Skip to main content

Pixel

Trait Pixel 

Source
pub trait Pixel: Copy + Sized {
    type Image: Sized + 'static;
    type Canvas: Canvas<Pixel = Self, Image = Self::Image>;

    // Required method
    fn default_color(color: Color) -> Self;

    // Provided method
    fn default_unit_size() -> (u32, u32) { ... }
}
Expand description

Abstraction of an image pixel.

Required Associated Types§

Source

type Image: Sized + 'static

Type of the finalized image.

Source

type Canvas: Canvas<Pixel = Self, Image = Self::Image>

The type that stores an intermediate buffer before finalizing to a concrete image

Required Methods§

Source

fn default_color(color: Color) -> Self

Obtains the default pixel color when a module is dark or light.

Provided Methods§

Source

fn default_unit_size() -> (u32, u32)

Obtains the default module size. The result must be at least 1×1.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§