Raxol.Terminal.ANSI.SixelPatternMap (Raxol v0.3.0)

View Source

Provides a mapping from Sixel characters to their 6-bit pixel patterns.

Summary

Functions

Gets the 6-bit integer pattern for a given Sixel character code.

Converts a 6-bit integer pattern into a list of 6 pixel values (0 or 1).

Functions

get_pattern(char_code)

@spec get_pattern(integer()) :: non_neg_integer() | nil

Gets the 6-bit integer pattern for a given Sixel character code.

Returns nil if the character code is outside the valid Sixel range (? to ~). Sixel characters range from ? (63) to ~ (126).

pattern_to_pixels(pattern)

@spec pattern_to_pixels(non_neg_integer()) :: [0 | 1]

Converts a 6-bit integer pattern into a list of 6 pixel values (0 or 1).

Bit 0 (LSB) corresponds to the top pixel.