/*-------------------------------------------------------- * * In-place 2D Convolution, zero-padded border (C-RAM) * requires symmetric co-efficients * */ #include #include "convo3.h" #define imageType cuint8 typedef cuint8 imageType imageType image[PIXELSperPE + KERNEL]; int k0 = 7, k1 = 5, k2 = 2; /* convolution with 3x3 symetric kernel */ void convolve(const imageType * window[KERNEL][KERNEL], imageType & result) { result = *window[1][1] * k0 + (*window[0][1] + *window[1][0] + *window[2][1] + *window[1][2]) * k1 + (*window[0][0] + *window[2][0] + *window[2][2] + *window[0][2]) * k2; } #include "../grid3x3/grid3x3.h"