DevDesc-class: Class "DevDescPtr" representing a C-level Graphics Device

Description Objects from the Class Slots Extends Methods Author(s) References See Also Examples

Description

The DevDescPtr class represents a C-level data structure that corresponds to an existing R graphics device. If the device is active, R graphics commands will cause the device's graphical operators to be called.

We typically obtain a reference to the graphics device via the function graphicsDevice. It is also passed as an argument in each call to the R functions that operate as graphical primitives for the R-level graphics device.

We can query and set the state of the device treating it like a list in R. We can then access the individual fields, querying and setting their values using the regular R operators [[ and \$, e.g. dev$left and dev$right = 1000.

Objects from the Class

Objects of class DevDescPtr are created by the R graphics engine in C code and via the function graphicsDevice. We do not create them ourselves.

On occassion, it might be useful to convert the reference to the C structure to an R structure, i.e. one with the corresponding slots and the values as R vectors, etc. We use the DevDesc class for this and we can convert using the as function, e.g. as(dev, "DevDesc").

Slots

left:

Object of class "numeric" typically 0

right:

Object of class "numeric" typically the width of the device

bottom:

Object of class "numeric" typically the height of the device

top:

Object of class "numeric" typically 0

clipLeft:

Object of class "numeric" typically 0

clipRight:

Object of class "numeric"

clipBottom:

Object of class "numeric"

clipTop:

Object of class "numeric"

xCharOffset:

Object of class "numeric"

yCharOffset:

Object of class "numeric"

yLineBias:

Object of class "numeric"

ipr:

Object of class "numeric" number of inches per raster "pixel"

cra:

Object of class "numeric" the size (width and height) of a character in rasters

gamma:

Object of class "numeric" the gamma correction

canClip:

Object of class "Rboolean" a logical value indicating whether the device can perform clipping operations itself or whether they should be done (more crudely) by R's graphics engine

canChangeGamma:

Object of class "Rboolean" a logical value indicating whether the gamma value can be changed during the life of the device.

canHAdj:

Object of class "integer" a value specifying whether the device can do horizontal alignment/justification. This can be one of 0, 1 or 2.

startps:

Object of class "numeric" the initial value for the point size, i.e. size of the "font"

startcol:

Object of class "integer", the default color for the pen for drawing lines, curves, etc.

startfill:

Object of class "integer" the default value for the fill color

startlty:

Object of class "integer" the initial/default value for the line type

startfont:

Object of class "integer" the default setting for the font.

startgamma:

Object of class "numeric" the default value for the gamma correction.

deviceSpecific:

a reference to the RDevDescMethodsPtr object in C that contains the collection of R functions that implement this C-level graphics device. One can coerce this to an RDevDescM

displayListOn:

Object of class "Rboolean"

canGenMouseDown:

Object of class "Rboolean"

canGenMouseMove:

Object of class "Rboolean"

canGenMouseUp:

Object of class "Rboolean"

canGenKeybd:

Object of class "Rboolean"

gettingEvent:

Object of class "Rboolean"

hasTextUTF8:

Object of class "Rboolean"

wantSymbolUTF8:

Object of class "Rboolean"

useRotatedTextInContour:

Object of class "Rboolean"

Extends

Class "CStruct-class", directly.

Methods

"[["

signature(x = "DevDescPtr"): these methods allow one to query and set the values of the individual fiels

"\$"

signature(x = "DevDescPtr"):

"[[<-"

signature(x = "DevDescPtr"):

"\$<-"

signature(x = "DevDescPtr"):

"as"

signature(x = "DevDescPtr"): this method allows us to convert the C-level reference to an R-level DevDesc object using regular coercion, i.e. as(dev, "DevDesc").

Author(s)

Duncan Temple Lang

References

“The R Internals Manual”, R Development Core Team.

See Also

graphicsDevice

Examples

1
showClass("DevDesc")

omegahat/RGraphicsDevice documentation built on Jan. 18, 2022, 4:37 a.m.