bm_bitmap {bittermelon}R Documentation

Bitmap object

Description

bm_bitmap() creates an S3 object representing bitmap.

Usage

bm_bitmap(x)

Arguments

x

Object to be converted to bm_bitmap(). If not already an integer matrix it will be cast to one by as_bm_bitmap().

Details

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. Color bitmaps are supported (the integer can be any non-negative integer) but we are unlikely to ever support exporting color bitmap fonts. Color bitmaps can be cast to black-and-white bitmaps via bm_clamp().

Value

An integer matrix with a “bm_bitmap” subclass.

Supported S3 methods

See Also

as_bm_bitmap(), is_bm_bitmap()

Examples

 space <- bm_bitmap(matrix(0, nrow = 16, ncol = 16))
 print(space, px = ".")

[Package bittermelon version 1.1.2 Index]