casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
ColormapInfo.h
Go to the documentation of this file.
00001 //# ColormapInfo.h: store information about the dynamic mapping of a Colormap
00002 //# Copyright (C) 1994,1995,1996,1997,1998,1999
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 #include <casa/aips.h>
00029 
00030 namespace casa { //# NAMESPACE CASA - BEGIN
00031 
00032 class Colormap;
00033 
00034 #ifndef TRIALDISPLAY_COLORMAPINFO_H
00035 #define TRIALDISPLAY_COLORMAPINFO_H
00036 
00037 // <summary>
00038 // ColormapInfo stores information about the dynamic mapping of a Colormap.
00039 // </summary>
00040 //
00041 // <synopsis>
00042 // </synopsis>
00043 //
00044 // <motivation>
00045 // </motivation>
00046 //
00047 // <example>
00048 // </example>
00049 
00050 class ColormapInfo {
00051 
00052  public:
00053 
00054   // (Required) default constructor.
00055   ColormapInfo();
00056 
00057   // Constructor taking a pointer to a Colormap, and the initial
00058   // weight, offset and size of the Colormap.
00059   ColormapInfo(const Colormap *colormap, const Float &weight, 
00060                const uInt &offset, const uInt &size);
00061 
00062   // Yield a pointer to the Colormap about which this stores
00063   // information.
00064   const Colormap *colormap() const 
00065     { return itsColormap; }
00066 
00067   // Return the current weight for this mapping.
00068   Float weight() const 
00069     { return itsWeight; }
00070 
00071   // Return the current offset for this mapping.
00072   uInt offset() const 
00073     { return itsOffset; }
00074 
00075   // Return the current size for this mapping.
00076   uInt size() const 
00077     { return itsSize; }
00078 
00079   // Set the weight for this mapping.
00080   void setWeight(const Float &weight);
00081 
00082   // Set the offset for this mapping.
00083   void setOffset(const uInt &offset);
00084 
00085   // Set the size for this mapping.
00086   void setSize(const uInt &size);
00087 
00088   // Increment and decrement the reference count for this mapping.
00089   // <group>
00090   void ref();
00091   void unref();
00092   // </group>
00093 
00094   // Return the current reference count.
00095   uInt refCount() const 
00096     { return itsRefCount; }
00097 
00098 private:
00099 
00100   // Store the Colormap of this mapping here.
00101   const Colormap *itsColormap;
00102 
00103   // Store the weight of the mapping here.
00104   Float itsWeight;
00105 
00106   // Store the offset of the mapping here.
00107   uInt itsOffset;
00108 
00109   // Store the size of the mapping here.
00110   uInt itsSize;
00111 
00112   // Store the reference count of the mapping here.
00113   Int itsRefCount;
00114 
00115 };
00116 
00117 
00118 } //# NAMESPACE CASA - END
00119 
00120 #endif