30 static char rcs_ident[] =
"$Header: /l/spencer/src/urt/tools/RCS/avg4.c,v 3.0.1.4 1992/04/30 14:08:43 spencer Exp $";
37 static bit_count[16] = {0, 63, 63, 127, 63, 127, 127,
38 192, 63, 127, 127, 192, 127, 192, 192, 255};
45 char *infname = NULL, *outfname = NULL;
49 FILE *outfile = stdout;
54 rle_hdr in_hdr, out_hdr;
56 rle_pixel *ptr0, *ptr1, *ptrout, *alphptr;
63 &oflag
, &outfname
, &infname
) == 0 )
84 new_xlen = (in_hdr
.xmax - in_hdr
.xmin + 1 ) / 2;
85 new_ylen = (in_hdr
.ymax - in_hdr
.ymin + 2 ) / 2;
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);
139 A = (
int) *ptr0++ + (
int) *ptr1++;
140 A += (
int) *ptr0++ + (
int) *ptr1++;
FILE * rle_open_f(char *prog_name, char *file_name, char *mode)
#define RLE_SET_BIT(glob, bit)
rle_hdr * rle_hdr_cp(rle_hdr *from_hdr, rle_hdr *to_hdr)
void rle_names(rle_hdr *the_hdr, const char *pgmname, const char *fname, int img_num)
void rle_row_free(rle_hdr *the_hdr, rle_pixel **scanp)
char * cmd_name(char **argv)
void main(int argc, char **argv)
int rle_get_setup(rle_hdr *the_hdr)
int rle_row_alloc(rle_hdr *the_hdr, rle_pixel ***scanp)
int rle_getrow(rle_hdr *the_hdr, scanline)
int rle_get_error(int code, const char *pgmname, const char *fname)
int scanargs(int argc, char **argv, const char *format,...)
void rle_puteof(rle_hdr *the_hdr)
void rle_putrow(rows, int rowlen, rle_hdr *the_hdr)
void rle_addhist(argv, rle_hdr *in_hdr, rle_hdr *out_hdr)
unsigned int rle_getskip(rle_hdr *the_hdr)
void rle_put_setup(rle_hdr *the_hdr)
rle_hdr * rle_hdr_init(rle_hdr *the_hdr)
#define RLE_CHECK_ALLOC(pgm, ptr, name)