LTI-Lib latest version v1.9 - last update 10 Apr 2010

lti::usePalette::parameters Class Reference

the parameters for the class usePalette More...

#include <ltiUsePalette.h>

Inheritance diagram for lti::usePalette::parameters:
Inheritance graph
[legend]
Collaboration diagram for lti::usePalette::parameters:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 parameters ()
 parameters (const parameters &other)
 ~parameters ()
const char * getTypeName () const
parameterscopy (const parameters &other)
parametersoperator= (const parameters &other)
virtual functor::parametersclone () const
virtual bool write (ioHandler &handler, const bool complete=true) const
virtual bool read (ioHandler &handler, const bool complete=true)

Public Attributes

palette colors
bool linearSearch
bool kdTreeOnDemand
int bucketSize

Detailed Description

the parameters for the class usePalette


Constructor & Destructor Documentation

lti::usePalette::parameters::parameters (  ) 

default constructor

Reimplemented from lti::functor::parameters.

lti::usePalette::parameters::parameters ( const parameters other  ) 

copy constructor

Parameters:
other the parameters object to be copied
lti::usePalette::parameters::~parameters (  )  [virtual]

destructor

Reimplemented from lti::functor::parameters.


Member Function Documentation

virtual functor::parameters* lti::usePalette::parameters::clone (  )  const [virtual]

returns a pointer to a clone of the parameters

Implements lti::functor::parameters.

parameters& lti::usePalette::parameters::copy ( const parameters other  ) 

copy the contents of a parameters object

Parameters:
other the parameters object to be copied
Returns:
a reference to this parameters object
const char* lti::usePalette::parameters::getTypeName (  )  const [virtual]

returns name of this type

Reimplemented from lti::functor::parameters.

parameters& lti::usePalette::parameters::operator= ( const parameters other  ) 

copy the contents of a parameters object

Parameters:
other the parameters object to be copied
Returns:
a reference to this parameters object
virtual bool lti::usePalette::parameters::read ( ioHandler handler,
const bool  complete = true 
) [virtual]

write the parameters in the given ioHandler

Parameters:
handler the ioHandler to be used
complete if true (the default) the enclosing begin/end will be also written, otherwise only the data block will be written.
Returns:
true if write was successful

Reimplemented from lti::functor::parameters.

virtual bool lti::usePalette::parameters::write ( ioHandler handler,
const bool  complete = true 
) const [virtual]

write the parameters in the given ioHandler

Parameters:
handler the ioHandler to be used
complete if true (the default) the enclosing begin/end will be also written, otherwise only the data block will be written.
Returns:
true if write was successful

Reimplemented from lti::functor::parameters.


Member Data Documentation

Each leaf node of the k-d Tree can contain a number of palette entries greater than one.

A linear search method takes place on sets of maximal this size.

Default value: 16

The palette to be used.

This is the vector of rgbPixel values to be used.

Default Palete: gray-value palette (256 entries, where ( colors.at(i) == rgbPixel(i,i,i) )

For those apply methods that get directly a palette or k-d Tree, this parameter will be ignored.

For all other methods that use the color entries in the colors attribute this parameter determines when to compute the k-d Tree (only if linearSearch is set to false):

  • If true, the k-d Tree is computed the first time an apply() method is called. This can take little bit time, and the total time execution for this first apply can be longer than a simple linear search (when the images are too small, for example).
  • If false, the k-d Tree is computed when the parameters are set.

If you want to apply the same palette to many different images, set this parameter to false in order to force the computation of the k-d Tree off-line.

Default value: false

To efficiently get the best entry in a palette, other techniques besides the "brute force" linear search exist.

This functor can also use k-d trees.

This makes only sense if the same palette is going to be used with different images, or if the images are big enough to compensate the overhead of generating the k-d tree, task which only depends on the size of the color palette.

If this attribute is set to true, the linear search will be used, avoiding the computation of the k-d Tree.

If set to false, a k-d Tree will be computed from the colors attribute at a time determined by the attribute kdTreeOnDemand.

Default value: false (i.e. use k-d trees)


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

Generated on Sat Apr 10 15:27:58 2010 for LTI-Lib by Doxygen 1.6.1