24 #include <fvutils/colormap/colormap.h> 26 #include <fvutils/color/color_object_map.h> 134 unsigned int lwidth =
width();
135 unsigned int lheight =
height();
137 unsigned int pixel_per_step = iheight / lheight;
138 unsigned int lines_per_step = iwidth / lwidth;
140 unsigned char *yp = yuv422_planar_buffer;
141 unsigned char *up = YUV422_PLANAR_U_PLANE(yuv422_planar_buffer, iwidth * 2, iheight * 2);
142 unsigned char *vp = YUV422_PLANAR_V_PLANE(yuv422_planar_buffer, iwidth * 2, iheight * 2);
147 for (
unsigned int v = lwidth; v > 0 ; --v) {
148 unsigned int v_index = (v - 1) *
deepness() / lwidth;
149 for (
unsigned int u = 0; u < lheight; ++u) {
150 unsigned int u_index = u *
deepness() / lheight;
153 for (
unsigned int p = 0; p < pixel_per_step; ++p) {
161 unsigned int lines = (2 * (lines_per_step - 1)) + 1;
162 memcpy(yp, (yp - iwidth * 2), (iwidth * 2) * lines);
163 yp += (iwidth * 2) * lines;
164 memcpy(up, (up - iwidth), iwidth * lines);
165 memcpy(vp, (vp - iwidth), iwidth * lines);
166 up += iwidth * lines;
167 vp += iwidth * lines;
unsigned char V
V component.
virtual void to_image(unsigned char *yuv422_planar_buffer, unsigned int level=0)
Create image from LUT.
virtual unsigned int depth() const =0
Get depth of colormap.
virtual unsigned int height() const =0
Get height of colormap.
unsigned char Y
Y component.
virtual ~Colormap()
Virtual empty destructor.
virtual color_t determine(unsigned int y, unsigned int u, unsigned int v) const =0
Determine color class for given YUV value.
virtual unsigned int width() const =0
Get width of colormap.
unsigned char U
U component.
virtual unsigned int deepness() const =0
Get deepness of colormap.
virtual unsigned int image_width() const
Width of conversion image.
static YUV_t get_color(color_t color)
YUV_t getter.
virtual unsigned int image_height() const
Height of conversion image.