Main Page | Modules | Class List | File List | Class Members | File Members

Convolution Operations
[Vision Package]


Classes

struct  Gan_Mask1D
 1D convolution mask. More...
struct  Gan_Mask2D
 2D convolution mask. More...

Defines

#define SHIFT_DOWN_REPEAT(v, s)   (((v) < (s)) ? (v) : ((s)-1))
#define SHIFT_UP_REPEAT(v, s)   (((v) < 0) ? 0 : (v))
#define SHIFT_IN_REPEAT(v, s)   (((v) < 0) ? 0 : (((v) < (s)) ? (v) : ((s)-1)))
#define SHIFT_DOWN_CIRCULAR(v, s)   (((v) < (s)) ? (v) : ((v)-(s)))
#define SHIFT_UP_CIRCULAR(v, s)   (((v) < 0) ? ((v)+(s)) : (v))
#define SHIFT_IN_CIRCULAR(v, s)   (((v) < 0) ? ((v)+(s)) : (((v) < (s)) ? (v) : ((v)-(s))))

Enumerations

enum  Gan_Mask1DFormat { GAN_MASK1D_SYMMETRIC, GAN_MASK1D_ANTISYMMETRIC, GAN_MASK1D_GENERIC }
 Format of convolution mask. More...
enum  Gan_EdgeBehaviour { GAN_EDGE_BEHAVIOUR_CLIP, GAN_EDGE_BEHAVIOUR_REPEAT, GAN_EDGE_BEHAVIOUR_CIRCULAR, GAN_EDGE_BEHAVIOUR_EXPAND }
 Edge behaviour. More...
enum  Gan_Mask2DFormat { GAN_MASK2D_SYMMETRIC, GAN_MASK2D_ANTISYMMETRIC, GAN_MASK2D_GENERIC }
 Format of 2D convolution mask. More...

Functions

Gan_Bool gan_convolve1D_f (float *source, int sstride, Gan_EdgeBehaviour behaviour, Gan_Bool zero_outside, float *dest, int dstride, Gan_Mask1D *mask, int dsize)
 1D convolution function for float arrays.
Gan_Bool gan_convolve1D_d (double *source, int sstride, Gan_EdgeBehaviour behaviour, Gan_Bool zero_outside, double *dest, int dstride, Gan_Mask1D *mask, int dsize)
 1D convolution function for double arrays.
Gan_Bool gan_convolve1D_i (int *source, int sstride, Gan_EdgeBehaviour behaviour, Gan_Bool zero_outside, int *dest, int dstride, Gan_Mask1D *mask, int dsize)
 1D convolution function for int arrays.
Gan_Bool gan_convolve1D_uc (unsigned char *source, int sstride, Gan_EdgeBehaviour behaviour, Gan_Bool zero_outside, unsigned char *dest, int dstride, Gan_Mask1D *mask, int dsize)
 1D convolution function for integer arrays.
Gan_Bool gan_convolve1D_rgb_uc (unsigned char *source, int sstride, unsigned char *dest, int dstride, Gan_Mask1D *mask, unsigned int dsize)
 1D convolution function for integer RGB arrays.
Gan_Bool gan_convolve1D_rgb_f (float *source, int sstride, float *dest, int dstride, Gan_Mask1D *mask, unsigned int dsize)
 1D convolution function for integer RGB arrays.
Gan_Bool gan_convolve1D_us (unsigned short *source, int sstride, Gan_EdgeBehaviour behaviour, Gan_Bool zero_outside, unsigned short *dest, int dstride, Gan_Mask1D *mask, int dsize)
 1D convolution function for integer arrays.
Gan_Bool gan_convolve1D_ui (unsigned int *source, int sstride, Gan_EdgeBehaviour behaviour, Gan_Bool zero_outside, unsigned int *dest, int dstride, Gan_Mask1D *mask, int dsize)
 1D convolution function for unsigned integer arrays.
Gan_Imagegan_image_convolve1Dx_q (const Gan_Image *image, Gan_ImageChannelType channel, Gan_EdgeBehaviour eEdgeBehaviour, Gan_Mask1D *mask, Gan_Image *dest)
 Convolves an image in the x-direction.
