Learn R Programming

plotcli (version 0.2.0)

BrailleCanvas: Braille Canvas Class

Description

Braille Canvas Class

Braille Canvas Class

Arguments

Super class

plotcli::Canvas -> BrailleCanvas

Public fields

braille_base

Unicode code point for empty Braille character

Methods

Inherited methods


Method new()

Initialize Braille canvas

Usage

BrailleCanvas$new(width, height)

Arguments

width

Character width

height

Character height


Method get_dot_bit()

Get the bit value for a dot position

Usage

BrailleCanvas$get_dot_bit(dot_row, dot_col)

Arguments

dot_row

Row within Braille cell (0-3)

dot_col

Column within Braille cell (0-1)

Returns

Bit value


Method set_pixel()

Set a pixel in Braille space

Usage

BrailleCanvas$set_pixel(x, y, color = NULL)

Arguments

x

X coordinate (1-based, in pixel space: 1 to width*2)

y

Y coordinate (1-based, in pixel space: 1 to height*4, 1 = top)

color

Optional color name


Method clone()

The objects of this class are cloneable with this method.

Usage

BrailleCanvas$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Details

High-resolution canvas using Unicode Braille patterns. Resolution: 2x4 (2 horizontal, 4 vertical dots per character = 8x resolution)

Braille dot layout (dot numbers and bit values):


       Col 0  Col 1     Bit values
Row 0:   1      4        0x01  0x08
Row 1:   2      5        0x02  0x10
Row 2:   3      6        0x04  0x20
Row 3:   7      8        0x40  0x80