42_cub3d/utils.h
2024-10-15 18:23:16 +02:00

44 lines
1.5 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* utils.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mcolonna <mcolonna@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/15 16:56:47 by mcolonna #+# #+# */
/* Updated: 2024/10/15 17:21:10 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef UTILS_H
# define UTILS_H
# include <linux/types.h>
typedef struct s_point_double
{
double x;
double y;
} t_point_double;
typedef struct s_point_int
{
int x;
int y;
} t_point_int;
// TODO Must the transparency be 0 or 255?
/// @brief Represents an TRGB color in 0xTTRRGGBB format.
typedef __u32 t_color;
/// @brief Convert a color from each color value to a t_color.
///
/// @param red Level of red from 0 to 255.
/// @param green Level of green from 0 to 255.
/// @param blue Level of blue from 0 to 255.
/// @return The result.
t_color color_from_rgb(int red, int green, int blue);
void write_err(const char *str, ...);
#endif