fix CmsProfile type references

(cherry picked from commit 6196695156)
This commit is contained in:
nulano 2020-06-22 07:14:07 +02:00
parent b4e7202dcb
commit bd2c705606

View File

@ -25,31 +25,30 @@ can be easily displayed in a chromaticity diagram, for example).
.. py:class:: CmsProfile .. py:class:: CmsProfile
.. py:attribute:: creation_date .. py:attribute:: creation_date
:type: Optional[datetime.datetime]
Date and time this profile was first created (see 7.2.1 of ICC.1:2010). Date and time this profile was first created (see 7.2.1 of ICC.1:2010).
:type: :py:class:`datetime.datetime` or ``None``
.. py:attribute:: version .. py:attribute:: version
:type: float
The version number of the ICC standard that this profile follows The version number of the ICC standard that this profile follows
(e.g. ``2.0``). (e.g. ``2.0``).
:type: :py:class:`float`
.. py:attribute:: icc_version .. py:attribute:: icc_version
:type: int
Same as ``version``, but in encoded format (see 7.2.4 of ICC.1:2010). Same as ``version``, but in encoded format (see 7.2.4 of ICC.1:2010).
.. py:attribute:: device_class .. py:attribute:: device_class
:type: str
4-character string identifying the profile class. One of 4-character string identifying the profile class. One of
``scnr``, ``mntr``, ``prtr``, ``link``, ``spac``, ``abst``, ``scnr``, ``mntr``, ``prtr``, ``link``, ``spac``, ``abst``,
``nmcl`` (see 7.2.5 of ICC.1:2010 for details). ``nmcl`` (see 7.2.5 of ICC.1:2010 for details).
:type: :py:class:`string`
.. py:attribute:: xcolor_space .. py:attribute:: xcolor_space
:type: str
4-character string (padded with whitespace) identifying the color 4-character string (padded with whitespace) identifying the color
space, e.g. ``XYZ␣``, ``RGB␣`` or ``CMYK`` (see 7.2.6 of space, e.g. ``XYZ␣``, ``RGB␣`` or ``CMYK`` (see 7.2.6 of
@ -59,9 +58,8 @@ can be easily displayed in a chromaticity diagram, for example).
interpreted (non-padded) variant of this (but can be empty on interpreted (non-padded) variant of this (but can be empty on
unknown input). unknown input).
:type: :py:class:`string`
.. py:attribute:: connection_space .. py:attribute:: connection_space
:type: str
4-character string (padded with whitespace) identifying the color 4-character string (padded with whitespace) identifying the color
space on the B-side of the transform (see 7.2.7 of ICC.1:2010 for space on the B-side of the transform (see 7.2.7 of ICC.1:2010 for
@ -70,42 +68,37 @@ can be easily displayed in a chromaticity diagram, for example).
Note that the deprecated attribute ``pcs`` contains an interpreted Note that the deprecated attribute ``pcs`` contains an interpreted
(non-padded) variant of this (but can be empty on unknown input). (non-padded) variant of this (but can be empty on unknown input).
:type: :py:class:`string`
.. py:attribute:: header_flags .. py:attribute:: header_flags
:type: int
The encoded header flags of the profile (see 7.2.11 of ICC.1:2010 The encoded header flags of the profile (see 7.2.11 of ICC.1:2010
for details). for details).
:type: :py:class:`int`
.. py:attribute:: header_manufacturer .. py:attribute:: header_manufacturer
:type: str
4-character string (padded with whitespace) identifying the device 4-character string (padded with whitespace) identifying the device
manufacturer, which shall match the signature contained in the manufacturer, which shall match the signature contained in the
appropriate section of the ICC signature registry found at appropriate section of the ICC signature registry found at
www.color.org (see 7.2.12 of ICC.1:2010). www.color.org (see 7.2.12 of ICC.1:2010).
:type: :py:class:`string`
.. py:attribute:: header_model .. py:attribute:: header_model
:type: str
4-character string (padded with whitespace) identifying the device 4-character string (padded with whitespace) identifying the device
model, which shall match the signature contained in the model, which shall match the signature contained in the
appropriate section of the ICC signature registry found at appropriate section of the ICC signature registry found at
www.color.org (see 7.2.13 of ICC.1:2010). www.color.org (see 7.2.13 of ICC.1:2010).
:type: :py:class:`string`
.. py:attribute:: attributes .. py:attribute:: attributes
:type: int
Flags used to identify attributes unique to the particular device Flags used to identify attributes unique to the particular device
setup for which the profile is applicable (see 7.2.14 of setup for which the profile is applicable (see 7.2.14 of
ICC.1:2010 for details). ICC.1:2010 for details).
:type: :py:class:`int`
.. py:attribute:: rendering_intent .. py:attribute:: rendering_intent
:type: int
The rendering intent to use when combining this profile with The rendering intent to use when combining this profile with
another profile (usually overridden at run-time, but provided here another profile (usually overridden at run-time, but provided here
@ -114,84 +107,82 @@ can be easily displayed in a chromaticity diagram, for example).
One of ``ImageCms.INTENT_ABSOLUTE_COLORIMETRIC``, ``ImageCms.INTENT_PERCEPTUAL``, One of ``ImageCms.INTENT_ABSOLUTE_COLORIMETRIC``, ``ImageCms.INTENT_PERCEPTUAL``,
``ImageCms.INTENT_RELATIVE_COLORIMETRIC`` and ``ImageCms.INTENT_SATURATION``. ``ImageCms.INTENT_RELATIVE_COLORIMETRIC`` and ``ImageCms.INTENT_SATURATION``.
:type: :py:class:`int`
.. py:attribute:: profile_id .. py:attribute:: profile_id
:type: bytes
A sequence of 16 bytes identifying the profile (via a specially A sequence of 16 bytes identifying the profile (via a specially
constructed MD5 sum), or 16 binary zeroes if the profile ID has constructed MD5 sum), or 16 binary zeroes if the profile ID has
not been calculated (see 7.2.18 of ICC.1:2010). not been calculated (see 7.2.18 of ICC.1:2010).
:type: :py:class:`bytes`
.. py:attribute:: copyright .. py:attribute:: copyright
:type: Optional[str]
The text copyright information for the profile (see 9.2.21 of ICC.1:2010). The text copyright information for the profile (see 9.2.21 of ICC.1:2010).
:type: :py:class:`unicode` or ``None``
.. py:attribute:: manufacturer .. py:attribute:: manufacturer
:type: Optional[str]
The (English) display string for the device manufacturer (see The (English) display string for the device manufacturer (see
9.2.22 of ICC.1:2010). 9.2.22 of ICC.1:2010).
:type: :py:class:`unicode` or ``None``
.. py:attribute:: model .. py:attribute:: model
:type: Optional[str]
The (English) display string for the device model of the device The (English) display string for the device model of the device
for which this profile is created (see 9.2.23 of ICC.1:2010). for which this profile is created (see 9.2.23 of ICC.1:2010).
:type: :py:class:`unicode` or ``None``
.. py:attribute:: profile_description .. py:attribute:: profile_description
:type: Optional[str]
The (English) display string for the profile description (see The (English) display string for the profile description (see
9.2.41 of ICC.1:2010). 9.2.41 of ICC.1:2010).
:type: :py:class:`unicode` or ``None``
.. py:attribute:: target .. py:attribute:: target
:type: Optional[str]
The name of the registered characterization data set, or the The name of the registered characterization data set, or the
measurement data for a characterization target (see 9.2.14 of measurement data for a characterization target (see 9.2.14 of
ICC.1:2010). ICC.1:2010).
:type: :py:class:`unicode` or ``None``
.. py:attribute:: red_colorant .. py:attribute:: red_colorant
:type: Optional[tuple[tuple[float]]]
The first column in the matrix used in matrix/TRC transforms (see 9.2.44 of ICC.1:2010). The first column in the matrix used in matrix/TRC transforms (see 9.2.44 of ICC.1:2010).
:type: ``((X, Y, Z), (x, y, Y))`` or ``None`` The value is in the format ``((X, Y, Z), (x, y, Y))``, if available.
.. py:attribute:: green_colorant .. py:attribute:: green_colorant
:type: Optional[tuple[tuple[float]]]
The second column in the matrix used in matrix/TRC transforms (see 9.2.30 of ICC.1:2010). The second column in the matrix used in matrix/TRC transforms (see 9.2.30 of ICC.1:2010).
:type: ``((X, Y, Z), (x, y, Y))`` or ``None`` The value is in the format ``((X, Y, Z), (x, y, Y))``, if available.
.. py:attribute:: blue_colorant .. py:attribute:: blue_colorant
:type: Optional[tuple[tuple[float]]]
The third column in the matrix used in matrix/TRC transforms (see 9.2.4 of ICC.1:2010). The third column in the matrix used in matrix/TRC transforms (see 9.2.4 of ICC.1:2010).
:type: ``((X, Y, Z), (x, y, Y))`` or ``None`` The value is in the format ``((X, Y, Z), (x, y, Y))``, if available.
.. py:attribute:: luminance .. py:attribute:: luminance
:type: Optional[tuple[tuple[float]]]
The absolute luminance of emissive devices in candelas per square The absolute luminance of emissive devices in candelas per square
metre as described by the Y channel (see 9.2.32 of ICC.1:2010). metre as described by the Y channel (see 9.2.32 of ICC.1:2010).
:type: ``((X, Y, Z), (x, y, Y))`` or ``None`` The value is in the format ``((X, Y, Z), (x, y, Y))``, if available.
.. py:attribute:: chromaticity .. py:attribute:: chromaticity
:type: Optional[tuple[tuple[float]]]
The data of the phosphor/colorant chromaticity set used (red, The data of the phosphor/colorant chromaticity set used (red,
green and blue channels, see 9.2.16 of ICC.1:2010). green and blue channels, see 9.2.16 of ICC.1:2010).
:type: ``((x, y, Y), (x, y, Y), (x, y, Y))`` or ``None`` The value is in the format ``((x, y, Y), (x, y, Y), (x, y, Y))``, if available.
.. py:attribute:: chromatic_adaption .. py:attribute:: chromatic_adaption
:type: tuple[tuple[float]]
The chromatic adaption matrix converts a color measured using the The chromatic adaption matrix converts a color measured using the
actual illumination conditions and relative to the actual adopted actual illumination conditions and relative to the actual adopted
@ -199,58 +190,52 @@ can be easily displayed in a chromaticity diagram, for example).
complete adaptation from the actual adopted white chromaticity to complete adaptation from the actual adopted white chromaticity to
the PCS adopted white chromaticity (see 9.2.15 of ICC.1:2010). the PCS adopted white chromaticity (see 9.2.15 of ICC.1:2010).
Two matrices are returned, one in (X, Y, Z) space and one in (x, y, Y) space. Two 3-tuples of floats are returned in a 2-tuple,
one in (X, Y, Z) space and one in (x, y, Y) space.
:type: 2-tuple of 3-tuple, the first with (X, Y, Z) and the second with (x, y, Y) values
.. py:attribute:: colorant_table .. py:attribute:: colorant_table
:type: list[str]
This tag identifies the colorants used in the profile by a unique This tag identifies the colorants used in the profile by a unique
name and set of PCSXYZ or PCSLAB values (see 9.2.19 of name and set of PCSXYZ or PCSLAB values (see 9.2.19 of
ICC.1:2010). ICC.1:2010).
:type: list of strings
.. py:attribute:: colorant_table_out .. py:attribute:: colorant_table_out
:type: list[str]
This tag identifies the colorants used in the profile by a unique This tag identifies the colorants used in the profile by a unique
name and set of PCSLAB values (for DeviceLink profiles only, see name and set of PCSLAB values (for DeviceLink profiles only, see
9.2.19 of ICC.1:2010). 9.2.19 of ICC.1:2010).
:type: list of strings
.. py:attribute:: colorimetric_intent .. py:attribute:: colorimetric_intent
:type: Optional[str]
4-character string (padded with whitespace) identifying the image 4-character string (padded with whitespace) identifying the image
state of PCS colorimetry produced using the colorimetric intent state of PCS colorimetry produced using the colorimetric intent
transforms (see 9.2.20 of ICC.1:2010 for details). transforms (see 9.2.20 of ICC.1:2010 for details).
:type: :py:class:`string` or ``None``
.. py:attribute:: perceptual_rendering_intent_gamut .. py:attribute:: perceptual_rendering_intent_gamut
:type: Optional[str]
4-character string (padded with whitespace) identifying the (one) 4-character string (padded with whitespace) identifying the (one)
standard reference medium gamut (see 9.2.37 of ICC.1:2010 for standard reference medium gamut (see 9.2.37 of ICC.1:2010 for
details). details).
:type: :py:class:`string` or ``None``
.. py:attribute:: saturation_rendering_intent_gamut .. py:attribute:: saturation_rendering_intent_gamut
:type: Optional[str]
4-character string (padded with whitespace) identifying the (one) 4-character string (padded with whitespace) identifying the (one)
standard reference medium gamut (see 9.2.37 of ICC.1:2010 for standard reference medium gamut (see 9.2.37 of ICC.1:2010 for
details). details).
:type: :py:class:`string` or ``None``
.. py:attribute:: technology .. py:attribute:: technology
:type: Optional[str]
4-character string (padded with whitespace) identifying the device 4-character string (padded with whitespace) identifying the device
technology (see 9.2.47 of ICC.1:2010 for details). technology (see 9.2.47 of ICC.1:2010 for details).
:type: :py:class:`string` or ``None``
.. py:attribute:: media_black_point .. py:attribute:: media_black_point
:type: Optional[tuple[tuple[float]]]
This tag specifies the media black point and is used for This tag specifies the media black point and is used for
generating absolute colorimetry. generating absolute colorimetry.
@ -258,57 +243,57 @@ can be easily displayed in a chromaticity diagram, for example).
This tag was available in ICC 3.2, but it is removed from This tag was available in ICC 3.2, but it is removed from
version 4. version 4.
:type: ``((X, Y, Z), (x, y, Y))`` or ``None`` The value is in the format ``((X, Y, Z), (x, y, Y))``, if available.
.. py:attribute:: media_white_point_temperature .. py:attribute:: media_white_point_temperature
:type: Optional[float]
Calculates the white point temperature (see the LCMS documentation Calculates the white point temperature (see the LCMS documentation
for more information). for more information).
:type: :py:class:`float` or ``None``
.. py:attribute:: viewing_condition .. py:attribute:: viewing_condition
:type: Optional[str]
The (English) display string for the viewing conditions (see The (English) display string for the viewing conditions (see
9.2.48 of ICC.1:2010). 9.2.48 of ICC.1:2010).
:type: :py:class:`unicode` or ``None``
.. py:attribute:: screening_description .. py:attribute:: screening_description
:type: Optional[str]
The (English) display string for the screening conditions. The (English) display string for the screening conditions.
This tag was available in ICC 3.2, but it is removed from This tag was available in ICC 3.2, but it is removed from
version 4. version 4.
:type: :py:class:`unicode` or ``None``
.. py:attribute:: red_primary .. py:attribute:: red_primary
:type: Optional[tuple[tuple[float]]]
The XYZ-transformed of the RGB primary color red (1, 0, 0). The XYZ-transformed of the RGB primary color red (1, 0, 0).
:type: ``((X, Y, Z), (x, y, Y))`` or ``None`` The value is in the format ``((X, Y, Z), (x, y, Y))``, if available.
.. py:attribute:: green_primary .. py:attribute:: green_primary
:type: Optional[tuple[tuple[float]]]
The XYZ-transformed of the RGB primary color green (0, 1, 0). The XYZ-transformed of the RGB primary color green (0, 1, 0).
:type: ``((X, Y, Z), (x, y, Y))`` or ``None`` The value is in the format ``((X, Y, Z), (x, y, Y))``, if available.
.. py:attribute:: blue_primary .. py:attribute:: blue_primary
:type: Optional[tuple[tuple[float]]]
The XYZ-transformed of the RGB primary color blue (0, 0, 1). The XYZ-transformed of the RGB primary color blue (0, 0, 1).
:type: ``((X, Y, Z), (x, y, Y))`` or ``None`` The value is in the format ``((X, Y, Z), (x, y, Y))``, if available.
.. py:attribute:: is_matrix_shaper .. py:attribute:: is_matrix_shaper
:type: bool
True if this profile is implemented as a matrix shaper (see True if this profile is implemented as a matrix shaper (see
documentation on LCMS). documentation on LCMS).
:type: :py:class:`bool`
.. py:attribute:: clut .. py:attribute:: clut
:type: dict[tuple[bool]]
Returns a dictionary of all supported intents and directions for Returns a dictionary of all supported intents and directions for
the CLUT model. the CLUT model.
@ -326,9 +311,8 @@ can be easily displayed in a chromaticity diagram, for example).
The elements of the tuple are booleans. If the value is ``True``, The elements of the tuple are booleans. If the value is ``True``,
that intent is supported for that direction. that intent is supported for that direction.
:type: :py:class:`dict` of boolean 3-tuples
.. py:attribute:: intent_supported .. py:attribute:: intent_supported
:type: dict[tuple[bool]]
Returns a dictionary of all supported intents and directions. Returns a dictionary of all supported intents and directions.
@ -345,53 +329,46 @@ can be easily displayed in a chromaticity diagram, for example).
The elements of the tuple are booleans. If the value is ``True``, The elements of the tuple are booleans. If the value is ``True``,
that intent is supported for that direction. that intent is supported for that direction.
:type: :py:class:`dict` of boolean 3-tuples
.. py:attribute:: color_space .. py:attribute:: color_space
:type: str
Deprecated but retained for backwards compatibility. Deprecated but retained for backwards compatibility.
Interpreted value of :py:attr:`.xcolor_space`. May be the Interpreted value of :py:attr:`.xcolor_space`. May be the
empty string if value could not be decoded. empty string if value could not be decoded.
:type: :py:class:`string`
.. py:attribute:: pcs .. py:attribute:: pcs
:type: str
Deprecated but retained for backwards compatibility. Deprecated but retained for backwards compatibility.
Interpreted value of :py:attr:`.connection_space`. May be Interpreted value of :py:attr:`.connection_space`. May be
the empty string if value could not be decoded. the empty string if value could not be decoded.
:type: :py:class:`string`
.. py:attribute:: product_model .. py:attribute:: product_model
:type: str
Deprecated but retained for backwards compatibility. Deprecated but retained for backwards compatibility.
ASCII-encoded value of :py:attr:`.model`. ASCII-encoded value of :py:attr:`.model`.
:type: :py:class:`string`
.. py:attribute:: product_manufacturer .. py:attribute:: product_manufacturer
:type: str
Deprecated but retained for backwards compatibility. Deprecated but retained for backwards compatibility.
ASCII-encoded value of :py:attr:`.manufacturer`. ASCII-encoded value of :py:attr:`.manufacturer`.
:type: :py:class:`string`
.. py:attribute:: product_copyright .. py:attribute:: product_copyright
:type: str
Deprecated but retained for backwards compatibility. Deprecated but retained for backwards compatibility.
ASCII-encoded value of :py:attr:`.copyright`. ASCII-encoded value of :py:attr:`.copyright`.
:type: :py:class:`string`
.. py:attribute:: product_description .. py:attribute:: product_description
:type: str
Deprecated but retained for backwards compatibility. Deprecated but retained for backwards compatibility.
ASCII-encoded value of :py:attr:`.profile_description`. ASCII-encoded value of :py:attr:`.profile_description`.
:type: :py:class:`string`
.. py:attribute:: product_desc .. py:attribute:: product_desc
:type: str
Deprecated but retained for backwards compatibility. Deprecated but retained for backwards compatibility.
ASCII-encoded value of :py:attr:`.profile_description`. ASCII-encoded value of :py:attr:`.profile_description`.
@ -401,8 +378,6 @@ can be easily displayed in a chromaticity diagram, for example).
depending on the value of the description, copyright, depending on the value of the description, copyright,
manufacturer and model fields). manufacturer and model fields).
:type: :py:class:`string`
There is one function defined on the class: There is one function defined on the class:
.. py:method:: is_intent_supported(intent, direction) .. py:method:: is_intent_supported(intent, direction)