pub struct Matrix3<T> {
pub m: [T; 9],
}
Expand description
A 3x3 matrix used for linear color transformations
Fields§
§m: [T; 9]
An array containing the cell values
Implementations§
Source§impl<T> Matrix3<T>
impl<T> Matrix3<T>
Sourcepub fn as_slice_mut(&mut self) -> &mut [T]
pub fn as_slice_mut(&mut self) -> &mut [T]
Return a mutable slice to the elements in the matrix
Sourcepub fn to_tuple(self) -> (T, T, T, T, T, T, T, T, T)
pub fn to_tuple(self) -> (T, T, T, T, T, T, T, T, T)
Return a nine element tuple containing the elements
Sourcepub fn determinant(&self) -> T
pub fn determinant(&self) -> T
Compute the determinant of the matrix
Sourcepub fn inverse(self) -> Option<Self>
pub fn inverse(self) -> Option<Self>
Compute the inverse of the matrix
None is returned if the matrix is singular (determinant = 0)
Sourcepub fn transform_vector<U>(&self, vec: (U, U, U)) -> (U, U, U)where
U: NumCast,
pub fn transform_vector<U>(&self, vec: (U, U, U)) -> (U, U, U)where
U: NumCast,
Transform a vector using self
Trait Implementations§
Source§impl<T> AbsDiffEq for Matrix3<T>
impl<T> AbsDiffEq for Matrix3<T>
Source§fn default_epsilon() -> Self::Epsilon
fn default_epsilon() -> Self::Epsilon
The default tolerance to use when testing values that are close together. Read more
Source§fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool
fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool
A test for equality that uses the absolute difference to compute the approximate
equality of two numbers.
Source§impl<T> AddAssign for Matrix3<T>
impl<T> AddAssign for Matrix3<T>
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+=
operation. Read moreSource§impl<T> DivAssign<T> for Matrix3<T>
impl<T> DivAssign<T> for Matrix3<T>
Source§fn div_assign(&mut self, rhs: T)
fn div_assign(&mut self, rhs: T)
Performs the
/=
operation. Read moreSource§impl<T> MulAssign<T> for Matrix3<T>
impl<T> MulAssign<T> for Matrix3<T>
Source§fn mul_assign(&mut self, rhs: T)
fn mul_assign(&mut self, rhs: T)
Performs the
*=
operation. Read moreSource§impl<T> MulAssign for Matrix3<T>
impl<T> MulAssign for Matrix3<T>
Source§fn mul_assign(&mut self, rhs: Matrix3<T>)
fn mul_assign(&mut self, rhs: Matrix3<T>)
Performs the
*=
operation. Read moreSource§impl<T> RelativeEq for Matrix3<T>
impl<T> RelativeEq for Matrix3<T>
Source§fn default_max_relative() -> Self::Epsilon
fn default_max_relative() -> Self::Epsilon
The default relative tolerance for testing values that are far-apart. Read more
Source§impl<T> SubAssign for Matrix3<T>
impl<T> SubAssign for Matrix3<T>
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-=
operation. Read moreSource§impl<T> UlpsEq for Matrix3<T>
impl<T> UlpsEq for Matrix3<T>
impl<T: Copy> Copy for Matrix3<T>
impl<T> StructuralPartialEq for Matrix3<T>
Auto Trait Implementations§
impl<T> Freeze for Matrix3<T>where
T: Freeze,
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§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more