library: libGraf #include "TAttImage.h"

# TImagePalette

class description - source file - inheritance tree (.pdf)

## class TImagePalette : public TObject

| Inheritance Chart:
`TObject`
| <- | `TImagePalette` |

        public:

                          TImagePalette()
                          TImagePalette(const TImagePalette& palette)
                          TImagePalette(UInt_t numPoints)
                  virtual ~TImagePalette()
           static TClass* Class()
            virtual Int_t FindColor(UShort_t r, UShort_t g, UShort_t b)
           virtual Int_t* GetRootColors()
          virtual TClass* IsA() const
           TImagePalette& operator=(const TImagePalette& palette)
             virtual void ShowMembers(TMemberInspector& insp, char* parent)
             virtual void Streamer(TBuffer& b)
                     void StreamerNVirtual(TBuffer& b)

### Data Members

        public:

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

## Class Description

      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.

      TPaletteEditor

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

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) : TObject(palette)

     Copy constructor.

~TImagePalette()

     Destructor.

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

### Inline Functions

            TImagePalette& operator=(const TImagePalette& palette)
                   TClass* Class()
                   TClass* IsA() const
                      void ShowMembers(TMemberInspector& insp, char* parent)
                      void Streamer(TBuffer& b)
                      void StreamerNVirtual(TBuffer& b)

Author: Reiner Rohlfs 24/03/02
Last update: root/graf:$Name: $:$Id: TAttImage.cxx,v 1.8 2005/06/21 17:09:26 brun Exp $
Copyright (C) 2001-2001, Rene Brun, Fons Rademakers and Reiner Rohlfs *