casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | Friends
casa::ColormapDefinition Class Reference

#include <ColormapDefinition.h>

List of all members.

Public Types

typedef std::map< String, bool > colormapnamemap
 Return the names of the built-in colormaps.

Public Member Functions

 ColormapDefinition ()
 Construct a single color (white) Colormap.
 ColormapDefinition (const String &mapName)
 Construct the known Colormap mapName, first looking for a saved Colormap having this name, then resorting to a built-in Colormap, and if that doesn't exist, throw an error.
 ColormapDefinition (const String &mapName, const Vector< Float > &reds, const Vector< Float > &greens, const Vector< Float > &blues)
 Construct a new Colormap, using the supplied name and component vectors.
void getValue (const Float t, Float &red, Float &green, Float &blue) const
 Obtain the Colormap value for the "index" value 0 <= t <= 1
void setValues (const Vector< Float > &reds, const Vector< Float > &greens, const Vector< Float > &blues)
 Change the Colormap values with the provided component vectors.
Bool save (const String &fullPathName, const Vector< String > &synonyms, const Bool &overwrite=True) const
 Write this ColormapDefinition to the named Table in the named directory (default values are obtained from the user's .aipsrc file.
Bool loadColormap (const String &name)
 Load Colormap definitions for a specified colormapname
Bool loadBuiltinColormap (const String &name)

Static Public Member Functions

static colormapnamemap builtinColormapNames (Bool uniqueonly=True)

Private Member Functions

Bool queryColormapTable (const Table &table, const String &name)
 Utility function to look if a colormap name is in a Table.

Static Private Member Functions

static void loadColormapTable ()
 load ColormapDefinitions from default location aips++/data/colormaps/default.tbl and/or location specified in display.colormaps.usertable

Private Attributes

String itsName
 The name of this ColormapDefinition.
Vector< FloatitsReds
 The Color component vectors for this ColormapDefinition.
Vector< FloatitsGreens
Vector< FloatitsBlues

Static Private Attributes

static String ourDefaultColormap
 The loaded colormaps (a replacement for the builtins)
static Table ourDefaultColormapTable
static Table ourUserColormapTable
static String ourTableVersion

Friends

ostream & operator<< (ostream &os, const ColormapDefinition &pcreh)
 Write a ColormapDefinition to an ostream in a simple text form.

Detailed Description

Definition at line 122 of file ColormapDefinition.h.


Member Typedef Documentation

Return the names of the built-in colormaps.

If uniqueonly is True (default), only the names of the unique colormaps are returned, otherwise all colormap names are returned.

Definition at line 170 of file ColormapDefinition.h.


Constructor & Destructor Documentation

Construct a single color (white) Colormap.

casa::ColormapDefinition::ColormapDefinition ( const String mapName) [explicit]

Construct the known Colormap mapName, first looking for a saved Colormap having this name, then resorting to a built-in Colormap, and if that doesn't exist, throw an error.

casa::ColormapDefinition::ColormapDefinition ( const String mapName,
const Vector< Float > &  reds,
const Vector< Float > &  greens,
const Vector< Float > &  blues 
)

Construct a new Colormap, using the supplied name and component vectors.


Member Function Documentation

void casa::ColormapDefinition::getValue ( const Float  t,
Float red,
Float green,
Float blue 
) const

Obtain the Colormap value for the "index" value 0 <= t <= 1

Load Colormap definitions for a specified colormapname

static void casa::ColormapDefinition::loadColormapTable ( ) [static, private]

load ColormapDefinitions from default location aips++/data/colormaps/default.tbl and/or location specified in display.colormaps.usertable

Bool casa::ColormapDefinition::queryColormapTable ( const Table table,
const String name 
) [private]

Utility function to look if a colormap name is in a Table.

Bool casa::ColormapDefinition::save ( const String fullPathName,
const Vector< String > &  synonyms,
const Bool overwrite = True 
) const

Write this ColormapDefinition to the named Table in the named directory (default values are obtained from the user's .aipsrc file.

If overwrite is True, then an existing map of the same name in the Table will be over-written. If the named Table does not exist, it will be created.

The table format has to conform with following scheme. It must have five columns: CMAP_NAME a String RED a Float array of dim n GREEN a Float array of dim n BLUE a Float array of dim n SYNONYMS a String array of dim m

void casa::ColormapDefinition::setValues ( const Vector< Float > &  reds,
const Vector< Float > &  greens,
const Vector< Float > &  blues 
)

Change the Colormap values with the provided component vectors.


Friends And Related Function Documentation

ostream& operator<< ( ostream &  os,
const ColormapDefinition pcreh 
) [friend]

Write a ColormapDefinition to an ostream in a simple text form.


Member Data Documentation

Definition at line 205 of file ColormapDefinition.h.

Definition at line 204 of file ColormapDefinition.h.

The name of this ColormapDefinition.

Definition at line 184 of file ColormapDefinition.h.

The Color component vectors for this ColormapDefinition.

Definition at line 203 of file ColormapDefinition.h.

The loaded colormaps (a replacement for the builtins)

Definition at line 196 of file ColormapDefinition.h.

Definition at line 197 of file ColormapDefinition.h.

Definition at line 199 of file ColormapDefinition.h.

Definition at line 198 of file ColormapDefinition.h.


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