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

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

#include <Colormap.h>

Public Member Functions

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

Protected Member Functions

void reinstall ()
 reinstall this Colormap on the registered PixelCanvasColorTables More...
 

Private Types

enum  { ColormapVersion }
 

Private Attributes

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

Friends

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

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 casacore::Vector of colors of a specific size.

A Colormap can operate in two modes:

Definition at line 104 of file Colormap.h.

Member Enumeration Documentation

anonymous enum
private
Enumerator
ColormapVersion 

Definition at line 263 of file Colormap.h.

Constructor & Destructor Documentation

casa::Colormap::Colormap ( )

Default Constructor Required.

casa::Colormap::Colormap ( const casacore::String name)
explicit

User Constructor.

virtual casa::Colormap::~Colormap ( )
virtual

Destructor.

Member Function Documentation

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

Compute RGB values using the definition and shape function.

ColormapDefinition* casa::Colormap::definition ( )
inline

Provide access to the colormap definition.

Definition at line 225 of file Colormap.h.

References itsColormapDefinition.

void casa::Colormap::doResizeCallbacks ( )

Do resizeCallbacks on the PixelCanvasColorTables that use this Colormap.

casacore::Float casa::Colormap::getAlpha ( ) const
inline

Definition at line 171 of file Colormap.h.

References itsAlpha.

casacore::Float casa::Colormap::getBrightness ( ) const
inline

Definition at line 163 of file Colormap.h.

References itsBrightness.

casacore::Float casa::Colormap::getContrast ( ) const
inline

Definition at line 179 of file Colormap.h.

References itsContrast.

void casa::Colormap::getInvertFlags ( casacore::Bool red,
casacore::Bool green,
casacore::Bool blue 
) const
const casacore::Vector<casacore::Float> casa::Colormap::getShapingCoefficients ( ) const
const casacore::String& casa::Colormap::name ( ) const
inline

return the name of the map

Definition at line 147 of file Colormap.h.

References itsName.

void casa::Colormap::registerPCColorTable ( PixelCanvasColorTable pcctbl)

Register/Unregister a PixelCanvasColorTable that uses this Colormap.

void casa::Colormap::reinstall ( )
protected

reinstall this Colormap on the registered PixelCanvasColorTables

casacore::Bool casa::Colormap::rigid ( ) const
inline

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

Definition at line 120 of file Colormap.h.

References itsIsRigid.

casacore::uInt casa::Colormap::rigidSize ( ) const
inline

What is the size enforced by the rigid requirement?

Definition at line 130 of file Colormap.h.

References itsRigidSize.

void casa::Colormap::setAlpha ( const casacore::Float brightness,
const casacore::Bool doReinstall = true 
)

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

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

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

void casa::Colormap::setColormapDefinition ( ColormapDefinition definition)
void casa::Colormap::setContrast ( const casacore::Float contrast,
const casacore::Bool doReinstall = true 
)

set/get the colormap contrast level

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

set/get the inverse flags

void casa::Colormap::setLogScale ( const casacore::Int logScale,
const casacore::Bool doReinstall = true 
)

Set whether or not the colormap should use a log scale.

void casa::Colormap::setName ( const casacore::String mapName)
inline

Definition at line 150 of file Colormap.h.

References itsName.

void casa::Colormap::setRigid ( casacore::Bool  b)
inline

Definition at line 123 of file Colormap.h.

References itsIsRigid.

void casa::Colormap::setRigidSize ( casacore::uInt  s)
inline

Definition at line 134 of file Colormap.h.

References itsRigidSize.

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

Set and retrieve the coefficients of the shaping function.

void casa::Colormap::setShapingFunction ( casacore::Function1D< casacore::Float, casacore::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.

void casa::Colormap::unregisterPCColorTable ( PixelCanvasColorTable pcctbl)

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const Colormap c 
)
friend

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

casacore::AipsIO& operator<< ( casacore::AipsIO aio,
const Colormap c 
)
friend

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

casacore::LogIO& operator<< ( casacore::LogIO lio,
const Colormap c 
)
friend

Write a Colormap to a casacore::LogIO stream.

casacore::AipsIO& operator>> ( casacore::AipsIO aio,
Colormap c 
)
friend

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

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

Member Data Documentation

casacore::Float casa::Colormap::itsAlpha
private

Transparency.

Definition at line 246 of file Colormap.h.

Referenced by getAlpha().

casacore::Float casa::Colormap::itsBrightness
private

levels

Definition at line 249 of file Colormap.h.

Referenced by getBrightness().

casacore::Float casa::Colormap::itsBrightnessScale
private

Definition at line 249 of file Colormap.h.

ColormapDefinition* casa::Colormap::itsColormapDefinition
private

Definition at line 255 of file Colormap.h.

Referenced by definition().

casacore::Float casa::Colormap::itsContrast
private

Definition at line 250 of file Colormap.h.

Referenced by getContrast().

casacore::Float casa::Colormap::itsContrastScale
private

Definition at line 250 of file Colormap.h.

casacore::Bool casa::Colormap::itsInvertBlue
private

Definition at line 252 of file Colormap.h.

casacore::Bool casa::Colormap::itsInvertGreen
private

Definition at line 252 of file Colormap.h.

casacore::Bool casa::Colormap::itsInvertRed
private

invert flags

Definition at line 252 of file Colormap.h.

casacore::Bool casa::Colormap::itsIsRigid
private

is this Colormap rigid?

Definition at line 241 of file Colormap.h.

Referenced by rigid(), and setRigid().

casacore::Int casa::Colormap::itsLogScale
private

Definition at line 253 of file Colormap.h.

casacore::String casa::Colormap::itsName
private

name of this Colormap.

Definition at line 238 of file Colormap.h.

Referenced by name(), and setName().

casacore::Bool casa::Colormap::itsOwnShapingFunction
private

Definition at line 259 of file Colormap.h.

std::map<PixelCanvasColorTable *, casacore::uInt> casa::Colormap::itsPCColorTables
private

Definition at line 261 of file Colormap.h.

casacore::uInt casa::Colormap::itsRigidSize
private

what is its rigid size?

Definition at line 244 of file Colormap.h.

Referenced by rigidSize(), and setRigidSize().

casacore::Function1D<casacore::Float, casacore::Float>* casa::Colormap::itsShapingFunction
private

function for shaping the colormap

Definition at line 258 of file Colormap.h.


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