Gan_Imagegan_image_convolve1Dy_q (const Gan_Image *image, Gan_ImageChannelType channel, Gan_EdgeBehaviour eEdgeBehaviour, Gan_Mask1D *mask, Gan_Image *dest)
 Convolves an image in the y-direction.
Gan_Imagegan_image_convolve1Dx_s (const Gan_Image *image, Gan_ImageChannelType channel, Gan_EdgeBehaviour eEdgeBehaviour, Gan_Mask1D *mask)
 Macro: Convolves an image in the x-direction.
Gan_Imagegan_image_convolve1Dy_s (const Gan_Image *image, Gan_ImageChannelType channel, Gan_EdgeBehaviour eEdgeBehaviour, Gan_Mask1D *mask)
 Macro: Convolves an image in the y-direction.
Gan_Bool gan_convolve2D_f (float *source, int sstride, float *dest, int dstride, Gan_Mask2D *mask, unsigned long width)
 2D convolution function for float arrays.
Gan_Bool gan_convolve2D_d (double *source, int sstride, double *dest, int dstride, Gan_Mask2D *mask, unsigned long width)
 2D convolution function for double arrays.
Gan_Bool gan_convolve2D_i (int *source, int sstride, int *dest, int dstride, Gan_Mask2D *mask, unsigned long width)
 2D convolution function for integer arrays.
Gan_Bool gan_convolve2D_uc (unsigned char *source, int sstride, unsigned char *dest, int dstride, Gan_Mask2D *mask, unsigned long width)
 2D convolution function for unsigned character arrays.
Gan_Bool gan_convolve2D_us (unsigned short *source, int sstride, unsigned short *dest, int dstride, Gan_Mask2D *mask, unsigned long width)
 2D convolution function for unsigned short arrays.
Gan_Bool gan_convolve2D_ui (unsigned int *source, int sstride, unsigned int *dest, int dstride, Gan_Mask2D *mask, unsigned long width)
 2D convolution function for unsigned integer arrays.
Gan_Imagegan_image_convolve2D_q (Gan_Image *image, Gan_ImageChannelType channel, Gan_Mask2D *mask, Gan_Image *dest)
 Convolves an image in both directions.
Gan_Imagegan_image_convolve2D_s (Gan_Image *image, Gan_ImageChannelType channel, Gan_Mask2D *mask)
 Macro: Convolves an image in both directions.
Gan_Mask1Dgan_mask1D_form_gen (Gan_Mask1D *mask, Gan_Mask1DFormat format, Gan_Type type, void *data, unsigned int size)
 Form a new 1D convolution mask.
Gan_Bool gan_mask1D_copy_q (Gan_Mask1D *source, Gan_Mask1D *dest)
 Copies a convolution mask.
Gan_Bool gan_mask1D_free (Gan_Mask1D *mask)
 Frees a convolution mask.
Gan_Mask1Dgan_gauss_mask_new (Gan_Type type, double sigma, unsigned mask_size, double scale, void *mask_data)
 Make new Gaussian convolution mask.
Gan_Mask1Dgan_mask1D_alloc (Gan_Mask1DFormat format, Gan_Type type, unsigned int size)
 Macro: Allocate and return a new 1D convolution mask.
Gan_Mask1Dgan_mask1D_alloc_data (Gan_Mask1DFormat format, Gan_Type type, void *data, unsigned int size)
 Macro: Allocate and return a new 1D convolution mask.
Gan_Mask1Dgan_mask1D_form (Gan_Mask1D *mask, Gan_Mask1DFormat format, Gan_Type type, unsigned int size)
 Macro: Build a new 1D convolution mask.
Gan_Mask1Dgan_mask1D_form_data (Gan_Mask1D *mask, Gan_Mask1DFormat format, Gan_Type type, void *data, unsigned int size)
 Macro: Build a new 1D convolution mask.
Gan_Mask2Dgan_mask2D_form_gen (Gan_Mask2D *mask, Gan_Mask2DFormat format, Gan_Matrix *data, unsigned int rows, unsigned int cols)
 Form a new 2D convolution mask.
