pub trait RGBSource {
    // Required methods
    fn dimensions(&self) -> (usize, usize);
    fn pixel_f32(&self, x: usize, y: usize) -> (f32, f32, f32);

    // Provided method
    fn dimensions_i32(&self) -> (i32, i32) { ... }
}
Expand description

Source of arbitrarily formatted RGB data.

Required Methods§

source

fn dimensions(&self) -> (usize, usize)

Returns the underlying image size as an usize tuple (w, h).

source

fn pixel_f32(&self, x: usize, y: usize) -> (f32, f32, f32)

Extract the pixel value at the specified location. Pixel values are expected to be floats in the range [0, 255] (u8 represented as f32).

Provided Methods§

source

fn dimensions_i32(&self) -> (i32, i32)

Returns the underlying image size as an i32 tuple (w, h).

Implementors§