#include "fdf.h"

void	put_pixel_to_image(t_line *line, t_swap *s, t_FDF *FDF)
{
	int 	x;
	int 	y;

	x = line->p1.x;
	y = line->p1.y;
	if (s->swap_coord)
	{
		y = line->p1.x;
		x = line->p1.y;
	}
	if (x < 0 || y < 0 || x >= FDF->w_width || y >= FDF->w_height)
		return ;
	*(int *)((FDF->image_data + x * FDF->bpp / 8 + y * FDF->line_size)) =
			color_to_int(choose_color(line, s));
}

