casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Private Attributes
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

List of all members.

Public Member Functions

 WCDataScaleHandler ()
 Default Constructor Required.
virtual ~WCDataScaleHandler ()
 Destructor (does nothing)
 WCDataScaleHandler (Double min, Double max)
 Set min/max at construction time.
virtual Bool operator() (Array< uInt > &out, const Array< Bool > &in)
 op() returns True if the Array in was converted to the Array out successfully.
virtual Bool operator() (Array< uInt > &out, const Array< uChar > &in)
virtual Bool operator() (Array< uInt > &out, const Array< Char > &in)
virtual Bool operator() (Array< uInt > &out, const Array< uShort > &in)
virtual Bool operator() (Array< uInt > &out, const Array< Short > &in)
virtual Bool operator() (Array< uInt > &out, const Array< uInt > &in)
virtual Bool operator() (Array< uInt > &out, const Array< Int > &in)
virtual Bool operator() (Array< uInt > &out, const Array< uLong > &in)
virtual Bool operator() (Array< uInt > &out, const Array< Long > &in)
virtual Bool operator() (Array< uInt > &out, const Array< Float > &in)
virtual Bool operator() (Array< uInt > &out, const Array< Double > &in)
virtual Bool operator() (Array< uInt > &out, const Array< Complex > &in)
virtual Bool operator() (Array< uInt > &out, const Array< DComplex > &in)
Double domainMin () const
 set/get the min/max to use for the input Array
Double domainMax () const
void setDomainMinMax (Double min, Double max)
uInt rangeMax () const
 set/get the maximum value to use for the output array Note: the minimum value is always zero
void setRangeMax (uInt max)
virtual void setDefaultOptions ()
 install the default options for this DisplayData
virtual Bool setOptions (Record &rec, Record &recOut)
 apply options stored in val to the DisplayData; return value True means a refresh is needed...
virtual Record getOptions ()
 retrieve the current and default options and parameter types.

Private Attributes

Double domainMin_
 domain limits to use
Double domainMax_
uInt rangeMax_
 range limits rangeMin is always zero

Detailed Description

Class implementing simple data scaling for the WorldCanvas.

Prerequisite

Etymology

WCDataScaleHandler : WorldCanvas 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 109 of file WCDataScaleHandler.h.


Constructor & Destructor Documentation

Default Constructor Required.

Destructor (does nothing)

Set min/max at construction time.


Member Function Documentation

Definition at line 151 of file WCDataScaleHandler.h.

References domainMax_.

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

Definition at line 150 of file WCDataScaleHandler.h.

References domainMin_.

retrieve the current and default options and parameter types.

Reimplemented in casa::WCPowerScaleHandler.

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

op() returns True if the Array in was converted to the Array out successfully.

Default implentation for Bool maps False to 0 and True to rangeMax

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

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

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

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

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

Definition at line 158 of file WCDataScaleHandler.h.

References rangeMax_.

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

install the default options for this DisplayData

Reimplemented in casa::WCPowerScaleHandler.

virtual Bool casa::WCDataScaleHandler::setOptions ( Record rec,
Record recOut 
) [virtual]

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

Reimplemented in casa::WCPowerScaleHandler.

Definition at line 159 of file WCDataScaleHandler.h.

References casa::max(), and rangeMax_.


Member Data Documentation

Definition at line 176 of file WCDataScaleHandler.h.

Referenced by domainMax().

domain limits to use

Definition at line 175 of file WCDataScaleHandler.h.

Referenced by domainMin().

range limits rangeMin is always zero

Definition at line 180 of file WCDataScaleHandler.h.

Referenced by rangeMax(), and setRangeMax().


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