Add support for RGB to CMYK conversion if the B2A0 table is available#46
Open
jlfwong wants to merge 4 commits intoFirefoxGraphics:mainfrom
Open
Add support for RGB to CMYK conversion if the B2A0 table is available#46jlfwong wants to merge 4 commits intoFirefoxGraphics:mainfrom
jlfwong wants to merge 4 commits intoFirefoxGraphics:mainfrom
Conversation
- Add format validation for RGB8/RGBA8/BGRA8 to CMYK conversions - Implement Clut3x4 structure for 3-input/4-output CLUT interpolation - Add modular_transform_create_lut3x4 function for CMYK output profiles - Update modular_transform_create_output to handle 4-channel CMYK B2A0 tables - Implement transform_precacheLUT_rgb_to_cmyk_float for precached LUTs - Add tetra_rgb_to_cmyk interpolation function for 4-channel output - Implement transform functions: qcms_transform_data_tetra_clut_rgb_to_cmyk, qcms_transform_data_tetra_clut_rgba_to_cmyk, and qcms_transform_data_tetra_clut_bgra_to_cmyk - Wire up RGB to CMYK conversion in transform_create - Add unit tests for RGB8/RGBA8 to CMYK conversions RGB to CMYK conversion requires ICCv4 profiles with B2A0 tables. The implementation mirrors the existing CMYK to RGB conversion pattern.
- Implement logic to read the optional B2A0 tag in ICC profiles, restoring valid state if reading fails. - Update unit tests for RGB8 and RGBA8 to CMYK conversions to ensure B2A0 tables are correctly handled and validate conversion results. - Enhance assertions to verify that CMYK values are reasonable and consistent across conversions, including round-trip tests. This change improves the robustness of ICC profile handling and ensures accurate color conversions when B2A0 tables are present.
- Allow 4 output channels in read_tag_lutType for B2A0 tables (PCS→CMYK) - Read B2A0 tables from CMYK profiles in iccread.rs - Add Clut3x4 transform for 3-input/4-output CLUT interpolation - Add transform functions for RGB8/RGBA8/BGRA8 to CMYK conversions - Add rgb_to_cmyk and rgba_to_cmyk tests using SWOP 2006 profile - Include SWOP 2006 Coated v2.icc test profile
Collaborator
|
Is the PR title meant to be "Add support for RGB to CMYK..."? |
Author
|
@jrmuizel whoops! yes, sorry. Fixed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This was basically 100% vibe coded, but I am planning on using this in a real application that relies upon it, so I figured I would upstream it in case it's useful to someone else