Skip to main content

PixelTarget

Trait PixelTarget 

Source
pub trait PixelTarget {
    // Required methods
    fn width(&self) -> usize;
    fn height(&self) -> usize;
    fn put_pixel(&mut self, x: usize, y: usize, color: Rgb888);

    // Provided method
    fn put_pixel_565(&mut self, x: usize, y: usize, rgb565: u16) { ... }
}
Expand description

A raw pixel sink that accepts individual pixels by integer coordinates.

Every CydFrame implements this trait, so DrawItem values can draw directly onto any CYD frame. See the canonical DrawItem example for construction, rendering, and framebuffer verification.

Required Methods§

Source

fn width(&self) -> usize

Source

fn height(&self) -> usize

Source

fn put_pixel(&mut self, x: usize, y: usize, color: Rgb888)

Provided Methods§

Source

fn put_pixel_565(&mut self, x: usize, y: usize, rgb565: u16)

Write a pre-packed RGB565 pixel (bit layout RRRRR_GGGGGG_BBBBB).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§