Logo ROOT   6.16/01
Reference Guide
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Types | Private Member Functions | List of all members
TASImage Class Reference

Image class.

TASImage is the concrete interface to the image processing library libAfterImage.

It allows reading and writing of images in different formats, several image manipulations (scaling, tiling, merging, etc.) and displaying in pads. The size of the image on the screen does not depend on the original size of the image but on the size of the pad. Therefore it is very easy to resize the image on the screen by resizing the pad.

Besides reading an image from a file an image can be defined by a two dimensional array of values. A palette defines the color of each value.

The image can be zoomed by defining a rectangle with the mouse. The color palette can be modified with a GUI, just select StartPaletteEditor() from the context menu.

Several examples showing how to use this class are available in the ROOT tutorials: $ROOTSYS/tutorials/image/

Definition at line 31 of file TASImage.h.

Public Member Functions

 TASImage ()
 Default image constructor. More...
 
 TASImage (const char *file, EImageFileTypes type=kUnknown)
 Create an image object and read from specified file. More...
 
 TASImage (const char *name, const Double_t *imageData, UInt_t width, UInt_t height, TImagePalette *palette=0)
 Create an image depending on the values of imageData. More...
 
 TASImage (const char *name, const TArrayD &imageData, UInt_t width, TImagePalette *palette=0)
 Create an image depending on the values of imageData. More...
 
 TASImage (const char *name, const TVectorD &imageData, UInt_t width, TImagePalette *palette=0)
 Create an image depending on the values of imageData. More...
 
 TASImage (const TASImage &img)
 Image copy constructor. More...
 
 TASImage (UInt_t w, UInt_t h)
 Create an empty image. More...
 
virtual ~TASImage ()
 Image destructor, clean up image and visual. More...
 
void Append (const TImage *im, const char *option="+", const char *color="#00000000")
 Append image. More...
 
void BeginPaint (Bool_t fast=kTRUE)
 BeginPaint initializes internal array[width x height] of ARGB32 pixel values. More...
 
void Bevel (Int_t x=0, Int_t y=0, UInt_t width=0, UInt_t height=0, const char *hi="#ffdddddd", const char *lo="#ff555555", UShort_t thick=1, Bool_t pressed=kFALSE)
 Bevel is used to create 3D effect while drawing buttons, or any other image that needs to be framed. More...
 
void Blur (Double_t hr=3, Double_t vr=3)
 Perform Gaussian blur of the image (useful for drop shadows). More...
 
void Browse (TBrowser *)
 Browse image. More...
 
TObjectClone (const char *newname) const
 Clone image. More...
 
void CopyArea (TImage *dst, Int_t xsrc, Int_t ysrc, UInt_t w, UInt_t h, Int_t xdst=0, Int_t ydst=0, Int_t gfunc=3, EColorChan chan=kAllChan)
 Copy source region to the destination image. More...
 
void Crop (Int_t x=0, Int_t y=0, UInt_t width=0, UInt_t height=0)
 Crop an image. More...
 
void CropPolygon (UInt_t npt, TPoint *ppt)
 Crop a convex polygon. More...
 
void CropSpans (UInt_t npt, TPoint *ppt, UInt_t *widths)
 Crop spans. More...
 
Int_t DistancetoPrimitive (Int_t px, Int_t py)
 Is the mouse in the image ? More...
 
void Draw (Option_t *option="")
 Draw image. More...
 
void DrawBox (Int_t x1, Int_t y1, Int_t x2, Int_t y2, const char *col="#000000", UInt_t thick=1, Int_t mode=0)
 Draw a box. More...
 
void DrawCellArray (Int_t x1, Int_t y1, Int_t x2, Int_t y2, Int_t nx, Int_t ny, UInt_t *ic)
 Draw a cell array. More...
 
void DrawCircle (Int_t x, Int_t y, Int_t r, const char *col="#000000", Int_t thick=1)
 Draw a circle. More...
 
void DrawCubeBezier (Int_t x1, Int_t y1, Int_t x2, Int_t y2, Int_t x3, Int_t y3, const char *col="#000000", UInt_t thick=1)
 Draw a cubic bezier line. More...
 
void DrawDashLine (UInt_t x1, UInt_t y1, UInt_t x2, UInt_t y2, UInt_t nDash, const char *pDash, const char *col="#000000", UInt_t thick=1)
 Draw a dashed line. More...
 
void DrawEllips (Int_t x, Int_t y, Int_t rx, Int_t ry, Int_t angle, const char *col="#000000", Int_t thick=1)
 Draw an ellipse. More...
 
void DrawEllips2 (Int_t x, Int_t y, Int_t rx, Int_t ry, Int_t angle, const char *col="#000000", Int_t thick=1)
 Draw an ellipse. More...
 
void DrawFillArea (UInt_t npt, TPoint *ppt, const char *col="#000000", const char *stipple=0, UInt_t w=16, UInt_t h=16)
 Fill a polygon (any type convex, non-convex). More...
 
void DrawFillArea (UInt_t npt, TPoint *ppt, TImage *tile)
 Fill a polygon (any type convex, non-convex). More...
 
void DrawLine (UInt_t x1, UInt_t y1, UInt_t x2, UInt_t y2, const char *col="#000000", UInt_t thick=1)
 Draw a line. More...
 
void DrawPolyLine (UInt_t nn, TPoint *xy, const char *col="#000000", UInt_t thick=1, TImage::ECoordMode mode=kCoordModeOrigin)
 Draw a polyline. More...
 
void DrawRectangle (UInt_t x, UInt_t y, UInt_t w, UInt_t h, const char *col="#000000", UInt_t thick=1)
 Draw a rectangle. More...
 
void DrawSegments (UInt_t nseg, Segment_t *seg, const char *col="#000000", UInt_t thick=1)
 Draw segments. More...
 
void DrawStraightEllips (Int_t x, Int_t y, Int_t rx, Int_t ry, const char *col="#000000", Int_t thick=1)
 Draw a straight ellipse. More...
 
void DrawText (Int_t x=0, Int_t y=0, const char *text="", Int_t size=12, const char *color=0, const char *font="fixed", EText3DType type=TImage::kPlain, const char *fore_file=0, Float_t angle=0)
 Draw text of size (in pixels for TrueType fonts) at position (x, y) with color specified by hex string. More...
 
void DrawText (TText *text, Int_t x=0, Int_t y=0)
 Draw text at the pixel position (x,y). More...
 
void EndPaint ()
 EndPaint does internal RLE compression of image data. More...
 
void ExecuteEvent (Int_t event, Int_t px, Int_t py)
 Execute mouse events. More...
 
void FillPolygon (UInt_t npt, TPoint *ppt, const char *col="#000000", const char *stipple=0, UInt_t w=16, UInt_t h=16)
 Fill a convex polygon with background color or bitmap. More...
 
void FillPolygon (UInt_t npt, TPoint *ppt, TImage *tile)
 Fill a convex polygon with background image. More...
 
void FillRectangle (const char *col=0, Int_t x=0, Int_t y=0, UInt_t width=0, UInt_t height=0)
 Fill rectangle of size (width, height) at position (x,y) within the existing image with specified color. More...
 
void FillSpans (UInt_t npt, TPoint *ppt, UInt_t *widths, const char *col="#000000", const char *stipple=0, UInt_t w=16, UInt_t h=16)
 Fill spans with specified color or/and stipple. More...
 
void FillSpans (UInt_t npt, TPoint *ppt, UInt_t *widths, TImage *tile)
 Fill spans with tile image. More...
 
void Flip (Int_t flip=180)
 Flip image in place. More...
 
void FloodFill (Int_t x, Int_t y, const char *col, const char *min_col, const char *max_col=0)
 Flood fill. More...
 
void FromGLBuffer (UChar_t *buf, UInt_t w, UInt_t h)
 Creates an image (screenshot) from a RGBA buffer. More...
 
void FromPad (TVirtualPad *pad, Int_t x=0, Int_t y=0, UInt_t w=0, UInt_t h=0)
 Create an image from the given pad, afterwards this image can be saved in any of the supported image formats. More...
 
void FromWindow (Drawable_t wid, Int_t x=0, Int_t y=0, UInt_t w=0, UInt_t h=0)
 Create an image (screenshot) from specified window. More...
 
UInt_tGetArgbArray ()
 Return a pointer to internal array[width x height] of ARGB32 values This array is directly accessible. More...
 
TArrayDGetArray (UInt_t w=0, UInt_t h=0, TImagePalette *pal=gWebImagePalette)
 In case of vectorized image return an associated array of doubles otherwise this method creates and returns a 2D array of doubles corresponding to palette. More...
 
UInt_t GetHeight () const
 Return height of original image not of the displayed image. More...
 
const char * GetIconName () const
 Returns mime type name of object. More...
 
ASImage * GetImage () const
 
void GetImageBuffer (char **buffer, int *size, EImageFileTypes type=TImage::kPng)
 Return in-memory buffer compressed according image type. More...
 
Pixmap_t GetMask ()
 Returns image mask pixmap (alpha channel). More...
 
char * GetObjectInfo (Int_t px, Int_t py) const
 Get image pixel coordinates and the pixel value at the mouse pointer. More...
 
TArrayLGetPixels (Int_t x=0, Int_t y=0, UInt_t w=0, UInt_t h=0)
 Return 2D array of machine dependent pixel values. More...
 
Pixmap_t GetPixmap ()
 Returns image pixmap. More...
 
UInt_tGetRgbaArray ()
 Return a pointer to an array[width x height] of RGBA32 values. More...
 
UInt_t GetScaledHeight () const
 Return height of the displayed image not of the original image. More...
 
TImageGetScaledImage () const
 
UInt_t GetScaledWidth () const
 Return width of the displayed image not of the original image. More...
 
UInt_tGetScanline (UInt_t y)
 Return a pointer to scan-line. More...
 
const char * GetTitle () const
 Title is used to keep 32x32 xpm image's thumbnail. More...
 
Double_tGetVecArray ()
 Return a pointer to internal array[width x height] of double values [0,1]. More...
 
UInt_t GetWidth () const
 Return width of original image not of the displayed image. More...
 
void GetZoomPosition (UInt_t &x, UInt_t &y, UInt_t &w, UInt_t &h) const
 Return the zoom parameters. More...
 
void Gradient (UInt_t angle=0, const char *colors="#FFFFFF #000000", const char *offsets=0, Int_t x=0, Int_t y=0, UInt_t width=0, UInt_t height=0)
 Render multipoint gradient inside rectangle of size (width, height) at position (x,y) within the existing image. More...
 
void Gray (Bool_t on=kTRUE)
 Convert RGB image to Gray image and vice versa. More...
 
void HSV (UInt_t hue=0, UInt_t radius=360, Int_t H=0, Int_t S=0, Int_t V=0, Int_t x=0, Int_t y=0, UInt_t width=0, UInt_t height=0)
 This function will tile original image to specified size with offsets requested, and then it will go though it and adjust hue, saturation and value of those pixels that have specific hue, set by affected_hue/ affected_radius parameters. More...
 
Bool_t IsEditable () const
 
Bool_t IsGray () const
 
Bool_t IsValid () const
 
void Merge (const TImage *im, const char *op="alphablend", Int_t x=0, Int_t y=0)
 Merge two images. More...
 
void Mirror (Bool_t vert=kTRUE)
 Mirror image in place. More...
 
TASImageoperator= (const TASImage &img)
 Image assignment operator. More...
 
void Pad (const char *color="#00FFFFFF", UInt_t left=0, UInt_t right=0, UInt_t top=0, UInt_t bottom=0)
 Enlarge image, padding it with specified color on each side in accordance with requested geometry. More...
 
void Paint (Option_t *option="")
 Paint image. More...
 
