weston/tests
Pekka Paalanen 9f4a9089f4 tests: fix perceptual intent in cLUT ICC profiles
The ICC profiles created for tests here are supposed to produce the same
results regardless of whether they are of the matrix-shaper or cLUT
form, and whether the compositor uses a colorimetric or perceptual
rendering intent. This is silly, but it fits our tests very well since
we mostly want to ensure correct computations in matrix and cLUT code
rather than meaningful results from different rendering intents.

When trying to switch the compositor from colorimetric to perceptual
rendering intent as required by the color-management protocol extension,
all and only the cLUT based tests failed (color-icc-output test).

The reason is that ICCv4 defines the perceptual PCS having a specific
non-zero black point. It requires ICC profiles to convert device black
to the PCS black and vice versa. However, matrix-shaper type ICC
profiles have no way to provide a perceptual transformation to/from PCS
separate from the colorimetric transformation. Hence, LittleCMS exempts
ICCv4 matrix-shaper profiles from the ICCv4 perceptual PCS definition.

Black point compensation (BPC) is always added by LittleCMS with the
perceptual rendering intent. If an ICC profile claims to be ICC version
4, the perceptual transformation in it is assumed to adhere to the
percptual PCS black point, which is non-zero. Hence, DToB0 and BToD0
tags need to respect that so that BPC works correctly.

Before this patch, DToB0 and BToD0 transformations did not use the
correct PCS black point, so when BPC got added, the color space
conversion went wrong. This patch replicates the BPC algorithm that
LittleCMS uses in order to respect the perceptual PCS definition. This
will then cancel out with the BPC added by LittleCMS, producing the
expected color space conversion.

The problem arises only with cLUT ICC profiles because matrix-shaper
profiles are exempt: the black points between source (always
matrix-shaper sRGB profile for now) and destination color spaces match,
and no BPC is added by LittleCMS.

