30 |
*. |
*. |
31 |
* |
* |
32 |
* General colvolution routines for RGB and gray (both 8bit and 16bit) |
* General colvolution routines for RGB and gray (both 8bit and 16bit) |
33 |
* images. 3x3 and 5x5 kernels are manually unrolled. |
* images. 3x3 and 5x5 kernels are manually unrolled. |
34 |
* |
* |
35 |
*/ |
*/ |
36 |
|
|
298 |
* almost the same as convolve except the kernel is a proper C array |
* almost the same as convolve except the kernel is a proper C array |
299 |
* kernel[krow][kcol] |
* kernel[krow][kcol] |
300 |
*/ |
*/ |
301 |
|
|
302 |
int |
int |
303 |
flimage_convolvea(FL_IMAGE * im, int *kernel, int krow, int kcol) |
flimage_convolvea(FL_IMAGE * im, int *kernel, int krow, int kcol) |
304 |
{ |
{ |
305 |
int **kk,status; |
int **kk,status; |
306 |
|
|
307 |
if (!(krow & 1) || !(kcol & 1)) |
if (!(krow & 1) || !(kcol & 1)) |
308 |
M_err("Convolve", "even or zero kernel size (row=%d col=%d)!", |
M_err("Convolve", "even or zero kernel size (row=%d col=%d)!", |
309 |
krow, kcol); |
krow, kcol); |
310 |
kk = fl_make_matrix(krow,kcol,sizeof(int), kernel); |
kk = fl_make_matrix(krow,kcol,sizeof(int), kernel); |
311 |
status = flimage_convolve(im, kk, krow,kcol); |
status = flimage_convolve(im, kk, krow,kcol); |