Skip to content

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?

@hugovk hugovk merged commit fcaed26 into python-pillow:main Jan 6, 2024
@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.

3 participants