void PaintImage (Drawable_t wid, Int_t x, Int_t y, Int_t xsrc=0, Int_t ysrc=0, UInt_t wsrc=0, UInt_t hsrc=0, Option_t *opt="")
 Draw image on the drawable wid (pixmap, window) at x,y position. More...
 
void PolyPoint (UInt_t npt, TPoint *ppt, const char *col="#000000", TImage::ECoordMode mode=kCoordModeOrigin)
 Draw a poly point. More...
 
void PutPixel (Int_t x, Int_t y, const char *col="#000000")
 Draw a point at the specified position. More...
 
void ReadImage (const char *file, EImageFileTypes type=TImage::kUnknown)
 Read specified image file. More...
 
void SavePrimitive (std::ostream &out, Option_t *option="")
 Save a primitive as a C++ statement(s) on output stream "out". More...
 
void Scale (UInt_t width, UInt_t height)
 Scale the original image. More...
 
void SetEditable (Bool_t on=kTRUE)
 
void SetImage (ASImage *image)
 
void SetImage (const Double_t *imageData, UInt_t width, UInt_t height, TImagePalette *palette=0)
 Deletes the old image and creates a new image depending on the values of imageData. More...
 
void SetImage (const TArrayD &imageData, UInt_t width, TImagePalette *palette=0)
 Delete the old image and creates a new image depending on the values of imageData. More...
 
void SetImage (const TVectorD &imageData, UInt_t width, TImagePalette *palette=0)
 Delete the old image and creates a new image depending on the values of imageData. More...
 
void SetImage (Pixmap_t pxm, Pixmap_t mask=0)
 Create image from pixmap. More...
 
Bool_t SetImageBuffer (char **buffer, EImageFileTypes type=TImage::kPng)
 Create image from compressed buffer. More...
 
Bool_t SetJpegDpi (const char *name, UInt_t dpi=72)
 Set an image printing resolution in Dots Per Inch units. More...
 
void SetPalette (const TImagePalette *palette)
 Set a new palette to an image. More...
 
void SetPaletteEnabled (Bool_t on=kTRUE)
 Switch on/off the image palette. More...
 
void SetTitle (const char *title="")
 Set a title for an image. More...
 
void Slice (UInt_t xStart, UInt_t xEnd, UInt_t yStart, UInt_t yEnd, UInt_t toWidth, UInt_t toHeight)
 Another method of enlarging images where corners remain unchanged, but middle part gets tiled. More...
 
void StartPaletteEditor ()
 Start palette editor. More...
 
void Tile (UInt_t width, UInt_t height)
 Tile the original image. More...
 
void UnZoom ()
 Un-zoom the image to original size. More...
 
Double_tVectorize (UInt_t max_colors=256, UInt_t dither=4, Int_t opaque_threshold=1)
 Reduce color-depth of an image and fills vector of "scientific data" [0...1]. More...
 
void WriteImage (const char *file, EImageFileTypes type=TImage::kUnknown)
 Write image to specified file. More...
 
void Zoom (UInt_t offX, UInt_t offY, UInt_t width, UInt_t height)
 The area of an image displayed in a pad is defined by this function. More...
 
- Public Member Functions inherited from TImage
 TImage (const TImage &img)
 
 TImage (UInt_t, UInt_t)
 
virtual ~TImage ()
 
virtual void Append (const TImage *, const char *="+", const char *="#00000000")
 
virtual void BeginPaint (Bool_t=kTRUE)
 
virtual void Bevel (Int_t=0, Int_t=0, UInt_t=0, UInt_t=0, const char *="#ffdddddd", const char *="#ff555555", UShort_t=1, Bool_t=kFALSE)
 
virtual void Blur (Double_t=3, Double_t=3)
 
virtual TObjectClone (const char *) const
 Make a clone of an object using the Streamer facility. More...
 
virtual void CopyArea (TImage *, Int_t, Int_t, UInt_t, UInt_t, Int_t=0, Int_t=0, Int_t=3, EColorChan=kAllChan)
 
virtual void Crop (Int_t=0, Int_t=0, UInt_t=0, UInt_t=0)
 
virtual void CropPolygon (UInt_t, TPoint *)
 
virtual void CropSpans (UInt_t, TPoint *, UInt_t *)
 
virtual void DrawBox (Int_t, Int_t, Int_t, Int_t, const char *="#000000", UInt_t=1, Int_t=0)
 
virtual void DrawCellArray (Int_t, Int_t, Int_t, Int_t, Int_t, Int_t, UInt_t *)
 
virtual void DrawCircle (Int_t, Int_t, Int_t, const char *="#000000", Int_t=1)
 
virtual void DrawCubeBezier (Int_t, Int_t, Int_t, Int_t, Int_t, Int_t, const char *="#000000", UInt_t=1)
 
virtual void DrawDashLine (UInt_t, UInt_t, UInt_t, UInt_t, UInt_t, const char *, const char *="#000000", UInt_t=1)
 
virtual void DrawEllips (Int_t, Int_t, Int_t, Int_t, Int_t, const char *="#000000", Int_t=1)
 
virtual void DrawEllips2 (Int_t, Int_t, Int_t, Int_t, Int_t, const char *="#000000", Int_t=1)
 
virtual void DrawFillArea (UInt_t, TPoint *, const char *="#000000", const char *=0, UInt_t=16, UInt_t=16)
 
virtual void DrawFillArea (UInt_t, TPoint *, TImage *)
 
virtual void DrawLine (UInt_t, UInt_t, UInt_t, UInt_t, const char *="#000000", UInt_t=1)
 
virtual void DrawPolyLine (UInt_t, TPoint *, const char *="#000000", UInt_t=1, TImage::ECoordMode=kCoordModeOrigin)
 
virtual void DrawRectangle (UInt_t, UInt_t, UInt_t, UInt_t, const char *="#000000", UInt_t=1)
 
virtual void DrawSegments (UInt_t, Segment_t *, const char *="#000000", UInt_t=1)
 
virtual void DrawStraightEllips (Int_t, Int_t, Int_t, Int_t, const char *="#000000", Int_t=1)
 
virtual void DrawText (Int_t=0, Int_t=0, const char *="", Int_t=12, const char *=0, const char *="fixed", EText3DType=TImage::kPlain, const char *=0, Float_t=0)
 
virtual void DrawText (TText *, Int_t=0, Int_t=0)
 
virtual void EndPaint ()
 
virtual void FillPolygon (UInt_t, TPoint *, const char *="#000000", const char *=0, UInt_t=16, UInt_t=16)
 
virtual void FillPolygon (UInt_t, TPoint *, TImage *)
 
virtual void FillRectangle (const char *=0, Int_t=0, Int_t=0, UInt_t=0, UInt_t=0)
 
virtual void FillSpans (UInt_t, TPoint *, UInt_t *, const char *="#000000", const char *=0, UInt_t=16, UInt_t=16)
 
virtual void FillSpans (UInt_t, TPoint *, UInt_t *, TImage *)
 
virtual void Flip (Int_t=180)
 
virtual void FloodFill (Int_t, Int_t, const char *, const char *, const char *=0)
 
virtual void FromGLBuffer (UChar_t *, UInt_t, UInt_t)
 
virtual void FromPad (TVirtualPad *, Int_t=0, Int_t=0, UInt_t=0, UInt_t=0)
 
virtual void FromWindow (Drawable_t, Int_t=0, Int_t=0, UInt_t=0, UInt_t=0)
 
virtual UInt_tGetArgbArray ()
 
virtual TArrayDGetArray (UInt_t=0, UInt_t=0, TImagePalette *=gWebImagePalette)
 
virtual UInt_t GetHeight () const
 
virtual void GetImageBuffer (char **, int *, EImageFileTypes=TImage::kPng)
 
virtual Pixmap_t GetMask ()
 
virtual TArrayLGetPixels (Int_t=0, Int_t=0, UInt_t=0, UInt_t=0)
 
virtual Pixmap_t GetPixmap ()
 
virtual UInt_tGetRgbaArray ()
 
virtual TImageGetScaledImage () const
 
virtual UInt_tGetScanline (UInt_t)
 
virtual Double_tGetVecArray ()
 
virtual UInt_t GetWidth () const
 
virtual void Gradient (UInt_t=0, const char *="#FFFFFF #000000", const char *=0, Int_t=0, Int_t=0, UInt_t=0, UInt_t=0)
 
virtual void Gray (Bool_t=kTRUE)
 
virtual void HSV (UInt_t=0, UInt_t=360, Int_t=0, Int_t=0, Int_t=0, Int_t=0, Int_t=0, UInt_t=0, UInt_t=0)
 
virtual Bool_t IsEditable () const
 
virtual Bool_t IsGray () const
 
virtual Bool_t IsValid () const
 
virtual void Merge (const TImage *, const char *="alphablend", Int_t=0, Int_t=0)
 
virtual void Mirror (Bool_t=kTRUE)
 
TImageoperator+= (const TImage &i)
 
TImageoperator/= (const TImage &i)
 
TImageoperator= (const TImage &img)
 
virtual void Pad (const char *="#FFFFFFFF", UInt_t=0, UInt_t=0, UInt_t=0, UInt_t=0)
 
virtual void PaintImage (Drawable_t, Int_t, Int_t, Int_t=0, Int_t=0, UInt_t=0, UInt_t=0, Option_t *="")
 
virtual void PolyPoint (UInt_t, TPoint *, const char *="#000000", TImage::ECoordMode=kCoordModeOrigin)
 
virtual void PutPixel (Int_t, Int_t, const char *="#000000")
 
virtual void ReadImage (const char *, EImageFileTypes=TImage::kUnknown)
 
virtual void Scale (UInt_t, UInt_t)
 
virtual void SetEditable (Bool_t=kTRUE)
 
virtual void SetImage (const Double_t *, UInt_t, UInt_t, TImagePalette *=0)
 
virtual void SetImage (const TArrayD &, UInt_t, TImagePalette *=0)
 
virtual void SetImage (const TVectorD &, UInt_t, TImagePalette *=0)
 
virtual void SetImage (Pixmap_t, Pixmap_t=0)
 
virtual Bool_t SetImageBuffer (char **, EImageFileTypes=TImage::kPng)
 
virtual void Slice (UInt_t, UInt_t, UInt_t, UInt_t, UInt_t, UInt_t)
 
virtual void Tile (UInt_t, UInt_t)
 
virtual void UnZoom ()
 
virtual Double_tVectorize (UInt_t=256, UInt_t=4, Int_t=0)
 
virtual void WriteImage (const char *, EImageFileTypes=TImage::kUnknown)
 
virtual void Zoom (UInt_t, UInt_t, UInt_t, UInt_t)
 
- Public Member Functions inherited from TNamed
 TNamed ()
 
 TNamed (const char *name, const char *title)
 
 TNamed (const TNamed &named)
 TNamed copy ctor. More...
 
 TNamed (const TString &name, const TString &title)
 
virtual ~TNamed ()
 TNamed destructor. More...
 
virtual void Clear (Option_t *option="")
 Set name and title to empty strings (""). More...
 
virtual TObjectClone (const char *newname="") const
 Make a clone of an object using the Streamer facility. More...
 
virtual Int_t Compare (const TObject *obj) const
 Compare two TNamed objects. More...
 
virtual void Copy (TObject &named) const
 Copy this to obj. More...
 
virtual void FillBuffer (char *&buffer)
 Encode TNamed into output buffer. More...
 
virtual const char * GetName () const
 Returns name of object. More...
 
virtual const char * GetTitle () const
 Returns title of object. More...
 
virtual ULong_t Hash () const
 Return hash value for this object. More...
 
virtual Bool_t IsSortable () const
 
virtual void ls (Option_t *option="") const
 List TNamed name and title. More...
 
TNamedoperator= (const TNamed &rhs)
 TNamed assignment operator. More...
 
