24 #ifndef __FIREVISION_FVUTILS_COLORMAP_YUVCM_H_ 25 #define __FIREVISION_FVUTILS_COLORMAP_YUVCM_H_ 27 #include <fvutils/colormap/colormap.h> 29 #include <sys/types.h> 30 #include <fvutils/base/types.h> 37 class SharedMemoryLookupTable;
42 YuvColormap(
unsigned int depth = 1,
unsigned int width = 256,
unsigned int height = 256);
43 YuvColormap(
const char *shmem_lut_id,
unsigned int depth = 1,
unsigned int width = 256,
unsigned int height = 256);
44 YuvColormap(
const char *shmem_lut_id,
bool destroy_on_free,
unsigned int depth = 1,
unsigned int width = 256,
unsigned int height = 256);
48 virtual color_t determine(
unsigned int y,
unsigned int u,
unsigned int v)
const;
49 virtual void set(
unsigned int y,
unsigned int u,
unsigned int v, color_t c);
52 virtual void set(
unsigned char *buffer);
54 virtual size_t size();
56 virtual unsigned char * get_buffer()
const;
59 virtual Colormap & operator+=(
const char *filename);
62 virtual unsigned int width()
const;
63 virtual unsigned int height()
const;
64 virtual unsigned int depth()
const;
65 virtual unsigned int deepness()
const;
66 unsigned int plane_size()
const;
68 virtual std::list<ColormapFileBlock *> get_blocks();
70 void copy_uvplane(
unsigned char *uvplane,
unsigned int level);
72 void replace_color(color_t from, color_t to);
75 void constructor(
unsigned int depth,
unsigned int width,
unsigned int height,
76 const char *shmem_lut_id = 0,
bool destroy_on_free =
false);
84 unsigned int __height;
86 unsigned int __depth_div;
87 unsigned int __width_div;
88 unsigned int __height_div;
89 unsigned int __plane_size;
94 YuvColormap::determine(
unsigned int y,
unsigned int u,
unsigned int v)
const 96 return (color_t) *(__lut + (y / __depth_div) * __plane_size + (v / __height_div) * __width + (u / __width_div));
Shared memory lookup table.