|
last update 20 Sep 2009 |
|
#include <cvrUsePalette.h>


Public Member Functions | |
| parameters () | |
| parameters (const parameters &other) | |
| ~parameters () | |
| const std::string & | name () const |
| parameters & | copy (const parameters &other) |
| parameters & | operator= (const parameters &other) |
| virtual parameters * | clone () const |
| virtual parameters * | newInstance () 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 |
| cvr::usePalette::usePalette::parameters::parameters | ( | ) |
| cvr::usePalette::usePalette::parameters::parameters | ( | const parameters & | other | ) |
copy constructor
| other | the parameters object to be copied |
Reimplemented from cvr::functor::functor::parameters.
| cvr::usePalette::usePalette::parameters::~parameters | ( | ) | [virtual] |
| virtual parameters* cvr::usePalette::usePalette::parameters::clone | ( | ) | const [virtual] |
| parameters& cvr::usePalette::usePalette::parameters::copy | ( | const parameters & | other | ) |
copy the contents of a parameters object
| other | the parameters object to be copied |
| const std::string& cvr::usePalette::usePalette::parameters::name | ( | ) | const [virtual] |
| virtual parameters* cvr::usePalette::usePalette::parameters::newInstance | ( | ) | const [virtual] |
| parameters& cvr::usePalette::usePalette::parameters::operator= | ( | const parameters & | other | ) |
copy the contents of a parameters object
| other | the parameters object to be copied |
| virtual bool cvr::usePalette::usePalette::parameters::read | ( | ioHandler & | handler, | |
| const bool | complete = true | |||
| ) | [virtual] |
write the parameters in the given ioHandler
| 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. |
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
| 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. |
Reimplemented from cvr::parametersManager::parametersManager::parameters.
| 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 |
| 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 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)