JWS C Library
C language utility library
matblock_conv.h File Reference

Declarations for matrix block convolution operations. More...

#include <jwsc/config.h>
#include <stdlib.h>
#include "jwsc/base/error.h"
#include "jwsc/matblock/matblock.h"
Include dependency graph for matblock_conv.h:

Go to the source code of this file.

Functions

convolve_matblock

Convolves a matrix block with a filter.

Errorconvolve_matblock_f (Matblock_f **m_out, const Matblock_f *m_in, const Matblock_f *h)
 Convolves a single precision matrix block with a filter.
Errorconvolve_matblock_d (Matblock_d **m_out, const Matblock_d *m_in, const Matblock_d *h)
 Convolves a double precision matrix block with a filter.

Detailed Description

Declarations for matrix block convolution operations.

Author:
Joseph Schlecht
License:
Creative Commons BY-NC-SA 3.0

Definition in file matblock_conv.h.


Function Documentation

Error* convolve_matblock_f ( Matblock_f **  m_out,
const Matblock_f m_in,
const Matblock_f h 
)

Convolves a single precision matrix block with a filter.

Uses reflection to handle boundary cases. The convolution filter must be no larger than the size of m_in.

If the dimension(s) of h are even, the center of the filter is the in upper-left of the central quadrant/pair. For example,

 1 0
 0 0

Does not use FFT.

Parameters:
m_outResult parameter. If *m_out is NULL, a matrix block is allocated; otherwise its space is re-used.
m_inMatrix block to convolve.
hFilter to use in convolution.
Returns:
On success, NULL is returned. On error, an Error is returned and *m_out is freed and set to NULL (if it is not m_in).
  • ERROR_INV_ARG h is not a usable filter in convolution, i.e., it is too large.
Note:
If *m_out == m_in, then m_in is overwritten.

Definition at line 98 of file matblock_conv.c.

Error* convolve_matblock_d ( Matblock_d **  m_out,
const Matblock_d m_in,
const Matblock_d h 
)

Convolves a double precision matrix block with a filter.

Uses reflection to handle boundary cases. The convolution filter must be no larger than the size of m_in.

If the dimension(s) of h are even, the center of the filter is the in upper-left of the central quadrant/pair. For example,

 1 0
 0 0

Does not use FFT.

Parameters:
m_outResult parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used.
m_inMatrix to convolve.
hFilter to use in convolution.
Returns:
On success, NULL is returned. On error, an Error is returned and *m_out is freed and set to NULL (if it is not m_in).
  • ERROR_INV_ARG h is not a usable filter in convolution, i.e., it is too large.
Note:
If *m_out == m_in, then m_in is overwritten.

Definition at line 235 of file matblock_conv.c.