virtual void Print (Option_t *option="") const
 Print TNamed name and title. More...
 
virtual void SetName (const char *name)
 Set the name of the TNamed. More...
 
virtual void SetNameTitle (const char *name, const char *title)
 Set all the TNamed parameters (name and title). More...
 
virtual void SetTitle (const char *title="")
 Set the title of the TNamed. More...
 
virtual Int_t Sizeof () const
 Return size of the TNamed part of the TObject. More...
 
- Public Member Functions inherited from TObject
 TObject ()
 TObject constructor. More...
 
 TObject (const TObject &object)
 TObject copy ctor. More...
 
virtual ~TObject ()
 TObject destructor. More...
 
void AbstractMethod (const char *method) const
 Use this method to implement an "abstract" method that you don't want to leave purely abstract. More...
 
virtual void AppendPad (Option_t *option="")
 Append graphics object to current pad. More...
 
virtual void Browse (TBrowser *b)
 Browse object. May be overridden for another default action. More...
 
ULong_t CheckedHash ()
 Check and record whether this class has a consistent Hash/RecursiveRemove setup (*) and then return the regular Hash value for this object. More...
 
virtual const char * ClassName () const
 Returns name of class to which the object belongs. More...
 
virtual void Clear (Option_t *="")
 
virtual TObjectClone (const char *newname="") const
 Make a clone of an object using the Streamer facility. More...
 
virtual Int_t Compare (const TObject *obj) const
 Compare abstract method. More...
 
virtual void Copy (TObject &object) const
 Copy this to obj. More...
 
virtual void Delete (Option_t *option="")
 Delete this object. More...
 
virtual Int_t DistancetoPrimitive (Int_t px, Int_t py)
 Computes distance from point (px,py) to the object. More...
 
virtual void Draw (Option_t *option="")
 Default Draw method for all objects. More...
 
virtual void DrawClass () const
 Draw class inheritance tree of the class to which this object belongs. More...
 
virtual TObjectDrawClone (Option_t *option="") const
 Draw a clone of this object in the current selected pad for instance with: gROOT->SetSelectedPad(gPad). More...
 
virtual void Dump () const
 Dump contents of object on stdout. More...
 
virtual void Error (const char *method, const char *msgfmt,...) const
 Issue error message. More...
 
virtual void Execute (const char *method, const char *params, Int_t *error=0)
 Execute method on this object with the given parameter string, e.g. More...
 
virtual void Execute (TMethod *method, TObjArray *params, Int_t *error=0)
 Execute method on this object with parameters stored in the TObjArray. More...
 
virtual void ExecuteEvent (Int_t event, Int_t px, Int_t py)
 Execute action corresponding to an event at (px,py). More...
 
virtual void Fatal (const char *method, const char *msgfmt,...) const
 Issue fatal error message. More...
 
virtual TObjectFindObject (const char *name) const
 Must be redefined in derived classes. More...
 
virtual TObjectFindObject (const TObject *obj) const
 Must be redefined in derived classes. More...
 
virtual Option_tGetDrawOption () const
 Get option used by the graphics system to draw this object. More...
 
virtual const char * GetIconName () const
 Returns mime type name of object. More...
 
virtual const char * GetName () const
 Returns name of object. More...
 
virtual char * GetObjectInfo (Int_t px, Int_t py) const
 Returns string containing info about the object at position (px,py). More...
 
virtual Option_tGetOption () const
 
virtual const char * GetTitle () const
 Returns title of object. More...
 
virtual UInt_t GetUniqueID () const
 Return the unique object id. More...
 
virtual Bool_t HandleTimer (TTimer *timer)
 Execute action in response of a timer timing out. More...
 
virtual ULong_t Hash () const
 Return hash value for this object. More...
 
