casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
WCPowerScaleHandler.h
Go to the documentation of this file.
1 //# WCPowerScaleHandler.h: lin, log and exp scaling of data for WorldCanvas
2 //# Copyright (C) 1998,1999,2000,2001
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //# $Id$
27 
28 #ifndef TRIALDISPLAY_WCPOWERSCALEHANDLER_H
29 #define TRIALDISPLAY_WCPOWERSCALEHANDLER_H
30 
31 #include <casa/aips.h>
32 #include <casa/Containers/Record.h>
34 
35 namespace casa { //# NAMESPACE CASA - BEGIN
36 
37 // <summary>
38 // Linear, logarithmic and exponential scaling of data for the WorldCanvas
39 // </summary>
40 //
41 // <prerequisite>
42 // <li> <linkto class="WCDataScaleHandler">WCDataScaleHandler</linkto>
43 // </prerequisite>
44 //
45 // <etymology>
46 // WCPowerScaleHandler : WorldCanvas Power Scale Handler
47 // </etymology>
48 //
49 // <synopsis>
50 // The WCPowerScaleHandler is an implementation of the
51 // <linkto class="WCDataScaleHandler">WCDataScaleHandler</linkto> that
52 // uses linear, logarithmic or exponential scaling to transform
53 // (probably non-discrete) input data into discrete output values
54 // in the range 0 to a settable maximum. Typically, this maximum would
55 // be set to the available number of colorcells minus one, for indexed
56 // raster drawing, or to a large integer (say 1000000) for use in color
57 // cube raster drawing. In the latter case, the output is then divided
58 // by the chosen large number in order to provide values in the range
59 // 0 to 1.
60 // </synopsis>
61 //
62 // <motivation>
63 // This class is motivated by the need to provide the most common
64 // data scaling requirements to the user.
65 // </motivation>
66 //
67 // <example>
68 // ...
69 // </example>
70 //
71 // <todo>
72 // <li> stream ops
73 // </todo>
74 //
75 
77 
78  public:
79 
80  // Default Constructor Required
82 
83  // Destructor
84  virtual ~WCPowerScaleHandler();
85 
86  // set/get the number of log cycles into which to compress the data
87  // <group>
90  }
92  return itsOptionsPowerCycles;
93  }
94  // </group>
95 
96  // install the default options for this DisplayData
97  virtual void setDefaultOptions();
98 
99  // apply options stored in val to the DisplayData; return value
100  // true means a refresh is needed...
102 
103  // retrieve the current and default options and parameter types.
104  virtual casacore::Record getOptions( bool scrub=false ) const;
105 
106  // apply returns true if the array in was converted to the array out
107  // successfully the last parameter sets the output range
108  // <group>
122  // </group>
123 
126  private:
127 
128  // Scaling power cycles: < 0 => log scaling, > 0 => exp scaling,
129  // == 0 => linear scaling
131 
132  // Is histogram equalisation required?
134 
135  };
136 
137 
138 } //# NAMESPACE CASA - END
139 
140 #endif
virtual casacore::Bool operator()(casacore::Array< casacore::uInt > &out, const casacore::Array< casacore::Bool > &in)
apply returns true if the array in was converted to the array out successfully the last parameter set...
static const casacore::String POWER_CYCLES
casacore::Bool histoEqualise(casacore::Array< casacore::Float > &out, const casacore::Array< casacore::Float > &in)
virtual ~WCPowerScaleHandler()
Destructor.
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...
casacore::Bool itsOptionsHistoEqualisation
Is histogram equalisation required?
void setCycles(casacore::Float cyc)
set/get the number of log cycles into which to compress the data
WCPowerScaleHandler()
Default Constructor Required.
A hierarchical collection of named fields of various types.
Definition: Record.h:180
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
casacore::Float itsOptionsPowerCycles
Scaling power cycles: &lt; 0 =&gt; log scaling, &gt; 0 =&gt; exp scaling, == 0 =&gt; linear scaling.
float Float
Definition: aipstype.h:54
virtual void setDefaultOptions()
install the default options for this DisplayData
virtual casacore::Record getOptions(bool scrub=false) const
retrieve the current and default options and parameter types.
String: the storage and methods of handling collections of characters.
Definition: String.h:223
Linear, logarithmic and exponential scaling of data for the WorldCanvas.
Class implementing simple data scaling for the WorldCanvas.