diff --git a/src/main.c b/src/main.c index 1695c83..10661f4 100644 --- a/src/main.c +++ b/src/main.c @@ -3,20 +3,10 @@ #include #include "image.h" +#include "mandelbrot.h" #include "options.h" #include "ppm.h" -static void fill_image(struct image *image) { - for (size_t i = 0; i < image->h; ++i) { - for (size_t j = 0; j < image->w; ++j) { - struct pixel *p = &image->buf[to_index(i, j, image)]; - p->r = 255 * i / image->h; - p->g = 255 * j / image->w; - p->g = 255 * (i + j) / (image->h + image->w); - } - } -} - int main(int argc, char *argv[]) { struct options opt = parse_options(&argc, &argv); @@ -24,7 +14,7 @@ int main(int argc, char *argv[]) { if (!image) err(EXIT_FAILURE, "could not allocate image"); - fill_image(image); + mandelbrot(image, 100); print_ppm(image, opt.output); fclose(opt.output);