Skip to content

pixtreme.core

core

Core Frame, LUT, channel, and closed-vocabulary types.

Alpha = Literal['premultiplied', 'straight'] module-attribute

Antialiasing = Literal['distance', 'supersample', 'off'] module-attribute

Blend = Literal['normal', 'lighten', 'add', 'screen', 'darken', 'multiply', 'difference', 'overlay', 'hardlight', 'softlight'] module-attribute

Border = Literal['mirror', 'replicate', 'wrap', 'constant'] module-attribute

ChromaSiting = Literal['left', 'center', 'topleft', 'top', 'bottomleft', 'bottom'] module-attribute

ChromaticAdaptation = Literal['Bradford', 'CAT02', 'CAT16', 'von-Kries'] module-attribute

ColorBarsOutput = Literal['normalized', 'code'] module-attribute

ColorBarsStandard = Literal['ARIB-STD-B28', 'SMPTE-RP219', 'BT.2111-HLG', 'BT.2111-PQ', 'BT.2111-PQ-full', 'full-100', 'full-75'] module-attribute

Colorspace = Literal['sRGB', 'Rec.709', 'Rec.2020', 'P3-DCI', 'P3-D60', 'P3-D65', 'SMPTE-C', 'ACES2065-1', 'ACEScg', 'S-Gamut', 'S-Gamut3', 'S-Gamut3.Cine', 'ARRI-Wide-Gamut-3', 'ARRI-Wide-Gamut-4', 'Blackmagic-Wide-Gamut-Gen-5', 'DaVinci-Wide-Gamut', 'REDWideGamutRGB', 'DRAGONcolor', 'DRAGONcolor2', 'REDcolor2', 'REDcolor3', 'REDcolor4', 'Canon-Cinema-Gamut', 'V-Gamut', 'D-Gamut', 'F-Gamut-C', 'Apple-Wide-Gamut', 'Adobe-RGB', 'ProPhoto-RGB'] module-attribute

Dtype = Literal['float32', 'float16', 'uint8', 'uint16', 'uint32'] module-attribute

ExrCompression = Literal['none', 'rle', 'zip', 'zips', 'piz', 'pxr24', 'b44', 'b44a', 'dwaa', 'dwab'] module-attribute

Gamma = Literal['linear', 'sRGB', 'Rec.709', 'BT.1886', 'PQ', 'HLG', 'ACEScc', 'ACEScct', 'S-Log', 'S-Log2', 'S-Log3', 'ARRI-LogC3', 'ARRI-LogC4', 'Blackmagic-Film-Gen-5', 'DaVinci-Intermediate', 'RED-Log3G10', 'REDlogFilm', 'Canon-Log', 'Canon-Log-2', 'Canon-Log-3', 'V-Log', 'D-Log', 'F-Log', 'F-Log2', 'N-Log', 'L-Log', 'Apple-Log', 'Samsung-Log', 'Cineon', 'Gamma-1.8', 'Gamma-2.2', 'Gamma-2.4', 'Gamma-2.5', 'Gamma-2.6', 'Adobe-RGB', 'ProPhoto-RGB'] module-attribute

GeneratorKind = Literal['linear', 'radial'] module-attribute

ImageFormat = Literal['jpeg', 'png', 'tiff', 'jpeg2000', 'webp', 'bmp', 'pnm'] module-attribute

Interpolation = Literal['nearest', 'bilinear', 'bicubic', 'b-spline', 'mitchell', 'lanczos2', 'lanczos3', 'lanczos4', 'lanczos2-aa', 'lanczos3-aa', 'lanczos4-aa', 'area', 'trilinear', 'tetrahedral', 'linear'] module-attribute

Layout = Literal['HWC', 'NHWC', 'CHW', 'NCHW'] module-attribute

Matrix = Literal['BT.601', 'BT.709', 'BT.2020', 'native'] module-attribute

MorphologyShape = Literal['disk', 'square'] module-attribute

Range = Literal['legal', 'full'] module-attribute

ReferenceWhite = Literal['D65', 'D93', 'D50', 'ACES', 'DCI'] module-attribute

SobelDirection = Literal['x', 'y', 'magnitude'] module-attribute

StackDirection = Literal['vertical', 'horizontal'] module-attribute

TemplateMatchingMethod = Literal['sqdiff', 'sqdiff_normed', 'ccorr', 'ccorr_normed', 'ccoeff', 'ccoeff_normed'] module-attribute

TextAlign = Literal['left', 'center', 'right', 'justify'] module-attribute

TextAnchor = Literal['top-left', 'top-center', 'top-right', 'center-left', 'center-center', 'center-right', 'baseline-left', 'baseline-center', 'baseline-right', 'bottom-left', 'bottom-center', 'bottom-right'] module-attribute