Gan_Bool gan_mask2D_copy_q (Gan_Mask2D *source, Gan_Mask2D *dest)
 Copies a convolution mask.
Gan_Bool gan_mask2D_free (Gan_Mask2D *mask)
 Frees a convolution mask.
Gan_Mask2Dgan_mask2D_gen_from_Gan_Image (Gan_Image *img)
 Generates a 2D convolution mask from a grey-level image.
Gan_Mask2Dgan_mask2D_alloc (Gan_Mask2DFormat format, unsigned int rows, unsigned int cols)
 Macro: Allocate and return a new 2D convolution mask.
Gan_Mask2Dgan_mask2D_alloc_data (Gan_Mask2DFormat format, Gan_Matrix *data, unsigned int rows, unsigned int cols)
 Macro: Allocate and return a new 2D convolution mask.
Gan_Mask2Dgan_mask2D_form (Gan_Mask2D *mask, Gan_Mask2DFormat format, unsigned int rows, unsigned int cols)
 Macro: Build a new 2D convolution mask.
Gan_Mask2Dgan_mask2D_form_data (Gan_Mask2D *mask, Gan_Mask2DFormat format, Gan_Matrix *data, unsigned int rows, unsigned int cols)
 Macro: Build a new 2D convolution mask.

Enumeration Type Documentation

enum Gan_EdgeBehaviour
 

Edge behaviour.

Enumeration values:
GAN_EDGE_BEHAVIOUR_CLIP  Don't access data outside edge
GAN_EDGE_BEHAVIOUR_REPEAT  Repeat data outside edge
GAN_EDGE_BEHAVIOUR_CIRCULAR  Treat data as circular
GAN_EDGE_BEHAVIOUR_EXPAND  Expand data by mask size

enum Gan_Mask1DFormat
 

Format of convolution mask.

Enumeration values:
GAN_MASK1D_SYMMETRIC  Symmetric 1D convolution mask
GAN_MASK1D_ANTISYMMETRIC  Antisymmetric 1D convolution mask
GAN_MASK1D_GENERIC  General 1D convolution mask

enum Gan_Mask2DFormat
 

Format of 2D convolution mask.

Format of 2D convolution mask, whose height h and width w have to be odd.

For GAN_MASK2D_SYMMETRIC, only $ ((h-1)/2+1)((w-1)/2+1) $ elements, belonging to the upper left quadrant, need to be specified by the user. The other quadrants are symmetric.

For GAN_MASK2D_ANTISYMMETRIC, only $ (h-1)(w-1)/4 $ elements, belonging to the upper left quadrant and excluding those located in the central axis of the mask, have to be defined. The upper right and the lower left quadrants are antisymmetric (multiplied by -1) and the lower right quadrant is symmetric. The pixels located in the central axis are equal to zero.

Enumeration values:
GAN_MASK2D_SYMMETRIC  Symmetric 2D convolution mask
GAN_MASK2D_ANTISYMMETRIC  Antisymmetric 2D convolution mask
GAN_MASK2D_GENERIC  General 2D convolution mask


Function Documentation

Gan_Bool gan_convolve1D_d double *  source,
int  sstride,
Gan_EdgeBehaviour  eEdgeBehaviour,
Gan_Bool  zero_outside,
double *  dest,
int  dstride,
Gan_Mask1D mask,
int  dsize
 

1D convolution function for double arrays.

Parameters:
source The input array to be convolved
sstride The stride of the source array in units of doubles
behaviour Behaviour of data beyond edge
zero_outside Whether to assume zeros outside the source data
dest The destination array for the convolution
dstride The stride of the dest array in units of doubles
mask The convolution mask
dsize The number of output elements to compute
Applies a one-dimensional convolution operation to the given source array. Both arrays must be of type double.
Returns:
GAN_TRUE on success, GAN_FALSE on failure.
See also:
gan_convolve1D_i().

Gan_Bool gan_convolve1D_f float *  source,
int  sstride,
Gan_EdgeBehaviour  eEdgeBehaviour,
Gan_Bool  zero_outside,
float *  dest,
int  dstride,
Gan_Mask1D mask,
int  dsize
 

