Commits on Source (12)
-
Vitaly Prosyak authored
Introduce 3D LUT definition as part of Weston color transform struct. A 3D LUT is a LUT containing entries for each possible RGB triplets. Co-authored-by: Pekka Paalanen <pekka.paalanen@collabora.com> Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
2e2ad02d -
Vitaly Prosyak authored
Introduce shader color mapping identity and 3D LUT. Shader requirements struct uses union for color mapping to prepare the place for 3x3 matrix. Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
cda130e4 -
Vitaly Prosyak authored
The following GL extensions provide support for shaders CM: -GL_OES_texture_float_linear makes GL_RGB32F linear filterable. -GL ES 3.0 provides Texture3D support in GL API. -GL_OES_texture_3D provides sampler3D support in ESSL 1.00. If abovesaid is supported then renderer sets flag WESTON_CAP_COLOR_OPS which means that all fields in struct weston_color_transform are supported, for example, 1DLUT and 3DLUT. Use GL_OES_texture_3D to implement 3DLUT function which uses trilinear interpolation for pixel processing or bypass as is. Quote from https://nick-shaw.github.io/cinematiccolor/luts-and-transforms.html "3D LUTs have long been embraced by color scientists and are one of the tools commonly used for gamut mapping. In fact, 3D LUTs are used within ICC profiles to model the complex device behaviors necessary for accurate color image reproduction". Quote from https://developer.nvidia.com/gpugems/gpugems2/part-iii-high-quality-rendering/ chapter-24-using-lookup-tables-accelerate-color is about interpolation: "By generating intermediate results based on a weighted average of the eight corners of the bounding cube, this algorithm is typically sufficient for color processing, and it is implemented in graphics hardware". Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
93c6180c -
Vitaly Prosyak authored
1. The cmlcms_category is used to identify the purpose of transform: - CMLCMS_CATEGORY_INPUT_TO_BLEND - CMLCMS_CATEGORY_BLEND_TO_OUTPUT - CMLCMS_CATEGORY_INPUT_TO_OUTPUT 2. Added following fields to cmlcms_color_profile: - output_eotf - If the profile does support being an output profile and it is used as an output then this field represents a light linearizing transfer function and it can not be null. The field is null only if the profile is not usable as an output profile. The field is set when cmlcms_color_profile is created. - vcgt - VCGT tag cached from output profile, it could be null if not exist - output_inv_eotf_vcgt - if the profile does support being an output profile and it is used as an output then this field represents a concatenation of inverse EOTF + VCGT, if the tag exists and it can not be null. 3. Added field cmsHTRANSFORM to cmlcms_color_transform. It is used to store LCMS optimized pipeline. Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
494ff5b2 -
Vitaly Prosyak authored
It is used for convenience when profile is cached. Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
a92fa34d -
Vitaly Prosyak authored
The stock profile would be used when client or output do not provide any profile or unaware of color management. Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
19f31869 -
Vitaly Prosyak authored
Add to search parameter cmlcms_category, input and output profiles, and render intent for output which would be used for both profiles. Add common function setup_search_param for every category. Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
19913366 -
Vitaly Prosyak authored
Use category, intent and output and input profiles for comparison. Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
37e0d54c -
Vitaly Prosyak authored
Graeme sketched a linearization method there: https://lists.freedesktop.org/archives/wayland-devel/2019-March/040171.html Sebastian prototyped there: wayland-protocols!14 (commits) Thanks to Pekka for great simplifications in implementation, like the xyz_dot_prod() Quote: "should help untangle lots of the multiplications and summations by saying we are computing dot products, etc". The approach was validated using matrix-shaper and cLUT type of profiles. If profile is matrix-shaper type then an optimization is applied. The extracted EOTF is inverted and concatenated with VCGT, if it is availible. Introduce function cmlcms_reasonable_1D_points which would be shared between linearization method and number of points in 1DLUT for the transform. Co-authored-by: Pekka Paalanen <pekka.paalanen@collabora.com> Co-authored-by: Sebastian Wick <sebastian@sebastianwick.net> Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
c199aade -
Vitaly Prosyak authored
Use 3D LUT for color mapping. For category CMLCMS_CATEGORY_INPUT_TO_BLEND use transform which has 3 profiles: input, output and light linearizing transfer function. For category CMLCMS_CATEGORY_INPUT_TO_OUTPUT use input and output profiles +VCGT. For category CMLCMS_CATEGORY_BLEND_TO_OUTPUT use output inverse EOTF + VCGT. Co-authored-by: Pekka Paalanen <pekka.paalanen@collabora.com> Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
6099c0e2 -
Vitaly Prosyak authored
Added pixel pipeline processing as following: tone curve(EOTF) + 3x3 matrix + tone curve(INV_EOTF) Co-authored-by: Pekka Paalanen <pekka.paalanen@collabora.com> Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
264a18f0 -
Vitaly Prosyak authored
1. Use fixture_setup to set the generated by LCMS output profile based on given chromaticities and white points. The following list of well known chromaticities: - sRGB - adobe RGB - bt2020 and white point is D65. Use INTENT_ABSOLUTE_COLORIMETRIC to avoid BPC. Input profile is always sRGB and it is used internally by Weston as stock profile. 2. Use these hardcoded matrixes as part of pipeline 1DLUT->3x3->1DLUT. The diagnostic code to retrieve the transform matrix is availble into test in the comments. The conversion matrixes generated for the following cases: - sRGB to sRGB (unity) - sRGB to adobeRGB - sRGB to BT2020 3. Compare GPU shaders(gl texture3D) vs manual pipeline calculation Use different max tolerable error per transform. There are comments how number of points in 3DLUT is related to tolerance. Tolerance depends more on the 1D LUT used for the inv EOTF than the tested 3D LUT size: 9x9x9, 17x17x17, 33x33x33, 127x127x127. 4. Enable build matrix-shaper test if color-management-lcms is enabled. Co-authored-by: Pekka Paalanen <pekka.paalanen@collabora.com> Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
fe35ca2d
tests/color-shaper-matrix-test.c
0 → 100644
tests/reference/shaper_matrix-00.png
0 → 100644
402 B
tests/reference/shaper_matrix-01.png
0 → 100644
506 B
tests/reference/shaper_matrix-02.png
0 → 100644
730 B