-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfractol.h
106 lines (93 loc) · 2.86 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* fractol.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: vsivanat <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/19 20:24:46 by vsivanat #+# #+# */
/* Updated: 2024/04/11 16:04:17 by vsivanat ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef FRACTOL_H
# define FRACTOL_H
# include "lib/libft/libft.h"
# include "lib/mlx-42/include/MLX42/MLX42.h"
# include <math.h>
# include <string.h>
typedef enum e_set
{
MANDELBROT,
JULIA,
BURNINGSHIP,
} t_set;
typedef struct s_fractol
{
double x;
double y;
double ca;
double cb;
char *fract_name;
double vertical_shift;
double horizontal_shift;
} t_fractol;
typedef struct s_px
{
double a;
double b;
double ca;
double cb;
double aa;
double bb;
int i;
} t_px;
typedef struct s_master
{
t_set set;
t_fractol *fract;
t_px *px;
mlx_t *mlx;
mlx_image_t *img;
int scale;
int iterations;
int8_t r;
int8_t g;
int8_t b;
} t_master;
# define WINDOW_X 1080
# define WINDOW_Y 720
# define MAX_ITERATIONS 40
# define MANDELBROT_R 0
# define MANDELBROT_G 5
# define MANDELBROT_B 0
# define MANDELBROT_SCALE 350
# define JULIA_R 0
# define JULIA_G 0
# define JULIA_B 5
# define JULIA_SCALE 300
# define BURNINGSHIP_R 0
# define BURNINGSHIP_G 5
# define BURNINGSHIP_B 5
# define BURNINGSHIP_SCALE 300
void mandelbrot(t_master *master);
void julia(t_master *master);
void buringship(t_master *master);
void loop_img_mandelbrot(t_master *master);
void loop_img_julia(t_master *master);
void loop_img_buringship(t_master *master);
void presettings(t_master *master);
void key_pres(mlx_key_data_t key_data, void *data);
void key_move(t_master *master, mlx_key_data_t key_data);
void key_iterations(t_master *master, mlx_key_data_t key_data);
void key_move(t_master *master, mlx_key_data_t key_data);
void key_pres_julia(t_master *master, mlx_key_data_t key_data);
void clear_px(t_master *master);
int valid_params(char *input);
void julia_settings(int argc, char **argv, t_master *master);
void which_fract(int argc, char **argv, t_master *master);
void usage(void);
void close_window(void *param);
int get_grey(int grey, int a);
int get_rgb_a(int i, int a, t_master *master);
void mouseaction(double a, double b, void *params);
#endif