20 char *out_fname = NULL;
23 float real, imaginary, width, step;
26 int xsize = 256, ysize = 256;
28 int oflag = 0, offset = 1, junk, verbose = 0;
33 register double z_r, z_i, z_rs, z_is;
38 "% v%- s%-xsize!dysize!d b%-band-scale!Fband-offset%d \n\
39 \to%-outfile!s real!f imag!f width!f",
41 &junk
, &xsize
, &ysize
,
42 &junk
, &scale
, &offset
,
44 &real
, &imaginary
, &width
))
47 step = width / (
double) xsize;
50 "Mandelbrot=set centered at (%g %g), width %g. Bands %g wide, offset %d.",
51 real, imaginary, width, scale, offset );
53 xpos = real - width / 2.0;
54 ypos = imaginary - (step / 2.0) * (
double) ysize;
63 out_hdr
.xmax = xsize - 1;
64 out_hdr
.ymax = ysize - 1;
78 for (y_pixel = 0; y_pixel < ysize; y_pixel++)
81 for (x_pixel = 0; x_pixel < xsize; x_pixel++)
86 stop = scale * 255 + offset;
88 ((z_rs = z_r * z_r) + (z_is = z_i * z_i)) < 4)
90 z_i = 2 * z_r*z_i + ypos;
91 z_r = z_rs - z_is + xpos;
97 iter = (iter - offset) / scale;
98 rows[0][x_pixel] = (
rle_pixel) (iter <= 0 ? 0 : iter);
103 if ((y_pixel % 50) == 0)
104 fprintf(stderr,
"line %d...\n", y_pixel);
FILE * rle_open_f(char *prog_name, char *file_name, char *mode)
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 rle_row_alloc(rle_hdr *the_hdr, rle_pixel ***scanp)
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)
const char * rle_putcom(char *value, rle_hdr *the_hdr) const
rle_hdr * rle_hdr_init(rle_hdr *the_hdr)
#define RLE_CHECK_ALLOC(pgm, ptr, name)