73 int add_extra_white_line = 0;
74 float heightinch = 3.0,
78 float x1, y1, x2, y2, widthinch;
79 unsigned char **
scan;
83 "% C%- s%- h%-height!f c%-center!f a%-aspect!f o%-outfile!s infile%s\n(\
84 \tConvert a URT RLE image to PostScript.\n\
85 \t-C\tOutput color PostScript.\n\
86 \t-s\t\"Scribe mode\", no showpage, center about 3.25\" at bottom.\n\
87 \t-h\tScale output to given height in inches.\n\
88 \t-c\tCenter at given distance from left (default 3.25\").\n\
89 \t-a\tPixel aspect ratio (default 1.0).)",
90 &
gencps, &sflag, &dummy, &heightinch, &
cflag, ¢er, &dummy,
91 &aspect, &
oflag, &outfname, &infname ) == 0 )
104 fprintf( stderr,
"%s is not RGB or b&w image",
105 infname ? infname :
"stdin" );
127 add_extra_white_line = 1;
132 buffer = (
unsigned char *)
malloc( nrow );
137 widthinch = (float) nrow * heightinch * aspect / (
float)
nscan;
140 x1 = center - widthinch / 2.0;
146 x1 = center - widthinch / 2.0;
149 x1 = 4.25 - widthinch / 2.0;
151 y1 = 11.0 - 1.0 - heightinch;
154 y2 = y1 + heightinch;
155 prologue(outfile,sflag,nscan,nrow,x1,y1,x2,y2);
162 for(pix = 0; pix <
nrow; pix ++) {
172 rgb_to_bw( scan[0], scan[1], scan[2], buffer, nrow );
173 for(pix = 0; pix <
nrow; pix ++)
177 if (add_extra_white_line)
178 for(i = 0; i < (
gencps ? 3 : 1); i++)
179 for(pix = 0; pix <
nrow; pix ++)
int scanargs(int argc, char **argv, const char *format,...)
int rle_row_alloc(rle_hdr *the_hdr, rle_pixel ***scanp)
void rgb_to_bw(rle_pixel *red_row, rle_pixel *green_row, rle_pixel *blue_row, rle_pixel *bw_row, int rowlen)
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)
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)