Skip to content

Commit

Permalink
document ImageCms.{ImageCmsProfile,Intent,Direction}; fix ImageCms.co…
Browse files Browse the repository at this point in the history
…re.CmsProfile references
  • Loading branch information
nulano committed Jan 1, 2024
1 parent 5d4b84e commit 9308bce
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
4 changes: 2 additions & 2 deletions docs/deprecations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,8 @@ ImageCms.CmsProfile attributes
.. deprecated:: 3.2.0
.. versionremoved:: 8.0.0

Some attributes in :py:class:`PIL.ImageCms.CmsProfile` have been removed. From 6.0.0,
they issued a :py:exc:`DeprecationWarning`:
Some attributes in :py:class:`PIL.ImageCms.core.CmsProfile` have been removed.
From 6.0.0, they issued a :py:exc:`DeprecationWarning`:

======================== ===================================================
Removed Use instead
Expand Down
21 changes: 20 additions & 1 deletion docs/reference/ImageCms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,26 @@ The :py:mod:`~PIL.ImageCms` module provides color profile management
support using the LittleCMS2 color management engine, based on Kevin
Cazabon's PyCMS library.

.. autoclass:: ImageCmsProfile
:members:
:special-members: __init__
.. autoclass:: ImageCmsTransform
:members:
:undoc-members:
.. autoexception:: PyCMSError

Constants
---------

.. autoclass:: Intent
:members:
:member-order: bysource
:undoc-members:
.. autoclass:: Direction
:members:
:member-order: bysource
:undoc-members:

Functions
---------

Expand All @@ -37,13 +54,15 @@ CmsProfile
----------

The ICC color profiles are wrapped in an instance of the class
:py:class:`CmsProfile`. The specification ICC.1:2010 contains more
:py:class:`~core.CmsProfile`. The specification ICC.1:2010 contains more
information about the meaning of the values in ICC profiles.

For convenience, all XYZ-values are also given as xyY-values (so they
can be easily displayed in a chromaticity diagram, for example).

.. py:currentmodule:: PIL.ImageCms.core
.. py:class:: CmsProfile
:canonical: PIL._imagingcms.CmsProfile

.. py:attribute:: creation_date
:type: Optional[datetime.datetime]
Expand Down
2 changes: 1 addition & 1 deletion docs/releasenotes/8.0.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Image.fromstring, im.fromstring and im.tostring
ImageCms.CmsProfile attributes
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Some attributes in :py:class:`PIL.ImageCms.CmsProfile` have been removed:
Some attributes in :py:class:`PIL.ImageCms.core.CmsProfile` have been removed:

======================== ===================================================
Removed Use instead
Expand Down
3 changes: 2 additions & 1 deletion src/PIL/ImageCms.py
Original file line number Diff line number Diff line change
Expand Up @@ -960,9 +960,10 @@ def getDefaultIntent(profile: _CmsProfileCompatible) -> int:
raise PyCMSError(v) from v


# TODO sphinx can't understand Literal[1, -1] as return type
def isIntentSupported(
profile: _CmsProfileCompatible, intent: Intent, direction: Direction
) -> Literal[1, -1]:
) -> int:
"""
(pyCMS) Checks if a given intent is supported.
Expand Down

0 comments on commit 9308bce

Please sign in to comment.