Skip to main content

Module color_convert_kernel

Module color_convert_kernel 

Source
Expand description

GPU color space conversion kernels (CPU simulation).

Provides batch color space conversion operations simulated with Rayon parallelism, matching GPU compute-shader semantics.

Supported conversions:

  • RGB ↔ YUV with BT.601, BT.709, BT.2020 coefficients
  • Limited range ↔ full range (studio swing ↔ JPEG)
  • Packed RGBA ↔ planar YUV (4:4:4)

§Example

use oximedia_gpu::color_convert_kernel::{ColorConvertKernel, ColorStandard, RangeMode};

let input = vec![235u8, 128, 44, 255]; // 1×1 RGBA pixel
let mut output = vec![0u8; 4];         // 1×1 YUVA output
ColorConvertKernel::rgb_to_yuv(&input, &mut output, 1, 1, ColorStandard::Bt709, RangeMode::Full)
    .expect("conversion failed");

Structs§

BatchConvertStats
Statistics produced after a batch color conversion.
ColorConvertKernel
GPU-style color space conversion kernel (CPU simulation via Rayon).
ConversionMatrix
3×3 forward (RGB→YCbCr) and inverse (YCbCr→RGB) matrices derived from ColorStandard and RangeMode.

Enums§

ColorKernelError
Errors returned by color conversion kernel operations.
ColorStandard
Color standard / primaries used for the YCbCr matrix coefficients.
RangeMode
Quantization range for Y/Cb/Cr values.