102 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
103 0xffff, 0xffff, 0xffff, 0xffff
107 0x0000, 0x0000, 0x7000, 0x0000, 0x0000, 0x0000, 0xffff, 0xffff,
108 0x7000, 0x8000, 0xffff, 0xffff
112 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0xffff, 0xffff, 0x0000,
113 0x0000, 0x8000, 0xffff, 0xffff
117 0x0000, 0x0000, 0x7000, 0xffff, 0xffff, 0x0000, 0x0000, 0x0000,
118 0x0000, 0xa000, 0xffff, 0xffff
140 for (i = 0; i < 214; i++) {
147 for (
int r = 0;
r < 6;
r++) {
148 for (
int g = 0;
g < 6;
g++) {
149 for (
int b = 0;
b < 6;
b++) {
166 return fCLUT[ri][gi][bi];
171 static std::vector<Int_t> gRootColors;
172 if (!gRootColors.empty())
173 return gRootColors.data();
175 gRootColors.resize(216);
178 for (
int r = 0;
r < 6;
r++) {
179 for (
int g = 0;
g < 6;
g++) {
180 for (
int b = 0;
b < 6;
b++) {
186 return gRootColors.data();
195 0.00,0.02,0.04,0.06,0.08,0.10,0.12,0.14,0.16,0.18,0.20,0.22,0.24,0.26,
196 0.28,0.30,0.32,0.34,0.36,0.38,0.40,0.42,0.44,0.46,0.48,0.50,0.52,0.54,
197 0.56,0.58,0.60,0.62,0.64,0.66,0.68,0.70,0.72,0.74,0.76,0.78,0.80,0.82,
198 0.84,0.86,0.88,0.90,0.92,0.94,0.96,0.98 };
201 242,229,204,178,153,127,102,76,192,204,204,193,186,178,183,173,155,135,
202 175,132,89,137,130,173,122, 117,104,109,124,127,170,89,211,221,188,198,
203 191,170,165,147,206,211,255,0,255,255,0,0,53,0 };
206 242,229,204,178,153,127,102,76,182,198,198,191,181,165,163,153,142,102,
207 206,193,211,168,158,188,142,137,130,122,153,127,165,84,206,186,158,153,
208 130,142,119,104,94,89,0,255,0,255,0,255,53,0 };
211 242,229,204,178,153,127,102,76,172,170,170,168,163,150,155,140,130,86,
212 198,163,84,160,140,198,153,145,150,132,209,155,191,216,135,135,130,124,
213 119,147,122,112,96,84,0,255,255,0,255,0,53,0 };
216 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
217 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
218 255,255,255,255,255,255,255,255,255,255,255,255,255,255 };
221 19,18,17,16,15,14,13,12,11,20,21,22,23,24,25,26,27,28,29,30, 8,
222 31,32,33,34,35,36,37,38,39,40, 9, 41,42,43,44,45,47,48,49,46,50, 2,
223 7, 6, 5, 4, 3, 112,1};
237 for (
int i = 0; i<50; i++) {
314 static Int_t palette[50] = {19,18,17,16,15,14,13,12,11,20,
315 21,22,23,24,25,26,27,28,29,30, 8,
316 31,32,33,34,35,36,37,38,39,40, 9,
317 41,42,43,44,45,47,48,49,46,50, 2,
318 7, 6, 5, 4, 3, 112,1};
331 for (i=0;i<ncolors;i++) {
332 col =
gROOT->GetColor(palette[i]);
345 if (ncolors == 1 && !
colors) {
362 for (i=1;i<ncolors;i++) {
363 col =
gROOT->GetColor(51+i);
376 if (!
colors && ncolors > 50) {
377 static const Int_t nRGBs = 5;
378 static Float_t stops[nRGBs] = { 0.00, 0.34, 0.61, 0.84, 1.00 };
379 static Float_t red[nRGBs] = { 0.00, 0.09, 0.18, 0.09, 0.00 };
380 static Float_t green[nRGBs] = { 0.01, 0.02, 0.39, 0.68, 0.97 };
381 static Float_t blue[nRGBs] = { 0.17, 0.39, 0.62, 0.79, 0.97 };
407 for (i=0;i<ncolors;i++) {
442 if (
this != &palette) {
496 static std::vector<Int_t> gRootColors;
497 if (!gRootColors.empty())
498 return gRootColors.data();
505 return gRootColors.data();
613 out <<
" " <<
name <<
"->SetImageQuality(TAttImage::";
615 case kImgPoor: out <<
"kImgPoor";
break;
616 case kImgFast: out <<
"kImgFast";
break;
617 case kImgGood: out <<
"kImgGood";
break;
618 case kImgBest: out <<
"kImgBest";
break;
619 default: out <<
"kImgDefault";
626 out <<
" " <<
name <<
"->SetConstRatio(" << (
fConstRatio ?
"kTRUE" :
"kFALSE") <<
");\n";
747 if (ncontours != 0 ) {
748 minColor = (0.99*ncolors)/ncontours;
749 scale =
static_cast<Double_t>(ncolors)/ncontours;
755 Double_t step = 1./(pPalette->fNumPoints-1);
757 for (
UInt_t i=0; i<pPalette->fNumPoints; ++i) {
759 pPalette->fPoints[i] = i*step;
777 if (
auto h =
gROOT->GetPluginManager()->FindHandler(
"TPaletteEditor")) {
778 if (
h->LoadPlugin() == -1)
unsigned short UShort_t
Unsigned Short integer 2 bytes (unsigned short).
int Int_t
Signed integer 4 bytes (int).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
short Short_t
Signed Short integer 2 bytes (short).
double Double_t
Double 8 bytes.
float Float_t
Float 4 bytes (float).
const char Option_t
Option string (const char).
static UShort_t gBlueDefault[kNUM_DEFAULT_COLORS]
static UShort_t gWebBase[6]
static UShort_t gGreenDefault[kNUM_DEFAULT_COLORS]
static UShort_t gDefHistG[50]
static UShort_t gDefHistA[50]
static UShort_t gDefHistR[50]
const Int_t kNUM_DEFAULT_COLORS
static Double_t gDefHistP[50]
static UShort_t gAlphaDefault[kNUM_DEFAULT_COLORS]
static UShort_t gDefHistB[50]
static Int_t gDefHistRoot[50]
static UShort_t gRedDefault[kNUM_DEFAULT_COLORS]
externTImagePalette * gHistImagePalette
externTImagePalette * gWebImagePalette
TPaletteEditor * fPaletteEditor
! GUI to edit the color palette
virtual void ResetAttImage(Option_t *option="")
Reset this image attributes to default values.
virtual void SetPalette(const TImagePalette *palette)
Set a new palette for the image.
Bool_t fConstRatio
keep aspect ratio of image on the screen
virtual ~TAttImage()
TAttImage destructor.
UInt_t fImageCompression
compression [0 .. 100] 0: no compression
EImageQuality fImageQuality
OPTION={GetMethod="GetImageQuality";SetMethod="SetImageQuality";Items=(kImgDefault="Default",...
TAttImage()
TAttImage default constructor.
void Copy(TAttImage &attline) const
Copy this image attributes to a new attimage.
TImagePalette fPalette
color palette for value -> color conversion
Bool_t fPaletteEnabled
! kTRUE - palette is drawn on the image
virtual void SaveImageAttributes(std::ostream &out, const char *name, EImageQuality qualdef=kImgPoor, UInt_t comprdef=0, Bool_t constRatiodef=kTRUE)
Save image attributes as C++ statement(s) on output stream, but not the palette.
virtual void SetConstRatio(Bool_t constRatio=kTRUE)
Set (constRatio = kTRUE) or unset (constRadio = kFALSE) the ratio flag.
virtual void StartPaletteEditor()
Opens a GUI to edit the color palette.
static Int_t GetColor(const char *hexcolor)
Int_t * GetRootColors() override
Returns a list of ROOT colors.
A class to define a conversion from pixel values to pixel color.
TImagePalette & operator=(const TImagePalette &palette)
Assignment operator.
virtual Int_t * GetRootColors()
Returns a list of ROOT colors.
UShort_t * fColorRed
[fNumPoints] red color at each anchor point
~TImagePalette() override
Destructor.
Double_t * fPoints
[fNumPoints] value of each anchor point [0..1]
static TImagePalette * CreateCOLPalette(Int_t nContours)
Factory method to creates an image palette for histogram plotting.
TImagePalette()
Default constructor, sets all pointers to 0.
virtual Int_t FindColor(UShort_t r, UShort_t g, UShort_t b)
Returns an index of the closest color.
UShort_t * fColorGreen
[fNumPoints] green color at each anchor point
UShort_t * fColorBlue
[fNumPoints] blue color at each anchor point
UInt_t fNumPoints
number of anchor points
static TImagePalette * Create(Option_t *opts)
Factory method to creates an image palette of a specific typ.
UShort_t * fColorAlpha
[fNumPoints] alpha at each anchor point
TObject()
TObject constructor.
Edit the palette via a GUI.
virtual void CloseWindow()
Closes the window and deletes itself.
TPaletteEditor(TAttImage *attImage, UInt_t w, UInt_t h)
Constructor.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Int_t FindColor(UShort_t r, UShort_t g, UShort_t b) override
Returns an index of the closest color.
Int_t * GetRootColors() override
Returns a list of ROOT colors.
Long64_t BinarySearch(Long64_t n, const T *array, T value)
Binary search in an array of n values to locate value.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.