| 1 | /* |
| 2 | * Copyright (c) 2003, 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 | #include "mlib_image.h" |
| 28 | #include "mlib_ImageConv.h" |
| 29 | #include "mlib_c_ImageConv.h" |
| 30 | |
| 31 | /***************************************************************/ |
| 32 | #define MLIB_PARAMS_CONV_MN_NW \ |
| 33 | mlib_image *dst, \ |
| 34 | const mlib_image *src, \ |
| 35 | const mlib_s32 *kern, \ |
| 36 | mlib_s32 m, \ |
| 37 | mlib_s32 n, \ |
| 38 | mlib_s32 dm, \ |
| 39 | mlib_s32 dn, \ |
| 40 | mlib_s32 scale, \ |
| 41 | mlib_s32 cmask |
| 42 | |
| 43 | /***************************************************************/ |
| 44 | #define MLIB_CALL_PARAMS_CONV_MN_NW \ |
| 45 | dst, src, kern, m, n, dm, dn, scale, cmask |
| 46 | |
| 47 | /***************************************************************/ |
| 48 | #define MLIB_PARAMS_CONV_MN_EXT \ |
| 49 | mlib_image *dst, \ |
| 50 | const mlib_image *src, \ |
| 51 | const mlib_s32 *kern, \ |
| 52 | mlib_s32 m, \ |
| 53 | mlib_s32 n, \ |
| 54 | mlib_s32 dx_l, \ |
| 55 | mlib_s32 dx_r, \ |
| 56 | mlib_s32 dy_t, \ |
| 57 | mlib_s32 dy_b, \ |
| 58 | mlib_s32 scale, \ |
| 59 | mlib_s32 cmask |
| 60 | |
| 61 | /***************************************************************/ |
| 62 | #define MLIB_CALL_PARAMS_CONV_MN_EXT \ |
| 63 | dst, src, kern, m, n, dx_l, dx_r, dy_t, dy_b, scale, cmask |
| 64 | |
| 65 | |
| 66 | /***************************************************************/ |
| 67 | mlib_status mlib_convMxNnw_u8(MLIB_PARAMS_CONV_MN_NW) |
| 68 | { |
| 69 | #ifdef __sparc |
| 70 | return mlib_c_convMxNnw_u8(MLIB_CALL_PARAMS_CONV_MN_NW); |
| 71 | #else |
| 72 | |
| 73 | if (mlib_ImageConvVersion(m, n, scale, MLIB_BYTE) == 0) |
| 74 | return mlib_c_convMxNnw_u8(MLIB_CALL_PARAMS_CONV_MN_NW); |
| 75 | else |
| 76 | return mlib_i_convMxNnw_u8(MLIB_CALL_PARAMS_CONV_MN_NW); |
| 77 | #endif /* __sparc */ |
| 78 | } |
| 79 | |
| 80 | /***************************************************************/ |
| 81 | mlib_status mlib_convMxNext_u8(MLIB_PARAMS_CONV_MN_EXT) |
| 82 | { |
| 83 | #ifdef __sparc |
| 84 | return mlib_c_convMxNext_u8(MLIB_CALL_PARAMS_CONV_MN_EXT); |
| 85 | #else |
| 86 | |
| 87 | if (mlib_ImageConvVersion(m, n, scale, MLIB_BYTE) == 0) |
| 88 | return mlib_c_convMxNext_u8(MLIB_CALL_PARAMS_CONV_MN_EXT); |
| 89 | else |
| 90 | return mlib_i_convMxNext_u8(MLIB_CALL_PARAMS_CONV_MN_EXT); |
| 91 | #endif /* __sparc */ |
| 92 | } |
| 93 | |
| 94 | /***************************************************************/ |
| 95 | |