casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
WCLinearScaleHandler.h
Go to the documentation of this file.
00001 //# WCLinearScaleHandler.h: linear data scaling for WorldCanvases
00002 //# Copyright (C) 1993,1994,1995,1996,1999,2000,2001
00003 //# Associated Universities, Inc. Washington DC, USA.
00004 //# 
00005 //# This library is free software; you can redistribute it and/or modify it
00006 //# under the terms of the GNU Library General Public License as published by
00007 //# the Free Software Foundation; either version 2 of the License, or (at your
00008 //# option) any later version.
00009 //# 
00010 //# This library is distributed in the hope that it will be useful, but WITHOUT
00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00013 //# License for more details.
00014 //# 
00015 //# You should have received a copy of the GNU Library General Public License
00016 //# along with this library; if not, write to the Free Software Foundation,
00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
00018 //# 
00019 //# Correspondence concerning AIPS++ should be addressed as follows:
00020 //#        Internet email: aips2-request@nrao.edu.
00021 //#        Postal address: AIPS++ Project Office
00022 //#                        National Radio Astronomy Observatory
00023 //#                        520 Edgemont Road
00024 //#                        Charlottesville, VA 22903-2475 USA
00025 //# 
00026 //# $Id$
00027 
00028 #ifndef TRIALDISPLAY_WCLINEARSCALEHANDLER_H
00029 #define TRIALDISPLAY_WCLINEARSCALEHANDLER_H
00030 
00031 #include <casa/aips.h>
00032 #include <display/DisplayCanvas/WCDataScaleHandler.h>
00033 
00034 namespace casa { //# NAMESPACE CASA - BEGIN
00035 
00036 // <summary>
00037 // Linear scaling of data for WorldCanvases.
00038 // </summary>
00039 //
00040 // <prerequisite>
00041 // <li> <linkto class="WCDataScaleHandler">WCDataScaleHandler</linkto>
00042 // </prerequisite>
00043 //
00044 // <etymology>
00045 // WCLinearScaleHandler : WorldCanvas Linear Scale Handler
00046 // </etymology>
00047 //
00048 // <synopsis>
00049 // The WCLinearScaleHandler is an implementation of the
00050 // <linkto class="WCDataScaleHandler">WCDataScaleHandler</linkto> that
00051 // uses linear scaling to get from real values to discrete values in
00052 // the range of 0 to rangeMax.  Typically, rangeMax is equivalent to the
00053 // available color resolution minus 1.
00054 // </synopsis>
00055 //
00056 // <motivation>
00057 // Need to provide some basic implementations of the WCDataScaleHandler
00058 // so users can model other custom scale handlers after it.  Linear scaling
00059 // is a common need, so it was implemented.
00060 // </motivation>
00061 //
00062 // <example>
00063 // see the test program tWCLinearScaleHandler.cc in the Display/test directory.
00064 // </example>
00065 //
00066 // <todo>
00067 // <li> stream ops
00068 // </todo>
00069 //
00070 
00071 class WCLinearScaleHandler  : public WCDataScaleHandler
00072 {
00073 public:
00074 
00075   // Default Constructor Required
00076   WCLinearScaleHandler();
00077 
00078   // Destructor
00079   virtual ~WCLinearScaleHandler();
00080 
00081   // apply returns True if the array in was converted to the
00082   // array out successfully
00083   // the last parameter sets the output range
00084   // <group>
00085   virtual Bool operator()(Array<uInt> & out, const Array<Bool> & in);
00086   virtual Bool operator()(Array<uInt> & out, const Array<uChar> & in);
00087   virtual Bool operator()(Array<uInt> & out, const Array<Char> & in);
00088   virtual Bool operator()(Array<uInt> & out, const Array<uShort> & in);
00089   virtual Bool operator()(Array<uInt> & out, const Array<Short> & in);
00090   virtual Bool operator()(Array<uInt> & out, const Array<uInt> & in);
00091   virtual Bool operator()(Array<uInt> & out, const Array<Int> & in);
00092   virtual Bool operator()(Array<uInt> & out, const Array<uLong> & in);
00093   virtual Bool operator()(Array<uInt> & out, const Array<Long> & in);
00094   virtual Bool operator()(Array<uInt> & out, const Array<Float> & in);
00095   virtual Bool operator()(Array<uInt> & out, const Array<Double> & in);
00096   virtual Bool operator()(Array<uInt> & out, const Array<Complex> & in);
00097   virtual Bool operator()(Array<uInt> & out, const Array<DComplex> & in);
00098   // </group>
00099 
00100 };
00101 
00102 
00103 } //# NAMESPACE CASA - END
00104 
00105 #endif