LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
ColorScale.h
Go to the documentation of this file.
1 #ifndef EVDB_COLORSCALE_H
10 #define EVDB_COLORSCALE_H
11 #include <string>
12 
13 namespace evdb {
33  };
34 
38  kLog,
40  };
41 
44  class ColorScale {
45  public:
46  ColorScale(double xlo, double xhi,
47  int which=kRainbow,
48  int scale=kLinear,
49  int n=40,
50  double h1=0, double h2=0,
51  double v1=0, double v2=0);
52 
53  int operator()(double x) const;
54  int GetColor(double x) const;
55  bool InBounds(double x) const;
56  void SetPalette();
57  void SetBounds(double xlo, double xhi) { fXlo = xlo; fXhi = xhi; }
58  void SetUnderFlowColor(int c);
59  void SetOverFlowColor(int c);
60  void Reverse();
61 
62  static int Palette(const std::string& nm);
63  static int Scale(const std::string& nm);
64 
65  private:
66  void HSVtoRGB(double h, double s, double v,
67  double* r, double* g, double* b) const;
68 
69  void MakeHSVScale(int n, double h1, double h2, double vs1, double vs2);
70  void MakeSequential();
71  void MakeFocus();
72  void MakeInvRainbow();
73  void MakeRainbow();
74  void MakeGreenToMagenta();
75  void MakeBlueToRed();
76  void MakeBlueToRedII();
77  void MakeBlueToGreen();
78  void MakeBlueToOrange();
79  void MakeBrownToBlue();
80  void MakeLinGray();
81  void MakeHeatedObject();
82 
83  private:
84  double fXlo;
85  double fXhi;
86  int fScale;
87  int fNcolor;
88  int fColors[256];
91  };
92 }
93 #endif
94 
Float_t x
Definition: compare.C:6
Blue to orange transition.
Definition: ColorScale.h:29
void MakeBlueToGreen()
Definition: ColorScale.cxx:925
Float_t s
Definition: plot.C:23
According to log(x)
Definition: ColorScale.h:39
Useful for sequential data.
Definition: ColorScale.h:31
Sequential data with focus in center of scale.
Definition: ColorScale.h:32
Blue to green transition.
Definition: ColorScale.h:28
void SetOverFlowColor(int c)
Definition: ColorScale.cxx:99
ROY G. BIV (default)
Definition: ColorScale.h:17
void MakeBlueToOrange()
Definition: ColorScale.cxx:952
bool InBounds(double x) const
Definition: ColorScale.cxx:113
int GetColor(double x) const
Definition: ColorScale.cxx:126
Manage all things related to colors for the event display.
int fColors[256]
How many colors in scale?
Definition: ColorScale.h:88
Linearly (default)
Definition: ColorScale.h:38
double fXhi
Numeric value at low end of scale.
Definition: ColorScale.h:85
Double_t scale
Definition: plot.C:25
void SetBounds(double xlo, double xhi)
Definition: ColorScale.h:57
Build an association between a numerical range and a ROOT color index for use in, eg...
Definition: ColorScale.h:44
A color scale primarily in greens.
Definition: ColorScale.h:25
void MakeHSVScale(int n, double h1, double h2, double vs1, double vs2)
Make a color scale of n colors ranging between two points in an HSV color space.
Definition: ColorScale.cxx:204
A color scale primarily in reds.
Definition: ColorScale.h:20
static int Palette(const std::string &nm)
Definition: ColorScale.cxx:17
static int Scale(const std::string &nm)
Definition: ColorScale.cxx:32
int fNcolor
Linear? Log? Sqrt?
Definition: ColorScale.h:87
A color scale primarily in blues.
Definition: ColorScale.h:26
Blue = cold, red = hot.
Definition: ColorScale.h:21
TH1F * h2
Definition: plot.C:46
Rainbow with high and low flipped.
Definition: ColorScale.h:18
void HSVtoRGB(double h, double s, double v, double *r, double *g, double *b) const
Definition: ColorScale.cxx:163
Green to magenta transition.
Definition: ColorScale.h:30
ColorScale(double xlo, double xhi, int which=kRainbow, int scale=kLinear, int n=40, double h1=0, double h2=0, double v1=0, double v2=0)
Definition: ColorScale.cxx:57
_scale_options
How to scale between low and high ranges.
Definition: ColorScale.h:36
void MakeGreenToMagenta()
Definition: ColorScale.cxx:848
void MakeBlueToRedII()
Definition: ColorScale.cxx:908
A color scale from dark blue (very cold) to red (hot) passing through yellow.
Definition: ColorScale.h:22
Light earth tones through green to blues.
Definition: ColorScale.h:27
void SetUnderFlowColor(int c)
Definition: ColorScale.cxx:95
int operator()(double x) const
Definition: ColorScale.cxx:148
TH1F * h1
Definition: plot.C:43
void MakeBrownToBlue()
Definition: ColorScale.cxx:983
Char_t n[5]
int fUnderFlowColor
List of ROOT color indicies.
Definition: ColorScale.h:89
int fScale
Numeric value at high end of scale.
Definition: ColorScale.h:86
int fOverFlowColor
Color to use for under flows.
Definition: ColorScale.h:90
Linearized gray scale.
Definition: ColorScale.h:19
A color scale primarily in reds.
Definition: ColorScale.h:24
_color_scales
The list of default color options.
Definition: ColorScale.h:15
A color scale from light to "burned".
Definition: ColorScale.h:23