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 
30 class TVirtualPad;
31 class TH1D;
33 class TGTextButton;
34 class TGCheckButton;
35 class TGComboBox;
36 class TGRadioButton;
37 
38 
40 
41 protected:
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);
50  };
51 
52  class LimitLine : public TLine {
53  private:
55  protected:
56  virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
57  public:
59  void Paint(Option_t *option);
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 
99 public:
100  TASPaletteEditor(TAttImage *attImage, UInt_t w, UInt_t h);
101  virtual ~TASPaletteEditor();
102 
103  Bool_t ProcessMessage(Long_t msg, Long_t param1, Long_t param2);
104 
105  void UpdateRange();
106  void CloseWindow();
107 
108  ClassDef(TASPaletteEditor,0) // GUI to edit a color palette
109 };
110 
111 #endif
TAttImage
TImage attributes.
Definition: TAttImage.h:59
TASPaletteEditor::fUnDoButton
TGTextButton * fUnDoButton
Definition: TASPaletteEditor.h:74
TLine.h
TGMainFrame
Defines top level windows that interact with the system Window Manager.
Definition: TGFrame.h:398
TAttImage.h
TLine
A simple line.
Definition: TLine.h:22
TASPaletteEditor::fPaletteCanvas
TRootEmbeddedCanvas * fPaletteCanvas
canvas to draw the current palette
Definition: TASPaletteEditor.h:66
TASPaletteEditor::PaintPalette
Definition: TASPaletteEditor.h:42
Option_t
const char Option_t
Definition: RtypesCore.h:66
TASPaletteEditor::LimitLine::fGui
TASPaletteEditor * fGui
Definition: TASPaletteEditor.h:54
TASPaletteEditor::fAutoUpdate
TGCheckButton * fAutoUpdate
Definition: TASPaletteEditor.h:77
TASPaletteEditor::SetStep
void SetStep()
Create a step palette.
Definition: TASPaletteEditor.cxx:769
TASPaletteEditor::NewPalette
void NewPalette(Long_t id)
A new palette is created, depending on the id.
Definition: TASPaletteEditor.cxx:676
TASPaletteEditor::fReDoButton
TGTextButton * fReDoButton
Definition: TASPaletteEditor.h:75
TASPaletteEditor::fStepButton
TGCheckButton * fStepButton
Definition: TASPaletteEditor.h:78
TH1D
1-D histogram with a double per channel (see TH1 documentation)}
Definition: TH1.h:618
TGTextButton
Yield an action as soon as it is clicked.
Definition: TGButton.h:142
x
Double_t x[n]
Definition: legend1.C:17
TASPaletteEditor::LinPalette
void LinPalette()
The anchor points are rescaled to be linar.
Definition: TASPaletteEditor.cxx:626
TASPaletteEditor::Open
void Open()
Opens either a ROOT file or an ASCII file and reads a palette.
Definition: TASPaletteEditor.cxx:462
TASPaletteEditor::fMaxValue
Double_t fMaxValue
max value of image
Definition: TASPaletteEditor.h:63
TASPaletteEditor::UpdateRange
void UpdateRange()
Updates the range of the palette.
Definition: TASPaletteEditor.cxx:863
bool
TASPaletteEditor::fMinValue
Double_t fMinValue
min value of image
Definition: TASPaletteEditor.h:62
TASPaletteEditor::ExpPalette
void ExpPalette()
The anchor points are rescaled by a exp operation.
Definition: TASPaletteEditor.cxx:607
TGCheckButton
Selects different options.
Definition: TGButton.h:264
Coord_t
double Coord_t
Definition: RtypesCore.h:94
TASPaletteEditor::fHistCanvas
TRootEmbeddedCanvas * fHistCanvas
canvas to draw the histogram
Definition: TASPaletteEditor.h:67
TASPaletteEditor::LimitLine::ExecuteEvent
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
Definition: TASPaletteEditor.cxx:957
TASPaletteEditor::fImagePad
TVirtualPad * fImagePad
Definition: TASPaletteEditor.h:70
TGRadioButton
Selects different options.
Definition: TGButton.h:322
h
#define h(i)
Definition: RSha256.hxx:106
TASPaletteEditor::LimitLine::LimitLine
LimitLine(Coord_t x, Coord_t y1, Coord_t y2, TASPaletteEditor *gui)
The blue limit line in the pixel value histogram.
Definition: TASPaletteEditor.cxx:935
TGFrame.h
Long_t
long Long_t
Definition: RtypesCore.h:54
TASPaletteEditor::TASPaletteEditor
TASPaletteEditor(TAttImage *attImage, UInt_t w, UInt_t h)
Palette editor constructor.
Definition: TASPaletteEditor.cxx:83
TASPaletteEditor::fComboBox
TGComboBox * fComboBox
Definition: TASPaletteEditor.h:82
TASPaletteEditor::Save
void Save()
Saves the current palette either into a ROOT file or in an ASCII file.
Definition: TASPaletteEditor.cxx:421
TASPaletteEditor::LimitLine
Definition: TASPaletteEditor.h:52
TASPaletteEditor::LimitLine::Paint
void Paint(Option_t *option)
Paint the limit lines.
Definition: TASPaletteEditor.cxx:947
TASPaletteEditor
This is a GUI window to edit a color palette.
Definition: TASPaletteEditor.h:39
unsigned int
TGComboBox
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
TASPaletteEditor::fPaintPalette
PaintPalette * fPaintPalette
Definition: TASPaletteEditor.h:71
TASPaletteEditor::UpdateScreen
void UpdateScreen(Bool_t histoUpdate)
All widgets of the screen are updated with the current palette.
Definition: TASPaletteEditor.cxx:521
TASPaletteEditor::InsertNewPalette
void InsertNewPalette(TImagePalette *newPalette)
The newPalette is inserted in the list of palettes (fPaletteList) and fPalette is set to the newPalet...
Definition: TASPaletteEditor.cxx:397
Double_t
double Double_t
Definition: RtypesCore.h:59
TASPaletteEditor::PaintPalette::PaintPalette
PaintPalette(TImagePalette **palette, TAttImage *attImage)
Definition: TASPaletteEditor.h:47
TVirtualPad
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition: TVirtualPad.h:51
TASPaletteEditor::InvertPalette
void InvertPalette()
The palette is inverted.
Definition: TASPaletteEditor.cxx:651
TObject
Mother of all ROOT objects.
Definition: TObject.h:37
TASPaletteEditor::CloseWindow
void CloseWindow()
Close editor.
Definition: TASPaletteEditor.cxx:285
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TASPaletteEditor::fPalette
TImagePalette * fPalette
current palette
Definition: TASPaletteEditor.h:69
TASPaletteEditor::PaintPalette::fAttImage
TAttImage * fAttImage
Definition: TASPaletteEditor.h:45
TASPaletteEditor::ProcessMessage
Bool_t ProcessMessage(Long_t msg, Long_t param1, Long_t param2)
Process all editor mouse events.
Definition: TASPaletteEditor.cxx:294
TASPaletteEditor::fHisto
TH1D * fHisto
histogram of image pixels
Definition: TASPaletteEditor.h:65
TImagePalette
A class to define a conversion from pixel values to pixel color.
Definition: TAttImage.h:33
TASPaletteEditor::fRamps
TGRadioButton * fRamps[3]
Definition: TASPaletteEditor.h:79
TASPaletteEditor::LogPalette
void LogPalette()
The anchor points are rescaled by a log operation.
Definition: TASPaletteEditor.cxx:588
TASPaletteEditor::fPaletteList
TList * fPaletteList
list of palettes for undo and redo
Definition: TASPaletteEditor.h:68
TPaletteEditor
Edit the palette via a GUI.
Definition: TAttImage.h:19
TASPaletteEditor::SetRamp
void SetRamp(Long_t ramp)
The palette is repeated up to 4 times.
Definition: TASPaletteEditor.cxx:820
TASPaletteEditor::fLimitLine
LimitLine * fLimitLine[2]
Definition: TASPaletteEditor.h:72
TASPaletteEditor::PaintPalette::fPalette
TImagePalette ** fPalette
Definition: TASPaletteEditor.h:44
TASPaletteEditor::~TASPaletteEditor
virtual ~TASPaletteEditor()
Palette editor destructor. Deletes all frames and their layout hints.
Definition: TASPaletteEditor.cxx:260
TList
A doubly linked list.
Definition: TList.h:44
TRootEmbeddedCanvas
This class creates a TGCanvas in which a TCanvas is created.
Definition: TRootEmbeddedCanvas.h:24
int
TASPaletteEditor::PaintPalette::Paint
void Paint(Option_t *option)
Actually paint the paletter.
Definition: TASPaletteEditor.cxx:898
TASPaletteEditor::fRampFactor
Int_t fRampFactor
Definition: TASPaletteEditor.h:80