73 * The src and the dst must be the same type and have same number
74 * of channels (1, 2, 3, or 4). They can be in MLIB_BIT, MLIB_BYTE,
75 * MLIB_SHORT, MLIB_USHORT or MLIB_INT data type.
76 * m >= 1, n >= 1,
77 * 0 <= dm < m, 0 <= dn < n.
78 * For data type MLIB_BYTE: 16 <= scale <= 31 (to be compatible with VIS version)
79 * For data type MLIB_SHORT: 17 <= scale <= 32 (to be compatible with VIS version)
80 * For data type MLIB_USHORT: 17 <= scale <= 32 (to be compatible with VIS version)
81 * For data type MLIB_INT: scale >= 0
82 */
83
84 #include "mlib_image.h"
85 #include "mlib_ImageCheck.h"
86 #include "mlib_ImageConv.h"
87 #include "mlib_ImageCreate.h"
88 #include "mlib_c_ImageConv.h"
89 #include "mlib_ImageClipping.h"
90 #include "mlib_ImageConvEdge.h"
91
92 /***************************************************************/
93 mlib_status mlib_ImageConvMxN(mlib_image *dst,
94 const mlib_image *src,
95 const mlib_s32 *kernel,
96 mlib_s32 m,
97 mlib_s32 n,
98 mlib_s32 dm,
99 mlib_s32 dn,
100 mlib_s32 scale,
101 mlib_s32 cmask,
102 mlib_edge edge)
103 {
104 MLIB_IMAGE_CHECK(dst);
105
106 switch (mlib_ImageGetType(dst)) {
107 case MLIB_BYTE:
108
109 if (scale < 16 || scale > 31)
110 return MLIB_FAILURE;
111 break;
112 case MLIB_SHORT:
113 case MLIB_USHORT:
|
73 * The src and the dst must be the same type and have same number
74 * of channels (1, 2, 3, or 4). They can be in MLIB_BIT, MLIB_BYTE,
75 * MLIB_SHORT, MLIB_USHORT or MLIB_INT data type.
76 * m >= 1, n >= 1,
77 * 0 <= dm < m, 0 <= dn < n.
78 * For data type MLIB_BYTE: 16 <= scale <= 31 (to be compatible with VIS version)
79 * For data type MLIB_SHORT: 17 <= scale <= 32 (to be compatible with VIS version)
80 * For data type MLIB_USHORT: 17 <= scale <= 32 (to be compatible with VIS version)
81 * For data type MLIB_INT: scale >= 0
82 */
83
84 #include "mlib_image.h"
85 #include "mlib_ImageCheck.h"
86 #include "mlib_ImageConv.h"
87 #include "mlib_ImageCreate.h"
88 #include "mlib_c_ImageConv.h"
89 #include "mlib_ImageClipping.h"
90 #include "mlib_ImageConvEdge.h"
91
92 /***************************************************************/
93 JNIEXPORT mlib_status JNICALL mlib_ImageConvMxN(mlib_image *dst,
94 const mlib_image *src,
95 const mlib_s32 *kernel,
96 mlib_s32 m,
97 mlib_s32 n,
98 mlib_s32 dm,
99 mlib_s32 dn,
100 mlib_s32 scale,
101 mlib_s32 cmask,
102 mlib_edge edge)
103 {
104 MLIB_IMAGE_CHECK(dst);
105
106 switch (mlib_ImageGetType(dst)) {
107 case MLIB_BYTE:
108
109 if (scale < 16 || scale > 31)
110 return MLIB_FAILURE;
111 break;
112 case MLIB_SHORT:
113 case MLIB_USHORT:
|