Struct framing::Function
[−]
[src]
pub struct Function<T, F> where
F: Fn(usize, usize) -> T, { /* fields omitted */ }
A frame backed by a function.
This might be useful if you just wanted to hack together a fractal renderer,
or wanted to wrap an image coming from a C library. Using move
closures
with this struct essentially lets you build anonymous frames.
Methods
impl<T, F> Function<T, F> where
F: Fn(usize, usize) -> T,
[src]
F: Fn(usize, usize) -> T,
Trait Implementations
impl<T: Clone, F: Clone> Clone for Function<T, F> where
F: Fn(usize, usize) -> T,
[src]
F: Fn(usize, usize) -> T,
fn clone(&self) -> Function<T, F>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<T: Debug, F: Debug> Debug for Function<T, F> where
F: Fn(usize, usize) -> T,
[src]
F: Fn(usize, usize) -> T,
impl<T, F> Image for Function<T, F> where
F: Fn(usize, usize) -> T,
[src]
F: Fn(usize, usize) -> T,
type Pixel = T
The kind of pixel that the frame is made of.
fn width(&self) -> usize
The width of the frame in pixels.
fn height(&self) -> usize
The height of the frame in pixels.
unsafe fn pixel(&self, x: usize, y: usize) -> Self::Pixel
Gets the pixel at the specified zero-indexed coordinates. Read more