1D convolution function for float arrays.

Parameters:
source The input array to be convolved
sstride The stride of the source array in units of floats
behaviour Behaviour of data beyond edge
zero_outside Whether to assume zeros outside the source data
dest The destination array for the convolution
dstride The stride of the dest array in units of floats
mask The convolution mask
dsize The number of output elements to compute
Applies a one-dimensional convolution operation to the given source array. Both arrays must be of type float.
Returns:
GAN_TRUE on success, GAN_FALSE on failure.
See also:
gan_convolve1D_i().

Gan_Bool gan_convolve1D_i int *  source,
int  sstride,
Gan_EdgeBehaviour  eEdgeBehaviour,
Gan_Bool  zero_outside,
int *  dest,
int  dstride,
Gan_Mask1D mask,
int  dsize
 

1D convolution function for int arrays.

Parameters:
source The input array to be convolved
sstride The stride of the source array in units of ints
behaviour Behaviour of data beyond edge
zero_outside Whether to assume zeros outside the source data
dest The destination array for the convolution
dstride The stride of the dest array in units of ints
mask The convolution mask
dsize The number of output elements to compute
Applies a one-dimensional convolution operation to the given source array. Both arrays must be of type int.
Returns:
GAN_TRUE on success, GAN_FALSE on failure.
See also:
gan_convolve1D_i().

Gan_Bool gan_convolve1D_rgb_f float *  source,
int  sstride,
float *  dest,
int  dstride,
Gan_Mask1D mask,
unsigned int  dsize
 

1D convolution function for integer RGB arrays.

Parameters:
source The input array to be convolved
sstride The stride of the source array
dest The destination array for the convolution
dstride The stride of the dest array
mask The convolution mask
dsize The number of output elements to compute
Applies a one-dimensional convolution operation to the given source array. Both arrays must be of type unsigned char. There is no checking for overflow.

Returns:
GAN_TRUE on success, GAN_FALSE on failure.
See also:
gan_convolve1D_rgb_uc().

Gan_Bool gan_convolve1D_rgb_uc unsigned char *  source,
int  sstride,
unsigned char *  dest,
int  dstride,
Gan_Mask1D mask,
unsigned int  dsize
 

1D convolution function for integer RGB arrays.

Parameters:
source The input array to be convolved
sstride The stride of the source array
dest The destination array for the convolution
dstride The stride of the dest array
mask The convolution mask
dsize The number of output elements to compute
Applies a one-dimensional convolution operation to the given source array. Both arrays must be of type unsigned char. There is no checking for overflow.

Returns:
GAN_TRUE on success, GAN_FALSE on failure.
See also:
gan_convolve1D_rgb_uc().

Gan_Bool gan_convolve1D_uc unsigned char *  source,
int  sstride,
Gan_EdgeBehaviour  behaviour,
Gan_Bool  zero_outside,
unsigned char *  dest,
int  dstride,
Gan_Mask1D mask,
int  dsize
 

1D convolution function for integer arrays.

Parameters:
source The input array to be convolved
sstride The stride of the source array
behaviour Behaviour of data beyond edge
zero_outside Whether to assume zeros outside the source data
dest The destination array for the convolution
dstride The stride of the dest array
mask The convolution mask
dsize The number of output elements to compute
Applies a one-dimensional convolution operation to the given source array. Both arrays must be of type unsigned char. There is no checking for overflow.

Returns:
GAN_TRUE on success, GAN_FALSE on failure.
See also:
gan_convolve1D_u().

Gan_Bool gan_convolve1D_ui unsigned int *  source,
int  sstride,
Gan_EdgeBehaviour  behaviour,
Gan_Bool  zero_outside,
unsigned int *  dest,
int  dstride,
Gan_Mask1D mask,
int  dsize
 

1D convolution function for unsigned integer arrays.

Parameters:
source The input array to be convolved
sstride The stride of the source array
behaviour Behaviour of data beyond edge
zero_outside Whether to assume zeros outside the source data
dest The destination array for the convolution
dstride The stride of the dest array
mask The convolution mask
dsize The number of output elements to compute
Applies a one-dimensional convolution operation to the given source array. Both arrays must be of type unsigned int. There is no checking for overflow.

