From 4972302d24ebada7244139d20a3944a1a77f41ee Mon Sep 17 00:00:00 2001 From: James Zern Date: Tue, 17 Jul 2012 13:42:15 -0700 Subject: [PATCH] swig: add WebPEncodeLossless* wrappers Change-Id: If373a5d2953ec53b856900666422fb2b4f9939a4 --- swig/libwebp.i | 103 +++++++++++---- swig/libwebp.jar | Bin 1942 -> 2143 bytes swig/libwebp_java_wrap.c | 263 +++++++++++++++++++++++++++++++++++---- 3 files changed, 318 insertions(+), 48 deletions(-) diff --git a/swig/libwebp.i b/swig/libwebp.i index d32e168a..b2014e16 100644 --- a/swig/libwebp.i +++ b/swig/libwebp.i @@ -90,6 +90,10 @@ static jint returned_buffer_size( { "Java_com_google_webp_libwebpJNI_wrap_1WebPEncodeBGR", 1 }, { "Java_com_google_webp_libwebpJNI_wrap_1WebPEncodeRGBA", 1 }, { "Java_com_google_webp_libwebpJNI_wrap_1WebPEncodeBGRA", 1 }, + { "Java_com_google_webp_libwebpJNI_wrap_1WebPEncodeLosslessRGB", 1 }, + { "Java_com_google_webp_libwebpJNI_wrap_1WebPEncodeLosslessBGR", 1 }, + { "Java_com_google_webp_libwebpJNI_wrap_1WebPEncodeLosslessRGBA", 1 }, + { "Java_com_google_webp_libwebpJNI_wrap_1WebPEncodeLosslessBGRA", 1 }, { NULL, 0 } }; const struct sizemap *p; @@ -108,6 +112,9 @@ static jint returned_buffer_size( typedef size_t (*WebPEncodeFunction)(const uint8_t* rgb, int width, int height, int stride, float quality_factor, uint8_t** output); +typedef size_t (*WebPEncodeLosslessFunction)(const uint8_t* rgb, + int width, int height, int stride, + uint8_t** output); static uint8_t* encode(const uint8_t* rgb, int width, int height, int stride, @@ -123,6 +130,19 @@ static uint8_t* encode(const uint8_t* rgb, *unused = 1; return image_size ? output : NULL; } + +static uint8_t* encode_lossless(const uint8_t* rgb, + int width, int height, int stride, + WebPEncodeLosslessFunction encfn, + int* output_size, int* unused) { + uint8_t *output = NULL; + const size_t image_size = encfn(rgb, width, height, stride, &output); + // the values of following two will be interpreted by returned_buffer_size() + // as 'width' and 'height' in the size calculation. + *output_size = image_size; + *unused = 1; + return image_size ? output : NULL; +} %} //------------------------------------------------------------------------------ @@ -137,6 +157,10 @@ static uint8_t* encode(const uint8_t* rgb, %newobject wrap_WebPEncodeBGR; %newobject wrap_WebPEncodeRGBA; %newobject wrap_WebPEncodeBGRA; +%newobject wrap_WebPEncodeLosslessRGB; +%newobject wrap_WebPEncodeLosslessBGR; +%newobject wrap_WebPEncodeLosslessRGBA; +%newobject wrap_WebPEncodeLosslessBGRA; #ifdef SWIGJAVA // There's no reason to call these directly @@ -144,6 +168,10 @@ static uint8_t* encode(const uint8_t* rgb, %javamethodmodifiers wrap_WebPEncodeBGR "private"; %javamethodmodifiers wrap_WebPEncodeRGBA "private"; %javamethodmodifiers wrap_WebPEncodeBGRA "private"; +%javamethodmodifiers wrap_WebPEncodeLosslessRGB "private"; +%javamethodmodifiers wrap_WebPEncodeLosslessBGR "private"; +%javamethodmodifiers wrap_WebPEncodeLosslessRGBA "private"; +%javamethodmodifiers wrap_WebPEncodeLosslessBGRA "private"; #endif /* SWIGJAVA */ %inline %{ @@ -152,33 +180,36 @@ static uint8_t* encode(const uint8_t* rgb, // than dealing with the return pointer. // The additional parameters are to allow reuse of returned_buffer_size(), // unused2 and output_size will be used in this case. -static uint8_t* wrap_WebPEncodeRGB( - const uint8_t* rgb, int* unused1, int* unused2, int* output_size, - int width, int height, int stride, float quality_factor) { - return encode(rgb, width, height, stride, quality_factor, - WebPEncodeRGB, output_size, unused2); -} +#define LOSSY_WRAPPER(FUNC) \ + static uint8_t* wrap_##FUNC( \ + const uint8_t* rgb, int* unused1, int* unused2, int* output_size, \ + int width, int height, int stride, float quality_factor) { \ + return encode(rgb, width, height, stride, quality_factor, \ + FUNC, output_size, unused2); \ + } \ -static uint8_t* wrap_WebPEncodeBGR( - const uint8_t* bgr, int* unused1, int* unused2, int* output_size, - int width, int height, int stride, float quality_factor) { - return encode(bgr, width, height, stride, quality_factor, - WebPEncodeBGR, output_size, unused2); -} +LOSSY_WRAPPER(WebPEncodeRGB) +LOSSY_WRAPPER(WebPEncodeBGR) +LOSSY_WRAPPER(WebPEncodeRGBA) +LOSSY_WRAPPER(WebPEncodeBGRA) -static uint8_t* wrap_WebPEncodeRGBA( - const uint8_t* rgba, int* unused1, int* unused2, int* output_size, - int width, int height, int stride, float quality_factor) { - return encode(rgba, width, height, stride, quality_factor, - WebPEncodeRGBA, output_size, unused2); -} +#undef LOSSY_WRAPPER + +#define LOSSLESS_WRAPPER(FUNC) \ + static uint8_t* wrap_##FUNC( \ + const uint8_t* rgb, int* unused1, int* unused2, int* output_size, \ + int width, int height, int stride) { \ + return encode_lossless(rgb, width, height, stride, \ + FUNC, output_size, unused2); \ + } \ + +LOSSLESS_WRAPPER(WebPEncodeLosslessRGB) +LOSSLESS_WRAPPER(WebPEncodeLosslessBGR) +LOSSLESS_WRAPPER(WebPEncodeLosslessRGBA) +LOSSLESS_WRAPPER(WebPEncodeLosslessBGRA) + +#undef LOSSLESS_WRAPPER -static uint8_t* wrap_WebPEncodeBGRA( - const uint8_t* bgra, int* unused1, int* unused2, int* output_size, - int width, int height, int stride, float quality_factor) { - return encode(bgra, width, height, stride, quality_factor, - WebPEncodeBGRA, output_size, unused2); -} %} //------------------------------------------------------------------------------ @@ -226,5 +257,29 @@ static uint8_t* wrap_WebPEncodeBGRA( return wrap_WebPEncodeBGRA( bgra, UNUSED, UNUSED, outputSize, width, height, stride, quality_factor); } + + public static byte[] WebPEncodeLosslessRGB( + byte[] rgb, int width, int height, int stride) { + return wrap_WebPEncodeLosslessRGB( + rgb, UNUSED, UNUSED, outputSize, width, height, stride); + } + + public static byte[] WebPEncodeLosslessBGR( + byte[] bgr, int width, int height, int stride) { + return wrap_WebPEncodeLosslessBGR( + bgr, UNUSED, UNUSED, outputSize, width, height, stride); + } + + public static byte[] WebPEncodeLosslessRGBA( + byte[] rgba, int width, int height, int stride) { + return wrap_WebPEncodeLosslessRGBA( + rgba, UNUSED, UNUSED, outputSize, width, height, stride); + } + + public static byte[] WebPEncodeLosslessBGRA( + byte[] bgra, int width, int height, int stride) { + return wrap_WebPEncodeLosslessBGRA( + bgra, UNUSED, UNUSED, outputSize, width, height, stride); + } %} #endif /* SWIGJAVA */ diff --git a/swig/libwebp.jar b/swig/libwebp.jar index 7daea5e10f4644d0015319ec37e85db71b8e64d3..602f037ce69ec88363f3f4f95526f880da7c8b3d 100644 GIT binary patch delta 1414 zcmbQne_wz%z?+#xgnel)MQsi{rV|4gM=ML+Wsp_OR6OrD|iYB z-dv>E(6DKTN)DT$LgNOPrIRd@Rv0*^PSjdgqo5z7w?yYO`-g=(=V$sfn)pmw`Ahxo z^Z&oTynOf4zP|n+n?YZ#q~np)H4j)%Yn}F<#&TNfwAE?tX}r@^POF_3^X^KWo!Xu{ zJ@tGq!zClnNvV_TQ@d4fe%uSZhKSk~P3DYH;u%5ROZTjkl<2*b;`aDf_1sN7OOv%&!5 z&zk24O}6ftzUZR2Y~bPl^77I5cBCvQ`;wH_ee3DWt#d_;kN=ig5N+d{LexkAntIT<;$4Yce>^;oXutCACNQam9j!rqoHPT~8I|G-ssE zOq`ke@~AB5T+6>2MGIcDvzi{VR8Gs|)SY7+bRvU&;?_3{XK7zHi<%KGR4AqEAkK7w zq27L1A-7Of&$ZkWb2|V1UfG|e_;z`i`Cip3YbSe!+NbA5n3wo1-prY&cYO<6uib&V zwzl(4m!18hgfHLZX18syz9RfiX}9l|?UUw)oj;WKU+G3|3V-x1*+qN1-zZNjTb}V= zt@_BNcS3LXrpRyIV&3(wZc~5k_O`sjz_!fp7Z+yKpHnos#Jr`2>EMR*?}~rSnY+&T z#G@aHi_~5P`YM^aT}iR^5?txIXxXbkxrwvXy7=~a@*Z&If3SDKxd);%k00^5o;J%> z&FhR$?lRXDvCf%m&u;1RnNwEMmll!AmdX2r!KD4oxBLulmfhBw#kXBGJTFYPy1*-V zOZi2n>{3(s@0msYJ5I+wMPmfHylwwXU?X2Qvdh z1SbOnO6GH5KmrOtc5;5M{$y_!nflU6XZ;R2h_t@{u==UI3#-dT(Onxlvy+2DJUAVj z*~DXKZ0lRHq{M^!Q_MP_m>&#wQ$Chi334y={C)OL@w+**OZL^DO}$yb8Ego&nvrEZM{=J37fvNE-7>NE!pAxs!FWB zxMH@Kf@;Xs%2bvm%dWl3TD9y~(6Q-F>l~N2Ub7E89BZ~jYhlx&zyE(l&viV}P@QUd zbFJ{aH9HEvzTB+O#$~VD{Zgy#@#SaCYj#z*W$q1)T+jCL>eQ_M%6Y!F`Vw`L$1j`B ztjx;&?0G89bcRz^Lh7Mq#YEW2yl9G MEW0sV7aK?f0H*+Q-T(jq delta 1215 zcmcaFFpZx#z?+#xgnMx+U_sBJuPqh(=^uw zqJoXvg0wWWx)SsQrb`3}T=~*`^V(D$&D~3KR6m;kJb0SD)9@cd{gjV$Qk%;*WSUoQ zH-27uex|MQ=hxrA&u0)@uzE*Jwbr}j&Zms0ou{QvbJx+H z`}nlvYO_;9Ul;HCdv2lD%dEo1tHMk9j#`vFyR}Y))0RIhQzXAz?3P+Rm)!sU{Si0w zm@{I2?A~O$yEe61-S_beUiR}!aoa3HudlTDdu=c4i7Da9FBWYrDEzjj#%I-nD$zf0 z3^fa5&Ph(c{8jI|^uN9p)_$ua&9Cde+kb6CmU`OTjCThr@-rlyje69jjurYIW?7d# z;|MQru+C*2W1Y-tJj#)Gt{9x2lw3bES@PhD0|j?2&%C!jS9kbK@xMLs?hEE?Kb3CV zJOBPF*%_tb30s)=Y+QL+sqIArv#o?H({#s`doPNvi0S;te@SNTY!lbTB70f)Hs8z_ znE$ilkyhr3**!{!=098Pna>yCcky$eQnJgX@4uh0G<{*1_@*MS>oQ+?$ix4q^% zPvwrp+DO-*O+O-xOnuJ2nCz=+bhg~^>*-~@M!F@2?z|_KJx|$n_o#`+>^Q-)=YNEJ zoj#VCuKE)Y&(0JbFF1YuC9ao?%7x$mV+`yRzpp#B}W!GHh1g!M7swCMFly|J3Y0NTmC@1(L71D zq|{00%!~j1kGb^o*S{Yu1zpS9RHP!`q!%8TVELITzwF$E99dq;An}L7=^C-sjPK8@ z^Yy>WJ-*!IZKL(}Si9X%^eh)C_Q&lpn2=eo=IpmJ?SqU_hVJUSn|)4;1UY(~UgNmk z_gehLMbU=Kq&7Av{;mIX`>x{|hw^08o1p^p*KF!|^K!Ak^sY5wOWvuOF26dF`A_*t zxvO78l5Kb8tiRj(`NUIM|36D7y|?6k=Tlw#IVETRt;!`6(lT~Dbdhg;c;fl4316r7 zF4XDSmCs(U{P&n-ae14w%8Sk;S{K|!9p1YvSDPq!`S|;U{E~zdm*!18D6=}5dA7(J zXJSiU$QVr%j#c3TCI5VDa9V9hW>lV$Q9 PcFD;O9FlAYSwVsTRX!zt diff --git a/swig/libwebp_java_wrap.c b/swig/libwebp_java_wrap.c index deeba0bc..f2ea1b50 100644 --- a/swig/libwebp_java_wrap.c +++ b/swig/libwebp_java_wrap.c @@ -829,6 +829,10 @@ static jint returned_buffer_size( { "Java_com_google_webp_libwebpJNI_wrap_1WebPEncodeBGR", 1 }, { "Java_com_google_webp_libwebpJNI_wrap_1WebPEncodeRGBA", 1 }, { "Java_com_google_webp_libwebpJNI_wrap_1WebPEncodeBGRA", 1 }, + { "Java_com_google_webp_libwebpJNI_wrap_1WebPEncodeLosslessRGB", 1 }, + { "Java_com_google_webp_libwebpJNI_wrap_1WebPEncodeLosslessBGR", 1 }, + { "Java_com_google_webp_libwebpJNI_wrap_1WebPEncodeLosslessRGBA", 1 }, + { "Java_com_google_webp_libwebpJNI_wrap_1WebPEncodeLosslessBGRA", 1 }, { NULL, 0 } }; const struct sizemap *p; @@ -847,6 +851,9 @@ static jint returned_buffer_size( typedef size_t (*WebPEncodeFunction)(const uint8_t* rgb, int width, int height, int stride, float quality_factor, uint8_t** output); +typedef size_t (*WebPEncodeLosslessFunction)(const uint8_t* rgb, + int width, int height, int stride, + uint8_t** output); static uint8_t* encode(const uint8_t* rgb, int width, int height, int stride, @@ -863,39 +870,55 @@ static uint8_t* encode(const uint8_t* rgb, return image_size ? output : NULL; } +static uint8_t* encode_lossless(const uint8_t* rgb, + int width, int height, int stride, + WebPEncodeLosslessFunction encfn, + int* output_size, int* unused) { + uint8_t *output = NULL; + const size_t image_size = encfn(rgb, width, height, stride, &output); + // the values of following two will be interpreted by returned_buffer_size() + // as 'width' and 'height' in the size calculation. + *output_size = image_size; + *unused = 1; + return image_size ? output : NULL; +} + // 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 // than dealing with the return pointer. // The additional parameters are to allow reuse of returned_buffer_size(), // unused2 and output_size will be used in this case. -static uint8_t* wrap_WebPEncodeRGB( - const uint8_t* rgb, int* unused1, int* unused2, int* output_size, - int width, int height, int stride, float quality_factor) { - return encode(rgb, width, height, stride, quality_factor, - WebPEncodeRGB, output_size, unused2); -} +#define LOSSY_WRAPPER(FUNC) \ + static uint8_t* wrap_##FUNC( \ + const uint8_t* rgb, int* unused1, int* unused2, int* output_size, \ + int width, int height, int stride, float quality_factor) { \ + return encode(rgb, width, height, stride, quality_factor, \ + FUNC, output_size, unused2); \ + } \ -static uint8_t* wrap_WebPEncodeBGR( - const uint8_t* bgr, int* unused1, int* unused2, int* output_size, - int width, int height, int stride, float quality_factor) { - return encode(bgr, width, height, stride, quality_factor, - WebPEncodeBGR, output_size, unused2); -} +LOSSY_WRAPPER(WebPEncodeRGB) +LOSSY_WRAPPER(WebPEncodeBGR) +LOSSY_WRAPPER(WebPEncodeRGBA) +LOSSY_WRAPPER(WebPEncodeBGRA) -static uint8_t* wrap_WebPEncodeRGBA( - const uint8_t* rgba, int* unused1, int* unused2, int* output_size, - int width, int height, int stride, float quality_factor) { - return encode(rgba, width, height, stride, quality_factor, - WebPEncodeRGBA, output_size, unused2); -} +#undef LOSSY_WRAPPER + +#define LOSSLESS_WRAPPER(FUNC) \ + static uint8_t* wrap_##FUNC( \ + const uint8_t* rgb, int* unused1, int* unused2, int* output_size, \ + int width, int height, int stride) { \ + return encode_lossless(rgb, width, height, stride, \ + FUNC, output_size, unused2); \ + } \ + +LOSSLESS_WRAPPER(WebPEncodeLosslessRGB) +LOSSLESS_WRAPPER(WebPEncodeLosslessBGR) +LOSSLESS_WRAPPER(WebPEncodeLosslessRGBA) +LOSSLESS_WRAPPER(WebPEncodeLosslessBGRA) + +#undef LOSSLESS_WRAPPER -static uint8_t* wrap_WebPEncodeBGRA( - const uint8_t* bgra, int* unused1, int* unused2, int* output_size, - int width, int height, int stride, float quality_factor) { - return encode(bgra, width, height, stride, quality_factor, - WebPEncodeBGRA, output_size, unused2); -} /* Work around broken gcj jni.h */ @@ -1470,6 +1493,198 @@ SWIGEXPORT jbyteArray JNICALL Java_com_google_webp_libwebpJNI_wrap_1WebPEncodeBG } +SWIGEXPORT jbyteArray JNICALL Java_com_google_webp_libwebpJNI_wrap_1WebPEncodeLosslessRGB(JNIEnv *jenv, jclass jcls, jbyteArray jarg1, jint jarg2, jint jarg3, jintArray jarg4, jint jarg5, jint jarg6, jint jarg7) { + 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 ; + 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; + result = (uint8_t *)wrap_WebPEncodeLosslessRGB((uint8_t const *)arg1,arg2,arg3,arg4,arg5,arg6,arg7); + 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_1WebPEncodeLosslessBGR(JNIEnv *jenv, jclass jcls, jbyteArray jarg1, jint jarg2, jint jarg3, jintArray jarg4, jint jarg5, jint jarg6, jint jarg7) { + 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 ; + 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; + result = (uint8_t *)wrap_WebPEncodeLosslessBGR((uint8_t const *)arg1,arg2,arg3,arg4,arg5,arg6,arg7); + 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_1WebPEncodeLosslessRGBA(JNIEnv *jenv, jclass jcls, jbyteArray jarg1, jint jarg2, jint jarg3, jintArray jarg4, jint jarg5, jint jarg6, jint jarg7) { + 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 ; + 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; + result = (uint8_t *)wrap_WebPEncodeLosslessRGBA((uint8_t const *)arg1,arg2,arg3,arg4,arg5,arg6,arg7); + 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_1WebPEncodeLosslessBGRA(JNIEnv *jenv, jclass jcls, jbyteArray jarg1, jint jarg2, jint jarg3, jintArray jarg4, jint jarg5, jint jarg6, jint jarg7) { + 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 ; + 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; + result = (uint8_t *)wrap_WebPEncodeLosslessBGRA((uint8_t const *)arg1,arg2,arg3,arg4,arg5,arg6,arg7); + 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