class

Opal::UI::AsciiImage

Inherits Opal::UI::Element < Opal::UI::Themable < Reference < Object

UI Element that renders TrueColor pixel buffers as terminal ASCII art. Supports high-resolution half-block rendering, optical luminance nearest-char rendering, nearest-neighbor & bilinear interpolation, and aspect ratio compensation.

Constants

RAMP_BLOCKS = " ░▒▓█"

High-contrast glyph ramp

RAMP_DETAILED = " .'`^\",:;Il!i><~+_-?][}{1)(|\\/tfjrxnuvczXYUJCLQ0OZmwqpdbkhao*#MW&8%B@$"

Detailed 70-level ASCII optical density ramp

RAMP_STANDARD = " .:-=+*#%@"

Standard 10-level ASCII optical density ramp (light to dark)

Constructors

new(image : Opal::Image::PixelBuffer, mode : Symbol | AsciiRenderMode = :half_block, interpolation : Symbol | Opal::Image::Interpolation = :bilinear, ramp : String = RAMP_STANDARD, colorize : Bool = true, bold : Bool = false, bg : Color | Symbol | String = Color.none)
Source

Instance methods

bg=(bg : Color)
Source
bold=(bold : Bool)
Source
bold?
Source
colorize=(colorize : Bool)
Source
colorize?
Source
image
Source
interpolation
Source
interpolation=(interpolation : Opal::Image::Interpolation)
Source
mode
Source
mode=(mode : AsciiRenderMode)
Source
preferred_size(available_w : Int32, available_h : Int32) : Tuple(Int32, Int32)
Source
ramp
Source
ramp=(ramp : String)
Source
render(buffer : Buffer, x : Int32, y : Int32, width : Int32, height : Int32) : Nil
Source