There is no way to ask LittleCMS to add its BPC on our will, so we need
to copy that code from LittleCMS 2.16.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2024-04-19 12:19:36 +00:00
..
reference tests/color-icc-output: add ICC VCGT tests 2023-04-27 10:37:38 +00:00
visualization tests/alpha-blending: replace compare_float() with rgb_diff_stat 2022-06-30 09:08:32 +00:00
alpha-blending-test.c tests: Only wait for frame callback when necessary 2024-02-22 14:26:32 +00:00
assert-test.c color-lcms: changes to the parameters of translate_curve_element() 2024-03-26 11:23:26 +00:00
bad-buffer-test.c tests: Speed up runtime using immediate repaint on capture 2024-02-22 14:26:32 +00:00
buffer-transforms-test.c tests: Only wait for frame callback when necessary 2024-02-22 14:26:32 +00:00
color-icc-output-test.c tests: replace mat2XYZ 2024-04-19 12:19:36 +00:00
color-lcms-optimizer-test.c tests: add color pipeline optimizer tests 2023-06-29 11:08:40 +00:00
color-management-test.c tests: replace mat2XYZ 2024-04-19 12:19:36 +00:00
color-metadata-errors-test.c color: rename get_stock_sRGB_color_profile to ref_stock_sRGB_color_profile 2024-02-23 16:46:39 +02:00
color-metadata-parsing-test.c tests: use enum weston_renderer_type 2023-01-18 14:16:41 +01:00
color_util.c tests/color-icc-output: add ICC VCGT tests 2023-04-27 10:37:38 +00:00
color_util.h tests/color-icc-output: add ICC VCGT tests 2023-04-27 10:37:38 +00:00
config-parser-test.c tests: Use memstream for config-parser test 2022-07-05 10:15:49 +01:00
constraints-test.c tests: Speed up runtime using immediate repaint on capture 2024-02-22 14:26:32 +00:00
custom-env-test.c custom-env: Add helper to parse combined env/arg strings 2022-07-19 14:12:37 +00:00
devices-test.c tests: Speed up runtime using immediate repaint on capture 2024-02-22 14:26:32 +00:00
drm-formats-test.c drm-formats: add weston_drm_format_array_count_pairs() 2021-11-25 10:47:45 -03:00
drm-smoke-test.c drm-smoke-test: Explicitly set-up the output name DRM test 2023-01-25 17:55:39 +00:00
drm-writeback-screenshot-test.c tests: make use of helpers to create unique filenames 2024-02-12 14:10:44 +00:00
event-test.c tests: Speed up runtime using immediate repaint on capture 2024-02-22 14:26:32 +00:00
image-iter.h tests/color-icc-output: extract image-iter.h 2022-06-16 08:52:12 +00:00
input-timestamps-helper.c tests: replace fprintf() with testlog() 2019-11-22 12:54:10 +02:00
input-timestamps-helper.h tests: Introduce input timestamps helper 2018-02-20 10:20:29 +02:00
internal-screenshot-test.c tests: Speed up runtime using immediate repaint on capture 2024-02-22 14:26:32 +00:00
iterate-debug-scopes-test.c libweston/weston-log: Add a iterator helper for debug scope 2023-05-30 11:05:14 +00:00
ivi-layout-internal-test.c tests: remove unnecessary weston.h includes 2023-12-18 15:34:26 +00:00
ivi-layout-test-client.c tests: ivi-shell: prepare for API simplification 2023-04-19 09:38:09 +03:00
ivi-layout-test-plugin.c Rename compositor/ to frontend/ 2023-12-18 15:34:26 +00:00
ivi-shell-app-test.c tests: fix leak in ivi-shell-app-test 2021-06-16 14:41:08 +00:00
ivi-test.h ivi-shell: implement surface_on_many_layer test 2016-06-29 11:32:23 +03:00
keyboard-test.c tests: Speed up runtime using immediate repaint on capture 2024-02-22 14:26:32 +00:00
lcms-util-test.c tests: add lcms-util with MPE curves 2022-06-03 10:22:25 +00:00
lcms_util.c tests: fix perceptual intent in cLUT ICC profiles 2024-04-19 12:19:36 +00:00
lcms_util.h tests: replace mat2XYZ 2024-04-19 12:19:36 +00:00
linux-explicit-synchronization-test.c tests: Speed up runtime using immediate repaint on capture 2024-02-22 14:26:32 +00:00
matrix-test.c tests: add matrix-test for CI 2022-05-31 12:26:09 +00:00
matrix-transform-test.c libweston: Use weston_coord in struct weston_output 2023-06-12 16:55:22 -05:00
meson.build CI: work around LeakSanitizer crashes with use_tls=0 2024-04-09 17:29:00 +03:00
output-capture-protocol-test.c tests: use enum weston_renderer_type 2023-01-18 14:16:41 +01:00
output-damage-test.c tests: Only wait for frame callback when necessary 2024-02-22 14:26:32 +00:00
output-decorations-test.c tests: use enum weston_renderer_type 2023-01-18 14:16:41 +01:00
output-transforms-test.c tests: Only wait for frame callback when necessary 2024-02-22 14:26:32 +00:00
paint-node-test.c tests: Speed up runtime using immediate repaint on capture 2024-02-22 14:26:32 +00:00
plugin-registry-test.c tests: remove unnecessary weston.h includes 2023-12-18 15:34:26 +00:00
pointer-shot-test.c tests: Only wait for frame callback when necessary 2024-02-22 14:26:32 +00:00
pointer-test.c tests: Only wait for frame callback when necessary 2024-02-22 14:26:32 +00:00
presentation-test.c tests: Speed up runtime using immediate repaint on capture 2024-02-22 14:26:32 +00:00
roles-test.c tests: Speed up runtime using immediate repaint on capture 2024-02-22 14:26:32 +00:00
safe-signal-output-removal-test.c replace weston_signal_emit_mutable with wl_signal_emit_mutable 2023-12-04 11:37:17 +02:00
safe-signal-test.c replace weston_signal_emit_mutable with wl_signal_emit_mutable 2023-12-04 11:37:17 +02:00
setbacklight.c tests: Update boilerplate from MIT X11 license to MIT Expat license 2015-06-15 13:04:19 -07:00
single-pixel-buffer-test.c tests: Speed up runtime using immediate repaint on capture 2024-02-22 14:26:32 +00:00
string-test.c tests: add missing include 2017-01-23 14:12:06 +02:00
subsurface-shot-test.c tests: Speed up runtime using immediate repaint on capture 2024-02-22 14:26:32 +00:00
subsurface-test.c tests: Speed up runtime using immediate repaint on capture 2024-02-22 14:26:32 +00:00
surface-global-test.c tests: remove unnecessary weston.h includes 2023-12-18 15:34:26 +00:00
surface-screenshot-test.c Rename compositor/ to frontend/ 2023-12-18 15:34:26 +00:00
surface-test.c tests: remove unnecessary weston.h includes 2023-12-18 15:34:26 +00:00
text-test.c tests: Speed up runtime using immediate repaint on capture 2024-02-22 14:26:32 +00:00
timespec-test.c Unify the include style of shared/ headers 2019-10-04 16:04:48 +03:00
touch-test.c tests: Speed up runtime using immediate repaint on capture 2024-02-22 14:26:32 +00:00
vertex-clip-test.c tests: Add box32 quad clipper tests 2024-02-06 09:21:11 +00:00
viewporter-shot-test.c tests: Only wait for frame callback when necessary 2024-02-22 14:26:32 +00:00
viewporter-test.c tests: Speed up runtime using immediate repaint on capture 2024-02-22 14:26:32 +00:00
weston-test-client-helper.c tests: Only wait for frame callback when necessary 2024-02-22 14:26:32 +00:00
weston-test-client-helper.h tests: Only wait for frame callback when necessary 2024-02-22 14:26:32 +00:00
weston-test-desktop-shell.c Rename compositor/ to frontend/ 2023-12-18 15:34:26 +00:00
weston-test-fixture-compositor.c tests: Speed up runtime using immediate repaint on capture 2024-02-22 14:26:32 +00:00
weston-test-fixture-compositor.h tests: Speed up runtime using immediate repaint on capture 2024-02-22 14:26:32 +00:00
weston-test-runner.c tests: add helpers to create unique filenames 2024-02-12 14:10:44 +00:00
weston-test-runner.h tests: add helpers to create unique filenames 2024-02-12 14:10:44 +00:00
weston-test.c Rename compositor/ to frontend/ 2023-12-18 15:34:26 +00:00
weston-testsuite-data.h tests: Add client<->compositor breakpoint support 2023-06-30 11:42:00 +00:00
xcb-client-helper.c xcb-client-helper: Call xcb_wait_for_event directly 2024-04-11 10:06:56 -05:00
xcb-client-helper.h xcb-client-helper: Add a XCB client helper for tests 2023-03-03 08:30:46 +00:00
xwayland-test.c tests/xwayland: Ensure $DISPLAY is correctly set 2023-06-19 21:32:47 +01:00
yuv-buffer-test.c tests: Speed up runtime using immediate repaint on capture 2024-02-22 14:26:32 +00:00