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

Class implementing simple data scaling for the WorldCanvas. More...

#include <WCDataScaleHandler.h>

Inheritance diagram for casa::WCDataScaleHandler:
casa::DisplayOptions casa::WCLinearScaleHandler casa::WCPowerScaleHandler

Public Member Functions

 WCDataScaleHandler ()
 Default Constructor Required. More...
 
virtual ~WCDataScaleHandler ()
 Destructor (does nothing) More...
 
 WCDataScaleHandler (casacore::Double min, casacore::Double max)
 Set min/max at construction time. More...
 
virtual casacore::Bool operator() (casacore::Array< casacore::uInt > &out, const casacore::Array< casacore::Bool > &in)
 op() returns true if the casacore::Array in was converted to the casacore::Array out successfully. More...
 
virtual casacore::Bool operator() (casacore::Array< casacore::uInt > &out, const casacore::Array< casacore::uChar > &in)
 
virtual casacore::Bool operator() (casacore::Array< casacore::uInt > &out, const casacore::Array< casacore::Char > &in)
 
virtual casacore::Bool operator() (casacore::Array< casacore::uInt > &out, const casacore::Array< casacore::uShort > &in)
 
virtual casacore::Bool operator() (casacore::Array< casacore::uInt > &out, const casacore::Array< casacore::Short > &in)
 
virtual casacore::Bool operator() (casacore::Array< casacore::uInt > &out, const casacore::Array< casacore::uInt > &in)
 
virtual casacore::Bool operator() (casacore::Array< casacore::uInt > &out, const casacore::Array< casacore::Int > &in)
 
virtual casacore::Bool operator() (casacore::Array< casacore::uInt > &out, const casacore::Array< casacore::uLong > &in)
 
virtual casacore::Bool operator() (casacore::Array< casacore::uInt > &out, const casacore::Array< casacore::Long > &in)
 
virtual casacore::Bool operator() (casacore::Array< casacore::uInt > &out, const casacore::Array< casacore::Float > &in)
 
virtual casacore::Bool operator() (casacore::Array< casacore::uInt > &out, const casacore::Array< casacore::Double > &in)
 
virtual casacore::Bool operator() (casacore::Array< casacore::uInt > &out, const casacore::Array< casacore::Complex > &in)
 
virtual casacore::Bool operator() (casacore::Array< casacore::uInt > &out, const casacore::Array< casacore::DComplex > &in)
 
casacore::Double domainMin () const
 set/get the min/max to use for the input Array More...
 
casacore::Double domainMax () const
 
void setDomainMinMax (casacore::Double min, casacore::Double max)
 
casacore::uInt rangeMax () const
 set/get the maximum value to use for the output array Note: the minimum value is always zero More...
 
void setRangeMax (casacore::uInt max)
 
virtual void setDefaultOptions ()
 install the default options for this DisplayData More...
 
virtual casacore::Bool setOptions (casacore::Record &rec, casacore::Record &recOut)
 apply options stored in val to the DisplayData; return value true means a refresh is needed... More...
 
virtual casacore::Record getOptions (bool scrub=false) const
 retrieve the current and default options and parameter types. More...
 
- Public Member Functions inherited from casa::DisplayOptions
 DisplayOptions ()
 Constructor. More...
 
virtual ~DisplayOptions ()
 Destructor. More...
 
template<class T >
casacore::Bool readOptionRecord (casacore::Vector< T > &target, casacore::Bool &error, const casacore::Record &rec, const casacore::String &fieldname) const
 Find the field fieldname in casacore::Record rec, containing the requested type (casacore::Bool, casacore::String, casacore::Float, casacore::Int) in itself or its "value" sub-field, and return the value in target. More...
 
template<class T >
casacore::Bool readOptionRecord (T &target, casacore::Bool &error, const casacore::Record &rec, const casacore::String &fieldname) const
 
