Main Page   Class Hierarchy   Alphabetical List   Compound List   Compound Members  

prapi::Indexer Class Reference

#include <Indexer.h>

List of all members.


Detailed Description

Indexer produces integer-valued matrices out of multi-channel color matrices or double-valued matrices.


Static Public Methods

Matrix< int > flatten (const Matrix< RGBColor<> > &mat, int levels, int originalLevels)
 Create an indexed matrix out of a color matrix.

Matrix< int > flatten (const Matrix< RGBColor<> > &mat, Quantizer &r, Quantizer &g, Quantizer &b) throw (QuantizationException&)
 Create an indexed matrix out of a color matrix.

Matrix< int > quantize (const Matrix< double > &mat, Quantizer &q) throw (QuantizationException&)
 Generate an integer-valued matrix out of a double-valued matrix.


Member Function Documentation

Matrix< int > prapi::Indexer::flatten const Matrix< RGBColor<> > &    mat,
Quantizer   r,
Quantizer   g,
Quantizer   b
throw (QuantizationException&) [static]
 

Create an indexed matrix out of a color matrix.

Each color channel is quantized using a different quantizer. The total number of levels in the output will equal to r.getLevels() * g.getLevels() * b.getLevels().

Parameters:
mat  the matrix to be indexed
r  a quantizer for the red color channel
g  a quantizer for the green color channel
b  a quantizer for the blue color channel
Exceptions:
QuantizationException  & if a quantization error occurs

Matrix< int > prapi::Indexer::flatten const Matrix< RGBColor<> > &    mat,
int    levels,
int    originalLevels
[static]
 

Create an indexed matrix out of a color matrix.

Each color channel is quantized to levels levels. Each channel is thus given an index in the range [0,levels-1]. The index for a color is calculated by: R*levels2 + G*levels + B. The maximum index will thus be index3-1.

Parameters:
mat  the matrix to be indexed
levels  the number of output levels
originalLevels  the maximum value for a color channel before flattening

Matrix< int > prapi::Indexer::quantize const Matrix< double > &    mat,
Quantizer   q
throw (QuantizationException&) [static]
 

Generate an integer-valued matrix out of a double-valued matrix.

Each floating-point value is passed to a quantizer and the returned value is placed in the result matrix.

Parameters:
mat  the matrix to be quantized
q  the quantizer


The documentation for this class was generated from the following files:
Documentation generated on 11.09.2003 with Doxygen.
The documentation is copyrighted material.
Copyright © Topi Mäenpää 2003. All rights reserved.