-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimage.c
41 lines (37 loc) · 1.36 KB
/
image.c
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* image.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rlechapt <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2015/01/19 21:54:27 by rlechapt #+# #+# */
/* Updated: 2015/01/19 23:02:53 by rlechapt ### ########.fr */
/* */
/* ************************************************************************** */
#include "fdf.h"
void draw_image(t_env *e, int x, int y)
{
ft_putnbr(x);
ft_putchar('\n');
ft_putnbr(y);
ft_putchar('\n');
// while (x >= 0 && x <= 1920 && y >= 0 && y <= 1080)
// {
e->p = y * e->sizeline + (e->bpp / 8) * x;
ft_memcpy(&e->data[e->p], &e->color, (e->bpp / 8));
// }
}
void ft_clear_image(t_env *e)
{
int x;
int y;
x = -1;
while (++x < 1920)
{
y = -1;
while (++y < 1080)
ft_memcpy(e->data + (y * e->sizeline) + (x * (e->bpp / 8)),
&e->black, e->bpp / 8);
}
}