From 00d9d6807c3eaa14a67f13dbc6aa8d4a49df2776 Mon Sep 17 00:00:00 2001 From: James Zern Date: Fri, 17 Jun 2011 14:26:06 -0700 Subject: [PATCH] swig: file reorganization Rather than %include'ing decode.h and potentially pickup new (unsupported functions), explicitly list the desired functions as with encode. Reorganize a bit to contain most of the language specific additions to one area. This fixes the visibility of the wrap_* functions in java. The method modifiers need to come before the function prototypes. Change-Id: I595df4d1a60edcb263923b5a2621879d3b6233cf --- swig/libwebp.i | 100 ++++----- swig/libwebp.jar | Bin 1924 -> 1917 bytes swig/libwebp_java_wrap.c | 442 +++++++++++++++++++-------------------- 3 files changed, 266 insertions(+), 276 deletions(-) diff --git a/swig/libwebp.i b/swig/libwebp.i index d6073493..2c6102f3 100644 --- a/swig/libwebp.i +++ b/swig/libwebp.i @@ -21,34 +21,19 @@ %include "constraints.i" %include "typemaps.i" +#ifdef SWIGJAVA +%include "arrays_java.i"; +%include "enums.swg" /*NB: requires JDK-1.5+ + See: http://www.swig.org/Doc1.3/Java.html#enumerations */ + +// map uint8_t* such that a byte[] is used +// this will generate a few spurious warnings in the wrapper code +%apply signed char[] { uint8_t * } +#endif /* SWIGJAVA */ + //------------------------------------------------------------------------------ // Decoder specific -%ignore WEBP_WEBP_DECODE_H_; -// FIXME for these to be available returned_buffer_size() would need to be -// made more intelligent. -%ignore WebPDecodeRGBInto; -%ignore WebPDecodeYUV; -%ignore WebPDecodeRGBAInto; -%ignore WebPDecodeBGRInto; -%ignore WebPDecodeBGRAInto; -%ignore WebPDecodeYUVInto; - -// incremental decoding -%ignore WEBP_CSP_MODE; -%ignore VP8StatusCode; -%ignore WebPIDecGetYUV; -%ignore WebPINew; -%ignore WebPIDecoder; -%ignore WebPIAppend; -%ignore WebPIDecGetRGB; -%ignore WebPIDelete; -%ignore WebPINewRGB; -%ignore WebPINewYUV; -%ignore WebPIUpdate; -%ignore WebPInitCustomIo; -%ignore WebPInitDecParams; - %apply int *OUTPUT { int *width, int *height } %apply int { uint32_t data_size } %apply Number NONNEGATIVE { uint32_t data_size } @@ -61,34 +46,27 @@ %newobject WebPDecodeBGRA; %typemap(newfree) uint8_t* "free($1);" +int WebPGetDecoderVersion(void); +int WebPGetInfo(const uint8_t* data, uint32_t data_size, + int *width, int *height); + +uint8_t* WebPDecodeRGB(const uint8_t* data, uint32_t data_size, + int *width, int *height); +uint8_t* WebPDecodeRGBA(const uint8_t* data, uint32_t data_size, + int *width, int *height); +uint8_t* WebPDecodeBGR(const uint8_t* data, uint32_t data_size, + int *width, int *height); +uint8_t* WebPDecodeBGRA(const uint8_t* data, uint32_t data_size, + int *width, int *height); + //------------------------------------------------------------------------------ // Encoder specific int WebPGetEncoderVersion(void); -#ifdef SWIGJAVA -%include "arrays_java.i"; -%include "enums.swg" /*NB: requires JDK-1.5+ - See: http://www.swig.org/Doc1.3/Java.html#enumerations */ +//------------------------------------------------------------------------------ +// Wrapper code additions -// map uint8_t* such that a byte[] is used -// this will generate a few spurious warnings in the wrapper code -%apply signed char[] { uint8_t * } - -%{ -/* Work around broken gcj jni.h */ -#ifdef __GCJ_JNI_H__ -# undef JNIEXPORT -# define JNIEXPORT -# undef JNICALL -# define JNICALL -#endif -%} -#endif - -/* - * Wrapper code additions - */ %{ #include "webp/decode.h" #include "webp/encode.h" @@ -158,6 +136,14 @@ static uint8_t* encode(const uint8_t* rgb, %newobject wrap_WebPEncodeRGBA; %newobject wrap_WebPEncodeBGRA; +#ifdef SWIGJAVA +// There's no reason to call these directly +%javamethodmodifiers wrap_WebPEncodeRGB "private"; +%javamethodmodifiers wrap_WebPEncodeBGR "private"; +%javamethodmodifiers wrap_WebPEncodeRGBA "private"; +%javamethodmodifiers wrap_WebPEncodeBGRA "private"; +#endif /* SWIGJAVA */ + %inline %{ // Changes the return type of WebPEncode* to more closely match Decode*. // This also makes it easier to wrap the output buffer in a native type rather @@ -193,12 +179,19 @@ static uint8_t* wrap_WebPEncodeBGRA( } %} +//------------------------------------------------------------------------------ +// Language specific + #ifdef SWIGJAVA -// There's no reason to call these directly -%javamethodmodifiers wrap_WebPEncodeRGB "private"; -%javamethodmodifiers wrap_WebPEncodeBGR "private"; -%javamethodmodifiers wrap_WebPEncodeRGBA "private"; -%javamethodmodifiers wrap_WebPEncodeBGRA "private"; +%{ +/* Work around broken gcj jni.h */ +#ifdef __GCJ_JNI_H__ +# undef JNIEXPORT +# define JNIEXPORT +# undef JNICALL +# define JNICALL +#endif +%} %pragma(java) modulecode=%{ private static final int UNUSED = 1; @@ -233,6 +226,3 @@ static uint8_t* wrap_WebPEncodeBGRA( } %} #endif /* SWIGJAVA */ - -// All functions, constants, etc. not named above in %ignore will be wrapped -%include "webp/decode.h" diff --git a/swig/libwebp.jar b/swig/libwebp.jar index 9f3184588d2aace6c4e8e800b0c8e927944eccac..b435e25ebc2902252348f68e4246f291aaffa873 100644 GIT binary patch delta 1208 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 diff --git a/swig/libwebp_java_wrap.c b/swig/libwebp_java_wrap.c index 0c904fa1..f4dc95a8 100644 --- a/swig/libwebp_java_wrap.c +++ b/swig/libwebp_java_wrap.c @@ -808,15 +808,6 @@ jdoubleArray SWIG_JavaArrayOutDouble (JNIEnv *jenv, double *result, jsize sz) { #endif -/* Work around broken gcj jni.h */ -#ifdef __GCJ_JNI_H__ -# undef JNIEXPORT -# define JNIEXPORT -# undef JNICALL -# define JNICALL -#endif - - #include "webp/decode.h" #include "webp/encode.h" @@ -906,222 +897,19 @@ static uint8_t* wrap_WebPEncodeBGRA( } +/* Work around broken gcj jni.h */ +#ifdef __GCJ_JNI_H__ +# undef JNIEXPORT +# define JNIEXPORT +# undef JNICALL +# define JNICALL +#endif + + #ifdef __cplusplus extern "C" { #endif -SWIGEXPORT jint JNICALL Java_com_google_webp_libwebpJNI_WebPGetEncoderVersion(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)WebPGetEncoderVersion(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jbyteArray JNICALL Java_com_google_webp_libwebpJNI_wrap_1WebPEncodeRGB(JNIEnv *jenv, jclass jcls, jbyteArray jarg1, jint jarg2, jint jarg3, jintArray jarg4, jint jarg5, jint jarg6, jint jarg7, jfloat jarg8) { - jbyteArray jresult = 0 ; - uint8_t *arg1 = (uint8_t *) 0 ; - int *arg2 = (int *) 0 ; - int *arg3 = (int *) 0 ; - int *arg4 = (int *) 0 ; - int arg5 ; - int arg6 ; - int arg7 ; - float arg8 ; - jbyte *jarr1 ; - int temp4 ; - uint8_t *result = 0 ; - - (void)jenv; - (void)jcls; - if (!SWIG_JavaArrayInSchar(jenv, &jarr1, &arg1, jarg1)) return 0; - arg2 = (int *)&jarg2; - arg3 = (int *)&jarg3; - { - if (!jarg4) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array null"); - return 0; - } - if ((*jenv)->GetArrayLength(jenv, jarg4) == 0) { - SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, "Array must contain at least 1 element"); - return 0; - } - arg4 = &temp4; - } - arg5 = (int)jarg5; - arg6 = (int)jarg6; - arg7 = (int)jarg7; - arg8 = (float)jarg8; - result = (uint8_t *)wrap_WebPEncodeRGB((uint8_t const *)arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8); - jresult = SWIG_JavaArrayOutSchar(jenv, result, FillMeInAsSizeCannotBeDeterminedAutomatically); - SWIG_JavaArrayArgoutSchar(jenv, jarr1, arg1, jarg1); - { - jint jvalue = (jint)temp4; - (*jenv)->SetIntArrayRegion(jenv, jarg4, 0, 1, &jvalue); - } - free(arg1); - - - - free(result); - return jresult; -} - - -SWIGEXPORT jbyteArray JNICALL Java_com_google_webp_libwebpJNI_wrap_1WebPEncodeBGR(JNIEnv *jenv, jclass jcls, jbyteArray jarg1, jint jarg2, jint jarg3, jintArray jarg4, jint jarg5, jint jarg6, jint jarg7, jfloat jarg8) { - jbyteArray jresult = 0 ; - uint8_t *arg1 = (uint8_t *) 0 ; - int *arg2 = (int *) 0 ; - int *arg3 = (int *) 0 ; - int *arg4 = (int *) 0 ; - int arg5 ; - int arg6 ; - int arg7 ; - float arg8 ; - jbyte *jarr1 ; - int temp4 ; - uint8_t *result = 0 ; - - (void)jenv; - (void)jcls; - if (!SWIG_JavaArrayInSchar(jenv, &jarr1, &arg1, jarg1)) return 0; - arg2 = (int *)&jarg2; - arg3 = (int *)&jarg3; - { - if (!jarg4) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array null"); - return 0; - } - if ((*jenv)->GetArrayLength(jenv, jarg4) == 0) { - SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, "Array must contain at least 1 element"); - return 0; - } - arg4 = &temp4; - } - arg5 = (int)jarg5; - arg6 = (int)jarg6; - arg7 = (int)jarg7; - arg8 = (float)jarg8; - result = (uint8_t *)wrap_WebPEncodeBGR((uint8_t const *)arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8); - jresult = SWIG_JavaArrayOutSchar(jenv, result, FillMeInAsSizeCannotBeDeterminedAutomatically); - SWIG_JavaArrayArgoutSchar(jenv, jarr1, arg1, jarg1); - { - jint jvalue = (jint)temp4; - (*jenv)->SetIntArrayRegion(jenv, jarg4, 0, 1, &jvalue); - } - free(arg1); - - - - free(result); - return jresult; -} - - -SWIGEXPORT jbyteArray JNICALL Java_com_google_webp_libwebpJNI_wrap_1WebPEncodeRGBA(JNIEnv *jenv, jclass jcls, jbyteArray jarg1, jint jarg2, jint jarg3, jintArray jarg4, jint jarg5, jint jarg6, jint jarg7, jfloat jarg8) { - jbyteArray jresult = 0 ; - uint8_t *arg1 = (uint8_t *) 0 ; - int *arg2 = (int *) 0 ; - int *arg3 = (int *) 0 ; - int *arg4 = (int *) 0 ; - int arg5 ; - int arg6 ; - int arg7 ; - float arg8 ; - jbyte *jarr1 ; - int temp4 ; - uint8_t *result = 0 ; - - (void)jenv; - (void)jcls; - if (!SWIG_JavaArrayInSchar(jenv, &jarr1, &arg1, jarg1)) return 0; - arg2 = (int *)&jarg2; - arg3 = (int *)&jarg3; - { - if (!jarg4) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array null"); - return 0; - } - if ((*jenv)->GetArrayLength(jenv, jarg4) == 0) { - SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, "Array must contain at least 1 element"); - return 0; - } - arg4 = &temp4; - } - arg5 = (int)jarg5; - arg6 = (int)jarg6; - arg7 = (int)jarg7; - arg8 = (float)jarg8; - result = (uint8_t *)wrap_WebPEncodeRGBA((uint8_t const *)arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8); - jresult = SWIG_JavaArrayOutSchar(jenv, result, FillMeInAsSizeCannotBeDeterminedAutomatically); - SWIG_JavaArrayArgoutSchar(jenv, jarr1, arg1, jarg1); - { - jint jvalue = (jint)temp4; - (*jenv)->SetIntArrayRegion(jenv, jarg4, 0, 1, &jvalue); - } - free(arg1); - - - - free(result); - return jresult; -} - - -SWIGEXPORT jbyteArray JNICALL Java_com_google_webp_libwebpJNI_wrap_1WebPEncodeBGRA(JNIEnv *jenv, jclass jcls, jbyteArray jarg1, jint jarg2, jint jarg3, jintArray jarg4, jint jarg5, jint jarg6, jint jarg7, jfloat jarg8) { - jbyteArray jresult = 0 ; - uint8_t *arg1 = (uint8_t *) 0 ; - int *arg2 = (int *) 0 ; - int *arg3 = (int *) 0 ; - int *arg4 = (int *) 0 ; - int arg5 ; - int arg6 ; - int arg7 ; - float arg8 ; - jbyte *jarr1 ; - int temp4 ; - uint8_t *result = 0 ; - - (void)jenv; - (void)jcls; - if (!SWIG_JavaArrayInSchar(jenv, &jarr1, &arg1, jarg1)) return 0; - arg2 = (int *)&jarg2; - arg3 = (int *)&jarg3; - { - if (!jarg4) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array null"); - return 0; - } - if ((*jenv)->GetArrayLength(jenv, jarg4) == 0) { - SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, "Array must contain at least 1 element"); - return 0; - } - arg4 = &temp4; - } - arg5 = (int)jarg5; - arg6 = (int)jarg6; - arg7 = (int)jarg7; - arg8 = (float)jarg8; - result = (uint8_t *)wrap_WebPEncodeBGRA((uint8_t const *)arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8); - jresult = SWIG_JavaArrayOutSchar(jenv, result, FillMeInAsSizeCannotBeDeterminedAutomatically); - SWIG_JavaArrayArgoutSchar(jenv, jarr1, arg1, jarg1); - { - jint jvalue = (jint)temp4; - (*jenv)->SetIntArrayRegion(jenv, jarg4, 0, 1, &jvalue); - } - free(arg1); - - - - free(result); - return jresult; -} - - SWIGEXPORT jint JNICALL Java_com_google_webp_libwebpJNI_WebPGetDecoderVersion(JNIEnv *jenv, jclass jcls) { jint jresult = 0 ; int result; @@ -1448,6 +1236,218 @@ SWIGEXPORT jbyteArray JNICALL Java_com_google_webp_libwebpJNI_WebPDecodeBGRA(JNI } +SWIGEXPORT jint JNICALL Java_com_google_webp_libwebpJNI_WebPGetEncoderVersion(JNIEnv *jenv, jclass jcls) { + jint jresult = 0 ; + int result; + + (void)jenv; + (void)jcls; + result = (int)WebPGetEncoderVersion(); + jresult = (jint)result; + return jresult; +} + + +SWIGEXPORT jbyteArray JNICALL Java_com_google_webp_libwebpJNI_wrap_1WebPEncodeRGB(JNIEnv *jenv, jclass jcls, jbyteArray jarg1, jint jarg2, jint jarg3, jintArray jarg4, jint jarg5, jint jarg6, jint jarg7, jfloat jarg8) { + jbyteArray jresult = 0 ; + uint8_t *arg1 = (uint8_t *) 0 ; + int *arg2 = (int *) 0 ; + int *arg3 = (int *) 0 ; + int *arg4 = (int *) 0 ; + int arg5 ; + int arg6 ; + int arg7 ; + float arg8 ; + jbyte *jarr1 ; + int temp4 ; + uint8_t *result = 0 ; + + (void)jenv; + (void)jcls; + if (!SWIG_JavaArrayInSchar(jenv, &jarr1, &arg1, jarg1)) return 0; + arg2 = (int *)&jarg2; + arg3 = (int *)&jarg3; + { + if (!jarg4) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array null"); + return 0; + } + if ((*jenv)->GetArrayLength(jenv, jarg4) == 0) { + SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, "Array must contain at least 1 element"); + return 0; + } + arg4 = &temp4; + } + arg5 = (int)jarg5; + arg6 = (int)jarg6; + arg7 = (int)jarg7; + arg8 = (float)jarg8; + result = (uint8_t *)wrap_WebPEncodeRGB((uint8_t const *)arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8); + jresult = SWIG_JavaArrayOutSchar(jenv, result, FillMeInAsSizeCannotBeDeterminedAutomatically); + SWIG_JavaArrayArgoutSchar(jenv, jarr1, arg1, jarg1); + { + jint jvalue = (jint)temp4; + (*jenv)->SetIntArrayRegion(jenv, jarg4, 0, 1, &jvalue); + } + free(arg1); + + + + free(result); + return jresult; +} + + +SWIGEXPORT jbyteArray JNICALL Java_com_google_webp_libwebpJNI_wrap_1WebPEncodeBGR(JNIEnv *jenv, jclass jcls, jbyteArray jarg1, jint jarg2, jint jarg3, jintArray jarg4, jint jarg5, jint jarg6, jint jarg7, jfloat jarg8) { + jbyteArray jresult = 0 ; + uint8_t *arg1 = (uint8_t *) 0 ; + int *arg2 = (int *) 0 ; + int *arg3 = (int *) 0 ; + int *arg4 = (int *) 0 ; + int arg5 ; + int arg6 ; + int arg7 ; + float arg8 ; + jbyte *jarr1 ; + int temp4 ; + uint8_t *result = 0 ; + + (void)jenv; + (void)jcls; + if (!SWIG_JavaArrayInSchar(jenv, &jarr1, &arg1, jarg1)) return 0; + arg2 = (int *)&jarg2; + arg3 = (int *)&jarg3; + { + if (!jarg4) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array null"); + return 0; + } + if ((*jenv)->GetArrayLength(jenv, jarg4) == 0) { + SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, "Array must contain at least 1 element"); + return 0; + } + arg4 = &temp4; + } + arg5 = (int)jarg5; + arg6 = (int)jarg6; + arg7 = (int)jarg7; + arg8 = (float)jarg8; + result = (uint8_t *)wrap_WebPEncodeBGR((uint8_t const *)arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8); + jresult = SWIG_JavaArrayOutSchar(jenv, result, FillMeInAsSizeCannotBeDeterminedAutomatically); + SWIG_JavaArrayArgoutSchar(jenv, jarr1, arg1, jarg1); + { + jint jvalue = (jint)temp4; + (*jenv)->SetIntArrayRegion(jenv, jarg4, 0, 1, &jvalue); + } + free(arg1); + + + + free(result); + return jresult; +} + + +SWIGEXPORT jbyteArray JNICALL Java_com_google_webp_libwebpJNI_wrap_1WebPEncodeRGBA(JNIEnv *jenv, jclass jcls, jbyteArray jarg1, jint jarg2, jint jarg3, jintArray jarg4, jint jarg5, jint jarg6, jint jarg7, jfloat jarg8) { + jbyteArray jresult = 0 ; + uint8_t *arg1 = (uint8_t *) 0 ; + int *arg2 = (int *) 0 ; + int *arg3 = (int *) 0 ; + int *arg4 = (int *) 0 ; + int arg5 ; + int arg6 ; + int arg7 ; + float arg8 ; + jbyte *jarr1 ; + int temp4 ; + uint8_t *result = 0 ; + + (void)jenv; + (void)jcls; + if (!SWIG_JavaArrayInSchar(jenv, &jarr1, &arg1, jarg1)) return 0; + arg2 = (int *)&jarg2; + arg3 = (int *)&jarg3; + { + if (!jarg4) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array null"); + return 0; + } + if ((*jenv)->GetArrayLength(jenv, jarg4) == 0) { + SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, "Array must contain at least 1 element"); + return 0; + } + arg4 = &temp4; + } + arg5 = (int)jarg5; + arg6 = (int)jarg6; + arg7 = (int)jarg7; + arg8 = (float)jarg8; + result = (uint8_t *)wrap_WebPEncodeRGBA((uint8_t const *)arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8); + jresult = SWIG_JavaArrayOutSchar(jenv, result, FillMeInAsSizeCannotBeDeterminedAutomatically); + SWIG_JavaArrayArgoutSchar(jenv, jarr1, arg1, jarg1); + { + jint jvalue = (jint)temp4; + (*jenv)->SetIntArrayRegion(jenv, jarg4, 0, 1, &jvalue); + } + free(arg1); + + + + free(result); + return jresult; +} + + +SWIGEXPORT jbyteArray JNICALL Java_com_google_webp_libwebpJNI_wrap_1WebPEncodeBGRA(JNIEnv *jenv, jclass jcls, jbyteArray jarg1, jint jarg2, jint jarg3, jintArray jarg4, jint jarg5, jint jarg6, jint jarg7, jfloat jarg8) { + jbyteArray jresult = 0 ; + uint8_t *arg1 = (uint8_t *) 0 ; + int *arg2 = (int *) 0 ; + int *arg3 = (int *) 0 ; + int *arg4 = (int *) 0 ; + int arg5 ; + int arg6 ; + int arg7 ; + float arg8 ; + jbyte *jarr1 ; + int temp4 ; + uint8_t *result = 0 ; + + (void)jenv; + (void)jcls; + if (!SWIG_JavaArrayInSchar(jenv, &jarr1, &arg1, jarg1)) return 0; + arg2 = (int *)&jarg2; + arg3 = (int *)&jarg3; + { + if (!jarg4) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array null"); + return 0; + } + if ((*jenv)->GetArrayLength(jenv, jarg4) == 0) { + SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, "Array must contain at least 1 element"); + return 0; + } + arg4 = &temp4; + } + arg5 = (int)jarg5; + arg6 = (int)jarg6; + arg7 = (int)jarg7; + arg8 = (float)jarg8; + result = (uint8_t *)wrap_WebPEncodeBGRA((uint8_t const *)arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8); + jresult = SWIG_JavaArrayOutSchar(jenv, result, FillMeInAsSizeCannotBeDeterminedAutomatically); + SWIG_JavaArrayArgoutSchar(jenv, jarr1, arg1, jarg1); + { + jint jvalue = (jint)temp4; + (*jenv)->SetIntArrayRegion(jenv, jarg4, 0, 1, &jvalue); + } + free(arg1); + + + + free(result); + return jresult; +} + + #ifdef __cplusplus } #endif