#include "stdio.h"
#include "image.h"
#include "rle.h"
Go to the source code of this file.
|
| main (int argc, argv) |
|
| ctos (unsigned char *cptr, unsigned short *sptr, int n) |
|
ctos |
( |
unsigned char * |
cptr, |
|
|
unsigned short * |
sptr, |
|
|
int |
n |
|
) |
| |
Definition at line 35 of file rletoiris.c.
39 unsigned char *
rows[3];
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++) {
80 putrow(oimage,
sbuf,y,0);
82 putrow(oimage,
sbuf,y,1);
84 putrow(oimage,
sbuf,y,2);
int scanargs(int argc, char **argv, const char *format,...)
void rle_names(rle_hdr *the_hdr, const char *pgmname, const char *fname, int img_num)
#define RLE_CLR_BIT(glob, bit)
FILE * rle_open_f(const char *prog_name, const char *f_name, const char *mode)
char * cmd_name(char **argv)
void rle_get_setup_ok(rle_hdr *the_hdr, const char *prog_name, const char *file_name)
int rle_getrow(rle_hdr *the_hdr, rle_pixel *scanline[])
rle_hdr * rle_hdr_init(rle_hdr *the_hdr)
ctos(unsigned char *cptr, unsigned short *sptr, int n)