casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
casa::ColormapDefinition Class Reference

#include <ColormapDefinition.h>

Public Types

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

Public Member Functions

 ColormapDefinition ()
 Construct a single color (white) Colormap. More...
 
 ColormapDefinition (const casacore::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. More...
 
 ColormapDefinition (const casacore::String &mapName, const casacore::Vector< casacore::Float > &reds, const casacore::Vector< casacore::Float > &greens, const casacore::Vector< casacore::Float > &blues)
 Construct a new Colormap, using the supplied name and component vectors. More...
 
void getValue (const casacore::Float t, casacore::Float &red, casacore::Float &green, casacore::Float &blue) const
 Obtain the Colormap value for the "index" value 0 <= t <= 1 More...
 
void setValues (const casacore::Vector< casacore::Float > &reds, const casacore::Vector< casacore::Float > &greens, const casacore::Vector< casacore::Float > &blues)
 Change the Colormap values with the provided component vectors. More...
 
casacore::Bool save (const casacore::String &fullPathName, const casacore::Vector< casacore::String > &synonyms, const casacore::Bool &overwrite=true) const
 Write this ColormapDefinition to the named casacore::Table in the named directory (default values are obtained from the user's .aipsrc file. More...
 
casacore::Bool loadColormap (const casacore::String &name)
 Load Colormap definitions for a specified colormapname More...
 
casacore::Bool loadBuiltinColormap (const casacore::String &name)
 

Static Public Member Functions

static colormapnamemap builtinColormapNames (casacore::Bool uniqueonly=true)
 
static void shutdown ()
 

Private Member Functions

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

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 More...
 

Private Attributes

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

Static Private Attributes

static casacore::String ourDefaultColormap
 The loaded colormaps (a replacement for the builtins) More...
 
static std::shared_ptr
< casacore::Table
ourDefaultColormapTable
 
static std::shared_ptr
< casacore::Table
ourUserColormapTable
 
static casacore::String ourTableVersion
 

Friends

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

Detailed Description

Definition at line 126 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 174 of file ColormapDefinition.h.

Constructor & Destructor Documentation

casa::ColormapDefinition::ColormapDefinition ( )

Construct a single color (white) Colormap.

casa::ColormapDefinition::ColormapDefinition ( const casacore::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 casacore::String mapName,
const casacore::Vector< casacore::Float > &  reds,
const casacore::Vector< casacore::Float > &  greens,
const casacore::Vector< casacore::Float > &  blues 
)

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

Member Function Documentation

static colormapnamemap casa::ColormapDefinition::builtinColormapNames ( casacore::Bool  uniqueonly = true)
static
void casa::ColormapDefinition::getValue ( const casacore::Float  t,
casacore::Float red,
casacore::Float green,
casacore::Float blue 
) const

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

casacore::Bool casa::ColormapDefinition::loadBuiltinColormap ( const casacore::String name)
casacore::Bool casa::ColormapDefinition::loadColormap ( const casacore::String name)

Load Colormap definitions for a specified colormapname

static void casa::ColormapDefinition::loadColormapTable ( )
staticprivate

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

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

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

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

Write this ColormapDefinition to the named casacore::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 casacore::Table will be over-written. If the named casacore::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 casacore::Float array of dim n GREEN a casacore::Float array of dim n BLUE a casacore::Float array of dim n SYNONYMS a casacore::String array of dim m

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

Change the Colormap values with the provided component vectors.

static void casa::ColormapDefinition::shutdown ( )
inlinestatic

Definition at line 185 of file ColormapDefinition.h.

References ourDefaultColormapTable, and ourUserColormapTable.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const ColormapDefinition pcreh 
)
friend

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

Member Data Documentation

casacore::Vector<casacore::Float> casa::ColormapDefinition::itsBlues
private

Definition at line 214 of file ColormapDefinition.h.

casacore::Vector<casacore::Float> casa::ColormapDefinition::itsGreens
private

Definition at line 213 of file ColormapDefinition.h.

casacore::String casa::ColormapDefinition::itsName
private

The name of this ColormapDefinition.

Definition at line 193 of file ColormapDefinition.h.

casacore::Vector<casacore::Float> casa::ColormapDefinition::itsReds
private

The Color component vectors for this ColormapDefinition.

Definition at line 212 of file ColormapDefinition.h.

casacore::String casa::ColormapDefinition::ourDefaultColormap
staticprivate

The loaded colormaps (a replacement for the builtins)

Definition at line 205 of file ColormapDefinition.h.

std::shared_ptr<casacore::Table> casa::ColormapDefinition::ourDefaultColormapTable
staticprivate

Definition at line 206 of file ColormapDefinition.h.

Referenced by shutdown().

casacore::String casa::ColormapDefinition::ourTableVersion
staticprivate

Definition at line 208 of file ColormapDefinition.h.

std::shared_ptr<casacore::Table> casa::ColormapDefinition::ourUserColormapTable
staticprivate

Definition at line 207 of file ColormapDefinition.h.

Referenced by shutdown().


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