CVR-Lib last update 20 Sep 2009

cvr::usePalette::usePalette::parameters Class Reference

the parameters for the class usePalette More...

#include <cvrUsePalette.h>

Inheritance diagram for cvr::usePalette::usePalette::parameters:

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

Collaboration graph
[legend]

List of all members.

Public Member Functions

 parameters ()
 parameters (const parameters &other)
 ~parameters ()
const std::string & name () const
parameterscopy (const parameters &other)
parametersoperator= (const parameters &other)
virtual parametersclone () const
virtual parametersnewInstance () 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

cvr::usePalette::usePalette::parameters::parameters (  ) 

default constructor

Reimplemented from cvr::functor::functor::parameters.

cvr::usePalette::usePalette::parameters::parameters ( const parameters other  ) 

copy constructor

Parameters:
other the parameters object to be copied

Reimplemented from cvr::functor::functor::parameters.

cvr::usePalette::usePalette::parameters::~parameters (  )  [virtual]

destructor

Reimplemented from cvr::functor::functor::parameters.


Member Function Documentation

virtual parameters* cvr::usePalette::usePalette::parameters::clone (  )  const [virtual]

returns a pointer to a clone of the parameters

Implements cvr::functor::functor::parameters.

parameters& cvr::usePalette::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 std::string& cvr::usePalette::usePalette::parameters::name (  )  const [virtual]

returns name of this type

Implements cvr::functor::functor::parameters.

virtual parameters* cvr::usePalette::usePalette::parameters::newInstance (  )  const [virtual]

returns a pointer to a new instance of the parameters

Implements cvr::functor::functor::parameters.

parameters& cvr::usePalette::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 cvr::usePalette::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 cvr::parametersManager::parametersManager::parameters.

virtual bool cvr::usePalette::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 cvr::parametersManager::parametersManager::parameters.


Member Data Documentation

int cvr::usePalette::usePalette::parameters::bucketSize

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

palette cvr::usePalette::usePalette::parameters::colors

The palette to be used.

This is the vector of rgbaPixel values to be used.

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

bool cvr::usePalette::usePalette::parameters::kdTreeOnDemand

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

bool cvr::usePalette::usePalette::parameters::linearSearch

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 Sun Sep 20 22:08:53 2009 for CVR-Lib by Doxygen 1.5.8