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);
135 ::Error(
"TASUtils::GetPixmap",
"Image not provided");
141#ifndef X_DISPLAY_MISSING
142 auto asimg =
dynamic_cast<TASImage *
>(timg);
144 ::Warning(
"TASUtils::GetPixmap",
"ASImage not provided");
151 ::Warning(
"TASUtils::GetPixmap",
"Visual not initiated");
155 ASImage *img = asimg->fScaledImage ? asimg->fScaledImage->fImage : asimg->fImage;
159 ::Error(
"TASUtils::GetPixmap",
"Invoke X11-specific methods on unsupported platform");
166 ::Error(
"TASUtils::GetPixmap",
"ARGB array is not exists");
183 std::vector<char> bits;
186 ::Error(
"TGWindow::GetImageMask",
"Image not provided");
198 auto asimg =
dynamic_cast<TASImage *
> (img);
203 asimg->DestroyScaledImage();
219 ::Error(
"TASUtils::FillImageFromWindow",
"Visual not initiated");
223#ifndef X_DISPLAY_MISSING
226 ::Error(
"TASUtils::FillImageFromWindow",
"Invoke X11-specific methods on unsupported platform");
231 ::Error(
"TASUtils::FillImageFromWindow",
"Fail to extract color bits for specified window");
238 if (!asimg->IsValid())
257 auto asimg = std::make_unique<TASImage>();
270 auto asimg = std::make_unique<TASImage>();
282 ::Warning(
"TASUtils::FromPixmap",
"Visual not initiated");
286#ifndef X_DISPLAY_MISSING
289 ::Error(
"TASUtils::FromPixmap",
"Invoke X11-specific methods on unsupported platform");
298 asimg->FromBitmap(bits,
w,
h, mask_bits);
305 if (!asimg->IsValid())
316 auto asimg =
dynamic_cast<TASImage *
>(timg);
318 ::Warning(
"TASUtils::PaintImage",
"Image not provided");
327 UInt_t mwidth = 0, mheight = 0;
328 std::vector<char> bits;
329 if (asimg->GetMaskBits(mwidth, mheight, bits))
351 #ifndef X_DISPLAY_MISSING
352 ASImage *im = asimg->fScaledImage ? asimg->fScaledImage->fImage : asimg->fImage;
355 asimage2drawable(vis,
wid, im, (GC)
holder.
fGC, 0, 0,
x,
y,
width,
height, 1);
359 ::Error(
"TASUtils::PaintImage",
"Invoke X11-specific methods on unsupported platform");
363 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
thread_local ASVisualHolder holder
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