std1.0.0-beta-7 SafeC docs

std :: dsp::imaging

Function std::conv2d

#include <std/dsp/imaging.h> source · definition

int conv2d(
    []const double img,
    unsigned long h,
    unsigned long w,
    []const double kernel,
    unsigned long kh,
    unsigned long kw,
    []double out,
)

'img' is hw row-major; 'kernel' is khkw row-major (kh, kw should be odd so the kernel has a well-defined center tap); 'out' must have room for h*w doubles (same size as 'img' — out-of-bounds kernel taps read as zero, i.e. zero-padded boundary handling).