Skip to content

Commit

Permalink
Add Python GPU renderer implementation example (AcademySoftwareFounda…
Browse files Browse the repository at this point in the history
…tion#1493)

* Add Python GPU renderer implementation example

Signed-off-by: Michael Dolan <michdolan@gmail.com>

* Move to apps with README

Signed-off-by: Michael Dolan <michdolan@gmail.com>

Co-authored-by: Patrick Hodoul <patrick.hodoul@autodesk.com>
Co-authored-by: Rémi Achard <remiachard@gmail.com>
  • Loading branch information
3 people authored Oct 18, 2021
1 parent 59316cf commit 4a6745a
Show file tree
Hide file tree
Showing 3 changed files with 1,393 additions and 0 deletions.
38 changes: 38 additions & 0 deletions src/apps/pyociodisplay/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!-- SPDX-License-Identifier: CC-BY-4.0 -->
<!-- Copyright Contributors to the OpenColorIO Project. -->

pyociodisplay
=============

**Work in progress**. Minimal image viewer implementation demonstrating use of
the OCIO GPU renderer in a Python application.

Usage
-----

1. Install dependencies on ``PYTHONPATH``
2. Run ``python pyociodisplay.py``
3. Load image with ``File/Load image...`` menu item

Dependencies
------------

* PyOpenColorIO
* [OpenImageIO (Python bindings)](https://github.com/OpenImageIO/oiio)
* [Imath (Python bindings)](https://github.com/AcademySoftwareFoundation/Imath)
* ``pip install requirements.txt``
* [numpy](https://pypi.org/project/numpy/)
* [PyOpenGL](https://pypi.org/project/PyOpenGL/)
* [PySide2](https://pypi.org/project/PySide2/)

Implementation notes
--------------------

* Assumes the ``OCIO`` environment variable is defined and pointing to a
compatible OCIO config file.
* Takes into account file and viewing rules, and may change the input color
space and/or view automatically when a new image is loaded.
* Exposure and gamma controls are dynamic parameters, driving uniforms in the
generated shader program.
* Specific channel views can be toggled with R, G, B, A keys, and the RGBA view
restored with C.
Loading

0 comments on commit 4a6745a

Please sign in to comment.