-
Notifications
You must be signed in to change notification settings - Fork 0
/
fractol.h
89 lines (81 loc) · 2.37 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* fractol.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: sel-hano <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/07/14 03:26:17 by sel-hano #+# #+# */
/* Updated: 2023/07/27 00:19:49 by sel-hano ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef FRACTOL_H
# define FRACTOL_H
# include <stdlib.h>
# include <mlx.h>
# include <math.h>
# include <unistd.h>
# include <stdio.h>
# include <stdbool.h>
# define WIDTH 800
# define HEIGHT 800
# define MAX_ITER 200
# define ESCAPE_RADIUS 2.0
# define ESC_KEY 53
# define MOUSE_LEFT 1
# define ARROW_UP 126
# define ARROW_DOWN 125
# define ARROW_LEFT 123
# define ARROW_RIGHT 124
typedef struct s_complex
{
double real;
double imaginary;
}t_complex;
typedef struct s_data {
t_complex c;
void *img;
char *addr;
void *mlx_ptr;
void *win_ptr;
int bits_per_pixel;
int size_line;
int endian;
double min_x;
double max_x;
double min_y;
double max_y;
double zoom_factor;
double x_holder;
double y_holder;
double step_size;
double center_x;
double center_y;
int iterations;
int color;
int x;
int y;
char *s;
int fraction_length;
double result;
double fraction;
int negative;
}t_data;
typedef enum s_fractals
{
mandelbrot = 1,
julia,
mandeljul,
}t_fractals;
void ft_mlx_pixel_put(t_data *data, int x, int y, int color);
int ft_strcmp(const char *s1, const char *s2);
void fractals_rendring(t_data *init);
int handle_mouse_wheel(int button, int x, int y, t_data *init);
int handle_keys_press(int button, t_data *init);
int button_cross(t_data *init);
int check_julia_args(t_data *init, char *av[], int ac);
void ft_error(int ac, char *av[]);
void zoom_in(t_data *init);
void zoom_out(t_data *init);
char *mini_atod(t_data *init, const char *str);
#endif