-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfdf.h
More file actions
115 lines (105 loc) · 3.22 KB
/
fdf.h
File metadata and controls
115 lines (105 loc) · 3.22 KB
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
113
114
115
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* fdf.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gemerald <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/11/10 12:40:10 by gemerald #+# #+# */
/* Updated: 2019/11/23 18:06:35 by gemerald ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef FDF_H
# define FDF_H
# include "libft/libft.h"
# include <math.h>
# include <fcntl.h>
# include <unistd.h>
# include <stdlib.h>
# include "mlx.h"
typedef struct s_mlw
{
void *mlx_ptr;
void *window;
void *map;
char *img_sourse;
} t_mlw;
typedef struct s_mouse
{
int prev_x;
int prev_y;
int x;
int y;
int left_press;
} t_mouse;
typedef struct s_vizor
{
int zoom;
int z_shift;
int x_shift;
int y_shift;
} t_vizor;
typedef struct s_rot
{
double alpha;
double beta;
double tetta;
} t_rot;
typedef struct s_point
{
int ***axis;
int max_x;
int max_y;
int bits_pp;
int size_line;
int endian;
int min_z;
int max_z;
char *img_sourse;
void *mlx_ptr;
void *window;
void *map;
t_mouse mouse;
t_vizor vizor;
int projection;
t_rot rot;
} t_point;
typedef struct s_pix
{
int x;
int y;
int z;
int color;
} t_pix;
int ***char_to_point(char *str);
void find_xy_interval(t_point *half);
double percent(int start, int end, int current);
void edge_of_abyss(int ***spl, int *min, int *max);
void make_first_color(int ****axis, int min, int max);
void incr_z(t_point *changed, int count, int mark);
void set_hooks(t_point *half);
int draw_point(t_point *half);
void rot_x(int *y, int *z, double alpha);
void rot_y(int *x, int *z, double beta);
void rot_z(int *x, int *y, double tetta);
void rotation(int flag, int *y, int *x, int *z, t_rot rot);
void iso_draw(int *x, int *y, int z);
void charge_draw(t_pix *dot, t_point *half);
void zero_to_vizor(t_point *half);
void zero_to_rot(t_rot *rot);
void zero_to_half(t_point *half, char *input);
char *ft_undin(int fd);
int get_color(t_pix present, t_pix start, t_pix end,\
t_pix delta);
void pixel_to_image(t_point *half, int x, int y, int color);
t_pix complect_t_pix(t_point *half, int x, int y);
void drawline(t_pix start, t_pix end, t_point *half);
int first_color(int z, int max_z, int min_z);
int spl_is_number(char c);
int mouse_press_hook(int key, int x, int y, void *param);
int motion_hook(int x, int y, void *param);
int mouse_release_hook(int key, int x, int y, void *param);
void free_to_axis(int ****spl);
void init_var_draw(t_pix *delta, t_pix *sign,\
t_pix start, t_pix end);
#endif