39 unsigned char *rows[3];
40 int i, y, xsize, ysize;
43 char *infname = NULL, *outfname = NULL;
46 if (
scanargs( argc
, argv
, "% o!-outimage.rgb!s in.rle%s\n(\
47 Convert URT RLE image in in.rle to SGI image format in outimage.rgb.\n\
48 Must specify -o outimage.rgb.)",
49 &i
, &outfname
, &infname
) == 0 )
61 fprintf(stderr,
"%s: input image must have 3 channels\n",
hdr.cmd);
69 oimage = iopen(outfname,
"w",RLE(1),3,xsize,ysize,3);
72 rows[0] = (
unsigned char*)malloc(xsize);
73 rows[1] = (
unsigned char*)malloc(xsize);
74 rows[2] = (
unsigned char*)malloc(xsize);
77 for(y=0; y<ysize; y++) {
79 ctos(rows[0],
sbuf,xsize);
80 putrow(oimage,sbuf,y,0);
81 ctos(rows[1],
sbuf,xsize);
82 putrow(oimage,sbuf,y,1);
83 ctos(rows[2],
sbuf,xsize);
84 putrow(oimage,sbuf,y,2);
93 register unsigned char *cptr;
94 register unsigned short *sptr;
FILE * rle_open_f(char *prog_name, char *file_name, char *mode)
void rle_names(rle_hdr *the_hdr, const char *pgmname, const char *fname, int img_num)
char * cmd_name(char **argv)
void main(int argc, char **argv)
int rle_getrow(rle_hdr *the_hdr, scanline)
int scanargs(int argc, char **argv, const char *format,...)
void rle_get_setup_ok(rle_hdr *the_hdr, const char *prog_name, const char *file_name)
#define RLE_CLR_BIT(glob, bit)
rle_hdr * rle_hdr_init(rle_hdr *the_hdr)