ColourMap.h

00001 //-*-C++-*-
00002 /***************************************************************************
00003  *
00004  *   Copyright (C) 2004 by Willem van Straten
00005  *   Licensed under the Academic Free License version 2.1
00006  *
00007  ***************************************************************************/
00008 
00009 /* $Source: /cvsroot/psrchive/psrchive/Util/pgutil/ColourMap.h,v $
00010    $Revision: 1.6 $
00011    $Date: 2010/01/05 05:41:57 $
00012    $Author: jonathan_khoo $ */
00013 
00014 #ifndef __ColourMap_H
00015 #define __ColourMap_H
00016 
00017 #include "TextInterface.h"
00018 
00019 namespace pgplot {
00020 
00022   class ColourMap : public Reference::Able {
00023 
00024   public:
00026     enum Name {
00027       GreyScale,
00028       Inverse,
00029       Heat,
00030       Cold,
00031       Plasma,
00032       Forest,
00033       AlienGlow,
00034       Test
00035     };
00036 
00038     ColourMap ();
00039 
00040     ColourMap (const Name _name);
00041 
00043     void set_name (Name name);
00044     Name get_name () const { return name; }
00045 
00047     void set_contrast (float contrast);
00048     float get_contrast () const { return contrast; }
00049 
00051     void set_brightness (float brightness);
00052     float get_brightness () const { return brightness; }
00053 
00055     void set_logarithmic (bool log) { logarithmic = log; }
00056     bool get_logarithmic () const { return logarithmic; }
00057 
00059     void apply ();
00060 
00062     class Interface;
00063     
00064   protected:
00065 
00067     Name name;
00068 
00070     float contrast;
00071 
00073     float brightness;
00074 
00076     bool logarithmic;
00077 
00078   };
00079 
00080   class ColourMap::Interface : public TextInterface::To<ColourMap> {
00081   public:
00082     Interface (ColourMap* = 0);
00083   };
00084 
00086   std::ostream& operator << (std::ostream&, ColourMap::Name);
00087 
00089   std::istream& operator >> (std::istream&, ColourMap::Name&);
00090 
00091 
00092 }
00093 
00094 #endif

Generated using doxygen 1.4.7