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;
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();
62 virtual unsigned int width()
const;
63 virtual unsigned int height()
const;
64 virtual unsigned int depth()
const;
65 virtual unsigned int deepness()
const;
68 virtual std::list<ColormapFileBlock *>
get_blocks();
70 void copy_uvplane(
unsigned char *uvplane,
unsigned int level);
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;
96 return (color_t) *(__lut + (y / __depth_div) * __plane_size + (v / __height_div) * __width + (u / __width_div));
virtual Colormap & operator=(const YuvColormap &yuvcm)
Assign operation.
virtual unsigned int deepness() const
Get deepness of colormap.
virtual unsigned int width() const
Get width of colormap.
YuvColormap(unsigned int depth=1, unsigned int width=256, unsigned int height=256)
Constructor.
void copy_uvplane(unsigned char *uvplane, unsigned int level)
Copy single U/V plane.
virtual std::list< ColormapFileBlock * > get_blocks()
Get file blocks for this colormap.
virtual ~YuvColormap()
Destructor.
virtual unsigned char * get_buffer() const
Get the raw buffer of this colormap.
virtual unsigned int depth() const
Get depth of colormap.
virtual color_t determine(unsigned int y, unsigned int u, unsigned int v) const
Determine color class for given YUV value.
virtual void reset()
Reset colormap.
void replace_color(color_t from, color_t to)
Replace a given color with another one.
virtual size_t size()
Size in bytes of buffer returned by get_buffer().
virtual unsigned int height() const
Get height of colormap.
Shared memory lookup table.
unsigned int plane_size() const
Get U/V plane size.
virtual Colormap & operator+=(const Colormap &cmlt)
Adds the given colormap to this colormap.