NSColorSpace: return ICC profile data for the generic RGB space (prototype)#508
Open
DTW-Thalion wants to merge 2 commits into
Open
NSColorSpace: return ICC profile data for the generic RGB space (prototype)#508DTW-Thalion wants to merge 2 commits into
DTW-Thalion wants to merge 2 commits into
Conversation
Cover the model enum values, and the colour space model, component count, name and singleton identity of the standard colour spaces.
The generic RGB colour space now reports an ICC profile, loaded from the ICC sRGB v2 reference profile that ships as a gui library resource. This is a first step; the generic gray and CMYK spaces can follow the same pattern with their own reference profiles.
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.
Prototype. NSColorSpace stored ICC data only when one was passed to initWithICCProfileData:; the standard colour spaces returned nil, where AppKit returns a profile for the generic spaces.
This adds the ICC sRGB v2 reference profile (sRGB2014.icc) as a gui library resource and loads it for +genericRGBColorSpace, so -ICCProfileData returns a valid profile. The profile is the International Color Consortium reference profile from https://registry.color.org/rgb-registry/srgbprofiles, redistributed unmodified under the ICC licence ("may be copied, distributed, embedded, made, used, and sold without restriction"); its provenance and licence are recorded in Resources/ColorSpaces/README. No Apple profile data is used (for obvious reasons).
Scope: only the generic RGB space is wired up, and this is deliberate. I looked at extending it to the generic gray and CMYK spaces and found no cleanly-licensed ICC-registry source for either:
So gray and CMYK are left returning nil for now. They could be added later either from a suitably-licensed profile or by synthesising minimal profiles, which is a maintainer call. The device spaces are also left without a profile, matching AppKit.
Whether sRGB is the right mapping for the generic RGB space, and whether to take on colour management more generally (e.g. via lcms2), is a design decision for the GNUStep team, but this at least puts the fraamework in place using a fully permissive licensed file.
Stacked on #507 (adds an assertion to its NSColorSpace test); merge that first.