bm_bitmap {bittermelon} | R Documentation |
Bittermelon bitmap matrix object
Description
bm_bitmap()
creates an S3 matrix subclass representing a bitmap.
Usage
bm_bitmap(x)
Arguments
x |
Object to be converted to |
Details
Intended to represent binary bitmaps especially (but not limited to) bitmap font glyphs.
Bitmaps are represented as integer matrices with special class methods.
The bottom left pixel is represented by the first row and first column.
The bottom right pixel is represented by the first row and last column.
The top left pixel is represented by the last row and first column.
The top right pixel is represented by the last row and last column.
Non-binary bitmaps are supported (the integer can be any non-negative integer) but we are unlikely to ever support exporting color bitmap fonts.
Non-binary bitmaps can be cast to binary bitmaps via
bm_clamp()
.See
bm_pixmap()
for an alternative S3 object backed by a color string matrix.
Value
An integer matrix with “bm_bitmap” and “bm_matrix” subclasses.
Supported S3 methods
-
Ops.bm_bitmap()
for all the S3 “Ops” Group generic functions
See Also
as_bm_bitmap()
, is_bm_bitmap()
Examples
space <- bm_bitmap(matrix(0, nrow = 16, ncol = 16))
print(space)