as.matrix.bm_matrix: Cast bitmap/pixmap objects to a (normal) matrix
Description
as.matrix.bm_matrix() casts bm_bitmap() objects to a (normal) integer matrix
and bm_pixmap() objects to a (normal) character matrix (of color strings).
Note unless first_row_is_top = TRUE the bottom left pixel will still be
represented by the pixel in the first row and first column
(i.e. these methods simply remove the class names).
Usage
# S3 method for bm_matrix
as.matrix(x, first_row_is_top = FALSE, ...)
Value
Either an integer matrix if x is a bm_bitmap() object
or a character matrix if x is a bm_pixmap() object.
Arguments
x
Either a bm_bitmap() or bm_pixmap() object.
first_row_is_top
If TRUE the first row of the matrix will represent the top of the bitmap
(like grDevices::as.raster() objects).
If FALSE the first row of the matrix will represent the bottom of the bitmap
(like bm_bitmap() and bm_pixmap() objects).