Expand description
GPU blend kernels (CPU simulation via Rayon).
Provides parallel image compositing and blending operations that simulate GPU compute-shader dispatch semantics.
§Supported blend modes
| Mode | Description |
|---|---|
BlendMode::AlphaComposite | Porter-Duff “over” compositing |
BlendMode::Additive | src + dst, clamped to 255 |
BlendMode::Multiply | src * dst / 255 |
BlendMode::Screen | 1 - (1-src)*(1-dst) |
BlendMode::Overlay | Photoshop-style overlay |
BlendMode::SoftLight | Pegtop soft light formula |
BlendMode::Difference | abs(src - dst) |
BlendMode::Dissolve | Random per-pixel src/dst selection by opacity |
§Example
use oximedia_gpu::blend_kernel::{BlendKernel, BlendMode};
let src = vec![200u8, 100, 50, 255]; // opaque orange
let mut dst = vec![0u8, 128, 255, 255]; // opaque blue
BlendKernel::blend(&src, &mut dst, 1, 1, BlendMode::AlphaComposite, 255)
.expect("blend failed");Structs§
- Blend
Kernel - GPU-style image blending kernel (CPU simulation via Rayon).
- Blend
Stats - Statistics from a blend operation.
Enums§
- Blend
Error - Errors returned by blend kernel operations.
- Blend
Mode - Compositing / blend mode.