#[repr(C, align(16))]pub struct Mat3 {
pub col0: [f32; 4],
pub col1: [f32; 4],
pub col2: [f32; 4],
}Expand description
Column-major 3x3 matrix with const fn arithmetic.
Each column is [$scalar; 4] padded to 16 bytes for SIMD alignment.
All methods are const fn for compile-time matrix derivation.
Fields§
§col0: [f32; 4]Column 0, rows [0..2] with padding at index 3.
col1: [f32; 4]Column 1, rows [0..2] with padding at index 3.
col2: [f32; 4]Column 2, rows [0..2] with padding at index 3.
Implementations§
Source§impl Mat3
impl Mat3
Sourcepub const fn invert(m: &Self) -> Self
pub const fn invert(m: &Self) -> Self
Invert via Cramer’s rule. const fn. Returns a matrix with NaN
or INFINITY entries if the determinant is zero or near-zero.
All standard RGB primary matrices have non-zero determinants.
Sourcepub const fn from_rows(m: [[f32; 3]; 3]) -> Self
pub const fn from_rows(m: [[f32; 3]; 3]) -> Self
Construct from row-major [[$scalar; 3]; 3]. const fn.
Sourcepub const fn luminance_weights(&self) -> [f32; 3]
pub const fn luminance_weights(&self) -> [f32; 3]
Y row as luminance weights [w_r, w_g, w_b]. const fn.
Trait Implementations§
impl Copy for Mat3
impl StructuralPartialEq for Mat3
Auto Trait Implementations§
impl Freeze for Mat3
impl RefUnwindSafe for Mat3
impl Send for Mat3
impl Sync for Mat3
impl Unpin for Mat3
impl UnsafeUnpin for Mat3
impl UnwindSafe for Mat3
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