-
Notifications
You must be signed in to change notification settings - Fork 0
/
put_tag.c
41 lines (38 loc) · 1.44 KB
/
put_tag.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* put_tag.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mlegendr <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2014/11/06 10:52:11 by mlegendr #+# #+# */
/* Updated: 2014/12/08 16:59:52 by mlegendr ### ########.fr */
/* */
/* ************************************************************************** */
#include "wolf3d.h"
void put_tag(t_mlx_image_8u *input, t_mlx_image_8u *output, t_roi roi,
t_pixel_8u color)
{
int x;
int y;
t_pixel_8u px;
y = roi.y;
while (y < roi.height + roi.y)
{
x = roi.x;
while (x < roi.width + roi.x)
{
if (x >= 0 && y >= 0 && x < output->width && y < output->height)
{
px = get_pixel_8u(input, (double)(x - roi.x) /
(double)roi.width * (double)input->width,
(double)(y - roi.y) /
(double)roi.height * (double)input->height);
if (px.alpha != 255)
pixel_8u(output, x, y, color);
}
++x;
}
++y;
}
}