Bool_t HasInconsistentHash () const
 Return true is the type of this object is known to have an inconsistent setup for Hash and RecursiveRemove (i.e. More...
 
virtual void Info (const char *method, const char *msgfmt,...) const
 Issue info message. More...
 
virtual Bool_t InheritsFrom (const char *classname) const
 Returns kTRUE if object inherits from class "classname". More...
 
virtual Bool_t InheritsFrom (const TClass *cl) const
 Returns kTRUE if object inherits from TClass cl. More...
 
virtual void Inspect () const
 Dump contents of this object in a graphics canvas. More...
 
void InvertBit (UInt_t f)
 
virtual Bool_t IsEqual (const TObject *obj) const
 Default equal comparison (objects are equal if they have the same address in memory). More...
 
virtual Bool_t IsFolder () const
 Returns kTRUE in case object contains browsable objects (like containers or lists of other objects). More...
 
R__ALWAYS_INLINE Bool_t IsOnHeap () const
 
virtual Bool_t IsSortable () const
 
R__ALWAYS_INLINE Bool_t IsZombie () const
 
virtual void ls (Option_t *option="") const
 The ls function lists the contents of a class on stdout. More...
 
void MayNotUse (const char *method) const
 Use this method to signal that a method (defined in a base class) may not be called in a derived class (in principle against good design since a child class should not provide less functionality than its parent, however, sometimes it is necessary). More...
 
virtual Bool_t Notify ()
 This method must be overridden to handle object notification. More...
 
void Obsolete (const char *method, const char *asOfVers, const char *removedFromVers) const
 Use this method to declare a method obsolete. More...
 
void operator delete (void *ptr)
 Operator delete. More...
 
void operator delete[] (void *ptr)
 Operator delete []. More...
 
voidoperator new (size_t sz)
 
voidoperator new (size_t sz, void *vp)
 
voidoperator new[] (size_t sz)
 
voidoperator new[] (size_t sz, void *vp)
 
TObjectoperator= (const TObject &rhs)
 TObject assignment operator. More...
 
virtual void Paint (Option_t *option="")
 This method must be overridden if a class wants to paint itself. More...
 
virtual void Pop ()
 Pop on object drawn in a pad to the top of the display list. More...
 
virtual void Print (Option_t *option="") const
 This method must be overridden when a class wants to print itself. More...
 
virtual Int_t Read (const char *name)
 Read contents of object with specified name from the current directory. More...
 
virtual void RecursiveRemove (TObject *obj)
 Recursively remove this object from a list. More...
 
void ResetBit (UInt_t f)
 
virtual void SaveAs (const char *filename="", Option_t *option="") const
 Save this object in the file specified by filename. More...
 
virtual void SavePrimitive (std::ostream &out, Option_t *option="")
 Save a primitive as a C++ statement(s) on output stream "out". More...
 
void SetBit (UInt_t f)
 
void SetBit (UInt_t f, Bool_t set)
 Set or unset the user status bits as specified in f. More...
 
virtual void SetDrawOption (Option_t *option="")
 Set drawing option for object. More...
 
virtual void SetUniqueID (UInt_t uid)
 Set the unique object id. More...
 
virtual void SysError (const char *method, const char *msgfmt,...) const
 Issue system error message. More...
 
R__ALWAYS_INLINE Bool_t TestBit (UInt_t f) const
 
Int_t TestBits (UInt_t f) const
 
virtual void UseCurrentStyle ()
 Set current style settings in this object This function is called when either TCanvas::UseCurrentStyle or TROOT::ForceStyle have been invoked. More...
 
virtual void Warning (const char *method, const char *msgfmt,...) const
 Issue warning message. More...
 
virtual Int_t Write (const char *name=0, Int_t option=0, Int_t bufsize=0)
 Write this object to the current directory. More...
 
virtual Int_t Write (const char *name=0, Int_t option=0, Int_t bufsize=0) const
 Write this object to the current directory. More...
 
- Public Member Functions inherited from TAttImage
 TAttImage ()
 TAttImage default constructor. More...
 
 TAttImage (EImageQuality lquality, UInt_t lcompression, Bool_t constRatio)
 TAttImage normal constructor. More...
 
virtual ~TAttImage ()
 TAttImage destructor. More...
 
void Copy (TAttImage &attline) const
 Copy this image attributes to a new attimage. More...
 
virtual void EditorClosed ()
 
Bool_t GetConstRatio () const
 
UInt_t GetImageCompression () const
 
EImageQuality GetImageQuality () const
 
virtual const TImagePaletteGetPalette () const
 
Bool_t IsPaletteEnabled () const
 
virtual void ResetAttImage (Option_t *option="")
 Reset this image attributes to default values. More...
 
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. More...
 
virtual void SetConstRatio (Bool_t constRatio=kTRUE)
 Set (constRatio = kTRUE) or unset (constRadio = kFALSE) the ratio flag. More...
 
virtual void SetImageCompression (UInt_t lcompression)
 
virtual void SetImageQuality (EImageQuality lquality)
 
virtual void SetPalette (const TImagePalette *palette)
 Set a new palette for the image. More...
 
virtual void SetPaletteEnabled (Bool_t on=kTRUE)
 
virtual void StartPaletteEditor ()
 Opens a GUI to edit the color palette. More...
 

Static Public Member Functions

static UInt_t AlphaBlend (UInt_t bot, UInt_t top)
 Return alpha-blended value computed from bottom and top pixel values. More...
 
static const ASVisual * GetVisual ()
 Return visual. More...
 
static void Image2Drawable (ASImage *im, Drawable_t wid, Int_t x, Int_t y, Int_t xsrc=0, Int_t ysrc=0, UInt_t wsrc=0, UInt_t hsrc=0, Option_t *opt="")
 Draw asimage on drawable. More...
 
- Static Public Member Functions inherited from TImage
static TImageCreate ()
 Create an image. More...
 
static EImageFileTypes GetImageFileTypeFromFilename (const char *opt)
 Return the image type for the extension specified in filename. More...
 
static TImageOpen (char **data)
 Create image from XPM data array. More...
 
static TImageOpen (const char *file, EImageFileTypes type=kUnknown)
 Open a specified image file. More...
 
static TImageOpen (const char *name, const Double_t *imageData, UInt_t width, UInt_t height, TImagePalette *palette)
 Open an image with the specified data in a Double_t array. More...
 
static TImageOpen (const char *name, const TArrayD &imageData, UInt_t width, TImagePalette *palette=0)
 Open an image with the specified data in a TArrayD. More...
 
static TImageOpen (const char *name, const TVectorD &imageData, UInt_t width, TImagePalette *palette=0)
 Open an image with the specified data in a TVectorD. More...
 
- Static Public Member Functions inherited from TObject
static Long_t GetDtorOnly ()
 Return destructor only flag. More...
 
static Bool_t GetObjectStat ()
 Get status of object stat flag. More...
 
static void SetDtorOnly (void *obj)
 Set destructor only flag. More...
 
static void SetObjectStat (Bool_t stat)
 Turn on/off tracking of objects in the TObjectTable. More...
 

Protected Member Functions

EImageFileTypes GetFileType (const char *ext)
 Return file type depending on specified extension. More...
 
void MapFileTypes (EImageFileTypes &type, UInt_t &astype, Bool_t toas=kTRUE)
 Map file type to/from AfterImage types. More...
 
void MapQuality (EImageQuality &quality, UInt_t &asquality, Bool_t toas=kTRUE)
 Map quality to/from AfterImage quality. More...
 
- Protected Member Functions inherited from TImage
 TImage ()
 
 TImage (const char *file)
 
- Protected Member Functions inherited from TObject
virtual void DoError (int level, const char *location, const char *fmt, va_list va) const
 Interface to ErrorHandler (protected). More...
 
void MakeZombie ()
 

Static Protected Member Functions

static Bool_t InitVisual ()
 Static function to initialize the ASVisual. More...
 

Protected Attributes

Bool_t fEditable
 ! kTRUE image can be resized, moved by resizing/moving gPad More...
 
ASImage * fGrayImage
 ! gray image More...
 
ASImage * fImage
 ! pointer to image structure of original image More...
 
Bool_t fIsGray
 ! kTRUE if image is gray More...
 
Double_t fMaxValue
 ! max value in image More...
 
Double_t fMinValue
 ! min value in image More...
 
Int_t fPaintMode
 ! 1 - fast mode, 0 - low memory slow mode More...
 
TASImagefScaledImage
 ! temporary scaled and zoomed image produced from original image More...
 
UInt_t fZoomHeight
 ! hight of zoomed image in image pixels More...
 
UInt_t fZoomOffX
 ! X - offset for zooming in image pixels More...
 
UInt_t fZoomOffY
 ! Y - offset for zooming im image pixels More...
 
Int_t fZoomUpdate
 ! kZoom - new zooming required, kZoomOps - other ops in action, kNoZoom - no zooming or ops More...
 
UInt_t fZoomWidth
 ! width of zoomed image in image pixels More...
 
- Protected Attributes inherited from TNamed
TString fName
 
TString fTitle
 
- Protected Attributes inherited from TAttImage
Bool_t fConstRatio
 keep aspect ratio of image on the screen More...
 
UInt_t fImageCompression
 compression [0 .. 100] 0: no compression More...
 
EImageQuality fImageQuality
 OPTION={GetMethod="GetImageQuality";SetMethod="SetImageQuality";Items=(kImgDefault="Default",kImgPoor="Poor",kImgFast="Fast",kImgGood="Good",kImgBest="Best")} More...
 
TImagePalette fPalette
 color palette for value -> color conversion More...
 
TPaletteEditorfPaletteEditor
 ! GUI to edit the color palette More...
 
Bool_t fPaletteEnabled
 ! kTRUE - palette is drawn on the image More...
 

Static Protected Attributes

static Bool_t fgInit = kFALSE
 global flag to init afterimage only once More...
 
static THashTablefgPlugList = new THashTable(50)
 ! hash table containing loaded plugins More...
 
static ASVisual * fgVisual = 0
 pointer to visual structure More...
 

Private Types

enum  { kNoZoom = 0 , kZoom = 1 , kZoomOps = -1 }
 
enum  { kReadWritePNG , kReadWriteVector }
 

Private Member Functions

void CreateThumbnail ()
 Create image thumbnail. More...
 
void DestroyImage ()
 Destroy image. More...
 
void DrawDashHLine (UInt_t y, UInt_t x1, UInt_t x2, UInt_t nDash, const char *pDash, UInt_t col, UInt_t thick)
 Draw a dashed horizontal line. More...
 
void DrawDashVLine (UInt_t x, UInt_t y1, UInt_t y2, UInt_t nDash, const char *pDash, UInt_t col, UInt_t thick)
 Draw a dashed vertical line. More...
 
void DrawDashZLine (UInt_t x1, UInt_t y1, UInt_t x2, UInt_t y2, UInt_t nDash, const char *pDash, UInt_t col)
 Draw a dashed line with one pixel width. More...
 
void DrawDashZTLine (UInt_t x1, UInt_t y1, UInt_t x2, UInt_t y2, UInt_t nDash, const char *pDash, UInt_t col, UInt_t thick)
 Draw a dashed line with thick pixel width. More...
 
void DrawGlyph (void *bitmap, UInt_t color, Int_t x, Int_t y)
 Draw glyph bitmap. More...
 
void DrawHLine (UInt_t y, UInt_t x1, UInt_t x2, UInt_t col, UInt_t thick)
 Draw an horizontal line. More...
 
void DrawLineInternal (UInt_t x1, UInt_t y1, UInt_t x2, UInt_t y2, UInt_t col, UInt_t thick)
 Internal line drawing. More...
 
void DrawTextTTF (Int_t x, Int_t y, const char *text, Int_t size, UInt_t color, const char *font_name, Float_t angle)
 Draw text using TrueType fonts. More...
 
void DrawVLine (UInt_t x, UInt_t y1, UInt_t y2, UInt_t col, UInt_t thick)
 Draw a vertical line. More...
 
void DrawWideLine (UInt_t x1, UInt_t y1, UInt_t x2, UInt_t y2, UInt_t col, UInt_t thick)
 Draw wide line. More...
 
void FillRectangleInternal (UInt_t col, Int_t x, Int_t y, UInt_t width, UInt_t height)
 Fill rectangle of size (width, height) at position (x,y) within the existing image with specified color. More...
 
void GetFillAreaSpans (UInt_t npt, TPoint *ppt, UInt_t *nspans, TPoint **firstPoint, UInt_t **firstWidth)
 
Bool_t GetPolygonSpans (UInt_t npt, TPoint *ppt, UInt_t *nspans, TPoint **firstPoint, UInt_t **firstWidth)
 The code is based on Xserver/mi/mipolycon.c "Copyright 1987, 1998 The Open Group". More...
 
Int_t Idx (Int_t idx)
 Return a valid index in fImage tables to avoid seg-fault by accessing out of indices out of array's ranges. More...
 
void SetDefaults ()
 Set default parameters. More...
 
const char * TypeFromMagicNumber (const char *file)
 Guess the file type from the first byte of file. More...
 

Additional Inherited Members

- Public Types inherited from TImage
enum  ECharType { kUTF8 = 0 , kChar = 1 , kUnicode = 4 }
 
enum  EColorChan {
  kRedChan = BIT(0) , kGreenChan = BIT(1) , kBlueChan = BIT(2) , kAlphaChan = BIT(3) ,
  kAllChan = kRedChan | kGreenChan | kBlueChan | kAlphaChan
}
 
enum  ECoordMode { kCoordModeOrigin = 0 , kCoordModePrevious }
 
enum  EImageFileTypes {
  kXpm = 0 , kZCompressedXpm , kGZCompressedXpm , kPng ,
  kJpeg , kXcf , kPpm , kPnm ,
  kBmp , kIco , kCur , kGif ,
  kTiff , kXbm , kFits , kTga ,
  kXml , kUnknown , kAnimGif
}
 
enum  EText3DType {
  kPlain = 0 , kEmbossed , kSunken , kShadeAbove ,
  kShadeBelow , kEmbossedThick , kSunkenThick , kOutlineAbove ,
  kOutlineBelow , kOutlineFull , k3DTypes
}
 
enum  ETileType { kStretch = 0 , kTile , kStretchY , kStretchX }
 
- Public Types inherited from TObject
enum  {
  kIsOnHeap = 0x01000000 , kNotDeleted = 0x02000000 , kZombie = 0x04000000 , kInconsistent = 0x08000000 ,
  kBitMask = 0x00ffffff
}
 
enum  { kSingleKey = BIT(0) , kOverwrite = BIT(1) , kWriteDelete = BIT(2) }
 
enum  EDeprecatedStatusBits { kObjInCanvas = BIT(3) }
 
enum  EStatusBits {
  kCanDelete = BIT(0) , kMustCleanup = BIT(3) , kIsReferenced = BIT(4) , kHasUUID = BIT(5) ,
  kCannotPick = BIT(6) , kNoContextMenu = BIT(8) , kInvalidObject = BIT(13)
}
 
- Public Types inherited from TAttImage
enum  EImageQuality {
  kImgDefault = -1 , kImgPoor = 0 , kImgFast = 1 , kImgGood = 2 ,
  kImgBest = 3
}
 

#include <TASImage.h>

Inheritance diagram for TASImage:
[legend]

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
kNoZoom 
kZoom 
kZoomOps 

Definition at line 34 of file TASImage.h.

◆ anonymous enum

anonymous enum
private
Enumerator
kReadWritePNG 
kReadWriteVector 

Definition at line 35 of file TASImage.h.

Constructor & Destructor Documentation

◆ TASImage() [1/7]

TASImage::TASImage ( )

Default image constructor.

Definition at line 220 of file TASImage.cxx.

◆ TASImage() [2/7]

TASImage::TASImage ( UInt_t  w,
UInt_t  h 
)

Create an empty image.

Definition at line 228 of file TASImage.cxx.

◆ TASImage() [3/7]

TASImage::TASImage ( const char *  file,
EImageFileTypes  type = kUnknown 
)

Create an image object and read from specified file.

For more information see description of function ReadImage() which is called by this constructor.

Definition at line 240 of file TASImage.cxx.

◆ TASImage() [4/7]

TASImage::TASImage ( const char *  name,
const Double_t imageData,
UInt_t  width,
UInt_t  height,
TImagePalette palette = 0 
)

Create an image depending on the values of imageData.

For more information see function SetImage() which is called by this constructor.

Definition at line 253 of file TASImage.cxx.

◆ TASImage() [5/7]

TASImage::TASImage ( const char *  name,
const TArrayD imageData,
UInt_t  width,
TImagePalette palette = 0 
)

Create an image depending on the values of imageData.

The size of the image is width X (imageData.fN / width). For more information see function SetImage() which is called by this constructor.

Definition at line 266 of file TASImage.cxx.

◆ TASImage() [6/7]

TASImage::TASImage ( const char *  name,
const TVectorD imageData,
UInt_t  width,
TImagePalette palette = 0 
)

Create an image depending on the values of imageData.

The size of the image is width X (imageData.fN / width). For more information see function SetImage() which is called by this constructor.

Definition at line 279 of file TASImage.cxx.

◆ TASImage() [7/7]

TASImage::TASImage ( const TASImage img)

Image copy constructor.

Definition at line 289 of file TASImage.cxx.

◆ ~TASImage()

TASImage::~TASImage ( )
virtual

Image destructor, clean up image and visual.

Definition at line 351 of file TASImage.cxx.

Member Function Documentation

◆ AlphaBlend()

UInt_t TASImage::AlphaBlend ( UInt_t  bot,
UInt_t  top 
)
static

Return alpha-blended value computed from bottom and top pixel values.

Definition at line 5155 of file TASImage.cxx.

◆ Append()

void TASImage::Append ( const TImage im,
const char *  option = "+",
const char *  color = "#00000000" 
)
virtual

Append image.

option:

  • "+" - appends to the right side
  • "/" - appends to the bottom

Reimplemented from TImage.

Definition at line 3490 of file TASImage.cxx.

◆ BeginPaint()

void TASImage::BeginPaint ( Bool_t  mode = kTRUE)
virtual

BeginPaint initializes internal array[width x height] of ARGB32 pixel values.

That provides quick access to image during paint operations. To RLE compress image one needs to call EndPaint method when painting is over.

Reimplemented from TImage.

Definition at line 3531 of file TASImage.cxx.

◆ Bevel()

void TASImage::Bevel ( Int_t  x = 0,
Int_t  y = 0,
UInt_t  width = 0,
UInt_t  height = 0,
const char *  hi_color = "#ffdddddd",
const char *  lo_color = "#ff555555",
UShort_t  thick = 1,
Bool_t  reverse = kFALSE 
)
virtual

Bevel is used to create 3D effect while drawing buttons, or any other image that needs to be framed.

Bevel is drawn using 2 primary colors: one for top and left sides - hi color, and another for bottom and right sides - low color. Bevel can be drawn over existing image or as newly created, as it is shown in code below:

img->Bevel(0, 0, 400, 300, "#dddddd", "#000000", 3);
An abstract interface to image processing library.
Definition: TImage.h:29
static TImage * Create()
Create an image.
Definition: TImage.cxx:36
virtual void Bevel(Int_t=0, Int_t=0, UInt_t=0, UInt_t=0, const char *="#ffdddddd", const char *="#ff555555", UShort_t=1, Bool_t=kFALSE)
Definition: TImage.h:178

Reimplemented from TImage.

Definition at line 3248 of file TASImage.cxx.

◆ Blur()

void TASImage::Blur ( Double_t  hr = 3,
Double_t  vr = 3 
)
virtual

Perform Gaussian blur of the image (useful for drop shadows).

  • hr - horizontal radius of the blur
  • vr - vertical radius of the blur

Reimplemented from TImage.

Definition at line 2758 of file TASImage.cxx.

◆ Browse()

void TASImage::Browse ( TBrowser )
virtual

Browse image.

Reimplemented from TObject.

Definition at line 6262 of file TASImage.cxx.

◆ Clone()

TObject * TASImage::Clone ( const char *  newname) const
virtual

Clone image.

Reimplemented from TImage.

Definition at line 2787 of file TASImage.cxx.

◆ CopyArea()

void TASImage::CopyArea ( TImage dst,
Int_t  xsrc,
Int_t  ysrc,
UInt_t  w,
UInt_t  h,
Int_t  xdst = 0,
Int_t  ydst = 0,
Int_t  gfunc = 3,
EColorChan  chan = kAllChan 
)
virtual

Copy source region to the destination image.

Copy is done according to specified function:

kGXclear = 0, // 0
kGXand, // src AND dst
kGXandReverse, // src AND NOT dst
kGXcopy, // src (default)
kGXandInverted, // NOT src AND dst
kGXnoop, // dst
kGXxor, // src XOR dst
kGXor, // src OR dst
kGXnor, // NOT src AND NOT dst
kGXequiv, // NOT src XOR dst
kGXinvert, // NOT dst
kGXorReverse, // src OR NOT dst
kGXcopyInverted, // NOT src
kGXorInverted, // NOT src OR dst
kGXnand, // NOT src OR NOT dst
kGXset // 1
};
EGraphicsFunction
Definition: GuiTypes.h:66
@ kGXorReverse
Definition: GuiTypes.h:78
@ kGXnand
Definition: GuiTypes.h:81
@ kGXandReverse
Definition: GuiTypes.h:69
@ kGXor
Definition: GuiTypes.h:74
@ kGXcopy
Definition: GuiTypes.h:70
@ kGXorInverted
Definition: GuiTypes.h:80
@ kGXandInverted
Definition: GuiTypes.h:71
@ kGXequiv
Definition: GuiTypes.h:76
@ kGXset
Definition: GuiTypes.h:82
@ kGXnor
Definition: GuiTypes.h:75
@ kGXnoop
Definition: GuiTypes.h:72
@ kGXinvert
Definition: GuiTypes.h:77
@ kGXxor
Definition: GuiTypes.h:73
@ kGXand
Definition: GuiTypes.h:68
@ kGXclear
Definition: GuiTypes.h:67
@ kGXcopyInverted
Definition: GuiTypes.h:79

