Re: [Rd] raster support in graphics devices

From: baptiste auguie <>
Date: Tue, 01 Dec 2009 19:38:21 +0100

Very nice, thank you for this great addition to R graphics! I can't wait to see lattice and ggplot2 functions that use rasterGrob to display images. The pdf output is so much better in every way!

Incidentally, I ran into a segfault with grid.cap on the quartz device, but maybe it's normal at this stage.

This works fine:

cap <- grid.cap()

This doesn't:

cap <- grid.cap()


  1. .Call(fnname, ..., PACKAGE = "grid")
  2. grid.Call("L_cap")
  3. grid.cap()

Possible actions:

1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace

[ GUI 1.30 (5527) i386-apple-darwin9.8.0]

> sessionInfo()

R version 2.11.0 Under development (unstable) (2009-11-30 r50622) i386-apple-darwin9.8.0

[1] en_GB.UTF-8/en_GB.UTF-8/C/C/en_GB.UTF-8/en_GB.UTF-8

attached base packages:
[1] stats graphics grDevices utils datasets methods base

Best regards,


2009/12/1 Paul Murrell <>:
> Hi
> This is for developers of extension packages that provide extra *graphics
> devices* for R.
> In the *development* version of R, support has been added to the graphics
> engine for sending raster images (bitmaps) to a graphics device.  This
> consists mainly of two new device functions:  dev_Raster() and dev_Cap().
> The R_GE_version constant (in GraphicsEngine.h) has been bumped up to 6 as a
> marker of this change.
> This means that, at a minimum, all graphics devices should be updated to
> provide dummy implementations of these new functions that just say the
> feature is not yet implemented (see for example the PicTeX and XFig devices
> in the 'grDevices' package).
> A full implementation of dev_Raster() should be able to draw a raster image
> (provided as an array of 32-bit R colors) at any size, possibly (bilinear)
> interpolated (otherwise nearest-neighbour), at any orientation, and with a
> per-pixel alpha channel.  Where these are not natively supported by a
> device, the graphics engine provides some routines for scaling and rotating
> raster images (see for example the X11 device).  The dev_Cap() function
> should return a representation of a raster image captured from the current
> device.  This will only make sense for some devices (see for example the
> Cairo device in the 'grDevices' package).
> A little more information and a couple of small examples are provided at
> Paul
> --
> Dr Paul Murrell
> Department of Statistics
> The University of Auckland
> Private Bag 92019
> Auckland
> New Zealand
> 64 9 3737599 x85392
> ______________________________________________
> mailing list
> mailing list Received on Tue 01 Dec 2009 - 19:09:19 GMT

This archive was generated by hypermail 2.2.0 : Wed 02 Dec 2009 - 00:40:57 GMT