Returns:
GAN_TRUE on success, GAN_FALSE on failure.
See also:
gan_convolve1D_uc().

Gan_Bool gan_convolve1D_us unsigned short *  source,
int  sstride,
Gan_EdgeBehaviour  behaviour,
Gan_Bool  zero_outside,
unsigned short *  dest,
int  dstride,
Gan_Mask1D mask,
int  dsize
 

1D convolution function for integer arrays.

Parameters:
source The input array to be convolved
sstride The stride of the source array
behaviour Behaviour of data beyond edge
zero_outside Whether to assume zeros outside the source data
dest The destination array for the convolution
dstride The stride of the dest array
mask The convolution mask
dsize The number of output elements to compute
Applies a one-dimensional convolution operation to the given source array. Both arrays must be of type unsigned short. There is no checking for overflow.

Returns:
GAN_TRUE on success, GAN_FALSE on failure.
See also:
gan_convolve1D_uc().

Gan_Bool gan_convolve2D_d double *  source,
int  sstride,
double *  dest,
int  dstride,
Gan_Mask2D mask,
unsigned long  width
 

2D convolution function for double arrays.

Parameters:
source The input array to be convolved.
sstride The stride of the source array.
dest The destination array for the convolution.
dstride The stride of the dest array.
mask The convolution mask.
width The width of the source image.
Applies a two-dimensional convolution operation to the given source array. Both arrays must be of type double.

Returns:
GAN_TRUE on success, GAN_FALSE on failure.
See also:
gan_convolve2D_i().

Gan_Bool gan_convolve2D_f float *  source,
int  sstride,
float *  dest,
int  dstride,
Gan_Mask2D mask,
unsigned long  width
 

2D convolution function for float arrays.

Parameters:
source The input array to be convolved.
sstride The stride of the source array.
dest The destination array for the convolution.
dstride The stride of the dest array.
mask The convolution mask.
width The width of the source image.
Applies a two-dimensional convolution operation to the given source array. Both arrays must be of type float.
Returns:
GAN_TRUE on success, GAN_FALSE on failure.
See also:
gan_convolve2D_i().

Gan_Bool gan_convolve2D_i int *  source,
int  sstride,
int *  dest,
int  dstride,
Gan_Mask2D mask,
unsigned long  width
 

2D convolution function for integer arrays.

Parameters:
source The input array to be convolved.
sstride The stride of the source array.
dest The destination array for the convolution.
dstride The stride of the dest array.
mask The convolution mask.
width The width of the source image.
Applies a two-dimensional convolution operation to the given source array. Both arrays must be of type int. There is no checking for overflow.

Returns:
GAN_TRUE on success, GAN_FALSE on failure.
See also:
gan_convolve2D_uc().

Gan_Bool gan_convolve2D_uc unsigned char *  source,
int  sstride,
unsigned char *  dest,
int  dstride,
Gan_Mask2D mask,
unsigned long  width
 

2D convolution function for unsigned character arrays.

Parameters:
source The input array to be convolved.
sstride The stride of the source array.
dest The destination array for the convolution.
dstride The stride of the dest array.
mask The convolution mask.
width The width of the source image.
Applies a two-dimensional convolution operation to the given source array. Both arrays must be of type unsigned char. Overflow is considered.

Returns:
GAN_TRUE on success, GAN_FALSE on failure.

Gan_Bool gan_convolve2D_ui unsigned int *  source,
int  sstride,
unsigned int *  dest,
int  dstride,
Gan_Mask2D mask,
unsigned long  width
 

2D convolution function for unsigned integer arrays.

Parameters:
source The input array to be convolved.
sstride The stride of the source array.
dest The destination array for the convolution.
dstride The stride of the dest array.
mask The convolution mask.
width The width of the source image.
Applies a two-dimensional convolution operation to the given source array. Both arrays must be of type unsigned int. There is no checking for overflow.

Returns:
GAN_TRUE on success, GAN_FALSE on failure.

