From b6882bf52c2484d0452389a0778b7ac10a107b52 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Tue, 10 Nov 2020 18:23:14 +0100 Subject: [PATCH] replace dummy output with actual mandelbrot --- src/main.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) 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);