radiant_rs

Trait Postprocessor

Source
pub trait Postprocessor {
    type T;

    // Required methods
    fn target(&self) -> &Texture;
    fn draw(&self, renderer: &Renderer, args: &Self::T);

    // Provided method
    fn process(&self, renderer: &Renderer, args: &Self::T) { ... }
}
Expand description

A custom postprocessor.

Postprocessing happens in three steps:

  • first, target() is invoked and expected to return an input texture target (to which the user will draw the input data to be postprocessed).
  • process() is invoked. Any drawing operations performed within will target the input texture.
  • draw() is invoked. Any drawing operations performed within will target the destination defined by the user.

Required Associated Types§

Source

type T

Custom type for the args parameter supplied to process() and draw().

Required Methods§

Source

fn target(&self) -> &Texture

Expected to return a texture for user drawing operations to target.

Source

fn draw(&self, renderer: &Renderer, args: &Self::T)

Expected to draw the final result. Draws issued within this function will target the rendertarget that the postprocessor is supposed to render to.

Provided Methods§

Source

fn process(&self, renderer: &Renderer, args: &Self::T)

Optionally expected to processes input data. Draws issued within this function will target the texure returned by target() unless overridden via Renderer::render_to().

Implementors§