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# include <win32/config.h>
37# include <win32/afterbase.h>
38# define X_DISPLAY_MISSING 1
79 Warning(
"File2ASImage",
"GhostScript is not available");
107 if (
line.IsNull() || !
line.BeginsWith(
"%"))
break;
109 if (
line.BeginsWith(
"%%BoundingBox:")) {
112 sscanf(
line.Data(),
"%d %d %d %d", &lx, &ly, &ux, &uy);
127 cmd +=
" -dSAFER -dBATCH -dNOPAUSE -dQUIET -sDEVICE=png16m -dGraphicsAlphaBits=4 -sOutputFile=- ";
135 const UInt_t kBuffLength = 32768;
136 static char buf[kBuffLength];
140 Long_t r = fread(&buf, 1, kBuffLength, in);
141 raw.
Append((
const char*)&buf,
r);
146 ASImageImportParams params;
148 params.width =
width;
150 params.filter = SCL_DO_ALL;
152 params.gamma_table =
nullptr;
153 params.compression = 0;
154 params.format = ASA_ASImage;
155 params.search_path =
nullptr;
158 ASImage *ret = PNGBuff2ASimage((CARD8 *)raw.
Data(), ¶ms);
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
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
char * StrDup(const char *str)
Duplicate the string str.
R__EXTERN TSystem * gSystem
Allows to read PS/EPS/PDF files via GhostScript.
char * fInterpreter
path to GhostScript interpreter
TASPluginGS(const char *ext)
ctor
ASImage * File2ASImage(const char *filename) override
read PS/EPS/PDF file and convert it to ASImage
virtual ~TASPluginGS()
dtor
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)
virtual const char * Getenv(const char *env)
Get environment variable.
virtual FILE * OpenPipe(const char *command, const char *mode)
Open a pipe.
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
virtual int ClosePipe(FILE *pipe)
Close the pipe.
virtual char * Which(const char *search, const char *file, EAccessMode mode=kFileExists)
Find location of file in a search path.
void CallRecursiveRemoveIfNeeded(TObject &obj)
call RecursiveRemove for obj if gROOT is valid and obj.TestBit(kMustCleanup) is true.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.