virtual casacore::Bool readOptionRecord (casacore::String &target, casacore::Bool &unsetTarget, casacore::Bool &error, const casacore::Record &rec, const casacore::String &fieldname) const
 Find the field fieldname in casacore::Record rec, containing the requested type (casacore::String) in itself or its "value" sub-field, and return the value in target. More...
 
casacore::Record unset () const
 Return a casacore::Record which is an "unset" casacore::Record, ie. More...
 
casacore::Bool isUnset (const casacore::Record &rec) const
 Return true or false indicating if the provided casacore::Record is equal to an "unset" Record. More...
 

Private Attributes

casacore::Double domainMin_
 domain limits to use More...
 
casacore::Double domainMax_
 
casacore::uInt rangeMax_
 range limits rangeMin is always zero More...
 

Additional Inherited Members

- Protected Member Functions inherited from casa::DisplayOptions
 DisplayOptions (const DisplayOptions &other)
 (Required) copy constructor. More...
 
void operator= (const DisplayOptions &other)
 (Required) copy assignment. More...
 

Detailed Description

Class implementing simple data scaling for the WorldCanvas.

Prerequisite

Etymology

WCDataScaleHandler : WorldCanvas casacore::Data Scale Handler

This class is responsible for scaling data into a range suitable for display.

Synopsis

WCDataScaleHandler defines a set of functions whose purpose is to transform real data values, such as those from raster images or contour lines, into an image whose value ranges from 0 to N-1 for some N, normally taken to be the color resolution available for display.

