LLIPS
rev33
Light Library for Image ProcesS
|
About general image handling. More...
Go to the source code of this file.
Macros | |
#define | OFFSET_SIGN 0x0000 |
#define | OFFSET_IMG_P_DATA 0x000A |
#define | OFFSET_IMG_WIDTH 0x0012 |
#define | OFFSET_IMG_HEIGHT 0x0016 |
#define | OFFSET_IMG_DEPTH 0x001C |
#define | OFFSET_SIGN_size 2 |
#define | OFFSET_IMG_P_DATA_size 4 |
#define | OFFSET_IMG_WIDTH_size 4 |
#define | OFFSET_IMG_HEIGHT_size 4 |
#define | OFFSET_IMG_DEPTH_size 2 |
#define | PIXEL_size 1 |
#define | WIN_BMP 0x4D42 |
#define | OFFSET_IMG_DATA_WIN24bit 0x0036 |
#define | DEPTH_24bit 24 |
#define | PIXEL_8bit_RANGE 255 |
#define | BLUE 0x0001 |
#define | GREEN 0x0010 |
#define | RED 0x0100 |
#define | HEADER 0x1000 |
#define | ERR_NONE 0x0000 |
#define | ERR_NOFILE 0x0001 |
#define | ERR_NOT_WINBMP 0x0002 |
#define | ERR_NOT_24bit 0x0003 |
#define | ERR_TOO_WIDTH 0x0004 |
#define | ERR_TOO_HEIGHT 0x0005 |
#define | ERR_HEADER_TOO_BIG 0x0006 |
#define | ERR_OPENFILE 0x0007 |
#define | NO_DIFF 0x0000 |
#define | DIFF_SIZE 0x0001 |
#define | DIFF_BLUE 0x0002 |
#define | DIFF_GREEN 0x0004 |
#define | DIFF_RED 0x0008 |
#define | DIFF_HIGH_QUANTITY 0x0010 |
#define | FILTER_SIZE_USER 15 |
#define | FILTER_SIZE FILTER_SIZE_USER |
#define | PI 3.141592653589793 |
#define | GetBlue(c) 0xFF&(c) |
#define | GetGreen(c) 0xFF&(c>>8) |
#define | GetRed(c) 0xFF&(c>>16) |
#define | SetRGB(r, g, b) ((0xFF&r)<<16) | ((0xFF&g)<<8 ) | (0xFF&b) |
Typedefs | |
typedef enum te_color | e_color |
Enumerations | |
enum | te_color { c_Red = 0, c_Green = 1, c_Blue = 2, c_color_size } |
Functions | |
CPU_VOID | display_img_value (t_img *img, CPU_INT16S colors) |
Display each color of image in ascii. More... | |
CPU_VOID | init_area (t_area *area, CPU_INT16U maxwidth, CPU_INT16U maxheight) |
Initialize an area from 0,0 to given values. More... | |
CPU_VOID | highlight_area (t_img *img, t_area *area, CPU_INT32U RGB) |
Draw a rectangular area on image in a given color. More... | |
CPU_VOID | printf_area (t_area *area) |
Display area corner coordonate in a console. More... | |
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. More... | |
t_area | pixel_to_area (t_pixel pix) |
Convert a pixel into a area of 1 x 1. More... | |
t_vect | pixels_to_vector (t_pixel pix1, t_pixel pix2) |
Convert two pixel into a vector. More... | |
CPU_INT16U | vectormodule (t_vect vect) |
Give module of a vector, in "pixel". More... | |
CPU_CHAR | color_filter (t_img *img_in, t_img *img_out, CPU_INT32U color) |
Create an image with only the color provided. More... | |
CPU_CHAR | histogram (t_img *img_in, t_img *img_out) |
Create an image with a view of histogram (RGBY). More... | |
CPU_CHAR | luminance (t_img *img_in, t_img *img_out) |
Create an image only luminance data (desaturated image) More... | |
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. More... | |
CPU_FP64 | conv_gauss (CPU_INT16S x, CPU_INT16S y, CPU_FP64 sig) |
Gaussian convolution, used to create gaussian filter. More... | |
CPU_VOID | create_gauss_filter (CPU_FP64 **tab_filtre, CPU_INT16S filtersize, CPU_FP64 sigma) |
Create a Gaussian filter used to smooth and image. More... | |
CPU_VOID | create_average_filter (CPU_FP64 **tab_filtre, CPU_INT16S filtersize) |
Create an average filter for smoothing. More... | |
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) More... | |
CPU_CHAR | apply_median_filter (t_img *img_in, CPU_INT16S filtersize, t_img *img_out) |
Apply a median filter on an image. More... | |
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. More... | |
CPU_VOID | display_filter_value (CPU_FP64 **tab_filtre, CPU_INT08U filtersize) |
Display values contained in a square filter. More... | |
About general image handling.
Definition in file llips_general.h.
#define BLUE 0x0001 |
Definition at line 32 of file llips_general.h.
#define DEPTH_24bit 24 |
Definition at line 28 of file llips_general.h.
#define DIFF_BLUE 0x0002 |
Definition at line 58 of file llips_general.h.
#define DIFF_GREEN 0x0004 |
Definition at line 59 of file llips_general.h.
#define DIFF_HIGH_QUANTITY 0x0010 |
Definition at line 61 of file llips_general.h.
#define DIFF_RED 0x0008 |
Definition at line 60 of file llips_general.h.
#define DIFF_SIZE 0x0001 |
Definition at line 57 of file llips_general.h.
#define ERR_HEADER_TOO_BIG 0x0006 |
Definition at line 52 of file llips_general.h.
#define ERR_NOFILE 0x0001 |
Definition at line 47 of file llips_general.h.
#define ERR_NONE 0x0000 |
Definition at line 46 of file llips_general.h.
#define ERR_NOT_24bit 0x0003 |
Definition at line 49 of file llips_general.h.
#define ERR_NOT_WINBMP 0x0002 |
Definition at line 48 of file llips_general.h.
#define ERR_OPENFILE 0x0007 |
Definition at line 53 of file llips_general.h.
#define ERR_TOO_HEIGHT 0x0005 |
Definition at line 51 of file llips_general.h.
#define ERR_TOO_WIDTH 0x0004 |
Definition at line 50 of file llips_general.h.
#define FILTER_SIZE FILTER_SIZE_USER |
Definition at line 70 of file llips_general.h.
#define FILTER_SIZE_USER 15 |
Definition at line 64 of file llips_general.h.
#define GetBlue | ( | c | ) | 0xFF&(c) |
Macro
Definition at line 80 of file llips_general.h.
#define GetGreen | ( | c | ) | 0xFF&(c>>8) |
Definition at line 81 of file llips_general.h.
#define GetRed | ( | c | ) | 0xFF&(c>>16) |
Definition at line 82 of file llips_general.h.
#define GREEN 0x0010 |
Definition at line 33 of file llips_general.h.
#define HEADER 0x1000 |
Definition at line 35 of file llips_general.h.
#define NO_DIFF 0x0000 |
Definition at line 56 of file llips_general.h.
#define OFFSET_IMG_DATA_WIN24bit 0x0036 |
Definition at line 27 of file llips_general.h.
#define OFFSET_IMG_DEPTH 0x001C |
Definition at line 17 of file llips_general.h.
#define OFFSET_IMG_DEPTH_size 2 |
Definition at line 23 of file llips_general.h.
#define OFFSET_IMG_HEIGHT 0x0016 |
Definition at line 16 of file llips_general.h.
#define OFFSET_IMG_HEIGHT_size 4 |
Definition at line 22 of file llips_general.h.
#define OFFSET_IMG_P_DATA 0x000A |
Definition at line 14 of file llips_general.h.
#define OFFSET_IMG_P_DATA_size 4 |
Definition at line 20 of file llips_general.h.
#define OFFSET_IMG_WIDTH 0x0012 |
Definition at line 15 of file llips_general.h.
#define OFFSET_IMG_WIDTH_size 4 |
Definition at line 21 of file llips_general.h.
#define OFFSET_SIGN 0x0000 |
Definition at line 13 of file llips_general.h.
#define OFFSET_SIGN_size 2 |
Definition at line 19 of file llips_general.h.
#define PI 3.141592653589793 |
Definition at line 73 of file llips_general.h.
#define PIXEL_8bit_RANGE 255 |
Definition at line 29 of file llips_general.h.
#define PIXEL_size 1 |
Definition at line 24 of file llips_general.h.
#define RED 0x0100 |
Definition at line 34 of file llips_general.h.
#define SetRGB | ( | r, | |
g, | |||
b | |||
) | ((0xFF&r)<<16) | ((0xFF&g)<<8 ) | (0xFF&b) |
Definition at line 83 of file llips_general.h.
#define WIN_BMP 0x4D42 |
Definition at line 26 of file llips_general.h.
enum te_color |
Enumerator | |
---|---|
c_Red | |
c_Green | |
c_Blue | |
c_color_size |
Definition at line 37 of file llips_general.h.
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.
img_in | t_img* - input image |
tab_filtre | CPU_FP64** - pointer to a 2D Table containing the filter |
filtersize | CPU_INT16S - size of the matrix representing the filter |
color | CPU_INT32U - color that will be impacted by the filter. If not selected, will be set to zero |
img_out | t_img* - output image |
Definition at line 619 of file llips_general.c.
CPU_CHAR apply_median_filter | ( | t_img * | img_in, |
CPU_INT16S | filtersize, | ||
t_img * | img_out | ||
) |
Apply a median filter on an image.
img_in | t_img* - input image |
filtersize | CPU_INT16S - filter size |
img_out | t_img* - output image |
Creating a matrix is not necessary prior to use this filter
Definition at line 882 of file llips_general.c.
CPU_CHAR color_filter | ( | t_img * | img_in, |
t_img * | img_out, | ||
CPU_INT32U | color | ||
) |
Create an image with only the color provided.
img_in | t_img* - input image |
img_out | t_img* - output image |
color | CPU_INT32U - range of color to work on |
The parameter color must be a combination of RED | GREEN | BLUE
Definition at line 333 of file llips_general.c.
CPU_FP64 conv_gauss | ( | CPU_INT16S | x, |
CPU_INT16S | y, | ||
CPU_FP64 | sig | ||
) |
Gaussian convolution, used to create gaussian filter.
x | CPU_INT16S - coordinate x in the matrix |
y | CPU_INT16S - coordinate y in the matrix |
sig | CPU_FP64 - standard deviation of Gaussian distribution |
http://en.wikipedia.org/wiki/Gaussian_filter or http://fr.wikipedia.org/wiki/Filtre_de_Gauss
Definition at line 705 of file llips_general.c.
CPU_VOID create_average_filter | ( | CPU_FP64 ** | tab_filtre, |
CPU_INT16S | filtersize | ||
) |
Create an average filter for smoothing.
tab_filtre | CPU_FP64** - pointer to a 2D table (matrix) that will receive the filter |
filtersize | CPU_INT16S - size of the matrix |
Definition at line 762 of file llips_general.c.
CPU_VOID create_gauss_filter | ( | CPU_FP64 ** | tab_filtre, |
CPU_INT16S | filtersize, | ||
CPU_FP64 | sigma | ||
) |
Create a Gaussian filter used to smooth and image.
tab_filtre | CPU_FP64** - pointer to a 2D table (matrix) that will receive the filter |
filtersize | CPU_INT16S - size of the matrix |
sigma | CPU_FP64 - standard deviation of Gaussian distribution (higher will smooth more) |
Definition at line 727 of file llips_general.c.
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)
tab_filtre | CPU_FP64** - pointer to a 2D table (matrix) that will receive the filter of size (minimum size 3) |
filtertype | CPU_INT16S - type of filter to use |
type 1 { 0,-1, 0} type 2 {0, 1, 0} {-1, 4,-1} {1,-4, 1} { 0,-1, 0} {0, 1, 0}
type 3 {-1,-1,-1} type 4 { 1,-2, 1} {-1, 8,-1} {-2, 4,-2} {-1,-1,-1} { 1,-2, 1}
type 5 { 0, 0,-1, 0, 0} { 0,-1,-2,-1, 0} {-1,-2,16,-2,-1} { 0,-1,-2,-1, 0} { 0, 0,-1, 0, 0}
Definition at line 797 of file llips_general.c.
CPU_VOID display_filter_value | ( | CPU_FP64 ** | tab_filtre, |
CPU_INT08U | filtersize | ||
) |
Display values contained in a square filter.
tab_filtre | CPU_FP64** - pointer to matrix filter to display |
filtersize | CPU_INT08U - Size of the filter |
Definition at line 965 of file llips_general.c.
CPU_VOID display_img_value | ( | t_img * | img, |
CPU_INT16S | colors | ||
) |
Display each color of image in ascii.
img | t_img* - image to display |
colors | CPU_INT16S - color layer to display |
Definition at line 96 of file llips_general.c.
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.
table2D | CPU_INT08U** - pixel table |
filter_range | CPU_INT16S - size of the filter |
i | CPU_INT16S - coordinate of pixel |
j | CPU_INT16S - coordinate of pixel |
Definition at line 939 of file llips_general.c.
CPU_VOID highlight_area | ( | t_img * | img, |
t_area * | area, | ||
CPU_INT32U | RGB | ||
) |
Draw a rectangular area on image in a given color.
img | t_img* - image to modify (also output) |
area | t_area* - area to highlight |
RGB | CPU_INT32U - highlight color |
Helpfull macro to define color is SetRGB(r,g,b), with value between 0 and 255
Definition at line 278 of file llips_general.c.
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.
img | t_img* - image to modify (also output) |
pix1 | t_pixel - first point of line |
pix2 | t_pixel - second point of line |
RGB | CPU_INT32U - color of the line |
Needs to be done Helpfull macro to define color is SetRGB(r,g,b), with value between 0 and 255
Definition at line 172 of file llips_general.c.
Create an image with a view of histogram (RGBY).
img_in | t_img* - input image |
img_out | t_img* - output image |
Width and precision of histogram depend on image width
Definition at line 392 of file llips_general.c.
CPU_VOID init_area | ( | t_area * | area, |
CPU_INT16U | maxwidth, | ||
CPU_INT16U | maxheight | ||
) |
Initialize an area from 0,0 to given values.
area | t_area* - pointer to initialized area |
maxwidth | CPU_INT16U - width of area |
maxheight | CPU_INT16U - height of area |
Definition at line 255 of file llips_general.c.
Create an image only luminance data (desaturated image)
img_in | t_img* - input image |
img_out | t_img* - output image |
Definition at line 571 of file llips_general.c.
Convert a pixel into a area of 1 x 1.
pix | t_pixel - pixel |
This function is use to be able to draw a pixel using highlight_area() function
Definition at line 229 of file llips_general.c.
Convert two pixel into a vector.
pix1 | t_pixel - starting point of vector |
pix2 | t_pixel - ending point of vector |
Definition at line 192 of file llips_general.c.
Display area corner coordonate in a console.
area | t_area* - area to display |
Definition at line 309 of file llips_general.c.
CPU_INT16U vectormodule | ( | t_vect | vect | ) |
Give module of a vector, in "pixel".
vect | t_vect - vector to process |
Definition at line 210 of file llips_general.c.