RAPI
Data Structures | Defines | Typedefs | Enumerations | Functions
R_ext/GraphicsEngine.h File Reference
#include <R_ext/GraphicsDevice.h>
Include dependency graph for GraphicsEngine.h:

Go to the source code of this file.

Data Structures

struct  R_GE_gcontext
struct  GESystemDesc
struct  _GEDevDesc

Defines

#define R_GE_version   11
#define MAX_GRAPHICS_SYSTEMS   24
#define desc2GEDesc   Rf_desc2GEDesc
#define fromDeviceX   GEfromDeviceX
#define toDeviceX   GEtoDeviceX
#define fromDeviceY   GEfromDeviceY
#define toDeviceY   GEtoDeviceY
#define fromDeviceWidth   GEfromDeviceWidth
#define toDeviceWidth   GEtoDeviceWidth
#define fromDeviceHeight   GEfromDeviceHeight
#define toDeviceHeight   GEtoDeviceHeight
#define RGBpar   Rf_RGBpar
#define RGBpar3   Rf_RGBpar3
#define col2name   Rf_col2name
#define LTY_BLANK   -1
#define LTY_SOLID   0
#define LTY_DASHED   4 + (4<<4)
#define LTY_DOTTED   1 + (3<<4)
#define LTY_DOTDASH   1 + (3<<4) + (4<<8) + (3<<12)
#define LTY_LONGDASH   7 + (3<<4)
#define LTY_TWODASH   2 + (2<<4) + (6<<8) + (2<<12)
#define DEG2RAD   0.01745329251994329576
#define CreateAtVector   Rf_CreateAtVector
#define GAxisPars   Rf_GAxisPars

Typedefs

typedef R_GE_gcontextpGEcontext
typedef struct _GEDevDesc GEDevDesc
typedef SEXP(* GEcallback )(GEevent, GEDevDesc *, SEXP)
typedef GEDevDescpGEDevDesc
typedef unsigned int rcolor

Enumerations

enum  GEUnit { GE_DEVICE = 0, GE_NDC = 1, GE_INCHES = 2, GE_CM = 3 }
enum  GEevent {
  GE_InitState = 0, GE_FinaliseState = 1, GE_SaveState = 2, GE_RestoreState = 6,
  GE_CopyState = 3, GE_SaveSnapshotState = 4, GE_RestoreSnapshotState = 5, GE_CheckPlot = 7,
  GE_ScalePS = 8
}
enum  R_GE_lineend { GE_ROUND_CAP = 1, GE_BUTT_CAP = 2, GE_SQUARE_CAP = 3 }
enum  R_GE_linejoin { GE_ROUND_JOIN = 1, GE_MITRE_JOIN = 2, GE_BEVEL_JOIN = 3 }

Functions

