class

Opal::Shader::ShaderContext

Inherits Reference < Object

Execution context provided to a text fragment shader for each evaluated cell.

Constructors

new(x : Int32, y : Int32, local_x : Int32, local_y : Int32, width : Int32, height : Int32, region_width : Int32, region_height : Int32, time : Float64, frame : UInt64, source_buffer : UI::Buffer, cell : UI::Cell)
Source

Instance methods

bg

Background color getter & setter

Source
bg=(color : Color)
Source
bold!
Source
bold=(val : Bool)
Source
bold?

Attribute flags

Source
cell
Source
cell=(cell : UI::Cell)
Source
char

Character getter & setter

Source
char=(ch : Char)
Source
dim!
Source
dim=(val : Bool)
Source
dim?
Source
discard

Discards current cell modifications

Source
discarded=(discarded : Bool)
Source
discarded?
Source
dist_center

Distance from center (0.5, 0.5)

Source
dist_from(cx : Float64, cy : Float64) : Float64

Distance from specific normalized coordinates (cx, cy)

Source
fg

Foreground color getter & setter

Source
fg=(color : Color)
Source
frame
Source
frame=(frame : UInt64)
Source
height
Source
height=(height : Int32)
Source
invert!
Source
italic=(val : Bool)
Source
italic?
Source
lerp_bg(target : Color, factor : Float64) : Nil

Interpolates active background color toward target color

Source
lerp_fg(target : Color, factor : Float64) : Nil

Interpolates active foreground color toward target color

Source
local_u
Source
local_u=(local_u : Float64)
Source
local_v
Source
local_v=(local_v : Float64)
Source
local_x
Source
local_x=(local_x : Int32)
Source
local_y
Source
local_y=(local_y : Int32)
Source
noise

Fast deterministic pseudo-random float between 0.0 and 1.0

Source
region_height
Source
region_height=(region_height : Int32)
Source
region_width
Source
region_width=(region_width : Int32)
Source
replace_from(other : UI::Cell) : Nil

Replaces current cell state entirely from another cell

Source
reset(x : Int32, y : Int32, local_x : Int32, local_y : Int32, width : Int32, height : Int32, region_width : Int32, region_height : Int32, time : Float64, frame : UInt64, source_buffer : UI::Buffer, cell : UI::Cell) : Nil

Mutates context in-place to avoid per-cell heap allocations during fragment shader passes

Source
reverse=(val : Bool)
Source
reverse?
Source
sample(sx : Int32, sy : Int32) : UI::Cell

Samples another cell from the input source buffer

Source
sample_char(sx : Int32, sy : Int32) : Char

Samples only the character from the input source buffer

Source
sample_fg(sx : Int32, sy : Int32) : Color

Samples only the foreground color from the input source buffer

Source
source_buffer
Source
source_buffer=(source_buffer : UI::Buffer)
Source
time
Source
time=(time : Float64)
Source
underline=(val : Bool)
Source
underline?
Source
wave(freq : Float64 = 1.0, speed : Float64 = 1.0) : Float64

Procedural trigonometric wave functions (accelerated via FastMath LUT)

Source
wave_y(freq : Float64 = 1.0, speed : Float64 = 1.0) : Float64
Source
width
Source
width=(width : Int32)
Source
x=(x : Int32)
Source
y=(y : Int32)
Source