Skip to content

Commit 278f203

Browse files
committed
Pre-invert matrices
Don't wait until runtime to invert matrices, invert them ahead of time.
1 parent 2e32e06 commit 278f203

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

coloraide/spaces/orgb.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@
1717
[0.8660, -0.8660, 0.0000]
1818
]
1919

20-
LC1C2_TO_RGB = alg.inv(RGB_TO_LC1C2)
20+
LC1C2_TO_RGB = [
21+
[1.0000000000000002, 0.11399999999999999, 0.7436489607390301],
22+
[1.0000000000000002, 0.11399999999999999, -0.4110854503464203],
23+
[1.0000000000000002, -0.886, 0.1662817551963048]
24+
]
2125

2226

2327
def rotate(v: Vector, d: float) -> Vector:

coloraide/spaces/zcam_jmh.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@
2424

2525
DEF_ILLUMINANT_BI = util.xyz_to_absxyz(util.xy_to_xyz(cat.WHITES['2deg']['E']), yw=100.0)
2626
CAT02 = cat.CAT02.MATRIX
27-
CAT02_INV = alg.inv(CAT02)
27+
CAT02_INV = [
28+
[1.0961238208355142, -0.27886900021828726, 0.18274517938277304],
29+
[0.45436904197535916, 0.4735331543074118, 0.07209780371722913],
30+
[-0.009627608738429355, -0.00569803121611342, 1.0153256399545427]
31+
]
2832

2933
# ZCAM uses a slightly different matrix than Jzazbz
3034
# It updates how `Iz` is calculated.

0 commit comments

Comments
 (0)