pub struct NdImage<T>(pub T);Expand description
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.
Tuple Fields§
§0: TTrait Implementations§
Source§impl<'a, C, A> Into<ArrayBase<ViewRepr<&'a A>, Dim<[usize; 2]>>> for NdImage<&'a ImageBuffer<Luma<A>, C>>
Turn grayscale images into 2d array views.
impl<'a, C, A> Into<ArrayBase<ViewRepr<&'a A>, Dim<[usize; 2]>>> for NdImage<&'a ImageBuffer<Luma<A>, C>>
Turn grayscale images into 2d array views.
Source§impl<'a, C, P, A> Into<ArrayBase<ViewRepr<&'a A>, Dim<[usize; 3]>>> for NdImage<&'a ImageBuffer<P, C>>
Turn arbitrary images into 3d array views with one dimension for the color channel.
impl<'a, C, P, A> Into<ArrayBase<ViewRepr<&'a A>, Dim<[usize; 3]>>> for NdImage<&'a ImageBuffer<P, C>>
Turn arbitrary images into 3d array views with one dimension for the color channel.
Source§impl<'a, C, A> Into<ArrayBase<ViewRepr<&'a mut A>, Dim<[usize; 2]>>> for NdImage<&'a mut ImageBuffer<Luma<A>, C>>
Turn grayscale images into mutable 2d array views.
impl<'a, C, A> Into<ArrayBase<ViewRepr<&'a mut A>, Dim<[usize; 2]>>> for NdImage<&'a mut ImageBuffer<Luma<A>, C>>
Turn grayscale images into mutable 2d array views.
Source§impl<'a, C, P, A> Into<ArrayBase<ViewRepr<&'a mut A>, Dim<[usize; 3]>>> for NdImage<&'a mut ImageBuffer<P, C>>
Turn arbitrary images into mutable 3d array views with one dimension for the color channel.
impl<'a, C, P, A> Into<ArrayBase<ViewRepr<&'a mut A>, Dim<[usize; 3]>>> for NdImage<&'a mut ImageBuffer<P, C>>
Turn arbitrary images into mutable 3d array views with one dimension for the color channel.
Source§fn into(self) -> NdColorMut<'a, A>
fn into(self) -> NdColorMut<'a, A>
Source§impl<'a, A> Into<Option<ImageBuffer<Bgr<A>, &'a [A]>>> for NdImage<NdColor<'a, A>>where
A: Primitive + 'static,
Turn 3d ArrayView into a Bgr image.
impl<'a, A> Into<Option<ImageBuffer<Bgr<A>, &'a [A]>>> for NdImage<NdColor<'a, A>>where
A: Primitive + 'static,
Turn 3d ArrayView into a Bgr image.
Can fail if the ArrayView is not contiguous or has the wrong number of channels.
Source§impl<'a, A> Into<Option<ImageBuffer<Bgra<A>, &'a [A]>>> for NdImage<NdColor<'a, A>>where
A: Primitive + 'static,
Turn 3d ArrayView into a Bgra image.
impl<'a, A> Into<Option<ImageBuffer<Bgra<A>, &'a [A]>>> for NdImage<NdColor<'a, A>>where
A: Primitive + 'static,
Turn 3d ArrayView into a Bgra image.
Can fail if the ArrayView is not contiguous or has the wrong number of channels.
Source§impl<'a, A> Into<Option<ImageBuffer<Luma<A>, &'a [A]>>> for NdImage<NdGray<'a, A>>where
A: Primitive + 'static,
Turn 2d ArrayView into a Luma image.
impl<'a, A> Into<Option<ImageBuffer<Luma<A>, &'a [A]>>> for NdImage<NdGray<'a, A>>where
A: Primitive + 'static,
Turn 2d ArrayView into a Luma image.
Can fail if the ArrayView is not contiguous.
Source§impl<'a, A> Into<Option<ImageBuffer<Luma<A>, &'a [A]>>> for NdImage<NdColor<'a, A>>where
A: Primitive + 'static,
Turn 3d ArrayView into a Luma image.
impl<'a, A> Into<Option<ImageBuffer<Luma<A>, &'a [A]>>> for NdImage<NdColor<'a, A>>where
A: Primitive + 'static,
Turn 3d ArrayView into a Luma image.
Can fail if the ArrayView is not contiguous or has the wrong number of channels.
Source§impl<'a, A> Into<Option<ImageBuffer<LumaA<A>, &'a [A]>>> for NdImage<NdColor<'a, A>>where
A: Primitive + 'static,
Turn 3d ArrayView into a LumaA image.
impl<'a, A> Into<Option<ImageBuffer<LumaA<A>, &'a [A]>>> for NdImage<NdColor<'a, A>>where
A: Primitive + 'static,
Turn 3d ArrayView into a LumaA image.
Can fail if the ArrayView is not contiguous or has the wrong number of channels.
Source§impl<'a, A> Into<Option<ImageBuffer<Rgb<A>, &'a [A]>>> for NdImage<NdColor<'a, A>>where
A: Primitive + 'static,
Turn 3d ArrayView into a Rgb image.
impl<'a, A> Into<Option<ImageBuffer<Rgb<A>, &'a [A]>>> for NdImage<NdColor<'a, A>>where
A: Primitive + 'static,
Turn 3d ArrayView into a Rgb image.
Can fail if the ArrayView is not contiguous or has the wrong number of channels.