1 | /* |
2 | * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. |
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 |
7 | * published by the Free Software Foundation. Oracle designates this |
8 | * particular file as subject to the "Classpath" exception as provided |
9 | * by Oracle in the LICENSE file that accompanied this code. |
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 | * |
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. |
24 | */ |
25 | |
26 | |
27 | #ifndef __MLIB_C_IMAGECONV_H |
28 | #define __MLIB_C_IMAGECONV_H |
29 | |
30 | #ifdef __cplusplus |
31 | extern "C" { |
32 | #endif /* __cplusplus */ |
33 | |
34 | // Shared macro defined for cleanup of allocated memory. |
35 | #ifndef FREE_AND_RETURN_STATUS |
36 | #define FREE_AND_RETURN_STATUS \ |
37 | if (pbuff != buff) mlib_free(pbuff); \ |
38 | if (k != akernel) mlib_free(k); \ |
39 | return status |
40 | #endif /* FREE_AND_RETURN_STATUS */ |
41 | |
42 | mlib_status mlib_c_convMxNnw_u8(mlib_image *dst, |
43 | const mlib_image *src, |
44 | const mlib_s32 *kernel, |
45 | mlib_s32 m, |
46 | mlib_s32 n, |
47 | mlib_s32 dm, |
48 | mlib_s32 dn, |
49 | mlib_s32 scale, |
50 | mlib_s32 cmask); |
51 | |
52 | mlib_status mlib_c_convMxNext_u8(mlib_image *dst, |
53 | const mlib_image *src, |
54 | const mlib_s32 *kern, |
55 | mlib_s32 m, |
56 | mlib_s32 n, |
57 | mlib_s32 dx_l, |
58 | mlib_s32 dx_r, |
59 | mlib_s32 dy_t, |
60 | mlib_s32 dy_b, |
61 | mlib_s32 scale, |
62 | mlib_s32 cmask); |
63 | |
64 | #if ! defined ( __sparc ) /* for x86, using integer multiplies is faster */ |
65 | |
66 | mlib_status mlib_i_convMxNnw_s16(mlib_image *dst, |
67 | const mlib_image *src, |
68 | const mlib_s32 *kernel, |
69 | mlib_s32 m, |
70 | mlib_s32 n, |
71 | mlib_s32 dm, |
72 | mlib_s32 dn, |
73 | mlib_s32 scale, |
74 | mlib_s32 cmask); |
75 | |
76 | mlib_status mlib_i_convMxNnw_u16(mlib_image *dst, |
77 | const mlib_image *src, |
78 | const mlib_s32 *kernel, |
79 | mlib_s32 m, |
80 | mlib_s32 n, |
81 | mlib_s32 dm, |
82 | mlib_s32 dn, |
83 | mlib_s32 scale, |
84 | mlib_s32 cmask); |
85 | |
86 | mlib_status mlib_i_convMxNnw_u8(mlib_image *dst, |
87 | const mlib_image *src, |
88 | const mlib_s32 *kernel, |
89 | mlib_s32 m, |
90 | mlib_s32 n, |
91 | mlib_s32 dm, |
92 | mlib_s32 dn, |
93 | mlib_s32 scale, |
94 | mlib_s32 cmask); |
95 | |
96 | mlib_status mlib_i_convMxNext_u8(mlib_image *dst, |
97 | const mlib_image *src, |
98 | const mlib_s32 *kern, |
99 | mlib_s32 m, |
100 | mlib_s32 n, |
101 | mlib_s32 dx_l, |
102 | mlib_s32 dx_r, |
103 | mlib_s32 dy_t, |
104 | mlib_s32 dy_b, |
105 | mlib_s32 scale, |
106 | mlib_s32 cmask); |
107 | |
108 | mlib_status mlib_i_convMxNext_s16(mlib_image *dst, |
109 | const mlib_image *src, |
110 | const mlib_s32 *kernel, |
111 | mlib_s32 m, |
112 | mlib_s32 n, |
113 | mlib_s32 dx_l, |
114 | mlib_s32 dx_r, |
115 | mlib_s32 dy_t, |
116 | mlib_s32 dy_b, |
117 | mlib_s32 scale, |
118 | mlib_s32 cmask); |
119 | |
120 | mlib_status mlib_i_convMxNext_u16(mlib_image *dst, |
121 | const mlib_image *src, |
122 | const mlib_s32 *kernel, |
123 | mlib_s32 m, |
124 | mlib_s32 n, |
125 | mlib_s32 dx_l, |
126 | mlib_s32 dx_r, |
127 | mlib_s32 dy_t, |
128 | mlib_s32 dy_b, |
129 | mlib_s32 scale, |
130 | mlib_s32 cmask); |
131 | |
132 | #endif /* ! defined ( __sparc ) ( for x86, using integer multiplies is faster ) */ |
133 | |
134 | #ifdef __cplusplus |
135 | } |
136 | #endif /* __cplusplus */ |
137 | #endif /* __MLIB_C_IMAGECONV_H */ |
138 | |