2
|
1 |
/*
|
5506
|
2 |
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
|
2
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
4 |
*
|
|
5 |
* This code is free software; you can redistribute it and/or modify it
|
|
6 |
* under the terms of the GNU General Public License version 2 only, as
|
5506
|
7 |
* published by the Free Software Foundation. Oracle designates this
|
2
|
8 |
* particular file as subject to the "Classpath" exception as provided
|
5506
|
9 |
* by Oracle in the LICENSE file that accompanied this code.
|
2
|
10 |
*
|
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that
|
|
15 |
* accompanied this code).
|
|
16 |
*
|
|
17 |
* You should have received a copy of the GNU General Public License version
|
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
20 |
*
|
5506
|
21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
22 |
* or visit www.oracle.com if you need additional information or have any
|
|
23 |
* questions.
|
2
|
24 |
*/
|
|
25 |
|
|
26 |
|
|
27 |
#include "mlib_image.h"
|
|
28 |
#include "mlib_ImageConv.h"
|
|
29 |
#include "mlib_c_ImageConv.h"
|
|
30 |
|
|
31 |
/***************************************************************/
|
|
32 |
#define MLIB_PARAMS_CONV_NW \
|
|
33 |
mlib_image *dst, \
|
|
34 |
const mlib_image *src, \
|
|
35 |
const mlib_s32 *kern, \
|
|
36 |
mlib_s32 scale, \
|
|
37 |
mlib_s32 cmask
|
|
38 |
|
|
39 |
/***************************************************************/
|
|
40 |
#define MLIB_CALL_PARAMS_CONV_NW \
|
|
41 |
dst, src, kern, scale, cmask
|
|
42 |
|
|
43 |
/***************************************************************/
|
|
44 |
#define MLIB_PARAMS_CONV_EXT \
|
|
45 |
mlib_image *dst, \
|
|
46 |
const mlib_image *src, \
|
|
47 |
mlib_s32 dx_l, \
|
|
48 |
mlib_s32 dx_r, \
|
|
49 |
mlib_s32 dy_t, \
|
|
50 |
mlib_s32 dy_b, \
|
|
51 |
const mlib_s32 *kern, \
|
|
52 |
mlib_s32 scale, \
|
|
53 |
mlib_s32 cmask
|
|
54 |
|
|
55 |
/***************************************************************/
|
|
56 |
#define MLIB_CALL_PARAMS_CONV_EXT \
|
|
57 |
dst, src, dx_l, dx_r, dy_t, dy_b, kern, scale, cmask
|
|
58 |
|
|
59 |
/***************************************************************/
|
|
60 |
#define MLIB_PARAMS_CONV_MN_NW \
|
|
61 |
mlib_image *dst, \
|
|
62 |
const mlib_image *src, \
|
|
63 |
const mlib_s32 *kern, \
|
|
64 |
mlib_s32 m, \
|
|
65 |
mlib_s32 n, \
|
|
66 |
mlib_s32 dm, \
|
|
67 |
mlib_s32 dn, \
|
|
68 |
mlib_s32 scale, \
|
|
69 |
mlib_s32 cmask
|
|
70 |
|
|
71 |
/***************************************************************/
|
|
72 |
#define MLIB_CALL_PARAMS_CONV_MN_NW \
|
|
73 |
dst, src, kern, m, n, dm, dn, scale, cmask
|
|
74 |
|
|
75 |
/***************************************************************/
|
|
76 |
#define MLIB_PARAMS_CONV_MN_EXT \
|
|
77 |
mlib_image *dst, \
|
|
78 |
const mlib_image *src, \
|
|
79 |
const mlib_s32 *kern, \
|
|
80 |
mlib_s32 m, \
|
|
81 |
mlib_s32 n, \
|
|
82 |
mlib_s32 dx_l, \
|
|
83 |
mlib_s32 dx_r, \
|
|
84 |
mlib_s32 dy_t, \
|
|
85 |
mlib_s32 dy_b, \
|
|
86 |
mlib_s32 scale, \
|
|
87 |
mlib_s32 cmask
|
|
88 |
|
|
89 |
/***************************************************************/
|
|
90 |
#define MLIB_CALL_PARAMS_CONV_MN_EXT \
|
|
91 |
dst, src, kern, m, n, dx_l, dx_r, dy_t, dy_b, scale, cmask
|
|
92 |
|
|
93 |
|
|
94 |
/***************************************************************/
|
|
95 |
mlib_status mlib_conv2x2nw_u8(MLIB_PARAMS_CONV_NW)
|
|
96 |
{
|
|
97 |
return mlib_c_conv2x2nw_u8(MLIB_CALL_PARAMS_CONV_NW);
|
|
98 |
}
|
|
99 |
|
|
100 |
/***************************************************************/
|
|
101 |
mlib_status mlib_conv3x3nw_u8(MLIB_PARAMS_CONV_NW)
|
|
102 |
{
|
|
103 |
#ifdef __sparc
|
|
104 |
return mlib_c_conv3x3nw_u8(MLIB_CALL_PARAMS_CONV_NW);
|
|
105 |
#else
|
|
106 |
|
|
107 |
if (mlib_ImageConvVersion(3, 3, scale, MLIB_BYTE) == 0)
|
|
108 |
return mlib_c_conv3x3nw_u8(MLIB_CALL_PARAMS_CONV_NW);
|
|
109 |
else
|
|
110 |
return mlib_i_conv3x3nw_u8(MLIB_CALL_PARAMS_CONV_NW);
|
|
111 |
#endif /* __sparc */
|
|
112 |
}
|
|
113 |
|
|
114 |
/***************************************************************/
|
|
115 |
mlib_status mlib_conv4x4nw_u8(MLIB_PARAMS_CONV_NW)
|
|
116 |
{
|
|
117 |
return mlib_c_conv4x4nw_u8(MLIB_CALL_PARAMS_CONV_NW);
|
|
118 |
}
|
|
119 |
|
|
120 |
/***************************************************************/
|
|
121 |
mlib_status mlib_conv5x5nw_u8(MLIB_PARAMS_CONV_NW)
|
|
122 |
{
|
|
123 |
#ifdef __sparc
|
|
124 |
return mlib_c_conv5x5nw_u8(MLIB_CALL_PARAMS_CONV_NW);
|
|
125 |
#else
|
|
126 |
|
|
127 |
if (mlib_ImageConvVersion(5, 5, scale, MLIB_BYTE) == 0)
|
|
128 |
return mlib_c_conv5x5nw_u8(MLIB_CALL_PARAMS_CONV_NW);
|
|
129 |
else
|
|
130 |
return mlib_i_conv5x5nw_u8(MLIB_CALL_PARAMS_CONV_NW);
|
|
131 |
#endif /* __sparc */
|
|
132 |
}
|
|
133 |
|
|
134 |
/***************************************************************/
|
|
135 |
mlib_status mlib_conv7x7nw_u8(MLIB_PARAMS_CONV_NW)
|
|
136 |
{
|
|
137 |
return mlib_c_conv7x7nw_u8(MLIB_CALL_PARAMS_CONV_NW);
|
|
138 |
}
|
|
139 |
|
|
140 |
/***************************************************************/
|
|
141 |
mlib_status mlib_convMxNnw_u8(MLIB_PARAMS_CONV_MN_NW)
|
|
142 |
{
|
|
143 |
#ifdef __sparc
|
|
144 |
return mlib_c_convMxNnw_u8(MLIB_CALL_PARAMS_CONV_MN_NW);
|
|
145 |
#else
|
|
146 |
|
|
147 |
if (mlib_ImageConvVersion(m, n, scale, MLIB_BYTE) == 0)
|
|
148 |
return mlib_c_convMxNnw_u8(MLIB_CALL_PARAMS_CONV_MN_NW);
|
|
149 |
else
|
|
150 |
return mlib_i_convMxNnw_u8(MLIB_CALL_PARAMS_CONV_MN_NW);
|
|
151 |
#endif /* __sparc */
|
|
152 |
}
|
|
153 |
|
|
154 |
/***************************************************************/
|
|
155 |
mlib_status mlib_conv2x2ext_u8(MLIB_PARAMS_CONV_EXT)
|
|
156 |
{
|
|
157 |
return mlib_c_conv2x2ext_u8(MLIB_CALL_PARAMS_CONV_EXT);
|
|
158 |
}
|
|
159 |
|
|
160 |
/***************************************************************/
|
|
161 |
mlib_status mlib_conv3x3ext_u8(MLIB_PARAMS_CONV_EXT)
|
|
162 |
{
|
|
163 |
#ifdef __sparc
|
|
164 |
return mlib_c_conv3x3ext_u8(MLIB_CALL_PARAMS_CONV_EXT);
|
|
165 |
#else
|
|
166 |
|
|
167 |
if (mlib_ImageConvVersion(3, 3, scale, MLIB_BYTE) == 0)
|
|
168 |
return mlib_c_conv3x3ext_u8(MLIB_CALL_PARAMS_CONV_EXT);
|
|
169 |
else
|
|
170 |
return mlib_i_conv3x3ext_u8(MLIB_CALL_PARAMS_CONV_EXT);
|
|
171 |
#endif /* __sparc */
|
|
172 |
}
|
|
173 |
|
|
174 |
/***************************************************************/
|
|
175 |
mlib_status mlib_conv4x4ext_u8(MLIB_PARAMS_CONV_EXT)
|
|
176 |
{
|
|
177 |
return mlib_c_conv4x4ext_u8(MLIB_CALL_PARAMS_CONV_EXT);
|
|
178 |
}
|
|
179 |
|
|
180 |
/***************************************************************/
|
|
181 |
mlib_status mlib_conv5x5ext_u8(MLIB_PARAMS_CONV_EXT)
|
|
182 |
{
|
|
183 |
#ifdef __sparc
|
|
184 |
return mlib_c_conv5x5ext_u8(MLIB_CALL_PARAMS_CONV_EXT);
|
|
185 |
#else
|
|
186 |
|
|
187 |
if (mlib_ImageConvVersion(5, 5, scale, MLIB_BYTE) == 0)
|
|
188 |
return mlib_c_conv5x5ext_u8(MLIB_CALL_PARAMS_CONV_EXT);
|
|
189 |
else
|
|
190 |
return mlib_i_conv5x5ext_u8(MLIB_CALL_PARAMS_CONV_EXT);
|
|
191 |
#endif /* __sparc */
|
|
192 |
}
|
|
193 |
|
|
194 |
/***************************************************************/
|
|
195 |
mlib_status mlib_conv7x7ext_u8(MLIB_PARAMS_CONV_EXT)
|
|
196 |
{
|
|
197 |
return mlib_c_conv7x7ext_u8(MLIB_CALL_PARAMS_CONV_EXT);
|
|
198 |
}
|
|
199 |
|
|
200 |
/***************************************************************/
|
|
201 |
mlib_status mlib_convMxNext_u8(MLIB_PARAMS_CONV_MN_EXT)
|
|
202 |
{
|
|
203 |
#ifdef __sparc
|
|
204 |
return mlib_c_convMxNext_u8(MLIB_CALL_PARAMS_CONV_MN_EXT);
|
|
205 |
#else
|
|
206 |
|
|
207 |
if (mlib_ImageConvVersion(m, n, scale, MLIB_BYTE) == 0)
|
|
208 |
return mlib_c_convMxNext_u8(MLIB_CALL_PARAMS_CONV_MN_EXT);
|
|
209 |
else
|
|
210 |
return mlib_i_convMxNext_u8(MLIB_CALL_PARAMS_CONV_MN_EXT);
|
|
211 |
#endif /* __sparc */
|
|
212 |
}
|
|
213 |
|
|
214 |
/***************************************************************/
|
|
215 |
mlib_status mlib_conv2x2nw_s16(MLIB_PARAMS_CONV_NW)
|
|
216 |
{
|
|
217 |
return mlib_c_conv2x2nw_s16(MLIB_CALL_PARAMS_CONV_NW);
|
|
218 |
}
|
|
219 |
|
|
220 |
/***************************************************************/
|
|
221 |
mlib_status mlib_conv2x2nw_u16(MLIB_PARAMS_CONV_NW)
|
|
222 |
{
|
|
223 |
return mlib_c_conv2x2nw_u16(MLIB_CALL_PARAMS_CONV_NW);
|
|
224 |
}
|
|
225 |
|
|
226 |
/***************************************************************/
|
|
227 |
mlib_status mlib_conv2x2ext_s16(MLIB_PARAMS_CONV_EXT)
|
|
228 |
{
|
|
229 |
return mlib_c_conv2x2ext_s16(MLIB_CALL_PARAMS_CONV_EXT);
|
|
230 |
}
|
|
231 |
|
|
232 |
/***************************************************************/
|
|
233 |
mlib_status mlib_conv2x2ext_u16(MLIB_PARAMS_CONV_EXT)
|
|
234 |
{
|
|
235 |
return mlib_c_conv2x2ext_u16(MLIB_CALL_PARAMS_CONV_EXT);
|
|
236 |
}
|
|
237 |
|
|
238 |
/***************************************************************/
|