-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfractol.h
92 lines (84 loc) · 2.7 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* fractol.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ysingh <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/11/30 21:36:32 by ysingh #+# #+# */
/* Updated: 2022/12/09 17:18:16 by ysingh ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef FRACTOL_H
# define FRACTOL_H
# include "MLX42/include/MLX42/MLX42.h"
# include "libft/includes/libft.h"
# include <math.h>
# include <memory.h>
# include <stdio.h>
# include <stdlib.h>
# include <unistd.h>
# define WIDTH 600
# define HEIGHT 400
typedef struct s_rgb
{
double r;
double g;
double b;
} t_rgb;
typedef struct s_hsv
{
double h;
double s;
double v;
} t_hsv;
typedef struct s_pqt
{
double p;
double q;
double t;
} t_pqt;
typedef struct s_complex
{
double imagine;
double real;
} t_complex;
typedef struct s_data
{
int fractal;
int max_iter;
int rainbow;
double x_x;
double y_y;
double scale;
double v1;
double v2;
double hue_off;
t_complex *complex;
mlx_image_t *img;
mlx_t *mlx;
} t_data;
int ft_choose_fractal(char **argv, int argc, t_data *data);
double ft_mandelbrot(t_complex *complex, t_data *data);
void ft_draw_fractal(t_data *data);
int ft_fractal_color(double n, t_data *data);
t_complex *ft_create_complex(double real, double imagine);
void ft_complex_addnum(t_complex *n1, t_complex *n2);
void ft_complex_mul(t_complex *n1, t_complex *n2);
float ft_complex_module(t_complex *complex);
void ft_mouse(double x, double y, void *vdata);
uint32_t hsv2rgb(t_hsv hsv);
t_data ft_fractal_init(void);
void hook_move(struct mlx_key_data keydata, t_data *data);
void hook(struct mlx_key_data keydata, void *data);
double ft_julia(t_complex *c, t_complex *z0, t_data *data);
double ft_atof(char *str);
void fractol_julia(t_data *data, char **argv);
void ft_arg_error(mlx_t *mlx);
void ft_check_fractal(t_data *data, t_complex *complex, int x,
int y);
void fractol_mandelbrot(t_data *data, int argc);
int ft_is_double(char *str);
void ft_color_shift(void *param);
void ft_color_hook(struct mlx_key_data keydata, t_data *data);
#endif