1 /*
   2  * Copyright (c) 2003, 2020, 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   if (mlib_ImageConvVersion(m, n, scale, MLIB_BYTE) == 0)
  70     return mlib_c_convMxNnw_u8(MLIB_CALL_PARAMS_CONV_MN_NW);
  71   else
  72     return mlib_i_convMxNnw_u8(MLIB_CALL_PARAMS_CONV_MN_NW);
  73 }
  74 
  75 /***************************************************************/
  76 mlib_status mlib_convMxNext_u8(MLIB_PARAMS_CONV_MN_EXT)
  77 {
  78   if (mlib_ImageConvVersion(m, n, scale, MLIB_BYTE) == 0)
  79     return mlib_c_convMxNext_u8(MLIB_CALL_PARAMS_CONV_MN_EXT);
  80   else
  81     return mlib_i_convMxNext_u8(MLIB_CALL_PARAMS_CONV_MN_EXT);
  82 }
  83 
  84 /***************************************************************/