Class Family "pixmap".

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 from the Class

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").


Object of class "integer" and length 2 (number of rows and columns).
Object of class "numeric" and length 2 specifying the cell resolution of each pixel in user coordinates.
Object of class "numeric" and length 4, the coordinates of the bounding box (x bottom, y bottom, x top, y top).
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.
Only for class "pixmapGrey", a matrix specifying the grey intensity (0=black, 1=white) of the picture.
Only for class "pixmapGrey", a character vector with a map of color names.
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".

See Also


  • pixmap-class
  • pixmapRGB-class
  • pixmapGrey-class
  • pixmapIndexed-class
  • pixmapChannels-class
  • coerce,pixmapGrey,pixmapIndexed-method
  • coerce,pixmapGrey,pixmapRGB-method
  • coerce,pixmapRGB,pixmapGrey-method
  • coerce,pixmapRGB,pixmapIndexed-method
  • coerce,pixmapIndexed,pixmapRGB-method
  • coerce,ANY,pixmapGrey-method
  • coerce,ANY,pixmapIndexed-method
Documentation reproduced from package pixmap, version 0.4-11, License: GPL-2

Community examples

Looks like there are no examples yet.