< prev index next >

src/java.desktop/share/native/libmlib_image/mlib_ImageConvKernelConvert.c

Print this page
rev 49551 : 8201226: missing JNIEXPORT / JNICALL at some places in function declarations/implementations


  61 #include "mlib_ImageConv.h"
  62 
  63 /***************************************************************/
  64 #ifdef __sparc
  65 
  66 #define CLAMP_S32(dst, src)                                     \
  67   dst = (mlib_s32)(src)
  68 
  69 #else
  70 
  71 #define CLAMP_S32(dst, src) {                                   \
  72   mlib_d64 s0 = (mlib_d64)(src);                                \
  73   if (s0 > (mlib_d64)MLIB_S32_MAX) s0 = (mlib_d64)MLIB_S32_MAX; \
  74   if (s0 < (mlib_d64)MLIB_S32_MIN) s0 = (mlib_d64)MLIB_S32_MIN; \
  75   dst = (mlib_s32)s0;                                           \
  76 }
  77 
  78 #endif /* __sparc */
  79 
  80 /***************************************************************/
  81 mlib_status mlib_ImageConvKernelConvert(mlib_s32       *ikernel,
  82                                         mlib_s32       *iscale,
  83                                         const mlib_d64 *fkernel,
  84                                         mlib_s32       m,
  85                                         mlib_s32       n,
  86                                         mlib_type      type)
  87 {
  88   mlib_d64 sum_pos, sum_neg, sum, norm, max, f;
  89   mlib_s32 isum_pos, isum_neg, isum, test;
  90   mlib_s32 i, scale, scale1, chk_flag;
  91 
  92   if (ikernel == NULL || iscale == NULL || fkernel == NULL || m < 1 || n < 1) {
  93     return MLIB_FAILURE;
  94   }
  95 
  96   if ((type == MLIB_BYTE) || (type == MLIB_SHORT) || (type == MLIB_USHORT)) {
  97 
  98     if (type != MLIB_SHORT) {               /* MLIB_BYTE, MLIB_USHORT */
  99       sum_pos = 0;
 100       sum_neg = 0;
 101 




  61 #include "mlib_ImageConv.h"
  62 
  63 /***************************************************************/
  64 #ifdef __sparc
  65 
  66 #define CLAMP_S32(dst, src)                                     \
  67   dst = (mlib_s32)(src)
  68 
  69 #else
  70 
  71 #define CLAMP_S32(dst, src) {                                   \
  72   mlib_d64 s0 = (mlib_d64)(src);                                \
  73   if (s0 > (mlib_d64)MLIB_S32_MAX) s0 = (mlib_d64)MLIB_S32_MAX; \
  74   if (s0 < (mlib_d64)MLIB_S32_MIN) s0 = (mlib_d64)MLIB_S32_MIN; \
  75   dst = (mlib_s32)s0;                                           \
  76 }
  77 
  78 #endif /* __sparc */
  79 
  80 /***************************************************************/
  81 JNIEXPORT mlib_status JNICALL mlib_ImageConvKernelConvert(mlib_s32       *ikernel,
  82                                         mlib_s32       *iscale,
  83                                         const mlib_d64 *fkernel,
  84                                         mlib_s32       m,
  85                                         mlib_s32       n,
  86                                         mlib_type      type)
  87 {
  88   mlib_d64 sum_pos, sum_neg, sum, norm, max, f;
  89   mlib_s32 isum_pos, isum_neg, isum, test;
  90   mlib_s32 i, scale, scale1, chk_flag;
  91 
  92   if (ikernel == NULL || iscale == NULL || fkernel == NULL || m < 1 || n < 1) {
  93     return MLIB_FAILURE;
  94   }
  95 
  96   if ((type == MLIB_BYTE) || (type == MLIB_SHORT) || (type == MLIB_USHORT)) {
  97 
  98     if (type != MLIB_SHORT) {               /* MLIB_BYTE, MLIB_USHORT */
  99       sum_pos = 0;
 100       sum_neg = 0;
 101 


< prev index next >