Warning, file /include/root/TImage.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TImage
0013 #define ROOT_TImage
0014
0015
0016 #include "TNamed.h"
0017
0018 #include "TAttImage.h"
0019 #include "GuiTypes.h"
0020 #include "TVectorDfwd.h"
0021
0022 class TVirtualPad;
0023 class TArrayD;
0024 class TArrayL;
0025 class TH2D;
0026 class TPoint;
0027 class TText;
0028
0029 class TImage : public TNamed, public TAttImage {
0030
0031 friend TImage operator+(const TImage &i1, const TImage &s2);
0032 friend TImage operator/(const TImage &i1, const TImage &s2);
0033
0034 public:
0035
0036 enum EImageFileTypes {
0037 kXpm = 0,
0038 kZCompressedXpm,
0039 kGZCompressedXpm,
0040 kPng,
0041 kJpeg,
0042 kXcf,
0043 kPpm,
0044 kPnm,
0045 kBmp,
0046 kIco,
0047 kCur,
0048 kGif,
0049 kTiff,
0050 kXbm,
0051 kFits,
0052 kTga,
0053 kXml,
0054 kUnknown,
0055 kAnimGif
0056 };
0057
0058 enum EText3DType {
0059 kPlain = 0,
0060 kEmbossed,
0061 kSunken,
0062 kShadeAbove,
0063 kShadeBelow,
0064 kEmbossedThick,
0065 kSunkenThick,
0066 kOutlineAbove,
0067 kOutlineBelow,
0068 kOutlineFull,
0069 k3DTypes
0070 };
0071
0072 enum ECharType {
0073 kUTF8 = 0,
0074 kChar = 1,
0075 kUnicode = 4
0076 };
0077
0078 enum ETileType {
0079 kStretch = 0,
0080 kTile,
0081 kStretchY,
0082 kStretchX
0083 };
0084
0085 enum ECoordMode {
0086 kCoordModeOrigin = 0,
0087 kCoordModePrevious
0088 };
0089
0090 enum EColorChan {
0091 kRedChan = BIT(0),
0092 kGreenChan = BIT(1),
0093 kBlueChan = BIT(2),
0094 kAlphaChan = BIT(3),
0095 kAllChan = kRedChan | kGreenChan | kBlueChan | kAlphaChan
0096 };
0097
0098 protected:
0099 TImage(const char *file) : TNamed(file, "") { }
0100 TImage() { }
0101
0102 public:
0103 TImage(const TImage &img) : TNamed(img), TAttImage(img) { }
0104 TImage &operator=(const TImage &img)
0105 { TNamed::operator=(img); TAttImage::operator=(img); return *this; }
0106 TImage(UInt_t , UInt_t ) : TNamed(), TAttImage() { }
0107
0108 ~TImage() override { }
0109
0110
0111 TObject *Clone(const char *) const override { return nullptr; }
0112
0113
0114 virtual void ReadImage(const char * , EImageFileTypes = TImage::kUnknown) {}
0115 virtual void WriteImage(const char * , EImageFileTypes = TImage::kUnknown) {}
0116 virtual void SetImage(const Double_t * , UInt_t , UInt_t , TImagePalette * = nullptr) {}
0117 virtual void SetImage(const TArrayD & , UInt_t , TImagePalette * = nullptr) {}
0118 virtual void SetImage(const TVectorD & , UInt_t , TImagePalette * = nullptr) {}
0119 virtual void SetImage(Pixmap_t , Pixmap_t = 0) {}
0120
0121
0122 virtual void FromPad(TVirtualPad * , Int_t = 0, Int_t = 0, UInt_t = 0, UInt_t = 0) {}
0123
0124
0125 virtual void UnZoom() {}
0126
0127
0128 virtual void Zoom(UInt_t , UInt_t , UInt_t , UInt_t ) {}
0129
0130
0131 virtual void Flip(Int_t = 180) {}
0132
0133
0134 virtual void Gray(Bool_t = kTRUE) {}
0135 virtual Bool_t IsGray() const { return kFALSE; }
0136
0137
0138 virtual void Mirror(Bool_t = kTRUE) {}
0139
0140
0141 virtual void Scale(UInt_t , UInt_t ) {}
0142
0143
0144 virtual void Slice(UInt_t , UInt_t , UInt_t , UInt_t ,
0145 UInt_t , UInt_t ) {}
0146
0147
0148 virtual void Tile(UInt_t , UInt_t ) {}
0149
0150
0151 virtual void Crop(Int_t = 0, Int_t = 0, UInt_t = 0, UInt_t = 0) {}
0152
0153
0154 virtual void Pad(const char * = "#FFFFFFFF", UInt_t = 0,
0155 UInt_t = 0, UInt_t = 0, UInt_t = 0) {}
0156
0157
0158 virtual void Blur(Double_t = 3, Double_t = 3) { }
0159
0160
0161 virtual Double_t *Vectorize(UInt_t = 256, UInt_t = 4, Int_t = 0) { return nullptr; }
0162
0163
0164 virtual void HSV(UInt_t = 0, UInt_t = 360, Int_t = 0, Int_t = 0, Int_t = 0,
0165 Int_t = 0, Int_t = 0, UInt_t = 0, UInt_t = 0) {}
0166
0167
0168 virtual void Gradient(UInt_t = 0, const char * = "#FFFFFF #000000", const char * = nullptr,
0169 Int_t = 0, Int_t = 0, UInt_t = 0, UInt_t = 0) {}
0170
0171
0172 virtual void Merge(const TImage * , const char * = "alphablend", Int_t = 0, Int_t = 0) {}
0173
0174
0175 virtual void Append(const TImage * , const char * = "+", const char * = "#00000000") {}
0176
0177
0178 virtual void Bevel(Int_t = 0, Int_t = 0, UInt_t = 0, UInt_t = 0,
0179 const char * = "#ffdddddd", const char * = "#ff555555",
0180 UShort_t = 1, Bool_t = kFALSE) {}
0181
0182 virtual void BeginPaint(Bool_t = kTRUE) {}
0183 virtual void EndPaint() {}
0184 virtual void DrawLine(UInt_t , UInt_t , UInt_t , UInt_t ,
0185 const char * = "#000000", UInt_t = 1) {}
0186 virtual void DrawDashLine(UInt_t , UInt_t , UInt_t , UInt_t , UInt_t ,
0187 const char * , const char * = "#000000", UInt_t = 1) {}
0188 virtual void DrawBox(Int_t , Int_t , Int_t , Int_t ,
0189 const char * = "#000000", UInt_t = 1, Int_t = 0) {}
0190 virtual void DrawRectangle(UInt_t , UInt_t , UInt_t , UInt_t ,
0191 const char * = "#000000", UInt_t = 1) {}
0192 virtual void FillRectangle(const char * = nullptr, Int_t = 0, Int_t = 0,
0193 UInt_t = 0, UInt_t = 0) {}
0194 virtual void DrawPolyLine(UInt_t , TPoint * , const char * = "#000000",
0195 UInt_t = 1, TImage::ECoordMode = kCoordModeOrigin) {}
0196 virtual void PutPixel(Int_t , Int_t , const char * = "#000000") {}
0197 virtual void PolyPoint(UInt_t , TPoint * , const char * = "#000000",
0198 TImage::ECoordMode = kCoordModeOrigin) {}
0199 virtual void DrawSegments(UInt_t , Segment_t * , const char * = "#000000", UInt_t = 1) {}
0200 virtual void DrawText(Int_t = 0, Int_t = 0, const char * = "", Int_t = 12,
0201 const char * = nullptr, const char * = "fixed",
0202 EText3DType = TImage::kPlain, const char * = nullptr, Float_t = 0) { }
0203 virtual void DrawText(TText * , Int_t = 0, Int_t = 0) { }
0204 virtual void FillPolygon(UInt_t , TPoint * , const char * = "#000000",
0205 const char * = nullptr, UInt_t = 16, UInt_t = 16) {}
0206 virtual void FillPolygon(UInt_t , TPoint * , TImage * ) {}
0207 virtual void CropPolygon(UInt_t , TPoint * ) {}
0208 virtual void DrawFillArea(UInt_t , TPoint * , const char * = "#000000",
0209 const char * = nullptr, UInt_t = 16, UInt_t = 16) {}
0210 virtual void DrawFillArea(UInt_t , TPoint * , TImage * ) {}
0211 virtual void FillSpans(UInt_t , TPoint * , UInt_t * , const char * = "#000000",
0212 const char * = nullptr, UInt_t = 16, UInt_t = 16) {}
0213 virtual void FillSpans(UInt_t , TPoint * , UInt_t * , TImage * ) {}
0214 virtual void CropSpans(UInt_t , TPoint * , UInt_t * ) {}
0215 virtual void CopyArea(TImage * , Int_t , Int_t , UInt_t , UInt_t ,
0216 Int_t = 0, Int_t = 0, Int_t = 3, EColorChan = kAllChan) {}
0217 virtual void DrawCellArray(Int_t , Int_t , Int_t , Int_t , Int_t , Int_t , UInt_t * ) {}
0218 virtual void FloodFill(Int_t , Int_t , const char * , const char * , const char * = nullptr) {}
0219 virtual void DrawCubeBezier(Int_t , Int_t , Int_t , Int_t , Int_t , Int_t , const char * = "#000000", UInt_t = 1) {}
0220 virtual void DrawStraightEllips(Int_t , Int_t , Int_t , Int_t , const char * = "#000000", Int_t = 1) {}
0221 virtual void DrawCircle(Int_t , Int_t , Int_t , const char * = "#000000", Int_t = 1) {}
0222 virtual void DrawEllips(Int_t , Int_t , Int_t , Int_t , Int_t , const char * = "#000000", Int_t = 1) {}
0223 virtual void DrawEllips2(Int_t , Int_t , Int_t , Int_t , Int_t , const char * = "#000000", Int_t = 1) {}
0224
0225 virtual void SetEditable(Bool_t = kTRUE) {}
0226 virtual Bool_t IsEditable() const { return kFALSE; }
0227
0228 virtual UInt_t GetWidth() const { return 0; }
0229 virtual UInt_t GetHeight() const { return 0; }
0230 virtual Bool_t IsValid() const { return kTRUE; }
0231 virtual TImage *GetScaledImage() const { return nullptr; }
0232
0233 virtual TArrayL *GetPixels(Int_t = 0, Int_t = 0, UInt_t = 0, UInt_t = 0) { return nullptr; }
0234 virtual TArrayD *GetArray(UInt_t = 0, UInt_t = 0, TImagePalette * = gWebImagePalette) { return nullptr; }
0235 virtual Pixmap_t GetPixmap() { return 0; }
0236 virtual Pixmap_t GetMask() { return 0; }
0237 virtual UInt_t *GetArgbArray() { return nullptr; }
0238 virtual UInt_t *GetRgbaArray() { return nullptr; }
0239 virtual Double_t *GetVecArray() { return nullptr; }
0240 virtual UInt_t *GetScanline(UInt_t ) { return nullptr; }
0241 virtual void GetImageBuffer(char ** , int* , EImageFileTypes = TImage::kPng) {}
0242 virtual Bool_t SetImageBuffer(char ** , EImageFileTypes = TImage::kPng) { return kFALSE; }
0243 virtual void PaintImage(Drawable_t , Int_t , Int_t , Int_t = 0, Int_t = 0, UInt_t = 0, UInt_t = 0, Option_t * = "") { }
0244 virtual void FromWindow(Drawable_t , Int_t = 0, Int_t = 0, UInt_t = 0, UInt_t = 0) {}
0245 virtual void FromGLBuffer(UChar_t* , UInt_t , UInt_t ) {}
0246 static EImageFileTypes GetImageFileTypeFromFilename(const char* opt);
0247
0248 static TImage *Create();
0249 static TImage *Open(const char *file, EImageFileTypes type = kUnknown);
0250 static TImage *Open(char **data);
0251 static TImage *Open(const char *name, const Double_t *imageData, UInt_t width, UInt_t height, TImagePalette *palette);
0252 static TImage *Open(const char *name, const TArrayD &imageData, UInt_t width, TImagePalette *palette = nullptr);
0253 static TImage *Open(const char *name, const TVectorD &imageData, UInt_t width, TImagePalette *palette = nullptr);
0254
0255 TImage &operator+=(const TImage &i) { Append(&i, "+"); return *this; }
0256 TImage &operator/=(const TImage &i) { Append(&i, "/"); return *this; }
0257
0258 void ls(Option_t *option="") const override;
0259
0260 ClassDefOverride(TImage,1)
0261 };
0262
0263
0264 #endif