-
Notifications
You must be signed in to change notification settings - Fork 0
/
fractol_bonus.h
99 lines (92 loc) · 2.9 KB
/
fractol_bonus.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* fractol_bonus.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cnascime <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/02/15 08:01:01 by cnascime #+# #+# */
/* Updated: 2023/03/20 17:10:45 by cnascime ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef FRACTOL_BONUS_H
# define FRACTOL_BONUS_H
# include "libft/libft.h"
# include <math.h>
# define WINDOWNAME "fract'ol"
# define WINDOWWIDTH (800)
# define WINDOWHEIGHT (800)
# define MAXITERATIONS (200)
# define LEFTBUTTON (1)
# define SCROLLUP (4)
# define SCROLLDOWN (5)
# if __APPLE__
# include "libmlx/mlx.h"
# define LSD (2)
# define MIDDLEBUTTON (3)
# define CLOSE (17)
# define ESC (53)
# define LEFTARROW (123)
# define RIGHTARROW (124)
# define DOWNARROW (125)
# define UPARROW (126)
# elif __unix__
# include "libmlx_Linux/mlx.h"
# define MIDDLEBUTTON (2)
# define LSD (3)
# define CLOSE (33)
# define ESC (65307)
# define LEFTARROW (65361)
# define RIGHTARROW (65363)
# define DOWNARROW (65364)
# define UPARROW (65362)
# endif
typedef struct s_setup
{
void *mlx;
void *window;
void *image;
char *address;
char *type;
double x;
double y;
double zreal;
double zimag;
double creal;
double cimag;
double minreal;
double maxreal;
double medreal;
double medimag;
double minimag;
double maximag;
double iteration;
double r;
double g;
double b;
int palette;
int bitsperpixel;
int linelength;
int endian;
} t_setup;
void guide(void);
void load(t_setup *ol);
double fractal(t_setup *ol);
double mandelbrot(t_setup *ol, double creal, double cimag);
double julia1(t_setup *ol, double zreal, double zimag);
double julia2(t_setup *ol, double zreal, double zimag);
double julia3(t_setup *ol, double zreal, double zimag);
double julia4(t_setup *ol, double zreal, double zimag);
double julia5(t_setup *ol, double zreal, double zimag);
double tricorn(t_setup *ol, double creal, double cimag);
double burningship(t_setup *ol, double creal, double cimag);
void ft_pixelput(t_setup *ol, int x, int y, int colour);
int trgb(int t, int r, int g, int b);
void palette(t_setup *ol);
void splatter(t_setup *ol);
void paintbucket(t_setup *ol, double r, double g, double b);
void render(t_setup *ol);
int keypress(int pressed, t_setup *ol);
int buttonpress(int pressed, int x, int y, t_setup *ol);
int eject(t_setup *ol);
#endif