1mlib_ImageConvolveMxN(3MLIBm)ediaLib Library Functionmslib_ImageConvolveMxN(3MLIB)
2
3
4
6 mlib_ImageConvolveMxN - MxN convolution, with kernel analysis for tak‐
7 ing advantage of special cases
8
10 cc [ flag... ] file... -lmlib [ library... ]
11 #include <mlib.h>
12
13 mlib_status mlib_ImageConvolveMxN(mlib_image *dst, const mlib_image *src,
14 const mlib_d64 *kernel, mlib_s32 m, mlib_s32 n, mlib_s32 dm,
15 mlib_s32 dn, mlib_s32 cmask, mlib_edge edge);
16
17
19 The mlib_ImageConvolveMxN() function analyzes the convolution kernel,
20 converts the floating-point kernel to an integer kernel, then performs
21 a MxN convolution on the source image by calling either one of the
22 functions like mlib_ImageSConv3x3(), mlib_ImageConv3x3(), and etc. in
23 special cases or mlib_ImageConvMxN() in other cases.
24
25
26 The input image and the output image must have the same image type and
27 have the same number of channels. The unselected channels in the output
28 image are not overwritten. For single-channel images, the channel mask
29 is ignored.
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]
36 p=-dm q=-dn
37
38
39
40 where m ≥ 1, n ≥ 1, 0 ≤ dm < m, 0 ≤ dn < n.
41
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 cmask Channel mask to indicate the channels to be convolved, each
69 bit of which represents a channel in the image. The channels
70 corresponding to 1 bits are those to be processed. For a sin‐
71 gle-channel image, the channel mask is ignored.
72
73
74 edge Type of edge condition. It can be one of the following:
75
76 MLIB_EDGE_DST_NO_WRITE
77 MLIB_EDGE_DST_FILL_ZERO
78 MLIB_EDGE_DST_COPY_SRC
79 MLIB_EDGE_SRC_EXTEND
80
81
82
84 The function returns MLIB_SUCCESS if successful. Otherwise it returns
85 MLIB_FAILURE.
86
88 See attributes(5) for descriptions of the following attributes:
89
90
91
92
93 ┌─────────────────────────────┬─────────────────────────────┐
94 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
95 ├─────────────────────────────┼─────────────────────────────┤
96 │Interface Stability │Committed │
97 ├─────────────────────────────┼─────────────────────────────┤
98 │MT-Level │MT-Safe │
99 └─────────────────────────────┴─────────────────────────────┘
100
102 mlib_ImageConv2x2(3MLIB), mlib_ImageConv2x2_Fp(3MLIB), mlib_Image‐
103 Conv2x2Index(3MLIB), mlib_ImageConv3x3(3MLIB), mlib_Image‐
104 Conv3x3_Fp(3MLIB), mlib_ImageConv3x3Index(3MLIB), mlib_Image‐
105 Conv4x4(3MLIB), mlib_ImageConv4x4_Fp(3MLIB), mlib_Image‐
106 Conv4x4Index(3MLIB), mlib_ImageConv5x5(3MLIB), mlib_Image‐
107 Conv5x5_Fp(3MLIB), mlib_ImageConv5x5Index(3MLIB), mlib_Image‐
108 Conv7x7(3MLIB), mlib_ImageConv7x7_Fp(3MLIB), mlib_Image‐
109 Conv7x7Index(3MLIB), mlib_ImageConvKernelConvert(3MLIB), mlib_ImageCon‐
110 vMxN(3MLIB), mlib_ImageConvMxN_Fp(3MLIB), mlib_ImageConvMxNIn‐
111 dex(3MLIB), mlib_ImageConvolveMxN_Fp(3MLIB), mlib_ImageSConv3x3(3MLIB),
112 mlib_ImageSConv3x3_Fp(3MLIB), mlib_ImageSConv5x5(3MLIB),
113 mlib_ImageSConv5x5_Fp(3MLIB), mlib_ImageSConv7x7(3MLIB),
114 mlib_ImageSConv7x7_Fp(3MLIB), mlib_ImageSConvKernelConvert(3MLIB),
115 attributes(5)
116
117
118
119SunOS 5.11 2 Mar 2007 mlib_ImageConvolveMxN(3MLIB)