Package org.aesh.charts.canvas
Class BrailleEncoder
java.lang.Object
org.aesh.charts.canvas.BrailleEncoder
Encodes sub-cell coordinates into Unicode Braille characters (U+2800-U+28FF).
Each braille character represents a 2-wide x 4-tall dot matrix, giving 2x horizontal and 4x vertical resolution per terminal character cell.
Dot positions and bit mapping:
Col 0 Col 1 Bit 0 Bit 3 Row 0 Row 0 Bit 1 Bit 4 Row 1 Row 1 Bit 2 Bit 5 Row 2 Row 2 Bit 6 Bit 7Character = U+2800 + (bit0 | bit1 | ... | bit7)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intHeight of a braille cell in sub-pixels.static final intWidth of a braille cell in sub-pixels. -
Method Summary
-
Field Details
-
CELL_WIDTH
public static final int CELL_WIDTHWidth of a braille cell in sub-pixels.- See Also:
-
CELL_HEIGHT
public static final int CELL_HEIGHTHeight of a braille cell in sub-pixels.- See Also:
-
-
Method Details
-
dotBit
public static int dotBit(int row, int col) Get the bit mask for a specific dot position.- Parameters:
row- row within the cell (0-3, top to bottom)col- column within the cell (0-1, left to right)- Returns:
- the bit mask
-
toChar
public static char toChar(int bits) Convert a bit pattern to the corresponding braille character.- Parameters:
bits- the combined bit pattern (0x00-0xFF)- Returns:
- the braille character
-
empty
public static char empty()Return the empty braille character (no dots set).
-