Logo ROOT  
Reference Guide
TASPaletteEditor.h
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#ifndef ROOT_TASPaletteEditor
13#define ROOT_TASPaletteEditor
14
15
16//////////////////////////////////////////////////////////////////////////
17// //
18// TASPaletteEditor //
19// //
20// This is a GUI window to edit a color palette. //
21// It is called by a context menu item of TImage. //
22// //
23//////////////////////////////////////////////////////////////////////////
24
25#include "TAttImage.h"
26#include "TGFrame.h"
27#include "TLine.h"
28
29
30class TVirtualPad;
31class TH1D;
33class TGTextButton;
34class TGCheckButton;
35class TGComboBox;
36class TGRadioButton;
37
38
40
41protected:
42 class PaintPalette : public TObject {
43 protected :
46 public:
47 PaintPalette(TImagePalette **palette, TAttImage *attImage)
48 { fPalette = palette; fAttImage = attImage; }
49 void Paint(Option_t *option = "") override;
50 };
51
52 class LimitLine : public TLine {
53 private:
55 protected:
56 void ExecuteEvent(Int_t event, Int_t px, Int_t py) override;
57 public:
59 void Paint(Option_t *option = "") override;
60 };
61
62 Double_t fMinValue; ///< min value of image
63 Double_t fMaxValue; ///< max value of image
64
65 TH1D *fHisto; ///< histogram of image pixels
66 TRootEmbeddedCanvas *fPaletteCanvas; ///< canvas to draw the current palette
67 TRootEmbeddedCanvas *fHistCanvas; ///< canvas to draw the histogram
68 TList *fPaletteList; ///< list of palettes for undo and redo
69 TImagePalette *fPalette; ///< current palette
73
76
81
83
84 void InsertNewPalette(TImagePalette *newPalette);
85
86 void Save();
87 void Open();
88
89 void LogPalette();
90 void ExpPalette();
91 void LinPalette();
92 void InvertPalette();
93 void NewPalette(Long_t id);
94 void SetStep();
95 void SetRamp(Long_t ramp);
96
97 void UpdateScreen(Bool_t histoUpdate);
98
99public:
101 virtual ~TASPaletteEditor();
102
103 Bool_t ProcessMessage(Longptr_t msg, Longptr_t param1, Longptr_t param2) override;
104
105 void UpdateRange();
106 void CloseWindow() override;
107
108 ClassDefOverride(TASPaletteEditor,0) // GUI to edit a color palette
109};
110
111#endif
#define h(i)
Definition: RSha256.hxx:106
long Longptr_t
Definition: RtypesCore.h:82
long Long_t
Definition: RtypesCore.h:54
const char Option_t
Definition: RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition: Rtypes.h:339
Option_t Option_t option
Option_t Option_t TPoint TPoint const char y2
Option_t Option_t TPoint TPoint const char y1
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).
PaintPalette(TImagePalette **palette, TAttImage *attImage)
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
void Save()
Saves the current palette either into a ROOT file or in an ASCII file.
TGCheckButton * fAutoUpdate
virtual ~TASPaletteEditor()
Palette editor destructor. Deletes all frames and their layout hints.
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
TImage attributes.
Definition: TAttImage.h:59
Selects different options.
Definition: TGButton.h:264
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
Defines top level windows that interact with the system Window Manager.
Definition: TGFrame.h:397
Selects different options.
Definition: TGButton.h:321
Yield an action as soon as it is clicked.
Definition: TGButton.h:142
1-D histogram with a double per channel (see TH1 documentation)}
Definition: TH1.h:617
A class to define a conversion from pixel values to pixel color.
Definition: TAttImage.h:33
Use the TLine constructor to create a simple line.
Definition: TLine.h:22
A doubly linked list.
Definition: TList.h:38
Mother of all ROOT objects.
Definition: TObject.h:37
Edit the palette via a GUI.
Definition: TAttImage.h:19
This class creates a TGCanvas in which a TCanvas is created.
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition: TVirtualPad.h:51
Double_t x[n]
Definition: legend1.C:17