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

Describes a method of generating a table of colors. More...

#include <Colormap.h>

List of all members.

Public Member Functions

 Colormap ()
 Default Constructor Required.
 Colormap (const String &name)
 User Constructor.
virtual ~Colormap ()
 Destructor.
Bool rigid () const
 If rigid is True, the colormap must be installed at a specific size.
void setRigid (Bool b)
uInt rigidSize () const
 What is the size enforced by the rigid requirement?
void setRigidSize (uInt s)
virtual Bool calcRGBMaps (uInt reqSize, Vector< Float > &redMap, Vector< Float > &greenMap, Vector< Float > &blueMap) const
 Compute RGB values using the definition and shape function.
const Stringname () const
 return the name of the map
void setName (const String &mapName)
void registerPCColorTable (PixelCanvasColorTable *pcctbl)
 Register/Unregister a PixelCanvasColorTable that uses this Colormap.
void unregisterPCColorTable (PixelCanvasColorTable *pcctbl)
void setBrightness (const Float &brightness, const Bool &doReinstall=True)
 set/get the colormap brightness level in range 0 to 1
Float getBrightness () const
void setContrast (const Float &contrast, const Bool &doReinstall=True)
 set/get the colormap contrast level
Float getContrast () const
void setInvertFlags (const Bool &red, const Bool &green, const Bool &blue, const Bool &doReinstall=True)
 set/get the inverse flags
void getInvertFlags (Bool &red, Bool &green, Bool &blue) const
void doResizeCallbacks ()
 Do resizeCallbacks on the PixelCanvasColorTables that use this Colormap.
void setShapingFunction (Function1D< Float, Float > *shapingfunc=0)
 Set the Colormap shaping function.
void setShapingCoefficients (const Vector< Float > &params, const Bool &doReinstall=True)
 Set and retrieve the coefficients of the shaping function.
const Vector< FloatgetShapingCoefficients () const
ColormapDefinitiondefinition ()
 Provide access to the colormap definition.
void setColormapDefinition (ColormapDefinition *definition)

Protected Member Functions

void reinstall ()
 reinstall this Colormap on the registered PixelCanvasColorTables

Private Types

enum  { ColormapVersion }

Private Attributes

String itsName
 name of this Colormap.
Bool itsIsRigid
 is this Colormap rigid?
uInt itsRigidSize
 what is its rigid size?
Float itsBrightness
 levels
Float itsBrightnessScale
Float itsContrast
Float itsContrastScale
Bool itsInvertRed
 invert flags
Bool itsInvertGreen
Bool itsInvertBlue
ColormapDefinitionitsColormapDefinition
Function1D< Float, Float > * itsShapingFunction
 function for shaping the colormap
Bool itsOwnShapingFunction
SimpleOrderedMap
< PixelCanvasColorTable
*, uInt
itsPCColorTables

Friends

ostream & operator<< (ostream &os, const Colormap &c)
 Write a Colormap to an ostream in a simple text form.
AipsIOoperator<< (AipsIO &aio, const Colormap &c)
 Write a Colormap to an AipsIO stream in a binary format.
LogIOoperator<< (LogIO &lio, const Colormap &c)
 Write a Colormap to a LogIO stream.
AipsIOoperator>> (AipsIO &aio, Colormap &c)
 Read a Colormap from an AipsIO stream in a binary format.

Detailed Description

Describes a method of generating a table of colors.

Etymology

The name of Colormap comes from ...

Synopsis

A Colormap is a class which is capable of generating a table of colormaps for the ColormapManager. The Colormap's duties are to fill a Vector of colors of a specific size.

A Colormap can operate in two modes:

Definition at line 100 of file Colormap.h.


Member Enumeration Documentation

anonymous enum [private]
Enumerator:
ColormapVersion 

Definition at line 232 of file Colormap.h.


Constructor & Destructor Documentation

Default Constructor Required.

casa::Colormap::Colormap ( const String name) [explicit]

User Constructor.

virtual casa::Colormap::~Colormap ( ) [virtual]

Destructor.


Member Function Documentation

