ROOT logo
ROOT » GRAF2D » GRAF » TImagePalette

class TImagePalette: public TObject


TAttImage

Image attributes are:
Image Quality (see EImageQuality for the list of qualities)
Compression defines the compression rate of the color data in the
internal image structure. Speed and memory depends
on this rate, but not the image display itself
0: no compression;  100: max compression
Radio Flag: kTRUE  the x/y radio of the displayed image is always
identical to the original image
                kFALSE the x and y size of the displayed image depends
on the size of the pad
Palette:    Defines the conversion from a pixel value to the
screen color

This class is used (in general by secondary inheritance)
by some other classes (image display).


TImagePalette

A class to define a conversion from pixel values to pixel color.
A Palette is defined by some anchor points. Each anchor point has
a value between 0 and 1 and a color. An image has to be normalized
and the values between the anchor points are interpolated.
All member variables are public and can be directly manipulated.
In most cases the default operator will be used to create a
TImagePalette. In this case the member arrays have to be allocated
by an application and will be deleted in the destructor of this
class.

We provide few predifined palettes:

o gHistImagePalette - palette used in TH2::Draw("col")

o gWebImagePalette
The web palette is a set of 216 colors that will not dither or
shift on PCs or Macs. Browsers use this built-in palette when
they need to render colors on monitors with only 256 colors
(also called 8-bit color monitors).
The 6x6x6 web palette provides very quick color index lookup
and can be used for good quality convertion of images into
2-D histograms.

o  TImagePalette(Int_t ncolors, Int_t *colors)
if ncolors <= 0 a default palette (see below) of 50 colors
is defined.

if ncolors == 1 && colors == 0, then
a Pretty Palette with a Spectrum Violet->Red is created.

if ncolors > 50 and colors=0, the DeepSea palette is used.
(see TStyle::CreateGradientColorTable for more details)

if ncolors > 0 and colors = 0, the default palette is used
with a maximum of ncolors.

The default palette defines:
index 0->9   : grey colors from light to dark grey
index 10->19 : "brown" colors
index 20->29 : "blueish" colors
index 30->39 : "redish" colors
index 40->49 : basic colors


TPaletteEditor

This class provides a way to edit the palette via a GUI.


Function Members (Methods)

public:
TImagePalette()
TImagePalette(const TImagePalette& palette)
TImagePalette(UInt_t numPoints)
TImagePalette(Int_t ncolors, Int_t* colors)
virtual~TImagePalette()
voidTObject::AbstractMethod(const char* method) const
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTObject::Clear(Option_t* = "")
virtual TObject*TObject::Clone(const char* newname = "") const
virtual Int_tTObject::Compare(const TObject* obj) const
virtual voidTObject::Copy(TObject& object) const
virtual voidTObject::Delete(Option_t* option = "")MENU
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual Int_tFindColor(UShort_t r, UShort_t g, UShort_t b)
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
virtual const char*TObject::GetIconName() const
virtual const char*TObject::GetName() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
virtual Int_t*GetRootColors()
virtual const char*TObject::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTObject::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTObject::IsSortable() const
Bool_tTObject::IsZombie() const
virtual voidTObject::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual Bool_tTObject::Notify()
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
TImagePalette&operator=(const TImagePalette& palette)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidTObject::Print(Option_t* option = "") const
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(ostream& out, Option_t* option = "")
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
static voidTObject::SetObjectStat(Bool_t stat)
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector&)
virtual voidStreamer(TBuffer&)
voidStreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
protected:
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidTObject::MakeZombie()

Data Members

public:
UShort_t*fColorAlpha[fNumPoints] alpha at each anchor point
UShort_t*fColorBlue[fNumPoints] blue color at each anchor point
UShort_t*fColorGreen[fNumPoints] green color at each anchor point
UShort_t*fColorRed[fNumPoints] red color at each anchor point
UInt_tfNumPointsnumber of anchor points
Double_t*fPoints[fNumPoints] value of each anchor point [0..1]

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TImagePalette()
 Default constructor, sets all pointers to 0.
TImagePalette(UInt_t numPoints)
 Constructor for a palette with numPoints anchor points.
 It allocates the memory but does not set any colors.
TImagePalette(const TImagePalette& palette)
 Copy constructor.
TImagePalette(Int_t ncolors, Int_t* colors)
 Creates palette in the same way as TStyle::SetPalette
~TImagePalette()
 Destructor.
TImagePalette & operator=(const TImagePalette& palette)
 Assignment operator.
Int_t FindColor(UShort_t r, UShort_t g, UShort_t b)
 returns an index of the closest color
Int_t * GetRootColors()
 Returns a list of ROOT colors. Could be used to set histogram palette.
 See also http://root.cern.ch/root/htmldoc/TStyle.html#TStyle:SetPalette