Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TASPaletteEditor.cxx
Go to the documentation of this file.
1// @(#)root/asimage:$Id$
2// Author: Reiner Rohlfs 24/03/2002
3
4/*************************************************************************
5 * Copyright (C) 1995-2002, 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 TASPaletteEditor
13\ingroup asimage
14
15This is a GUI window to edit a color palette.
16It is called by a pull down menu item of TASImage.
17*/
18
19#include "TASImage.h"
20#include "TRootEmbeddedCanvas.h"
21#include "TCanvas.h"
22#include "TH1.h"
23#include "TFile.h"
24#include "TASPaletteEditor.h"
25#include "TGXYLayout.h"
26#include "TGButton.h"
27#include "TGComboBox.h"
28#include "TGFileDialog.h"
29#include "TLine.h"
30#include "TROOT.h"
31#include "TMath.h"
32#include "RConfigure.h"
33#include "TVirtualX.h"
34#include "strlcpy.h"
35#include "snprintf.h"
36
37#ifdef R__HAS_COCOA
38# define X_DISPLAY_MISSING 1
39#endif
40
41#ifdef WIN32
42#include "Windows4root.h"
43#endif
44
45#ifndef WIN32
46# include <afterbase.h>
47#else
48# include <win32/config.h>
49# include <win32/afterbase.h>
50#endif
51# include <afterimage.h>
52extern "C" {
53# include <bmp.h>
54}
55
56
57static const char *gFileTypes[] = {
58 "ROOT palette file", "*.pal.root",
59 "ASCII palette file", "*.pal.txt",
60 nullptr, nullptr
61};
62
63static UShort_t gRedRainbow[12] = {
64 0x0000, 0x7000, 0x0000, 0x0000, 0x0000,
65 0xffff, 0xffff, 0x7000, 0x8000, 0xffff
66};
67static UShort_t gGreenRainbow[12] = {
68 0x0000, 0x0000, 0x0000, 0xffff, 0xffff,
69 0xffff, 0x0000, 0x0000, 0x8000, 0xffff
70};
71static UShort_t gBlueRainbow[12] = {
72 0x0000, 0x7000, 0xffff, 0xffff, 0x0000,
73 0x0000, 0x0000, 0x0000, 0xa000, 0xffff
74};
75
76
78
79////////////////////////////////////////////////////////////////////////////////
80/// Palette editor constructor.
81/// The palette editor allows the editing of the color palette of the image.
82
84 : TPaletteEditor(attImage, w, h), TGMainFrame(nullptr, w, h)
85{
87 fHisto = nullptr;
88 fLimitLine[0] = nullptr;
89 fLimitLine[1] = nullptr;
90 fRampFactor = 0;
92
93 fPaletteList = new TList;
95
96 fPalette = new TImagePalette(attImage->GetPalette());
98
99 // buttons
101
102 button = new TGTextButton(this, "&Apply", 1);
103 button->SetToolTipText("Apply the palette to the image");
104 AddFrame(button, new TGXYLayoutHints(70, 1, 8, 1.8));
105
106 button = new TGTextButton(this, "&Ok", 2);
107 button->SetToolTipText("Same as Apply and Cancel button");
108 AddFrame(button, new TGXYLayoutHints(70, 3, 8, 1.8));
109
110 button = new TGTextButton(this, "&Cancel", 3);
111 button->SetToolTipText("Close this window");
112 AddFrame(button, new TGXYLayoutHints(70, 5, 8, 1.8));
113
114 button = new TGTextButton(this, "&Save", 4);
115 button->SetToolTipText("Save the palette in a ROOT or an ASCII file");
116 AddFrame(button, new TGXYLayoutHints(70, 7.5, 8, 1.8));
117
118 button = new TGTextButton(this, "O&pen", 5);
119 button->SetToolTipText("Read a palette from a ROOT or an ASCII file");
120 AddFrame(button, new TGXYLayoutHints(70, 9.5, 8, 1.8));
121
122 button = new TGTextButton(this, "&New", 6);
123 button->SetToolTipText("Create a new palette (not yet implemented)");
124 button->SetState(kButtonDisabled);
125 AddFrame(button, new TGXYLayoutHints(70, 12, 8, 1.8));
126
127 button = new TGTextButton(this, "&Edit", 7);
128 button->SetToolTipText("Edit a palette (not yet implemented)");
129 button->SetState(kButtonDisabled);
130 AddFrame(button, new TGXYLayoutHints(70, 14, 8, 1.8));
131
132 fAutoUpdate = new TGCheckButton(this, "Auto Update", 13);
133 fAutoUpdate->SetToolTipText("Automatic update of the image (without Apply button)");
134 AddFrame(fAutoUpdate, new TGXYLayoutHints(50, 1, 20, 1.8));
135
136 fUnDoButton = new TGTextButton(this, "&Undo", 20);
137 fUnDoButton->SetToolTipText("Undo the last modification (repeatable)");
138 AddFrame(fUnDoButton, new TGXYLayoutHints(50, 3, 8, 1.8));
139
140 fReDoButton = new TGTextButton(this, "&Redo", 21);
141 fReDoButton->SetToolTipText("Undo the last undo operation (repeatable)");
142 AddFrame(fReDoButton, new TGXYLayoutHints(60, 3, 8, 1.8));
143
144 button = new TGTextButton(this, "&Log", 8);
145 button->SetToolTipText("Apply a log operation to the anchor points of the palette");
146 AddFrame(button, new TGXYLayoutHints(50, 15, 8, 1.8));
147
148 button = new TGTextButton(this, "E&xp", 9);
149 button->SetToolTipText("Apply a exp operation to the anchor points of the palette");
150 AddFrame(button, new TGXYLayoutHints(50, 17, 8, 1.8));
151
152 button = new TGTextButton(this, "L&in", 10);
153 button->SetToolTipText("Make the distance of all anchor points constant");
154 AddFrame(button, new TGXYLayoutHints(50, 19, 8, 1.8));
155
156 button = new TGTextButton(this, "In&vert", 11);
157 button->SetToolTipText("Invert the order of the colors");
158 AddFrame(button, new TGXYLayoutHints(60, 17, 8, 1.8));
159
160 fStepButton = new TGCheckButton(this, "Step", 12);
161 fStepButton->SetToolTipText("Apply a step function to the palette");
162 AddFrame(fStepButton, new TGXYLayoutHints(60, 19, 8, 1.8));
163
164 // ramp: 1, 2 or 4
165 TGGroupFrame *rampFrame = new TGGroupFrame(this, "Ramps");
166 rampFrame->SetLayoutManager(new TGXYLayout(rampFrame));
167 AddFrame(rampFrame, new TGXYLayoutHints(50, 8.5, 14, 6,
170
171 fRamps[0] = new TGRadioButton(rampFrame, "1", 1);
172 fRamps[0]->SetToolTipText("Repeat the palette once");
173 rampFrame->AddFrame(fRamps[0], new TGXYLayoutHints(2, 1.4, 5, 1.8));
174
175 fRamps[1] = new TGRadioButton(rampFrame, "2", 2);
176 fRamps[1]->SetToolTipText("Repeat the palette twice");
177 rampFrame->AddFrame(fRamps[1], new TGXYLayoutHints(2, 3.3, 5, 1.8));
178
179 fRamps[2] = new TGRadioButton(rampFrame, "4", 4);
180 fRamps[2]->SetToolTipText("Repeat the palette four times");
181 rampFrame->AddFrame(fRamps[2], new TGXYLayoutHints(8, 3.3, 5, 1.8));
182
183 fRamps[0]->Associate(this);
184 fRamps[1]->Associate(this);
185 fRamps[2]->Associate(this);
186
187 // the histogram of the data
188 fHistCanvas = new TRootEmbeddedCanvas("data hist", this, 300, 50);
189 AddFrame(fHistCanvas, new TGXYLayoutHints(1, 1, 48, 20,
191
192 const ASImage *image = ((TASImage*)attImage)->GetImage();
193 if (image && image->alt.vector) {
194 Int_t pixel;
195 Double_t *data = image->alt.vector;
196 Int_t numPixel = image->width * image->height;
197 Int_t numBins = numPixel / 20;
198 numBins = (numBins < 10) ? 10 : (numBins > 200) ? 200 : numBins;
199
200 // get min and max value of image
201 fMinValue = fMaxValue = *image->alt.vector;
202 for (pixel = 1; pixel < numPixel; pixel++) {
203 if (fMinValue > *(data + pixel)) fMinValue = *(data + pixel);
204 if (fMaxValue < *(data + pixel)) fMaxValue = *(data + pixel);
205 }
206
207 fHisto = new TH1D("Statistics", "Pixel histogram of unzoomed image ",
208 numBins, fMinValue, fMaxValue);
209 for (pixel = 0; pixel < numPixel; pixel++)
210 fHisto->Fill(*(data + pixel));
211
212 fHisto->Draw("HIST");
217
219 0, fHisto->GetMaximum(), this);
220 fLimitLine[0]->Draw();
222 (fMaxValue - fMinValue), 0, fHisto->GetMaximum(), this);
223 fLimitLine[1]->Draw();
224 }
225
226 // the combobox of different palettes
227 fComboBox = new TGComboBox(this, 100);
228 AddFrame(fComboBox, new TGXYLayoutHints(50, 6, 14, 2));
229
230 fComboBox->AddEntry("Rainbow", 0);
231 fComboBox->AddEntry("Grey", 1);
232 fComboBox->AddEntry("Hot", 2);
233 fComboBox->AddEntry("Cold", 3);
234 fComboBox->AddEntry("Bowlerhat", 4);
235 fComboBox->AddEntry("", 5);
236
237
238 // the palette
239 fPaletteCanvas = new TRootEmbeddedCanvas("palette", this, 300, 50);
240 AddFrame(fPaletteCanvas, new TGXYLayoutHints(1, 22, 78, 2.5,
242
243 fPaintPalette = new PaintPalette(&fPalette, attImage);
245
247 Layout();
248
249 SetWindowName("Palette Editor");
250 SetIconName("Palette Editor");
251
252 MapWindow();
253
255}
256
257////////////////////////////////////////////////////////////////////////////////
258/// Palette editor destructor. Deletes all frames and their layout hints.
259
261{
262 TGFrameElement *ptr;
263
264 // delete all frames and layout hints
265 if (fList) {
266 TIter next(fList);
267 while ((ptr = (TGFrameElement *) next())) {
268 if (ptr->fLayout)
269 delete ptr->fLayout;
270 if (ptr->fFrame)
271 delete ptr->fFrame;
272 }
273 }
274
275 delete fHisto;
276 delete fPaintPalette;
277 delete fLimitLine[0];
278 delete fLimitLine[1];
279 delete fPaletteList;
280}
281
282////////////////////////////////////////////////////////////////////////////////
283/// Close editor.
284
286{
288 delete this;
289}
290
291////////////////////////////////////////////////////////////////////////////////
292/// Process all editor mouse events
293
295{
296 switch (GET_MSG(msg)) {
297
298 case kC_COMMAND:
299 switch (GET_SUBMSG(msg)) {
300
301 case kCM_COMBOBOX:
302 NewPalette(param2);
303 break;
304
305 case kCM_RADIOBUTTON:
306 SetRamp(param1);
307 break;
308
309 case kCM_CHECKBUTTON:
310 if (param1 == 12)
311 SetStep();
312 break;
313
314 case kCM_BUTTON:
315 switch (param1) {
316
317 case 1 : // Apply
320 fImagePad->Update();
321 break;
322
323 case 2 : // OK
326 fImagePad->Update();
327 CloseWindow();
328 break;
329
330 case 3 : // Cancel
331 CloseWindow();
332 break;
333
334 case 4 : // Save
335 Save();
336 break;
337
338 case 5 : // Open
339 Open();
340 break;
341
342 case 8: // log
343 LogPalette();
344 break;
345
346 case 9: // exp
347 ExpPalette();
348 break;
349
350 case 10: // lin
351 LinPalette();
352 break;
353
354 case 11: // invert
356 break;
357
358
359 case 20: // undo
361 if (fAutoUpdate->GetState() == kButtonDown) {
364 fImagePad->Update();
365 }
367 break;
368
369 case 21: // redo
371 if (fAutoUpdate->GetState() == kButtonDown) {
374 fImagePad->Update();
375 }
377 break;
378
379 default: ;
380 }
381 break;
382
383 default: ;
384 }
385 break;
386
387 default: ;
388 }
389
390 return kTRUE;
391}
392
393////////////////////////////////////////////////////////////////////////////////
394/// The newPalette is inserted in the list of palettes (fPaletteList) and
395/// fPalette is set to the newPalette. Protected method,
396
398{
399 // first remove all palettes in the list which are behind the
400 // current palette
401 while (auto obj = fPaletteList->After(fPalette))
402 delete fPaletteList->Remove(obj);
403
404 // add new palette and make it to the current palette
405 fPaletteList->Add(newPalette);
406 fPalette = newPalette;
407
408 // update the image
409 if (fAutoUpdate->GetState() == kButtonDown) {
412 fImagePad->Update();
413 }
414}
415
416////////////////////////////////////////////////////////////////////////////////
417/// Saves the current palette either into a ROOT file or in an ASCII file.
418/// It is called by the Save - button. Protected method.
419
421{
422 TGFileInfo fi;
424 static Bool_t overwr = kFALSE;
425 fi.fOverwrite = overwr;
426
427 new TGFileDialog(gClient->GetRoot(), this, kFDSave, &fi);
428 overwr = fi.fOverwrite;
429 if (!fi.fFilename)
430 return;
431
432 TString fn = fi.fFilename;
433
434 if (fn.EndsWith(".pal.txt")) {
435 // write into an ASCII file
436 FILE *fl = fopen(fn.Data(), "w");
437 if (!fl)
438 return;
439 fprintf(fl, "%u\n", fPalette->fNumPoints);
440 for (Int_t pt = 0; pt < Int_t(fPalette->fNumPoints); pt++)
441 fprintf(fl, "%10.9f %04hx %04hx %04hx %04hx\n", fPalette->fPoints[pt], fPalette->fColorRed[pt],
443 fclose(fl);
444 } else {
445 // write into a ROOT file
446 if (!fn.EndsWith(".pal.root"))
447 fn.Append(".pal.root");
448
449 gROOT->SaveObjectAs(fPalette, fn.Data(), "q");
450 }
451}
452
453////////////////////////////////////////////////////////////////////////////////
454/// Opens either a ROOT file or an ASCII file and reads a palette.
455/// It is called by the Open - button. Protected method.
456
458{
459 TGFileInfo fi;
461
462 new TGFileDialog(gClient->GetRoot(), this, kFDOpen, &fi);
463 if (!fi.fFilename)
464 return;
465
466 TString fn = fi.fFilename;
467
468 TImagePalette *newPalette = nullptr;
469
470 if (fn.EndsWith(".pal.txt")) {
471 FILE *fl = fopen(fn.Data(), "r");
472 if (!fl)
473 return;
474 UInt_t numPoints = 0;
475 if (fscanf(fl, "%u\n", &numPoints) != 1)
476 Error("Open", "Failure reading num points from %s", fn.Data());
477 newPalette = new TImagePalette(numPoints);
478 for (UInt_t pt = 0; pt < numPoints; pt++) {
479 if (fscanf(fl, "%lf %hx %hx %hx %hx\n", newPalette->fPoints + pt, newPalette->fColorRed + pt,
480 newPalette->fColorGreen + pt, newPalette->fColorBlue + pt, newPalette->fColorAlpha + pt) != 5)
481 Error("Open", "Failure reading point %u from %s", pt, fn.Data());
482 }
483 fclose(fl);
484 } else {
485 // read from a ROOT file
486 if (!fn.EndsWith(".pal.root"))
487 fn.Append(".pal.root");
488
489 TDirectory *dirsav = gDirectory;
490
491 auto fsave = TFile::Open(fn.Data(), "READ");
492 if (!fsave || !fsave->IsOpen()) {
493 delete fsave;
494 return;
495 }
496
497 newPalette = (TImagePalette *)fsave->Get("TImagePalette");
498 delete fsave;
499 if (dirsav)
500 dirsav->cd();
501 if (!newPalette)
502 return;
503 }
504
505 InsertNewPalette(newPalette);
507
508 fComboBox->Select(5); // empty entry
509}
510
511////////////////////////////////////////////////////////////////////////////////
512/// All widgets of the screen are updated with the current palette.
513/// Protected method.
514
516{
517 // update the color palette
520
521 if (histoUpdate) {
522 // update the limit lines
524 fLimitLine[0]->SetX1(xPos);
525 fLimitLine[0]->SetX2(xPos);
526
528 fLimitLine[1]->SetX1(xPos);
529 fLimitLine[1]->SetX2(xPos);
530
533 }
534
535 // update undo / redo button
538
539 // test if it is a step palette
541
542 Int_t pt;
543 for (pt = 2; pt < Int_t(fPalette->fNumPoints - 2); pt += 2)
544 if (TMath::Abs(fPalette->fPoints[pt] - fPalette->fPoints[pt + 1]) > 0.0001 ||
548 step = kButtonUp;
549 fStepButton->SetState(step);
550
551 // find the ramp factor
552 fRampFactor = 4;
553 Int_t off = (fPalette->fNumPoints - 2) / 4;
554 for (pt = 0; pt < Int_t(fPalette->fNumPoints - 2) / 4 * 3; pt++)
555 if (fPalette->fColorRed[pt + 1] != fPalette->fColorRed[pt + 1 + off] ||
556 fPalette->fColorGreen[pt + 1] != fPalette->fColorGreen[pt + 1 + off] ||
557 fPalette->fColorBlue[pt + 1] != fPalette->fColorBlue[pt + 1 + off] ||
558 fPalette->fColorAlpha[pt + 1] != fPalette->fColorAlpha[pt + 1 + off]) {
559 fRampFactor = 2;
560 break;
561 }
562
563 off = (fPalette->fNumPoints - 2) / 2;
564 for (pt = 0; pt < Int_t(fPalette->fNumPoints - 2) / 2; pt++)
565 if (fPalette->fColorRed[pt + 1] != fPalette->fColorRed[pt + 1 + off] ||
566 fPalette->fColorGreen[pt + 1] != fPalette->fColorGreen[pt + 1 + off] ||
567 fPalette->fColorBlue[pt + 1] != fPalette->fColorBlue[pt + 1 + off] ||
568 fPalette->fColorAlpha[pt + 1] != fPalette->fColorAlpha[pt + 1 + off]) {
569 fRampFactor = 1;
570 break;
571 }
572
576}
577
578////////////////////////////////////////////////////////////////////////////////
579/// The anchor points are rescaled by a log operation.
580/// It is called by the log - button. Protected method.
581
583{
584 TImagePalette *newPalette = new TImagePalette(*fPalette);
585
587
588 for (Int_t pt = 2; pt < Int_t(fPalette->fNumPoints - 2); pt++)
589 newPalette->fPoints[pt] = fPalette->fPoints[1] +
591 TMath::Log(delta + 1) * delta;
592
593 InsertNewPalette(newPalette);
595}
596
597////////////////////////////////////////////////////////////////////////////////
598/// The anchor points are rescaled by a exp operation.
599/// It is called by the exp - button. Protected method.
600
602{
603 TImagePalette *newPalette = new TImagePalette(*fPalette);
604
606
607 for (Int_t pt = 2; pt < Int_t(fPalette->fNumPoints - 2); pt++)
608 newPalette->fPoints[pt] = fPalette->fPoints[1] +
610 TMath::Log(delta + 1) / delta) - 1;
611
612 InsertNewPalette(newPalette);
614}
615
616////////////////////////////////////////////////////////////////////////////////
617/// The anchor points are rescaled to be linar.
618/// It is called by the lin - button. Protected method.
619
621{
622 TImagePalette *newPalette = new TImagePalette(*fPalette);
623
625 if (fStepButton->GetState() == kButtonUp) {
626 for (Int_t pt = 2; pt < Int_t(fPalette->fNumPoints - 2); pt++)
627 newPalette->fPoints[pt] = fPalette->fPoints[1] +
628 delta * (pt - 1) / (fPalette->fNumPoints - 3);
629 } else {
630 for (Int_t pt = 0; pt < Int_t(fPalette->fNumPoints - 4); pt += 2) {
631 newPalette->fPoints[pt + 3] = fPalette->fPoints[1] + delta * (pt + 2) /
632 (fPalette->fNumPoints - 2) ;
633 newPalette->fPoints[pt + 2] = newPalette->fPoints[pt + 3];
634 }
635 }
636
637 InsertNewPalette(newPalette);
639}
640
641////////////////////////////////////////////////////////////////////////////////
642/// The palette is inverted.
643/// It is called by the invert - button. Protected method.
644
646{
647 TImagePalette *newPalette = new TImagePalette(*fPalette);
648
649 Int_t pt;
650 for (pt = 0; pt < Int_t(fPalette->fNumPoints); pt++) {
651 newPalette->fColorRed[pt] = fPalette->fColorRed[fPalette->fNumPoints - 1 - pt];
652 newPalette->fColorGreen[pt] = fPalette->fColorGreen[fPalette->fNumPoints - 1 - pt];
653 newPalette->fColorBlue[pt] = fPalette->fColorBlue[fPalette->fNumPoints - 1 - pt];
654 newPalette->fColorAlpha[pt] = fPalette->fColorAlpha[fPalette->fNumPoints - 1 - pt];
655 }
656
657 for (pt = 2; pt < Int_t(fPalette->fNumPoints - 2); pt++)
658 newPalette->fPoints[pt] = fPalette->fPoints[1] +
661
662 InsertNewPalette(newPalette);
664}
665
666////////////////////////////////////////////////////////////////////////////////
667/// A new palette is created, depending on the id.
668/// It is called by the combo box. Protected method.
669
671{
672 if (id == 5) // empty entry
673 return;
674
675 TImagePalette *newPalette;
676
678 UInt_t numPt;
679
680 numPt = id == 0 ? 12 : 13;
681 newPalette = new TImagePalette(numPt);
682 Int_t pt;
683 for (pt = 1; pt < Int_t(numPt - 1); pt++) {
684 newPalette->fPoints[pt] = fPalette->fPoints[1] + (pt - 1) * delta / (numPt - 3);
685 newPalette->fColorAlpha[pt] = 0xffff;
686 }
687
688 switch (id) {
689 case 0: // rainbow
690 memcpy(newPalette->fColorRed + 1, gRedRainbow, 12 * sizeof(UShort_t));
691 memcpy(newPalette->fColorGreen + 1, gGreenRainbow, 12 * sizeof(UShort_t));
692 memcpy(newPalette->fColorBlue + 1, gBlueRainbow, 12 * sizeof(UShort_t));
693 break;
694
695 case 1: // gray
696 for (pt = 1; pt < Int_t(numPt - 1); pt++) {
697 newPalette->fColorRed[pt] = 0xffff * (pt - 1) / (numPt - 3);
698 newPalette->fColorGreen[pt] = 0xffff * (pt - 1) / (numPt - 3);
699 newPalette->fColorBlue[pt] = 0xffff * (pt - 1) / (numPt - 3);
700 }
701 break;
702
703 case 2: // hot (red)
704 for (pt = 1; pt < Int_t(numPt - 1) / 2; pt++) {
705 newPalette->fColorRed[pt] = 0xffff * (pt - 1) / ((numPt - 3) / 2);
706 newPalette->fColorGreen[pt] = 0;
707 newPalette->fColorBlue[pt] = 0;
708 }
709
710 for (; pt < Int_t(numPt - 1); pt++) {
711 newPalette->fColorRed[pt] = 0xffff;
712 newPalette->fColorGreen[pt] = 0xffff * (pt - (numPt - 1) / 2) / ((numPt - 3) / 2);
713 newPalette->fColorBlue[pt] = 0xffff * (pt - (numPt - 1) / 2) / ((numPt - 3) / 2);
714 }
715 break;
716
717 case 3: // cold (blue)
718 for (pt = 1; pt < Int_t(numPt - 1) / 2; pt++) {
719 newPalette->fColorRed[pt] = 0;
720 newPalette->fColorGreen[pt] = 0;
721 newPalette->fColorBlue[pt] = 0xffff * (pt - 1) / ((numPt - 3) / 2);
722 }
723
724 for (; pt < Int_t(numPt - 1); pt++) {
725 newPalette->fColorRed[pt] = 0xffff * (pt - (numPt - 1) / 2) / ((numPt - 3) / 2);
726 newPalette->fColorGreen[pt] = 0xffff * (pt - (numPt - 1) / 2) / ((numPt - 3) / 2);
727 newPalette->fColorBlue[pt] = 0xffff;
728 }
729 break;
730
731 case 4: // bolwerhat
732 for (pt = 1; pt < Int_t(numPt + 1) / 2; pt++) {
733 newPalette->fColorRed[pt] = newPalette->fColorRed[numPt - pt - 1]
734 = 0xffff * (pt - 1) / ((numPt - 3) / 2);
735 newPalette->fColorGreen[pt] = newPalette->fColorGreen[numPt - pt - 1]
736 = 0xffff * (pt - 1) / ((numPt - 3) / 2);
737 newPalette->fColorBlue[pt] = newPalette->fColorBlue[numPt - pt - 1]
738 = 0xffff * (pt - 1) / ((numPt - 3) / 2);
739 }
740 break;
741 }
742
743 newPalette->fPoints[0] = 0;
744 newPalette->fColorRed[0] = newPalette->fColorRed[1];
745 newPalette->fColorGreen[0] = newPalette->fColorGreen[1];
746 newPalette->fColorBlue[0] = newPalette->fColorBlue[1];
747 newPalette->fColorAlpha[0] = newPalette->fColorAlpha[1];
748
749 newPalette->fPoints[newPalette->fNumPoints-1] = 1.0;
750 newPalette->fColorRed[newPalette->fNumPoints-1] = newPalette->fColorRed[newPalette->fNumPoints-2];
751 newPalette->fColorGreen[newPalette->fNumPoints-1] = newPalette->fColorGreen[newPalette->fNumPoints-2];
752 newPalette->fColorBlue[newPalette->fNumPoints-1] = newPalette->fColorBlue[newPalette->fNumPoints-2];
753 newPalette->fColorAlpha[newPalette->fNumPoints-1] = newPalette->fColorAlpha[newPalette->fNumPoints-2];
754
755 InsertNewPalette(newPalette);
757}
758
759////////////////////////////////////////////////////////////////////////////////
760/// Create a step palette. This is called by the step - check button.
761/// Protected method.
762
764{
765 TImagePalette *newPalette;
766
767 if (fStepButton->GetState() == kButtonDown) {
768 // change colors in steps
769 newPalette = new TImagePalette(fPalette->fNumPoints * 2 - 2);
771 for (Int_t pt = 1; pt < Int_t(fPalette->fNumPoints - 1); pt++) {
772 newPalette->fPoints[pt * 2 - 1] = fPalette->fPoints[1] + (fPalette->fPoints[pt] - fPalette->fPoints[1]) * fkt;
773 newPalette->fPoints[pt * 2] = fPalette->fPoints[1] + (fPalette->fPoints[pt + 1] - fPalette->fPoints[1]) * fkt;
774 newPalette->fColorRed[pt * 2 - 1] = newPalette->fColorRed[pt * 2] = fPalette->fColorRed[pt];
775 newPalette->fColorGreen[pt * 2 - 1] = newPalette->fColorGreen[pt * 2] = fPalette->fColorGreen[pt];
776 newPalette->fColorBlue[pt * 2 - 1] = newPalette->fColorBlue[pt * 2] = fPalette->fColorBlue[pt];
777 newPalette->fColorAlpha[pt * 2 - 1] = newPalette->fColorAlpha[pt * 2] = fPalette->fColorAlpha[pt];
778 }
779 } else {
780 // continuous change of colors
781 newPalette = new TImagePalette(fPalette->fNumPoints / 2 + 1);
784 for (Int_t pt = 1; pt < Int_t(newPalette->fNumPoints - 1); pt++) {
785 newPalette->fPoints[pt] = fPalette->fPoints[pt * 2 -1] * fkt;
786 newPalette->fColorRed[pt] = fPalette->fColorRed[pt * 2 - 1];
787 newPalette->fColorGreen[pt] = fPalette->fColorGreen[pt * 2 - 1];
788 newPalette->fColorBlue[pt] = fPalette->fColorBlue[pt * 2 - 1];
789 newPalette->fColorAlpha[pt] = fPalette->fColorAlpha[pt * 2 - 1];
790 }
791 }
792
793 newPalette->fPoints[0] = fPalette->fPoints[0];
794 newPalette->fColorRed[0] = fPalette->fColorRed[0];
795 newPalette->fColorGreen[0] = fPalette->fColorGreen[0];
796 newPalette->fColorBlue[0] = fPalette->fColorBlue[0];
797 newPalette->fColorAlpha[0] = fPalette->fColorAlpha[0];
798
799 newPalette->fPoints[newPalette->fNumPoints-2] = fPalette->fPoints[fPalette->fNumPoints-2];
800 newPalette->fPoints[newPalette->fNumPoints-1] = fPalette->fPoints[fPalette->fNumPoints-1];
801 newPalette->fColorRed[newPalette->fNumPoints-1] = fPalette->fColorRed[fPalette->fNumPoints-1];
802 newPalette->fColorGreen[newPalette->fNumPoints-1] = fPalette->fColorGreen[fPalette->fNumPoints-1];
803 newPalette->fColorBlue[newPalette->fNumPoints-1] = fPalette->fColorBlue[fPalette->fNumPoints-1];
804 newPalette->fColorAlpha[newPalette->fNumPoints-1] = fPalette->fColorAlpha[fPalette->fNumPoints-1];
805
806 InsertNewPalette(newPalette);
808}
809
810////////////////////////////////////////////////////////////////////////////////
811/// The palette is repeated up to 4 times.
812/// This is called by one of the ramp radio buttons. Protected method.
813
815{
816 if (ramp == fRampFactor)
817 return;
818
819 Int_t ptPerRamp = (fPalette->fNumPoints - 2) / fRampFactor;
820 TImagePalette *newPalette = new TImagePalette(ptPerRamp * ramp + 2);
821
823 for (Int_t rp = 0; rp < ramp; rp++) {
824 for (Int_t pt = 0; pt < ptPerRamp; pt++) {
825 newPalette->fPoints[1 + pt + rp * ptPerRamp] = fPalette->fPoints[1] +
826 delta / ramp * rp +
827 (fPalette->fPoints[1+pt] - fPalette->fPoints[1]) * fRampFactor / ramp;
828 newPalette->fColorRed [1 + pt + rp * ptPerRamp] = fPalette->fColorRed [1 + pt];
829 newPalette->fColorGreen[1 + pt + rp * ptPerRamp] = fPalette->fColorGreen[1 + pt];
830 newPalette->fColorBlue [1 + pt + rp * ptPerRamp] = fPalette->fColorBlue [1 + pt];
831 newPalette->fColorAlpha[1 + pt + rp * ptPerRamp] = fPalette->fColorAlpha[1 + pt];
832 }
833 }
834
835 newPalette->fPoints[0] = fPalette->fPoints[0];
836 newPalette->fColorRed[0] = fPalette->fColorRed[0];
837 newPalette->fColorGreen[0] = fPalette->fColorGreen[0];
838 newPalette->fColorBlue[0] = fPalette->fColorBlue[0];
839 newPalette->fColorAlpha[0] = fPalette->fColorAlpha[0];
840
841 newPalette->fPoints[newPalette->fNumPoints-2] = fPalette->fPoints[fPalette->fNumPoints-2];
842 newPalette->fPoints[newPalette->fNumPoints-1] = fPalette->fPoints[fPalette->fNumPoints-1];
843 newPalette->fColorRed[newPalette->fNumPoints-1] = fPalette->fColorRed[fPalette->fNumPoints-1];
844 newPalette->fColorGreen[newPalette->fNumPoints-1] = fPalette->fColorGreen[fPalette->fNumPoints-1];
845 newPalette->fColorBlue[newPalette->fNumPoints-1] = fPalette->fColorBlue[fPalette->fNumPoints-1];
846 newPalette->fColorAlpha[newPalette->fNumPoints-1] = fPalette->fColorAlpha[fPalette->fNumPoints-1];
847
848 InsertNewPalette(newPalette);
850}
851
852////////////////////////////////////////////////////////////////////////////////
853/// Updates the range of the palette.
854/// This is called after the blue limit lines were moved to define
855/// a new range.
856
858{
859 if (fMaxValue == fMinValue)
860 return;
861
862 TImagePalette *newPalette = new TImagePalette(*fPalette);
863
864 Double_t l0 = fLimitLine[0]->GetX1();
865 Double_t l1 = fLimitLine[1]->GetX1();
866 l0 = (l0 < fMinValue) ? fMinValue : ((l0 > fMaxValue) ? fMaxValue : l0);
867 l1 = (l1 < fMinValue) ? fMinValue : ((l1 > fMaxValue) ? fMaxValue : l1);
868 if (l0 > l1) {
869 Double_t tmp = l0;
870 l0 = l1;
871 l1 = tmp;
872 }
873
875 Double_t newDelta = (l1 - l0) / (fMaxValue - fMinValue);
876 Double_t newOff = (l0 - fMinValue) / (fMaxValue - fMinValue);
877
878 if (newDelta < 0.001 || oldDelta < 0.001)
879 return;
880
881 for (Int_t pt = 1; pt < Int_t(fPalette->fNumPoints - 1); pt++)
882 newPalette->fPoints[pt] = newOff +
883 (fPalette->fPoints[pt] - fPalette->fPoints[1]) * newDelta / oldDelta;
884
885 InsertNewPalette(newPalette);
887}
888
889////////////////////////////////////////////////////////////////////////////////
890/// Actually paint the paletter.
891
893{
894 // get geometry of pad
895 Int_t to_w = TMath::Abs(gPad->XtoPixel(gPad->GetX2()) -
896 gPad->XtoPixel(gPad->GetX1()));
897 Int_t to_h = TMath::Abs(gPad->YtoPixel(gPad->GetY2()) -
898 gPad->YtoPixel(gPad->GetY1()));
899
900 ASGradient grad;
901
902 grad.npoints = (*fPalette)->fNumPoints - 2;
903 grad.type = GRADIENT_Left2Right;
904 grad.color = new ARGB32[grad.npoints];
905 grad.offset = new double[grad.npoints];
906 for (Int_t pt = 0; pt < grad.npoints; pt++) {
907 grad.offset[pt] = ((*fPalette)->fPoints[pt + 1] - (*fPalette)->fPoints[1]) /
908 ((*fPalette)->fPoints[(*fPalette)->fNumPoints - 2] - (*fPalette)->fPoints[1]);
909 grad.color[pt] = (((ARGB32)((*fPalette)->fColorBlue[pt + 1] & 0xff00)) >> 8) |
910 (((ARGB32)((*fPalette)->fColorGreen[pt + 1] & 0xff00)) ) |
911 (((ARGB32)((*fPalette)->fColorRed[pt + 1] & 0xff00)) << 8) |
912 (((ARGB32)((*fPalette)->fColorAlpha[pt + 1] & 0xff00)) << 16);
913 }
914
915 ASImage * grad_im = make_gradient((ASVisual*)TASImage::GetVisual(), &grad , to_w, to_h,
916 SCL_DO_COLOR, ASA_ARGB32, 0,
918 delete [] grad.color;
919 delete [] grad.offset;
920
921 Window_t wid = (Window_t)gVirtualX->GetWindowID(gPad->GetPixmapID());
922 TASImage::Image2Drawable(grad_im, wid, 0, 0);
923 destroy_asimage(&grad_im);
924}
925
926////////////////////////////////////////////////////////////////////////////////
927/// The blue limit line in the pixel value histogram.
928
930 TASPaletteEditor *gui)
931 : TLine(x, y1, x, y2)
932{
933 fGui = gui;
934 SetLineColor(4);
935 SetLineWidth(2);
936}
937
938////////////////////////////////////////////////////////////////////////////////
939/// Paint the limit lines.
940
942{
943 fY1 = gPad->GetUymin();
944 fY2 = gPad->GetUymax();
945
947}
948
949////////////////////////////////////////////////////////////////////////////////
950
952 Int_t px, Int_t /*py*/)
953{
954 static Int_t oldX;
955
956 if (!gPad) return;
957
958 switch(event) {
959 case kMouseMotion:
960 gPad->SetCursor(kMove);
961 break;
962
963 case kButton1Down:
964 gVirtualX->SetLineColor(-1);
965 TAttLine::Modify(); //Change line attributes only if necessary
966 oldX = gPad->XtoAbsPixel(fX1);
967 break;
968
969 case kButton1Motion:
970 gVirtualX->DrawLine(oldX, gPad->YtoPixel(fY1), oldX, gPad->YtoPixel(fY2));
971 oldX = px;
972 gVirtualX->DrawLine(oldX, gPad->YtoPixel(fY1), oldX, gPad->YtoPixel(fY2));
973 gVirtualX->Update();
974 break;
975
976 case kButton1Up:
977 gVirtualX->SetLineColor(-1);
978 TAttLine::Modify(); //Change line attributes only if necessary
979 fX1 = fX2 = gPad->AbsPixeltoX(oldX);
980 fGui->UpdateRange();
981 gPad->Modified(kTRUE);
982 gPad->Update();
983 break;
984
985 default:
986 break;
987 }
988}
@ kMouseMotion
Definition Buttons.h:23
@ kButton1Motion
Definition Buttons.h:20
@ kButton1Up
Definition Buttons.h:19
@ kButton1Down
Definition Buttons.h:17
@ kMove
Definition GuiTypes.h:374
Handle_t Window_t
Window handle.
Definition GuiTypes.h:29
#define h(i)
Definition RSha256.hxx:106
unsigned short UShort_t
Definition RtypesCore.h:40
int Int_t
Definition RtypesCore.h:45
long Longptr_t
Definition RtypesCore.h:75
long Long_t
Definition RtypesCore.h:54
constexpr Bool_t kFALSE
Definition RtypesCore.h:94
double Double_t
Definition RtypesCore.h:59
constexpr Bool_t kTRUE
Definition RtypesCore.h:93
const char Option_t
Definition RtypesCore.h:66
#define ClassImp(name)
Definition Rtypes.h:382
static UShort_t gRedRainbow[12]
static UShort_t gBlueRainbow[12]
static UShort_t gGreenRainbow[12]
static const char * gFileTypes[]
#define gDirectory
Definition TDirectory.h:384
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Definition TError.cxx:185
EButtonState
Definition TGButton.h:52
@ kButtonDown
Definition TGButton.h:54
@ kButtonDisabled
Definition TGButton.h:56
@ kButtonUp
Definition TGButton.h:53
#define gClient
Definition TGClient.h:157
@ kFDOpen
@ kFDSave
Option_t Option_t option
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Option_t Option_t SetLineWidth
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void pixel
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize wid
Option_t Option_t SetLineColor
Option_t Option_t TPoint TPoint const char y2
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t button
Option_t Option_t TPoint TPoint const char y1
#define gROOT
Definition TROOT.h:406
#define gPad
#define gVirtualX
Definition TVirtualX.h:337
Int_t GET_MSG(Long_t val)
@ kCM_COMBOBOX
@ kC_COMMAND
@ kCM_BUTTON
@ kCM_RADIOBUTTON
@ kCM_CHECKBUTTON
Int_t GET_SUBMSG(Long_t val)
Image class.
Definition TASImage.h:31
static const ASVisual * GetVisual()
Return visual.
static void Image2Drawable(ASImage *im, Drawable_t wid, Int_t x, Int_t y, Int_t xsrc=0, Int_t ysrc=0, UInt_t wsrc=0, UInt_t hsrc=0, Option_t *opt="")
Draw asimage on drawable.
void Paint(Option_t *option="") override
Paint the limit lines.
LimitLine(Coord_t x, Coord_t y1, Coord_t y2, TASPaletteEditor *gui)
The blue limit line in the pixel value histogram.
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Execute action corresponding to an event at (px,py).
void Paint(Option_t *option="") override
Actually paint the paletter.
This is a GUI window to edit a color palette.
void UpdateScreen(Bool_t histoUpdate)
All widgets of the screen are updated with the current palette.
PaintPalette * fPaintPalette
void UpdateRange()
Updates the range of the palette.
TGTextButton * fUnDoButton
TVirtualPad * fImagePad
TImagePalette * fPalette
current palette
TGCheckButton * fStepButton
TGTextButton * fReDoButton
Double_t fMinValue
min value of image
void Open()
Opens either a ROOT file or an ASCII file and reads a palette.
TList * fPaletteList
list of palettes for undo and redo
void ExpPalette()
The anchor points are rescaled by a exp operation.
void InsertNewPalette(TImagePalette *newPalette)
The newPalette is inserted in the list of palettes (fPaletteList) and fPalette is set to the newPalet...
void CloseWindow() override
Close editor.
TGRadioButton * fRamps[3]
TASPaletteEditor(TAttImage *attImage, UInt_t w, UInt_t h)
Palette editor constructor.
Bool_t ProcessMessage(Longptr_t msg, Longptr_t param1, Longptr_t param2) override
Process all editor mouse events.
TRootEmbeddedCanvas * fHistCanvas
canvas to draw the histogram
TGComboBox * fComboBox
TH1D * fHisto
histogram of image pixels
~TASPaletteEditor() override
Palette editor destructor. Deletes all frames and their layout hints.
void Save()
Saves the current palette either into a ROOT file or in an ASCII file.
TGCheckButton * fAutoUpdate
void NewPalette(Long_t id)
A new palette is created, depending on the id.
void LinPalette()
The anchor points are rescaled to be linar.
LimitLine * fLimitLine[2]
void SetRamp(Long_t ramp)
The palette is repeated up to 4 times.
void InvertPalette()
The palette is inverted.
void SetStep()
Create a step palette.
Double_t fMaxValue
max value of image
void LogPalette()
The anchor points are rescaled by a log operation.
TRootEmbeddedCanvas * fPaletteCanvas
canvas to draw the current palette
virtual void SetLabelSize(Float_t size=0.04)
Set size of axis labels.
Definition TAttAxis.cxx:203
virtual void SetLabelFont(Style_t font=62)
Set labels' font.
Definition TAttAxis.cxx:180
TImage attributes.
Definition TAttImage.h:59
virtual void SetPalette(const TImagePalette *palette)
Set a new palette for the image.
EImageQuality GetImageQuality() const
Definition TAttImage.h:87
virtual const TImagePalette & GetPalette() const
Definition TAttImage.h:88
virtual void Modify()
Change current line attributes if necessary.
Definition TAttLine.cxx:247
void Update() override
Update canvas pad buffers.
Definition TCanvas.cxx:2489
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
Describe directory structure in memory.
Definition TDirectory.h:45
virtual Bool_t cd()
Change current directory to "this" directory.
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
Definition TFile.cxx:4086
virtual void SetToolTipText(const char *text, Long_t delayms=400)
Set tool tip text associated with this button.
Definition TGButton.cxx:445
virtual EButtonState GetState() const
Definition TGButton.h:112
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set button state.
Definition TGButton.cxx:235
Selects different options.
Definition TGButton.h:264
void SetState(EButtonState state, Bool_t emit=kFALSE) override
Set check button state.
A combobox (also known as a drop down listbox) allows the selection of one item out of a list of item...
Definition TGComboBox.h:47
virtual void AddEntry(TGString *s, Int_t id)
Definition TGComboBox.h:86
virtual void Select(Int_t id, Bool_t emit=kTRUE)
Make the selected item visible in the combo box window and emit signals according to the second param...
virtual void SetLayoutManager(TGLayoutManager *l)
Set the layout manager for the composite frame.
Definition TGFrame.cxx:1000
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1117
void MapSubwindows() override
Map all sub windows that are part of the composite frame.
Definition TGFrame.cxx:1164
void Layout() override
Layout the elements of the composite frame.
Definition TGFrame.cxx:1257
TList * fList
container of frame elements
Definition TGFrame.h:292
This class creates a file selection dialog.
char * fFilename
selected file name
const char ** fFileTypes
file types used to filter selectable files
Bool_t fOverwrite
if true overwrite the file with existing name on save
TGLayoutHints * fLayout
Definition TGLayout.h:114
TGFrame * fFrame
Definition TGLayout.h:112
void MapWindow() override
map window
Definition TGFrame.h:204
A composite frame with a border and a title.
Definition TGFrame.h:522
Defines top level windows that interact with the system Window Manager.
Definition TGFrame.h:397
void SetIconName(const char *name)
Set window icon name. This is typically done via the window manager.
Definition TGFrame.cxx:1801
void SetWindowName(const char *name=nullptr) override
Set window name. This is typically done via the window manager.
Definition TGFrame.cxx:1788
Selects different options.
Definition TGButton.h:321
void SetState(EButtonState state, Bool_t emit=kFALSE) override
Set radio button state.
Yield an action as soon as it is clicked.
Definition TGButton.h:142
virtual void Associate(const TGWindow *w)
Definition TGWidget.h:72
This layout hint must be used for the TGXYLayout manager!
Definition TGXYLayout.h:19
Is a layout manager where the position and the size of each widget in the frame are defined by X / Y ...
Definition TGXYLayout.h:58
1-D histogram with a double per channel (see TH1 documentation)
Definition TH1.h:671
TAxis * GetXaxis()
Definition TH1.h:325
virtual Double_t GetMaximum(Double_t maxval=FLT_MAX) const
Return maximum value smaller than maxval of bins in the range, unless the value has been overridden b...
Definition TH1.cxx:8578
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
Definition TH1.cxx:3346
TAxis * GetYaxis()
Definition TH1.h:326
void Draw(Option_t *option="") override
Draw this histogram with options.
Definition TH1.cxx:3068
A class to define a conversion from pixel values to pixel color.
Definition TAttImage.h:33
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
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
UShort_t * fColorAlpha
[fNumPoints] alpha at each anchor point
Definition TAttImage.h:41
Use the TLine constructor to create a simple line.
Definition TLine.h:22
virtual void SetX2(Double_t x2)
Definition TLine.h:66
void Paint(Option_t *option="") override
Paint this line with its current attributes.
Definition TLine.cxx:389
virtual void SetX1(Double_t x1)
Definition TLine.h:65
Double_t GetX1() const
Definition TLine.h:50
A doubly linked list.
Definition TList.h:38
TObject * After(const TObject *obj) const override
Returns the object after object obj.
Definition TList.cxx:328
TObject * Before(const TObject *obj) const override
Returns the object before object obj.
Definition TList.cxx:369
void Add(TObject *obj) override
Definition TList.h:81
TObject * Remove(TObject *obj) override
Remove object from the list.
Definition TList.cxx:820
TObject * Last() const override
Return the last object in the list. Returns 0 when list is empty.
Definition TList.cxx:691
TObject * First() const override
Return the first object in the list. Returns 0 when list is empty.
Definition TList.cxx:657
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
Definition TObject.cxx:292
void Modified(Bool_t flag=true) override
Mark pad modified Will be repainted when TCanvas::Update() will be called next time.
Definition TPad.cxx:7388
Edit the palette via a GUI.
Definition TAttImage.h:19
virtual void CloseWindow()
Closes the window and deletes itself.
TAttImage * fAttImage
Definition TAttImage.h:22
This class creates a TGCanvas in which a TCanvas is created.
TCanvas * GetCanvas() const
Basic string class.
Definition TString.h:139
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
Definition TString.cxx:2244
const char * Data() const
Definition TString.h:376
TString & Append(const char *cs)
Definition TString.h:572
virtual void Modified(Bool_t flag=1)=0
virtual void Update()=0
TPaveText * pt
Double_t x[n]
Definition legend1.C:17
Double_t Exp(Double_t x)
Returns the base-e exponential function of x, which is e raised to the power x.
Definition TMath.h:713
Double_t Log(Double_t x)
Returns the natural logarithm of x.
Definition TMath.h:760
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
Definition TMathBase.h:123