-
Notifications
You must be signed in to change notification settings - Fork 0
/
gradient.h
36 lines (30 loc) · 1.38 KB
/
gradient.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* gradient.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tdarchiv <tdarchiv@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/02/23 16:57:31 by tdarchiv #+# #+# */
/* Updated: 2019/02/23 21:01:39 by tdarchiv ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef FRACTOL_GRADIENT_H
# define FRACTOL_GRADIENT_H
# include "rgb.h"
typedef struct s_grad_step
{
t_rgb color;
float treshold;
} t_grad_step;
typedef struct s_gradient
{
t_grad_step *step;
int step_count;
} t_gradient;
t_gradient create_gradient(int gradient_type);
void destroy_gradient(t_gradient gradient);
uint32_t get_color_from_gradient(t_gradient gradient, float percent);
void get_color_interval(t_gradient gradient, float percent,
t_grad_step *a, t_grad_step *b);
#endif