vtdata library
Public Member Functions | Public Attributes
ColorMap Class Reference

List of all members.

Public Member Functions

bool Save (const char *fname) const
bool Load (const char *fname)
void Add (float elev, const RGBi &color)
void RemoveAt (int num)
void Clear ()
int Num () const
void GenerateColors (std::vector< RGBi > &table, int iTableSize, float fMin, float fMax) const

Public Attributes

bool m_bBlend
bool m_bRelative
std::vector< float > m_elev
std::vector< RGBim_color

Detailed Description

This small class describes how to map elevation (as from a heightfield) onto a set of colors.


Member Function Documentation

void ColorMap::Add ( float  elev,
const RGBi color 
)

Add a color entry, keeping the elevation values sorted.

void ColorMap::GenerateColors ( std::vector< RGBi > &  table,
int  iTableSize,
float  fMin,
float  fMax 
) const

Generate an array of interpolated colors from this ColorMap.

Parameters:
tableAn empty table ready to fill with the interpolated colors.
iTableSizeThe desired number of elements in the resulting table.
fMin,fMaxThe elevation range to interpolate over.
 All Classes Files Functions Variables Enumerations Enumerator