Skip to content

Instantly share code, notes, and snippets.

ocio_profile_version: 2.2
name: example-egamut2-config_v1.0
description: |
Demonstrates the use of EGamut2 D65 as the scene reference space and the rest of the display color space / view transform architecture
search_path:
- ./luts
@zachlewis
zachlewis / package.py
Last active February 22, 2025 16:46
Rez package for Boost
name = 'boost'
version = "1.85.0"
authors = ['boost.org']
hased_variants= True
description = \
'''
@zachlewis
zachlewis / patch_cicp.py
Last active February 26, 2025 15:28
Patch nclx data into AVIF file header for specified Primaries / TRC / YUV Matrix
import binascii
import os
import re
from logging import getLogger
logger = getLogger(__name__)
def patch_avif_header_cicp(input_file, P=9, T=16, M=9, output_file=None, preset=None, dryrun=False):
"""Patch nclx data into AVIF file header for specified Primaries / TRC / YUV Matrix Coeff enums."""
@zachlewis
zachlewis / package.py
Created May 10, 2024 01:19
rust rez package.py
name = 'rust'
version = '1.78.0'
description = 'Rust is an interpreted, interactive, object-oriented programming language'
help = "https://www.rust-lang.org"
@early()
def uuid():
@zachlewis
zachlewis / package.py
Last active May 10, 2024 01:39
python rez package.py that uses `rye` to download and deploy indygreg builds
name = "python"
version = "3.10.14"
authors = ["Guido van Rossum"]
description = "The Python programming language"
@early()
def variants():
import rez.package_py_utils as rezutils, platform
p = 'platform-%s' % {'darwin':'osx','windows':'windows','linux':'linux'}[platform.system().lower()]
return [rezutils.expand_requires(p, "arch-**")]
@zachlewis
zachlewis / NumericLookup.py
Last active May 23, 2022 22:31
NumericLookup
import numpy as np
class NumericLookup(dict):
"""
Extends *dict* type to provide a lookup by value(s), including numpy arrays.
Methods
-------
keys_from_value
first_key_from_value
@zachlewis
zachlewis / aces_ot_candidates_ocio_config.ipynb
Last active September 22, 2023 12:19
ACES_OT_Candidates_ocio_config.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@zachlewis
zachlewis / set_ocio_transform_metadata.py
Created November 29, 2021 16:31
PyOpenColorIO format metadata method
import PyOpenColorIO as ocio
from typing import Union, List
def set_transform_metadata(
transform: ocio.Transform,
name: str = "",
id: str = "",
description: Union[str, List[str]] = "",
input_descriptor: str = "",
output_descriptor: str = "",
@zachlewis
zachlewis / SessionState.py
Created January 22, 2021 01:57 — forked from tvst/SessionState.py
A possible design for doing per-session persistent state in Streamlit
"""Hack to add per-session state to Streamlit.
Usage
-----
>>> import SessionState
>>>
>>> session_state = SessionState.get(user_name='', favorite_color='black')
>>> session_state.user_name
''
@zachlewis
zachlewis / package.py
Last active January 24, 2021 06:27
cmake rez package
# -*- coding: utf-8 -*-
name = 'cmake'
version = '3.17.2'
description = 'Cross-platform make system'
tools = [
'ccmake',