class Opal::Shader::ShaderContext

Overview

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

Defined in:

opal/shader/context.cr

Constructors

Instance Method Summary

Constructor Detail

def self.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) #

[View source]

Instance Method Detail

def bg : Color #

Background color getter & setter


[View source]
def bg=(color : Color) #

[View source]
def bold! : Nil #

[View source]
def bold=(val : Bool) #

[View source]
def bold? : Bool #

Attribute flags


[View source]
def cell : UI::Cell #

[View source]
def cell=(cell : UI::Cell) #

[View source]
def char : Char #

Character getter & setter


[View source]
def char=(ch : Char) #

[View source]
def dim! : Nil #

[View source]
def dim=(val : Bool) #

[View source]
def dim? : Bool #

[View source]
def discard : Nil #

Discards current cell modifications


[View source]
def discarded=(discarded : Bool) #

[View source]
def discarded? : Bool #

[View source]
def dist_center : Float64 #

Distance from center (0.5, 0.5)


[View source]
def dist_from(cx : Float64, cy : Float64) : Float64 #

Distance from specific normalized coordinates (cx, cy)


[View source]
def fg : Color #

Foreground color getter & setter


[View source]
def fg=(color : Color) #

[View source]
def frame : UInt64 #

[View source]
def frame=(frame : UInt64) #

[View source]
def height : Int32 #

[View source]
def height=(height : Int32) #

[View source]
def invert! : Nil #

[View source]
def italic=(val : Bool) #

[View source]
def italic? : Bool #

[View source]
def lerp_bg(target : Color, factor : Float64) : Nil #

Interpolates active background color toward target color


[View source]
def lerp_fg(target : Color, factor : Float64) : Nil #

Interpolates active foreground color toward target color


[View source]
def local_u : Float64 #

[View source]
def local_u=(local_u : Float64) #

[View source]
def local_v : Float64 #

[View source]
def local_v=(local_v : Float64) #

[View source]
def local_x : Int32 #

[View source]
def local_x=(local_x : Int32) #

[View source]
def local_y : Int32 #

[View source]
def local_y=(local_y : Int32) #

[View source]
def noise : Float64 #

Fast deterministic pseudo-random float between 0.0 and 1.0


[View source]
def region_height : Int32 #

[View source]
def region_height=(region_height : Int32) #

[View source]
def region_width : Int32 #

[View source]
def region_width=(region_width : Int32) #

[View source]
def replace_from(other : UI::Cell) : Nil #

Replaces current cell state entirely from another cell


[View source]
def 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


[View source]
def reverse=(val : Bool) #

[View source]
def reverse? : Bool #

[View source]
def sample(sx : Int32, sy : Int32) : UI::Cell #

Samples another cell from the input source buffer


[View source]
def sample_char(sx : Int32, sy : Int32) : Char #

Samples only the character from the input source buffer


[View source]
def sample_fg(sx : Int32, sy : Int32) : Color #

Samples only the foreground color from the input source buffer


[View source]
def source_buffer : UI::Buffer #

[View source]
def source_buffer=(source_buffer : UI::Buffer) #

[View source]
def time : Float64 #

[View source]
def time=(time : Float64) #

[View source]
def u : Float64 #

[View source]
def u=(u : Float64) #

[View source]
def underline=(val : Bool) #

[View source]
def underline? : Bool #

[View source]
def v : Float64 #

[View source]
def v=(v : Float64) #

[View source]
def wave(freq : Float64 = 1.0, speed : Float64 = 1.0) : Float64 #

Procedural trigonometric wave functions (accelerated via FastMath LUT)


[View source]
def wave_y(freq : Float64 = 1.0, speed : Float64 = 1.0) : Float64 #

[View source]
def width : Int32 #

[View source]
def width=(width : Int32) #

[View source]
def x : Int32 #

[View source]
def x=(x : Int32) #

[View source]
def y : Int32 #

[View source]
def y=(y : Int32) #

[View source]