20#include "RConfigure.h"
23# define X_DISPLAY_MISSING 1
24# define popen_flags "r"
26# include "Windows4root.h"
27# define popen_flags "rb"
30# define popen_flags "r"
34# include <afterbase.h>
36# define X_DISPLAY_MISSING 1
37# include <afterbase.h>
74 Warning(
"File2ASImage",
"GhostScript is not available");
83 const char *ppos = strrchr(
filename,
'.');
105 if (
line.IsNull() || !
line.BeginsWith(
"%"))
108 if (
line.BeginsWith(
"%%BoundingBox:")) {
111 sscanf(
line.Data(),
"%d %d %d %d", &lx, &ly, &ux, &uy);
112 width = std::abs(ux - lx);
113 height = std::abs(uy - ly);
125 cmd +=
" -dSAFER -dBATCH -dNOPAUSE -dQUIET -sDEVICE=png16m -dGraphicsAlphaBits=4 -sOutputFile=- ";
132 const UInt_t kBuffLength = 32768;
133 char buf[kBuffLength];
137 Long_t r = fread(&buf, 1, kBuffLength, in);
138 raw.
Append((
const char*)&buf,
r);
143 ASImageImportParams params;
145 params.width =
width;
147 params.filter = SCL_DO_ALL;
149 params.gamma_table =
nullptr;
150 params.compression = 0;
151 params.format = ASA_ASImage;
152 params.search_path =
nullptr;
155 ASImage *
ret = PNGBuff2ASimage((CARD8 *)raw.
Data(), ¶ms);
bool Bool_t
Boolean (0=false, 1=true) (bool).
long Long_t
Signed long integer 4 bytes (long). Size depends on architecture.
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
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 Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
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 r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t height
TASImagePlugin(const char *ext)
TString fGsExe
path to GhostScript interpreter
~TASPluginGS() override
dtor
TASPluginGS(const char *ext)
ctor
ASImage * File2ASImage(const char *filename) override
read PS/EPS/PDF file and convert it to ASImage
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
void ToLower()
Change string to lower-case.
TSubString Strip(EStripType s=kTrailing, char c=' ') const
Return a substring of self stripped at beginning and/or end.
const char * Data() const
TString & Append(const char *cs)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
void CallRecursiveRemoveIfNeeded(TObject &obj)
call RecursiveRemove for obj if gROOT is valid and obj.TestBit(kMustCleanup) is true.