Skip to main content

CanShade

Trait CanShade 

Source
pub trait CanShade {
    // Required method
    fn shade(&mut self, pixel: Pixel) -> Pixel;
}
Expand description

To write a shader you must have a struct that implements this shader

Required Methods§

Source

fn shade(&mut self, pixel: Pixel) -> Pixel

This function accepts a pixel and returns the adjusted pixel, as you wish to adjust it

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§