Gan_Bool gan_convolve2D_us unsigned short *  source,
int  sstride,
unsigned short *  dest,
int  dstride,
Gan_Mask2D mask,
unsigned long  width
 

2D convolution function for unsigned short arrays.

Parameters:
source The input array to be convolved.
sstride The stride of the source array.
dest The destination array for the convolution.
dstride The stride of the dest array.
mask The convolution mask.
width The width of the source image.
Applies a two-dimensional convolution operation to the given source array. Both arrays must be of type unsigned short. There is no checking for overflow.

Returns:
GAN_TRUE on success, GAN_FALSE on failure.
See also:
gan_convolve2D_us().

Gan_Mask1D * gan_gauss_mask_new Gan_Type  type,
double  sigma,
unsigned  mask_size,
double  scale,
void *  mask_data
 

Make new Gaussian convolution mask.

Parameters:
type Type of mask element, e.g. GAN_DOUBLE
sigma Standard deviation of convolution
mask_size Mask dimension, must be odd
scale Scale factor for mask entries
mask_data Pointer to mask data or NULL
Allocates, fills and returns a pointer to a new Gaussian convolution mask structure with given size and standard deviation.

Returns:
Non-NULL Pointer to the created convolution mask structure, or NULL on failure.
See also:
gan_mask1D_free().

Gan_Image * gan_image_convolve1Dx_q const Gan_Image image,
Gan_ImageChannelType  channel,
Gan_EdgeBehaviour  eEdgeBehaviour,
Gan_Mask1D mask,
Gan_Image dest
 

Convolves an image in the x-direction.

Parameters:
image The input image
channel Colour channel to be convolved where applicable
eEdgeBehaviour Behaviour of data beyond edge
mask The image convolution mask
dest The destination image for the convolution operation
Applies a one-dimensional convolution operation to the given image in the x-direction. When the image contains colour or vector field data, a particular colour channel/vector field element can be specified by the channel argument, which should otherwise be passed as GAN_ALL_CHANNELS. There is no checking for overflow of integer values.

Macro call to gan_image_convolve1Dx_q().

Returns:
Non-NULL on successfully returning the destination image dest, NULL on failure.
See also:
gan_image_convolve1Dx_q, gan_gauss_mask_new().

Gan_Image* gan_image_convolve1Dx_s const Gan_Image image,
Gan_ImageChannelType  channel,
Gan_EdgeBehaviour  eEdgeBehaviour,
Gan_Mask1D mask
 

Macro: Convolves an image in the x-direction.

Parameters:
image The input image
channel Colour channel to be convolved where applicable
eEdgeBehaviour Behaviour of data beyond edge
mask The image convolution mask
Returns:
GAN_TRUE on success, GAN_FALSE on failure.
Applies a one-dimensional convolution operation to the given image in the x-direction. When the image contains colour or vector field data, a particular colour channel/vector field element can be specified by the channel argument, which should otherwise be passed as GAN_ALL_CHANNELS.

Macro call to gan_image_convolve1Dx_q().

See also:
gan_image_convolve1Dx_q, gan_gauss_mask_new().

Gan_Image * gan_image_convolve1Dy_q const Gan_Image image,
Gan_ImageChannelType  channel,
Gan_EdgeBehaviour  eEdgeBehaviour,
Gan_Mask1D mask,
Gan_Image dest
 

Convolves an image in the y-direction.

Parameters:
image The input image
channel Colour channel to be convolved where applicable
eEdgeBehaviour Behaviour of data beyond edge
mask The image convolution mask
dest The destination image for the convolution operation
Applies a one-dimensional convolution operation to the given image in the y-direction. When the image contains colour or vector field data, a particular colour channel/vector field element can be specified by the channel argument, which should otherwise be passed as GAN_ALL_CHANNELS. There is no checking for overflow of integer values.

Macro call to gan_image_convolve1Dy_q().

Returns:
Non-NULL on successfully returning the destination image dest, NULL on failure.
See also:
gan_image_convolve1Dy_q, gan_gauss_mask_new().

