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

lti::kMColorQuantization Class Reference

k-Means based color quantization. More...

#include <ltiKMColorQuantization.h>

Inheritance diagram for lti::kMColorQuantization:
Inheritance graph
[legend]
Collaboration diagram for lti::kMColorQuantization:
Collaboration graph
[legend]

List of all members.

Classes

class  parameters
 the parameters for the class kMColorQuantization More...

Public Member Functions

 kMColorQuantization ()
 kMColorQuantization (const parameters &par)
 kMColorQuantization (const kMColorQuantization &other)
virtual ~kMColorQuantization ()
const parametersgetParameters () const
kMColorQuantizationcopy (const kMColorQuantization &other)
virtual functorclone () const
virtual const char * getTypeName () const
bool apply (const image &src, matrix< int > &dest, palette &thePalette) const
bool apply (const image &src, channel8 &dest, palette &thePalette) const
bool apply (image &srcdest) const
bool apply (const image &src, image &dest) const

Detailed Description

k-Means based color quantization.

This functor calculates (using k-Means) an optimal color subpalette for the input image. The maximal number of colors to be used is given through the parameters (inherited from colorQuantization::parameters).

If the real number of colors used in the image is less than the desired number of quantized colors, no quantization is done and the output palette will contain all image colors, i.e. it will be smaller that the expected size of parameters::numberOfColors.


Constructor & Destructor Documentation

lti::kMColorQuantization::kMColorQuantization (  ) 

default constructor

lti::kMColorQuantization::kMColorQuantization ( const parameters par  ) 

default constructor

lti::kMColorQuantization::kMColorQuantization ( const kMColorQuantization other  ) 

copy constructor

virtual lti::kMColorQuantization::~kMColorQuantization (  )  [virtual]

destructor


Member Function Documentation

bool lti::kMColorQuantization::apply ( const image src,
image dest 
) const [virtual]

Operates on the given parameter.

Parameters:
src image with the source data.
dest image with only the number of colors specified in the parameters
Returns:
true if apply successful or false otherwise.

Reimplemented from lti::colorQuantization.

bool lti::kMColorQuantization::apply ( image srcdest  )  const [virtual]

Operates on the given parameter.

Parameters:
srcdest image with the source data. The result will be left here too.
Returns:
true if apply successful or false otherwise.

Reimplemented from lti::colorQuantization.

bool lti::kMColorQuantization::apply ( const image src,
channel8 dest,
palette thePalette 
) const [virtual]

Apply.

Operates on a copy of the given parameters.

Parameters:
src original image with the true-color data
dest channel8 where the indexes of the also calculated palette will be.
thePalette the color palette used by the channel. If it is not empty, it will be taken as a InitPalette for the computation of the new one.
Returns:
true if apply successful or false otherwise.

Implements lti::colorQuantization.

bool lti::kMColorQuantization::apply ( const image src,
matrix< int > &  dest,
palette thePalette 
) const

Apply.

Parameters:
src original image with the true-color data
dest matrix<int> where the indexes of the calculated palette will be.
thePalette the color palette used by the matrix. If it is not empty, it will be taken as a InitPalette for the computation of the new one.
Returns:
true if apply successful or false otherwise.
virtual functor* lti::kMColorQuantization::clone (  )  const [virtual]

returns a pointer to a clone of the functor.

Implements lti::colorQuantization.

kMColorQuantization& lti::kMColorQuantization::copy ( const kMColorQuantization other  ) 

copy data of "other" functor.

Reimplemented from lti::colorQuantization.

const parameters& lti::kMColorQuantization::getParameters (  )  const

returns current parameters.

Reimplemented from lti::colorQuantization.

virtual const char* lti::kMColorQuantization::getTypeName (  )  const [virtual]

returns the name of this type

Reimplemented from lti::colorQuantization.


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

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