Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add LCMS2 flags to ImageCms #7676

Merged
merged 5 commits into from
Jan 6, 2024
Merged

Add LCMS2 flags to ImageCms #7676

merged 5 commits into from
Jan 6, 2024

Conversation

nulano
Copy link
Contributor

@nulano nulano commented Jan 1, 2024

While adding type hints to ImageCms, I found that the FLAGS dict is based on lcms1 and has not been updated for lcms2.

Changes proposed in this pull request:

  • Add ImageCms.Flags listing all flags from LCMS2-2.16's lcms2.h as a subclass of enum.IntFlag for better type hinting (in a future PR). I plan to create a second PR for deprecating the old names in ImageCms.FLAGS. Edit: Deprecate ImageCms constants and versions() function #7702
  • Fix typos in error messages.
  • Document ImageCms.Direction and ImageCms.Intent enums, and ImageCms.ImageCmsProfile class.
  • Fix docs reference to ImageCms.core.CmsProfile (incorrectly listed without core).

_GRIDPOINTS_16 = 16 << 16
_GRIDPOINTS_32 = 32 << 16
_GRIDPOINTS_64 = 64 << 16
_GRIDPOINTS_128 = 128 << 16
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The purpose of these _GRIDPOINTS_ flags is not for independent use, but rather so that when you look at _MAX_FLAG or the returned values of GRIDPOINTS(), you see the numbers expressed as flags, not just integers, yes?

Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
src/PIL/ImageCms.py Outdated Show resolved Hide resolved
src/PIL/ImageCms.py Outdated Show resolved Hide resolved
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
@hugovk hugovk merged commit fcaed26 into python-pillow:main Jan 6, 2024
57 checks passed
@nulano nulano deleted the lcms2-flags branch January 6, 2024 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants