39 float maxval, tmp, expnt, tmp_max;
40 char *infilename = NULL, *outfilename = NULL;
45 if (
scanargs(argc, argv,
"% v%- p%- s%- m%-maxval!f o%-outfile!s infile!s",
46 &verbose_flag, &print_flag, &scan_flag, &max_flag, &maxval,
47 &oflag, &outfilename, &infilename ) == 0)
56 for ( rle_cnt = 0; ; rle_cnt++ )
59 if ( start < 0 && !max_flag && !scan_flag )
62 "%s: Can't pipe input unless either -m or -s is given.\n",
71 fprintf(stderr,
"%s: warning - no exponential_data comment\n",
77 "%s: File does not contain exponent channel.\n",
91 if ((verbose_flag) && (y % 100) == 0)
92 fprintf(stderr,
"Scanning row %d...\n", y);
104 maxval =
MAX( maxval, tmp );
107 if (scan_flag || print_flag || verbose_flag)
108 fprintf(stderr,
"Maximum value: %1.8g\n", maxval);
110 if (scan_flag) exit(0);
148 if (((y % 100) == 0) && verbose_flag)
149 fprintf(stderr,
"Processing row %d...\n", y);
158 expnt = ldexp( 1/256.0,
in_rows[RLE_EXPONENT][x] - 127 );
163 tmp = expnt / maxval * tmp_max;
190 fprintf(stderr,
"%s: %d bytes truncated (sorry...)\n",
void rle_row_free(rle_hdr *the_hdr, rle_pixel **scanp)
int scanargs(int argc, char **argv, const char *format,...)
char * rle_getcom(const char *name, rle_hdr *the_hdr)
int rle_row_alloc(rle_hdr *the_hdr, rle_pixel ***scanp)
const char * rle_delcom(const char *name, rle_hdr *the_hdr)
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)
int rle_get_setup(rle_hdr *the_hdr)
int rle_get_error(int code, const char *pgmname, const char *fname)
rle_hdr * rle_hdr_cp(rle_hdr *from_hdr, rle_hdr *to_hdr)
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)
int rle_getrow(rle_hdr *the_hdr, rle_pixel *scanline[])
#define RLE_CHECK_ALLOC(pgm, ptr, name)
rle_hdr * rle_hdr_init(rle_hdr *the_hdr)