-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfractol.h
77 lines (70 loc) · 2.52 KB
/
fractol.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* fractol.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mmouhiid <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/12/20 03:40:40 by mmouhiid #+# #+# */
/* Updated: 2024/01/03 17:04:41 by mmouhiid ### ########.fr */
/* */
/* ************************************************************************** */
#include <math.h>
#include <unistd.h>
#include <stdlib.h>
#include <mlx.h>
#include "libft/libft.h"
#define ERROR_MSG "usage:\n\tmandelbrot\n\tjulia <r> <i>\n\tburningship\n"
#define WIN_HEIGHT 800
#define WIN_WIDTH 800
typedef struct vars
{
long double x;
long double y;
long double x2;
long double y2;
long double r;
int iteration;
} t_vars;
typedef struct s_image
{
void *img;
char *addr;
int bits_per_pixel;
int line_length;
int endian;
} t_image;
typedef struct s_program
{
void *mlx;
void *win;
char *fractol_type;
int color_pallete;
int max_iteration;
long double right_x;
long double left_x;
long double top_y;
long double bottom_y;
long double c_x;
long double c_y;
t_image *img;
} t_program;
long double ft_atoildbl(char *str);
int exit_handler(t_program *program);
int ft_strcmp(char *s1, char *s2);
void opt_mlx_pixel_put(t_image *img, int x, int y, int color);
long double scale(long double number, long double inMax,
long double outMin, long double outMax);
int close_window(t_program *param);
void key_hook_helper(int keycode, t_program *program,
long double offset);
int key_hook(int keycode, t_program *program);
int mouse_hook(int keycode, int x, int y, t_program *program);
int render_fractor(t_program *program);
int get_color(int iteration, int max_iteration, int color_pallete);
int generate_color(t_program *program, long double xo, long double yo);
int is_valid_double(char *str);
void fractol_init(t_program *program, char **argv);
int get_color(int iteration, int max_iteration, int color_pallete);
void key_hook_helper(int keycode, t_program *program,
long double offset);