Reimplemented from TImage.

Definition at line 5012 of file TASImage.cxx.

◆ CreateThumbnail()

void TASImage::CreateThumbnail ( )
private

Create image thumbnail.

Definition at line 6086 of file TASImage.cxx.

◆ Crop()

void TASImage::Crop ( Int_t  x = 0,
Int_t  y = 0,
UInt_t  width = 0,
UInt_t  height = 0 
)
virtual

Crop an image.

Reimplemented from TImage.

Definition at line 3413 of file TASImage.cxx.

◆ CropPolygon()

void TASImage::CropPolygon ( UInt_t  npt,
TPoint ppt 
)
virtual

Crop a convex polygon.

Reimplemented from TImage.

Definition at line 5404 of file TASImage.cxx.

◆ CropSpans()

void TASImage::CropSpans ( UInt_t  npt,
TPoint ppt,
UInt_t widths 
)
virtual

Crop spans.

Reimplemented from TImage.

Definition at line 4924 of file TASImage.cxx.

◆ DestroyImage()

void TASImage::DestroyImage ( )
private

Destroy image.

Definition at line 175 of file TASImage.cxx.

◆ DistancetoPrimitive()

Int_t TASImage::DistancetoPrimitive ( Int_t  px,
Int_t  py 
)
virtual

Is the mouse in the image ?

Reimplemented from TObject.

Definition at line 1678 of file TASImage.cxx.

◆ Draw()

void TASImage::Draw ( Option_t option = "")
virtual

Draw image.

Support the following drawing options:

  • "T[x,y[,tint]]" : tile image (use specified offset and tint), e.g. "T100,100,#556655" with this option the zooming is not possible and disabled
  • "N" : display in new canvas (of original image size)
  • "X" : image is drawn expanded to pad size
  • "Z" : image is vectorized and image palette is drawn

The default is to display the image in the current gPad.

Reimplemented from TObject.

Definition at line 1167 of file TASImage.cxx.

◆ DrawBox()

void TASImage::DrawBox ( Int_t  x1,
Int_t  y1,
Int_t  x2,
Int_t  y2,
const char *  col = "#000000",
UInt_t  thick = 1,
Int_t  mode = 0 
)
virtual

Draw a box.

Reimplemented from TImage.

Definition at line 4120 of file TASImage.cxx.

◆ DrawCellArray()

void TASImage::DrawCellArray ( Int_t  x1,
Int_t  y1,
Int_t  x2,
Int_t  y2,
Int_t  nx,
Int_t  ny,
UInt_t ic 
)
virtual

Draw a cell array.

Parameters
[in]x1,y1: left down corner
[in]x2,y2: right up corner
[in]nx,ny: array size
[in]ic: array of ARGB32 colors

Draw a cell array. The drawing is done with the pixel precision if (X2-X1)/NX (or Y) is not a exact pixel number the position of the top right corner may be wrong.

Reimplemented from TImage.

Definition at line 5126 of file TASImage.cxx.

◆ DrawCircle()

void TASImage::DrawCircle ( Int_t  x,
Int_t  y,
Int_t  r,
const char *  col = "#000000",
Int_t  thick = 1 
)
virtual

Draw a circle.

If thick < 0 - draw filled circle

Reimplemented from TImage.

Definition at line 6395 of file TASImage.cxx.

◆ DrawCubeBezier()

void TASImage::DrawCubeBezier ( Int_t  x1,
Int_t  y1,
Int_t  x2,
Int_t  y2,
Int_t  x3,
Int_t  y3,
const char *  col = "#000000",
UInt_t  thick = 1 
)
virtual

Draw a cubic bezier line.

Reimplemented from TImage.

Definition at line 6314 of file TASImage.cxx.

◆ DrawDashHLine()

void TASImage::DrawDashHLine ( UInt_t  y,
UInt_t  x1,
UInt_t  x2,
UInt_t  nDash,
const char *  pDash,
UInt_t  col,
UInt_t  thick 
)
private

Draw a dashed horizontal line.

Definition at line 4169 of file TASImage.cxx.

◆ DrawDashLine()

void TASImage::DrawDashLine ( UInt_t  x1,
UInt_t  y1,
UInt_t  x2,
UInt_t  y2,
UInt_t  nDash,
const char *  pDash,
const char *  col = "#000000",
UInt_t  thick = 1 
)
virtual

Draw a dashed line.

Reimplemented from TImage.

Definition at line 4622 of file TASImage.cxx.

◆ DrawDashVLine()

void TASImage::DrawDashVLine ( UInt_t  x,
UInt_t  y1,
UInt_t  y2,
UInt_t  nDash,
const char *  pDash,
UInt_t  col,
UInt_t  thick 
)
private

Draw a dashed vertical line.

Definition at line 4223 of file TASImage.cxx.

◆ DrawDashZLine()

void TASImage::DrawDashZLine ( UInt_t  x1,
UInt_t  y1,
UInt_t  x2,
UInt_t  y2,
UInt_t  nDash,
const char *  pDash,
UInt_t  col 
)
private

Draw a dashed line with one pixel width.

Definition at line 4280 of file TASImage.cxx.

◆ DrawDashZTLine()

void TASImage::DrawDashZTLine ( UInt_t  x1,
UInt_t  y1,
UInt_t  x2,
UInt_t  y2,
UInt_t  nDash,
const char *  pDash,
UInt_t  col,
UInt_t  thick 
)
private

Draw a dashed line with thick pixel width.

Definition at line 4464 of file TASImage.cxx.

◆ DrawEllips()

void TASImage::DrawEllips ( Int_t  x,
Int_t  y,
Int_t  rx,
Int_t  ry,
Int_t  angle,
const char *  col = "#000000",
Int_t  thick = 1 
)
virtual

Draw an ellipse.

If thick < 0 - draw filled ellips

Reimplemented from TImage.

Definition at line 6435 of file TASImage.cxx.

◆ DrawEllips2()

void TASImage::DrawEllips2 ( Int_t  x,
Int_t  y,
Int_t  rx,
Int_t  ry,
Int_t  angle,
const char *  col = "#000000",
Int_t  thick = 1 
)
virtual

Draw an ellipse.

If thick < 0 - draw filled ellipse.

Reimplemented from TImage.

Definition at line 6475 of file TASImage.cxx.

◆ DrawFillArea() [1/2]

void TASImage::DrawFillArea ( UInt_t  npt,
TPoint ppt,
const char *  col = "#000000",
const char *  stipple = 0,
UInt_t  w = 16,
UInt_t  h = 16 
)
virtual

Fill a polygon (any type convex, non-convex).

Reimplemented from TImage.

Definition at line 5430 of file TASImage.cxx.

◆ DrawFillArea() [2/2]

void TASImage::DrawFillArea ( UInt_t  npt,
TPoint ppt,
TImage tile 
)
virtual

Fill a polygon (any type convex, non-convex).

Reimplemented from TImage.

Definition at line 5544 of file TASImage.cxx.

◆ DrawGlyph()

void TASImage::DrawGlyph ( void bitmap,
UInt_t  color,
Int_t  x,
Int_t  y 
)
private

Draw glyph bitmap.

Definition at line 5711 of file TASImage.cxx.

◆ DrawHLine()

void TASImage::DrawHLine ( UInt_t  y,
UInt_t  x1,
UInt_t  x2,
UInt_t  col,
UInt_t  thick 
)
private

Draw an horizontal line.

Definition at line 3873 of file TASImage.cxx.

◆ DrawLine()

void TASImage::DrawLine ( UInt_t  x1,
UInt_t  y1,
UInt_t  x2,
UInt_t  y2,
const char *  col = "#000000",
UInt_t  thick = 1 
)
virtual

Draw a line.

Reimplemented from TImage.

Definition at line 3908 of file TASImage.cxx.

◆ DrawLineInternal()

void TASImage::DrawLineInternal ( UInt_t  x1,
UInt_t  y1,
UInt_t  x2,
UInt_t  y2,
UInt_t  col,
UInt_t  thick 
)
private

Internal line drawing.

Definition at line 3919 of file TASImage.cxx.

◆ DrawPolyLine()

void TASImage::DrawPolyLine ( UInt_t  nn,
TPoint xy,
const char *  col = "#000000",
UInt_t  thick = 1,
TImage::ECoordMode  mode = kCoordModeOrigin 
)
virtual

Draw a polyline.

Reimplemented from TImage.

Definition at line 4666 of file TASImage.cxx.

◆ DrawRectangle()

void TASImage::DrawRectangle ( UInt_t  x,
UInt_t  y,
UInt_t  w,
UInt_t  h,
const char *  col = "#000000",
UInt_t  thick = 1 
)
virtual

Draw a rectangle.

Reimplemented from TImage.

Definition at line 4080 of file TASImage.cxx.

◆ DrawSegments()

void TASImage::DrawSegments ( UInt_t  nseg,
Segment_t seg,
const char *  col = "#000000",
UInt_t  thick = 1 
)
virtual

Draw segments.

Reimplemented from TImage.

Definition at line 4786 of file TASImage.cxx.

◆ DrawStraightEllips()

void TASImage::DrawStraightEllips ( Int_t  x,
Int_t  y,
Int_t  rx,
Int_t  ry,
const char *  col = "#000000",
Int_t  thick = 1 
)
virtual

Draw a straight ellipse.

If thick < 0 - draw filled ellipse.

Reimplemented from TImage.

Definition at line 6355 of file TASImage.cxx.

◆ DrawText() [1/2]

