pub fn median_blur_gpu(
runtime: &WgpuRuntime,
source: &GpuImage,
kernel_size: u32,
border: GpuImageBorder,
) -> SpatialResult<GpuImage>Expand description
Selects the exact per-channel median of a 3x3 or 5x5 square neighborhood. Supports all 1..=4 logical u8 channels and retains metadata. Each component, including alpha, is filtered independently. Replicate and constant-zero borders match the corresponding CPU median. One ordered device pass returns an owned image without host transfer/wait or image-sized scratch. Upload/readback remain explicit caller operations. Runtime, kernel and device limits reject before output/cache allocation.