class
Opal::Shader::ShaderContext
- Opal::Shader::ShaderContext
- Reference
- Object
Overview
Execution context provided to a text fragment shader for each evaluated cell.
Defined in:
opal/shader/context.crConstructors
Instance Method Summary
-
#bg : Color
Background color getter & setter
- #bg=(color : Color)
- #bold! : Nil
- #bold=(val : Bool)
-
#bold? : Bool
Attribute flags
- #cell : UI::Cell
- #cell=(cell : UI::Cell)
-
#char : Char
Character getter & setter
- #char=(ch : Char)
- #dim! : Nil
- #dim=(val : Bool)
- #dim? : Bool
-
#discard : Nil
Discards current cell modifications
- #discarded=(discarded : Bool)
- #discarded? : Bool
-
#dist_center : Float64
Distance from center (0.5, 0.5)
-
#dist_from(cx : Float64, cy : Float64) : Float64
Distance from specific normalized coordinates (cx, cy)
-
#fg : Color
Foreground color getter & setter
- #fg=(color : Color)
- #frame : UInt64
- #frame=(frame : UInt64)
- #height : Int32
- #height=(height : Int32)
- #invert! : Nil
- #italic=(val : Bool)
- #italic? : Bool
-
#lerp_bg(target : Color, factor : Float64) : Nil
Interpolates active background color toward target color
-
#lerp_fg(target : Color, factor : Float64) : Nil
Interpolates active foreground color toward target color
- #local_u : Float64
- #local_u=(local_u : Float64)
- #local_v : Float64
- #local_v=(local_v : Float64)
- #local_x : Int32
- #local_x=(local_x : Int32)
- #local_y : Int32
- #local_y=(local_y : Int32)
-
#noise : Float64
Fast deterministic pseudo-random float between 0.0 and 1.0
- #region_height : Int32
- #region_height=(region_height : Int32)
- #region_width : Int32
- #region_width=(region_width : Int32)
-
#replace_from(other : UI::Cell) : Nil
Replaces current cell state entirely from another cell
-
#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
- #reverse=(val : Bool)
- #reverse? : Bool
-
#sample(sx : Int32, sy : Int32) : UI::Cell
Samples another cell from the input source buffer
-
#sample_char(sx : Int32, sy : Int32) : Char
Samples only the character from the input source buffer
-
#sample_fg(sx : Int32, sy : Int32) : Color
Samples only the foreground color from the input source buffer
- #source_buffer : UI::Buffer
- #source_buffer=(source_buffer : UI::Buffer)
- #time : Float64
- #time=(time : Float64)
- #u : Float64
- #u=(u : Float64)
- #underline=(val : Bool)
- #underline? : Bool
- #v : Float64
- #v=(v : Float64)
-
#wave(freq : Float64 = 1.0, speed : Float64 = 1.0) : Float64
Procedural trigonometric wave functions (accelerated via FastMath LUT)
- #wave_y(freq : Float64 = 1.0, speed : Float64 = 1.0) : Float64
- #width : Int32
- #width=(width : Int32)
- #x : Int32
- #x=(x : Int32)
- #y : Int32
- #y=(y : Int32)
Constructor Detail
Instance Method Detail
Distance from specific normalized coordinates (cx, cy)
Interpolates active background color toward target color
Interpolates active foreground color toward target color
Replaces current cell state entirely from another cell
Mutates context in-place to avoid per-cell heap allocations during fragment shader passes
Samples another cell from the input source buffer
Samples only the character from the input source buffer
Samples only the foreground color from the input source buffer
Procedural trigonometric wave functions (accelerated via FastMath LUT)