ColorPallet Class Reference

Volume color pallet table. Similar to GMT CPT, but has differences. More...

List of all members.

Public Types

enum  ColorModel {
  UNKNOWN_CLR_MODEL, ALPHA, LUM_ALPHA, RGBA,
  HSVA
}

Public Member Functions

 ColorPallet (const string &filename, bool &ok)
 Create a new color pallet table.
bool getRGBA (const size_t offset, float &r, float &g, float &b, float &a) const
 Retrief the RGB value for a cell level.
bool setRGBA (const size_t offset, const float r, const float g, const float b, const float a)
 Set the RGB value for a cell level.
void setColorModel (const ColorModel cm)
ColorModel getColorModel () const

Private Member Functions

bool checkColorModel (const string &str)
 Look for a color model = string and set the type.
bool insertCmapEntryRGBA (const float v1, const float r1, const float g1, const float b1, const float a1, const float v2, const float r2, const float g2, const float b2, const float a2)
bool handleA_Line (const string &bufStr)
bool handleLA_Line (const string &bufStr)
bool handleRGBA_Line (const string &bufStr)
bool handleHSVA_Line (const string &bufStr)

Private Attributes

vector< float > r
vector< float > g
vector< float > b
vector< float > a
ColorModel colorModel


Detailed Description

Volume color pallet table. Similar to GMT CPT, but has differences.


Member Enumeration Documentation

enum ColorPallet::ColorModel
 

Enumerator:
UNKNOWN_CLR_MODEL 
ALPHA 
LUM_ALPHA 
RGBA 
HSVA 


Constructor & Destructor Documentation

ColorPallet::ColorPallet const string &  filename,
bool &  ok
 

Create a new color pallet table.

Parameters:
filename File to load a GMT style cpt from
ok true if load went ok


Member Function Documentation

bool ColorPallet::checkColorModel const string &  str  )  [private]
 

Look for a color model = string and set the type.

ColorModel ColorPallet::getColorModel  )  const [inline]
 

bool ColorPallet::getRGBA const size_t  offset,
float &  r,
float &  g,
float &  b,
float &  a
const
 

Retrief the RGB value for a cell level.

Parameters:
offset must be between 0 and 255
r,g,b,a Return the red, green, blue, and alpha value for offset. Values are [0..1]
Returns:
false if there was trouble. For example a bad offset

bool ColorPallet::handleA_Line const string &  bufStr  )  [private]
 

bool ColorPallet::handleHSVA_Line const string &  bufStr  )  [private]
 

bool ColorPallet::handleLA_Line const string &  bufStr  )  [private]
 

bool ColorPallet::handleRGBA_Line const string &  bufStr  )  [private]
 

bool ColorPallet::insertCmapEntryRGBA const float  v1,
const float  r1,
const float  g1,
const float  b1,
const float  a1,
const float  v2,
const float  r2,
const float  g2,
const float  b2,
const float  a2
[private]
 

void ColorPallet::setColorModel const ColorModel  cm  )  [inline]
 

bool ColorPallet::setRGBA const size_t  offset,
const float  r,
const float  g,
const float  b,
const float  a
 

Set the RGB value for a cell level.

Parameters:
offset must be between 0 and 255
r,g,b,a 0..1 values for red, green, blue, and alpha value for offset
Returns:
false if there was trouble. For example a bad offset


Member Data Documentation

vector<float> ColorPallet::a [private]
 

vector<float> ColorPallet::b [private]
 

ColorModel ColorPallet::colorModel [private]
 

vector<float> ColorPallet::g [private]
 

vector<float> ColorPallet::r [private]
 


The documentation for this class was generated from the following file:
Generated on Thu Mar 2 17:55:25 2006 for density by  doxygen 1.4.6