7 #ifndef __LLIPS_GENERAL_H
8 #define __LLIPS_GENERAL_H
13 #define OFFSET_SIGN 0x0000
14 #define OFFSET_IMG_P_DATA 0x000A
15 #define OFFSET_IMG_WIDTH 0x0012
16 #define OFFSET_IMG_HEIGHT 0x0016
17 #define OFFSET_IMG_DEPTH 0x001C
19 #define OFFSET_SIGN_size 2
20 #define OFFSET_IMG_P_DATA_size 4
21 #define OFFSET_IMG_WIDTH_size 4
22 #define OFFSET_IMG_HEIGHT_size 4
23 #define OFFSET_IMG_DEPTH_size 2
26 #define WIN_BMP 0x4D42
27 #define OFFSET_IMG_DATA_WIN24bit 0x0036
28 #define DEPTH_24bit 24
29 #define PIXEL_8bit_RANGE 255
46 #define ERR_NONE 0x0000
47 #define ERR_NOFILE 0x0001
48 #define ERR_NOT_WINBMP 0x0002
49 #define ERR_NOT_24bit 0x0003
50 #define ERR_TOO_WIDTH 0x0004
51 #define ERR_TOO_HEIGHT 0x0005
52 #define ERR_HEADER_TOO_BIG 0x0006
53 #define ERR_OPENFILE 0x0007
56 #define NO_DIFF 0x0000
57 #define DIFF_SIZE 0x0001
58 #define DIFF_BLUE 0x0002
59 #define DIFF_GREEN 0x0004
60 #define DIFF_RED 0x0008
61 #define DIFF_HIGH_QUANTITY 0x0010
64 #define FILTER_SIZE_USER 15
66 #if ((FILTER_SIZE_USER % 2) == 0)
67 #warning "Added 1 to FILTER_SIZE_USER"
68 #define FILTER_SIZE (FILTER_SIZE_USER + 1)
70 #define FILTER_SIZE FILTER_SIZE_USER
73 #define PI 3.141592653589793
80 #define GetBlue(c) 0xFF&(c)
81 #define GetGreen(c) 0xFF&(c>>8)
82 #define GetRed(c) 0xFF&(c>>16)
83 #define SetRGB(r,g,b) ((0xFF&r)<<16) | ((0xFF&g)<<8 ) | (0xFF&b)
CPU_INT16S create_laplacian_filter(CPU_FP64 **tab_filtre, CPU_INT08U filtertype)
Create a laplacian filter for edge detection (return matrix must have a size of 3 or 5) ...
CPU_VOID highlight_area(t_img *img, t_area *area, CPU_INT32U RGB)
Draw a rectangular area on image in a given color.
CPU_VOID init_area(t_area *area, CPU_INT16U maxwidth, CPU_INT16U maxheight)
Initialize an area from 0,0 to given values.
CPU_FP64 conv_gauss(CPU_INT16S x, CPU_INT16S y, CPU_FP64 sig)
Gaussian convolution, used to create gaussian filter.
CPU_VOID display_filter_value(CPU_FP64 **tab_filtre, CPU_INT08U filtersize)
Display values contained in a square filter.
CPU_CHAR apply_linfilter(t_img *img_in, CPU_FP64 **tab_filtre, CPU_INT16S filtersize, CPU_INT32U color, t_img *img_out)
Apply a predefined filter on the image.
t_area pixel_to_area(t_pixel pix)
Convert a pixel into a area of 1 x 1.
t_vect pixels_to_vector(t_pixel pix1, t_pixel pix2)
Convert two pixel into a vector.
CPU_INT16U vectormodule(t_vect vect)
Give module of a vector, in "pixel".
CPU_INT08U get_median(CPU_INT08U **table2D, CPU_INT16S filter_range, CPU_INT16S i, CPU_INT16S j)
Calcultate the median value of an area surrounding a pixel.
CPU_VOID display_img_value(t_img *img, CPU_INT16S colors)
Display each color of image in ascii.
t_vect highlight_line(t_img *img, t_pixel pix1, t_pixel pix2, CPU_INT32U RGB)
Draw a line on image in a given color.
CPU_CHAR histogram(t_img *img_in, t_img *img_out)
Create an image with a view of histogram (RGBY).
CPU_CHAR apply_median_filter(t_img *img_in, CPU_INT16S filtersize, t_img *img_out)
Apply a median filter on an image.
CPU_VOID create_average_filter(CPU_FP64 **tab_filtre, CPU_INT16S filtersize)
Create an average filter for smoothing.
unsigned short CPU_INT16U
CPU_CHAR luminance(t_img *img_in, t_img *img_out)
Create an image only luminance data (desaturated image)
CPU_VOID printf_area(t_area *area)
Display area corner coordonate in a console.
CPU_CHAR color_filter(t_img *img_in, t_img *img_out, CPU_INT32U color)
Create an image with only the color provided.
CPU_VOID create_gauss_filter(CPU_FP64 **tab_filtre, CPU_INT16S filtersize, CPU_FP64 sigma)
Create a Gaussian filter used to smooth and image.