Logo ROOT  
Reference Guide
Go to the documentation of this file.
1// @(#)root/graf:$Id$
2// Author: Reiner Rohlfs 24/03/02
5 * Copyright (C) 2001-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 *************************************************************************/
12#ifndef ROOT_TAttImage
13#define ROOT_TAttImage
15#include "TObject.h"
17class TAttImage;
22 TAttImage *fAttImage; // image attributes to be edited
25 TPaletteEditor(TAttImage *attImage, UInt_t w, UInt_t h);
26 virtual ~TPaletteEditor() { }
28 virtual void CloseWindow();
30 ClassDef(TPaletteEditor, 0) // Base class for palette editor
33class TImagePalette : public TObject {
36 UInt_t fNumPoints; ///< number of anchor points
37 Double_t *fPoints; ///< [fNumPoints] value of each anchor point [0..1]
38 UShort_t *fColorRed; ///< [fNumPoints] red color at each anchor point
39 UShort_t *fColorGreen; ///< [fNumPoints] green color at each anchor point
40 UShort_t *fColorBlue; ///< [fNumPoints] blue color at each anchor point
41 UShort_t *fColorAlpha; ///< [fNumPoints] alpha at each anchor point
44 TImagePalette(const TImagePalette &palette);
45 TImagePalette(UInt_t numPoints);
47 virtual ~TImagePalette();
49 virtual Int_t *GetRootColors();
51 TImagePalette &operator=(const TImagePalette &palette);
53 static TImagePalette* Create(Option_t* opts);
54 static TImagePalette* CreateCOLPalette(Int_t nContours);
56 ClassDef(TImagePalette,2) // Color Palette for value -> color conversion
59class TAttImage {
62 // Defines level of output quality/speed ratio
68 kImgBest = 3
69 };
72 EImageQuality fImageQuality; ///< *OPTION={GetMethod="GetImageQuality";SetMethod="SetImageQuality";Items=(kImgDefault="Default",kImgPoor="Poor",kImgFast="Fast",kImgGood="Good",kImgBest="Best")}*
73 UInt_t fImageCompression; ///< compression [0 .. 100] 0: no compression
74 Bool_t fConstRatio; ///< keep aspect ratio of image on the screen
75 TImagePalette fPalette; ///< color palette for value -> color conversion
76 TPaletteEditor *fPaletteEditor; ///<! GUI to edit the color palette
77 Bool_t fPaletteEnabled; ///<! kTRUE - palette is drawn on the image
80 TAttImage();
81 TAttImage(EImageQuality lquality, UInt_t lcompression, Bool_t constRatio);
82 virtual ~TAttImage();
84 void Copy(TAttImage &attline) const;
85 Bool_t GetConstRatio() const { return fConstRatio; }
88 virtual const TImagePalette &GetPalette() const { return fPalette; }
90 virtual void ResetAttImage(Option_t *option="");
91 virtual void SaveImageAttributes(std::ostream &out, const char *name,
92 EImageQuality qualdef = kImgDefault,
93 UInt_t comprdef = 0,
94 Bool_t constRatiodef = kTRUE);
95 virtual void SetConstRatio(Bool_t constRatio = kTRUE); // *TOGGLE*
96 virtual void SetPaletteEnabled(Bool_t on = kTRUE) { fPaletteEnabled = on; }
97 virtual void SetImageCompression(UInt_t lcompression)
98 { fImageCompression = (lcompression > 100) ? 100 : lcompression; } // *MENU*
99 virtual void SetImageQuality(EImageQuality lquality)
100 { fImageQuality = lquality;} // *SUBMENU*
101 virtual void SetPalette(const TImagePalette *palette);
102 virtual void StartPaletteEditor(); // *MENU*
103 virtual void EditorClosed() { fPaletteEditor = 0; }
106 ClassDef(TAttImage,1) //Image attributes
109R__EXTERN TImagePalette *gHistImagePalette; // palette used in TH2::Draw("col")
110R__EXTERN TImagePalette *gWebImagePalette; // 6x6x6 colors web palette
#define R__EXTERN
Definition: DllImport.h:27
ROOT::R::TRInterface & r
Definition: Object.C:4
#define b(i)
Definition: RSha256.hxx:100
#define g(i)
Definition: RSha256.hxx:105
#define h(i)
Definition: RSha256.hxx:106
unsigned short UShort_t
Definition: RtypesCore.h:36
int Int_t
Definition: RtypesCore.h:41
unsigned int UInt_t
Definition: RtypesCore.h:42
bool Bool_t
Definition: RtypesCore.h:59
double Double_t
Definition: RtypesCore.h:55
const Bool_t kTRUE
Definition: RtypesCore.h:87
const char Option_t
Definition: RtypesCore.h:62
#define ClassDef(name, id)
Definition: Rtypes.h:326
R__EXTERN TImagePalette * gHistImagePalette
Definition: TAttImage.h:109
R__EXTERN TImagePalette * gWebImagePalette
Definition: TAttImage.h:110
char name[80]
Definition: TGX11.cxx:109
Color * colors
Definition: X3DBuffer.c:21
TImage attributes.
Definition: TAttImage.h:59
TPaletteEditor * fPaletteEditor
! GUI to edit the color palette
Definition: TAttImage.h:76
virtual void ResetAttImage(Option_t *option="")
Reset this image attributes to default values.
Definition: TAttImage.cxx:584
virtual void SetPalette(const TImagePalette *palette)
Set a new palette for the image.
Definition: TAttImage.cxx:650
Bool_t fConstRatio
keep aspect ratio of image on the screen
Definition: TAttImage.h:74
virtual ~TAttImage()
TAttImage destructor.
Definition: TAttImage.cxx:559
EImageQuality GetImageQuality() const
Definition: TAttImage.h:87
Bool_t GetConstRatio() const
Definition: TAttImage.h:85
virtual const TImagePalette & GetPalette() const
Definition: TAttImage.h:88
virtual void SetPaletteEnabled(Bool_t on=kTRUE)
Definition: TAttImage.h:96
UInt_t fImageCompression
compression [0 .. 100] 0: no compression
Definition: TAttImage.h:73
EImageQuality fImageQuality
Definition: TAttImage.h:72
Bool_t IsPaletteEnabled() const
Definition: TAttImage.h:104
TAttImage default constructor.
Definition: TAttImage.cxx:524
virtual void SetImageQuality(EImageQuality lquality)
Definition: TAttImage.h:99
void Copy(TAttImage &attline) const
Copy this image attributes to a new attimage.
Definition: TAttImage.cxx:567
@ kImgPoor
Definition: TAttImage.h:65
@ kImgDefault
Definition: TAttImage.h:64
@ kImgFast
Definition: TAttImage.h:66
@ kImgGood
Definition: TAttImage.h:67
@ kImgBest
Definition: TAttImage.h:68
TImagePalette fPalette
color palette for value -> color conversion
Definition: TAttImage.h:75
virtual void SetImageCompression(UInt_t lcompression)
Definition: TAttImage.h:97
UInt_t GetImageCompression() const
Definition: TAttImage.h:86
virtual void EditorClosed()
Definition: TAttImage.h:103
Bool_t fPaletteEnabled
! kTRUE - palette is drawn on the image
Definition: TAttImage.h:77
virtual void SetConstRatio(Bool_t constRatio=kTRUE)
Set (constRatio = kTRUE) or unset (constRadio = kFALSE) the ratio flag.
Definition: TAttImage.cxx:641
virtual void StartPaletteEditor()
Opens a GUI to edit the color palette.
Definition: TAttImage.cxx:780
virtual void SaveImageAttributes(std::ostream &out, const char *name, EImageQuality qualdef=kImgDefault, UInt_t comprdef=0, Bool_t constRatiodef=kTRUE)
Save image attributes as C++ statement(s) on output stream, but not the palette.
Definition: TAttImage.cxx:620
A class to define a conversion from pixel values to pixel color.
Definition: TAttImage.h:33
TImagePalette & operator=(const TImagePalette &palette)
Assignment operator.
Definition: TAttImage.cxx:453
virtual Int_t * GetRootColors()
Returns a list of ROOT colors.
Definition: TAttImage.cxx:507
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
static TImagePalette * CreateCOLPalette(Int_t nContours)
Factory method to creates an image palette for histogram plotting.
Definition: TAttImage.cxx:748
Default constructor, sets all pointers to 0.
Definition: TAttImage.cxx:270
virtual ~TImagePalette()
Definition: TAttImage.cxx:441
virtual Int_t FindColor(UShort_t r, UShort_t g, UShort_t b)
Returns an index of the closest color.
Definition: TAttImage.cxx:485
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
static TImagePalette * Create(Option_t *opts)
Factory method to creates an image palette of a specific typ.
Definition: TAttImage.cxx:702
UShort_t * fColorAlpha
[fNumPoints] alpha at each anchor point
Definition: TAttImage.h:41
Mother of all ROOT objects.
Definition: TObject.h:37
Edit the palette via a GUI.
Definition: TAttImage.h:19
virtual ~TPaletteEditor()
Definition: TAttImage.h:26
virtual void CloseWindow()
Closes the window and deletes itself.
Definition: TAttImage.cxx:262
TAttImage * fAttImage
Definition: TAttImage.h:22
TPaletteEditor(TAttImage *attImage, UInt_t w, UInt_t h)
Definition: TAttImage.cxx:254