[][src]Struct ndarray_image::NdImage

pub struct NdImage<T>(pub T);

This newtype struct can wrap an image from either the ndarray or image crates to automatically allow them to be turned into() the equivalents in the other crate. This works without copying.

Trait Implementations

impl<'a, C, A: 'static> Into<ArrayBase<ViewRepr<&'a A>, Dim<[usize; 2]>>> for NdImage<&'a ImageBuffer<Luma<A>, C>> where
    A: Primitive,
    C: Deref<Target = [A]> + AsRef<[A]>, 
[src]

Turn grayscale images into 2d array views.

impl<'a, C, P: 'static, A: 'static> Into<ArrayBase<ViewRepr<&'a A>, Dim<[usize; 3]>>> for NdImage<&'a ImageBuffer<P, C>> where
    A: Primitive,
    P: Pixel<Subpixel = A>,
    C: Deref<Target = [P::Subpixel]> + AsRef<[A]>, 
[src]

Turn arbitrary images into 3d array views with one dimension for the color channel.

impl<'a, C, A: 'static> Into<ArrayBase<ViewRepr<&'a mut A>, Dim<[usize; 2]>>> for NdImage<&'a mut ImageBuffer<Luma<A>, C>> where
    A: Primitive,
    C: Deref<Target = [A]> + AsRef<[A]>, 
[src]

Turn grayscale images into mutable 2d array views.

impl<'a, C, P: 'static, A: 'static> Into<ArrayBase<ViewRepr<&'a mut A>, Dim<[usize; 3]>>> for NdImage<&'a mut ImageBuffer<P, C>> where
    A: Primitive,
    P: Pixel<Subpixel = A>,
    C: Deref<Target = [P::Subpixel]> + AsRef<[A]>, 
[src]

Turn arbitrary images into mutable 3d array views with one dimension for the color channel.

impl<'a, A: 'static> Into<Option<ImageBuffer<Bgr<A>, &'a [A]>>> for NdImage<NdColor<'a, A>> where
    A: Primitive
[src]

Turn 3d ArrayView into a Bgr image.

Can fail if the ArrayView is not contiguous or has the wrong number of channels.

impl<'a, A: 'static> Into<Option<ImageBuffer<Bgra<A>, &'a [A]>>> for NdImage<NdColor<'a, A>> where
    A: Primitive
[src]

Turn 3d ArrayView into a Bgra image.

Can fail if the ArrayView is not contiguous or has the wrong number of channels.

impl<'a, A: 'static> Into<Option<ImageBuffer<Luma<A>, &'a [A]>>> for NdImage<NdGray<'a, A>> where
    A: Primitive
[src]

Turn 2d ArrayView into a Luma image.

Can fail if the ArrayView is not contiguous.

impl<'a, A: 'static> Into<Option<ImageBuffer<Luma<A>, &'a [A]>>> for NdImage<NdColor<'a, A>> where
    A: Primitive
[src]

Turn 3d ArrayView into a Luma image.

Can fail if the ArrayView is not contiguous or has the wrong number of channels.

impl<'a, A: 'static> Into<Option<ImageBuffer<LumaA<A>, &'a [A]>>> for NdImage<NdColor<'a, A>> where
    A: Primitive
[src]

Turn 3d ArrayView into a LumaA image.

Can fail if the ArrayView is not contiguous or has the wrong number of channels.

impl<'a, A: 'static> Into<Option<ImageBuffer<Rgb<A>, &'a [A]>>> for NdImage<NdColor<'a, A>> where
    A: Primitive
[src]

Turn 3d ArrayView into a Rgb image.

Can fail if the ArrayView is not contiguous or has the wrong number of channels.

impl<'a, A: 'static> Into<Option<ImageBuffer<Rgba<A>, &'a [A]>>> for NdImage<NdColor<'a, A>> where
    A: Primitive
[src]

Turn 3d ArrayView into a Rgba image.

Can fail if the ArrayView is not contiguous or has the wrong number of channels.

Auto Trait Implementations

impl<T> RefUnwindSafe for NdImage<T> where
    T: RefUnwindSafe

impl<T> Send for NdImage<T> where
    T: Send

impl<T> Sync for NdImage<T> where
    T: Sync

impl<T> Unpin for NdImage<T> where
    T: Unpin

impl<T> UnwindSafe for NdImage<T> where
    T: UnwindSafe

Blanket Implementations

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

impl<'a, A, D, T> AsArray<'a, A, D> for T where
    A: 'a,
    D: Dimension,
    T: Into<ArrayBase<ViewRepr<&'a A>, D>>, 
[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> SetParameter for T

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.