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. | |
TASImage (const char *file, EImageFileTypes type=kUnknown) | |
Create an image object and read from specified file. | |
TASImage (const char *name, const Double_t *imageData, UInt_t width, UInt_t height, TImagePalette *palette=nullptr) | |
Create an image depending on the values of imageData. | |
TASImage (const char *name, const TArrayD &imageData, UInt_t width, TImagePalette *palette=nullptr) | |
Create an image depending on the values of imageData. | |
TASImage (const char *name, const TVectorD &imageData, UInt_t width, TImagePalette *palette=nullptr) | |
Create an image depending on the values of imageData. | |
TASImage (const TASImage &img) | |
Image copy constructor. | |
TASImage (UInt_t w, UInt_t h) | |
Create an empty image. | |
~TASImage () override | |
Image destructor, clean up image and visual. | |
void | Append (const TImage *im, const char *option="+", const char *color="#00000000") override |
Append image. | |
void | BeginPaint (Bool_t fast=kTRUE) override |
BeginPaint initializes internal array[width x height] of ARGB32 pixel values. | |
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) override |
Bevel is used to create 3D effect while drawing buttons, or any other image that needs to be framed. | |
void | Blur (Double_t hr=3, Double_t vr=3) override |
Perform Gaussian blur of the image (useful for drop shadows). | |
void | Browse (TBrowser *) override |
Browse image. | |
TObject * | Clone (const char *newname) const override |
Clone image. | |
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) override |
Copy source region to the destination image. | |
void | Crop (Int_t x=0, Int_t y=0, UInt_t width=0, UInt_t height=0) override |
Crop an image. | |
void | CropPolygon (UInt_t npt, TPoint *ppt) override |
Crop a convex polygon. | |
void | CropSpans (UInt_t npt, TPoint *ppt, UInt_t *widths) override |
Crop spans. | |
Int_t | DistancetoPrimitive (Int_t px, Int_t py) override |
Is the mouse in the image ? | |
void | Draw (Option_t *option="") override |
Draw image. | |
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) override |
Draw a box. | |
void | DrawCellArray (Int_t x1, Int_t y1, Int_t x2, Int_t y2, Int_t nx, Int_t ny, UInt_t *ic) override |
Draw a cell array. | |
void | DrawCircle (Int_t x, Int_t y, Int_t r, const char *col="#000000", Int_t thick=1) override |
Draw a circle. | |
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) override |
Draw a cubic bezier line. | |
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) override |
Draw a dashed line. | |
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) override |
Draw an ellipse. | |
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) override |
Draw an ellipse. | |
void | DrawFillArea (UInt_t npt, TPoint *ppt, const char *col="#000000", const char *stipple=nullptr, UInt_t w=16, UInt_t h=16) override |
Fill a polygon (any type convex, non-convex). | |
void | DrawFillArea (UInt_t npt, TPoint *ppt, TImage *tile) override |
Fill a polygon (any type convex, non-convex). | |
void | DrawLine (UInt_t x1, UInt_t y1, UInt_t x2, UInt_t y2, const char *col="#000000", UInt_t thick=1) override |
Draw a line. | |
void | DrawPolyLine (UInt_t nn, TPoint *xy, const char *col="#000000", UInt_t thick=1, TImage::ECoordMode mode=kCoordModeOrigin) override |
Draw a polyline. | |
void | DrawRectangle (UInt_t x, UInt_t y, UInt_t w, UInt_t h, const char *col="#000000", UInt_t thick=1) override |
Draw a rectangle. | |
void | DrawSegments (UInt_t nseg, Segment_t *seg, const char *col="#000000", UInt_t thick=1) override |
Draw segments. | |
void | DrawStraightEllips (Int_t x, Int_t y, Int_t rx, Int_t ry, const char *col="#000000", Int_t thick=1) override |
Draw a straight ellipse. | |
void | DrawText (Int_t x=0, Int_t y=0, const char *text="", Int_t size=12, const char *color=nullptr, const char *font="fixed", EText3DType type=TImage::kPlain, const char *fore_file=nullptr, Float_t angle=0) override |
Draw text of size (in pixels for TrueType fonts) at position (x, y) with color specified by hex string. | |
void | DrawText (TText *text, Int_t x=0, Int_t y=0) override |
Draw text at the pixel position (x,y). | |
void | EndPaint () override |
EndPaint does internal RLE compression of image data. | |
void | ExecuteEvent (Int_t event, Int_t px, Int_t py) override |
Execute mouse events. | |
void | FillPolygon (UInt_t npt, TPoint *ppt, const char *col="#000000", const char *stipple=nullptr, UInt_t w=16, UInt_t h=16) override |
Fill a convex polygon with background color or bitmap. | |
void | FillPolygon (UInt_t npt, TPoint *ppt, TImage *tile) override |
Fill a convex polygon with background image. | |
void | FillRectangle (const char *col=nullptr, Int_t x=0, Int_t y=0, UInt_t width=0, UInt_t height=0) override |
Fill rectangle of size (width, height) at position (x,y) within the existing image with specified color. | |
void | FillSpans (UInt_t npt, TPoint *ppt, UInt_t *widths, const char *col="#000000", const char *stipple=nullptr, UInt_t w=16, UInt_t h=16) override |
Fill spans with specified color or/and stipple. | |
void | FillSpans (UInt_t npt, TPoint *ppt, UInt_t *widths, TImage *tile) override |
Fill spans with tile image. | |
void | Flip (Int_t flip=180) override |
Flip image in place. | |
void | FloodFill (Int_t x, Int_t y, const char *col, const char *min_col, const char *max_col=nullptr) override |
Flood fill. | |
void | FromGLBuffer (UChar_t *buf, UInt_t w, UInt_t h) override |
Creates an image (screenshot) from a RGBA buffer. | |
void | FromPad (TVirtualPad *pad, Int_t x=0, Int_t y=0, UInt_t w=0, UInt_t h=0) override |
Create an image from the given pad, afterwards this image can be saved in any of the supported image formats. | |
void | FromWindow (Drawable_t wid, Int_t x=0, Int_t y=0, UInt_t w=0, UInt_t h=0) override |
Create an image (screenshot) from specified window. | |
UInt_t * | GetArgbArray () override |
Return a pointer to internal array[width x height] of ARGB32 values This array is directly accessible. | |
TArrayD * | GetArray (UInt_t w=0, UInt_t h=0, TImagePalette *pal=gWebImagePalette) override |
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. | |
UInt_t | GetHeight () const override |
Return height of original image not of the displayed image. | |
const char * | GetIconName () const override |
Returns mime type name of object. | |
ASImage * | GetImage () const |
void | GetImageBuffer (char **buffer, int *size, EImageFileTypes type=TImage::kPng) override |
Return in-memory buffer compressed according image type. | |
Pixmap_t | GetMask () override |
Returns image mask pixmap (alpha channel). | |
char * | GetObjectInfo (Int_t px, Int_t py) const override |
Get image pixel coordinates and the pixel value at the mouse pointer. | |
TArrayL * | GetPixels (Int_t x=0, Int_t y=0, UInt_t w=0, UInt_t h=0) override |
Return 2D array of machine dependent pixel values. | |
Pixmap_t | GetPixmap () override |
Returns image pixmap. | |
UInt_t * | GetRgbaArray () override |
Return a pointer to an array[width x height] of RGBA32 values. | |
UInt_t | GetScaledHeight () const |
Return height of the displayed image not of the original image. | |
TImage * | GetScaledImage () const override |
UInt_t | GetScaledWidth () const |
Return width of the displayed image not of the original image. | |
UInt_t * | GetScanline (UInt_t y) override |
Return a pointer to scan-line. | |
const char * | GetTitle () const override |
Title is used to keep 32x32 xpm image's thumbnail. | |
Double_t * | GetVecArray () override |
Return a pointer to internal array[width x height] of double values [0,1]. | |
UInt_t | GetWidth () const override |
Return width of original image not of the displayed image. | |
void | GetZoomPosition (UInt_t &x, UInt_t &y, UInt_t &w, UInt_t &h) const |
Return the zoom parameters. | |
void | Gradient (UInt_t angle=0, const char *colors="#FFFFFF #000000", const char *offsets=nullptr, Int_t x=0, Int_t y=0, UInt_t width=0, UInt_t height=0) override |
Render multipoint gradient inside rectangle of size (width, height) at position (x,y) within the existing image. | |
void | Gray (Bool_t on=kTRUE) override |
Convert RGB image to Gray image and vice versa. | |
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) override |
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. | |
TClass * | IsA () const override |
Bool_t | IsEditable () const override |
Bool_t | IsGray () const override |
Bool_t | IsValid () const override |
void | Merge (const TImage *im, const char *op="alphablend", Int_t x=0, Int_t y=0) override |
Merge two images. | |
void | Mirror (Bool_t vert=kTRUE) override |
Mirror image in place. | |
TASImage & | operator= (const TASImage &img) |
Image assignment operator. | |
void | Pad (const char *color="#00FFFFFF", UInt_t left=0, UInt_t right=0, UInt_t top=0, UInt_t bottom=0) override |
Enlarge image, padding it with specified color on each side in accordance with requested geometry. | |
void | Paint (Option_t *option="") override |
Paint image. | |
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="") override |
Draw image on the drawable wid (pixmap, window) at x,y position. | |
void | PolyPoint (UInt_t npt, TPoint *ppt, const char *col="#000000", TImage::ECoordMode mode=kCoordModeOrigin) override |
Draw a poly point. | |
void | PutPixel (Int_t x, Int_t y, const char *col="#000000") override |
Draw a point at the specified position. | |
void | ReadImage (const char *file, EImageFileTypes type=TImage::kUnknown) override |
Read specified image file. | |
void | SavePrimitive (std::ostream &out, Option_t *option="") override |
Save a primitive as a C++ statement(s) on output stream "out". | |
void | Scale (UInt_t width, UInt_t height) override |
Scale the original image. | |
void | SetEditable (Bool_t on=kTRUE) override |
void | SetImage (ASImage *image) |
void | SetImage (const Double_t *imageData, UInt_t width, UInt_t height, TImagePalette *palette=nullptr) override |
Deletes the old image and creates a new image depending on the values of imageData. | |
void | SetImage (const TArrayD &imageData, UInt_t width, TImagePalette *palette=nullptr) override |
Delete the old image and creates a new image depending on the values of imageData. | |
void | SetImage (const TVectorD &imageData, UInt_t width, TImagePalette *palette=nullptr) override |
Delete the old image and creates a new image depending on the values of imageData. | |
void | SetImage (Pixmap_t pxm, Pixmap_t mask=0) override |
Create image from pixmap. | |
Bool_t | SetImageBuffer (char **buffer, EImageFileTypes type=TImage::kPng) override |
Create image from compressed buffer. | |
Bool_t | SetJpegDpi (const char *name, UInt_t dpi=72) |
Set an image printing resolution in Dots Per Inch units. | |
void | SetPalette (const TImagePalette *palette) override |
Set a new palette to an image. | |
void | SetPaletteEnabled (Bool_t on=kTRUE) override |
Switch on/off the image palette. | |
void | SetTitle (const char *title="") override |
Set a title for an image. | |
void | Slice (UInt_t xStart, UInt_t xEnd, UInt_t yStart, UInt_t yEnd, UInt_t toWidth, UInt_t toHeight) override |
Another method of enlarging images where corners remain unchanged, but middle part gets tiled. | |
void | StartPaletteEditor () override |
Start palette editor. | |
void | Streamer (TBuffer &) override |
Streamer for ROOT I/O. | |
void | StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b) |
void | Tile (UInt_t width, UInt_t height) override |
Tile the original image. | |
void | UnZoom () override |
Un-zoom the image to original size. | |
Double_t * | Vectorize (UInt_t max_colors=256, UInt_t dither=4, Int_t opaque_threshold=1) override |
Reduce color-depth of an image and fills vector of "scientific data" [0...1]. | |
void | WriteImage (const char *file, EImageFileTypes type=TImage::kUnknown) override |
Write image to specified file. | |
void | Zoom (UInt_t offX, UInt_t offY, UInt_t width, UInt_t height) override |
The area of an image displayed in a pad is defined by this function. | |
Public Member Functions inherited from TImage | |
TImage (const TImage &img) | |
TImage (UInt_t, UInt_t) | |
~TImage () override | |
TObject * | Clone (const char *) const override |
Make a clone of an object using the Streamer facility. | |
TClass * | IsA () const override |
void | ls (Option_t *option="") const override |
List this image with its attributes. | |
TImage & | operator+= (const TImage &i) |
TImage & | operator/= (const TImage &i) |
TImage & | operator= (const TImage &img) |
void | Streamer (TBuffer &) override |
Stream an object of class TObject. | |
void | StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b) |
Public Member Functions inherited from TNamed | |
TNamed () | |
TNamed (const char *name, const char *title) | |
TNamed (const TNamed &named) | |
TNamed copy ctor. | |
TNamed (const TString &name, const TString &title) | |
virtual | ~TNamed () |
TNamed destructor. | |
void | Clear (Option_t *option="") override |
Set name and title to empty strings (""). | |
TObject * | Clone (const char *newname="") const override |
Make a clone of an object using the Streamer facility. | |
Int_t | Compare (const TObject *obj) const override |
Compare two TNamed objects. | |
void | Copy (TObject &named) const override |
Copy this to obj. | |
virtual void | FillBuffer (char *&buffer) |
Encode TNamed into output buffer. | |
const char * | GetName () const override |
Returns name of object. | |
const char * | GetTitle () const override |
Returns title of object. | |
ULong_t | Hash () const override |
Return hash value for this object. | |
TClass * | IsA () const override |
Bool_t | IsSortable () const override |
void | ls (Option_t *option="") const override |
List TNamed name and title. | |
TNamed & | operator= (const TNamed &rhs) |
TNamed assignment operator. | |
void | Print (Option_t *option="") const override |
Print TNamed name and title. | |
virtual void | SetName (const char *name) |
Set the name of the TNamed. | |
virtual void | SetNameTitle (const char *name, const char *title) |
Set all the TNamed parameters (name and title). | |
virtual Int_t | Sizeof () const |
Return size of the TNamed part of the TObject. | |
void | Streamer (TBuffer &) override |
Stream an object of class TObject. | |
void | StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b) |
Public Member Functions inherited from TObject | |
TObject () | |
TObject constructor. | |
TObject (const TObject &object) | |
TObject copy ctor. | |
virtual | ~TObject () |
TObject destructor. | |
void | AbstractMethod (const char *method) const |
Use this method to implement an "abstract" method that you don't want to leave purely abstract. | |
virtual void | AppendPad (Option_t *option="") |
Append graphics object to current pad. | |
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. | |
virtual const char * | ClassName () const |
Returns name of class to which the object belongs. | |
virtual void | Delete (Option_t *option="") |
Delete this object. | |
virtual void | DrawClass () const |
Draw class inheritance tree of the class to which this object belongs. | |
virtual TObject * | DrawClone (Option_t *option="") const |
Draw a clone of this object in the current selected pad with: gROOT->SetSelectedPad(c1) . | |
virtual void | Dump () const |
Dump contents of object on stdout. | |
virtual void | Error (const char *method, const char *msgfmt,...) const |
Issue error message. | |
virtual void | Execute (const char *method, const char *params, Int_t *error=nullptr) |
Execute method on this object with the given parameter string, e.g. | |
virtual void | Execute (TMethod *method, TObjArray *params, Int_t *error=nullptr) |
Execute method on this object with parameters stored in the TObjArray. | |
virtual void | Fatal (const char *method, const char *msgfmt,...) const |
Issue fatal error message. | |
virtual TObject * | FindObject (const char *name) const |
Must be redefined in derived classes. | |
virtual TObject * | FindObject (const TObject *obj) const |
Must be redefined in derived classes. | |
virtual Option_t * | GetDrawOption () const |
Get option used by the graphics system to draw this object. | |
virtual Option_t * | GetOption () const |
virtual UInt_t | GetUniqueID () const |
Return the unique object id. | |
virtual Bool_t | HandleTimer (TTimer *timer) |
Execute action in response of a timer timing out. | |
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. | |
virtual void | Info (const char *method, const char *msgfmt,...) const |
Issue info message. | |
virtual Bool_t | InheritsFrom (const char *classname) const |
Returns kTRUE if object inherits from class "classname". | |
virtual Bool_t | InheritsFrom (const TClass *cl) const |
Returns kTRUE if object inherits from TClass cl. | |
virtual void | Inspect () const |
Dump contents of this object in a graphics canvas. | |
void | InvertBit (UInt_t f) |
Bool_t | IsDestructed () const |
IsDestructed. | |
virtual Bool_t | IsEqual (const TObject *obj) const |
Default equal comparison (objects are equal if they have the same address in memory). | |
virtual Bool_t | IsFolder () const |
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects). | |
R__ALWAYS_INLINE Bool_t | IsOnHeap () const |
R__ALWAYS_INLINE Bool_t | IsZombie () const |
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). | |
virtual Bool_t | Notify () |
This method must be overridden to handle object notification (the base implementation is no-op). | |
void | Obsolete (const char *method, const char *asOfVers, const char *removedFromVers) const |
Use this method to declare a method obsolete. | |
void | operator delete (void *ptr) |
Operator delete. | |
void | operator delete (void *ptr, void *vp) |
Only called by placement new when throwing an exception. | |
void | operator delete[] (void *ptr) |
Operator delete []. | |
void | operator delete[] (void *ptr, void *vp) |
Only called by placement new[] when throwing an exception. | |
void * | operator new (size_t sz) |
void * | operator new (size_t sz, void *vp) |
void * | operator new[] (size_t sz) |
void * | operator new[] (size_t sz, void *vp) |
TObject & | operator= (const TObject &rhs) |
TObject assignment operator. | |
virtual void | Pop () |
Pop on object drawn in a pad to the top of the display list. | |
virtual Int_t | Read (const char *name) |
Read contents of object with specified name from the current directory. | |
virtual void | RecursiveRemove (TObject *obj) |
Recursively remove this object from a list. | |
void | ResetBit (UInt_t f) |
virtual void | SaveAs (const char *filename="", Option_t *option="") const |
Save this object in the file specified by filename. | |
void | SetBit (UInt_t f) |
void | SetBit (UInt_t f, Bool_t set) |
Set or unset the user status bits as specified in f. | |
virtual void | SetDrawOption (Option_t *option="") |
Set drawing option for object. | |
virtual void | SetUniqueID (UInt_t uid) |
Set the unique object id. | |
void | StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b) |
virtual void | SysError (const char *method, const char *msgfmt,...) const |
Issue system error message. | |
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. | |
virtual void | Warning (const char *method, const char *msgfmt,...) const |
Issue warning message. | |
virtual Int_t | Write (const char *name=nullptr, Int_t option=0, Int_t bufsize=0) |
Write this object to the current directory. | |
virtual Int_t | Write (const char *name=nullptr, Int_t option=0, Int_t bufsize=0) const |
Write this object to the current directory. | |
Public Member Functions inherited from TAttImage | |
TAttImage () | |
TAttImage default constructor. | |
TAttImage (EImageQuality lquality, UInt_t lcompression, Bool_t constRatio) | |
TAttImage normal constructor. | |
virtual | ~TAttImage () |
TAttImage destructor. | |
void | Copy (TAttImage &attline) const |
Copy this image attributes to a new attimage. | |
virtual void | EditorClosed () |
Bool_t | GetConstRatio () const |
UInt_t | GetImageCompression () const |
EImageQuality | GetImageQuality () const |
virtual const TImagePalette & | GetPalette () const |
Bool_t | IsPaletteEnabled () const |
virtual void | ResetAttImage (Option_t *option="") |
Reset this image attributes to default values. | |
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. | |
virtual void | SetConstRatio (Bool_t constRatio=kTRUE) |
Set (constRatio = kTRUE) or unset (constRadio = kFALSE) the ratio flag. | |
virtual void | SetImageCompression (UInt_t lcompression) |
virtual void | SetImageQuality (EImageQuality lquality) |
void | StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b) |
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. | |
static TClass * | Class () |
static const char * | Class_Name () |
static constexpr Version_t | Class_Version () |
static const char * | DeclFileName () |
static const ASVisual * | GetVisual () |
Return visual. | |
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. | |
Static Public Member Functions inherited from TImage | |
static TClass * | Class () |
static const char * | Class_Name () |
static constexpr Version_t | Class_Version () |
static TImage * | Create () |
Create an image. | |
static const char * | DeclFileName () |
static EImageFileTypes | GetImageFileTypeFromFilename (const char *opt) |
Return the image type for the extension specified in filename. | |
static TImage * | Open (char **data) |
Create image from XPM data array. | |
static TImage * | Open (const char *file, EImageFileTypes type=kUnknown) |
Open a specified image file. | |
static TImage * | Open (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. | |
static TImage * | Open (const char *name, const TArrayD &imageData, UInt_t width, TImagePalette *palette=nullptr) |
Open an image with the specified data in a TArrayD. | |
static TImage * | Open (const char *name, const TVectorD &imageData, UInt_t width, TImagePalette *palette=nullptr) |
Open an image with the specified data in a TVectorD. | |
Static Public Member Functions inherited from TNamed | |
static TClass * | Class () |
static const char * | Class_Name () |
static constexpr Version_t | Class_Version () |
static const char * | DeclFileName () |
Static Public Member Functions inherited from TObject | |
static TClass * | Class () |
static const char * | Class_Name () |
static constexpr Version_t | Class_Version () |
static const char * | DeclFileName () |
static Longptr_t | GetDtorOnly () |
Return destructor only flag. | |
static Bool_t | GetObjectStat () |
Get status of object stat flag. | |
static void | SetDtorOnly (void *obj) |
Set destructor only flag. | |
static void | SetObjectStat (Bool_t stat) |
Turn on/off tracking of objects in the TObjectTable. | |
Static Public Member Functions inherited from TAttImage | |
static TClass * | Class () |
static const char * | Class_Name () |
static constexpr Version_t | Class_Version () |
static const char * | DeclFileName () |
Protected Member Functions | |
EImageFileTypes | GetFileType (const char *ext) |
Return file type depending on specified extension. | |
void | MapFileTypes (EImageFileTypes &type, UInt_t &astype, Bool_t toas=kTRUE) |
Map file type to/from AfterImage types. | |
void | MapQuality (EImageQuality &quality, UInt_t &asquality, Bool_t toas=kTRUE) |
Map quality to/from AfterImage quality. | |
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). | |
void | MakeZombie () |
Static Protected Member Functions | |
static Bool_t | InitVisual () |
Static function to initialize the ASVisual. | |
Protected Attributes | |
Bool_t | fEditable |
! kTRUE image can be resized, moved by resizing/moving gPad | |
ASImage * | fGrayImage |
! gray image | |
ASImage * | fImage |
! pointer to image structure of original image | |
Bool_t | fIsGray |
! kTRUE if image is gray | |
Double_t | fMaxValue |
! max value in image | |
Double_t | fMinValue |
! min value in image | |
Int_t | fPaintMode |
! 1 - fast mode, 0 - low memory slow mode | |
TASImage * | fScaledImage |
! temporary scaled and zoomed image produced from original image | |
UInt_t | fZoomHeight |
! hight of zoomed image in image pixels | |
UInt_t | fZoomOffX |
! X - offset for zooming in image pixels | |
UInt_t | fZoomOffY |
! Y - offset for zooming im image pixels | |
Int_t | fZoomUpdate |
! kZoom - new zooming required, kZoomOps - other ops in action, kNoZoom - no zooming or ops | |
UInt_t | fZoomWidth |
! width of zoomed image in image pixels | |
Protected Attributes inherited from TNamed | |
TString | fName |
TString | fTitle |
Protected Attributes inherited from TAttImage | |
Bool_t | fConstRatio {kFALSE} |
keep aspect ratio of image on the screen | |
UInt_t | fImageCompression {0} |
compression [0 .. 100] 0: no compression | |
EImageQuality | fImageQuality {kImgDefault} |
OPTION={GetMethod="GetImageQuality";SetMethod="SetImageQuality";Items=(kImgDefault="Default",kImgPoor="Poor",kImgFast="Fast",kImgGood="Good",kImgBest="Best")} | |
TImagePalette | fPalette |
color palette for value -> color conversion | |
TPaletteEditor * | fPaletteEditor {nullptr} |
! GUI to edit the color palette | |
Bool_t | fPaletteEnabled {kFALSE} |
! kTRUE - palette is drawn on the image | |
Static Protected Attributes | |
static Bool_t | fgInit = kFALSE |
global flag to init afterimage only once | |
static THashTable * | fgPlugList = new THashTable(50) |
! hash table containing loaded plugins | |
static ASVisual * | fgVisual = nullptr |
pointer to visual structure | |
Private Types | |
enum | { kNoZoom = 0 , kZoom = 1 , kZoomOps = -1 } |
enum | { kReadWritePNG , kReadWriteVector } |
Private Member Functions | |
void | CreateThumbnail () |
Create image thumbnail. | |
void | DestroyImage () |
Destroy image. | |
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. | |
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. | |
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. | |
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. | |
void | DrawGlyph (void *bitmap, UInt_t color, Int_t x, Int_t y) |
Draw glyph bitmap. | |
void | DrawHLine (UInt_t y, UInt_t x1, UInt_t x2, UInt_t col, UInt_t thick) |
Draw an horizontal line. | |
void | DrawLineInternal (UInt_t x1, UInt_t y1, UInt_t x2, UInt_t y2, UInt_t col, UInt_t thick) |
Internal line drawing. | |
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. | |
void | DrawVLine (UInt_t x, UInt_t y1, UInt_t y2, UInt_t col, UInt_t thick) |
Draw a vertical line. | |
void | DrawWideLine (UInt_t x1, UInt_t y1, UInt_t x2, UInt_t y2, UInt_t col, UInt_t thick) |
Draw wide line. | |
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. | |
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". | |
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. | |
void | SetDefaults () |
Set default parameters. | |
const char * | TypeFromMagicNumber (const char *file) |
Guess the file type from the first byte of file. | |
Additional Inherited Members | |
Public Types inherited from TImage | |
enum | ECharType { kUTF8 = 0 , kChar = 1 , kUnicode = 4 } |
enum | EColorChan { kRedChan = (1ULL << ( 0 )) , kGreenChan = (1ULL << ( 1 )) , kBlueChan = (1ULL << ( 2 )) , kAlphaChan = (1ULL << ( 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 = (1ULL << ( 0 )) , kOverwrite = (1ULL << ( 1 )) , kWriteDelete = (1ULL << ( 2 )) } |
enum | EDeprecatedStatusBits { kObjInCanvas = (1ULL << ( 3 )) } |
enum | EStatusBits { kCanDelete = (1ULL << ( 0 )) , kMustCleanup = (1ULL << ( 3 )) , kIsReferenced = (1ULL << ( 4 )) , kHasUUID = (1ULL << ( 5 )) , kCannotPick = (1ULL << ( 6 )) , kNoContextMenu = (1ULL << ( 8 )) , kInvalidObject = (1ULL << ( 13 )) } |
Public Types inherited from TAttImage | |
enum | EImageQuality { kImgDefault = -1 , kImgPoor = 0 , kImgFast = 1 , kImgGood = 2 , kImgBest = 3 } |
Protected Types inherited from TObject | |
enum | { kOnlyPrepStep = (1ULL << ( 3 )) } |
#include <TASImage.h>
|
private |
Enumerator | |
---|---|
kNoZoom | |
kZoom | |
kZoomOps |
Definition at line 34 of file TASImage.h.
|
private |
Enumerator | |
---|---|
kReadWritePNG | |
kReadWriteVector |
Definition at line 35 of file TASImage.h.
TASImage::TASImage | ( | ) |
Default image constructor.
Definition at line 227 of file TASImage.cxx.
Create an empty image.
Definition at line 235 of file TASImage.cxx.
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 247 of file TASImage.cxx.
TASImage::TASImage | ( | const char * | name, |
const Double_t * | imageData, | ||
UInt_t | width, | ||
UInt_t | height, | ||
TImagePalette * | palette = nullptr |
||
) |
Create an image depending on the values of imageData.
For more information see function SetImage() which is called by this constructor.
Definition at line 260 of file TASImage.cxx.
TASImage::TASImage | ( | const char * | name, |
const TArrayD & | imageData, | ||
UInt_t | width, | ||
TImagePalette * | palette = nullptr |
||
) |
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 273 of file TASImage.cxx.
TASImage::TASImage | ( | const char * | name, |
const TVectorD & | imageData, | ||
UInt_t | width, | ||
TImagePalette * | palette = nullptr |
||
) |
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 286 of file TASImage.cxx.
TASImage::TASImage | ( | const TASImage & | img | ) |
Image copy constructor.
Definition at line 296 of file TASImage.cxx.
|
override |
Image destructor, clean up image and visual.
Definition at line 358 of file TASImage.cxx.
Return alpha-blended value computed from bottom and top pixel values.
Definition at line 5151 of file TASImage.cxx.
|
overridevirtual |
Append image.
option:
Reimplemented from TImage.
Definition at line 3491 of file TASImage.cxx.
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 3532 of file TASImage.cxx.
|
overridevirtual |
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:
Reimplemented from TImage.
Definition at line 3251 of file TASImage.cxx.
Perform Gaussian blur of the image (useful for drop shadows).
Reimplemented from TImage.
Definition at line 2757 of file TASImage.cxx.
|
overridevirtual |
|
static |
|
inlinestaticconstexpr |
Definition at line 211 of file TASImage.h.
|
overridevirtual |
|
overridevirtual |
Copy source region to the destination image.
Copy is done according to specified function:
Reimplemented from TImage.
Definition at line 5008 of file TASImage.cxx.
|
private |
Create image thumbnail.
Definition at line 6091 of file TASImage.cxx.
|
inlinestatic |
Definition at line 211 of file TASImage.h.
|
private |
Destroy image.
Definition at line 182 of file TASImage.cxx.
Is the mouse in the image ?
Reimplemented from TObject.
Definition at line 1686 of file TASImage.cxx.
|
overridevirtual |
Draw image.
Support the following drawing options:
The default is to display the image in the current gPad.
Reimplemented from TObject.
Definition at line 1176 of file TASImage.cxx.
|
overridevirtual |
Draw a cell array.
[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 5122 of file TASImage.cxx.
|
overridevirtual |
Draw a circle.
If thick < 0 - draw filled circle
Reimplemented from TImage.
Definition at line 6397 of file TASImage.cxx.
|
private |
Draw a dashed horizontal line.
Definition at line 4167 of file TASImage.cxx.
|
private |
Draw a dashed vertical line.
Definition at line 4221 of file TASImage.cxx.
|
private |
Draw a dashed line with one pixel width.
Definition at line 4278 of file TASImage.cxx.
|
private |
Draw a dashed line with thick pixel width.
Definition at line 4462 of file TASImage.cxx.
|
overridevirtual |
Draw an ellipse.
If thick < 0 - draw filled ellips
Reimplemented from TImage.
Definition at line 6437 of file TASImage.cxx.
|
overridevirtual |
Draw an ellipse.
If thick < 0 - draw filled ellipse.
Reimplemented from TImage.
Definition at line 6477 of file TASImage.cxx.
|
overridevirtual |
Fill a polygon (any type convex, non-convex).
Reimplemented from TImage.
Definition at line 5426 of file TASImage.cxx.
Fill a polygon (any type convex, non-convex).
Reimplemented from TImage.
Definition at line 5543 of file TASImage.cxx.
Draw glyph bitmap.
Definition at line 5713 of file TASImage.cxx.
Draw an horizontal line.
Definition at line 3873 of file TASImage.cxx.
|
private |
Internal line drawing.
Definition at line 3919 of file TASImage.cxx.
|
overridevirtual |
|
overridevirtual |
Draw a straight ellipse.
If thick < 0 - draw filled ellipse.
Reimplemented from TImage.
Definition at line 6357 of file TASImage.cxx.
|
overridevirtual |
Draw text of size (in pixels for TrueType fonts) at position (x, y) with color specified by hex string.
Reimplemented from TImage.
Definition at line 2577 of file TASImage.cxx.
Draw text at the pixel position (x,y).
Reimplemented from TImage.
Definition at line 5811 of file TASImage.cxx.
|
private |
Draw text using TrueType fonts.
Definition at line 5954 of file TASImage.cxx.
Draw a vertical line.
Definition at line 3838 of file TASImage.cxx.
|
private |
Draw wide line.
Definition at line 5666 of file TASImage.cxx.
|
overridevirtual |
EndPaint does internal RLE compression of image data.
Reimplemented from TImage.
Definition at line 3564 of file TASImage.cxx.
|
overridevirtual |
Fill a convex polygon with background color or bitmap.
For non convex polygon one must use DrawFillArea method
Reimplemented from TImage.
Definition at line 5344 of file TASImage.cxx.
Fill a convex polygon with background image.
For non convex polygon one must use DrawFillArea method
Reimplemented from TImage.
Definition at line 5376 of file TASImage.cxx.
|
overridevirtual |
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:
Reimplemented from TImage.
Definition at line 3812 of file TASImage.cxx.
|
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.
|
overridevirtual |
Fill spans with specified color or/and stipple.
Reimplemented from TImage.
Definition at line 4807 of file TASImage.cxx.
|
overridevirtual |
Fill spans with tile image.
Reimplemented from TImage.
Definition at line 4866 of file TASImage.cxx.
|
overridevirtual |
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 2077 of file TASImage.cxx.
Creates an image (screenshot) from a RGBA buffer.
Reimplemented from TImage.
Definition at line 6690 of file TASImage.cxx.
|
overridevirtual |
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 1080 of file TASImage.cxx.
|
overridevirtual |
Create an image (screenshot) from specified window.
Reimplemented from TImage.
Definition at line 6638 of file TASImage.cxx.
|
overridevirtual |
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 3591 of file TASImage.cxx.
|
overridevirtual |
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
The returned array must be deleted after usage.
Reimplemented from TImage.
Definition at line 2501 of file TASImage.cxx.
|
protected |
Return file type depending on specified extension.
Protected method.
Definition at line 827 of file TASImage.cxx.
|
private |
|
overridevirtual |
Return height of original image not of the displayed image.
(Number of image pixels)
Reimplemented from TImage.
Definition at line 2163 of file TASImage.cxx.
|
inlineoverridevirtual |
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.
|
inline |
Definition at line 186 of file TASImage.h.
|
overridevirtual |
Return in-memory buffer compressed according image type.
Buffer must be deallocated after usage with free(buffer) call. This method can be used for sending images over network.
Reimplemented from TImage.
Definition at line 5989 of file TASImage.cxx.
|
overridevirtual |
Returns image mask pixmap (alpha channel).
The pixmap must deleted by user.
Reimplemented from TImage.
Definition at line 2303 of file TASImage.cxx.
Get image pixel coordinates and the pixel value at the mouse pointer.
Reimplemented from TObject.
Definition at line 1820 of file TASImage.cxx.
|
overridevirtual |
Return 2D array of machine dependent pixel values.
Reimplemented from TImage.
Definition at line 2409 of file TASImage.cxx.
|
overridevirtual |
Returns image pixmap.
The pixmap must deleted by user.
Reimplemented from TImage.
Definition at line 2271 of file TASImage.cxx.
|
private |
The code is based on Xserver/mi/mipolycon.c "Copyright 1987, 1998 The Open Group".
Definition at line 5199 of file TASImage.cxx.
|
overridevirtual |
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 3619 of file TASImage.cxx.
UInt_t TASImage::GetScaledHeight | ( | ) | const |
Return height of the displayed image not of the original image.
(Number of screen pixels)
Definition at line 2181 of file TASImage.cxx.
|
inlineoverridevirtual |
Reimplemented from TImage.
Definition at line 188 of file TASImage.h.
UInt_t TASImage::GetScaledWidth | ( | ) | const |
Return width of the displayed image not of the original image.
(Number of screen pixels)
Definition at line 2172 of file TASImage.cxx.
Return a pointer to scan-line.
Reimplemented from TImage.
Definition at line 3664 of file TASImage.cxx.
|
overridevirtual |
Title is used to keep 32x32 xpm image's thumbnail.
Reimplemented from TObject.
Definition at line 6280 of file TASImage.cxx.
|
overridevirtual |
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 2479 of file TASImage.cxx.
|
static |
Return visual.
Definition at line 5162 of file TASImage.cxx.
|
overridevirtual |
Return width of original image not of the displayed image.
(Number of image pixels)
Reimplemented from TImage.
Definition at line 2154 of file TASImage.cxx.
Return the zoom parameters.
This is useful when the zoom has been done interactively using the mouse.
Definition at line 2190 of file TASImage.cxx.
|
overridevirtual |
Render multipoint gradient inside rectangle of size (width, height) at position (x,y) within the existing image.
[in] | angle | Given 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] | colors | Whitespace-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] | offsets | Whitespace-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. |
[in] | x | x position coordinate |
[in] | y | y position coordinate |
[in] | width | image width, if 0, it will be read from fImage |
[in] | height | image height, if 0, it will be read from fImage |
Reimplemented from TImage.
Definition at line 3011 of file TASImage.cxx.
Convert RGB image to Gray image and vice versa.
Reimplemented from TImage.
Definition at line 6524 of file TASImage.cxx.
|
overridevirtual |
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 :
All the hue values in parameters will be adjusted to fall within 0-360 range.
[in] | hue | hue in degrees in range 0-360. This allows to limit impact of color adjustment to affect only limited range of hues. |
[in] | radius | value 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] | H | value by which to change hues in affected range. |
[in] | S | value by which to change saturation of the pixels in affected hue range. |
[in] | V | value by which to change Value(brightness) of pixels in affected hue range. |
[in] | x,y | position on infinite surface tiled with original image, of the left-top corner of the area to be used for new image. |
[in] | width,height | size 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.
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.
|
static |
Draw asimage on drawable.
Definition at line 1228 of file TASImage.cxx.
|
staticprotected |
Static function to initialize the ASVisual.
Definition at line 2201 of file TASImage.cxx.
|
inlineoverridevirtual |
Reimplemented from TObject.
Definition at line 211 of file TASImage.h.
|
inlineoverridevirtual |
Reimplemented from TImage.
Definition at line 95 of file TASImage.h.
|
inlineoverridevirtual |
Reimplemented from TImage.
Definition at line 185 of file TASImage.h.
|
inlineoverridevirtual |
Reimplemented from TImage.
Definition at line 184 of file TASImage.h.
|
protected |
Map file type to/from AfterImage types.
Protected method.
Definition at line 871 of file TASImage.cxx.
|
protected |
Map quality to/from AfterImage quality.
Protected method.
Definition at line 956 of file TASImage.cxx.
|
overridevirtual |
Merge two images.
op is string which specifies overlay operation. Supported operations are:
Reimplemented from TImage.
Definition at line 2718 of file TASImage.cxx.
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 2124 of file TASImage.cxx.
Image assignment operator.
Definition at line 324 of file TASImage.cxx.
|
overridevirtual |
Enlarge image, padding it with specified color on each side in accordance with requested geometry.
Reimplemented from TImage.
Definition at line 3367 of file TASImage.cxx.
|
overridevirtual |
Paint image.
Support the following drawing options:
The default is to display the image in the current gPad.
Reimplemented from TObject.
Definition at line 1371 of file TASImage.cxx.
|
overridevirtual |
Draw image on the drawable wid (pixmap, window) at x,y position.
[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. |
[in] | opt | : specific options |
Reimplemented from TImage.
Definition at line 1351 of file TASImage.cxx.
|
overridevirtual |
Draw a point at the specified position.
Reimplemented from TImage.
Definition at line 4689 of file TASImage.cxx.
|
overridevirtual |
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,
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 487 of file TASImage.cxx.
|
overridevirtual |
Save a primitive as a C++ statement(s) on output stream "out".
Reimplemented from TObject.
Definition at line 6740 of file TASImage.cxx.
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 1917 of file TASImage.cxx.
|
private |
Set default parameters.
Definition at line 200 of file TASImage.cxx.
Reimplemented from TImage.
Definition at line 94 of file TASImage.h.
|
inline |
Definition at line 187 of file TASImage.h.
|
overridevirtual |
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 993 of file TASImage.cxx.
|
overridevirtual |
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 1057 of file TASImage.cxx.
|
overridevirtual |
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 1070 of file TASImage.cxx.
|
overridevirtual |
Create image from compressed buffer.
Supported formats:
Reimplemented from TImage.
Definition at line 6042 of file TASImage.cxx.
Set an image printing resolution in Dots Per Inch units.
[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.
|
overridevirtual |
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 1861 of file TASImage.cxx.
Switch on/off the image palette.
That also invokes calling vectorization of image.
Reimplemented from TAttImage.
Definition at line 6711 of file TASImage.cxx.
|
overridevirtual |
|
overridevirtual |
Another method of enlarging images where corners remain unchanged, but middle part gets tiled.
Reimplemented from TImage.
Definition at line 1951 of file TASImage.cxx.
|
overridevirtual |
|
overridevirtual |
|
inline |
Definition at line 211 of file TASImage.h.
|
private |
Guess the file type from the first byte of file.
Definition at line 402 of file TASImage.cxx.
|
overridevirtual |
Un-zoom the image to original size.
UnZoom() - performs undo for Zoom,Crop,Scale actions
Reimplemented from TImage.
Definition at line 2049 of file TASImage.cxx.
|
overridevirtual |
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.
[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 2832 of file TASImage.cxx.
|
overridevirtual |
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:
A deprecated version for saving the last subimage of a looping gif animation is:
The following macro creates animated gif from jpeg images with names
Reimplemented from TImage.
Definition at line 656 of file TASImage.cxx.
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 2027 of file TASImage.cxx.
|
protected |
! kTRUE image can be resized, moved by resizing/moving gPad
Definition at line 66 of file TASImage.h.
global flag to init afterimage only once
Definition at line 73 of file TASImage.h.
|
staticprotected |
! hash table containing loaded plugins
Definition at line 70 of file TASImage.h.
|
protected |
! gray image
Definition at line 68 of file TASImage.h.
|
staticprotected |
pointer to visual structure
Definition at line 72 of file TASImage.h.
|
protected |
! pointer to image structure of original image
Definition at line 57 of file TASImage.h.
|
protected |
! kTRUE if image is gray
Definition at line 69 of file TASImage.h.
|
protected |
! max value in image
Definition at line 59 of file TASImage.h.
|
protected |
! min value in image
Definition at line 60 of file TASImage.h.
|
protected |
! 1 - fast mode, 0 - low memory slow mode
Definition at line 67 of file TASImage.h.
|
protected |
! temporary scaled and zoomed image produced from original image
Definition at line 58 of file TASImage.h.
|
protected |
! hight of zoomed image in image pixels
Definition at line 64 of file TASImage.h.
|
protected |
! X - offset for zooming in image pixels
Definition at line 61 of file TASImage.h.
|
protected |
! Y - offset for zooming im image pixels
Definition at line 62 of file TASImage.h.
|
protected |
! kZoom - new zooming required, kZoomOps - other ops in action, kNoZoom - no zooming or ops
Definition at line 65 of file TASImage.h.
|
protected |
! width of zoomed image in image pixels
Definition at line 63 of file TASImage.h.