Skip to main content

DisplayTransform

Trait DisplayTransform 

Source
pub trait DisplayTransform:
    Send
    + Sync
    + Debug {
    // Required method
    fn stage(&self, target: &DisplayTarget) -> Stage;

    // Provided methods
    fn apply(&self, target: &DisplayTarget, scene: &[f32], out: &mut [Color32]) { ... }
    fn apply_f32(&self, target: &DisplayTarget, scene: &[f32], out: &mut [f32]) { ... }
    fn revision(&self) -> u64 { ... }
}
Expand description

The application’s colour management at the end of the viewport.

Required Methods§

Source

fn stage(&self, target: &DisplayTarget) -> Stage

The stage for a target (the GPU path runs it in its shader).

Provided Methods§

Source

fn apply(&self, target: &DisplayTarget, scene: &[f32], out: &mut [Color32])

Scene pixels (RGBA floats) to display colours, on the CPU. By default the stage’s arithmetic; override for a LUT or anything the stage cannot express (then deliver display pixels from the source, as the GPU path only runs stages).

Source

fn apply_f32(&self, target: &DisplayTarget, scene: &[f32], out: &mut [f32])

Scene pixels (RGBA floats) to encoded floats for a target, on the CPU (an export, a surface of the application’s own): the stage’s arithmetic, alpha kept.

Source

fn revision(&self) -> u64

Bumped when the transform changes (pixels transformed on the CPU are then redone).

Implementors§