Dali: Kernel -- C API

[ Header Files | Types | Allocation | Initialization | Operations | Queries | See Also ]

Header Files

#include <dvmkernel.h>

Type Definitions

Kernel

A Kernel is used for convolution of images. The structure contains a matrix and an offset. See the overview for an example of using it. The convolution matrix is stored as a two dimensioanl array of integers. The image is convolved with these values, and the result is scaled by another integer (divfactor). Finally, another integer (offset) is added to the result. This representation allows Dali to perform convolutions using only integer arithmetic.

    typedef struct Kernel {
        int width;
        int height;
        int **vals;
        int divfactor;
        int offset;
    } Kernel
  
width
width of the convolution kernel matrix.
height
height of the convolution kernel matrix.
vals
The matrix, in row-major order.
divfactor
Division factor of the vals. The actual values are vals[][]/divfactor
offset
Offset applied by the convolution kernel.

Operators

Allocation

Kernel* KernelNew(int width, int height)

void KernelFree(Kernel *kern)


Initialization

KernelSetValues(Kernel *k, int *values)

KernelSetDivFactor(Kernel *k, int divfactor)

KernelSetOffset(Kernel *k, int offset)


Operations

void KernelApply(Kernel *kern, ByteImage *src, ByteImage *dest)

void KernelCompose(Kernel *src1, Kernel *src2, Kernel *dest)


Queries

int KernelGetWidth(Kernel *kern)
int KernelGetHeight(Kernel *kern)
int KernelGetDivFactor(Kernel *kern)
int KernelGetOffset(Kernel *kern)


See Also

ByteImage


Last updated : Saturday, November 14, 1998, 07:50 PM