38 rle_op backrundata[4], *rows[4];
39 char * outfilename = NULL;
40 static int numrundata[4] = { 1, 1, 1, 1};
41 float top_inten = 1.0 , bot_inten = 0.1, delta = 0;
42 unsigned char a, r, g, b;
46 int i, j, alpha = -1, red, green, blue;
47 int oflag = 0, sizeflag = 0, xsize = 512, ysize = 480, vbackflag = 0;
50 "% s%-xsize!dysize!d l%- v%-top%fbottom%f o%-outfile!s \n\
51 red!d green!d blue!d alpha%d",
52 &sizeflag
, &xsize
, &ysize
, &linear_ramp
, &vbackflag
,
53 &top_inten
, &bot_inten
, &oflag
, &outfilename
,
54 &red
, &green
, &blue
, &alpha
) == 0 )
65 if ((top_inten < 0.0) || (top_inten > 1.0) || (bot_inten < 0.0) ||
68 fprintf(stderr,
"background: -v bounds must be 0.0 to 1.0");
72 if (no_alpha_given = (alpha == -1))
78 backrundata[i]
.xloc = 0;
84 backrundata[0].u.run_val = alpha;
85 backrundata[1].u.run_val = red;
86 backrundata[2].u.run_val = green;
87 backrundata[3].u.run_val = blue;
90 delta = (top_inten - bot_inten) / ysize;
93 rows[i] = &(backrundata[i]);
97 the_hdr
.xmax = xsize - 1;
98 the_hdr
.ymax = ysize - 1;
103 scale = (top_inten - bot_inten) / (ysize * ysize);
105 for (j = 0; j < ysize; j++)
113 if (top_inten > bot_inten)
114 inten = scale * (
float) (j * j) + bot_inten;
116 inten = top_inten - (scale * (
float)
117 ((ysize - j) * (ysize - j)));
121 a = (
int) ((
float)alpha * inten);
123 r = (
int) ((
float)red * inten);
124 g = (
int) ((
float)green * inten);
125 b = (
int) ((
float)blue * inten);
126 backrundata[0].u.run_val = a;
127 backrundata[1].u.run_val = r;
128 backrundata[2].u.run_val = g;
129 backrundata[3].u.run_val = b;
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)
void rle_putraw(rle_op **scanraw, int *nraw, rle_hdr *the_hdr)
int scanargs(int argc, char **argv, const char *format,...)
void rle_puteof(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)