int R_GE_getVersion (void)
void R_GE_checkVersionOrDie (int version)
pGEDevDesc desc2GEDesc (pDevDesc dd)
int GEdeviceNumber (pGEDevDesc dd)
pGEDevDesc GEgetDevice (int i)
void GEaddDevice (pGEDevDesc gdd)
void GEaddDevice2 (pGEDevDesc gdd, const char *name)
void GEaddDevice2f (pGEDevDesc gdd, const char *name, const char *file)
void GEkillDevice (pGEDevDesc gdd)
pGEDevDesc GEcreateDevDesc (pDevDesc dev)
void GEdestroyDevDesc (pGEDevDesc dd)
void * GEsystemState (pGEDevDesc dd, int index)
void GEregisterWithDevice (pGEDevDesc dd)
void GEregisterSystem (GEcallback callback, int *systemRegisterIndex)
void GEunregisterSystem (int registerIndex)
SEXP GEhandleEvent (GEevent event, pDevDesc dev, SEXP data)
double fromDeviceX (double value, GEUnit to, pGEDevDesc dd)
double toDeviceX (double value, GEUnit from, pGEDevDesc dd)
double fromDeviceY (double value, GEUnit to, pGEDevDesc dd)
double toDeviceY (double value, GEUnit from, pGEDevDesc dd)
double fromDeviceWidth (double value, GEUnit to, pGEDevDesc dd)
double toDeviceWidth (double value, GEUnit from, pGEDevDesc dd)
double fromDeviceHeight (double value, GEUnit to, pGEDevDesc dd)
double toDeviceHeight (double value, GEUnit from, pGEDevDesc dd)
rcolor RGBpar (SEXP x, int i)
rcolor RGBpar3 (SEXP x, int i, rcolor bg)
const char * col2name (rcolor col)
rcolor R_GE_str2col (const char *s)
R_GE_lineend GE_LENDpar (SEXP value, int ind)
SEXP GE_LENDget (R_GE_lineend lend)
R_GE_linejoin GE_LJOINpar (SEXP value, int ind)
SEXP GE_LJOINget (R_GE_linejoin ljoin)
void GESetClip (double x1, double y1, double x2, double y2, pGEDevDesc dd)
void GENewPage (const pGEcontext gc, pGEDevDesc dd)
void GELine (double x1, double y1, double x2, double y2, const pGEcontext gc, pGEDevDesc dd)
void GEPolyline (int n, double *x, double *y, const pGEcontext gc, pGEDevDesc dd)
void GEPolygon (int n, double *x, double *y, const pGEcontext gc, pGEDevDesc dd)
SEXP GEXspline (int n, double *x, double *y, double *s, Rboolean open, Rboolean repEnds, Rboolean draw, const pGEcontext gc, pGEDevDesc dd)
void GECircle (double x, double y, double radius, const pGEcontext gc, pGEDevDesc dd)
void GERect (double x0, double y0, double x1, double y1, const pGEcontext gc, pGEDevDesc dd)
void GEPath (double *x, double *y, int npoly, int *nper, Rboolean winding, const pGEcontext gc, pGEDevDesc dd)
void GERaster (unsigned int *raster, int w, int h, double x, double y, double width, double height, double angle, Rboolean interpolate, const pGEcontext gc, pGEDevDesc dd)
SEXP GECap (pGEDevDesc dd)
void GEText (double x, double y, const char *const str, cetype_t enc, double xc, double yc, double rot, const pGEcontext gc, pGEDevDesc dd)
void GEMode (int mode, pGEDevDesc dd)
void GESymbol (double x, double y, int pch, double size, const pGEcontext gc, pGEDevDesc dd)
void GEPretty (double *lo, double *up, int *ndiv)
void GEMetricInfo (int c, const pGEcontext gc, double *ascent, double *descent, double *width, pGEDevDesc dd)
double GEStrWidth (const char *str, cetype_t enc, const pGEcontext gc, pGEDevDesc dd)
double GEStrHeight (const char *str, cetype_t enc, const pGEcontext gc, pGEDevDesc dd)
void GEStrMetric (const char *str, cetype_t enc, const pGEcontext gc, double *ascent, double *descent, double *width, pGEDevDesc dd)
int GEstring_to_pch (SEXP pch)
unsigned int GE_LTYpar (SEXP value, int ind)
SEXP GE_LTYget (unsigned int lty)
void R_GE_rasterScale (unsigned int *sraster, int sw, int sh, unsigned int *draster, int dw, int dh)
void R_GE_rasterInterpolate (unsigned int *sraster, int sw, int sh, unsigned int *draster, int dw, int dh)
void R_GE_rasterRotatedSize (int w, int h, double angle, int *wnew, int *hnew)
void R_GE_rasterRotatedOffset (int w, int h, double angle, int botleft, double *xoff, double *yoff)
void R_GE_rasterResizeForRotation (unsigned int *sraster, int w, int h, unsigned int *newRaster, int wnew, int hnew, const pGEcontext gc)
void R_GE_rasterRotate (unsigned int *sraster, int w, int h, double angle, unsigned int *draster, const pGEcontext gc, Rboolean perPixelAlpha)
double GEExpressionWidth (SEXP expr, const pGEcontext gc, pGEDevDesc dd)
double GEExpressionHeight (SEXP expr, const pGEcontext gc, pGEDevDesc dd)
void GEExpressionMetric (SEXP expr, const pGEcontext gc, double *ascent, double *descent, double *width, pGEDevDesc dd)
void GEMathText (double x, double y, SEXP expr, double xc, double yc, double rot, const pGEcontext gc, pGEDevDesc dd)
SEXP GEcontourLines (double *x, int nx, double *y, int ny, double *z, double *levels, int nl)
double R_GE_VStrWidth (const char *s, cetype_t enc, const pGEcontext gc, pGEDevDesc dd)
double R_GE_VStrHeight (const char *s, cetype_t enc, const pGEcontext gc, pGEDevDesc dd)
void R_GE_VText (double x, double y, const char *const s, cetype_t enc, double x_justify, double y_justify, double rotation, const pGEcontext gc, pGEDevDesc dd)
pGEDevDesc GEcurrentDevice (void)
Rboolean GEdeviceDirty (pGEDevDesc dd)
void GEdirtyDevice (pGEDevDesc dd)
Rboolean GEcheckState (pGEDevDesc dd)
Rboolean GErecording (SEXP call, pGEDevDesc dd)
void GErecordGraphicOperation (SEXP op, SEXP args, pGEDevDesc dd)
void GEinitDisplayList (pGEDevDesc dd)
void GEplayDisplayList (pGEDevDesc dd)
void GEcopyDisplayList (int fromDevice)
SEXP GEcreateSnapshot (pGEDevDesc dd)
void GEplaySnapshot (SEXP snapshot, pGEDevDesc dd)
void GEonExit (void)
void GEnullDevice (void)
SEXP CreateAtVector (double *axp, double *usr, int nint, Rboolean logflag)
void GAxisPars (double *min, double *max, int *n, Rboolean log, int axis)

