TASPaletteEditor.h

Go to the documentation of this file.
00001 // @(#)root/asimage:$Id: TASPaletteEditor.h 20882 2007-11-19 11:31:26Z rdm $
00002 // Author: Reiner Rohlfs 24/03/2002
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2002, Rene Brun, Fons Rademakers and Reiner Rohlfs *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_TASPaletteEditor
00013 #define ROOT_TASPaletteEditor
00014 
00015 
00016 //////////////////////////////////////////////////////////////////////////
00017 //                                                                      //
00018 //  TASPaletteEditor                                                    //
00019 //                                                                      //
00020 //  This is a GUI window to edit a color palette.                       //
00021 //  It is called by a context menu item of TImage.                      //
00022 //                                                                      //
00023 //////////////////////////////////////////////////////////////////////////
00024 
00025 #ifndef ROOT_TAttImage
00026 #include "TAttImage.h"
00027 #endif
00028 #ifndef ROOT_TGFrame
00029 #include "TGFrame.h"
00030 #endif
00031 #ifndef ROOT_TLine
00032 #include "TLine.h"
00033 #endif
00034 
00035 
00036 class TVirtualPad;
00037 class TH1D;
00038 class TRootEmbeddedCanvas;
00039 class TGTextButton;
00040 class TGCheckButton;
00041 class TGComboBox;
00042 class TGRadioButton;
00043 
00044 
00045 class TASPaletteEditor : public TPaletteEditor, public TGMainFrame {
00046 
00047 protected:
00048    class PaintPalette : public TObject {
00049    protected :
00050       TImagePalette  **fPalette;
00051       TAttImage       *fAttImage;
00052    public:
00053       PaintPalette(TImagePalette **palette, TAttImage *attImage)
00054          { fPalette = palette; fAttImage = attImage; }
00055       void Paint(Option_t *option);
00056    };
00057 
00058    class LimitLine : public TLine {
00059    private:
00060       TASPaletteEditor  *fGui;
00061    protected:
00062       virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
00063    public:
00064       LimitLine(Coord_t x, Coord_t y1, Coord_t y2, TASPaletteEditor *gui);
00065       void Paint(Option_t *option);
00066    };
00067 
00068    Double_t              fMinValue;           // min value of image
00069    Double_t              fMaxValue;           // max value of image
00070 
00071    TH1D                 *fHisto;              // hitogram of image pixels
00072    TRootEmbeddedCanvas  *fPaletteCanvas;      // canvas to draw the current palette
00073    TRootEmbeddedCanvas  *fHistCanvas;         // canvas to draw the histogram
00074    TList                *fPaletteList;        // list of palettes for undo and redo
00075    TImagePalette        *fPalette;            // current palette
00076    TVirtualPad          *fImagePad;
00077    PaintPalette         *fPaintPalette;
00078    LimitLine            *fLimitLine[2];
00079 
00080    TGTextButton         *fUnDoButton;
00081    TGTextButton         *fReDoButton;
00082 
00083    TGCheckButton        *fAutoUpdate;
00084    TGCheckButton        *fStepButton;
00085    TGRadioButton        *fRamps[3];
00086    Int_t                 fRampFactor;
00087 
00088    TGComboBox           *fComboBox;
00089 
00090    void  InsertNewPalette(TImagePalette *newPalette);
00091 
00092    void  Save();
00093    void  Open();
00094 
00095    void  LogPalette();
00096    void  ExpPalette();
00097    void  LinPalette();
00098    void  InvertPalette();
00099    void  NewPalette(Long_t id);
00100    void  SetStep();
00101    void  SetRamp(Long_t ramp);
00102 
00103    void  UpdateScreen(Bool_t histoUpdate);
00104 
00105 public:
00106    TASPaletteEditor(TAttImage *attImage, UInt_t w, UInt_t h);
00107    virtual ~TASPaletteEditor();
00108 
00109    Bool_t ProcessMessage(Long_t msg, Long_t param1, Long_t param2);
00110 
00111    void   UpdateRange();
00112    void   CloseWindow();
00113 
00114    ClassDef(TASPaletteEditor,0)  // GUI to edit a color palette
00115 };
00116 
00117 #endif

Generated on Tue Jul 5 14:13:24 2011 for ROOT_528-00b_version by  doxygen 1.5.1