TextFont = Literal['sans', 'mono'] module-attribute

TextLanguage = Literal['ja', 'zh-hans', 'zh-hant', 'ko'] module-attribute

TiffCompression = Literal['none', 'lzw'] module-attribute

Tonemap = Literal['ACES-1.3', 'ACES-2.0', 'BT.2408'] module-attribute

VectorBlurShutter = Literal['centered', 'forward', 'backward'] module-attribute

__all__ = ('Frame', 'Lut', 'Lut1D', 'channels', 'ChromaticAdaptation', 'ReferenceWhite', 'Colorspace', 'Gamma', 'Matrix', 'Dtype', 'Layout', 'Tonemap', 'Range', 'Interpolation', 'Border', 'ChromaSiting', 'StackDirection', 'SobelDirection', 'TemplateMatchingMethod', 'Blend', 'Alpha', 'Antialiasing', 'TextLanguage', 'TextAnchor', 'TextAlign', 'TextFont', 'GeneratorKind', 'ColorBarsStandard', 'ColorBarsOutput', 'MorphologyShape', 'ImageFormat', 'TiffCompression', 'ExrCompression', 'VectorBlurShutter', 'get_cmake_dir') module-attribute

Frame

A mutable HWC GPU image whose pixels and color metadata are held by one C++ Frame.

C-contiguous input is borrowed without allocating pixels. Non-contiguous input and deep copies use the caller's CuPy allocator. DLPack arguments pass through unchanged to the CuPy data array.

__slots__ = ('_handle', '__weakref__') class-attribute instance-attribute

data property writable

Borrowed or copied C-contiguous CuPy pixels.

colorspace property writable

gamma property writable

channels property writable

matrix property writable

width property

Image width in pixels.

height property

Image height in pixels.

shape property

HWC data shape.

dtype property

Data storage dtype.

__init__(*, data, colorspace, gamma, channels, matrix=None)

__setattr__(name, value)

__dlpack__(*, stream=None, max_version=None, dl_device=None, copy=None)

Delegate DLPack export to data, preserving consumer arguments.

__dlpack_device__()

Delegate the DLPack device query to data.

__eq__(other)

__copy__()

__deepcopy__(memo=None)

__getstate__()

__setstate__(state)

__repr__()

Represent known channel labels compactly and preserve custom labels explicitly.

Lut dataclass

A validated 3D RGB lookup grid stored on an NVIDIA GPU.

data has shape (N, N, N, 3) indexed by red, green, and blue, with float32 values and N >= 2. The array is retained by reference, without a construction-time copy; callers are responsible for avoiding mutation while the LUT is in use. domain_min and domain_max map input RGB values onto the grid independently by channel. shaper may hold a shared float32 (N,) output table on the same CUDA device. It is retained by reference and evaluated linearly before the cube, with its output clamped to cube coordinates. Writing such a LUT as Cube irreversibly bakes the two stages onto one grid, so the shaper and its between-node evaluation cannot be recovered from that file.

data instance-attribute

domain_min = _DEFAULT_DOMAIN_MIN class-attribute instance-attribute

domain_max = _DEFAULT_DOMAIN_MAX class-attribute instance-attribute

shaper = dataclass_field(default=None, kw_only=True) class-attribute instance-attribute

__post_init__()

__init__(data, domain_min=_DEFAULT_DOMAIN_MIN, domain_max=_DEFAULT_DOMAIN_MAX, *, shaper=None)

Lut1D dataclass

A validated per-channel RGB lookup curve stored on an NVIDIA GPU.

data has shape (N, 3) with float32 values and N >= 2. Each column is the independent red, green, or blue output curve. The array is retained by reference without a construction-time copy; callers are responsible for avoiding mutation while the LUT is in use. Per-channel domain_min and domain_max values map inputs onto sample indices. Table outputs may be non-monotonic or outside 0..1.

data instance-attribute

domain_min = _DEFAULT_DOMAIN_MIN class-attribute instance-attribute

domain_max = _DEFAULT_DOMAIN_MAX class-attribute instance-attribute

__post_init__()

__init__(data, domain_min=_DEFAULT_DOMAIN_MIN, domain_max=_DEFAULT_DOMAIN_MAX)

channels(value)

Normalize a compact known-label string or a non-empty sequence of arbitrary channel labels.

get_cmake_dir()

Return the installed CMake SDK directory for pixtreme_DIR.

C and C++ consumers use find_package(pixtreme CONFIG REQUIRED) and link pixtreme::pixtreme. Keep the installed library on the runtime search path; consumers call pixtreme::require_abi() to check their compiled headers. This lookup works for wheels and editable installs without loading CUDA.