Skip to main content

Module scale_kernel

Module scale_kernel 

Source
Expand description

GPU scaling kernels (CPU simulation via Rayon).

Provides parallel image scaling operations that simulate GPU compute shader dispatch. Supports packed RGBA and planar YUV formats.

§Supported filters

FilterQualitySpeed
ScaleFilter::NearestLowFastest
ScaleFilter::BilinearMediumFast
ScaleFilter::BicubicHighMedium
ScaleFilter::AreaHigh (downscale)Medium

§Example

use oximedia_gpu::scale_kernel::{ScaleKernel, ScaleFilter};

let src = vec![0u8; 8 * 8 * 4]; // 8×8 RGBA
let mut dst = vec![0u8; 4 * 4 * 4]; // scale to 4×4
ScaleKernel::scale_rgba(&src, 8, 8, &mut dst, 4, 4, ScaleFilter::Bilinear)
    .expect("scale failed");

Structs§

ScaleKernel
GPU-style image scaling kernel (CPU simulation via Rayon).
ScaleStats
Statistics produced after a scaling operation.

Enums§

ScaleError
Errors returned by scale kernel operations.
ScaleFilter
Interpolation filter used when scaling.