The Display library defines the following process of image display:

  1. fitting of images to display (WCResampleHandler)
  2. transformation of values from real values to discrete values in the range of [0,N-1], where N is the output color resolution. (WCDataScaleHandler)
  3. translating [0,N-1] into color indicies (PixelCanvas 's mapToColor() function)

The function suite includes all the normal scalar types. Default implementations exist for

Each scalar implementation must scale the data according to the domain minimum and maximum values and the N-1 value called the rangeMax.

This class would idealy be implemented by a templated member function, but C++ does not yet support templated member functions in non-templated classes. Thus the manual expansion-by-type.

Motivation

Wanted a way for users to customize the scaling process from real values to discrete values for color display.

Example

see WCLinearScaleHandler

To Do

Definition at line 113 of file WCDataScaleHandler.h.

Constructor & Destructor Documentation

casa::WCDataScaleHandler::WCDataScaleHandler ( )

Default Constructor Required.

virtual casa::WCDataScaleHandler::~WCDataScaleHandler ( )
virtual

Destructor (does nothing)

casa::WCDataScaleHandler::WCDataScaleHandler ( casacore::Double  min,
casacore::Double  max 
)

Set min/max at construction time.

Member Function Documentation

casacore::Double casa::WCDataScaleHandler::domainMax ( ) const
inline

Definition at line 157 of file WCDataScaleHandler.h.

References domainMax_.

casacore::Double casa::WCDataScaleHandler::domainMin ( ) const
inline

set/get the min/max to use for the input Array

Definition at line 154 of file WCDataScaleHandler.h.

References domainMin_.

virtual casacore::Record casa::WCDataScaleHandler::getOptions ( bool  scrub = false) const
virtual

retrieve the current and default options and parameter types.

Reimplemented in casa::WCPowerScaleHandler.

virtual casacore::Bool casa::WCDataScaleHandler::operator() ( casacore::Array< casacore::uInt > &  out,
const casacore::Array< casacore::Bool > &  in 
)
virtual

op() returns true if the casacore::Array in was converted to the casacore::Array out successfully.

Default implentation for Bool maps false to 0 and true to rangeMax

Types casacore::uChar to casacore::Double not implemented (They return false). User should override the types needed (or perhaps all depending on your compiler.

Default casacore::Complex and casacore::DComplex extract amplitude and call the casacore::Float or casacore::Double version.

Reimplemented in casa::WCPowerScaleHandler, and casa::WCLinearScaleHandler.

virtual casacore::Bool casa::WCDataScaleHandler::operator() ( casacore::Array< casacore::uInt > &  out,
const casacore::Array< casacore::uChar > &  in 
)
virtual
virtual casacore::Bool casa::WCDataScaleHandler::operator() ( casacore::Array< casacore::uInt > &  out,
const casacore::Array< casacore::Char > &  in 
)
virtual
virtual casacore::Bool casa::WCDataScaleHandler::operator() ( casacore::Array< casacore::uInt > &  out,
const casacore::Array< casacore::uShort > &  in 
)
virtual
virtual casacore::Bool casa::WCDataScaleHandler::operator() ( casacore::Array< casacore::uInt > &  out,
const casacore::Array< casacore::Short > &  in 
)
virtual
virtual casacore::Bool casa::WCDataScaleHandler::operator() ( casacore::Array< casacore::uInt > &  out,
const casacore::Array< casacore::uInt > &  in 
)
virtual
virtual casacore::Bool casa::WCDataScaleHandler::operator() ( casacore::Array< casacore::uInt > &  out,
const casacore::Array< casacore::Int > &  in 
)
virtual
virtual casacore::Bool casa::WCDataScaleHandler::operator() ( casacore::Array< casacore::uInt > &  out,
const casacore::Array< casacore::uLong > &  in 
)
virtual
virtual casacore::Bool casa::WCDataScaleHandler::operator() ( casacore::Array< casacore::uInt > &  out,
const casacore::Array< casacore::Long > &  in 
)
virtual
virtual casacore::Bool casa::WCDataScaleHandler::operator() ( casacore::Array< casacore::uInt > &  out,
const casacore::Array< casacore::Float > &  in 
)
virtual
virtual casacore::Bool casa::WCDataScaleHandler::operator() ( casacore::Array< casacore::uInt > &  out,
const casacore::Array< casacore::Double > &  in 
)
virtual
virtual casacore::Bool casa::WCDataScaleHandler::operator() ( casacore::Array< casacore::uInt > &  out,
const casacore::Array< casacore::Complex > &  in 
)
virtual
virtual casacore::Bool casa::WCDataScaleHandler::operator() ( casacore::Array< casacore::uInt > &  out,
const casacore::Array< casacore::DComplex > &  in 
)
virtual
casacore::uInt casa::WCDataScaleHandler::rangeMax ( ) const
inline

set/get the maximum value to use for the output array Note: the minimum value is always zero

Definition at line 166 of file WCDataScaleHandler.h.

References rangeMax_.

virtual void casa::WCDataScaleHandler::setDefaultOptions ( )
virtual

install the default options for this DisplayData

Reimplemented in casa::WCPowerScaleHandler.

void casa::WCDataScaleHandler::setDomainMinMax ( casacore::Double  min,
casacore::Double  max 
)
virtual casacore::Bool casa::WCDataScaleHandler::setOptions ( casacore::Record rec,
casacore::Record recOut 
)
virtual

apply options stored in val to the DisplayData; return value true means a refresh is needed...

Reimplemented in casa::WCPowerScaleHandler.

void casa::WCDataScaleHandler::setRangeMax ( casacore::uInt  max)
inline

Definition at line 169 of file WCDataScaleHandler.h.

References max, and rangeMax_.

Member Data Documentation

casacore::Double casa::WCDataScaleHandler::domainMax_
private

Definition at line 188 of file WCDataScaleHandler.h.

Referenced by domainMax().

casacore::Double casa::WCDataScaleHandler::domainMin_
private

domain limits to use

Definition at line 187 of file WCDataScaleHandler.h.

Referenced by domainMin().

casacore::uInt casa::WCDataScaleHandler::rangeMax_
private

range limits rangeMin is always zero

Definition at line 192 of file WCDataScaleHandler.h.

Referenced by rangeMax(), and setRangeMax().


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