ColourMap.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2004 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/Util/pgutil/ColourMap.h
10 
11 #ifndef __ColourMap_H
12 #define __ColourMap_H
13 
14 #include "TextInterface.h"
15 #include "Pulsar/Config.h"
16 #include <string>
17 
18 namespace pgplot {
19 
21  class ColourMap : public Reference::Able {
22 
23  public:
25  enum Name {
26  GreyScale,
27  Inverse,
28  Heat,
29  Cold,
30  Plasma,
31  Forest,
32  AlienGlow,
33  CubeHelix,
34  Test
35  };
36 
38  ColourMap ();
39 
40  ColourMap (const Name _name);
41 
43  void set_name (Name name);
44  Name get_name () const { return name; }
45 
47  void set_contrast (float contrast);
48  float get_contrast () const { return contrast; }
49 
51  void set_brightness (float brightness);
52  float get_brightness () const { return brightness; }
53 
55  void set_logarithmic (bool log) { logarithmic = log; }
56  bool get_logarithmic () const { return logarithmic; }
57 
59  void apply ();
60 
62  class Interface;
63 
64  protected:
65 
67  Name name;
68 
70  float contrast;
71 
73  float brightness;
74 
76  bool logarithmic;
77 
78  public:
79 
80  static Pulsar::Option<std::string> default_colour_map;
81  };
82 
83  class ColourMap::Interface : public TextInterface::To<ColourMap> {
84  public:
85  Interface (ColourMap* = 0);
86  };
87 
89  std::ostream& operator << (std::ostream&, ColourMap::Name);
90 
92  std::istream& operator >> (std::istream&, ColourMap::Name&);
93 
94 
95 }
96 #endif
void set_logarithmic(bool log)
Set the image transfer function to logarithmic.
Definition: ColourMap.h:65
Name name
Colour map name.
Definition: ColourMap.h:72
void set_brightness(float brightness)
Set the brightness (0 to 1; normally 5)
Definition: ColourMap.C:35
const ScalarMath log(const ScalarMath &x)
char code(const std::string &telescope_name)
void apply()
Apply the current attributes.
Definition: ColourMap.C:47
float brightness
Brightness.
Definition: ColourMap.h:83
void set_name(Name name)
Set the colour map name.
Definition: ColourMap.C:42
ColourMap()
Default constructor.
Definition: ColourMap.C:11
void set_contrast(float contrast)
Set the contrast (0 to 1; normally 1)
Definition: ColourMap.C:28
Convenience interface to a bunch of regularly used colour maps.
Definition: ColourMap.h:26
bool logarithmic
Logarithmic image transfer function.
Definition: ColourMap.h:86
Name
Available colour map names.
Definition: ColourMap.h:35
float contrast
Contrast.
Definition: ColourMap.h:80

Generated using doxygen 1.8.17