Skip to main content

Module planar_capture

Module planar_capture 

Source
Expand description

Forward packed-to-planar capture (PlanarCaptureSpec, PlanarCapturePlan, CaptureScratch): strided interleaved pixels → multi-plane YCbCr / YCgCo / Identity GBR / planar RGB / monochrome PlanarViewMut (U8, U16 8/10/12/16-bit including P010 / U10_LSB, U32, and F32 planar RGB).

Two-stage execution guarantees identical color, transfer, HDR white/peak, HLG OOTF, alpha matte, gamut, and CMS behavior with RowPlan:

  1. Stage 1 converts source rows into full-range f32 in the destination’s primaries, transfer, diffuse white, and alpha mode using a compiled RowPlan over an O(width) ring buffer of at most 2 * max_vertical_subsampling + 1 rows (5 rows for 4:2:0 — ~230 KiB at 4K instead of a full frame buffer).
  2. Stage 2 evaluates exact f64 ITU-T H.273 matrix encoding, phase-exact chroma downsampling honoring PlanarCaptureSpec::chroma_siting and PlanarCaptureSpec::visible_rect crop origin (using local integer coordinates immune to large-offset float rounding), final f64 quantization (Round / Truncate / OrderedDither), and BitPacking::pack_code.

Structs§

CaptureScratch
Reusable caller-owned or budget-borrowed f64 scratch workspace for PlanarCapturePlan::execute.
PlanarCaptureOptions
Configuration for forward planar capture (PlanarCapturePlan).
PlanarCapturePlan
Prepared, reusable, thread-safe forward planar capture plan.
PlanarCaptureSpec
Target planar geometry, plane layout, chroma siting, and true coded CICP signal for PlanarCapturePlan.

Enums§

ChromaDownsample
Chroma downsampling filter for subsampled YCbCr capture (4:2:0, 4:2:2, 4:4:0, 4:1:1).