Define Documentation

#define col2name   Rf_col2name
#define CreateAtVector   Rf_CreateAtVector
#define DEG2RAD   0.01745329251994329576
#define desc2GEDesc   Rf_desc2GEDesc
#define fromDeviceHeight   GEfromDeviceHeight
#define fromDeviceWidth   GEfromDeviceWidth
#define fromDeviceX   GEfromDeviceX
#define fromDeviceY   GEfromDeviceY
#define GAxisPars   Rf_GAxisPars
#define LTY_BLANK   -1
#define LTY_DASHED   4 + (4<<4)
#define LTY_DOTDASH   1 + (3<<4) + (4<<8) + (3<<12)
#define LTY_DOTTED   1 + (3<<4)
#define LTY_LONGDASH   7 + (3<<4)
#define LTY_SOLID   0
#define LTY_TWODASH   2 + (2<<4) + (6<<8) + (2<<12)
#define MAX_GRAPHICS_SYSTEMS   24
#define R_GE_version   11
#define RGBpar   Rf_RGBpar
#define RGBpar3   Rf_RGBpar3
#define toDeviceHeight   GEtoDeviceHeight
#define toDeviceWidth   GEtoDeviceWidth
#define toDeviceX   GEtoDeviceX
#define toDeviceY   GEtoDeviceY

Typedef Documentation

typedef struct _GEDevDesc GEDevDesc
typedef unsigned int rcolor

Enumeration Type Documentation

enum GEevent
Enumerator:
GE_InitState 
GE_FinaliseState 
GE_SaveState 
GE_RestoreState 
GE_CopyState 
GE_SaveSnapshotState 
GE_RestoreSnapshotState 
GE_CheckPlot 
GE_ScalePS 
             {
    /* In response to this event, the registered graphics system
     * should allocate and initialise the systemSpecific structure
     *
     * Should return R_NilValue on failure so that engine
     * can tidy up memory allocation
     */
    GE_InitState = 0,
    /* This event gives the registered system a chance to undo
     * anything done in the initialisation.
     */
    GE_FinaliseState = 1,
    /* This is sent by the graphics engine prior to initialising
     * the display list.  It give the graphics system the chance
     * to squirrel away information it will need for redrawing the
     * the display list
     */
    GE_SaveState = 2,
    /* This is sent by the graphics engine prior to replaying the
     * display list.  It gives the graphics system the chance to
     * restore any information it saved on the GE_SaveState event
     */
    GE_RestoreState = 6,
    /* Copy system state information to the current device.
     * This is used when copying graphics from one device to another
     * so all the graphics system needs to do is to copy across
     * the bits required for the display list to draw faithfully
     * on the new device.
     */
    GE_CopyState = 3,
    /* Create a snapshot of the system state that is sufficient
     * for the current "image" to be reproduced
     */
    GE_SaveSnapshotState = 4,
    /* Restore the system state that is saved by GE_SaveSnapshotState
     */
    GE_RestoreSnapshotState = 5,
    /* When replaying the display list, the graphics engine
     * checks, after each replayed action, that the action
     * produced valid output.  This is the graphics system's
     * chance to say that the output is crap (in which case the
     * graphics engine will abort the display list replay).
     */
    GE_CheckPlot = 7,
    /* The device wants to scale the current pointsize
     * (for scaling an image)
     * This is not a nice general solution, but a quick fix for
     * the Windows device.
     */
    GE_ScalePS = 8
} GEevent;
enum GEUnit
Enumerator:
GE_DEVICE 
GE_NDC 
GE_INCHES 
GE_CM 
             {
 GE_DEVICE  = 0,    /* native device coordinates (rasters) */
 GE_NDC = 1,    /* normalised device coordinates x=(0,1), y=(0,1) */
 GE_INCHES = 2,
 GE_CM     = 3
} GEUnit;
Enumerator:
GE_ROUND_CAP 
GE_BUTT_CAP 
GE_SQUARE_CAP 
Enumerator:
GE_ROUND_JOIN 
GE_MITRE_JOIN 
GE_BEVEL_JOIN 

