header norm check

This commit is contained in:
Gregory Tertyshny 2017-03-24 19:59:25 +02:00
parent 91cd64dba8
commit bd7baf18bd

View file

@ -6,7 +6,7 @@
/* By: gtertysh <marvin@42.fr> +#+ +:+ +#+ */ /* By: gtertysh <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/16 20:59:04 by gtertysh #+# #+# */ /* Created: 2017/03/16 20:59:04 by gtertysh #+# #+# */
/* Updated: 2017/03/24 14:00:01 by gtertysh ### ########.fr */ /* Updated: 2017/03/24 19:58:43 by gtertysh ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -40,85 +40,84 @@
# define NUM_THREADS 24 # define NUM_THREADS 24
typedef struct s_complex
typedef struct s_complex
{ {
long double rl; long double rl;
long double im; long double im;
} t_complex; } t_complex;
typedef struct s_move typedef struct s_move
{ {
long double x; long double x;
long double y; long double y;
long double z; long double z;
} t_move; } t_move;
typedef struct s_color typedef struct s_color
{ {
int red; int red;
int grn; int grn;
int blu; int blu;
} t_color; } t_color;
typedef struct s_gradient typedef struct s_gradient
{ {
t_color grd[NUM_COLORS]; t_color grd[NUM_COLORS];
} t_gradient; } t_gradient;
typedef struct s_frac_data typedef struct s_frac_data
{ {
t_complex com_const; t_complex com_const;
t_gradient grd; t_gradient grd;
t_move mov; t_move mov;
int max_itr; int max_itr;
int com_rl_im_change; int com_rl_im_change;
int allow_mouse_change; int allow_mouse_change;
int frac_type; int frac_type;
} t_frac_data; } t_frac_data;
typedef struct s_image typedef struct s_image
{ {
void *ptr; void *ptr;
char *data; char *data;
int l_size; int l_size;
int end; int end;
int bpp; int bpp;
} t_image; } t_image;
typedef t_color (*frac_func)(t_frac_data *data, int x, int y); typedef t_color (*t_frac_func)(t_frac_data *data, int x, int y);
typedef struct s_fractol typedef struct s_fractol
{ {
void *mlx; void *mlx;
void *win; void *win;
t_frac_data *frac; t_frac_data *frac;
frac_func fr_funcs[3]; t_frac_func fr_funcs[3];
int w_height; int w_height;
int w_width; int w_width;
t_image *img; t_image *img;
} t_fractol; } t_fractol;
typedef struct s_thread_data typedef struct s_thread_data
{ {
t_fractol fr; t_fractol fr;
int y_start; int y_start;
int y_end; int y_end;
frac_func fractal_func; t_frac_func fractal_func;
} t_thread_data; } t_thread_data;
void quit(t_fractol *fractol); void quit(t_fractol *fractol);
void print_help(void); void print_help(void);
void parse_input(int ac, char **av); void parse_input(int ac, char **av);
t_color gradient(float value, t_gradient gradient); t_color gradient(float value, t_gradient gradient);
t_gradient default_gradient(void); t_gradient default_gradient(void);
t_gradient random_gradient(void); t_gradient random_gradient(void);
t_fractol *fractol_init(void *mlx, int frac_type); t_fractol *fractol_init(void *mlx, int frac_type);
int key_hook(int keycode, void *m); int key_hook(int keycode, void *m);
int mouse_move_hook( int x, int y, void *fr); int mouse_move_hook(int x, int y, void *fr);
int mouse_button_hook(int btn, int x, int y, void *fr); int mouse_button_hook(int btn, int x, int y, void *fr);
void put_pixel_to_image(int x, int y, t_color col, t_fractol *fr); void put_pixel_to_image(int x, int y, t_color col, t_fractol *fr);
@ -144,8 +143,8 @@ void move_down(t_fractol *fr);
void reset(t_fractol *fr); void reset(t_fractol *fr);
void change_limit_down(t_fractol *fr); void change_limit_down(t_fractol *fr);
void change_limit_up(t_fractol *fr); void change_limit_up(t_fractol *fr);
int change_real(t_fractol *fr, int x, int *start_x); int change_real(t_fractol *fr, int x, int *start_x);
int change_imagianry(t_fractol *fr, int x, int *start_x); int change_imagianry(t_fractol *fr, int x, int *start_x);
void gradient_hook(t_fractol *fr); void gradient_hook(t_fractol *fr);
#endif #endif