WCDataScaleHandler.h
Classes
- WCDataScaleHandler -- Class implementing simple data scaling for the WorldCanvas. (full description)
Interface
- Public Members
- WCDataScaleHandler()
- virtual ~WCDataScaleHandler()
- WCDataScaleHandler(Double min, Double max)
- virtual Bool operator()(Array<uInt> & out, const Array<Bool> & in)
- 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
- Double domainMax() const
- void setDomainMinMax(Double min, Double max)
- uInt rangeMax() const
- void setRangeMax(uInt max)
- virtual void setDefaultOptions()
- virtual Bool setOptions(Record &rec, Record &recOut)
- virtual Record getOptions()
Prerequisite
- Understanding of pseudocolor display of single-channel graphic
primitives.
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:
- fitting of images to display
(WCResampleHandler)
- transformation of values from real values to discrete values
in the range of [0,N-1], where N is the output color resolution.
(WCDataScaleHandler)
- translating [0,N-1] into color indicies
(PixelCanvas's mapToColor() function)
The function suite includes all the normal scalar types. Default
implementations exist for
- Bool version which maps False to 0 and True to N-1
- Complex version which extracts magnitude and forwards the
call to the Float version.
- DComplex version which extracts magnitude and forwards the
call to the Double version.
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
- add ComplexToRealMethod field to base class to allow
for extracting values other than magnitude for Complex and DComplex
variables.
- consider changing Matrices to Arrays to support a Vector of
transformations.
Member Description
Default Constructor Required
Destructor (does nothing)
Set min/max at construction time
virtual Bool operator()(Array<uInt> & out, const Array<Bool> & in)
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)
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.
set/get the min/max to use for the input Array
set/get the maximum value to use for the output array
Note: the minimum value is always zero
install the default options for this DisplayData
apply options stored in val to the DisplayData; return value
True means a refresh is needed...
retrieve the current and default options and parameter types.