LArSoft
v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
|
Build an association between a numerical range and a ROOT color index for use in, eg., the event display. More...
#include "ColorScale.h"
Public Member Functions | |
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) | |
int | operator() (double x) const |
int | GetColor (double x) const |
bool | InBounds (double x) const |
void | SetPalette () |
void | SetBounds (double xlo, double xhi) |
void | SetUnderFlowColor (int c) |
void | SetOverFlowColor (int c) |
void | Reverse () |
Static Public Member Functions | |
static int | Palette (const std::string &nm) |
static int | Scale (const std::string &nm) |
Private Member Functions | |
void | HSVtoRGB (double h, double s, double v, double *r, double *g, double *b) const |
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. More... | |
void | MakeSequential () |
void | MakeFocus () |
void | MakeInvRainbow () |
void | MakeRainbow () |
void | MakeGreenToMagenta () |
void | MakeBlueToRed () |
void | MakeBlueToRedII () |
void | MakeBlueToGreen () |
void | MakeBlueToOrange () |
void | MakeBrownToBlue () |
void | MakeLinGray () |
void | MakeHeatedObject () |
Private Attributes | |
double | fXlo |
double | fXhi |
Numeric value at low end of scale. More... | |
int | fScale |
Numeric value at high end of scale. More... | |
int | fNcolor |
Linear? Log? Sqrt? More... | |
int | fColors [256] |
How many colors in scale? More... | |
int | fUnderFlowColor |
List of ROOT color indicies. More... | |
int | fOverFlowColor |
Color to use for under flows. More... | |
Build an association between a numerical range and a ROOT color index for use in, eg., the event display.
Definition at line 44 of file ColorScale.h.
evdb::ColorScale::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 |
||
) |
Construct a color scale
xlo | - The value at the low end of the scale |
xhi | - The value at the high end of the scale |
which | - Which color map to use (see enum's in ColorScale.h) |
scale | - How to scale range (see enum's in ColorScale.h) |
n | - How many colors to use |
h1 | - First H value in range |
h2 | - Last H value in range |
v1 | - First V value in range |
v2 | - Last V value in range |
Definition at line 57 of file ColorScale.cxx.
References fNcolor, evdb::kBlues, evdb::kBlueToOrange, evdb::kBlueToRed, evdb::kBlueToRedII, evdb::kColdToHot, evdb::kCustom, evdb::kFocus, evdb::kGeographic, evdb::kGreens, evdb::kGreenToMagenta, evdb::kHeatedObject, evdb::kInvRainbow, evdb::kLinGray, evdb::kRainbow, evdb::kReds, evdb::kSequential, MakeBlueToOrange(), MakeBlueToRed(), MakeBlueToRedII(), MakeBrownToBlue(), MakeFocus(), MakeGreenToMagenta(), MakeHeatedObject(), MakeHSVScale(), MakeInvRainbow(), MakeLinGray(), MakeRainbow(), and MakeSequential().
int evdb::ColorScale::GetColor | ( | double | x | ) | const |
Assign a ROOT color index to the value x
x | - the value on the scale |
Definition at line 126 of file ColorScale.cxx.
References f, fColors, fNcolor, fOverFlowColor, fScale, fUnderFlowColor, fXhi, fXlo, evdb::kLinear, evdb::kLog, and evdb::kSqrt.
Referenced by evd::TQPad::Draw(), evd::RecoBaseDrawer::DrawPFParticle3D(), operator()(), evd::RawDataDrawer::QueueDrawingBoxes(), and evd::RecoBaseDrawer::Wire2D().
|
private |
Convert hue, saturation and value numbers to red, green, blue
h | - hue (in range from 0 to 360) |
s | - saturation |
v | - value |
r | - returned r value |
g | - returned g value |
b | - returned b value |
Definition at line 163 of file ColorScale.cxx.
Referenced by MakeHSVScale(), and SetBounds().
bool evdb::ColorScale::InBounds | ( | double | x | ) | const |
Definition at line 113 of file ColorScale.cxx.
|
private |
Definition at line 925 of file ColorScale.cxx.
References fColors, and fNcolor.
Referenced by SetBounds().
|
private |
Definition at line 952 of file ColorScale.cxx.
References fColors, and fNcolor.
Referenced by ColorScale(), and SetBounds().
|
private |
Definition at line 877 of file ColorScale.cxx.
References fColors, and fNcolor.
Referenced by ColorScale(), and SetBounds().
|
private |
Definition at line 908 of file ColorScale.cxx.
References blue, fColors, fNcolor, and red.
Referenced by ColorScale(), and SetBounds().
|
private |
Definition at line 983 of file ColorScale.cxx.
References fColors, and fNcolor.
Referenced by ColorScale(), and SetBounds().
|
private |
Build a sequential color map with red at the center
Definition at line 282 of file ColorScale.cxx.
References fColors, and fNcolor.
Referenced by ColorScale(), and SetBounds().
|
private |
Definition at line 848 of file ColorScale.cxx.
References fColors, and fNcolor.
Referenced by ColorScale(), and SetBounds().
|
private |
Definition at line 1025 of file ColorScale.cxx.
References fColors, and fNcolor.
Referenced by ColorScale(), and SetBounds().
|
private |
Make a color scale of n colors ranging between two points in an HSV color space.
Choose points so that the value of the colors changes uniformly. This ensures good viewing event in black and white.
n | - number of colors in the scale |
h1 | - first H value in color scale |
h2 | - second H value in color scale |
vs1 | - first V value in color scale |
vs2 | - second V value in color scale |
Definition at line 204 of file ColorScale.cxx.
References fColors, fNcolor, h1, HSVtoRGB(), n, and s.
Referenced by ColorScale(), and SetBounds().
|
private |
Definition at line 319 of file ColorScale.cxx.
References fColors, and fNcolor.
Referenced by ColorScale(), and SetBounds().
|
private |
Definition at line 1008 of file ColorScale.cxx.
References blue, fColors, fNcolor, and red.
Referenced by ColorScale(), and SetBounds().
|
private |
Definition at line 585 of file ColorScale.cxx.
References fColors, and fNcolor.
Referenced by ColorScale(), and SetBounds().
|
private |
Build the sequential color map
Definition at line 243 of file ColorScale.cxx.
References fColors, and fNcolor.
Referenced by ColorScale(), and SetBounds().
int evdb::ColorScale::operator() | ( | double | x | ) | const |
|
static |
Definition at line 17 of file ColorScale.cxx.
Referenced by SetBounds(), and evdb::Colors::UnpackColorScale().
void evdb::ColorScale::Reverse | ( | ) |
Definition at line 103 of file ColorScale.cxx.
References fColors, fNcolor, fOverFlowColor, and fUnderFlowColor.
Referenced by SetBounds().
|
static |
Definition at line 32 of file ColorScale.cxx.
Referenced by SetBounds(), and evdb::Colors::UnpackColorScale().
|
inline |
Definition at line 57 of file ColorScale.h.
References fXhi, fXlo, h1, h2, HSVtoRGB(), MakeBlueToGreen(), MakeBlueToOrange(), MakeBlueToRed(), MakeBlueToRedII(), MakeBrownToBlue(), MakeFocus(), MakeGreenToMagenta(), MakeHeatedObject(), MakeHSVScale(), MakeInvRainbow(), MakeLinGray(), MakeRainbow(), MakeSequential(), n, Palette(), Reverse(), s, Scale(), SetOverFlowColor(), and SetUnderFlowColor().
void evdb::ColorScale::SetOverFlowColor | ( | int | c | ) |
Definition at line 99 of file ColorScale.cxx.
References fOverFlowColor.
Referenced by SetBounds().
void evdb::ColorScale::SetPalette | ( | ) |
Set the ROOT color palette to use this color scale
Definition at line 234 of file ColorScale.cxx.
References fColors, and fNcolor.
void evdb::ColorScale::SetUnderFlowColor | ( | int | c | ) |
Definition at line 95 of file ColorScale.cxx.
References fUnderFlowColor.
Referenced by SetBounds().
|
private |
How many colors in scale?
Definition at line 88 of file ColorScale.h.
Referenced by GetColor(), MakeBlueToGreen(), MakeBlueToOrange(), MakeBlueToRed(), MakeBlueToRedII(), MakeBrownToBlue(), MakeFocus(), MakeGreenToMagenta(), MakeHeatedObject(), MakeHSVScale(), MakeInvRainbow(), MakeLinGray(), MakeRainbow(), MakeSequential(), Reverse(), and SetPalette().
|
private |
Linear? Log? Sqrt?
Definition at line 87 of file ColorScale.h.
Referenced by ColorScale(), GetColor(), MakeBlueToGreen(), MakeBlueToOrange(), MakeBlueToRed(), MakeBlueToRedII(), MakeBrownToBlue(), MakeFocus(), MakeGreenToMagenta(), MakeHeatedObject(), MakeHSVScale(), MakeInvRainbow(), MakeLinGray(), MakeRainbow(), MakeSequential(), Reverse(), and SetPalette().
|
private |
Color to use for under flows.
Definition at line 90 of file ColorScale.h.
Referenced by GetColor(), Reverse(), and SetOverFlowColor().
|
private |
Numeric value at high end of scale.
Definition at line 86 of file ColorScale.h.
Referenced by GetColor().
|
private |
List of ROOT color indicies.
Definition at line 89 of file ColorScale.h.
Referenced by GetColor(), Reverse(), and SetUnderFlowColor().
|
private |
Numeric value at low end of scale.
Definition at line 85 of file ColorScale.h.
Referenced by GetColor(), InBounds(), and SetBounds().
|
private |
Definition at line 84 of file ColorScale.h.
Referenced by GetColor(), InBounds(), and SetBounds().