Skip to content

Commit

Permalink
Add *Fichet et al. (2021)* examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
KelSolaar committed May 20, 2024
1 parent 405498d commit 970f59c
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -876,6 +876,18 @@ Images
(276, 281, 3)
Spectral Images - Fichet et al. (2021)
**************************************
.. code-block:: python
components = colour.read_spectral_image_Fichet2021("Polarised.exr")
list(components.keys())
.. code-block:: text
['S0', 'S1', 'S2', 'S3']
Look Up Table (LUT) Data
************************
Expand Down
32 changes: 32 additions & 0 deletions colour/examples/io/examples_fichet2021.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
"""
Showcases *Fichet, Pacanowski and Wilkie (2021)*
*OpenEXR Layout for Spectral Images* related examples.
"""

import os
import tempfile

import colour
from colour.utilities import message_box

ROOT_RESOURCES = os.path.join(
os.path.dirname(__file__), "..", "..", "io", "tests", "resources"
)

message_box('"Fichet, Pacanowski and Wilkie (2021)" Spectral Image Reading and Writing')

message_box("Reading a spectral image.")
path = os.path.join(ROOT_RESOURCES, "Ohta1997.exr")
components, specification = colour.read_spectral_image_Fichet2021(
path, additional_data=True
)
print(components)
print(specification)

print("\n")

message_box("Writing a spectral image.")
_descriptor, path = tempfile.mkstemp(suffix=".exr")
colour.write_spectral_image_Fichet2021(components, path) # pyright: ignore
components = colour.read_spectral_image_Fichet2021(path)
print(components)
12 changes: 12 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,18 @@ Images
(276, 281, 3)
Spectral Images - Fichet et al. (2021)
**************************************

.. code-block:: python
components = colour.read_spectral_image_Fichet2021("Polarised.exr")
list(components.keys())
.. code-block:: text
['S0', 'S1', 'S2', 'S3']
Look Up Table (LUT) Data
************************

Expand Down

0 comments on commit 970f59c

Please sign in to comment.