virtual Bool casa::Colormap::calcRGBMaps ( uInt  reqSize,
Vector< Float > &  redMap,
Vector< Float > &  greenMap,
Vector< Float > &  blueMap 
) const [virtual]

Compute RGB values using the definition and shape function.

Provide access to the colormap definition.

Definition at line 199 of file Colormap.h.

References itsColormapDefinition.

Do resizeCallbacks on the PixelCanvasColorTables that use this Colormap.

Definition at line 152 of file Colormap.h.

References itsBrightness.

Float casa::Colormap::getContrast ( ) const [inline]

Definition at line 158 of file Colormap.h.

References itsContrast.

void casa::Colormap::getInvertFlags ( Bool red,
Bool green,
Bool blue 
) const
const String& casa::Colormap::name ( ) const [inline]

return the name of the map

Definition at line 137 of file Colormap.h.

References itsName.

Register/Unregister a PixelCanvasColorTable that uses this Colormap.

void casa::Colormap::reinstall ( ) [protected]

reinstall this Colormap on the registered PixelCanvasColorTables

Bool casa::Colormap::rigid ( ) const [inline]

If rigid is True, the colormap must be installed at a specific size.

Definition at line 116 of file Colormap.h.

References itsIsRigid.

uInt casa::Colormap::rigidSize ( ) const [inline]

What is the size enforced by the rigid requirement?

Definition at line 124 of file Colormap.h.

References itsRigidSize.

void casa::Colormap::setBrightness ( const Float brightness,
const Bool doReinstall = True 
)

set/get the colormap brightness level in range 0 to 1

void casa::Colormap::setContrast ( const Float contrast,
const Bool doReinstall = True 
)

set/get the colormap contrast level

void casa::Colormap::setInvertFlags ( const Bool red,
const Bool green,
const Bool blue,
const Bool doReinstall = True 
)

set/get the inverse flags

void casa::Colormap::setName ( const String mapName) [inline]

Definition at line 139 of file Colormap.h.

References itsName.

void casa::Colormap::setRigid ( Bool  b) [inline]

Definition at line 118 of file Colormap.h.

References itsIsRigid.

void casa::Colormap::setRigidSize ( uInt  s) [inline]

Definition at line 126 of file Colormap.h.

References itsRigidSize.

void casa::Colormap::setShapingCoefficients ( const Vector< Float > &  params,
const Bool doReinstall = True 
)

Set and retrieve the coefficients of the shaping function.

void casa::Colormap::setShapingFunction ( Function1D< Float, Float > *  shapingfunc = 0)

Set the Colormap shaping function.

If the argument is 0, then resort to using the default shaping function, which happens to be a polynomial of order 1.


Friends And Related Function Documentation

ostream& operator<< ( ostream &  os,
const Colormap c 
) [friend]

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

AipsIO& operator<< ( AipsIO aio,
const Colormap c 
) [friend]

Write a Colormap to an AipsIO stream in a binary format.

LogIO& operator<< ( LogIO lio,
const Colormap c 
) [friend]

Write a Colormap to a LogIO stream.

AipsIO& operator>> ( AipsIO aio,
Colormap c 
) [friend]

Read a Colormap from an AipsIO stream in a binary format.

Will throw an AipsError if the current Colormap Version does not match that of the one on disk.


Member Data Documentation

levels

Definition at line 219 of file Colormap.h.

Referenced by getBrightness().

Definition at line 219 of file Colormap.h.

Definition at line 224 of file Colormap.h.

Referenced by definition().

Definition at line 220 of file Colormap.h.

Referenced by getContrast().

Definition at line 220 of file Colormap.h.

Definition at line 222 of file Colormap.h.

Definition at line 222 of file Colormap.h.

invert flags

Definition at line 222 of file Colormap.h.

is this Colormap rigid?

Definition at line 213 of file Colormap.h.

Referenced by rigid(), and setRigid().

name of this Colormap.

Definition at line 210 of file Colormap.h.

Referenced by name(), and setName().

Definition at line 228 of file Colormap.h.

Definition at line 230 of file Colormap.h.

what is its rigid size?

Definition at line 216 of file Colormap.h.

Referenced by rigidSize(), and setRigidSize().

function for shaping the colormap

Definition at line 227 of file Colormap.h.


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