Struct FixedConvolutionKernel

Compile-time fixed convolution kernel.

struct FixedConvolutionKernel(alias Shape, Coefficient, Coefficients...)
  
if (is(Coefficient == float) || is(Coefficient == double));

Shape provides fixed neighbourhood geometry.

Coefficient is float or double.

Coefficients are template values in row-major neighbourhood order and their count must equal Shape.sampleCount.

The type stores no runtime fields. Coefficients are manifest compile-time data, allowing fixed-kernel code generation and specialization.

No normalization, scale factor, colour/radiometric meaning or border policy is implied.

Example

Example defining a fixed identity-style 3 x 3 float kernel.

import raster;
alias Shape = NeighbourhoodShape!(3, 3, 1, 1);
alias Kernel = FixedConvolutionKernel!(
    Shape,
    float,
    0.0f, 0.0f, 0.0f,
    0.0f, 1.0f, 0.0f,
    0.0f, 0.0f, 0.0f
);
static assert(Kernel.shape.sampleCount == 9);
static assert(Kernel.coefficients[4] == 1.0f);