Function Documentation

const char* col2name ( rcolor  col)
SEXP CreateAtVector ( double *  axp,
double *  usr,
int  nint,
Rboolean  logflag 
)
double fromDeviceHeight ( double  value,
GEUnit  to,
pGEDevDesc  dd 
)
double fromDeviceWidth ( double  value,
GEUnit  to,
pGEDevDesc  dd 
)
double fromDeviceX ( double  value,
GEUnit  to,
pGEDevDesc  dd 
)
double fromDeviceY ( double  value,
GEUnit  to,
pGEDevDesc  dd 
)
void GAxisPars ( double *  min,
double *  max,
int *  n,
Rboolean  log,
int  axis 
)
R_GE_lineend GE_LENDpar ( SEXP  value,
int  ind 
)
R_GE_linejoin GE_LJOINpar ( SEXP  value,
int  ind 
)
SEXP GE_LTYget ( unsigned int  lty)
unsigned int GE_LTYpar ( SEXP  value,
int  ind 
)
void GEaddDevice ( pGEDevDesc  gdd)
void GEaddDevice2 ( pGEDevDesc  gdd,
const char *  name 
)
void GEaddDevice2f ( pGEDevDesc  gdd,
const char *  name,
const char *  file 
)
void GECircle ( double  x,
double  y,
double  radius,
const pGEcontext  gc,
pGEDevDesc  dd 
)
SEXP GEcontourLines ( double *  x,
int  nx,
double *  y,
int  ny,
double *  z,
double *  levels,
int  nl 
)
void GEcopyDisplayList ( int  fromDevice)
void GEdirtyDevice ( pGEDevDesc  dd)
double GEExpressionHeight ( SEXP  expr,
const pGEcontext  gc,
pGEDevDesc  dd 
)
void GEExpressionMetric ( SEXP  expr,
const pGEcontext  gc,
double *  ascent,
double *  descent,
double *  width,
pGEDevDesc  dd 
)
double GEExpressionWidth ( SEXP  expr,
const pGEcontext  gc,
pGEDevDesc  dd 
)
pGEDevDesc GEgetDevice ( int  i)
SEXP GEhandleEvent ( GEevent  event,
pDevDesc  dev,
SEXP  data 
)
void GEkillDevice ( pGEDevDesc  gdd)
void GELine ( double  x1,
double  y1,
double  x2,
double  y2,
const pGEcontext  gc,
pGEDevDesc  dd 
)
void GEMathText ( double  x,
double  y,
SEXP  expr,
double  xc,
double  yc,
double  rot,
const pGEcontext  gc,
pGEDevDesc  dd 
)
void GEMetricInfo ( int  c,
const pGEcontext  gc,
double *  ascent,
double *  descent,
double *  width,
pGEDevDesc  dd 
)
void GEMode ( int  mode,
pGEDevDesc  dd 
)
void GENewPage ( const pGEcontext  gc,
pGEDevDesc  dd 
)
void GEnullDevice ( void  )
void GEonExit ( void  )
void GEPath ( double *  x,
double *  y,
int  npoly,
int *  nper,
Rboolean  winding,
const pGEcontext  gc,
pGEDevDesc  dd 
)
void GEplaySnapshot ( SEXP  snapshot,
pGEDevDesc  dd 
)
void GEPolygon ( int  n,
double *  x,
double *  y,
const pGEcontext  gc,
pGEDevDesc  dd 
)
void GEPolyline ( int  n,
double *  x,
double *  y,
const pGEcontext  gc,
pGEDevDesc  dd 
)
void GEPretty ( double *  lo,
double *  up,
int *  ndiv 
)
void GERaster ( unsigned int *  raster,
int  w,
int  h,
double  x,
double  y,
double  width,
double  height,
double  angle,
Rboolean  interpolate,
const pGEcontext  gc,
pGEDevDesc  dd 
)
void GErecordGraphicOperation ( SEXP  op,
SEXP  args,
pGEDevDesc  dd 
)
Rboolean GErecording ( SEXP  call,
pGEDevDesc  dd 
)
void GERect ( double  x0,
double  y0,
double  x1,
double  y1,
const pGEcontext  gc,
pGEDevDesc  dd 
)
void GEregisterSystem ( GEcallback  callback,
int *  systemRegisterIndex 
)
void GESetClip ( double  x1,
double  y1,
double  x2,
double  y2,
pGEDevDesc  dd 
)
double GEStrHeight ( const char *  str,
cetype_t  enc,
const pGEcontext  gc,
pGEDevDesc  dd 
)
int GEstring_to_pch ( SEXP  pch)
void GEStrMetric ( const char *  str,
cetype_t  enc,
const pGEcontext  gc,
double *  ascent,
double *  descent,
double *  width,
pGEDevDesc  dd 
)
double GEStrWidth ( const char *  str,
cetype_t  enc,
const pGEcontext  gc,
pGEDevDesc  dd 
)
void GESymbol ( double  x,
double  y,
int  pch,
double  size,
const pGEcontext  gc,
pGEDevDesc  dd 
)
void* GEsystemState ( pGEDevDesc  dd,
int  index 
)
void GEText ( double  x,
double  y,
const char *const  str,
cetype_t  enc,
double  xc,
double  yc,
double  rot,
const pGEcontext  gc,
pGEDevDesc  dd 
)
void GEunregisterSystem ( int  registerIndex)
SEXP GEXspline ( int  n,
double *  x,
double *  y,
double *  s,
Rboolean  open,
Rboolean  repEnds,
Rboolean  draw,
const pGEcontext  gc,
pGEDevDesc  dd 
)
void R_GE_checkVersionOrDie ( int  version)
int R_GE_getVersion ( void  )
void R_GE_rasterInterpolate ( unsigned int *  sraster,
int  sw,
int  sh,
unsigned int *  draster,
int  dw,
int  dh 
)
void R_GE_rasterResizeForRotation ( unsigned int *  sraster,
int  w,
int  h,
unsigned int *  newRaster,
int  wnew,
int  hnew,
const pGEcontext  gc 
)
void R_GE_rasterRotate ( unsigned int *  sraster,
int  w,
int  h,
double  angle,
unsigned int *  draster,
const pGEcontext  gc,
Rboolean  perPixelAlpha 
)
void R_GE_rasterRotatedOffset ( int  w,
int  h,
double  angle,
int  botleft,
double *  xoff,
double *  yoff 
)
void R_GE_rasterRotatedSize ( int  w,
int  h,
double  angle,
int *  wnew,
int *  hnew 
)
void R_GE_rasterScale ( unsigned int *  sraster,
int  sw,
int  sh,
unsigned int *  draster,
int  dw,
int  dh 
)
rcolor R_GE_str2col ( const char *  s)
double R_GE_VStrHeight ( const char *  s,
cetype_t  enc,
const pGEcontext  gc,
pGEDevDesc  dd 
)
double R_GE_VStrWidth ( const char *  s,
cetype_t  enc,
const pGEcontext  gc,
pGEDevDesc  dd 
)
void R_GE_VText ( double  x,
double  y,
const char *const  s,
cetype_t  enc,
double  x_justify,
double  y_justify,
double  rotation,
const pGEcontext  gc,
pGEDevDesc  dd 
)
rcolor RGBpar ( SEXP  x,
int  i 
)
rcolor RGBpar3 ( SEXP  x,
int  i,
rcolor  bg 
)
double toDeviceHeight ( double  value,
GEUnit  from,
pGEDevDesc  dd 
)
double toDeviceWidth ( double  value,
GEUnit  from,
pGEDevDesc  dd 
)
double toDeviceX ( double  value,
GEUnit  from,
pGEDevDesc  dd 
)
double toDeviceY ( double  value,
GEUnit  from,
pGEDevDesc  dd 
)
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines