From 8db6918f320b792698f385bb2ea58ddd94cba6fe Mon Sep 17 00:00:00 2001 From: Charles Date: Mon, 24 Feb 2020 13:48:17 +0100 Subject: window_complex position buffer, basic palette, mandelbrot working --- src/helper.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/helper.c') diff --git a/src/helper.c b/src/helper.c index e69de29..f3b040b 100644 --- a/src/helper.c +++ b/src/helper.c @@ -0,0 +1,24 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* helper.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cacharle +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/02/24 11:54:57 by cacharle #+# #+# */ +/* Updated: 2020/02/24 12:17:08 by cacharle ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "fractol.h" + +void h_offset_to_complex(t_state *state, t_complex *z, int offset) +{ + int y; // unoptimized + int x; + + y = offset / state->window.width; + x = offset % state->window.width; + z->a = y / state->window.height * state->plane.a; + z->b = x / state->window.width * state->plane.b; +} -- cgit