void TASImage::DrawText ( Int_t  x = 0,
Int_t  y = 0,
const char *  text = "",
Int_t  size = 12,
const char *  color = 0,
const char *  font_name = "fixed",
EText3DType  type = TImage::kPlain,
const char *  fore_file = 0,
Float_t  angle = 0 
)
virtual

Draw text of size (in pixels for TrueType fonts) at position (x, y) with color specified by hex string.

  • font_name: TrueType font's filename or X font spec or alias. 3D style of text is one of the following:
    • 0 plain 2D text,
    • 1 embossed,
    • 2 sunken,
    • 3 shade above,
    • 4 shade below,
    • 5 embossed thick,
    • 6 sunken thick.
    • 7 outline above,
    • 8 ouline below,
    • 9 full ouline.
  • fore_file specifies foreground texture of text.

Reimplemented from TImage.

Definition at line 2578 of file TASImage.cxx.

◆ DrawText() [2/2]

void TASImage::DrawText ( TText text,
Int_t  x = 0,
Int_t  y = 0 
)
virtual

Draw text at the pixel position (x,y).

Reimplemented from TImage.

Definition at line 5809 of file TASImage.cxx.

◆ DrawTextTTF()

void TASImage::DrawTextTTF ( Int_t  x,
Int_t  y,
const char *  text,
Int_t  size,
UInt_t  color,
const char *  font_name,
Float_t  angle 
)
private

Draw text using TrueType fonts.

Definition at line 5952 of file TASImage.cxx.

◆ DrawVLine()

void TASImage::DrawVLine ( UInt_t  x,
UInt_t  y1,
UInt_t  y2,
UInt_t  col,
UInt_t  thick 
)
private

Draw a vertical line.

Definition at line 3838 of file TASImage.cxx.

◆ DrawWideLine()

void TASImage::DrawWideLine ( UInt_t  x1,
UInt_t  y1,
UInt_t  x2,
UInt_t  y2,
UInt_t  col,
UInt_t  thick 
)
private

Draw wide line.

Definition at line 5664 of file TASImage.cxx.

◆ EndPaint()

void TASImage::EndPaint ( )
virtual

EndPaint does internal RLE compression of image data.

Reimplemented from TImage.

Definition at line 3563 of file TASImage.cxx.

◆ ExecuteEvent()

void TASImage::ExecuteEvent ( Int_t  event,
Int_t  px,
Int_t  py 
)
virtual

Execute mouse events.

Reimplemented from TObject.

Definition at line 1701 of file TASImage.cxx.

◆ FillPolygon() [1/2]

void TASImage::FillPolygon ( UInt_t  npt,
TPoint ppt,
const char *  col = "#000000",
const char *  stipple = 0,
UInt_t  w = 16,
UInt_t  h = 16 
)
virtual

Fill a convex polygon with background color or bitmap.

For non convex polygon one must use DrawFillArea method

Reimplemented from TImage.

Definition at line 5348 of file TASImage.cxx.

◆ FillPolygon() [2/2]

void TASImage::FillPolygon ( UInt_t  npt,
TPoint ppt,
TImage tile 
)
virtual

Fill a convex polygon with background image.

For non convex polygon one must use DrawFillArea method

Reimplemented from TImage.

Definition at line 5380 of file TASImage.cxx.

◆ FillRectangle()

void TASImage::FillRectangle ( const char *  col = 0,
Int_t  x = 0,
Int_t  y = 0,
UInt_t  width = 0,
UInt_t  height = 0 
)
virtual

Fill rectangle of size (width, height) at position (x,y) within the existing image with specified color.

To create new image with Fill method the following code can be used:

img->Fill("#FF00FF", 0, 0, 400, 300);

Reimplemented from TImage.

Definition at line 3812 of file TASImage.cxx.

◆ FillRectangleInternal()

void TASImage::FillRectangleInternal ( UInt_t  col,
Int_t  x,
Int_t  y,
UInt_t  width,
UInt_t  height 
)
private

Fill rectangle of size (width, height) at position (x,y) within the existing image with specified color.

Definition at line 3734 of file TASImage.cxx.

◆ FillSpans() [1/2]

void TASImage::FillSpans ( UInt_t  npt,
TPoint ppt,
UInt_t widths,
const char *  col = "#000000",
const char *  stipple = 0,
UInt_t  w = 16,
UInt_t  h = 16 
)
virtual

Fill spans with specified color or/and stipple.

Reimplemented from TImage.

Definition at line 4809 of file TASImage.cxx.

◆ FillSpans() [2/2]

void TASImage::FillSpans ( UInt_t  npt,
TPoint ppt,
UInt_t widths,
TImage tile 
)
virtual

Fill spans with tile image.

Reimplemented from TImage.

Definition at line 4868 of file TASImage.cxx.

◆ Flip()

void TASImage::Flip ( Int_t  flip = 180)
virtual

Flip image in place.

Flip is either 90, 180, 270, 180 is default. This function manipulates the original image and destroys the scaled and zoomed image which will be recreated at the next call of the Draw function. If the image is zoomed the zoom - coordinates are now relative to the new image. This function cannot be used for images which were created with the SetImage() functions, because the original pixel values would be destroyed.

Reimplemented from TImage.

Definition at line 2071 of file TASImage.cxx.

◆ FloodFill()

void TASImage::FloodFill ( Int_t  x,
Int_t  y,
const char *  col,
const char *  min_col,
const char *  max_col = 0 
)
virtual

Flood fill.

Reimplemented from TImage.

Definition at line 6514 of file TASImage.cxx.

◆ FromGLBuffer()

void TASImage::FromGLBuffer ( UChar_t buf,
UInt_t  w,
UInt_t  h 
)
virtual

Creates an image (screenshot) from a RGBA buffer.

Reimplemented from TImage.

Definition at line 6688 of file TASImage.cxx.

◆ FromPad()

void TASImage::FromPad ( TVirtualPad pad,
Int_t  x = 0,
Int_t  y = 0,
UInt_t  w = 0,
UInt_t  h = 0 
)
virtual

Create an image from the given pad, afterwards this image can be saved in any of the supported image formats.

Reimplemented from TImage.

Definition at line 1071 of file TASImage.cxx.

◆ FromWindow()

void TASImage::FromWindow ( Drawable_t  wid,
Int_t  x = 0,
Int_t  y = 0,
UInt_t  w = 0,
UInt_t  h = 0 
)
virtual

Create an image (screenshot) from specified window.

Reimplemented from TImage.

Definition at line 6636 of file TASImage.cxx.

◆ GetArgbArray()

UInt_t * TASImage::GetArgbArray ( )
virtual

Return a pointer to internal array[width x height] of ARGB32 values This array is directly accessible.

That allows to manipulate/change the image.

Reimplemented from TImage.

Definition at line 3590 of file TASImage.cxx.

◆ GetArray()

TArrayD * TASImage::GetArray ( UInt_t  w = 0,
UInt_t  h = 0,
TImagePalette palette = gWebImagePalette 
)
virtual

In case of vectorized image return an associated array of doubles otherwise this method creates and returns a 2D array of doubles corresponding to palette.

If palette is ZERO a color converted to double value [0, 1] according to formula

Double_t((r << 16) + (g << 8) + b)/0xFFFFFF
ROOT::R::TRInterface & r
Definition: Object.C:4
#define b(i)
Definition: RSha256.hxx:100
#define g(i)
Definition: RSha256.hxx:105
double Double_t
Definition: RtypesCore.h:55

The returned array must be deleted after usage.

Reimplemented from TImage.

Definition at line 2500 of file TASImage.cxx.

◆ GetFileType()

TImage::EImageFileTypes TASImage::GetFileType ( const char *  ext)
protected

Return file type depending on specified extension.

Protected method.

Definition at line 818 of file TASImage.cxx.

◆ GetFillAreaSpans()

void TASImage::GetFillAreaSpans ( UInt_t  npt,
TPoint ppt,
UInt_t nspans,
TPoint **  firstPoint,
UInt_t **  firstWidth 
)
private

◆ GetHeight()

UInt_t TASImage::GetHeight ( ) const
virtual

Return height of original image not of the displayed image.

(Number of image pixels)

Reimplemented from TImage.

Definition at line 2157 of file TASImage.cxx.

◆ GetIconName()

const char * TASImage::GetIconName ( ) const
inlinevirtual

Returns mime type name of object.

Used by the TBrowser (via TGMimeTypes class). Override for class of which you would like to have different icons for objects of the same class.

Reimplemented from TObject.

Definition at line 99 of file TASImage.h.

◆ GetImage()

ASImage * TASImage::GetImage ( ) const
inline

Definition at line 186 of file TASImage.h.

◆ GetImageBuffer()

void TASImage::GetImageBuffer ( char **  buffer,
int *  size,
EImageFileTypes  type = TImage::kPng 
)
virtual

Return in-memory buffer compressed according image type.

Buffer must be deallocated after usage. This method can be used for sending images over network.

Reimplemented from TImage.

Definition at line 5987 of file TASImage.cxx.

◆ GetMask()

Pixmap_t TASImage::GetMask ( )
virtual

Returns image mask pixmap (alpha channel).

The pixmap must deleted by user.

Reimplemented from TImage.

Definition at line 2300 of file TASImage.cxx.

◆ GetObjectInfo()

char * TASImage::GetObjectInfo ( Int_t  px,
Int_t  py 
) const
virtual

Get image pixel coordinates and the pixel value at the mouse pointer.

Reimplemented from TObject.

Definition at line 1814 of file TASImage.cxx.

◆ GetPixels()

TArrayL * TASImage::GetPixels ( Int_t  x = 0,
Int_t  y = 0,
UInt_t  w = 0,
UInt_t  h = 0 
)
virtual

Return 2D array of machine dependent pixel values.

Reimplemented from TImage.

Definition at line 2406 of file TASImage.cxx.

◆ GetPixmap()

Pixmap_t TASImage::GetPixmap ( )
virtual

Returns image pixmap.

The pixmap must deleted by user.

Reimplemented from TImage.

Definition at line 2268 of file TASImage.cxx.

◆ GetPolygonSpans()

Bool_t TASImage::GetPolygonSpans ( UInt_t  npt,
TPoint ppt,
UInt_t nspans,
TPoint **  firstPoint,
UInt_t **  firstWidth 
)
private

The code is based on Xserver/mi/mipolycon.c "Copyright 1987, 1998 The Open Group".

Definition at line 5203 of file TASImage.cxx.

◆ GetRgbaArray()

UInt_t * TASImage::GetRgbaArray ( )
virtual

Return a pointer to an array[width x height] of RGBA32 values.

This array is created from internal ARGB32 array, must be deleted after usage.

Reimplemented from TImage.

Definition at line 3618 of file TASImage.cxx.

◆ GetScaledHeight()

UInt_t TASImage::GetScaledHeight ( ) const

Return height of the displayed image not of the original image.

(Number of screen pixels)

Definition at line 2175 of file TASImage.cxx.

◆ GetScaledImage()

TImage * TASImage::GetScaledImage ( ) const
inlinevirtual

Reimplemented from TImage.

Definition at line 188 of file TASImage.h.

◆ GetScaledWidth()

UInt_t TASImage::GetScaledWidth ( ) const

Return width of the displayed image not of the original image.

(Number of screen pixels)

Definition at line 2166 of file TASImage.cxx.

◆ GetScanline()

UInt_t * TASImage::GetScanline ( UInt_t  y)
virtual

Return a pointer to scan-line.

Reimplemented from TImage.

Definition at line 3664 of file TASImage.cxx.

◆ GetTitle()

const char * TASImage::GetTitle ( ) const
virtual

Title is used to keep 32x32 xpm image's thumbnail.

Reimplemented from TNamed.

Definition at line 6275 of file TASImage.cxx.

◆ GetVecArray()

