Skip to content

Commit 5366f57

Browse files
committed
Add Python docs for new API functions
The ColorConfig class was not documented yet, this only documents the new methods. Signed-off-by: Brecht Van Lommel <brecht@blender.org>
1 parent 151e75b commit 5366f57

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed

src/doc/pythonbindings.rst

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3888,6 +3888,73 @@ sections) work with deep inputs::
38883888
38893889
|
38903890
3891+
.. _sec-pythoncolorconfig:
3892+
3893+
3894+
ColorConfig
3895+
===========
3896+
3897+
The `ColorConfig` class that represents the set of color transformations that
3898+
are allowed.
3899+
3900+
If OpenColorIO is enabled at build time, this configuration is loaded at
3901+
runtime, allowing the user to have complete control of all color transformation
3902+
math. See the
3903+
`OpenColorIO documentation <https://opencolorio.readthedocs.io>`_ for details.
3904+
3905+
If OpenColorIO is not enabled at build time, a generic color configuration
3906+
is provided for minimal color support.
3907+
3908+
..
3909+
TODO: The documentation for this class is incomplete.
3910+
3911+
.. py:method:: get_cicp (colorspace)
3912+
3913+
Find CICP code corresponding to the colorspace.
3914+
Return a sequence of 4 ints, or None if not found.
3915+
3916+
Example:
3917+
3918+
.. code-block:: python
3919+
3920+
colorconfig = oiio.ColorConfig()
3921+
cicp = colorconfig.get_cicp("pq_rec2020_display")
3922+
if cicp:
3923+
primaries, transfer, matrix, color_range = cicp
3924+
3925+
This function was added in OpenImageIO 3.1.
3926+
3927+
3928+
.. py:method:: get_color_interop_id (colorspace)
3929+
3930+
Find color interop ID for the given colorspace.
3931+
Returns empty string if not found.
3932+
3933+
Example:
3934+
3935+
.. code-block:: python
3936+
3937+
colorconfig = oiio.ColorConfig()
3938+
interop_id = colorconfig.get_color_interop_id("Rec.2100-PQ - Display")
3939+
3940+
This function was added in OpenImageIO 3.1.
3941+
3942+
3943+
.. py:method:: get_color_interop_id (cicp)
3944+
3945+
Find color interop ID corresponding to the CICP code.
3946+
Returns empty string if not found.
3947+
3948+
Example:
3949+
3950+
.. code-block:: python
3951+
3952+
colorconfig = oiio.ColorConfig()
3953+
interop_id = colorconfig.get_color_interop_id([9, 16, 9, 1])
3954+
3955+
This function was added in OpenImageIO 3.1.
3956+
3957+
38913958
.. _sec-pythonmiscapi:
38923959
38933960
Miscellaneous Utilities

0 commit comments

Comments
 (0)