[][src]Struct prisma::Matrix3

pub struct Matrix3<T> {
    pub m: [T; 9],
}

A 3x3 matrix used for linear color transformations

Fields

m: [T; 9]

An array containing the cell values

Implementations

impl<T> Matrix3<T> where
    T: Num + Copy + Zero + NumCast
[src]

pub fn new(values: [T; 9]) -> Self[src]

Construct a new Matrix3 from a list of values (row major)

pub fn zero() -> Self[src]

Construct a new Matrix3 with all zero entries

pub fn identity() -> Self[src]

Construct an identity matrix

pub fn broadcast(val: T) -> Self[src]

Construct a new Matrix3 with all values set to val

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

Return a slice to the elements in the matrix

pub fn as_slice_mut(&mut self) -> &mut [T][src]

Return a mutable slice to the elements in the matrix

pub fn to_tuple(self) -> (T, T, T, T, T, T, T, T, T)[src]

Return a nine element tuple containing the elements

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

Compute the determinant of the matrix

pub fn transpose(self) -> Self[src]

Transpose the matrix

pub fn inverse(self) -> Option<Self>[src]

Compute the inverse of the matrix

None is returned if the matrix is singular (determinant = 0)

pub fn transform_vector<U>(&self, vec: (U, U, U)) -> (U, U, U) where
    U: NumCast
[src]

Transform a vector using self

Trait Implementations

impl<T> AbsDiffEq<Matrix3<T>> for Matrix3<T> where
    T: Num + Copy + AbsDiffEq,
    T::Epsilon: Clone
[src]

type Epsilon = T::Epsilon

Used for specifying relative comparisons.

impl<T> Add<Matrix3<T>> for Matrix3<T> where
    T: Num + Copy + AddAssign<T>, 
[src]

type Output = Self

The resulting type after applying the + operator.

impl<T> AddAssign<Matrix3<T>> for Matrix3<T> where
    T: Num + Copy + AddAssign<T>, 
[src]

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

impl<T: Copy> Copy for Matrix3<T>[src]

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

impl<T> Default for Matrix3<T> where
    T: Num + Copy + Default
[src]

impl<T> Display for Matrix3<T> where
    T: Num + Copy + Display
[src]

impl<T> Div<T> for Matrix3<T> where
    T: Num + Copy
[src]

type Output = Self

The resulting type after applying the / operator.

impl<T> DivAssign<T> for Matrix3<T> where
    T: Num + Copy
[src]

impl<T> Mul<Matrix3<T>> for Matrix3<T> where
    T: Num + Copy
[src]

type Output = Self

The resulting type after applying the * operator.

impl<T> Mul<T> for Matrix3<T> where
    T: Num + Copy
[src]

type Output = Self

The resulting type after applying the * operator.

impl<T> MulAssign<Matrix3<T>> for Matrix3<T> where
    T: Num + Copy
[src]

impl<T> MulAssign<T> for Matrix3<T> where
    T: Num + Copy
[src]

impl<T: PartialEq> PartialEq<Matrix3<T>> for Matrix3<T>[src]

impl<T> RelativeEq<Matrix3<T>> for Matrix3<T> where
    T: Num + Copy + RelativeEq,
    T::Epsilon: Clone
[src]

impl<T> StructuralPartialEq for Matrix3<T>[src]

impl<T> Sub<Matrix3<T>> for Matrix3<T> where
    T: Num + Copy + SubAssign<T>, 
[src]

type Output = Self

The resulting type after applying the - operator.

impl<T> SubAssign<Matrix3<T>> for Matrix3<T> where
    T: Num + Copy + SubAssign<T>, 
[src]

impl<T> UlpsEq<Matrix3<T>> for Matrix3<T> where
    T: Num + Copy + UlpsEq,
    T::Epsilon: Clone
[src]

Auto Trait Implementations

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

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

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

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

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

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[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.