pub struct Matrix3<Src: ColorSpace, Dst: ColorSpace> { /* private fields */ }Expand description
Q4_28 coefficients that convert Color<Src, Linear> to Color<Dst, Linear>.
Implementations§
Source§impl<Src: ColorSpace, Dst: ColorSpace> Matrix3<Src, Dst>
impl<Src: ColorSpace, Dst: ColorSpace> Matrix3<Src, Dst>
Sourcepub const fn from_q428(coefs: [[Q4_28; 3]; 3]) -> Self
pub const fn from_q428(coefs: [[Q4_28; 3]; 3]) -> Self
Wrap baked Q4_28 coefficients. Target code does not derive them.
Sourcepub const fn apply(&self, color: Color<Src, Linear>) -> Color<Dst, Linear>
pub const fn apply(&self, color: Color<Src, Linear>) -> Color<Dst, Linear>
Apply to a linear source: one i64 accumulate per row, then one
shift-round-saturate. There is no inverse or chromatic adaptation.
Sourcepub fn apply_f32(&self, color: ColorF32<Src, Linear>) -> ColorF32<Dst, Linear>
pub fn apply_f32(&self, color: ColorF32<Src, Linear>) -> ColorF32<Dst, Linear>
Apply with f32 mul/add of Q4.28 coefficients decoded as
coef as f32 / 2^28. Saturates each channel to 0.0..=1.0.
Additive: does not change Self::apply. Error versus W7 goldens is
at most crate::F32_MAX_ERR_LSB.
Trait Implementations§
Source§impl<Src: ColorSpace, Dst: ColorSpace> Clone for Matrix3<Src, Dst>
impl<Src: ColorSpace, Dst: ColorSpace> Clone for Matrix3<Src, Dst>
impl<Src: ColorSpace, Dst: ColorSpace> Copy for Matrix3<Src, Dst>
Source§impl<Src: ColorSpace, Dst: ColorSpace> Debug for Matrix3<Src, Dst>
impl<Src: ColorSpace, Dst: ColorSpace> Debug for Matrix3<Src, Dst>
impl<Src: ColorSpace, Dst: ColorSpace> Eq for Matrix3<Src, Dst>
Auto Trait Implementations§
impl<Src, Dst> Freeze for Matrix3<Src, Dst>
impl<Src, Dst> RefUnwindSafe for Matrix3<Src, Dst>
impl<Src, Dst> Send for Matrix3<Src, Dst>
impl<Src, Dst> Sync for Matrix3<Src, Dst>
impl<Src, Dst> Unpin for Matrix3<Src, Dst>
impl<Src, Dst> UnsafeUnpin for Matrix3<Src, Dst>
impl<Src, Dst> UnwindSafe for Matrix3<Src, Dst>
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