45 char *
infname = NULL, *outfname = NULL;
56 rle_pixel *ptr0, *ptr1, *ptrout, *alphptr;
62 if (
scanargs( argc, argv,
"% o%-outfile!s infile%s",
63 &oflag, &outfname, &infname ) == 0 )
81 if ( (in_hdr.
xmax - in_hdr.
xmin) % 2 == 0 )
84 new_xlen = (in_hdr.
xmax - in_hdr.
xmin + 1 ) / 2;
85 new_ylen = (in_hdr.
ymax - in_hdr.
ymin + 2 ) / 2;
88 out_hdr.
xmax = out_hdr.
xmin + new_xlen - 1;
89 out_hdr.
ymax = out_hdr.
ymin + new_ylen - 1;
103 for ( j = 0; j < new_ylen*2; j+=2 )
110 ptr0 = &(rows0[chan][in_hdr.
xmin]);
111 ptr1 = &(rows1[chan][in_hdr.
xmin]);
112 ptrout = rowsout[chan];
124 bzero(alphptr, new_xlen);
126 else for( i = 0; i < new_xlen; i++)
130 *alphptr |= (*ptr0 ? 1 : 0) | (ptr0[1] ? 2 : 0) |
131 (*ptr1 ? 4 : 0) | (ptr1[1] ? 8 : 0);
134 if (chan == (in_hdr.
ncolors - 1))
139 A = (
int) *ptr0++ + (
int) *ptr1++;
140 A += (
int) *ptr0++ + (
int) *ptr1++;
#define RLE_SET_BIT(glob, bit)
void rle_row_free(rle_hdr *the_hdr, rle_pixel **scanp)
int scanargs(int argc, char **argv, const char *format,...)
int rle_row_alloc(rle_hdr *the_hdr, rle_pixel ***scanp)
void rle_putrow(rle_pixel *rows[], int rowlen, rle_hdr *the_hdr)
void rle_addhist(char *argv[], rle_hdr *in_hdr, rle_hdr *out_hdr)
void rle_puteof(rle_hdr *the_hdr)
void rle_names(rle_hdr *the_hdr, const char *pgmname, const char *fname, int img_num)
int rle_get_setup(rle_hdr *the_hdr)
int rle_get_error(int code, const char *pgmname, const char *fname)
unsigned int rle_getskip(rle_hdr *the_hdr)
rle_hdr * rle_hdr_cp(rle_hdr *from_hdr, rle_hdr *to_hdr)
FILE * rle_open_f(const char *prog_name, const char *f_name, const char *mode)
void rle_put_setup(rle_hdr *the_hdr)
char * cmd_name(char **argv)
int rle_getrow(rle_hdr *the_hdr, rle_pixel *scanline[])
#define RLE_CHECK_ALLOC(pgm, ptr, name)
rle_hdr * rle_hdr_init(rle_hdr *the_hdr)