Colormap Class Reference
Colormap interface. More...
#include <fvutils/colormap/colormap.h>

Public Member Functions | |
| 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 void | set (unsigned int y, unsigned int u, unsigned int v, color_t c)=0 |
| Set color class for given YUV value. | |
| virtual void | reset ()=0 |
| Reset colormap. | |
| virtual void | set (unsigned char *buffer)=0 |
| Set to the given raw buffer. | |
| virtual size_t | size ()=0 |
| Size in bytes of buffer returned by get_buffer(). | |
| virtual void | to_image (unsigned char *yuv422_planar_buffer, unsigned int level=0) |
| Create image from LUT. | |
| virtual unsigned char * | get_buffer () const =0 |
| Get the raw buffer of this colormap. | |
| virtual Colormap & | operator+= (const Colormap &cmlt)=0 |
| Adds the given colormap to this colormap. | |
| virtual Colormap & | operator+= (const char *filename)=0 |
| Convenience method for the method above. | |
| virtual unsigned int | width () const =0 |
| Get width of colormap. | |
| virtual unsigned int | height () const =0 |
| Get height of colormap. | |
| virtual unsigned int | depth () const =0 |
| Get depth of colormap. | |
| virtual unsigned int | deepness () const =0 |
| Get deepness of colormap. | |
| virtual std::list < ColormapFileBlock * > | get_blocks ()=0 |
| Get file blocks for this colormap. | |
Detailed Description
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 33 of file colormap.h.
Constructor & Destructor Documentation
| Colormap::~Colormap | ( | ) | [virtual] |
Member Function Documentation
| unsigned int Colormap::deepness | ( | ) | const [pure virtual] |
Get deepness of colormap.
The deepness is the maximum value of depth().
- Returns:
- colormap deepness, meaning depends on actual colormap implementation
Implemented in YuvColormap.
Referenced by ColormapViewerWidget::draw(), ColormapViewerWidget::set_colormap(), ColormapViewerWidget::set_layer_selector(), and to_image().
| unsigned int Colormap::depth | ( | ) | const [pure virtual] |
Get depth of colormap.
- Returns:
- colormap depth, meaning depends on actual colormap implementation
Implemented in YuvColormap.
Referenced by ColormapFile::add_colormap(), ColormapViewerWidget::draw(), ColorTrainWidget::load_colormap(), FireVisionNetworkTool::set_colormap(), and to_image().
| color_t Colormap::determine | ( | unsigned int | y, | |
| unsigned int | u, | |||
| unsigned int | v | |||
| ) | const [pure virtual] |
Determine color class for given YUV value.
- Parameters:
-
y Y value from YUV colorspace u U value from YUV colorspace v V value from YUV colorspace
- Returns:
- color class for the given YUV color
Implemented in YuvColormap.
Referenced by to_image().
| std::list< ColormapFileBlock * > Colormap::get_blocks | ( | ) | [pure virtual] |
Get file blocks for this colormap.
- Returns:
- list of colormap blocks for this colormap.
Implemented in YuvColormap.
Referenced by ColormapFile::add_colormap().
| unsigned char * Colormap::get_buffer | ( | ) | const [pure virtual] |
Get the raw buffer of this colormap.
- Returns:
- raw buffer
Implemented in YuvColormap.
Referenced by FireVisionNetworkTool::set_colormap().
| unsigned int Colormap::height | ( | ) | const [pure virtual] |
Get height of colormap.
- Returns:
- colormap height, meaning depends on actual colormap implementation
Implemented in YuvColormap.
Referenced by ColormapFile::add_colormap(), ColormapViewerWidget::draw(), ColorTrainWidget::load_colormap(), FireVisionNetworkTool::set_colormap(), and to_image().
| Colormap & Colormap::operator+= | ( | const char * | filename | ) | [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.
- Parameters:
-
filename file name of colormap to add
- Returns:
- reference to this
Implemented in YuvColormap.
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.
- Parameters:
-
cmlt other colormap to add
- Returns:
- reference to this
Implemented in YuvColormap.
| void Colormap::reset | ( | ) | [pure virtual] |
Reset colormap.
Resets all values to return C_UNKNOWN for every query with determine().
Implemented in YuvColormap.
| void Colormap::set | ( | unsigned char * | buffer | ) | [pure virtual] |
Set to the given raw buffer.
- Parameters:
-
buffer buffer to copy data from
Implemented in YuvColormap.
| void Colormap::set | ( | unsigned int | y, | |
| unsigned int | u, | |||
| unsigned int | v, | |||
| color_t | c | |||
| ) | [pure virtual] |
Set color class for given YUV value.
- Parameters:
-
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 YuvColormap.
| size_t Colormap::size | ( | ) | [pure virtual] |
| void Colormap::to_image | ( | unsigned char * | yuv422_planar_buffer, | |
| unsigned int | level = 0 | |||
| ) | [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.
- Parameters:
-
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 123 of file colormap.cpp.
References deepness(), depth(), determine(), ColorObjectMap::get_color(), height(), YUV_t_struct::U, YUV_t_struct::V, width(), and YUV_t_struct::Y.
Referenced by ColormapViewerWidget::draw().
| unsigned int Colormap::width | ( | ) | const [pure virtual] |
Get width of colormap.
- Returns:
- colormap width, meaning depends on actual colormap implementation
Implemented in YuvColormap.
Referenced by ColormapFile::add_colormap(), ColormapViewerWidget::draw(), ColorTrainWidget::load_colormap(), FireVisionNetworkTool::set_colormap(), and to_image().
The documentation for this class was generated from the following files:
- src/firevision/fvutils/colormap/colormap.h
- src/firevision/fvutils/colormap/colormap.cpp

