Struct rscolorq::Matrix3d[][src]

pub struct Matrix3d<T> { /* fields omitted */ }

Three-dimensional matrix.

Implementations

impl<T: Clone + Default> Matrix3d<T>[src]

pub fn new(width: usize, height: usize, depth: usize) -> Self[src]

Creates a new Matrix3d initialized with default values.

pub fn from_vec(data: Vec<T>, width: usize, height: usize, depth: usize) -> Self[src]

Creates a Matrix3d from a Vec.

Panics if width by height by depth does not equal the supplied Vec’s length.

let matrix = rscolorq::Matrix3d::from_vec(vec![0, 1, 2], 1, 2, 1);

pub fn width(&self) -> usize[src]

Returns the width of the Matrix3d.

pub fn height(&self) -> usize[src]

Returns the height of the Matrix3d.

pub fn depth(&self) -> usize[src]

Returns the depth of the Matrix3d.

pub fn get(&self, i: usize, j: usize, k: usize) -> Option<&T>[src]

Returns a reference to the indexed element.

pub fn get_mut(&mut self, i: usize, j: usize, k: usize) -> Option<&mut T>[src]

Returns a mutable reference to the indexed element.

pub fn into_raw_vec(self) -> Vec<T>[src]

Consume the Matrix3d and return the underlying Vec.

pub fn iter(&self) -> Iter<'_, T>[src]

Returns an iterator to the underlying Vec.

pub fn iter_mut(&mut self) -> IterMut<'_, T>[src]

Returns a mutable iterator to the underlying Vec.

Trait Implementations

impl<T: Clone> Clone for Matrix3d<T>[src]

impl<T: Debug> Debug for Matrix3d<T>[src]

Auto Trait Implementations

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

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

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

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

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

Blanket Implementations

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
    T: Component + Float,
    D: AdaptFrom<S, Swp, Dwp, T>,
    Swp: WhitePoint,
    Dwp: WhitePoint
[src]

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, U> ConvertInto<U> for T where
    U: ConvertFrom<T>, 
[src]

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.