Gan_Image* gan_image_convolve1Dy_s const Gan_Image image,
Gan_ImageChannelType  channel,
Gan_EdgeBehaviour  eEdgeBehaviour,
Gan_Mask1D mask
 

Macro: Convolves an image in the y-direction.

Parameters:
image The input image
channel Colour channel to be convolved where applicable
eEdgeBehaviour Behaviour of data beyond edge
mask The image convolution mask
Returns:
GAN_TRUE on success, GAN_FALSE on failure.
Applies a one-dimensional convolution operation to the given image in the y-direction. When the image contains colour or vector field data, a particular colour channel/vector field element can be specified by the channel argument, which should otherwise be passed as GAN_ALL_CHANNELS.

Macro call to gan_image_convolve1Dy_q().

See also:
gan_image_convolve1Dy_q, gan_gauss_mask_new().

Gan_Image * gan_image_convolve2D_q Gan_Image image,
Gan_ImageChannelType  channel,
Gan_Mask2D mask,
Gan_Image dest
 

Convolves an image in both directions.

Parameters:
image The input image
channel Colour channel to be convolved where applicable
mask The image convolution mask
dest The destination image for the convolution operation
Applies a two-dimensional convolution operation to the given image. When the image contains colour or vector field data, a particular colour channel/vector field element can be specified by the channel argument, which should otherwise be passed as GAN_ALL_CHANNELS. There is no checking for overflow of integer values.

Returns:
Non-NULL on successfully returning the destination image dest, NULL on failure.
See also:
gan_image_convolve2Dy_q, gan_gauss_mask_new().

Gan_Image* gan_image_convolve2D_s Gan_Image image,
Gan_ImageChannelType  channel,
Gan_Mask2D mask
 

Macro: Convolves an image in both directions.

Parameters:
image The input image
channel Colour channel to be convolved where applicable
mask The image convolution mask
Returns:
GAN_TRUE on success, GAN_FALSE on failure.
Applies a two-dimensional convolution operation to the given image. When the image contains colour or vector field data, a particular colour channel/vector field element can be specified by the channel argument, which should otherwise be passed as GAN_ALL_CHANNELS.

Macro call to gan_image_convolve2D_q().

See also:
gan_image_convolve2Dx_q, gan_gauss_mask_new().

Gan_Mask1D* gan_mask1D_alloc Gan_Mask1DFormat  format,
Gan_Type  type,
unsigned int  size
 

Macro: Allocate and return a new 1D convolution mask.

Allocates and returns a new 1D convolution mask with the given format, type and size.

Implemented as a macro call to gan_mask1D_form_gen().

See also:
gan_mask1D_form() and gan_mask1D_alloc_data().

Gan_Mask1D* gan_mask1D_alloc_data Gan_Mask1DFormat  format,
Gan_Type  type,
void *  data,
unsigned int  size
 

Macro: Allocate and return a new 1D convolution mask.

Allocates and returns a new 1D convolution mask with the given format, type, data array and size.

Implemented as a macro call to gan_mask1D_form_gen().

See also:
gan_mask1D_form() and gan_mask1D_alloc().

Gan_Bool gan_mask1D_copy_q Gan_Mask1D source,
Gan_Mask1D dest
 

Copies a convolution mask.

Parameters:
source The input convolution mask
dest The output convolution mask
Copy 1D convolution mask from source mask to dest mask
Returns:
GAN_TRUE on success, GAN_FALSE on failure.

Gan_Mask1D* gan_mask1D_form Gan_Mask1D mask,
Gan_Mask1DFormat  format,
Gan_Type  type,
unsigned int  size
 

Macro: Build a new 1D convolution mask.

Builds and returns a new 1D convolution mask with the given format, type and size, writing it into the provided structure mask.

Implemented as a macro call to gan_mask1D_form_gen().

See also:
gan_mask1D_alloc() and gan_mask1D_alloc_data().

Gan_Mask1D* gan_mask1D_form_data Gan_Mask1D mask,
Gan_Mask1DFormat  format,
Gan_Type  type,
void *  data,
unsigned int  size
 

Macro: Build a new 1D convolution mask.

