Fawkes API
Fawkes Development Version
|
#include <>>
Public Member Functions | |
virtual | ~Colormap () |
Virtual empty destructor. More... | |
virtual color_t | determine (unsigned int y, unsigned int u, unsigned int v) const =0 |
Determine color class for given YUV value. More... | |
virtual void | set (unsigned int y, unsigned int u, unsigned int v, color_t c)=0 |
Set color class for given YUV value. More... | |
virtual void | reset ()=0 |
Reset colormap. More... | |
virtual void | set (unsigned char *buffer)=0 |
Set to the given raw buffer. More... | |
virtual size_t | size ()=0 |
Size in bytes of buffer returned by get_buffer(). More... | |
virtual void | to_image (unsigned char *yuv422_planar_buffer, unsigned int level=0) |
Create image from LUT. More... | |
virtual unsigned int | image_height () const |
Height of conversion image. More... | |
virtual unsigned int | image_width () const |
Width of conversion image. More... | |
virtual unsigned char * | get_buffer () const =0 |
Get the raw buffer of this colormap. More... | |
virtual Colormap & | operator+= (const Colormap &cmlt)=0 |
Adds the given colormap to this colormap. More... | |
virtual Colormap & | operator+= (const char *filename)=0 |
Convenience method for the method above. More... | |
virtual unsigned int | width () const =0 |
Get width of colormap. More... | |
virtual unsigned int | height () const =0 |
Get height of colormap. More... | |
virtual unsigned int | depth () const =0 |
Get depth of colormap. More... | |
virtual unsigned int | deepness () const =0 |
Get deepness of colormap. More... | |
virtual std::list < ColormapFileBlock * > | get_blocks ()=0 |
Get file blocks for this colormap. More... | |
Colormap interface.
This C++ pure virtual class describes the interface to a generic colormap. It is currently tailored to the YUV colorspace.
Definition at line 38 of file colormap.h.
|
virtual |
Virtual empty destructor.
Definition at line 111 of file colormap.cpp.
|
pure virtual |
Get deepness of colormap.
The deepness is the maximum value of depth().
Implemented in firevision::YuvColormap.
Referenced by ColormapViewerWidget::set_colormap().
|
pure virtual |
Get depth of colormap.
Implemented in firevision::YuvColormap.
Referenced by firevision::ColormapFile::add_colormap(), ColorTrainWidget::load_colormap(), and FireVisionNetworkTool::set_colormap().
|
pure virtual |
Determine color class for given YUV value.
y | Y value from YUV colorspace |
u | U value from YUV colorspace |
v | V value from YUV colorspace |
Implemented in firevision::YuvColormap.
|
pure virtual |
Get file blocks for this colormap.
Implemented in firevision::YuvColormap.
Referenced by firevision::ColormapFile::add_colormap().
|
pure virtual |
Get the raw buffer of this colormap.
Implemented in firevision::YuvColormap.
Referenced by FireVisionNetworkTool::set_colormap().
|
pure virtual |
Get height of colormap.
Implemented in firevision::YuvColormap.
Referenced by firevision::ColormapFile::add_colormap(), ColorTrainWidget::load_colormap(), and FireVisionNetworkTool::set_colormap().
|
virtual |
Height of conversion image.
The buffer passed into to_image() must have the returned width.
Definition at line 186 of file colormap.cpp.
|
virtual |
Width of conversion image.
The buffer passed into to_image() must have the returned width.
Definition at line 176 of file colormap.cpp.
Adds the given colormap to this colormap.
This operator takes the given colormap and compares it to this colormap. If this colormap has C_OTHER or C_BACKGROUND the value is compied from the other LUT, otherwise the value is kept as is.
cmlt | other colormap to add |
Implemented in firevision::YuvColormap.
|
pure virtual |
Convenience method for the method above.
This adds the colormap as in the above method but instead of an instantiated colormap it takes the path to a colormap file which is loaded and added.
filename | file name of colormap to add |
Implemented in firevision::YuvColormap.
|
pure virtual |
Reset colormap.
Resets all values to return C_UNKNOWN for every query with determine().
Implemented in firevision::YuvColormap.
|
pure virtual |
Set color class for given YUV value.
y | Y value from YUV colorspace |
u | U value from YUV colorspace |
v | V value from YUV colorspace |
c | class for the given YUV color |
Implemented in firevision::YuvColormap.
|
pure virtual |
Set to the given raw buffer.
buffer | buffer to copy data from |
Implemented in firevision::YuvColormap.
|
pure virtual |
Size in bytes of buffer returned by get_buffer().
Implemented in firevision::YuvColormap.
|
virtual |
Create image from LUT.
Create image from LUT, useful for debugging and analysing. This method produces a representation of the given level (Y range with 0 <= level < depth) for visual inspection of the colormap. The dimensions of the resulting image are 512x512 pixels. It uses standard strong colors for the different standard color classes. C_UNKNOWN is grey, C_BACKGROUND is black (like C_BLACK). If the standard method does not suit your needs you can override this method.
yuv422_planar_buffer | contains the image upon return, must be initialized with the appropriate memory size before calling, dimensions are 512x512 pixels. |
level | the level to draw, it's a range in the Y direction and is in the range 0 <= level < depth. |
Definition at line 129 of file colormap.cpp.
References firevision::YUV_t_struct::U, firevision::YUV_t_struct::V, and firevision::YUV_t_struct::Y.
|
pure virtual |
Get width of colormap.
Implemented in firevision::YuvColormap.
Referenced by firevision::ColormapFile::add_colormap(), ColorTrainWidget::load_colormap(), and FireVisionNetworkTool::set_colormap().