Skip to main content

soft_light_rgb_core

Function soft_light_rgb_core 

Source
pub fn soft_light_rgb_core(
    a: ArrayView3<'_, f32>,
    b: ArrayView3<'_, f32>,
    out: &mut Array3<f32>,
)
Expand description

Soft light blend of two 3-D (H, W, C) arrays, e.g. RGB or RGBA imagery, in a single pass. The entry point for multi-channel inputs.

Every channel is blended independently with the same formula as soft_light_core; any channel count C works.

§Arguments

  • a - ArrayView3<f32>, shape (H, W, C): the base layer, values nominally in [0, 1]. Any memory layout.
  • b - ArrayView3<f32>, shape (H, W, C): the blend layer, values nominally in [0, 1]. Any memory layout.
  • out - &mut Array3<f32>, shape (H, W, C): overwritten with the result, every element in [0, 1].

Runs serially below PARALLEL_THRESHOLD elements (H × W × C) and in parallel at or above it.

§Panics

If a, b and out do not all have the same shape.