63 "% a%- h%-hdrsize!d o%-outfile!s xsize!d ysize!d files!*s\n(\
64 \tConvert one or more raw images to an RLE image.\n\
65 \t-a\tFirst input file is alpha channel. Normally first is red.\n\
66 \t-h\tSpecify number of bytes to discard from input header.\n\
67 \txsize ysize\tSize of input images.\n\
68 \tTry rawtorle for more complex situations.)",
84 inpfil = (FILE **)
malloc(
sizeof( FILE * ) * files );
85 for ( i=0; i<files; i++ )
87 inpfil[
i] =
rle_open_f(
"graytorle", fname[i],
"r" );
88 if ( inpfil[i] == stdin )
93 "%s: Can't use standard input for more than one file\n",
103 if ( hflag && (hsize > 0) )
105 trash = (
char *)
malloc( hsize );
107 for ( i=0; i<files; i++ )
108 fread( trash, 1, hsize, inpfil[i] );
122 out_hdr.
alpha = aflag;
123 out_hdr.
ncolors = files - aflag;
124 out_hdr.
xmax = xsize - 1;
125 out_hdr.
ymax = ysize - 1;
127 for ( i = -aflag; i<out_hdr.
ncolors; i++)
134 fprintf(stderr,
"%s: Ran out of heap space!!\n",
141 for ( row=0; row<
ysize; row++)
143 for ( i = -aflag; i<files-aflag; i++ )
144 fread( outrow[i], 1, xsize, inpfil[i+aflag] );
#define RLE_SET_BIT(glob, bit)
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)
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)
rle_hdr * rle_hdr_init(rle_hdr *the_hdr)