Double_t * TASImage::GetVecArray ( )
virtual

Return a pointer to internal array[width x height] of double values [0,1].

This array is directly accessible. That allows to manipulate/change the image.

Reimplemented from TImage.

Definition at line 2478 of file TASImage.cxx.

◆ GetVisual()

const ASVisual * TASImage::GetVisual ( )
static

Return visual.

Definition at line 5166 of file TASImage.cxx.

◆ GetWidth()

UInt_t TASImage::GetWidth ( ) const
virtual

Return width of original image not of the displayed image.

(Number of image pixels)

Reimplemented from TImage.

Definition at line 2148 of file TASImage.cxx.

◆ GetZoomPosition()

void TASImage::GetZoomPosition ( UInt_t x,
UInt_t y,
UInt_t w,
UInt_t h 
) const

Return the zoom parameters.

This is useful when the zoom has been done interactively using the mouse.

Definition at line 2184 of file TASImage.cxx.

◆ Gradient()

void TASImage::Gradient ( UInt_t  angle = 0,
const char *  colors = "#FFFFFF #000000",
const char *  offsets = 0,
Int_t  x = 0,
Int_t  y = 0,
UInt_t  width = 0,
UInt_t  height = 0 
)
virtual

Render multipoint gradient inside rectangle of size (width, height) at position (x,y) within the existing image.

Parameters
[in]angleGiven in degrees. Default is 0. This is the direction of the gradient. Currently the only supported values are 0, 45, 90, 135, 180, 225, 270, 315. 0 means left to right, 90 means top to bottom, etc.
[in]colorsWhitespace-separated list of colors. At least two colors are required. Each color in this list will be visited in turn, at the intervals given by the offsets attribute.
[in]offsetsWhitespace-separated list of floating point values ranging from 0.0 to 1.0. The colors from the colors attribute are given these offsets, and the final gradient is rendered from the combination of the two. If both colors and offsets are given but the number of colors and offsets do not match, the minimum of the two will be used, and the other will be truncated to match. If offsets are not given, a smooth stepping from 0.0 to 1.0 will be used.

Reimplemented from TImage.

Definition at line 3008 of file TASImage.cxx.

◆ Gray()

void TASImage::Gray ( Bool_t  on = kTRUE)
virtual

Convert RGB image to Gray image and vice versa.

Reimplemented from TImage.

Definition at line 6522 of file TASImage.cxx.

◆ HSV()

void TASImage::HSV ( UInt_t  hue = 0,
UInt_t  radius = 360,
Int_t  H = 0,
Int_t  S = 0,
Int_t  V = 0,
Int_t  x = 0,
Int_t  y = 0,
UInt_t  width = 0,
UInt_t  height = 0 
)
virtual

This function will tile original image to specified size with offsets requested, and then it will go though it and adjust hue, saturation and value of those pixels that have specific hue, set by affected_hue/ affected_radius parameters.

When affected_radius is greater then 180 entire image will be adjusted. Note that since grayscale colors have no hue - the will not get adjusted. Only saturation and value will be adjusted in gray pixels.

Hue is measured as an angle on a 360 degree circle, The following is relationship of hue values to regular color names :

  • red - 0
  • yellow - 60
  • green - 120
  • cyan - 180
  • blue - 240
  • magenta - 300
  • red - 360

All the hue values in parameters will be adjusted to fall within 0-360 range.

Parameters
[in]huehue in degrees in range 0-360. This allows to limit impact of color adjustment to affect only limited range of hues.
[in]radiusvalue in degrees to be used in order to calculate the range of affected hues. Range is determined by substracting and adding this value from/to affected_hue.
[in]Hvalue by which to change hues in affected range.
[in]Svalue by which to change saturation of the pixels in affected hue range.
[in]Vvalue by which to change Value(brightness) of pixels in affected hue range.
[in]x,yposition on infinite surface tiled with original image, of the left-top corner of the area to be used for new image.
[in]width,heightsize of the area of the original image to be used for new image. Default is current width, height of the image.

Reimplemented from TImage.

Definition at line 2945 of file TASImage.cxx.

◆ Idx()

Int_t TASImage::Idx ( Int_t  idx)
inlineprivate

Return a valid index in fImage tables to avoid seg-fault by accessing out of indices out of array's ranges.

Definition at line 6838 of file TASImage.cxx.

◆ Image2Drawable()

void TASImage::Image2Drawable ( ASImage *  im,
Drawable_t  wid,
Int_t  x,
Int_t  y,
Int_t  xsrc = 0,
Int_t  ysrc = 0,
UInt_t  wsrc = 0,
UInt_t  hsrc = 0,
Option_t opt = "" 
)
static

Draw asimage on drawable.

Definition at line 1219 of file TASImage.cxx.

◆ InitVisual()

Bool_t TASImage::InitVisual ( )
staticprotected

Static function to initialize the ASVisual.

Definition at line 2195 of file TASImage.cxx.

◆ IsEditable()

Bool_t TASImage::IsEditable ( ) const
inlinevirtual

Reimplemented from TImage.

Definition at line 95 of file TASImage.h.

◆ IsGray()

Bool_t TASImage::IsGray ( ) const
inlinevirtual

Reimplemented from TImage.

Definition at line 185 of file TASImage.h.

◆ IsValid()

Bool_t TASImage::IsValid ( ) const
inlinevirtual

Reimplemented from TImage.

Definition at line 184 of file TASImage.h.

◆ MapFileTypes()

void TASImage::MapFileTypes ( EImageFileTypes type,
UInt_t astype,
Bool_t  toas = kTRUE 
)
protected

Map file type to/from AfterImage types.

Protected method.

Definition at line 862 of file TASImage.cxx.

◆ MapQuality()

void TASImage::MapQuality ( EImageQuality quality,
UInt_t asquality,
Bool_t  toas = kTRUE 
)
protected

Map quality to/from AfterImage quality.

Protected method.

Definition at line 947 of file TASImage.cxx.

◆ Merge()

void TASImage::Merge ( const TImage im,
const char *  op = "alphablend",
Int_t  x = 0,
Int_t  y = 0 
)
virtual

Merge two images.

op is string which specifies overlay operation. Supported operations are:

  • add - color addition with saturation
  • alphablend - alpha-blending
  • allanon - color values averaging
  • colorize - hue and saturate bottom image same as top image
  • darken - use lowest color value from both images
  • diff - use absolute value of the color difference between two images
  • dissipate - randomly alpha-blend images
  • hue - hue bottom image same as top image
  • lighten - use highest color value from both images
  • overlay - some weird image overlaying(see GIMP)
  • saturate - saturate bottom image same as top image
  • screen - another weird image overlaying(see GIMP)
  • sub - color substraction with saturation
  • tint - tinting image with image
  • value - value bottom image same as top image

Reimplemented from TImage.

Definition at line 2719 of file TASImage.cxx.

◆ Mirror()

void TASImage::Mirror ( Bool_t  vert = kTRUE)
virtual

Mirror image in place.

If vert is true mirror in vertical axis, horizontal otherwise. Vertical is default. This function manipulates the original image and destroys the scaled and zoomed image which will be recreated at the next call of the Draw function. If the image is zoomed the zoom - coordinates are now relative to the new image. This function cannot be used for images which were created with the SetImage() functions, because the original pixel values would be destroyed.

Reimplemented from TImage.

Definition at line 2118 of file TASImage.cxx.

◆ operator=()

TASImage & TASImage::operator= ( const TASImage img)

Image assignment operator.

Definition at line 317 of file TASImage.cxx.

◆ Pad()

void TASImage::Pad ( const char *  color = "#00FFFFFF",
UInt_t  left = 0,
UInt_t  right = 0,
UInt_t  top = 0,
UInt_t  bottom = 0 
)
virtual

Enlarge image, padding it with specified color on each side in accordance with requested geometry.

Reimplemented from TImage.

Definition at line 3364 of file TASImage.cxx.

◆ Paint()

void TASImage::Paint ( Option_t option = "")
virtual

Paint image.

Support the following drawing options:

  • "T[x,y[,tint]]" : tile image (use specified offset and tint), e.g. "T100,100,#556655" with this option the zooming is not possible and disabled
  • "N" : display in new canvas (of original image size)
  • "X" : image is drawn expanded to pad size
  • "Z" : image is vectorized and image palette is drawn

The default is to display the image in the current gPad.

Reimplemented from TObject.

Definition at line 1361 of file TASImage.cxx.

◆ PaintImage()

void TASImage::PaintImage ( Drawable_t  wid,
Int_t  x,
Int_t  y,
Int_t  xsrc = 0,
Int_t  ysrc = 0,
UInt_t  wsrc = 0,
UInt_t  hsrc = 0,
Option_t opt = "" 
)
virtual

Draw image on the drawable wid (pixmap, window) at x,y position.

Parameters
[in]wid: Drawable (pixmap or window) on which image is drawn.
[in]x,y: Window coordinates where image is drawn.
[in]xsrc,ysrc: X and Y coordinates of an image area to be drawn.
[in]wsrc,hsrc: Width and height image area to be drawn.

Reimplemented from TImage.

Definition at line 1341 of file TASImage.cxx.

◆ PolyPoint()

void TASImage::PolyPoint ( UInt_t  npt,
TPoint ppt,
const char *  col = "#000000",
TImage::ECoordMode  mode = kCoordModeOrigin 
)
virtual

Draw a poly point.

Reimplemented from TImage.

Definition at line 4726 of file TASImage.cxx.

◆ PutPixel()

void TASImage::PutPixel ( Int_t  x,
Int_t  y,
const char *  col = "#000000" 
)
virtual

Draw a point at the specified position.

Reimplemented from TImage.

Definition at line 4691 of file TASImage.cxx.

◆ ReadImage()

void TASImage::ReadImage ( const char *  filename,
EImageFileTypes  type = TImage::kUnknown 
)
virtual

Read specified image file.

The file type is determined by the file extension (the type argument is ignored). It will attempt to append .gz and then .Z to the filename and find such a file. If the filename ends with extension consisting of digits only, it will attempt to find the file with this extension stripped off. On success this extension will be used to load subimage from the file with that number. Subimage is supported for GIF files (ICO, BMP, CUR, TIFF, XCF to be supported in future). For example,

i1 = TImage::Open("anim.gif.0"); // read the first subimage
i4 = TImage::Open("anim.gif.3"); // read the forth subimage
static TImage * Open(const char *file, EImageFileTypes type=kUnknown)
Open a specified image file.
Definition: TImage.cxx:110

It is also possible to put XPM raw string (see also SetImageBuffer) as the first input parameter ("filename"), such string is returned by GetImageBuffer method.

Reimplemented from TImage.

Definition at line 478 of file TASImage.cxx.

◆ SavePrimitive()

void TASImage::SavePrimitive ( std::ostream &  out,
Option_t option = "" 
)
virtual

Save a primitive as a C++ statement(s) on output stream "out".

Reimplemented from TObject.

Definition at line 6738 of file TASImage.cxx.

◆ Scale()

void TASImage::Scale ( UInt_t  toWidth,
UInt_t  toHeight 
)
virtual

Scale the original image.

The size of the image on the screen does not change because it is defined by the size of the pad. This function can be used to change the size of an image before writing it into a file. The colors of the new pixels are interpolated. An image created with the SetImage() functions cannot be modified with the function SetPalette() any more after a call of this function!

Reimplemented from TImage.

Definition at line 1911 of file TASImage.cxx.

◆ SetDefaults()

void TASImage::SetDefaults ( )
private

Set default parameters.

Definition at line 193 of file TASImage.cxx.

◆ SetEditable()

void TASImage::SetEditable ( Bool_t  on = kTRUE)
inlinevirtual

Reimplemented from TImage.

Definition at line 94 of file TASImage.h.

◆ SetImage() [1/5]

