Table of Contents

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

char

DotsPerCellHeight

Number of vertical pixels per terminal cell in braille mode.

public const int DotsPerCellHeight = 4

Field Value

int

DotsPerCellWidth

Number of horizontal pixels per terminal cell in braille mode.

public const int DotsPerCellWidth = 2

Field Value

int

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

pixels bool[,]

The pixel grid [height, width]. True = filled.

x0 int

Start X coordinate.

y0 int

Start Y coordinate.

x1 int

End X coordinate.

y1 int

End 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

pixels bool[,]

The pixel grid [height, width].

cellCol int

The cell column index (each cell is 2 pixels wide).

cellRow int

The cell row index (each cell is 4 pixels tall).

Returns

char

A Unicode Braille character (U+2800 to U+28FF).