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 if (strcmp(".pal.txt", fi.fFilename + strlen(fi.fFilename) - 8) == 0) {
433 // write into an ASCII file
434 FILE *fl = fopen(fi.fFilename, "w");
435 if (!fl) return;
436 fprintf(fl, "%u\n", fPalette->fNumPoints);
437 for (Int_t pt = 0; pt < Int_t(fPalette->fNumPoints); pt++)
438 fprintf(fl, "%10.9f %04hx %04hx %04hx %04hx\n",
444 fclose(fl);
445 } else {
446 // write into a ROOT file
447 char fn[512];
448 if (strcmp(".pal.root", fi.fFilename + strlen(fi.fFilename) - 9) != 0)
449 snprintf(fn,512, "%s%s", fi.fFilename, ".pal.root");
450 else
451 strlcpy(fn, fi.fFilename,512);
452
453 gROOT->ProcessLine(TString::Format("gROOT->SaveObjectAs((TASPaletteEditor*)0x%zx,\"%s\",\"%s\");",(size_t)this,fn,"q"));
454 }
455}
456
457////////////////////////////////////////////////////////////////////////////////
458/// Opens either a ROOT file or an ASCII file and reads a palette.
459/// It is called by the Open - button. Protected method.
460
462{
463 TGFileInfo fi;
465
466 new TGFileDialog(gClient->GetRoot(), this, kFDOpen, &fi);
467 if (!fi.fFilename)
468 return;
469
470 TImagePalette *newPalette;
471
472 if (strcmp(".pal.txt", fi.fFilename + strlen(fi.fFilename) - 8) == 0) {
473 FILE *fl = fopen(fi.fFilename, "r");
474 if (!fl) return;
475 UInt_t numPoints;
476 // coverity [Calling risky function : FALSE]
477 if (fscanf(fl, "%u\n", &numPoints)) {;}
478 newPalette = new TImagePalette(numPoints);
479 for (Int_t pt = 0; pt < Int_t(numPoints); pt++)
480 // coverity [Calling risky function : FALSE]
481 if (fscanf(fl, "%lf %hx %hx %hx %hx\n",
482 newPalette->fPoints + pt,
483 newPalette->fColorRed + pt,
484 newPalette->fColorGreen + pt,
485 newPalette->fColorBlue + pt,
486 newPalette->fColorAlpha + pt )) {;}
487 fclose(fl);
488 } else {
489 // read from a ROOT file
490 char fn[512];
491 if (strcmp(".pal.root", fi.fFilename + strlen(fi.fFilename) - 9) != 0)
492 snprintf(fn,512, "%s%s", fi.fFilename, ".pal.root");
493 else
494 strlcpy(fn, fi.fFilename,512);
495 TDirectory *dirsav = gDirectory;
496
497 TFile *fsave = new TFile(fn, "READ");
498 if (!fsave->IsOpen()) {
499 delete fsave;
500 return;
501 }
502
503 newPalette = (TImagePalette*)fsave->Get("TImagePalette");
504 delete fsave;
505 if (dirsav) dirsav->cd();
506 if (!newPalette)
507 return;
508 }
509
510 InsertNewPalette(newPalette);
512
513 fComboBox->Select(5); // empty entry
514}
515
516////////////////////////////////////////////////////////////////////////////////
517/// All widgets of the screen are updated with the current palette.
518/// Protected method.
519
521{
522 // update the color palette
525
526 if (histoUpdate) {
527 // update the limit lines
529 fLimitLine[0]->SetX1(xPos);
530 fLimitLine[0]->SetX2(xPos);
531
533 fLimitLine[1]->SetX1(xPos);
534 fLimitLine[1]->SetX2(xPos);
535
538 }
539
540 // update undo / redo button
543
544 // test if it is a step palette
546
547 Int_t pt;
548 for (pt = 2; pt < Int_t(fPalette->fNumPoints - 2); pt += 2)
549 if (TMath::Abs(fPalette->fPoints[pt] - fPalette->fPoints[pt + 1]) > 0.0001 ||
553 step = kButtonUp;
554 fStepButton->SetState(step);
555
556 // find the ramp factor
557 fRampFactor = 4;
558 Int_t off = (fPalette->fNumPoints - 2) / 4;
559 for (pt = 0; pt < Int_t(fPalette->fNumPoints - 2) / 4 * 3; pt++)
560 if (fPalette->fColorRed[pt + 1] != fPalette->fColorRed[pt + 1 + off] ||
561 fPalette->fColorGreen[pt + 1] != fPalette->fColorGreen[pt + 1 + off] ||
562 fPalette->fColorBlue[pt + 1] != fPalette->fColorBlue[pt + 1 + off] ||
563 fPalette->fColorAlpha[pt + 1] != fPalette->fColorAlpha[pt + 1 + off]) {
564 fRampFactor = 2;
565 break;
566 }
567
568 off = (fPalette->fNumPoints - 2) / 2;
569 for (pt = 0; pt < Int_t(fPalette->fNumPoints - 2) / 2; pt++)
570 if (fPalette->fColorRed[pt + 1] != fPalette->fColorRed[pt + 1 + off] ||
571 fPalette->fColorGreen[pt + 1] != fPalette->fColorGreen[pt + 1 + off] ||
572 fPalette->fColorBlue[pt + 1] != fPalette->fColorBlue[pt + 1 + off] ||
573 fPalette->fColorAlpha[pt + 1] != fPalette->fColorAlpha[pt + 1 + off]) {
574 fRampFactor = 1;
575 break;
576 }
577
581}
582
583////////////////////////////////////////////////////////////////////////////////
584/// The anchor points are rescaled by a log operation.
585/// It is called by the log - button. Protected method.
586
588{
589 TImagePalette *newPalette = new TImagePalette(*fPalette);
590
592
593 for (Int_t pt = 2; pt < Int_t(fPalette->fNumPoints - 2); pt++)
594 newPalette->fPoints[pt] = fPalette->fPoints[1] +
596 TMath::Log(delta + 1) * delta;
597
598 InsertNewPalette(newPalette);
600}
601
602////////////////////////////////////////////////////////////////////////////////
603/// The anchor points are rescaled by a exp operation.
604/// It is called by the exp - button. Protected method.
605
607{
608 TImagePalette *newPalette = new TImagePalette(*fPalette);
609
611
612 for (Int_t pt = 2; pt < Int_t(fPalette->fNumPoints - 2); pt++)
613 newPalette->fPoints[pt] = fPalette->fPoints[1] +
615 TMath::Log(delta + 1) / delta) - 1;
616
617 InsertNewPalette(newPalette);
619}
620
621////////////////////////////////////////////////////////////////////////////////
622/// The anchor points are rescaled to be linar.
623/// It is called by the lin - button. Protected method.
624
626{
627 TImagePalette *newPalette = new TImagePalette(*fPalette);
628
630 if (fStepButton->GetState() == kButtonUp) {
631 for (Int_t pt = 2; pt < Int_t(fPalette->fNumPoints - 2); pt++)
632 newPalette->fPoints[pt] = fPalette->fPoints[1] +
633 delta * (pt - 1) / (fPalette->fNumPoints - 3);
634 } else {
635 for (Int_t pt = 0; pt < Int_t(fPalette->fNumPoints - 4); pt += 2) {
636 newPalette->fPoints[pt + 3] = fPalette->fPoints[1] + delta * (pt + 2) /
637 (fPalette->fNumPoints - 2) ;
638 newPalette->fPoints[pt + 2] = newPalette->fPoints[pt + 3];
639 }
640 }
641
642 InsertNewPalette(newPalette);
644}
645
646////////////////////////////////////////////////////////////////////////////////
647/// The palette is inverted.
648/// It is called by the invert - button. Protected method.
649
651{
652 TImagePalette *newPalette = new TImagePalette(*fPalette);
653
654 Int_t pt;
655 for (pt = 0; pt < Int_t(fPalette->fNumPoints); pt++) {
656 newPalette->fColorRed[pt] = fPalette->fColorRed[fPalette->fNumPoints - 1 - pt];
657 newPalette->fColorGreen[pt] = fPalette->fColorGreen[fPalette->fNumPoints - 1 - pt];
658 newPalette->fColorBlue[pt] = fPalette->fColorBlue[fPalette->fNumPoints - 1 - pt];
659 newPalette->fColorAlpha[pt] = fPalette->fColorAlpha[fPalette->fNumPoints - 1 - pt];
660 }
661
662 for (pt = 2; pt < Int_t(fPalette->fNumPoints - 2); pt++)
663 newPalette->fPoints[pt] = fPalette->fPoints[1] +
666
667 InsertNewPalette(newPalette);
669}
670
671////////////////////////////////////////////////////////////////////////////////
672/// A new palette is created, depending on the id.
673/// It is called by the combo box. Protected method.
674
676{
677 if (id == 5) // empty entry
678 return;
679
680 TImagePalette *newPalette;
681
683 UInt_t numPt;
684
685 numPt = id == 0 ? 12 : 13;
686 newPalette = new TImagePalette(numPt);
687 Int_t pt;
688 for (pt = 1; pt < Int_t(numPt - 1); pt++) {
689 newPalette->fPoints[pt] = fPalette->fPoints[1] + (pt - 1) * delta / (numPt - 3);
690 newPalette->fColorAlpha[pt] = 0xffff;
691 }
692
693 switch (id) {
694 case 0: // rainbow
695 memcpy(newPalette->fColorRed + 1, gRedRainbow, 12 * sizeof(UShort_t));
696 memcpy(newPalette->fColorGreen + 1, gGreenRainbow, 12 * sizeof(UShort_t));
697 memcpy(newPalette->fColorBlue + 1, gBlueRainbow, 12 * sizeof(UShort_t));
698 break;
699
700 case 1: // gray
701 for (pt = 1; pt < Int_t(numPt - 1); pt++) {
702 newPalette->fColorRed[pt] = 0xffff * (pt - 1) / (numPt - 3);
703 newPalette->fColorGreen[pt] = 0xffff * (pt - 1) / (numPt - 3);
704 newPalette->fColorBlue[pt] = 0xffff * (pt - 1) / (numPt - 3);
705 }
706 break;
707
708 case 2: // hot (red)
709 for (pt = 1; pt < Int_t(numPt - 1) / 2; pt++) {
710 newPalette->fColorRed[pt] = 0xffff * (pt - 1) / ((numPt - 3) / 2);
711 newPalette->fColorGreen[pt] = 0;
712 newPalette->fColorBlue[pt] = 0;
713 }
714
715 for (; pt < Int_t(numPt - 1); pt++) {
716 newPalette->fColorRed[pt] = 0xffff;
717 newPalette->fColorGreen[pt] = 0xffff * (pt - (numPt - 1) / 2) / ((numPt - 3) / 2);
718 newPalette->fColorBlue[pt] = 0xffff * (pt - (numPt - 1) / 2) / ((numPt - 3) / 2);
719 }
720 break;
721
722 case 3: // cold (blue)
723 for (pt = 1; pt < Int_t(numPt - 1) / 2; pt++) {
724 newPalette->fColorRed[pt] = 0;
725 newPalette->fColorGreen[pt] = 0;
726 newPalette->fColorBlue[pt] = 0xffff * (pt - 1) / ((numPt - 3) / 2);
727 }
728
729 for (; pt < Int_t(numPt - 1); pt++) {
730 newPalette->fColorRed[pt] = 0xffff * (pt - (numPt - 1) / 2) / ((numPt - 3) / 2);
731 newPalette->fColorGreen[pt] = 0xffff * (pt - (numPt - 1) / 2) / ((numPt - 3) / 2);
732 newPalette->fColorBlue[pt] = 0xffff;
733 }
734 break;
735
736 case 4: // bolwerhat
737 for (pt = 1; pt < Int_t(numPt + 1) / 2; pt++) {
738 newPalette->fColorRed[pt] = newPalette->fColorRed[numPt - pt - 1]
739 = 0xffff * (pt - 1) / ((numPt - 3) / 2);
740 newPalette->fColorGreen[pt] = newPalette->fColorGreen[numPt - pt - 1]
741 = 0xffff * (pt - 1) / ((numPt - 3) / 2);
742 newPalette->fColorBlue[pt] = newPalette->fColorBlue[numPt - pt - 1]
743 = 0xffff * (pt - 1) / ((numPt - 3) / 2);
744 }
745 break;
746 }
747
748 newPalette->fPoints[0] = 0;
749 newPalette->fColorRed[0] = newPalette->fColorRed[1];
750 newPalette->fColorGreen[0] = newPalette->fColorGreen[1];
751 newPalette->fColorBlue[0] = newPalette->fColorBlue[1];
752 newPalette->fColorAlpha[0] = newPalette->fColorAlpha[1];
753
754 newPalette->fPoints[newPalette->fNumPoints-1] = 1.0;
755 newPalette->fColorRed[newPalette->fNumPoints-1] = newPalette->fColorRed[newPalette->fNumPoints-2];
756 newPalette->fColorGreen[newPalette->fNumPoints-1] = newPalette->fColorGreen[newPalette->fNumPoints-2];
757 newPalette->fColorBlue[newPalette->fNumPoints-1] = newPalette->fColorBlue[newPalette->fNumPoints-2];
758 newPalette->fColorAlpha[newPalette->fNumPoints-1] = newPalette->fColorAlpha[newPalette->fNumPoints-2];
759
760 InsertNewPalette(newPalette);
762}
763
764////////////////////////////////////////////////////////////////////////////////
765/// Create a step palette. This is called by the step - check button.
766/// Protected method.
767
769{
770 TImagePalette *newPalette;
771
772 if (fStepButton->GetState() == kButtonDown) {
773 // change colors in steps
774 newPalette = new TImagePalette(fPalette->fNumPoints * 2 - 2);
776 for (Int_t pt = 1; pt < Int_t(fPalette->fNumPoints - 1); pt++) {
777 newPalette->fPoints[pt * 2 - 1] = fPalette->fPoints[1] + (fPalette->fPoints[pt] - fPalette->fPoints[1]) * fkt;
778 newPalette->fPoints[pt * 2] = fPalette->fPoints[1] + (fPalette->fPoints[pt + 1] - fPalette->fPoints[1]) * fkt;
779 newPalette->fColorRed[pt * 2 - 1] = newPalette->fColorRed[pt * 2] = fPalette->fColorRed[pt];
780 newPalette->fColorGreen[pt * 2 - 1] = newPalette->fColorGreen[pt * 2] = fPalette->fColorGreen[pt];
781 newPalette->fColorBlue[pt * 2 - 1] = newPalette->fColorBlue[pt * 2] = fPalette->fColorBlue[pt];
782 newPalette->fColorAlpha[pt * 2 - 1] = newPalette->fColorAlpha[pt * 2] = fPalette->fColorAlpha[pt];
783 }
784 } else {
785 // continuous change of colors
786 newPalette = new TImagePalette(fPalette->fNumPoints / 2 + 1);
789 for (Int_t pt = 1; pt < Int_t(newPalette->fNumPoints - 1); pt++) {
790 newPalette->fPoints[pt] = fPalette->fPoints[pt * 2 -1] * fkt;
791 newPalette->fColorRed[pt] = fPalette->fColorRed[pt * 2 - 1];
792 newPalette->fColorGreen[pt] = fPalette->fColorGreen[pt * 2 - 1];
793 newPalette->fColorBlue[pt] = fPalette->fColorBlue[pt * 2 - 1];
794 newPalette->fColorAlpha[pt] = fPalette->fColorAlpha[pt * 2 - 1];
795 }
796 }
797
798 newPalette->fPoints[0] = fPalette->fPoints[0];
799 newPalette->fColorRed[0] = fPalette->fColorRed[0];
800 newPalette->fColorGreen[0] = fPalette->fColorGreen[0];
801 newPalette->fColorBlue[0] = fPalette->fColorBlue[0];
802 newPalette->fColorAlpha[0] = fPalette->fColorAlpha[0];
803
804 newPalette->fPoints[newPalette->fNumPoints-2] = fPalette->fPoints[fPalette->fNumPoints-2];
805 newPalette->fPoints[newPalette->fNumPoints-1] = fPalette->fPoints[fPalette->fNumPoints-1];
806 newPalette->fColorRed[newPalette->fNumPoints-1] = fPalette->fColorRed[fPalette->fNumPoints-1];
807 newPalette->fColorGreen[newPalette->fNumPoints-1] = fPalette->fColorGreen[fPalette->fNumPoints-1];
808 newPalette->fColorBlue[newPalette->fNumPoints-1] = fPalette->fColorBlue[fPalette->fNumPoints-1];
809 newPalette->fColorAlpha[newPalette->fNumPoints-1] = fPalette->fColorAlpha[fPalette->fNumPoints-1];
810
811 InsertNewPalette(newPalette);
813}
814
815////////////////////////////////////////////////////////////////////////////////
816/// The palette is repeated up to 4 times.
817/// This is called by one of the ramp radio buttons. Protected method.
818
820{
821 if (ramp == fRampFactor)
822 return;
823
824 Int_t ptPerRamp = (fPalette->fNumPoints - 2) / fRampFactor;
825 TImagePalette *newPalette = new TImagePalette(ptPerRamp * ramp + 2);
826
828 for (Int_t rp = 0; rp < ramp; rp++) {
829 for (Int_t pt = 0; pt < ptPerRamp; pt++) {
830 newPalette->fPoints[1 + pt + rp * ptPerRamp] = fPalette->fPoints[1] +
831 delta / ramp * rp +
832 (fPalette->fPoints[1+pt] - fPalette->fPoints[1]) * fRampFactor / ramp;
833 newPalette->fColorRed [1 + pt + rp * ptPerRamp] = fPalette->fColorRed [1 + pt];
834 newPalette->fColorGreen[1 + pt + rp * ptPerRamp] = fPalette->fColorGreen[1 + pt];
835 newPalette->fColorBlue [1 + pt + rp * ptPerRamp] = fPalette->fColorBlue [1 + pt];
836 newPalette->fColorAlpha[1 + pt + rp * ptPerRamp] = fPalette->fColorAlpha[1 + pt];
837 }
838 }
839
840 newPalette->fPoints[0] = fPalette->fPoints[0];
841 newPalette->fColorRed[0] = fPalette->fColorRed[0];
842 newPalette->fColorGreen[0] = fPalette->fColorGreen[0];
843 newPalette->fColorBlue[0] = fPalette->fColorBlue[0];
844 newPalette->fColorAlpha[0] = fPalette->fColorAlpha[0];
845
846 newPalette->fPoints[newPalette->fNumPoints-2] = fPalette->fPoints[fPalette->fNumPoints-2];
847 newPalette->fPoints[newPalette->fNumPoints-1] = fPalette->fPoints[fPalette->fNumPoints-1];
848 newPalette->fColorRed[newPalette->fNumPoints-1] = fPalette->fColorRed[fPalette->fNumPoints-1];
849 newPalette->fColorGreen[newPalette->fNumPoints-1] = fPalette->fColorGreen[fPalette->fNumPoints-1];
850 newPalette->fColorBlue[newPalette->fNumPoints-1] = fPalette->fColorBlue[fPalette->fNumPoints-1];
851 newPalette->fColorAlpha[newPalette->fNumPoints-1] = fPalette->fColorAlpha[fPalette->fNumPoints-1];
852
853 InsertNewPalette(newPalette);
855}
856
857////////////////////////////////////////////////////////////////////////////////
858/// Updates the range of the palette.
859/// This is called after the blue limit lines were moved to define
860/// a new range.
861
863{
864 if (fMaxValue == fMinValue)
865 return;
866
867 TImagePalette *newPalette = new TImagePalette(*fPalette);
868
869 Double_t l0 = fLimitLine[0]->GetX1();
870 Double_t l1 = fLimitLine[1]->GetX1();
871 l0 = (l0 < fMinValue) ? fMinValue : ((l0 > fMaxValue) ? fMaxValue : l0);
872 l1 = (l1 < fMinValue) ? fMinValue : ((l1 > fMaxValue) ? fMaxValue : l1);
873 if (l0 > l1) {
874 Double_t tmp = l0;
875 l0 = l1;
876 l1 = tmp;
877 }
878
880 Double_t newDelta = (l1 - l0) / (fMaxValue - fMinValue);
881 Double_t newOff = (l0 - fMinValue) / (fMaxValue - fMinValue);
882
883 if (newDelta < 0.001 || oldDelta < 0.001)
884 return;
885
886 for (Int_t pt = 1; pt < Int_t(fPalette->fNumPoints - 1); pt++)
887 newPalette->fPoints[pt] = newOff +
888 (fPalette->fPoints[pt] - fPalette->fPoints[1]) * newDelta / oldDelta;
889
890 InsertNewPalette(newPalette);
892}
893
894////////////////////////////////////////////////////////////////////////////////
895/// Actually paint the paletter.
896
898{
899 // get geometry of pad
900 Int_t to_w = TMath::Abs(gPad->XtoPixel(gPad->GetX2()) -
901 gPad->XtoPixel(gPad->GetX1()));
902 Int_t to_h = TMath::Abs(gPad->YtoPixel(gPad->GetY2()) -
903 gPad->YtoPixel(gPad->GetY1()));
904
905 ASGradient grad;
906
907 grad.npoints = (*fPalette)->fNumPoints - 2;
908 grad.type = GRADIENT_Left2Right;
909 grad.color = new ARGB32[grad.npoints];
910 grad.offset = new double[grad.npoints];
911 for (Int_t pt = 0; pt < grad.npoints; pt++) {
912 grad.offset[pt] = ((*fPalette)->fPoints[pt + 1] - (*fPalette)->fPoints[1]) /
913 ((*fPalette)->fPoints[(*fPalette)->fNumPoints - 2] - (*fPalette)->fPoints[1]);
914 grad.color[pt] = (((ARGB32)((*fPalette)->fColorBlue[pt + 1] & 0xff00)) >> 8) |
915 (((ARGB32)((*fPalette)->fColorGreen[pt + 1] & 0xff00)) ) |
916 (((ARGB32)((*fPalette)->fColorRed[pt + 1] & 0xff00)) << 8) |
917 (((ARGB32)((*fPalette)->fColorAlpha[pt + 1] & 0xff00)) << 16);
918 }
919
920 ASImage * grad_im = make_gradient((ASVisual*)TASImage::GetVisual(), &grad , to_w, to_h,
921 SCL_DO_COLOR, ASA_ARGB32, 0,
923 delete [] grad.color;
924 delete [] grad.offset;
925
926 Window_t wid = (Window_t)gVirtualX->GetWindowID(gPad->GetPixmapID());
927 TASImage::Image2Drawable(grad_im, wid, 0, 0);
928 destroy_asimage(&grad_im);
929}
930
931////////////////////////////////////////////////////////////////////////////////
932/// The blue limit line in the pixel value histogram.
933
935 TASPaletteEditor *gui)
936 : TLine(x, y1, x, y2)
937{
938 fGui = gui;
939 SetLineColor(4);
940 SetLineWidth(2);
941}
942
943////////////////////////////////////////////////////////////////////////////////
944/// Paint the limit lines.
945
947{
948 fY1 = gPad->GetUymin();
949 fY2 = gPad->GetUymax();
950
952}
953
954////////////////////////////////////////////////////////////////////////////////
955
957 Int_t px, Int_t /*py*/)
958{
959 static Int_t oldX;
960
961 if (!gPad) return;
962
963 switch(event) {
964 case kMouseMotion:
965 gPad->SetCursor(kMove);
966 break;
967
968 case kButton1Down:
969 gVirtualX->SetLineColor(-1);
970 TAttLine::Modify(); //Change line attributes only if necessary
971 oldX = gPad->XtoAbsPixel(fX1);
972 break;
973
974 case kButton1Motion:
975 gVirtualX->DrawLine(oldX, gPad->YtoPixel(fY1), oldX, gPad->YtoPixel(fY2));
976 oldX = px;
977 gVirtualX->DrawLine(oldX, gPad->YtoPixel(fY1), oldX, gPad->YtoPixel(fY2));
978 gVirtualX->Update();
979 break;
980
981 case kButton1Up:
982 gVirtualX->SetLineColor(-1);
983 TAttLine::Modify(); //Change line attributes only if necessary
984 fX1 = fX2 = gPad->AbsPixeltoX(oldX);
985 fGui->UpdateRange();
986 gPad->Modified(kTRUE);
987 gPad->Update();
988 break;
989
990 default:
991 break;
992 }
993}
@ 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:82
long Long_t
Definition RtypesCore.h:54
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
double Double_t
Definition RtypesCore.h:59
constexpr Bool_t kTRUE
Definition RtypesCore.h:100
const char Option_t
Definition RtypesCore.h:66
#define ClassImp(name)
Definition Rtypes.h:377
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
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:407
#define gPad
#define gVirtualX
Definition TVirtualX.h:338
Int_t GET_MSG(Long_t val)
@ kCM_COMBOBOX
@ kC_COMMAND
@ kCM_BUTTON
@ kCM_RADIOBUTTON
@ kCM_CHECKBUTTON
Int_t GET_SUBMSG(Long_t val)
#define snprintf
Definition civetweb.c:1540
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:245
void Update() override
Update canvas pad buffers.
Definition TCanvas.cxx:2475
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
TObject * Get(const char *namecycle) override
Return pointer to object identified by namecycle.
Describe directory structure in memory.
Definition TDirectory.h:45
virtual Bool_t cd()
Change current directory to "this" directory.
A ROOT file is composed of a header, followed by consecutive data records (TKey instances) with a wel...
Definition TFile.h:53
virtual Bool_t IsOpen() const
Returns kTRUE in case file is open and kFALSE if file is not open.
Definition TFile.cxx:1455
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:620
TAxis * GetXaxis()
Definition TH1.h:322
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:8462
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
Definition TH1.cxx:3345
TAxis * GetYaxis()
Definition TH1.h:323
void Draw(Option_t *option="") override
Draw this histogram with options.
Definition TH1.cxx:3067
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:330
TObject * Before(const TObject *obj) const override
Returns the object before object obj.
Definition TList.cxx:371
void Add(TObject *obj) override
Definition TList.h:81
TObject * Remove(TObject *obj) override
Remove object from the list.
Definition TList.cxx:822
TObject * Last() const override
Return the last object in the list. Returns 0 when list is empty.
Definition TList.cxx:693
TObject * First() const override
Return the first object in the list. Returns 0 when list is empty.
Definition TList.cxx:659
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
Definition TObject.cxx:274
void Modified(Bool_t flag=1) override
Definition TPad.h:420
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
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Definition TString.cxx:2356
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:709
Double_t Log(Double_t x)
Returns the natural logarithm of x.
Definition TMath.h:756
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
Definition TMathBase.h:123