Logo ROOT  
Reference Guide
TAttImage.cxx
Go to the documentation of this file.
1// @(#)root/graf:$Id$
2// Author: Reiner Rohlfs 24/03/02
3
4/*************************************************************************
5 * Copyright (C) 2001-2001, Rene Brun, Fons Rademakers and Reiner Rohlfs *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12/** \class TAttImage
13\ingroup BasicGraphics
14\ingroup GraphicsAtt
15
16TImage attributes.
17
18Image attributes are:
19
20- Image Quality (see EImageQuality for the list of qualities)
21- Compression defines the compression rate of the color data in the
22 internal image structure. Speed and memory depends
23 on this rate, but not the image display itself
24 0: no compression; 100: max compression
25- Radio Flag: kTRUE the x/y radio of the displayed image is always
26 identical to the original image kFALSE the x and y size of the displayed
27 image depends on the size of the pad
28- Palette: Defines the conversion from a pixel value to the
29 screen color
30
31This class is used (in general by secondary inheritance)
32by some other classes (image display).
33*/
34
35/** \class TImagePalette
36\ingroup BasicGraphics
37
38A class to define a conversion from pixel values to pixel color.
39
40A Palette is defined by some anchor points. Each anchor point has
41a value between 0 and 1 and a color. An image has to be normalized
42and the values between the anchor points are interpolated.
43All member variables are public and can be directly manipulated.
44In most cases the default operator will be used to create a
45TImagePalette. In this case the member arrays have to be allocated
46by an application and will be deleted in the destructor of this
47class.
48
49We provide few predefined palettes:
50
51- gHistImagePalette - palette used in TH2::Draw("col")
52- gWebImagePalette
53 The web palette is a set of 216 colors that will not dither or
54 shift on PCs or Macs. Browsers use this built-in palette when
55 they need to render colors on monitors with only 256 colors
56 (also called 8-bit color monitors).
57 The 6x6x6 web palette provides very quick color index lookup
58 and can be used for good quality conversion of images into
59 2-D histograms.
60- TImagePalette(Int_t ncolors, Int_t *colors)
61 if ncolors <= 0 a default palette (see below) of 50 colors
62 is defined.
63
64if ncolors == 1 && colors == 0, then a Rainbow Palette is created.
65
66if ncolors > 50 and colors=0, the DeepSea palette is used.
67(see TStyle::CreateGradientColorTable for more details)
68
69if ncolors > 0 and colors = 0, the default palette is used with a maximum of ncolors.
70
71The default palette defines:
72- index 0->9 : grey colors from light to dark grey
73- index 10->19 : "brown" colors
74- index 20->29 : "blueish" colors
75- index 30->39 : "redish" colors
76- index 40->49 : basic colors
77*/
78
79/** \class TPaletteEditor
80\ingroup BasicGraphics
81
82Edit the palette via a GUI.
83
84This class provides a way to edit the palette via a GUI.
85*/
86
87
88#include "TAttImage.h"
89#include "TROOT.h"
90#include "TPluginManager.h"
91#include <iostream>
92#include "TColor.h"
93#include "TMath.h"
94#include "TStyle.h"
95
96
100
101
102// definition of a default palette
105 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
106 0xffff, 0xffff, 0xffff, 0xffff
107};
108
110 0x0000, 0x0000, 0x7000, 0x0000, 0x0000, 0x0000, 0xffff, 0xffff,
111 0x7000, 0x8000, 0xffff, 0xffff
112};
113
115 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0xffff, 0xffff, 0x0000,
116 0x0000, 0x8000, 0xffff, 0xffff
117};
118
120 0x0000, 0x0000, 0x7000, 0xffff, 0xffff, 0x0000, 0x0000, 0x0000,
121 0x0000, 0xa000, 0xffff, 0xffff
122};
123
124
125//////////////////////////// Web Palette ///////////////////////////////////////
126static UShort_t gWebBase[6] = { 0, 51, 102, 153, 204, 255 };
127
129
130private:
131 Int_t fCLUT[6][6][6]; // Color LookUp Table
132
133public:
135 int i = 0;
136 fNumPoints = 216;
137 fPoints = new Double_t[216];
138 fColorRed = new UShort_t[216];
139 fColorBlue = new UShort_t[216];
140 fColorGreen = new UShort_t[216];
141 fColorAlpha = new UShort_t[216];
142
143 for (i = 0; i < 214; i++) {
144 fPoints[i + 1] = (double)i/213;
145 }
146 fPoints[0] = 0;
147 fPoints[215] = 1;
148
149 i = 0;
150 for (int r = 0; r < 6; r++) {
151 for (int g = 0; g < 6; g++) {
152 for (int b = 0; b < 6; b++) {
153 fColorRed[i] = gWebBase[r] << 8;
154 fColorGreen[i] = gWebBase[g] << 8;
155 fColorBlue[i] = gWebBase[b] << 8;
156 fColorAlpha[i] = 0xffff;
157 fCLUT[r][g][b] = i;
158 i++;
159 }
160 }
161 }
162 }
163
165 {
169 return fCLUT[ri][gi][bi];
170 }
171
173 {
174 static Int_t *gRootColors = nullptr;
175 if (gRootColors) return gRootColors;
176
177 gRootColors = new Int_t[216];
178
179 int i = 0;
180 for (int r = 0; r < 6; r++) {
181 for (int g = 0; g < 6; g++) {
182 for (int b = 0; b < 6; b++) {
183 gRootColors[i] = TColor::GetColor(gWebBase[r], gWebBase[g], gWebBase[b]);
184 i++;
185 }
186 }
187 }
188 return gRootColors;
189 }
190};
191
193
194
195////////////////////////////// Hist Palette ////////////////////////////////////
196static Double_t gDefHistP[50] = {
197 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,
198 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,
199 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,
200 0.84,0.86,0.88,0.90,0.92,0.94,0.96,0.98 };
201
202static UShort_t gDefHistR[50] = {
203 242,229,204,178,153,127,102,76,192,204,204,193,186,178,183,173,155,135,
204 175,132,89,137,130,173,122, 117,104,109,124,127,170,89,211,221,188,198,
205 191,170,165,147,206,211,255,0,255,255,0,0,53,0 };
206
207static UShort_t gDefHistG[50] = {
208 242,229,204,178,153,127,102,76,182,198,198,191,181,165,163,153,142,102,
209 206,193,211,168,158,188,142,137,130,122,153,127,165,84,206,186,158,153,
210 130,142,119,104,94,89,0,255,0,255,0,255,53,0 };
211
212static UShort_t gDefHistB[50] = {
213 242,229,204,178,153,127,102,76,172,170,170,168,163,150,155,140,130,86,
214 198,163,84,160,140,198,153,145,150,132,209,155,191,216,135,135,130,124,
215 119,147,122,112,96,84,0,255,255,0,255,0,53,0 };
216
217static UShort_t gDefHistA[50] = {
218 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
219 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
220 255,255,255,255,255,255,255,255,255,255,255,255,255,255 };
221
222static Int_t gDefHistRoot[50] = {
223 19,18,17,16,15,14,13,12,11,20,21,22,23,24,25,26,27,28,29,30, 8,
224 31,32,33,34,35,36,37,38,39,40, 9, 41,42,43,44,45,47,48,49,46,50, 2,
225 7, 6, 5, 4, 3, 112,1};
226
227
229
230public:
232 fNumPoints = 50;
238
239 for (int i = 0; i<50; i++) {
240 fColorRed[i] = fColorRed[i] << 8;
241 fColorGreen[i] = fColorGreen[i] << 8;
242 fColorBlue[i] = fColorBlue[i] << 8;
243 fColorAlpha[i] = fColorAlpha[i] << 8;
244 }
245 }
246
247 Int_t *GetRootColors() override { return gDefHistRoot; }
248};
249
251
252
253////////////////////////////////////////////////////////////////////////////////
254/// Constructor.
255
257{
258 fAttImage = attImage;
259}
260
261////////////////////////////////////////////////////////////////////////////////
262/// Closes the window and deletes itself.
263
265{
267}
268
269////////////////////////////////////////////////////////////////////////////////
270/// Default constructor, sets all pointers to 0.
271
273{
274 fNumPoints = 0;
275 fPoints = 0;
276 fColorRed = 0;
277 fColorGreen = 0;
278 fColorBlue = 0;
279 fColorAlpha = 0;
280}
281
282////////////////////////////////////////////////////////////////////////////////
283/// Constructor for a palette with numPoints anchor points.
284/// It allocates the memory but does not set any colors.
285
287{
288 fNumPoints = numPoints;
294}
295
296////////////////////////////////////////////////////////////////////////////////
297/// Copy constructor.
298
300{
301 fNumPoints = palette.fNumPoints;
302
304 memcpy(fPoints, palette.fPoints, fNumPoints * sizeof(Double_t));
305
310 memcpy(fColorRed, palette.fColorRed, fNumPoints * sizeof(UShort_t));
311 memcpy(fColorGreen, palette.fColorGreen, fNumPoints * sizeof(UShort_t));
312 memcpy(fColorBlue, palette.fColorBlue, fNumPoints * sizeof(UShort_t));
313 memcpy(fColorAlpha, palette.fColorAlpha, fNumPoints * sizeof(UShort_t));
314}
315
316////////////////////////////////////////////////////////////////////////////////
317/// Creates palette in the same way as TStyle::SetPalette
318
320{
321 fNumPoints = 0;
322 fPoints = 0;
323 fColorRed = 0;
324 fColorGreen = 0;
325 fColorBlue = 0;
326 fColorAlpha = 0;
327
328 Int_t i;
329 static Int_t palette[50] = {19,18,17,16,15,14,13,12,11,20,
330 21,22,23,24,25,26,27,28,29,30, 8,
331 31,32,33,34,35,36,37,38,39,40, 9,
332 41,42,43,44,45,47,48,49,46,50, 2,
333 7, 6, 5, 4, 3, 112,1};
334 TColor *col = 0;
335 Float_t step = 0;
336 // set default palette (pad type)
337 if (ncolors <= 0) {
338 ncolors = 50;
339 fNumPoints = ncolors;
340 step = 1./fNumPoints;
346 for (i=0;i<ncolors;i++) {
347 col = gROOT->GetColor(palette[i]);
348 fPoints[i] = i*step;
349 if (col) {
350 fColorRed[i] = UShort_t(col->GetRed()*255) << 8;
351 fColorGreen[i] = UShort_t(col->GetGreen()*255) << 8;
352 fColorBlue[i] = UShort_t(col->GetBlue()*255) << 8;
353 }
354 fColorAlpha[i] = 65280;
355 }
356 return;
357 }
358
359 // set Pretty Palette Spectrum Violet->Red
360 if (ncolors == 1 && colors == 0) {
361 ncolors = 50;
362 fNumPoints = ncolors;
363 step = 1./fNumPoints;
369
370 // 0 point is white
371 fPoints[0] = 0;
372 fColorRed[0] = 255 << 8;
373 fColorGreen[0] = 255 << 8;
374 fColorBlue[0] = 255 << 8;
375 fColorAlpha[0] = 0;
376
377 for (i=1;i<ncolors;i++) {
378 col = gROOT->GetColor(51+i);
379 fPoints[i] = i*step;
380 if (col) {
381 fColorRed[i] = UShort_t(col->GetRed()*255) << 8;
382 fColorGreen[i] = UShort_t(col->GetGreen()*255) << 8;
383 fColorBlue[i] = UShort_t(col->GetBlue()*255) << 8;
384 }
385 fColorAlpha[i] = 65280;
386 }
387 return;
388 }
389
390 // set DeepSea palette
391 if (colors == 0 && ncolors > 50) {
392 static const Int_t nRGBs = 5;
393 static Float_t stops[nRGBs] = { 0.00, 0.34, 0.61, 0.84, 1.00 };
394 static Float_t red[nRGBs] = { 0.00, 0.09, 0.18, 0.09, 0.00 };
395 static Float_t green[nRGBs] = { 0.01, 0.02, 0.39, 0.68, 0.97 };
396 static Float_t blue[nRGBs] = { 0.17, 0.39, 0.62, 0.79, 0.97 };
397 fNumPoints = nRGBs;
403 for (i=0;i<(int)fNumPoints;i++) {
404 fPoints[i] = stops[i];
405 fColorRed[i] = UShort_t(red[i]*255) << 8;
406 fColorGreen[i] = UShort_t(green[i]*255) << 8;
407 fColorBlue[i] = UShort_t(blue[i]*255) << 8;
408 fColorAlpha[i] = 65280;
409 }
410 return;
411 }
412
413 // set user defined palette
414 if (colors) {
415 fNumPoints = ncolors;
416 step = 1./fNumPoints;
422 for (i=0;i<ncolors;i++) {
423 fPoints[i] = i*step;
424 col = gROOT->GetColor(colors[i]);
425 if (col) {
426 fColorRed[i] = UShort_t(col->GetRed()*255) << 8;
427 fColorGreen[i] = UShort_t(col->GetGreen()*255) << 8;
428 fColorBlue[i] = UShort_t(col->GetBlue()*255) << 8;
429 fColorAlpha[i] = 65280;
430 } else {
431 fColorRed[i] = 0;
432 fColorGreen[i] = 0;
433 fColorBlue[i] = 0;
434 fColorAlpha[i] = 0;
435 }
436 }
437 }
438}
439
440////////////////////////////////////////////////////////////////////////////////
441/// Destructor.
442
444{
445 delete [] fPoints;
446 delete [] fColorRed;
447 delete [] fColorGreen;
448 delete [] fColorBlue;
449 delete [] fColorAlpha;
450}
451
452////////////////////////////////////////////////////////////////////////////////
453/// Assignment operator.
454
456{
457 if (this != &palette) {
458 fNumPoints = palette.fNumPoints;
459
460 delete [] fPoints;
462 memcpy(fPoints, palette.fPoints, fNumPoints * sizeof(Double_t));
463
464 delete [] fColorRed;
466 memcpy(fColorRed, palette.fColorRed, fNumPoints * sizeof(UShort_t));
467
468 delete [] fColorGreen;
470 memcpy(fColorGreen, palette.fColorGreen, fNumPoints * sizeof(UShort_t));
471
472 delete [] fColorBlue;
474 memcpy(fColorBlue, palette.fColorBlue, fNumPoints * sizeof(UShort_t));
475
476 delete [] fColorAlpha;
478 memcpy(fColorAlpha, palette.fColorAlpha, fNumPoints * sizeof(UShort_t));
479 }
480
481 return *this;
482}
483
484////////////////////////////////////////////////////////////////////////////////
485/// Returns an index of the closest color
486
488{
489 Int_t ret = 0;
490 UInt_t d = 10000;
491 UInt_t min = 10000;
492
493 for (UInt_t i = 0; i < fNumPoints; i++) {
494 d = TMath::Abs(r - ((fColorRed[i] & 0xff00) >> 8)) +
495 TMath::Abs(g - ((fColorGreen[i] & 0xff00) >> 8)) +
496 TMath::Abs(b - ((fColorBlue[i] & 0xff00) >> 8));
497 if (d < min) {
498 min = d;
499 ret = i;
500 }
501 }
502 return ret;
503}
504
505////////////////////////////////////////////////////////////////////////////////
506/// Returns a list of ROOT colors. Could be used to set histogram palette.
507/// See also TStyle::SetPalette
508
510{
511 static Int_t *gRootColors = 0;
512 if (gRootColors) return gRootColors;
513
514 gRootColors = new Int_t[fNumPoints];
515
516 for (UInt_t i = 0; i < fNumPoints; i++) {
517 gRootColors[i] = TColor::GetColor(fColorRed[i], fColorGreen[i], fColorBlue[i]);
518 }
519 return gRootColors;
520}
521
522////////////////////////////////////////////////////////////////////////////////
523/// TAttImage default constructor.
524/// Calls ResetAttImage to set the attributes to a default state.
525
527{
529 fPaletteEditor = 0;
531}
532
533////////////////////////////////////////////////////////////////////////////////
534/// TAttImage normal constructor.
535/// Image attributes are taken from the argument list
536///
537/// \param[in] lquality must be one of EImageQuality (kImgDefault is same as
538/// kImgGood in the current implementation)
539/// \param[in] lcompression defines the compression rate of the color data in the
540/// image. Speed and memory depends on this rate, but not
541/// the image display itself
542/// 0: no compression; 100: max compression
543/// \param[in] constRatio keeps the aspect ratio of the image constant on the
544/// screen (in pixel units)
545
547 Bool_t constRatio)
548{
550
551 fImageQuality = lquality;
552 fImageCompression = (lcompression > 100) ? 100 : lcompression;
553 fConstRatio = constRatio;
554 fPaletteEditor = 0;
556}
557
558////////////////////////////////////////////////////////////////////////////////
559/// TAttImage destructor.
560
562{
563 delete fPaletteEditor;
564}
565
566////////////////////////////////////////////////////////////////////////////////
567/// Copy this image attributes to a new attimage.
568
569void TAttImage::Copy(TAttImage &attimage) const
570{
571 attimage.fImageQuality = fImageQuality;
573 attimage.fConstRatio = fConstRatio;
574 attimage.fPalette = fPalette;
575}
576
577////////////////////////////////////////////////////////////////////////////////
578/// Reset this image attributes to default values.
579/// Default values are:
580///
581/// - quality: kImgPoor, (no smoothing while the image is zoomed)
582/// - compression: 0 (no compression)
583/// - constRatio: kTRUE
584/// - palette: a default rainbow palette
585
587{
591
592 // set the default palette
593 delete [] fPalette.fPoints;
594 delete [] fPalette.fColorRed;
595 delete [] fPalette.fColorGreen;
596 delete [] fPalette.fColorBlue;
597 delete [] fPalette.fColorAlpha;
598
600
606
611
612 for (Int_t point = 0; point < kNUM_DEFAULT_COLORS - 2; point++)
613 fPalette.fPoints[point + 1] = (double)point / (kNUM_DEFAULT_COLORS - 3);
614 fPalette.fPoints[0] = 0;
616}
617
618////////////////////////////////////////////////////////////////////////////////
619/// Save image attributes as C++ statement(s) on output stream, but
620/// not the palette.
621
622void TAttImage::SaveImageAttributes(std::ostream &out, const char *name,
623 EImageQuality qualdef,
624 UInt_t comprdef, Bool_t constRatiodef)
625{
626 if (fImageQuality != qualdef) {
627 out<<" "<<name<<"->SetImageQuality("<<fImageQuality<<");"<<std::endl;
628 }
629 if (fImageCompression != comprdef) {
630 out<<" "<<name<<"->SetImageCompression("<<fImageCompression<<");"<<std::endl;
631 }
632 if (fConstRatio != constRatiodef) {
633 out<<" "<<name<<"->SetConstRatio("<<fConstRatio<<");"<<std::endl;
634 }
635}
636
637////////////////////////////////////////////////////////////////////////////////
638/// Set (constRatio = kTRUE) or unset (constRadio = kFALSE) the ratio flag.
639/// The aspect ratio of the image on the screen is constant if the ratio
640/// flag is set. That means one image pixel is always a square on the screen
641/// independent of the pad size and of the size of the zoomed area.
642
644{
645 fConstRatio = constRatio;
646}
647
648////////////////////////////////////////////////////////////////////////////////
649/// Set a new palette for the image. If palette == 0 a default
650/// rainbow color palette is used.
651
653{
654 if (palette)
655 fPalette = *palette;
656 else {
657 // set default palette
658
659 delete [] fPalette.fPoints;
660 delete [] fPalette.fColorRed;
661 delete [] fPalette.fColorGreen;
662 delete [] fPalette.fColorBlue;
663 delete [] fPalette.fColorAlpha;
664
666
672
677
678 for (Int_t point = 0; point < kNUM_DEFAULT_COLORS - 2; point++)
679 fPalette.fPoints[point + 1] = (double)point / (kNUM_DEFAULT_COLORS - 3);
680 fPalette.fPoints[0] = 0;
682 }
683}
684
685////////////////////////////////////////////////////////////////////////////////
686/// Factory method to creates an image palette of a specific typ
687///
688/// Create a new palette
689///
690/// This creates a new TImagePalette based on the
691/// option specified in the parameter. The supported options are:
692///
693/// - "col" - color palette similar in TStyle (i.e. use for "col" option)
694/// - "web" - color palette similar to gWebImagePalette
695/// - "hist" - color palette similar to gHistImagePalette
696///
697/// \param opts the type of palette to create
698///
699/// Ownership of the returned object transfers to the caller.
700///
701/// \retval new palette
702/// \retval nullptr - option does not exist
703
705{
706 TImagePalette* pPalette = nullptr;
707
708 TString option(opts);
709 if (option.Contains("col", TString::kIgnoreCase)) {
710 // Define the new palette using the current palette in TStyle
711 pPalette = new TImagePalette(gStyle->GetNumberOfColors());
712 Double_t step = 1./(pPalette->fNumPoints-1);
713
714 for (UInt_t i=0; i<pPalette->fNumPoints; ++i) {
715 TColor* pColor = gROOT->GetColor(gStyle->GetColorPalette(i));
716 pPalette->fPoints[i] = i*step;
717 if (pColor) {
718 pPalette->fColorRed[i] = UShort_t(pColor->GetRed()*255) << 8;
719 pPalette->fColorGreen[i] = UShort_t(pColor->GetGreen()*255) << 8;
720 pPalette->fColorBlue[i] = UShort_t(pColor->GetBlue()*255) << 8;
721 }
722 pPalette->fColorAlpha[i] = 0xff00;
723 }
724 } else if (option.Contains("web", TString::kIgnoreCase)) {
725 pPalette = new TDefHistImagePalette();
726 } else if (option.Contains("hist", TString::kIgnoreCase)) {
727 pPalette = new TWebPalette();
728 }
729
730 return pPalette;
731}
732
733////////////////////////////////////////////////////////////////////////////////
734/// Factory method to creates an image palette for histogram plotting.
735///
736/// Creates a "col" palette with correct number of contours
737///
738/// The behavior is similar to the TImagePalette::Create() method with
739/// the "col" option. The difference here is that the palette will only
740/// contain a specific number of colors. This method is used to create
741/// the palette used in the "col2" and "colz2" options. It handles the
742/// color selection for contours.
743///
744/// \param ncontours number of contours
745///
746/// Ownership of the returned object transfers to the caller.
747///
748/// \return new palette
749
751{
752 Int_t ncolors = gStyle->GetNumberOfColors();
753 Int_t minColor = 0;
754 Double_t scale = 1;
755 if (ncontours != 0 ) {
756 minColor = (0.99*ncolors)/ncontours;
757 scale = static_cast<Double_t>(ncolors)/ncontours;
758 ncolors = ncontours;
759 }
760
761 // Define the new palette using the current palette in TStyle
762 auto pPalette = new TImagePalette(ncolors);
763 Double_t step = 1./(pPalette->fNumPoints-1);
764
765 for (UInt_t i=0; i<pPalette->fNumPoints; ++i) {
766 TColor* pColor = gROOT->GetColor(gStyle->GetColorPalette(minColor + i*scale));
767 pPalette->fPoints[i] = i*step;
768 if (pColor) {
769 pPalette->fColorRed[i] = UShort_t(pColor->GetRed()*255) << 8;
770 pPalette->fColorGreen[i] = UShort_t(pColor->GetGreen()*255) << 8;
771 pPalette->fColorBlue[i] = UShort_t(pColor->GetBlue()*255) << 8;
772 pPalette->fColorAlpha[i] = UShort_t(pColor->GetAlpha()*255) << 8;
773 }
774 }
775
776 return pPalette;
777}
778
779////////////////////////////////////////////////////////////////////////////////
780/// Opens a GUI to edit the color palette.
781
783{
784 if (fPaletteEditor == 0) {
786
787 if ((h = gROOT->GetPluginManager()->FindHandler("TPaletteEditor"))) {
788 if (h->LoadPlugin() == -1)
789 return;
790 fPaletteEditor = (TPaletteEditor *) h->ExecPlugin(3, this, 80, 25);
791 }
792 }
793}
#define d(i)
Definition: RSha256.hxx:102
#define h(i)
Definition: RSha256.hxx:106
unsigned short UShort_t
Definition: RtypesCore.h:40
int Int_t
Definition: RtypesCore.h:45
float Float_t
Definition: RtypesCore.h:57
short Short_t
Definition: RtypesCore.h:39
double Double_t
Definition: RtypesCore.h:59
const Bool_t kTRUE
Definition: RtypesCore.h:100
const char Option_t
Definition: RtypesCore.h:66
#define ClassImp(name)
Definition: Rtypes.h:375
static UShort_t gBlueDefault[kNUM_DEFAULT_COLORS]
Definition: TAttImage.cxx:119
static UShort_t gWebBase[6]
Definition: TAttImage.cxx:126
static UShort_t gGreenDefault[kNUM_DEFAULT_COLORS]
Definition: TAttImage.cxx:114
TImagePalette * gWebImagePalette
Definition: TAttImage.cxx:192
static UShort_t gDefHistG[50]
Definition: TAttImage.cxx:207
static UShort_t gDefHistA[50]
Definition: TAttImage.cxx:217
static UShort_t gDefHistR[50]
Definition: TAttImage.cxx:202
const Int_t kNUM_DEFAULT_COLORS
Definition: TAttImage.cxx:103
static Double_t gDefHistP[50]
Definition: TAttImage.cxx:196
static UShort_t gAlphaDefault[kNUM_DEFAULT_COLORS]
Definition: TAttImage.cxx:104
TImagePalette * gHistImagePalette
Definition: TAttImage.cxx:250
static UShort_t gDefHistB[50]
Definition: TAttImage.cxx:212
static Int_t gDefHistRoot[50]
Definition: TAttImage.cxx:222
static UShort_t gRedDefault[kNUM_DEFAULT_COLORS]
Definition: TAttImage.cxx:109
Option_t Option_t option
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t b
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t g
char name[80]
Definition: TGX11.cxx:110
#define gROOT
Definition: TROOT.h:404
R__EXTERN TStyle * gStyle
Definition: TStyle.h:414
Color * colors
Definition: X3DBuffer.c:21
TImage attributes.
Definition: TAttImage.h:59
TPaletteEditor * fPaletteEditor
! GUI to edit the color palette
Definition: TAttImage.h:76
virtual void ResetAttImage(Option_t *option="")
Reset this image attributes to default values.
Definition: TAttImage.cxx:586
virtual void SetPalette(const TImagePalette *palette)
Set a new palette for the image.
Definition: TAttImage.cxx:652
Bool_t fConstRatio
keep aspect ratio of image on the screen
Definition: TAttImage.h:74
virtual ~TAttImage()
TAttImage destructor.
Definition: TAttImage.cxx:561
UInt_t fImageCompression
compression [0 .. 100] 0: no compression
Definition: TAttImage.h:73
EImageQuality fImageQuality
OPTION={GetMethod="GetImageQuality";SetMethod="SetImageQuality";Items=(kImgDefault="Default",...
Definition: TAttImage.h:72
TAttImage()
TAttImage default constructor.
Definition: TAttImage.cxx:526
void Copy(TAttImage &attline) const
Copy this image attributes to a new attimage.
Definition: TAttImage.cxx:569
@ kImgPoor
Definition: TAttImage.h:65
TImagePalette fPalette
color palette for value -> color conversion
Definition: TAttImage.h:75
virtual void EditorClosed()
Definition: TAttImage.h:103
Bool_t fPaletteEnabled
! kTRUE - palette is drawn on the image
Definition: TAttImage.h:77
virtual void SetConstRatio(Bool_t constRatio=kTRUE)
Set (constRatio = kTRUE) or unset (constRadio = kFALSE) the ratio flag.
Definition: TAttImage.cxx:643
virtual void StartPaletteEditor()
Opens a GUI to edit the color palette.
Definition: TAttImage.cxx:782
virtual void SaveImageAttributes(std::ostream &out, const char *name, EImageQuality qualdef=kImgDefault, UInt_t comprdef=0, Bool_t constRatiodef=kTRUE)
Save image attributes as C++ statement(s) on output stream, but not the palette.
Definition: TAttImage.cxx:622
The color creation and management class.
Definition: TColor.h:19
Float_t GetRed() const
Definition: TColor.h:58
static Int_t GetColor(const char *hexcolor)
Static method returning color number for color specified by hex color string of form: "#rrggbb",...
Definition: TColor.cxx:1822
Float_t GetAlpha() const
Definition: TColor.h:64
Float_t GetBlue() const
Definition: TColor.h:60
Float_t GetGreen() const
Definition: TColor.h:59
Int_t * GetRootColors() override
Returns a list of ROOT colors.
Definition: TAttImage.cxx:247
A class to define a conversion from pixel values to pixel color.
Definition: TAttImage.h:33
TImagePalette & operator=(const TImagePalette &palette)
Assignment operator.
Definition: TAttImage.cxx:455
virtual Int_t * GetRootColors()
Returns a list of ROOT colors.
Definition: TAttImage.cxx:509
UShort_t * fColorRed
[fNumPoints] red color at each anchor point
Definition: TAttImage.h:38
Double_t * fPoints
[fNumPoints] value of each anchor point [0..1]
Definition: TAttImage.h:37
static TImagePalette * CreateCOLPalette(Int_t nContours)
Factory method to creates an image palette for histogram plotting.
Definition: TAttImage.cxx:750
TImagePalette()
Default constructor, sets all pointers to 0.
Definition: TAttImage.cxx:272
virtual ~TImagePalette()
Destructor.
Definition: TAttImage.cxx:443
virtual Int_t FindColor(UShort_t r, UShort_t g, UShort_t b)
Returns an index of the closest color.
Definition: TAttImage.cxx:487
UShort_t * fColorGreen
[fNumPoints] green color at each anchor point
Definition: TAttImage.h:39
UShort_t * fColorBlue
[fNumPoints] blue color at each anchor point
Definition: TAttImage.h:40
UInt_t fNumPoints
number of anchor points
Definition: TAttImage.h:36
static TImagePalette * Create(Option_t *opts)
Factory method to creates an image palette of a specific typ.
Definition: TAttImage.cxx:704
UShort_t * fColorAlpha
[fNumPoints] alpha at each anchor point
Definition: TAttImage.h:41
Mother of all ROOT objects.
Definition: TObject.h:37
Edit the palette via a GUI.
Definition: TAttImage.h:19
virtual void CloseWindow()
Closes the window and deletes itself.
Definition: TAttImage.cxx:264
TAttImage * fAttImage
Definition: TAttImage.h:22
TPaletteEditor(TAttImage *attImage, UInt_t w, UInt_t h)
Constructor.
Definition: TAttImage.cxx:256
Basic string class.
Definition: TString.h:136
@ kIgnoreCase
Definition: TString.h:268
Int_t GetColorPalette(Int_t i) const
Return color number i in current palette.
Definition: TStyle.cxx:1057
Int_t GetNumberOfColors() const
Return number of colors in the color palette.
Definition: TStyle.cxx:1123
Int_t fCLUT[6][6][6]
Definition: TAttImage.cxx:131
Int_t FindColor(UShort_t r, UShort_t g, UShort_t b) override
Returns an index of the closest color.
Definition: TAttImage.cxx:164
Int_t * GetRootColors() override
Returns a list of ROOT colors.
Definition: TAttImage.cxx:172
Long64_t BinarySearch(Long64_t n, const T *array, T value)
Definition: TMathBase.h:274
Short_t Abs(Short_t d)
Definition: TMathBase.h:120