|
26 | 26 |
|
27 | 27 | use crate::{
|
28 | 28 | convert::{FromColorUnclamped, IntoColorUnclamped},
|
| 29 | + lms::{ |
| 30 | + self, |
| 31 | + meta::{LmsToXyz, XyzToLms}, |
| 32 | + }, |
29 | 33 | matrix::{multiply_3x3, multiply_xyz, Mat3},
|
30 | 34 | num::{Arithmetics, Real, Zero},
|
31 | 35 | white_point::{Any, WhitePoint},
|
@@ -95,44 +99,20 @@ where
|
95 | 99 | match *self {
|
96 | 100 | Method::Bradford => {
|
97 | 101 | ConeResponseMatrices::<T> {
|
98 |
| - ma: [ |
99 |
| - T::from_f64(0.8951000), T::from_f64(0.2664000), T::from_f64(-0.1614000), |
100 |
| - T::from_f64(-0.7502000), T::from_f64(1.7135000), T::from_f64(0.0367000), |
101 |
| - T::from_f64(0.0389000), T::from_f64(-0.0685000), T::from_f64(1.0296000) |
102 |
| - ], |
103 |
| - inv_ma: [ |
104 |
| - T::from_f64(0.9869929), T::from_f64(-0.1470543), T::from_f64(0.1599627), |
105 |
| - T::from_f64(0.4323053), T::from_f64(0.5183603), T::from_f64(0.0492912), |
106 |
| - T::from_f64(-0.0085287), T::from_f64(0.0400428), T::from_f64(0.9684867) |
107 |
| - ], |
| 102 | + ma: lms::meta::Bradford::xyz_to_lms_matrix(), |
| 103 | + inv_ma: lms::meta::Bradford::lms_to_xyz_matrix(), |
108 | 104 | }
|
109 | 105 | }
|
110 | 106 | Method::VonKries => {
|
111 | 107 | ConeResponseMatrices::<T> {
|
112 |
| - ma: [ |
113 |
| - T::from_f64(0.4002400), T::from_f64(0.7076000), T::from_f64(-0.0808100), |
114 |
| - T::from_f64(-0.2263000), T::from_f64(1.1653200), T::from_f64(0.0457000), |
115 |
| - T::from_f64(0.0000000), T::from_f64(0.0000000), T::from_f64(0.9182200) |
116 |
| - ], |
117 |
| - inv_ma: [ |
118 |
| - T::from_f64(1.8599364), T::from_f64(-1.1293816), T::from_f64(0.2198974), |
119 |
| - T::from_f64(0.3611914), T::from_f64(0.6388125), T::from_f64(-0.0000064), |
120 |
| - T::from_f64(0.0000000), T::from_f64(0.0000000), T::from_f64(1.0890636) |
121 |
| - ], |
| 108 | + ma: lms::meta::VonKries::xyz_to_lms_matrix(), |
| 109 | + inv_ma: lms::meta::VonKries::lms_to_xyz_matrix(), |
122 | 110 | }
|
123 | 111 | }
|
124 | 112 | Method::XyzScaling => {
|
125 | 113 | ConeResponseMatrices::<T> {
|
126 |
| - ma: [ |
127 |
| - T::from_f64(1.0000000), T::from_f64(0.0000000), T::from_f64(0.0000000), |
128 |
| - T::from_f64(0.0000000), T::from_f64(1.0000000), T::from_f64(0.0000000), |
129 |
| - T::from_f64(0.0000000), T::from_f64(0.0000000), T::from_f64(1.0000000) |
130 |
| - ], |
131 |
| - inv_ma: [ |
132 |
| - T::from_f64(1.0000000), T::from_f64(0.0000000), T::from_f64(0.0000000), |
133 |
| - T::from_f64(0.0000000), T::from_f64(1.0000000), T::from_f64(0.0000000), |
134 |
| - T::from_f64(0.0000000), T::from_f64(0.0000000), T::from_f64(1.0000000) |
135 |
| - ], |
| 114 | + ma: lms::meta::UnitMatrix::xyz_to_lms_matrix(), |
| 115 | + inv_ma: lms::meta::UnitMatrix::lms_to_xyz_matrix(), |
136 | 116 | }
|
137 | 117 | }
|
138 | 118 | }
|
|
0 commit comments