-
Notifications
You must be signed in to change notification settings - Fork 0
/
fractol.h
112 lines (99 loc) · 3.25 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
107
108
109
110
111
112
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* fractol.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: abiriuk <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/09/12 16:36:24 by abiriuk #+# #+# */
/* Updated: 2018/10/10 17:59:42 by abiriuk ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef FRACTOL_H
# define FRACTOL_H
# include <math.h>
# include "mlx.h"
# define HOR 1200
# define VER 1200
# define MOVE 25
typedef struct s_win
{
void *mlx_ptr;
void *win_ptr;
} t_win;
typedef struct s_pic
{
int pix_mas;
int line_mas;
void *img_ptr;
int pic_strt;
int img_mas;
int *img_arr;
} t_pic;
typedef struct s_num
{
int x;
int y;
double c_re;
double c_im;
} t_num;
typedef struct s_start_end
{
double min_re;
double max_re;
double min_im;
double max_im;
} t_start_end;
typedef struct s_all
{
t_win win_str;
t_num move;
t_pic *picture;
t_start_end zoom;
t_num mouse;
t_num fix;
int fix_num;
int itter;
double re_fact;
double im_fact;
} t_all;
typedef struct s_fact
{
double re_fact;
double im_fact;
} t_fact;
int exit_x(void *par);
int exit_esc(int keycode, void *param);
void wind(t_all *all, t_pic *pic);
void put_pix(int answer, t_num num, t_all *all);
int mandelbrot(t_num num, int itter);
void change_px(t_pic *picture, t_all *all);
int set_col(int res, int itter);
int move(int keycode, void *all);
int mouse(int button, int x, int y, void *param);
int motion(int x, int y, void *param);
t_num transform_pix(int i, t_all *all);
void change_mot(t_pic *picture, t_all *all);
void change_clt(t_pic *picture, t_all *all);
int move_clt(int keycode, void *alli);
void change_clt(t_pic *picture, t_all *all);
int mouse_clt(int button, int x, int y, void *param);
void cover_clt(t_all *all, t_pic *pic);
void cover_px(t_all *all, t_pic *pic);
void change_hrt(t_pic *picture, t_all *all);
int mouse_hrt(int button, int x, int y, void *param);
int move_hrt(int keycode, void *alli);
void cover_hrt(t_all *all, t_pic *pic);
int precision(int keycode, void *alli);
int mouse_jul(int button, int x, int y, void *param);
int move_jul(int keycode, void *alli);
void change_tri(t_pic *picture, t_all *all);
int move_tri(int keycode, void *alli);
int mouse_tri(int button, int x, int y, void *param);
void cover_tri(t_all *all, t_pic *pic);
double interpolate(double start, double end, double inter);
void change_buf(t_pic *picture, t_all *all);
int move_buf(int keycode, void *alli);
int mouse_buf(int button, int x, int y, void *param);
void cover_buf(t_all *all, t_pic *pic);
#endif