[][src]Struct ffimage::packed::image::generic::GenericView

pub struct GenericView<'a, T: Pixel> { /* fields omitted */ }

Image view parametrized by its pixel type

Implementations

impl<'a, T: Pixel> GenericView<'a, T>[src]

pub fn new(raw: &'a [T::T], width: u32, height: u32) -> Option<Self>[src]

Returns an image view with pixel accessors

The backing memory storage must have the same element type as the underlying pixel type of the image.

Arguments

  • raw - Raw memory region to interpret as typed image
  • width - Width in pixels
  • height - Height in pixels

Example

use ffimage::color::rgb::*;
use ffimage::packed::GenericImageView;

let mem = vec![0; 3];
let view = GenericImageView::<Rgb<u8>>::new(&mem, 1, 1).expect("Memory region too small");

pub fn raw(&self) -> &[T::T][src]

Trait Implementations

impl<'a, T: Pixel> AccessPixel for GenericView<'a, T>[src]

type PixelType = T

impl<'a, '_, T: Pixel> From<&'_ GenericView<'a, T>> for GenericBuffer<T>[src]

impl<'a, T: Pixel> ImageView for GenericView<'a, T>[src]

type T = T

Pixel type

impl<'a, T: Pixel> IntoIterator for &'a GenericView<'a, T>[src]

type Item = &'a T

The type of the elements being iterated over.

type IntoIter = PixelIter<'a, GenericView<'a, T>>

Which kind of iterator are we turning this into?

impl<'a, SP, DP> TryConvert<GenericBuffer<DP>> for GenericView<'a, SP> where
    SP: Pixel,
    DP: Pixel,
    SP: TryConvertSlice<DP>, 
[src]

type Error = ()

impl<'a, 'b, SP, DP> TryConvert<GenericFlatBuffer<'b, DP>> for GenericView<'a, SP> where
    SP: Pixel,
    DP: Pixel,
    SP: TryConvertSlice<DP>, 
[src]

type Error = ()

impl<'a, '_, T> TryFrom<&'_ DynamicView<'a>> for GenericView<'a, T> where
    T: Pixel<T = u8>, 
[src]

type Error = ()

The type returned in the event of a conversion error.

Auto Trait Implementations

impl<'a, T> RefUnwindSafe for GenericView<'a, T> where
    <T as Pixel>::T: RefUnwindSafe

impl<'a, T> Send for GenericView<'a, T> where
    <T as Pixel>::T: Sync

impl<'a, T> Sync for GenericView<'a, T> where
    <T as Pixel>::T: Sync

impl<'a, T> Unpin for GenericView<'a, T>

impl<'a, T> UnwindSafe for GenericView<'a, T> where
    <T as Pixel>::T: RefUnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.