-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwrite_on_img.c
26 lines (23 loc) · 1.21 KB
/
write_on_img.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* write_on_img.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: qchevrin <qchevrin@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2014/03/17 14:42:34 by qchevrin #+# #+# */
/* Updated: 2014/03/25 20:02:07 by vwatrelo ### ########.fr */
/* */
/* ************************************************************************** */
#include "raytracer.h"
#include "client.h"
void write_on_img(t_param *param, int color, int i, int j)
{
unsigned int value;
char *tmp;
t_img *img;
img = &(param->v_img);
value = my_mlx_get_color_value(color, img->decrgb, img->depth);
tmp = img->addr + (img->line * i) + (j * (img->bpp / 8));
ft_memcpy(tmp, &value, img->bpp / 8);
}