24#ifndef _FIREVISION_FVUTILS_COLORMAP_YUVCM_H_
25#define _FIREVISION_FVUTILS_COLORMAP_YUVCM_H_
27#include <fvutils/base/types.h>
28#include <fvutils/colormap/colormap.h>
33class SharedMemoryLookupTable;
40 unsigned int depth = 1,
41 unsigned int width = 256,
42 unsigned int height = 256);
45 unsigned int depth = 1,
46 unsigned int width = 256,
47 unsigned int height = 256);
52 virtual color_t
determine(
unsigned int y,
unsigned int u,
unsigned int v)
const;
53 virtual void set(
unsigned int y,
unsigned int u,
unsigned int v, color_t c);
56 virtual void set(
unsigned char *buffer);
58 virtual size_t size();
66 virtual unsigned int width()
const;
67 virtual unsigned int height()
const;
68 virtual unsigned int depth()
const;
69 virtual unsigned int deepness()
const;
72 virtual std::list<ColormapFileBlock *>
get_blocks();
74 void copy_uvplane(
unsigned char *uvplane,
unsigned int level);
79 void constructor(
unsigned int depth,
82 const char * shmem_lut_id = 0,
83 bool destroy_on_free =
false);
92 unsigned int depth_div_;
93 unsigned int width_div_;
94 unsigned int height_div_;
95 unsigned int plane_size_;
102 * (lut_ + (y / depth_div_) * plane_size_ + (v / height_div_) * width_ + (u / width_div_));
Shared memory lookup table.
virtual Colormap & operator=(const YuvColormap &yuvcm)
Assign operation.
void copy_uvplane(unsigned char *uvplane, unsigned int level)
Copy single U/V plane.
virtual Colormap & operator+=(const Colormap &cmlt)
Adds the given colormap to this colormap.
virtual unsigned char * get_buffer() const
Get the raw buffer of this colormap.
virtual size_t size()
Size in bytes of buffer returned by get_buffer().
void replace_color(color_t from, color_t to)
Replace a given color with another one.
YuvColormap(unsigned int depth=1, unsigned int width=256, unsigned int height=256)
Constructor.
virtual unsigned int height() const
Get height of colormap.
virtual void reset()
Reset colormap.
virtual std::list< ColormapFileBlock * > get_blocks()
Get file blocks for this colormap.
virtual unsigned int depth() const
Get depth of colormap.
virtual unsigned int width() const
Get width of colormap.
virtual ~YuvColormap()
Destructor.
virtual void set(unsigned int y, unsigned int u, unsigned int v, color_t c)
Set color class for given YUV value.
virtual color_t determine(unsigned int y, unsigned int u, unsigned int v) const
Determine color class for given YUV value.
unsigned int plane_size() const
Get U/V plane size.
virtual unsigned int deepness() const
Get deepness of colormap.