[−][src]Struct prisma::Matrix3
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]
T: Num + Copy + Zero + NumCast,
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]
U: NumCast,
Transform a vector using self
Trait Implementations
impl<T> AbsDiffEq<Matrix3<T>> for Matrix3<T> where
T: Num + Copy + AbsDiffEq,
T::Epsilon: Clone,
[src]
T: Num + Copy + AbsDiffEq,
T::Epsilon: Clone,
type Epsilon = T::Epsilon
Used for specifying relative comparisons.
fn default_epsilon() -> Self::Epsilon
[src]
fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool
[src]
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
[src]
impl<T> Add<Matrix3<T>> for Matrix3<T> where
T: Num + Copy + AddAssign<T>,
[src]
T: Num + Copy + AddAssign<T>,
type Output = Self
The resulting type after applying the +
operator.
fn add(self, rhs: Self) -> Self
[src]
impl<T> AddAssign<Matrix3<T>> for Matrix3<T> where
T: Num + Copy + AddAssign<T>,
[src]
T: Num + Copy + AddAssign<T>,
fn add_assign(&mut self, rhs: Self)
[src]
impl<T> Clone for Matrix3<T> where
T: Clone,
[src]
T: Clone,
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[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]
T: Num + Copy + Default,
impl<T> Display for Matrix3<T> where
T: Num + Copy + Display,
[src]
T: Num + Copy + Display,
impl<T> Div<T> for Matrix3<T> where
T: Num + Copy,
[src]
T: Num + Copy,
type Output = Self
The resulting type after applying the /
operator.
fn div(self, rhs: T) -> Self
[src]
impl<T> DivAssign<T> for Matrix3<T> where
T: Num + Copy,
[src]
T: Num + Copy,
fn div_assign(&mut self, rhs: T)
[src]
impl<T> Mul<Matrix3<T>> for Matrix3<T> where
T: Num + Copy,
[src]
T: Num + Copy,
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, rhs: Matrix3<T>) -> Self
[src]
impl<T> Mul<T> for Matrix3<T> where
T: Num + Copy,
[src]
T: Num + Copy,
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, rhs: T) -> Self
[src]
impl<T> MulAssign<Matrix3<T>> for Matrix3<T> where
T: Num + Copy,
[src]
T: Num + Copy,
fn mul_assign(&mut self, rhs: Matrix3<T>)
[src]
impl<T> MulAssign<T> for Matrix3<T> where
T: Num + Copy,
[src]
T: Num + Copy,
fn mul_assign(&mut self, rhs: T)
[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]
T: Num + Copy + RelativeEq,
T::Epsilon: Clone,
fn default_max_relative() -> Self::Epsilon
[src]
fn relative_eq(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
[src]
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
fn relative_ne(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
[src]
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
impl<T> StructuralPartialEq for Matrix3<T>
[src]
impl<T> Sub<Matrix3<T>> for Matrix3<T> where
T: Num + Copy + SubAssign<T>,
[src]
T: Num + Copy + SubAssign<T>,
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, rhs: Self) -> Self
[src]
impl<T> SubAssign<Matrix3<T>> for Matrix3<T> where
T: Num + Copy + SubAssign<T>,
[src]
T: Num + Copy + SubAssign<T>,
fn sub_assign(&mut self, rhs: Self)
[src]
impl<T> UlpsEq<Matrix3<T>> for Matrix3<T> where
T: Num + Copy + UlpsEq,
T::Epsilon: Clone,
[src]
T: Num + Copy + UlpsEq,
T::Epsilon: Clone,
Auto Trait Implementations
impl<T> RefUnwindSafe for Matrix3<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Matrix3<T> where
T: Send,
T: Send,
impl<T> Sync for Matrix3<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Matrix3<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Matrix3<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,