25 #ifndef __FIREVISION_UTILS_COLOR_RGB_H
26 #define __FIREVISION_UTILS_COLOR_RGB_H
33 #define RGB_PIXEL_SIZE 3
34 #define RGB_PIXEL_AT(RGB, width, x, y) ((RGB_t *)(RGB + ((y) * (width) * RGB_PIXEL_SIZE) + (x) * RGB_PIXEL_SIZE))
35 #define RGB_CLEAR_PIXEL(RGB, width, x, y) memset(RGB + ((y) * (width) * RGB_PIXEL_SIZE) + (x) * RGB_PIXEL_SIZE, 0, RGB_PIXEL_SIZE);
36 #define RGB_RED_AT(RGB, width, x, y) (RGB_PIXEL_AT(RGB, (width), (x), (y))->R)
37 #define RGB_GREEN_AT(RGB, width, x, y) (RGB_PIXEL_AT(RGB, (width), (x), (y))->G)
38 #define RGB_BLUE_AT(RGB, width, x, y) (RGB_PIXEL_AT(RGB, (width), (x), (y))->B)
39 #define RGB_SET_RED(RGB, width, x, y) {RGB_t *p=RGB_PIXEL_AT(RGB, (width), (x), (y)); p->R=255; p->G=0; p->B=0; }
40 #define RGB_SET_GREEN(RGB, width, x, y) {RGB_t *p=RGB_PIXEL_AT(RGB, (width), (x), (y)); p->R=0; p->G=255; p->B=0; }
41 #define RGB_SET_BLUE(RGB, width, x, y) {RGB_t *p=RGB_PIXEL_AT(RGB, (width), (x), (y)); p->R=0; p->G=0; p->B=255; }
57 void rgb_to_rgb_with_alpha_plainc(
const unsigned char *rgb,
unsigned char *rgb_alpha,
58 unsigned int width,
unsigned int height);
60 void rgb_to_bgr_with_alpha_plainc(
const unsigned char *rgb,
unsigned char *bgr_alpha,
61 unsigned int width,
unsigned int height);
63 void bgr_to_rgb_plainc(
const unsigned char *BGR,
unsigned char *RGB,
64 unsigned int width,
unsigned int height);
66 void convert_line_bgr_rgb(
const unsigned char *BGR,
unsigned char *RGB,
67 unsigned int width,
unsigned int height);
Structure defining an RGB pixel (in R-G-B byte ordering).
Structure defining an RGB pixel (in B-G-R byte ordering).