pixmap-class | R Documentation |
The family "pixmap"
(“pixel maps”) of classes provides
methods for creating,
plotting and converting bitmapped images in currently three different
formats: RGB ("pixmapRGB"
), grey
("pixmapGrey"
)and indexed pixmaps ("pixmapIndexed"
).
Objects can be created by calls of the form new("pixmap", ...)
or
using the creator functions pixmap
(similar for all child
classes of name ("pixmapXXX"
).
size
:Object of class "integer"
and length 2
(number of rows and columns).
cellres
:Object of class "numeric"
and length
2 specifying the cell resolution of each pixel in user coordinates.
bbox
:Object of class "numeric"
and length 4,
the coordinates of the bounding box (x bottom, y bottom, x top, y
top).
channels
:A character vector naming the channel slots
of the object (NULL
for indexed pixmaps).
red
, green
, blue
:Only for class
"pixmapRGB"
with matrices specifying the red, green
and blue
channel of the picture.
grey
:Only for class
"pixmapGrey"
, a matrix specifying the grey intensity
(0=black, 1=white) of the picture.
col
:Only for class
"pixmapGrey"
, a character vector with a map of color
names.
index
:Only for class
"pixmapIndexed"
, an integer matrix with codes from the
color map.
Class "pixmap"
specifies the basic geometry of a picture: the
size in pixels together with information for an optional coordinate
system, see pixmap
for details.
Grey and indexed pixmaps are besically matrices (contained in the
grey
or index
slot, respectively). The element [1,1]
corresponds to the upper left corner as usual. For grey pixmaps the
elements must be between 0 (black) and 1 (white). Indexed pixmaps have
integer elements, each giving the index number corresponding to the
palette specified in slot "col"
.
Colors are given using the usual R
color strings (either names like "red"
or hex values like
"#FF0000"
). Alternatively, a function to create a color palette
can be specified, see rainbow
or
heat.colors
for examples.
RGB pixmaps have three matrices for each of the three color channels. Elements of the matrices must be between 0 (=color off) and 1 (=color at maximum intensity).
Methods for coercion between all formats are available.
Class "pixmapChannels"
is a
helper parent class currently containing classes "pixmapRGB"
and "pixmapGrey"
.
Friedrich Leisch
pixmap
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.