13#include "RConfigure.h"
27 ::Error(
"TASUtils::GetPixmap",
"Not implemented, ASImage is not compiled");
33 ::Error(
"TASUtils::GetMask",
"Not implemented, ASImage is not compiled");
39 ::Error(
"TASUtils::PaintImage",
"Not implemented, ASImage is not compiled");
45 ::Error(
"TASUtils::FillImageFromWindow",
"Not implemented, ASImage is not compiled");
51 ::Error(
"TASUtils::FromWindow",
"Not implemented, ASImage is not compiled");
57 ::Error(
"TASUtils::FromPixmap",
"Not implemented, ASImage is not compiled");
66#define X_DISPLAY_MISSING 1
67#include "Windows4root.h"
70#define X_DISPLAY_MISSING 1
75#include "afterimage.h"
78#ifndef X_DISPLAY_MISSING
92#ifndef X_DISPLAY_MISSING
94 Display *disp = (Display*)
gVirtualX->GetDisplay();
101 fVisual = create_asvisual_for_id(disp, screen, depth, XVisualIDFromVisual(vis),
cmap,
nullptr);
105 fVisual = create_asvisual(
nullptr, 0, 0,
nullptr);
138 ::Error(
"TASUtils::GetPixmap",
"Image not provided");
144#ifndef X_DISPLAY_MISSING
145 auto asimg =
dynamic_cast<TASImage *
>(timg);
147 ::Warning(
"TASUtils::GetPixmap",
"ASImage not provided");
154 ::Warning(
"TASUtils::GetPixmap",
"Visual not initiated");
158 ASImage *img = asimg->fScaledImage ? asimg->fScaledImage->fImage : asimg->fImage;
162 ::Error(
"TASUtils::GetPixmap",
"Invoke X11-specific methods on unsupported platform");
169 ::Error(
"TASUtils::GetPixmap",
"ARGB array is not exists");
186 std::vector<char> bits;
189 ::Error(
"TGWindow::GetImageMask",
"Image not provided");
201 auto asimg =
dynamic_cast<TASImage *
> (img);
206 asimg->DestroyScaledImage();
222 ::Error(
"TASUtils::FillImageFromWindow",
"Visual not initiated");
226#ifndef X_DISPLAY_MISSING
229 ::Error(
"TASUtils::FillImageFromWindow",
"Invoke X11-specific methods on unsupported platform");
234 ::Error(
"TASUtils::FillImageFromWindow",
"Fail to extract color bits for specified window");
241 if (!asimg->IsValid())
260 auto asimg = std::make_unique<TASImage>();
273 auto asimg = std::make_unique<TASImage>();
285 ::Warning(
"TASUtils::FromPixmap",
"Visual not initiated");
289#ifndef X_DISPLAY_MISSING
292 ::Error(
"TASUtils::FromPixmap",
"Invoke X11-specific methods on unsupported platform");
301 asimg->FromBitmap(bits,
w,
h, mask_bits);
308 if (!asimg->IsValid())
319 auto asimg =
dynamic_cast<TASImage *
>(timg);
321 ::Warning(
"TASUtils::PaintImage",
"Image not provided");
330 UInt_t mwidth = 0, mheight = 0;
331 std::vector<char> bits;
332 if (asimg->GetMaskBits(mwidth, mheight, bits))
354 #ifndef X_DISPLAY_MISSING
355 ASImage *im = asimg->fScaledImage ? asimg->fScaledImage->fImage : asimg->fImage;
358 asimage2drawable(vis,
wid, im, (GC)holder.fGC, 0, 0,
x,
y,
width,
height, 1);
362 ::Error(
"TASUtils::PaintImage",
"Invoke X11-specific methods on unsupported platform");
366 auto argb = asimg->GetArgbArray();
Handle_t Pixmap_t
Pixmap handle.
const Mask_t kGCClipXOrigin
Handle_t Window_t
Window handle.
Handle_t GContext_t
Graphics context handle.
Handle_t Drawable_t
Drawable handle.
const Mask_t kGCClipYOrigin
bool Bool_t
Boolean (0=false, 1=true) (bool)
int Int_t
Signed integer 4 bytes (int)
static unsigned long kAllPlanes
const unsigned long kAllPlanes
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t mask
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void cmap
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize wid
Option_t Option_t TPoint xy
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void pxm
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t height
R__EXTERN TSystem * gSystem
R__EXTERN Int_t(* gThreadXAR)(const char *xact, Int_t nb, void **ar, Int_t *iret)
void DestroyImage()
Destroy image.
static Pixmap_t GetPixmap(TImage *timg)
Returns image pixmap.
static std::unique_ptr< TImage > FromWindow(Window_t wid)
Create an image from the given window.
static Bool_t FillImageFromWindow(TImage *img, Window_t wid, Int_t width, Int_t height)
Create an image from the given window.
static Bool_t PaintImage(TImage *timg, Drawable_t wid, Int_t x, Int_t y, Bool_t opaque=kFALSE)
Paint image on specified window.
static Pixmap_t GetMask(TImage *timg)
Returns image mask pixmap (alpha channel).
static std::unique_ptr< TImage > FromPixmap(Pixmap_t pxm, Pixmap_t mask)
Create image from pixmap.
An abstract interface to image processing library.
virtual Bool_t GetMaskBits(UInt_t &, UInt_t &, std::vector< char > &)
virtual UInt_t GetScaledWidth() const
virtual UInt_t * GetArgbArray()
virtual UInt_t GetScaledHeight() const
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
virtual void Sleep(UInt_t milliSec)
Sleep milliSec milli seconds.
virtual Bool_t ProcessEvents()
Process pending events (GUI, timers, sockets).
Graphics context structure.
Pixmap_t fClipMask
bitmap clipping; other calls for rects
Int_t fClipXOrigin
origin for clipping
Mask_t fMask
bit mask specifying which fields are valid