Builds and returns a new 1D convolution mask with the given format, type, data and size, writing it into the provided structure mask.

Implemented as a macro call to gan_mask1D_form_gen().

See also:
gan_mask1D_alloc() and gan_mask1D_alloc_data().

Gan_Mask1D * gan_mask1D_form_gen Gan_Mask1D mask,
Gan_Mask1DFormat  format,
Gan_Type  type,
void *  data,
unsigned int  size
 

Form a new 1D convolution mask.

Don't call this function directly. Use the macro gan_mask1D_form_data() instead.

Gan_Bool gan_mask1D_free Gan_Mask1D mask  ) 
 

Frees a convolution mask.

Parameters:
mask The convolution mask to be freed
Free memory associated with 1D convolution mask.
Returns:
GAN_TRUE on success, GAN_FALSE on failure.

Gan_Mask2D* gan_mask2D_alloc Gan_Mask2DFormat  format,
unsigned int  rows,
unsigned int  cols
 

Macro: Allocate and return a new 2D convolution mask.

Allocates and returns a new 2D convolution mask with the given format and size.

Implemented as a macro call to gan_mask2D_form_gen().

See also:
gan_mask2D_form() and gan_mask2D_alloc_data().

Gan_Mask2D* gan_mask2D_alloc_data Gan_Mask2DFormat  format,
Gan_Matrix data,
unsigned int  rows,
unsigned int  cols
 

Macro: Allocate and return a new 2D convolution mask.

Allocates and returns a new 2D convolution mask with the given format, type, data array and size.

Implemented as a macro call to gan_mask2D_form_gen().

See also:
gan_mask2D_form() and gan_mask2D_alloc().

Gan_Bool gan_mask2D_copy_q Gan_Mask2D source,
Gan_Mask2D dest
 

Copies a convolution mask.

Parameters:
source The input convolution mask
dest The output convolution mask
Copy 2D convolution mask from source mask to dest mask
Returns:
GAN_TRUE on success, GAN_FALSE on failure.

Gan_Mask2D* gan_mask2D_form Gan_Mask2D mask,
Gan_Mask2DFormat  format,
unsigned int  rows,
unsigned int  cols
 

Macro: Build a new 2D convolution mask.

Builds and returns a new 2D convolution mask with the given format, type and size, writing it into the provided structure mask.

Implemented as a macro call to gan_mask2D_form_gen().

See also:
gan_mask2D_alloc() and gan_mask2D_alloc_data().

Gan_Mask2D* gan_mask2D_form_data Gan_Mask2D mask,
Gan_Mask2DFormat  format,
Gan_Matrix data,
unsigned int  rows,
unsigned int  cols
 

Macro: Build a new 2D convolution mask.

Builds and returns a new 2D convolution mask with the given format, type, data and size, writing it into the provided structure mask.

Implemented as a macro call to gan_mask2D_form_gen().

See also:
gan_mask1D_alloc() and gan_mask2D_alloc_data().

Gan_Mask2D * gan_mask2D_form_gen Gan_Mask2D mask,
Gan_Mask2DFormat  format,
Gan_Matrix data,
unsigned int  rows,
unsigned int  cols
 

Form a new 2D convolution mask.

Parameters:
mask The 2D convolution mask.
format The format of the convolution mask.
data A 2D matrix that defines the values of the mask.
rows The number of rows of the mask (height).
cols The number of columns of the mask (width).
Don't call this function directly. Use the macro gan_mask1D_form_data() instead.

Gan_Bool gan_mask2D_free Gan_Mask2D mask  ) 
 

Frees a convolution mask.

Parameters:
mask The convolution mask to be freed
Free memory associated with 2D convolution mask.
Returns:
GAN_TRUE on success, GAN_FALSE on failure.

Gan_Mask2D * gan_mask2D_gen_from_Gan_Image Gan_Image img  ) 
 

Generates a 2D convolution mask from a grey-level image.

Parameters:
img The image.
Generates a 2D convolution mask from a grey-level image.
Returns:
A 2D convolution mask identical to the image.


Generated on Fri Mar 17 12:45:02 2006 by  doxygen 1.3.9.1