1mlib_ImageConvMxN(3MLIB)  mediaLib Library Functions  mlib_ImageConvMxN(3MLIB)
2
3
4

NAME

6       mlib_ImageConvMxN - MxN convolution
7

SYNOPSIS

9       cc [ flag... ] file... -lmlib [ library... ]
10       #include <mlib.h>
11
12       mlib_status mlib_ImageConvMxN(mlib_image *dst, const mlib_image *src,
13            const mlib_s32 *kernel, mlib_s32 m, mlib_s32 n, mlib_s32 dm,
14            mlib_s32 dn, mlib_s32 scale, mlib_s32 cmask, mlib_edge edge);
15
16

DESCRIPTION

18       The  mlib_ImageConvMxN()  function  performs  a  MxN convolution on the
19       source image by using the user-supplied kernel.
20
21
22       The input image and the output image must have the same image type  and
23       have the same number of channels. The unselected channels in the output
24       image are not overwritten. For single-channel images, the channel  mask
25       is ignored.
26
27
28       For  this  convolution,  the  key  element of the convolution kernel is
29       located at (dm, dn) of the kernel matrix.
30
31
32       It uses the following equation:
33
34                        m-1-dm n-1-dn
35         dst[x][y][i] =  SUM    SUM  src[x+p][y+q][i]*k[p][q]*2**(-scale)
36                        p=-dm  q=-dn
37
38
39
40       where m ≥ 1, n ≥ 1, 0 ≤ dm < m, 0 ≤ dn < n.
41

PARAMETERS

43       The function takes the following arguments:
44
45       dst       Pointer to destination image.
46
47
48       src       Pointer to source image.
49
50
51       kernel    Pointer to the convolution kernel, in row major order.
52
53
54       m         Width of the convolution kernel. m ≥ 1.
55
56
57       n         Height of the convolution kernel. n ≥ 1.
58
59
60       dm        X coordinate of the key element in the convolution kernel.  0
61                 ≤ dm < m.
62
63
64       dn        Y  coordinate of the key element in the convolution kernel. 0
65                 ≤ dn < n.
66
67
68       scale     Scaling factor.
69
70
71       cmask     Channel mask to indicate the channels to be  convolved,  each
72                 bit  of which represents a channel in the image. The channels
73                 corresponding to bits with a value of 1 are those to be  pro‐
74                 cessed.  For  a  single-channel  image,  the  channel mask is
75                 ignored.
76
77
78       edge      Type of edge condition. It can be one of the following:
79
80                   MLIB_EDGE_DST_NO_WRITE
81                   MLIB_EDGE_DST_FILL_ZERO
82                   MLIB_EDGE_DST_COPY_SRC
83                   MLIB_EDGE_SRC_EXTEND
84
85
86

RETURN VALUES

88       The function returns MLIB_SUCCESS if successful. Otherwise  it  returns
89       MLIB_FAILURE.
90

ATTRIBUTES

92       See attributes(5) for descriptions of the following attributes:
93
94
95
96
97       ┌─────────────────────────────┬─────────────────────────────┐
98       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
99       ├─────────────────────────────┼─────────────────────────────┤
100       │Interface Stability          │Committed                    │
101       ├─────────────────────────────┼─────────────────────────────┤
102       │MT-Level                     │MT-Safe                      │
103       └─────────────────────────────┴─────────────────────────────┘
104

SEE ALSO

106       mlib_ImageConv2x2(3MLIB),    mlib_ImageConv2x2_Fp(3MLIB),   mlib_Image‐
107       Conv2x2Index(3MLIB),       mlib_ImageConv3x3(3MLIB),        mlib_Image‐
108       Conv3x3_Fp(3MLIB),      mlib_ImageConv3x3Index(3MLIB),      mlib_Image‐
109       Conv4x4(3MLIB),        mlib_ImageConv4x4_Fp(3MLIB),         mlib_Image‐
110       Conv4x4Index(3MLIB),        mlib_ImageConv5x5(3MLIB),       mlib_Image‐
111       Conv5x5_Fp(3MLIB),      mlib_ImageConv5x5Index(3MLIB),      mlib_Image‐
112       Conv7x7(3MLIB),         mlib_ImageConv7x7_Fp(3MLIB),        mlib_Image‐
113       Conv7x7Index(3MLIB), mlib_ImageConvKernelConvert(3MLIB), mlib_ImageCon‐
114       vMxN_Fp(3MLIB),      mlib_ImageConvMxNIndex(3MLIB),      mlib_ImageCon‐
115       volveMxN(3MLIB),                       mlib_ImageConvolveMxN_Fp(3MLIB),
116       mlib_ImageSConv3x3(3MLIB),                mlib_ImageSConv3x3_Fp(3MLIB),
117       mlib_ImageSConv5x5(3MLIB),                mlib_ImageSConv5x5_Fp(3MLIB),
118       mlib_ImageSConv7x7(3MLIB),                mlib_ImageSConv7x7_Fp(3MLIB),
119       mlib_ImageSConvKernelConvert(3MLIB), attributes(5)
120
121
122
123SunOS 5.11                        2 Mar 2007          mlib_ImageConvMxN(3MLIB)
Impressum