Skip to main content

PixelRemapper

Trait PixelRemapper 

Source
pub trait PixelRemapper {
    const VIRT_ROWS: usize;
    const VIRT_COLS: usize;
    const FB_ROWS: usize;
    const FB_COLS: usize;

    // Required method
    fn remap_xy(x: usize, y: usize) -> (usize, usize);

    // Provided methods
    fn remap<C: PixelColor>(pixel: Pixel<C>) -> Pixel<C> { ... }
    fn remap_point(point: Point) -> Point { ... }
    fn virtual_size() -> (usize, usize) { ... }
    fn fb_size() -> (usize, usize) { ... }
}
Expand description

Trait for pixel re-mappers

Implementors of this trait will remap x,y coordinates from a virtual panel to the actual framebuffer used to drive the panels

§Type Parameters

  • PANEL_ROWS - Number of rows in a single panel
  • PANEL_COLS - Number of columns in a single panel
  • TILE_ROWS - Number of panels stacked vertically
  • TILE_COLS - Number of panels stacked horizontally

Required Associated Constants§

Source

const VIRT_ROWS: usize

Number of rows in the virtual panel

Source

const VIRT_COLS: usize

Number of columns in the virtual panel

Source

const FB_ROWS: usize

Number of rows in the actual framebuffer

Source

const FB_COLS: usize

Number of columns in the actual framebuffer

Required Methods§

Source

fn remap_xy(x: usize, y: usize) -> (usize, usize)

Remap an x,y coordinate to a framebuffer pixel

Provided Methods§

Source

fn remap<C: PixelColor>(pixel: Pixel<C>) -> Pixel<C>

Remap a virtual pixel to a framebuffer pixel

Source

fn remap_point(point: Point) -> Point

Remap a virtual point to a framebuffer point

Source

fn virtual_size() -> (usize, usize)

Size of the virtual panel

Source

fn fb_size() -> (usize, usize)

Size of the framebuffer that this remaps to

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl<const PANEL_ROWS: usize, const PANEL_COLS: usize, const TILE_ROWS: usize, const TILE_COLS: usize> PixelRemapper for ChainTopRightDown<PANEL_ROWS, PANEL_COLS, TILE_ROWS, TILE_COLS>