26#ifndef __TERRALIB_RP_INTERNAL_PALETTERASTER_H
27#define __TERRALIB_RP_INTERNAL_PALETTERASTER_H
106 double Mean(
int i) {
return (i < 3 && i >= 0) ? (
m_mean[i]) : (0); }
187 double Mean(
int i) {
return (i < 3 && i >= 0 &&
m_pop != 0) ? ((double)
m_Ex[i] /
m_pop) : ((double)0); }
240 int palettesize = 256);
262 std::vector< te::rst::BandProperty::ColorEntry >
m_palette;
std::list< CubeColor * > m_CClist
list of CubeColors present in the Image
int m_firstvg
fisrt valid green value
short m_blockb[256]
blue grouping block
te::map::RasterTransform * m_rasterTransform
Raster Transformation from input raster.
std::vector< te::rst::BandProperty::ColorEntry > getPalette()
Gets the generated palette.
std::vector< te::rst::BandProperty::ColorEntry > m_palette
generated palette
short m_blockg[256]
green grouping block
unsigned int m_outNCols
output columns number
unsigned int m_outNRows
output rows number
int m_ngc
number of GroupColors
CubeColor **** hist
histogram of CubeColors
double ** m_lut
lut - values found for each channel (R,G,B)
Codifima(const te::rst::Raster &inputRaster, te::map::RasterTransform &rasterTransform, te::rst::Raster &outRasterPtr, int palettesize=256)
Codifies a rgb raster to a paletta raster.
int m_lastvr
last valid red value
void DeallocateMatclass()
int m_lastvg
last valid green value
bool Apply()
Aplies the method.
int m_firstvb
fisrt valid blue value
int *** matclass
classification matrix
int m_firstvr
fisrt valid red value
short m_blockr[256]
red grouping block
const te::rst::Raster * m_inputRaster
input rgb raster
~Codifima()
Normal destructor.
int m_lastvb
last valid blue value
te::rst::Raster * m_outputRaster
output palette raster
te::rst::Band * m_outBand
output band
GroupColor ** m_GC
array of GroupColors
int m_finalcolors
final number of colors found
Defines a cubic volume in the RGB color space.
int IndexG()
Get green component of cube center.
void InsertTripleRGB(int r, int g, int b)
Inserts a triple rgb in CubeColor.
double m_mean[3]
Mean of triples from an Image rgb belonging to this CubeColor.
int m_igc
Index of GroupColor associated with CubeColor.
int IndexR()
Get red component of cube center.
double Pop()
Get number of Image rgb triples in the CubeColor.
int IndexB()
Get blue component of cube center.
double m_pop
Number of Image rgb triples in the CubeColor.
int m_ibg
Index of color green in the color cube space.
double Mean(int i)
Get i-th mean color component value.
CubeColor(int ir, int ig, int ib)
CubeColor constructor.
int m_ibb
Index of color blue in the color cube space.
void SetGroupColorIndex(int index)
Sets group color index.
int GroupColorIndex()
Get the index of GroupColor associated with CubeColor.
int m_ibr
Index of color red in the color cube space.
Defines a classification context.
GroupColor * Split(int newgcid)
Splits the GroupColor in two ones. The new GroupColor will have its id given by newgcid....
void InsertCubeColor(CubeColor *cc)
Inserts a CubeColor in the List.
double m_pop
population of group color
double m_Ex2[3]
Expectation of squared means of CubeColors belonging to this GroupColor.
int m_id
Id of GroupColor.
GroupColor(int ident)
Constructor.
double m_var[3]
Variance in each dimension of CubeColors belonging to this GroupColor.
std::list< CubeColor * > m_CClist
List of pointers to CubeColors.
double m_Ex[3]
Expectation of means of CubeColors belonging to this GroupColor.
size_t GetNCubeColors()
Returns the number of CubeColors in this GroupColor.
double MaxVar()
Returns the biggest variance.
double Mean(int i)
Return Mean[i] of GroupColor.
std::list< CubeColor * >::iterator m_itCC
iterator to CubeColors list
CubeColor * RemoveCubeColor()
Removes the current item from the list.
double m_varmax
Biggest variance.
A raster band description.
An abstract class for raster data strucutures.
Namespace for Raster Processing module of TerraLib.
It gives access to values in one band (dimension) of a raster.
A rectified grid is the spatial support for raster data.
An abstract class for raster data strucutures.
Configuration flags for the Raster Processing module of TerraLib.
#define TERPEXPORT
You can use this macro in order to export/import classes and functions from this module.