Class BrailleHelpers
- Namespace
- SharpConsoleUI.Helpers
- Assembly
- SharpConsoleUI.dll
Shared static helpers for pixel-grid braille rendering. Provides Bresenham's line algorithm and braille character mapping for controls that render using Unicode Braille patterns (U+2800 block).
public static class BrailleHelpers
- Inheritance
-
BrailleHelpers
- Inherited Members
Fields
BrailleEmpty
Unicode Braille base character (all dots off).
public const char BrailleEmpty = '⠀'
Field Value
DotsPerCellHeight
Number of vertical pixels per terminal cell in braille mode.
public const int DotsPerCellHeight = 4
Field Value
DotsPerCellWidth
Number of horizontal pixels per terminal cell in braille mode.
public const int DotsPerCellWidth = 2
Field Value
Methods
DrawLinePixels(bool[,], int, int, int, int)
Draws a line on a boolean pixel grid using Bresenham's line algorithm.
public static void DrawLinePixels(bool[,] pixels, int x0, int y0, int x1, int y1)
Parameters
pixelsbool[,]The pixel grid [height, width]. True = filled.
x0intStart X coordinate.
y0intStart Y coordinate.
x1intEnd X coordinate.
y1intEnd Y coordinate.
GetBrailleChar(bool[,], int, int)
Converts a 2x4 pixel block at the given cell position to a Unicode Braille character.
public static char GetBrailleChar(bool[,] pixels, int cellCol, int cellRow)
Parameters
pixelsbool[,]The pixel grid [height, width].
cellColintThe cell column index (each cell is 2 pixels wide).
cellRowintThe cell row index (each cell is 4 pixels tall).
Returns
- char
A Unicode Braille character (U+2800 to U+28FF).