ColorModelLookupTable Class Reference

Color model based on a lookup table. More...

#include <models/color/lookuptable.h>

Inheritance diagram for ColorModelLookupTable:

List of all members.


Public Member Functions

 ColorModelLookupTable (YuvColormap *colormap)
 Create a lookup table with given dimensions _not_ using shared memory.
 ColorModelLookupTable (const char *file)
 Create a lookup table, load contents from file.
 ColorModelLookupTable (const char *file, const char *lut_id, bool destroy_on_free=false)
 Create a lookup table using shared memory, load contents from file.
 ColorModelLookupTable (unsigned int depth, const char *lut_id, bool destroy_on_free)
 Create a lookup table with given dimensions using shared memory.
 ColorModelLookupTable (const char *lut_id, bool destroy_on_free)
 Create a lookup table with given dimensions using shared memory.
virtual ~ColorModelLookupTable ()
 Destructor.
virtual color_t determine (unsigned int y, unsigned int u, unsigned int v) const
 Determine classification of YUV pixel.
const char * get_name ()
 Get name of color model.
YuvColormapget_colormap () const
 Get colormap.
void load (const char *filename)
 Load colormap from file.
void reset ()
 Reset colormap.
ColorModelLookupTableoperator+= (const ColorModelLookupTable &cmlt)
 Add colormaps.

Static Public Member Functions

static std::string compose_filename (const std::string format)
 Compose filename.

Detailed Description

Color model based on a lookup table.

Very fast and easy implementation of a lookup table. It ignores the luminance and determines the classification just based on the U and V chrominance values. This model is very versatile as you can generate the lookuptable with many different methods.

Definition at line 32 of file lookuptable.h.


Constructor & Destructor Documentation

ColorModelLookupTable::ColorModelLookupTable ( YuvColormap colormap  ) 

Create a lookup table with given dimensions _not_ using shared memory.

Parameters:
colormap colormap to use, the colormap is consumed, meaning that the color model takes ownership of the colormap and deletes it in its dtor.

Definition at line 59 of file lookuptable.cpp.

ColorModelLookupTable::ColorModelLookupTable ( const char *  file  ) 

Create a lookup table, load contents from file.

Parameters:
file name of the file to load from

Definition at line 110 of file lookuptable.cpp.

References ColormapFile::get_colormap(), and FireVisionDataFile::read().

ColorModelLookupTable::ColorModelLookupTable ( const char *  file,
const char *  lut_id,
bool  destroy_on_free = false 
)

Create a lookup table using shared memory, load contents from file.

Parameters:
file name of the file to load from
lut_id ID of the LUT in shared memory, use a constant from utils/shm_registry.h
destroy_on_free true to destroy lookup table in shmem on delete

Definition at line 91 of file lookuptable.cpp.

References ColormapFile::get_colormap(), and FireVisionDataFile::read().

ColorModelLookupTable::ColorModelLookupTable ( unsigned int  depth,
const char *  lut_id,
bool  destroy_on_free 
)

Create a lookup table with given dimensions using shared memory.

Parameters:
depth depth of the lookup table
lut_id ID of the LUT in shared memory
destroy_on_free true to destroy lookup table in shmem on delete

Definition at line 79 of file lookuptable.cpp.

ColorModelLookupTable::ColorModelLookupTable ( const char *  lut_id,
bool  destroy_on_free 
)

Create a lookup table with given dimensions using shared memory.

Parameters:
lut_id ID of the LUT in shared memory
destroy_on_free true to destroy lookup table in shmem on delete

Definition at line 68 of file lookuptable.cpp.

ColorModelLookupTable::~ColorModelLookupTable (  )  [virtual]

Destructor.

Definition at line 124 of file lookuptable.cpp.


Member Function Documentation

std::string ColorModelLookupTable::compose_filename ( const std::string  format  )  [static]

Compose filename.

Parameters:
format format string
Returns:
composed filename
See also:
ColormapFile::compose_filename()

Definition at line 191 of file lookuptable.cpp.

color_t ColorModelLookupTable::determine ( unsigned int  y,
unsigned int  u,
unsigned int  v 
) const [inline, virtual]

Determine classification of YUV pixel.

Given a pixel in the YUV colorspace the colormodel determines the color classification based on some a-priori knowledge.

Parameters:
y Y value
u U value
v V value

Implements ColorModel.

Definition at line 62 of file lookuptable.h.

References YuvColormap::determine().

YuvColormap * ColorModelLookupTable::get_colormap (  )  const

Get colormap.

Returns:
a pointer to the YUV colormap used internally.

Definition at line 140 of file lookuptable.cpp.

Referenced by FvRetrieverThread::init().

const char * ColorModelLookupTable::get_name (  )  [virtual]

Get name of color model.

Returns:
name of color model.
Author:
Tim Niemueller

Implements ColorModel.

Definition at line 131 of file lookuptable.cpp.

void ColorModelLookupTable::load ( const char *  filename  ) 

Load colormap from file.

Parameters:
filename name of colormap file

Definition at line 150 of file lookuptable.cpp.

References ColormapFile::get_colormap(), and FireVisionDataFile::read().

ColorModelLookupTable & ColorModelLookupTable::operator+= ( const ColorModelLookupTable cmlt  ) 

Add colormaps.

This adds the colormap of the given lookuptable color model to internals colormap.

Parameters:
cmlt lookup table color model to copy data from
Returns:
this

Definition at line 171 of file lookuptable.cpp.

void ColorModelLookupTable::reset (  ) 

Reset colormap.

Definition at line 180 of file lookuptable.cpp.

References YuvColormap::reset().


The documentation for this class was generated from the following files: