43 int xsize, ysize, zsize;
44 unsigned char *rows[3];
45 char *infname = NULL, *outfname = NULL;
47 if (
scanargs( argc
, argv
, "% o%-outfile.rle!s, infile.rgb!s\n\
48 (Convert SGI image in infile.rgb to URT RLE image in outfile.rle.)",
49 &i
, &outfname
, &infname
) == 0 )
53 image=iopen(infname,
"r");
55 fprintf(stderr,
"%s: can't open input file %s\n",cmd_name(argv),infname);
69 rows[0] = (
unsigned char *)malloc(xsize*
sizeof(
unsigned char));
70 rows[1] = (
unsigned char *)malloc(xsize*
sizeof(
unsigned char));
71 rows[2] = (
unsigned char *)malloc(xsize*
sizeof(
unsigned char));
88 for(y=0; y<ysize; y++) {
90 getrow(image,rbuf,y,0);
91 stoc(rbuf,rows[0],xsize);
92 stoc(rbuf,rows[1],xsize);
93 stoc(rbuf,rows[2],xsize);
95 getrow(image,rbuf,y,0);
96 getrow(image,gbuf,y,1);
97 getrow(image,bbuf,y,2);
98 stoc(rbuf,rows[0],xsize);
99 stoc(gbuf,rows[1],xsize);
100 stoc(bbuf,rows[2],xsize);
111 register unsigned short *sptr;
112 register unsigned char *cptr;
FILE * rle_open_f(char *prog_name, char *file_name, char *mode)
#define RLE_SET_BIT(glob, bit)
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 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)
void rle_put_setup(rle_hdr *the_hdr)
rle_hdr * rle_hdr_init(rle_hdr *the_hdr)