#[repr(C, align(16))]pub struct DMat3 {
pub col0: [f64; 4],
pub col1: [f64; 4],
pub col2: [f64; 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: [f64; 4]Column 0, rows [0..2] with padding at index 3.
col1: [f64; 4]Column 1, rows [0..2] with padding at index 3.
col2: [f64; 4]Column 2, rows [0..2] with padding at index 3.
Implementations§
Source§impl DMat3
impl DMat3
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: [[f64; 3]; 3]) -> Self
pub const fn from_rows(m: [[f64; 3]; 3]) -> Self
Construct from row-major [[$scalar; 3]; 3]. const fn.
Sourcepub const fn luminance_weights(&self) -> [f64; 3]
pub const fn luminance_weights(&self) -> [f64; 3]
Y row as luminance weights [w_r, w_g, w_b]. const fn.
Trait Implementations§
impl Copy for DMat3
impl StructuralPartialEq for DMat3
Auto Trait Implementations§
impl Freeze for DMat3
impl RefUnwindSafe for DMat3
impl Send for DMat3
impl Sync for DMat3
impl Unpin for DMat3
impl UnsafeUnpin for DMat3
impl UnwindSafe for DMat3
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