core owns viewer state, source abstractions, frame orchestration, and OCIO transform application contracts.
viewer_state.pyframe_source.pysource_models.pyframe_cache.pyframe_service.pyocio_processor.pylut/analysis.pylut/interpolation.pylut/volume_projection.pyscopes/waveform.pyscopes/waveform_science.py
- Defines UI-facing state dataclasses (
PanelState,CompareState,CompareViewState). - Holds compare mode, wipe state, zoom/pan state, and per-side colorspace/look/bypass settings.
- Defines shared contracts/protocols (
FrameSource) and frame metadata (FrameInfo).
- Provides concrete source models for still images, sequences, and movie files.
- Normalizes frame indexing and frame-info access.
- Exposes
create_source_from_path(...)for input classification handoff.
- Small bounded LRU-like cache keyed by
(source_id, frame_index).
- Orchestrates frame retrieval through cache + source decode.
- Tracks request tokens for stale-result detection when rapid frame changes occur.
- Builds OCIO processors from selected input/output colorspace, optional look, and context values.
- Applies processor transforms to float RGB buffers.
- Computes UI-agnostic LUT Inspector summary metrics from plotted sample data.
- Reports sample count, effective channel count, per-channel output min/max,
values outside
[0, 1], and per-channel monotonicity. - Keeps numerical summary behavior out of Qt widgets.
- Provides reusable LUT interpolation helpers for inspection workflows.
- Evaluates 1D piecewise-linear prelut mappings with explicit endpoint clamping.
- Normalizes shaped prelut outputs to unit cube coordinates with explicit clamping.
- Uses SciPy
RegularGridInterpolatorbehind a Prism helper for 3D LUT trilinear sampling. - Public sampling coordinates are normalized
(x, y, z)while stored cube data remains(z, y, x, channels). - Direct neutral-axis extraction remains preferred when exact lattice samples are available and interpolation is unnecessary.
- Builds deterministic 3D LUT point-cloud samples from stored
(z, y, x, 3)volume data. - Projects sampled RGB points into normalized 2D coordinates for the UI Volume view.
- Supports
RGB isometric,RG plane,RB plane, andGB planeprojections. - Supports output-cloud positions and input-lattice positions.
- Applies a deterministic sample cap for large LUT previews so UI rendering stays responsive.
- Selects neutral-axis samples from input lattice diagonal indices for the UI overlay; this keeps the reference stable even when output RGB is warped.
- Builds deterministic raw R, G, B, and encoded Y' density grids from float RGB analysis buffers.
- Defaults to BT.709 and accepts explicit BT.2020 selection.
- Records signal-standard and coefficient provenance in
WaveformTrace. - Keeps the legacy
density_lumafield name for compatibility; its documented meaning is encoded Y' density, not scene-linear luminance.
- Obtains BT.709/BT.2020 encoded-signal weights from Colour's
WEIGHTS_YCBCRregistry. - Returns defensive, read-only coefficient arrays.
- Uses SciPy Gaussian filtering with the locked
(0.5, 0.5)kernel for presentation copies only. - Normalizes filtered R, G, B, and Y' channels with one shared maximum so channel relationships are preserved.
- Keeps raw waveform density arrays unchanged and UI-independent.
Colour Science is available as a Prism dependency, but LUT Inspector does not currently expose Delta E or other perceptual LUT metrics. Arbitrary LUT files do not reliably declare source colourspace, target colourspace, transfer encoding, viewing condition, or creative/technical intent. Any Colour-backed LUT metric must therefore be introduced by a separate plan with an explicit colourspace and comparison contract.
- Add new source kinds by extending source detection + concrete model implementing
FrameSourcebehavior. - Extend transform parameterization in
viewer_statefirst, then consume inocio_processor. - Keep extension logic explicit and side-effect conscious; avoid hidden routing abstractions.