void TASImage::SetImage ( ASImage *  image)
inline

Definition at line 187 of file TASImage.h.

◆ SetImage() [2/5]

void TASImage::SetImage ( const Double_t imageData,
UInt_t  width,
UInt_t  height,
TImagePalette palette = 0 
)
virtual

Deletes the old image and creates a new image depending on the values of imageData.

The size of the image is width X height.

The color of each pixel depends on the imageData of the corresponding pixel. The palette is used to convert an image value into its color. If palette is not defined (palette = 0) a default palette is used. Any previously defined zooming is reset.

Reimplemented from TImage.

Definition at line 984 of file TASImage.cxx.

◆ SetImage() [3/5]

void TASImage::SetImage ( const TArrayD imageData,
UInt_t  width,
TImagePalette palette = 0 
)
virtual

Delete the old image and creates a new image depending on the values of imageData.

The size of the image is width X (imageData.fN / width). The color of each pixel depends on the imageData of the corresponding pixel. The palette is used to convert an image value into its color. If palette is not defined (palette = 0) a default palette is used. Any previously defined zooming is reset.

Reimplemented from TImage.

Definition at line 1048 of file TASImage.cxx.

◆ SetImage() [4/5]

void TASImage::SetImage ( const TVectorD imageData,
UInt_t  width,
TImagePalette palette = 0 
)
virtual

Delete the old image and creates a new image depending on the values of imageData.

The size of the image is width X (imageData.fN / width). The color of each pixel depends on the imageData of the corresponding pixel. The palette is used to convert an image value into its color. If palette is not defined (palette = 0) a default palette is used. Any previously defined zooming is reset.

Reimplemented from TImage.

Definition at line 1061 of file TASImage.cxx.

◆ SetImage() [5/5]

void TASImage::SetImage ( Pixmap_t  pxm,
Pixmap_t  mask = 0 
)
virtual

Create image from pixmap.

Reimplemented from TImage.

Definition at line 2362 of file TASImage.cxx.

◆ SetImageBuffer()

Bool_t TASImage::SetImageBuffer ( char **  buffer,
EImageFileTypes  type = TImage::kPng 
)
virtual

Create image from compressed buffer.

Supported formats:

  • PNG - by default
  • XPM - two options exist:
    1. xpm as a single string (raw buffer). Such string is returned by GetImageBuffer method. For example:
      char *buf;
      int sz;
      im1->GetImageBuffer(&buf, &int, TImage::kXpm); /*raw buffer*&zwj;/
      TImage *im2 = TImage::Create();
      im2->SetImageBuffer(&buf, TImage::kXpm);
      @ kXpm
      Definition: TImage.h:37
    2. xpm as an array of strings (pre-parsed)
      For example:
      char *xpm[] = {
      "64 28 58 1",
      " c #0A030C",
      ". c #1C171B"
      ...
      TImage *im = TImage::Create();
      im->SetImageBuffer(xpm, TImage::kXpm);
      void example()
      Definition: example.C:26

Reimplemented from TImage.

Definition at line 6039 of file TASImage.cxx.

◆ SetJpegDpi()

Bool_t TASImage::SetJpegDpi ( const char *  name,
UInt_t  set = 72 
)

Set an image printing resolution in Dots Per Inch units.

Parameters
[in]name- the name of jpeg file.
[in]set- dpi resolution.

Returns kFALSE in case of error.

Definition at line 6782 of file TASImage.cxx.

◆ SetPalette()

void TASImage::SetPalette ( const TImagePalette palette)
virtual

Set a new palette to an image.

Only images that were created with the SetImage() functions can be modified with this function. The previously used palette is destroyed.

Reimplemented from TAttImage.

Definition at line 1855 of file TASImage.cxx.

◆ SetPaletteEnabled()

void TASImage::SetPaletteEnabled ( Bool_t  on = kTRUE)
virtual

Switch on/off the image palette.

That also invokes calling vectorization of image.

Reimplemented from TAttImage.

Definition at line 6709 of file TASImage.cxx.

◆ SetTitle()

void TASImage::SetTitle ( const char *  title = "")
virtual

Set a title for an image.

Reimplemented from TNamed.

Definition at line 6293 of file TASImage.cxx.

◆ Slice()

void TASImage::Slice ( UInt_t  xStart,
UInt_t  xEnd,
UInt_t  yStart,
UInt_t  yEnd,
UInt_t  toWidth,
UInt_t  toHeight 
)
virtual

Another method of enlarging images where corners remain unchanged, but middle part gets tiled.

Reimplemented from TImage.

Definition at line 1945 of file TASImage.cxx.

◆ StartPaletteEditor()

void TASImage::StartPaletteEditor ( )
virtual

Start palette editor.

Reimplemented from TAttImage.

Definition at line 2249 of file TASImage.cxx.

◆ Tile()

void TASImage::Tile ( UInt_t  width,
UInt_t  height 
)
virtual

Tile the original image.

Reimplemented from TImage.

Definition at line 1981 of file TASImage.cxx.

◆ TypeFromMagicNumber()

const char * TASImage::TypeFromMagicNumber ( const char *  file)
private

Guess the file type from the first byte of file.

Definition at line 395 of file TASImage.cxx.

◆ UnZoom()

void TASImage::UnZoom ( )
virtual

Un-zoom the image to original size.

UnZoom() - performs undo for Zoom,Crop,Scale actions

Reimplemented from TImage.

Definition at line 2043 of file TASImage.cxx.

◆ Vectorize()

Double_t * TASImage::Vectorize ( UInt_t  max_colors = 256,
UInt_t  dither = 4,
Int_t  opaque_threshold = 1 
)
virtual

Reduce color-depth of an image and fills vector of "scientific data" [0...1].

Colors are reduced by allocating color cells to most used colors first, and then approximating other colors with those allocated.

Parameters
[in]max_colors- maximum size of the colormap.
[in]dither- number of bits to strip off the color data ( 0...7 )
[in]opaque_threshold- alpha channel threshold at which pixel should be treated as opaque

Reimplemented from TImage.

Definition at line 2833 of file TASImage.cxx.

◆ WriteImage()

void TASImage::WriteImage ( const char *  file,
EImageFileTypes  type = TImage::kUnknown 
)
virtual

Write image to specified file.

If there is no file extension or if the file extension is unknown, the type argument will be used to determine the file type. The quality and compression is derived from the TAttImage values.

It's possible to write image into an animated GIF file by specifying file name as "myfile.gif+" or "myfile.gif+NN", where NN is the delay of displaying subimages during animation in 10ms seconds units. NN is not restricted to two digits. If NN is omitted the delay between subimages is zero. For an animation that stops after last subimage is reached, one has to write the last image as .gif+ (zero delay of last image) or .gif+NN (NN*10ms delay of last image).

For repeated animation (looping), the last subimage must be specified as:

  • "myfile.gif++NN++" if you want an infinite looping gif with NN*10ms delay of the last image.
  • "myfile.gif++" for an infinite loop with zero delay of last image.
  • "myfile.gif+NN++RR" if you want a finite looping gif with NN*10ms delay of the last image and the animation to be stopped after RR repeats. RR is not restricted to two digits.

A deprecated version for saving the last subimage of a looping gif animation is:

  • "myfile.gif++NN" for a finite loop where NN is number of repetitions and NN*10ms the delay of last image. (No separate control of repeats and delay). Note: If the file "myfile.gif" already exists, the new frames are appended at the end of the file. To avoid this, delete it first with gSystem->Unlink(myfile.gif);

The following macro creates animated gif from jpeg images with names

  • imageNN.jpg, where 1<= NN <= 10
  • The delays are set to 10*10ms.
    {
    TImage *img = 0;
    gSystem->Unlink("anim.gif"); // delete existing file
    for (int i = 1; i <= 10; i++) {
    delete img; // delete previous image
    // Read image data. Image can be in any format, e.g. png, gif, etc.
    img = TImage::Open(Form("image%d.jpg", i));
    if (i < 10) {
    img->WriteImage("anim.gif+10"); // 10 centiseconds delay
    } else { // the last image written. "++" stands for infinit animation.
    img->WriteImage("anim.gif++10++"); // 10 centiseconds delay of last image
    }
    }
    }
    char * Form(const char *fmt,...)
    R__EXTERN TSystem * gSystem
    Definition: TSystem.h:540
    virtual void WriteImage(const char *, EImageFileTypes=TImage::kUnknown)
    Definition: TImage.h:115
    virtual int Unlink(const char *name)
    Unlink, i.e.
    Definition: TSystem.cxx:1371

Reimplemented from TImage.

Definition at line 647 of file TASImage.cxx.

◆ Zoom()

void TASImage::Zoom ( UInt_t  offX,
UInt_t  offY,
UInt_t  width,
UInt_t  height 
)
virtual

The area of an image displayed in a pad is defined by this function.

Note: the size on the screen is defined by the size of the pad. The original image is not modified by this function. If width or height is larger than the original image they are reduced to the width and height of the image. If the off values are too large (off + width > image width) than the off values are decreased. For example: offX = image width - width Note: the parameters are always relative to the original image not to the size of an already zoomed image.

Reimplemented from TImage.

Definition at line 2021 of file TASImage.cxx.

Member Data Documentation

◆ fEditable

Bool_t TASImage::fEditable
protected

! kTRUE image can be resized, moved by resizing/moving gPad

Definition at line 66 of file TASImage.h.

◆ fgInit

Bool_t TASImage::fgInit = kFALSE
staticprotected

global flag to init afterimage only once

Definition at line 73 of file TASImage.h.

◆ fgPlugList

THashTable * TASImage::fgPlugList = new THashTable(50)
staticprotected

! hash table containing loaded plugins

Definition at line 70 of file TASImage.h.

◆ fGrayImage

ASImage* TASImage::fGrayImage
protected

! gray image

Definition at line 68 of file TASImage.h.

◆ fgVisual

ASVisual * TASImage::fgVisual = 0
staticprotected

pointer to visual structure

Definition at line 72 of file TASImage.h.

◆ fImage

ASImage* TASImage::fImage
protected

! pointer to image structure of original image

Definition at line 57 of file TASImage.h.

◆ fIsGray

Bool_t TASImage::fIsGray
protected

! kTRUE if image is gray

Definition at line 69 of file TASImage.h.

◆ fMaxValue

Double_t TASImage::fMaxValue
protected

! max value in image

Definition at line 59 of file TASImage.h.

◆ fMinValue

Double_t TASImage::fMinValue
protected

! min value in image

Definition at line 60 of file TASImage.h.

◆ fPaintMode

Int_t TASImage::fPaintMode
protected

! 1 - fast mode, 0 - low memory slow mode

Definition at line 67 of file TASImage.h.

◆ fScaledImage

TASImage* TASImage::fScaledImage
protected

! temporary scaled and zoomed image produced from original image

Definition at line 58 of file TASImage.h.

◆ fZoomHeight

UInt_t TASImage::fZoomHeight
protected

! hight of zoomed image in image pixels

Definition at line 64 of file TASImage.h.

◆ fZoomOffX

UInt_t TASImage::fZoomOffX
protected

! X - offset for zooming in image pixels

Definition at line 61 of file TASImage.h.

◆ fZoomOffY

UInt_t TASImage::fZoomOffY
protected

! Y - offset for zooming im image pixels

Definition at line 62 of file TASImage.h.

◆ fZoomUpdate

Int_t TASImage::fZoomUpdate
protected

! kZoom - new zooming required, kZoomOps - other ops in action, kNoZoom - no zooming or ops

Definition at line 65 of file TASImage.h.

◆ fZoomWidth

UInt_t TASImage::fZoomWidth
protected

! width of zoomed image in image pixels

Definition at line 63 of file TASImage.h.

Libraries for TASImage:
[legend]

The documentation for this class was generated from the following files: