20 #include "RConfigure.h" 23 # define X_DISPLAY_MISSING 1 24 # define popen_flags "r" 26 # include "Windows4root.h" 27 # define popen_flags "rb" 29 # include <X11/Xlib.h> 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 77 Warning(
"File2ASImage",
"GhostScript is not available");
82 Warning(
"File2ASImage",
"input file %s is not accessible", filename);
86 TString ext = (strrchr(filename,
'.') + 1);
96 FILE *fd = fopen(filename,
"r");
98 Warning(
"File2ASImage",
"input file %s is not readable", filename);
110 sscanf(line.
Data(),
"%d %d %d %d", &lx, &ly, &ux, &uy);
123 cmd +=
Form(
" -g%dx%d", width, height);
125 cmd +=
" -dSAFER -dBATCH -dNOPAUSE -dQUIET -sDEVICE=png16m -dGraphicsAlphaBits=4 -sOutputFile=- ";
133 const UInt_t kBuffLength = 32768;
134 static char buf[kBuffLength];
138 Long_t r = fread(&buf, 1, kBuffLength, in);
139 raw.
Append((
const char*)&buf, r);
144 ASImageImportParams params;
146 params.width = width;
147 params.height = height;
148 params.filter = SCL_DO_ALL;
150 params.gamma_table = 0;
151 params.compression = 0;
152 params.format = ASA_ASImage;
153 params.search_path = 0;
156 ASImage *ret = PNGBuff2ASimage((CARD8 *)raw.
Data(), ¶ms);
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
void ToLower()
Change string to lower-case.
virtual char * Which(const char *search, const char *file, EAccessMode mode=kFileExists)
Find location of file in a search path.
virtual FILE * OpenPipe(const char *command, const char *mode)
Open a pipe.
virtual const char * Getenv(const char *env)
Get environment variable.
virtual ~TASPluginGS()
dtor
TString & Append(const char *cs)
TASPluginGS(const char *ext)
ctor
ASImage * File2ASImage(const char *filename)
read PS/EPS/PDF file and convert it to ASImage
R__EXTERN TSystem * gSystem
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
char * Form(const char *fmt,...)
TSubString Strip(EStripType s=kTrailing, char c=' ') const
Return a substring of self stripped at beginning and/or end.
virtual int ClosePipe(FILE *pipe)
Close the pipe.
char * StrDup(const char *str)
Duplicate the string str.
Allows to read PS/EPS/PDF files via GhostScript.
char * fInterpreter
path to GhostScript interpreter
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
const char * Data() const