25 #ifndef __FIREVISION_UTILS_COLOR_YUV_H 26 #define __FIREVISION_UTILS_COLOR_YUV_H 34 #define YUV422PA_MACROPIXEL_AT(YUV, width, x, y) ((unsigned char*)YUV + (y)*(width)*2 + ((x)-((x)%2))*2) 36 #define YUV422_PLANAR_Y_AT(YUV, width, x, y) \ 37 *(YUV + (y) * (width) + (x)) 39 #define YUV422_PLANAR_U_AT(YUV, width, height, x, y) \ 40 *(YUV + ((width) * (height)) + (((y) * (width) + (x))/ 2)) 42 #define YUV422_PLANAR_V_AT(YUV, width, height, x, y) \ 43 *(YUV + ((width) * (height)) + (((width) * (height) + (y) * (width) + (x)) / 2)) 45 #define YUV422_PLANAR_YUV(YUV, width, height, x, y, yp, up, vp) \ 47 yp = YUV422_PLANAR_Y_AT(YUV, width, x, y); \ 48 up = YUV422_PLANAR_U_AT(YUV, width, height, x, y); \ 49 vp = YUV422_PLANAR_V_AT(YUV, width, height, x, y); \ 52 #define YUV422_PLANAR_U_PLANE(YUV, width, height) (YUV + (width) * (height)) 53 #define YUV422_PLANAR_V_PLANE(YUV, width, height) (YUV + ((width) * (height)) + ((width) * (height) / 2)) 55 #define YUV420_PLANAR_U_PLANE(YUV, width, height) (YUV + (width) * (height)) 56 #define YUV420_PLANAR_V_PLANE(YUV, width, height) (YUV + ((width) * (height)) + ((width) * (height) / 4)) 69 YUV_t_struct(
unsigned char y = 127,
unsigned char u = 127,
unsigned char v = 127)
95 void iyu1_to_yuy2(
const unsigned char *src,
unsigned char *dest,
96 unsigned int width,
unsigned int height);
102 void gray8_to_yuy2(
const unsigned char *src,
unsigned char *dest,
103 unsigned int width,
unsigned int height);
108 void gray8_to_yuv422planar_plainc(
const unsigned char *src,
unsigned char *dst,
109 unsigned int width,
unsigned int height);
110 void gray8_to_yuv422packed_plainc(
const unsigned char *src,
unsigned char *dst,
111 unsigned int width,
unsigned int height);
114 void yuv420planar_to_yuv422planar(
const unsigned char *src,
unsigned char *dst,
115 unsigned int width,
unsigned int height);
119 void yuv422planar_copy_uv(
const unsigned char *src,
unsigned char *dst,
120 unsigned int width,
unsigned int height,
121 unsigned int x,
unsigned int y,
122 unsigned int copy_width,
unsigned int copy_height);
128 void yuv422planar_to_yuv422packed(
const unsigned char *planar,
unsigned char *packed,
129 unsigned int width,
unsigned int height);
133 void yuv422planar_quarter_to_yuv422packed(
const unsigned char *planar,
134 unsigned char *packed,
135 const unsigned int width,
136 const unsigned int height);
139 void yuv422planar_quarter_to_yuv422planar(
const unsigned char *planar,
140 unsigned char *packed,
141 const unsigned int width,
142 const unsigned int height);
147 void yuv422packed_to_yuv422planar(
const unsigned char *packed,
unsigned char *planar,
148 unsigned int width,
unsigned int height);
152 void yuy2_to_yuv422planar(
const unsigned char *packed,
unsigned char *planar,
153 unsigned int width,
unsigned int height);
157 void yuy2_to_yuv422planar_quarter(
const unsigned char *packed,
unsigned char *planar,
158 const unsigned int width,
const unsigned int height);
162 void yvy2_to_yuv422planar(
const unsigned char *packed,
unsigned char *planar,
163 unsigned int width,
unsigned int height);
167 void yuv444packed_to_yuv422planar(
const unsigned char *yuv444,
unsigned char *yuv422,
168 unsigned int width,
unsigned int height);
170 void yuv444packed_to_yuv422packed(
const unsigned char *yuv444,
unsigned char *yuv422,
171 unsigned int width,
unsigned int height);
173 void yvu444packed_to_yuv422planar(
const unsigned char *yuv444,
unsigned char *yuv422,
174 unsigned int width,
unsigned int height);
176 void yvu444packed_to_yuv422packed(
const unsigned char *yuv444,
unsigned char *yuv422,
177 unsigned int width,
unsigned int height);
181 void yuv422planar_erase_y_plane(
unsigned char *yuv,
unsigned int width,
unsigned int height);
184 void yuv422planar_erase_u_plane(
unsigned char *yuv,
unsigned int width,
unsigned int height);
187 void yuv422planar_erase_v_plane(
unsigned char *yuv,
unsigned int width,
unsigned int height);
190 void grayscale_yuv422packed(
const unsigned char *src,
unsigned char *dst,
191 unsigned int width,
unsigned int height);
194 void grayscale_yuv422planar(
const unsigned char *src,
unsigned char *dst,
195 unsigned int width,
unsigned int height);
199 convert_line_yuv422planar_to_yuv444packed(
const unsigned char *src,
unsigned char *dst,
200 unsigned int width,
unsigned int height,
201 unsigned int src_line,
unsigned int dst_line)
205 const unsigned char *yp, *up, *vp;
207 yp = src + (width * src_line);
208 up = YUV422_PLANAR_U_PLANE(src, width, height) + (width * src_line / 2);
209 vp = YUV422_PLANAR_V_PLANE(src, width, height) + (width * src_line / 2);
211 dst += 3 * width * dst_line;
static YUV_t_struct yellow()
unsigned char V
V component.
static YUV_t_struct magenta()
static YUV_t_struct red()
YUV_t_struct(unsigned char y=127, unsigned char u=127, unsigned char v=127)
Standard constructor.
unsigned char Y
Y component.
static YUV_t_struct cyan()
static YUV_t_struct black()
static YUV_t_struct gray()
static YUV_t_struct orange()
static YUV_t_struct green()
unsigned char U
U component.
static YUV_t_struct blue()
static YUV_t_struct white()