[−][src]Trait nshare::MutNdarray3
Mutably borrows a 3d type to a ndarray 2d array type.
Coordinates are in (channel, row, col)
, where channel is typically a color channel,
or they are in (z, y, x)
.
This uses an associated type to avoid ambiguity for the compiler. By calling this, the compiler always knows the returned type.
Associated Types
Loading content...Required methods
pub fn mut_ndarray3(self) -> Self::Out
[src]
Implementations on Foreign Types
impl<'a, P> MutNdarray3 for &'a mut ImageBuffer<P, Vec<P::Subpixel>> where
P: Pixel + 'static,
[src]
P: Pixel + 'static,
use image::{RgbImage, Rgb}; use nshare::MutNdarray3; use ndarray::s; let mut vals = RgbImage::new(2, 4); // Set all the blue channel to 255. vals.mut_ndarray3().slice_mut(s![2, .., ..]).fill(255); assert_eq!(vals[(0, 0)], Rgb([0, 0, 255]));