-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfract_ol.h
86 lines (73 loc) · 2.39 KB
/
fract_ol.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* fract_ol.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mbrement <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/02/03 15:34:08 by mbrement #+# #+# */
/* Updated: 2023/02/23 13:23:09 by mbrement ### ########lyon.fr */
/* */
/* ************************************************************************** */
#ifndef FRACT_OL_H
# define FRACT_OL_H
# include "./Mini_libx/mlx.h"
# include <fcntl.h>
# include <math.h>
# include <unistd.h>
# include <stdlib.h>
# include "./Tools/Libft/libft.h"
# define WIN_W 1500
# define WIN_H 750
typedef struct s_complex {
float x;
float y;
} t_complex;
typedef struct s_data{
void *img;
char *addr;
int bits_per_pixel;
int line_length;
int endian;
} t_data;
typedef struct s_fract{
int fractal_nb;
int value;
void *mlx;
void *window;
float zoom;
float off_y;
float off_x;
float zoom_o;
float off_y_o;
float off_x_o;
int color;
int mouse;
struct s_complex x;
struct s_complex x_o;
struct s_complex y;
struct s_data *data;
} t_fract;
//PROJECT_CORE
void algo_init(int value, int fractal_nb);
int hook(int key, t_fract *fract);
int hook_mouse(int key, int x, int y, t_fract *fract);
unsigned int ft_color(int color, struct s_fract *value);
void my_mlx_pixel_put(t_data *data, int x, int y,
unsigned int color);
int loop(void *fractal);
//MATH
void algo_julia(struct s_fract *value);
void algo_mandelbrot(struct s_fract *value);
t_complex add_complex(t_complex a, t_complex b);
t_complex algo_cplx(t_complex a, t_complex b);
t_complex mult_cplx(t_complex a, t_complex b);
float module_cplx_pow2(t_complex z);
void mult_cplx2(t_complex *a);
//PARSER
int parser(int arg_c, char **arg_v);
//ERR0R
void ft_error(int error_code);
void end_of_prog(t_fract *value);
int on_destroy(struct s_fract *fractal);
#endif