aboutsummaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
Diffstat (limited to 'test/src')
-rw-r--r--test/src/lcms-tests.el44
1 files changed, 44 insertions, 0 deletions
diff --git a/test/src/lcms-tests.el b/test/src/lcms-tests.el
index d6d1d16b9ad..cc324af68ba 100644
--- a/test/src/lcms-tests.el
+++ b/test/src/lcms-tests.el
@@ -94,6 +94,38 @@ B is considered the exact value."
94 (apply #'color-xyz-to-xyy (lcms-temp->white-point 7504)) 94 (apply #'color-xyz-to-xyy (lcms-temp->white-point 7504))
95 '(0.29902 0.31485 1.0)))) 95 '(0.29902 0.31485 1.0))))
96 96
97(ert-deftest lcms-roundtrip ()
98 "Test accuracy of converting to and from different color spaces"
99 (skip-unless (featurep 'lcms2))
100 (should
101 (let ((color '(.5 .3 .7)))
102 (lcms-triple-approx-p (lcms-jch->xyz (lcms-xyz->jch color))
103 color
104 0.0001)))
105 (should
106 (let ((color '(.8 -.2 .2)))
107 (lcms-triple-approx-p (lcms-jch->jab (lcms-jab->jch color))
108 color
109 0.0001))))
110
111(ert-deftest lcms-ciecam02-gold ()
112 "Test CIE CAM02 JCh gold values"
113 (skip-unless (featurep 'lcms2))
114 (should
115 (lcms-triple-approx-p
116 (lcms-xyz->jch '(0.1931 0.2393 0.1014)
117 '(0.9888 0.900 0.3203)
118 '(18 200 1 1.0))
119 '(48.0314 38.7789 191.0452)
120 0.02))
121 (should
122 (lcms-triple-approx-p
123 (lcms-xyz->jch '(0.1931 0.2393 0.1014)
124 '(0.9888 0.90 0.3203)
125 '(18 20 1 1.0))
126 '(47.6856 36.0527 185.3445)
127 0.09)))
128
97(ert-deftest lcms-dE-cam02-ucs-silver () 129(ert-deftest lcms-dE-cam02-ucs-silver ()
98 "Test CRI-CAM02-UCS deltaE metric values from colorspacious." 130 "Test CRI-CAM02-UCS deltaE metric values from colorspacious."
99 (skip-unless (featurep 'lcms2)) 131 (skip-unless (featurep 'lcms2))
@@ -114,4 +146,16 @@ B is considered the exact value."
114 8.503323264883667 146 8.503323264883667
115 0.04))) 147 0.04)))
116 148
149(ert-deftest lcms-jmh->cam02-ucs-silver ()
150 "Compare JCh conversion to CAM02-UCS to values from colorspacious."
151 (skip-unless (featurep 'lcms2))
152 (should
153 (lcms-triple-approx-p (lcms-jch->jab '(50 20 10))
154 '(62.96296296 16.22742674 2.86133316)
155 0.05))
156 (should
157 (lcms-triple-approx-p (lcms-jch->jab '(10 60 100))
158 '(15.88785047 -6.56546789 37.23461867)
159 0.04)))
160
117;;; lcms-tests.el ends here 161;;; lcms-tests.el ends here