Opal::UI::MaskMap
A 2D normalized weight map (values from 0.0 to 1.0) used for alpha stencil masking, spotlights, and feathered dithering effects in terminal screen buffers.
Constants
DITHER_CHARS = Opal::Glyphs::Shades
Shading characters for dithering fractional alpha values: 0.0 -> 1.0
Constructors
box(bx : Int32, by : Int32, bw : Int32, bh : Int32, feather : Float64 = 0.0, width : Int32 = 80, height : Int32 = 25) : MaskMap
Generates a rectangular box mask with optional feathering around its perimeter
checkerboard(tile_w : Int32 = 4, tile_h : Int32 = 2, width : Int32 = 80, height : Int32 = 25) : MaskMap
Generates a checkerboard mask pattern
linear_gradient(angle_degrees : Float64, width : Int32 = 80, height : Int32 = 25, start_val : Float64 = 0.0, end_val : Float64 = 1.0) : MaskMap
Generates a linear gradient mask along a specified angle (in degrees, 0 = left-to-right, 90 = top-to-bottom)
radial(cx : Float64 | Int32, cy : Float64 | Int32, radius : Float64, feather : Float64 = 0.0, width : Int32 = 80, height : Int32 = 25, aspect_ratio : Float64 = 2.0) : MaskMap
Generates a circular or elliptical radial mask centered at (cx, cy) with optional feathering. Terminal cells have an aspect ratio of roughly 2:1 (height:width), which is compensated for.
Class methods
Instance methods
Blends this mask with another mask using :multiply, :screen, :add, or :subtract
height
Sourceweights
Sourcewidth
Source