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_IMAGECONV_H
  28 #define __MLIB_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 { \
  38 if (pbuff != buff) mlib_free(pbuff); \
  39 if (k != akernel) mlib_free(k); \
  40 return status; \
  41 }
  42 #endif /* FREE_AND_RETURN_STATUS */
  43 
  44 mlib_status mlib_convMxNext_s32(mlib_image       *dst,
  45                                 const mlib_image *src,
  46                                 const mlib_s32   *kernel,
  47                                 mlib_s32         m,
  48                                 mlib_s32         n,
  49                                 mlib_s32         dx_l,
  50                                 mlib_s32         dx_r,
  51                                 mlib_s32         dy_t,
  52                                 mlib_s32         dy_b,
  53                                 mlib_s32         scale,
  54                                 mlib_s32         cmask);
  55 
  56 mlib_status mlib_convMxNnw_d64(mlib_image       *dst,
  57                                const mlib_image *src,
  58                                const mlib_d64   *ker,
  59                                mlib_s32         m,
  60                                mlib_s32         n,
  61                                mlib_s32         dm,
  62                                mlib_s32         dn,
  63                                mlib_s32         cmask);
  64 
  65 mlib_status mlib_convMxNnw_f32(mlib_image       *dst,
  66                                const mlib_image *src,
  67                                const mlib_d64   *ker,
  68                                mlib_s32         m,
  69                                mlib_s32         n,
  70                                mlib_s32         dm,
  71                                mlib_s32         dn,
  72                                mlib_s32         cmask);
  73 
  74 mlib_status mlib_convMxNnw_s16(mlib_image       *dst,
  75                                const mlib_image *src,
  76                                const mlib_s32   *kernel,
  77                                mlib_s32         m,
  78                                mlib_s32         n,
  79                                mlib_s32         dm,
  80                                mlib_s32         dn,
  81                                mlib_s32         scale,
  82                                mlib_s32         cmask);
  83 
  84 mlib_status mlib_convMxNnw_s32(mlib_image       *dst,
  85                                const mlib_image *src,
  86                                const mlib_s32   *kernel,
  87                                mlib_s32         m,
  88                                mlib_s32         n,
  89                                mlib_s32         dm,
  90                                mlib_s32         dn,
  91                                mlib_s32         scale,
  92                                mlib_s32         cmask);
  93 
  94 mlib_status mlib_convMxNnw_u16(mlib_image       *dst,
  95                                const mlib_image *src,
  96                                const mlib_s32   *kernel,
  97                                mlib_s32         m,
  98                                mlib_s32         n,
  99                                mlib_s32         dm,
 100                                mlib_s32         dn,
 101                                mlib_s32         scale,
 102                                mlib_s32         cmask);
 103 
 104 mlib_s32 mlib_ImageConvVersion(mlib_s32  m,
 105                                mlib_s32  n,
 106                                mlib_s32  scale,
 107                                mlib_type type);
 108 
 109 mlib_status mlib_ImageConvMxN_f(mlib_image       *dst,
 110                                 const mlib_image *src,
 111                                 const void       *kernel,
 112                                 mlib_s32         m,
 113                                 mlib_s32         n,
 114                                 mlib_s32         dm,
 115                                 mlib_s32         dn,
 116                                 mlib_s32         scale,
 117                                 mlib_s32         cmask,
 118                                 mlib_edge        edge);
 119 
 120 mlib_status mlib_convMxNnw_u8(mlib_image       *dst,
 121                               const mlib_image *src,
 122                               const mlib_s32   *kern,
 123                               mlib_s32         m,
 124                               mlib_s32         n,
 125                               mlib_s32         dm,
 126                               mlib_s32         dn,
 127                               mlib_s32         scale,
 128                               mlib_s32         cmask);
 129 
 130 mlib_status mlib_convMxNext_u8(mlib_image       *dst,
 131                                const mlib_image *src,
 132                                const mlib_s32   *kern,
 133                                mlib_s32         m,
 134                                mlib_s32         n,
 135                                mlib_s32         dx_l,
 136                                mlib_s32         dx_r,
 137                                mlib_s32         dy_t,
 138                                mlib_s32         dy_b,
 139                                mlib_s32         scale,
 140                                mlib_s32         cmask);
 141 
 142 mlib_status mlib_convMxNext_s16(mlib_image *dst,
 143                                 const mlib_image *src,
 144                                 const mlib_s32 *kernel,
 145                                 mlib_s32 m,
 146                                 mlib_s32 n,
 147                                 mlib_s32 dx_l,
 148                                 mlib_s32 dx_r,
 149                                 mlib_s32 dy_t,
 150                                 mlib_s32 dy_b,
 151                                 mlib_s32 scale,
 152                                 mlib_s32 cmask);
 153 
 154 mlib_status mlib_convMxNext_u16(mlib_image       *dst,
 155                                 const mlib_image *src,
 156                                 const mlib_s32   *kernel,
 157                                 mlib_s32         m,
 158                                 mlib_s32         n,
 159                                 mlib_s32         dx_l,
 160                                 mlib_s32         dx_r,
 161                                 mlib_s32         dy_t,
 162                                 mlib_s32         dy_b,
 163                                 mlib_s32         scale,
 164                                 mlib_s32         cmask);
 165 
 166 mlib_status mlib_convMxNext_f32(mlib_image       *dst,
 167                                 const mlib_image *src,
 168                                 const mlib_d64   *kernel,
 169                                 mlib_s32         m,
 170                                 mlib_s32         n,
 171                                 mlib_s32         dx_l,
 172                                 mlib_s32         dx_r,
 173                                 mlib_s32         dy_t,
 174                                 mlib_s32         dy_b,
 175                                 mlib_s32         cmask);
 176 
 177 mlib_status mlib_convMxNext_d64(mlib_image       *dst,
 178                                 const mlib_image *src,
 179                                 const mlib_d64   *kernel,
 180                                 mlib_s32         m,
 181                                 mlib_s32         n,
 182                                 mlib_s32         dx_l,
 183                                 mlib_s32         dx_r,
 184                                 mlib_s32         dy_t,
 185                                 mlib_s32         dy_b,
 186                                 mlib_s32         cmask);
 187 
 188 #ifdef __cplusplus
 189 }
 190 #endif /* __cplusplus */
 191 #endif /* __MLIB_IMAGECONV_H */