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/More/Plotting/pgutil/ColourMap.h
10
11#ifndef __ColourMap_H
12#define __ColourMap_H
13
14#include "Pulsar/Config.h"
15#include "TextInterface.h"
16#include <string>
17
18namespace 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
68
70 float contrast;
71
74
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
Configuration option.
Definition Config.h:69
Colour map manager.
Definition ColourMap.h:21
void apply()
Apply the current attributes.
Definition ColourMap.C:47
void set_brightness(float brightness)
Set the brightness (0 to 1; normally 5)
Definition ColourMap.C:35
ColourMap()
Default constructor.
Definition ColourMap.C:11
float brightness
Brightness.
Definition ColourMap.h:73
void set_logarithmic(bool log)
Set the image transfer function to logarithmic.
Definition ColourMap.h:55
void set_name(Name name)
Set the colour map name.
Definition ColourMap.C:42
void set_contrast(float contrast)
Set the contrast (0 to 1; normally 1)
Definition ColourMap.C:28
bool logarithmic
Logarithmic image transfer function.
Definition ColourMap.h:76
float contrast
Contrast.
Definition ColourMap.h:70
Name
Available colour map names.
Definition ColourMap.h:25
Name name
Colour map name.
Definition ColourMap.h:67

Generated using doxygen 1.14.0