swig: add python encode support

wraps the simple interface similar to java.

Change-Id: Ib922bbcae322b2345b6dce5dee08faad705a77fd
(cherry picked from commit 14677e11d4)
This commit is contained in:
James Zern 2013-05-20 13:29:41 -07:00
parent 6b931875ac
commit d573a8d53f
4 changed files with 516 additions and 248 deletions

View File

@ -52,7 +52,28 @@ JAVA_ARRAYS_TYPEMAPS(uint8_t, byte, jbyte, Uint8, "[B")
%apply (char* STRING, size_t LENGTH) { (const uint8_t* data, size_t data_size) } %apply (char* STRING, size_t LENGTH) { (const uint8_t* data, size_t data_size) }
%typemap(out) uint8_t* { %typemap(out) uint8_t* {
$result = PyString_FromStringAndSize( $result = PyString_FromStringAndSize(
(const char*)$1, ReturnedBufferSize("$symname", arg3, arg4)); (const char*)$1,
($1 == NULL) ? 0 : ReturnedBufferSize("$symname", arg3, arg4));
}
%typemap (in) const uint8_t* rgb (Py_buffer rgb_buffer) {
// NB: with Python < 2.6 the old style buffer protocol may be used:
// Py_ssize_t unused;
// PyObject_AsReadBuffer($input, (const void**)(&$1), &unused);
if (!PyObject_CheckBuffer($input)) {
SWIG_exception_fail(SWIG_TypeError,
"in method '$symname', argument $argnum"
" does not support the buffer interface");
}
if (PyObject_GetBuffer($input, &rgb_buffer, PyBUF_SIMPLE)) {
SWIG_exception_fail(SWIG_RuntimeError,
"in method '$symname', unable to get buffer view");
}
$1 = ($1_ltype)rgb_buffer.buf;
}
%typemap(freearg) const uint8_t* rgb {
PyBuffer_Release(&rgb_buffer$argnum);
} }
#endif /* SWIGPYTHON */ #endif /* SWIGPYTHON */
@ -134,6 +155,14 @@ static size_t ReturnedBufferSize(
{ "WebPDecodeARGB", 4 }, { "WebPDecodeARGB", 4 },
{ "WebPDecodeBGR", 3 }, { "WebPDecodeBGR", 3 },
{ "WebPDecodeBGRA", 4 }, { "WebPDecodeBGRA", 4 },
{ "wrap_WebPEncodeRGB", 1 },
{ "wrap_WebPEncodeBGR", 1 },
{ "wrap_WebPEncodeRGBA", 1 },
{ "wrap_WebPEncodeBGRA", 1 },
{ "wrap_WebPEncodeLosslessRGB", 1 },
{ "wrap_WebPEncodeLosslessBGR", 1 },
{ "wrap_WebPEncodeLosslessRGBA", 1 },
{ "wrap_WebPEncodeLosslessBGRA", 1 },
#endif #endif
{ NULL, 0 } { NULL, 0 }
}; };
@ -305,3 +334,39 @@ CALL_ENCODE_LOSSLESS_WRAPPER(WebPEncodeLosslessRGBA)
CALL_ENCODE_LOSSLESS_WRAPPER(WebPEncodeLosslessBGR) CALL_ENCODE_LOSSLESS_WRAPPER(WebPEncodeLosslessBGR)
CALL_ENCODE_LOSSLESS_WRAPPER(WebPEncodeLosslessBGRA) CALL_ENCODE_LOSSLESS_WRAPPER(WebPEncodeLosslessBGRA)
#endif /* SWIGJAVA */ #endif /* SWIGJAVA */
#ifdef SWIGPYTHON
%pythoncode %{
_UNUSED = 1
%}
%define CALL_ENCODE_LOSSY_WRAPPER(func)
%pythoncode %{
def func(rgb, width, height, stride, quality_factor):
webp = wrap_##func(
rgb, _UNUSED, _UNUSED, width, height, stride, quality_factor)
if len(webp[0]) == 0:
return None
return webp[0]
%}
%enddef
%define CALL_ENCODE_LOSSLESS_WRAPPER(func)
%pythoncode %{
def func(rgb, width, height, stride):
webp = wrap_##func(rgb, _UNUSED, _UNUSED, width, height, stride)
if len(webp[0]) == 0:
return None
return webp[0]
%}
%enddef
CALL_ENCODE_LOSSY_WRAPPER(WebPEncodeRGB)
CALL_ENCODE_LOSSY_WRAPPER(WebPEncodeRGBA)
CALL_ENCODE_LOSSY_WRAPPER(WebPEncodeBGR)
CALL_ENCODE_LOSSY_WRAPPER(WebPEncodeBGRA)
CALL_ENCODE_LOSSLESS_WRAPPER(WebPEncodeLosslessRGB)
CALL_ENCODE_LOSSLESS_WRAPPER(WebPEncodeLosslessRGBA)
CALL_ENCODE_LOSSLESS_WRAPPER(WebPEncodeLosslessBGR)
CALL_ENCODE_LOSSLESS_WRAPPER(WebPEncodeLosslessBGRA)
#endif /* SWIGPYTHON */

View File

@ -131,6 +131,60 @@ wrap_WebPEncodeLosslessRGBA = _libwebp.wrap_WebPEncodeLosslessRGBA
def wrap_WebPEncodeLosslessBGRA(*args): def wrap_WebPEncodeLosslessBGRA(*args):
return _libwebp.wrap_WebPEncodeLosslessBGRA(*args) return _libwebp.wrap_WebPEncodeLosslessBGRA(*args)
wrap_WebPEncodeLosslessBGRA = _libwebp.wrap_WebPEncodeLosslessBGRA wrap_WebPEncodeLosslessBGRA = _libwebp.wrap_WebPEncodeLosslessBGRA
_UNUSED = 1
def WebPEncodeRGB(rgb, width, height, stride, quality_factor):
webp = wrap_WebPEncodeRGB(
rgb, _UNUSED, _UNUSED, width, height, stride, quality_factor)
if len(webp[0]) == 0:
return None
return webp[0]
def WebPEncodeRGBA(rgb, width, height, stride, quality_factor):
webp = wrap_WebPEncodeRGBA(
rgb, _UNUSED, _UNUSED, width, height, stride, quality_factor)
if len(webp[0]) == 0:
return None
return webp[0]
def WebPEncodeBGR(rgb, width, height, stride, quality_factor):
webp = wrap_WebPEncodeBGR(
rgb, _UNUSED, _UNUSED, width, height, stride, quality_factor)
if len(webp[0]) == 0:
return None
return webp[0]
def WebPEncodeBGRA(rgb, width, height, stride, quality_factor):
webp = wrap_WebPEncodeBGRA(
rgb, _UNUSED, _UNUSED, width, height, stride, quality_factor)
if len(webp[0]) == 0:
return None
return webp[0]
def WebPEncodeLosslessRGB(rgb, width, height, stride):
webp = wrap_WebPEncodeLosslessRGB(rgb, _UNUSED, _UNUSED, width, height, stride)
if len(webp[0]) == 0:
return None
return webp[0]
def WebPEncodeLosslessRGBA(rgb, width, height, stride):
webp = wrap_WebPEncodeLosslessRGBA(rgb, _UNUSED, _UNUSED, width, height, stride)
if len(webp[0]) == 0:
return None
return webp[0]
def WebPEncodeLosslessBGR(rgb, width, height, stride):
webp = wrap_WebPEncodeLosslessBGR(rgb, _UNUSED, _UNUSED, width, height, stride)
if len(webp[0]) == 0:
return None
return webp[0]
def WebPEncodeLosslessBGRA(rgb, width, height, stride):
webp = wrap_WebPEncodeLosslessBGRA(rgb, _UNUSED, _UNUSED, width, height, stride)
if len(webp[0]) == 0:
return None
return webp[0]
# This file is compatible with both classic and new-style classes. # This file is compatible with both classic and new-style classes.

View File

@ -897,6 +897,14 @@ static size_t ReturnedBufferSize(
{ "WebPDecodeARGB", 4 }, { "WebPDecodeARGB", 4 },
{ "WebPDecodeBGR", 3 }, { "WebPDecodeBGR", 3 },
{ "WebPDecodeBGRA", 4 }, { "WebPDecodeBGRA", 4 },
{ "wrap_WebPEncodeRGB", 1 },
{ "wrap_WebPEncodeBGR", 1 },
{ "wrap_WebPEncodeRGBA", 1 },
{ "wrap_WebPEncodeBGRA", 1 },
{ "wrap_WebPEncodeLosslessRGB", 1 },
{ "wrap_WebPEncodeLosslessBGR", 1 },
{ "wrap_WebPEncodeLosslessRGBA", 1 },
{ "wrap_WebPEncodeLosslessBGRA", 1 },
#endif #endif
{ NULL, 0 } { NULL, 0 }
}; };

View File

@ -3218,6 +3218,14 @@ static size_t ReturnedBufferSize(
{ "WebPDecodeARGB", 4 }, { "WebPDecodeARGB", 4 },
{ "WebPDecodeBGR", 3 }, { "WebPDecodeBGR", 3 },
{ "WebPDecodeBGRA", 4 }, { "WebPDecodeBGRA", 4 },
{ "wrap_WebPEncodeRGB", 1 },
{ "wrap_WebPEncodeBGR", 1 },
{ "wrap_WebPEncodeRGBA", 1 },
{ "wrap_WebPEncodeBGRA", 1 },
{ "wrap_WebPEncodeLosslessRGB", 1 },
{ "wrap_WebPEncodeLosslessBGR", 1 },
{ "wrap_WebPEncodeLosslessRGBA", 1 },
{ "wrap_WebPEncodeLosslessBGRA", 1 },
#endif #endif
{ NULL, 0 } { NULL, 0 }
}; };
@ -3481,7 +3489,8 @@ SWIGINTERN PyObject *_wrap_WebPDecodeRGB(PyObject *SWIGUNUSEDPARM(self), PyObjec
result = (uint8_t *)WebPDecodeRGB((uint8_t const *)arg1,arg2,arg3,arg4); result = (uint8_t *)WebPDecodeRGB((uint8_t const *)arg1,arg2,arg3,arg4);
{ {
resultobj = PyString_FromStringAndSize( resultobj = PyString_FromStringAndSize(
(const char*)result, ReturnedBufferSize("WebPDecodeRGB", arg3, arg4)); (const char*)result,
(result == NULL) ? 0 : ReturnedBufferSize("WebPDecodeRGB", arg3, arg4));
} }
if (SWIG_IsTmpObj(res3)) { if (SWIG_IsTmpObj(res3)) {
resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg3))); resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg3)));
@ -3533,7 +3542,8 @@ SWIGINTERN PyObject *_wrap_WebPDecodeRGBA(PyObject *SWIGUNUSEDPARM(self), PyObje
result = (uint8_t *)WebPDecodeRGBA((uint8_t const *)arg1,arg2,arg3,arg4); result = (uint8_t *)WebPDecodeRGBA((uint8_t const *)arg1,arg2,arg3,arg4);
{ {
resultobj = PyString_FromStringAndSize( resultobj = PyString_FromStringAndSize(
(const char*)result, ReturnedBufferSize("WebPDecodeRGBA", arg3, arg4)); (const char*)result,
(result == NULL) ? 0 : ReturnedBufferSize("WebPDecodeRGBA", arg3, arg4));
} }
if (SWIG_IsTmpObj(res3)) { if (SWIG_IsTmpObj(res3)) {
resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg3))); resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg3)));
@ -3585,7 +3595,8 @@ SWIGINTERN PyObject *_wrap_WebPDecodeARGB(PyObject *SWIGUNUSEDPARM(self), PyObje
result = (uint8_t *)WebPDecodeARGB((uint8_t const *)arg1,arg2,arg3,arg4); result = (uint8_t *)WebPDecodeARGB((uint8_t const *)arg1,arg2,arg3,arg4);
{ {
resultobj = PyString_FromStringAndSize( resultobj = PyString_FromStringAndSize(
(const char*)result, ReturnedBufferSize("WebPDecodeARGB", arg3, arg4)); (const char*)result,
(result == NULL) ? 0 : ReturnedBufferSize("WebPDecodeARGB", arg3, arg4));
} }
if (SWIG_IsTmpObj(res3)) { if (SWIG_IsTmpObj(res3)) {
resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg3))); resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg3)));
@ -3637,7 +3648,8 @@ SWIGINTERN PyObject *_wrap_WebPDecodeBGR(PyObject *SWIGUNUSEDPARM(self), PyObjec
result = (uint8_t *)WebPDecodeBGR((uint8_t const *)arg1,arg2,arg3,arg4); result = (uint8_t *)WebPDecodeBGR((uint8_t const *)arg1,arg2,arg3,arg4);
{ {
resultobj = PyString_FromStringAndSize( resultobj = PyString_FromStringAndSize(
(const char*)result, ReturnedBufferSize("WebPDecodeBGR", arg3, arg4)); (const char*)result,
(result == NULL) ? 0 : ReturnedBufferSize("WebPDecodeBGR", arg3, arg4));
} }
if (SWIG_IsTmpObj(res3)) { if (SWIG_IsTmpObj(res3)) {
resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg3))); resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg3)));
@ -3689,7 +3701,8 @@ SWIGINTERN PyObject *_wrap_WebPDecodeBGRA(PyObject *SWIGUNUSEDPARM(self), PyObje
result = (uint8_t *)WebPDecodeBGRA((uint8_t const *)arg1,arg2,arg3,arg4); result = (uint8_t *)WebPDecodeBGRA((uint8_t const *)arg1,arg2,arg3,arg4);
{ {
resultobj = PyString_FromStringAndSize( resultobj = PyString_FromStringAndSize(
(const char*)result, ReturnedBufferSize("WebPDecodeBGRA", arg3, arg4)); (const char*)result,
(result == NULL) ? 0 : ReturnedBufferSize("WebPDecodeBGRA", arg3, arg4));
} }
if (SWIG_IsTmpObj(res3)) { if (SWIG_IsTmpObj(res3)) {
resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg3))); resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg3)));
@ -3735,8 +3748,7 @@ SWIGINTERN PyObject *_wrap_wrap_WebPEncodeRGB(PyObject *SWIGUNUSEDPARM(self), Py
int arg6 ; int arg6 ;
int arg7 ; int arg7 ;
float arg8 ; float arg8 ;
void *argp1 = 0 ; Py_buffer rgb_buffer1 ;
int res1 = 0 ;
int temp2 ; int temp2 ;
int res2 = 0 ; int res2 = 0 ;
int temp3 ; int temp3 ;
@ -3762,11 +3774,21 @@ SWIGINTERN PyObject *_wrap_wrap_WebPEncodeRGB(PyObject *SWIGUNUSEDPARM(self), Py
arg4 = &temp4; arg4 = &temp4;
if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:wrap_WebPEncodeRGB",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:wrap_WebPEncodeRGB",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_uint8_t, 0 | 0 ); {
if (!SWIG_IsOK(res1)) { // NB: with Python < 2.6 the old style buffer protocol may be used:
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "wrap_WebPEncodeRGB" "', argument " "1"" of type '" "uint8_t const *""'"); // Py_ssize_t unused;
// PyObject_AsReadBuffer(obj0, (const void**)(&arg1), &unused);
if (!PyObject_CheckBuffer(obj0)) {
SWIG_exception_fail(SWIG_TypeError,
"in method 'wrap_WebPEncodeRGB', argument 1"
" does not support the buffer interface");
}
if (PyObject_GetBuffer(obj0, &rgb_buffer1, PyBUF_SIMPLE)) {
SWIG_exception_fail(SWIG_RuntimeError,
"in method 'wrap_WebPEncodeRGB', unable to get buffer view");
}
arg1 = (uint8_t *)rgb_buffer1.buf;
} }
arg1 = (uint8_t *)(argp1);
if (!(SWIG_IsOK((res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2),SWIGTYPE_p_int,0))))) { if (!(SWIG_IsOK((res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2),SWIGTYPE_p_int,0))))) {
int val; int val;
int ecode = SWIG_AsVal_int(obj1, &val); int ecode = SWIG_AsVal_int(obj1, &val);
@ -3810,7 +3832,8 @@ SWIGINTERN PyObject *_wrap_wrap_WebPEncodeRGB(PyObject *SWIGUNUSEDPARM(self), Py
result = (uint8_t *)wrap_WebPEncodeRGB((uint8_t const *)arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8); result = (uint8_t *)wrap_WebPEncodeRGB((uint8_t const *)arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8);
{ {
resultobj = PyString_FromStringAndSize( resultobj = PyString_FromStringAndSize(
(const char*)result, ReturnedBufferSize("wrap_WebPEncodeRGB", arg3, arg4)); (const char*)result,
(result == NULL) ? 0 : ReturnedBufferSize("wrap_WebPEncodeRGB", arg3, arg4));
} }
if (SWIG_IsTmpObj(res4)) { if (SWIG_IsTmpObj(res4)) {
resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg4))); resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg4)));
@ -3818,11 +3841,17 @@ SWIGINTERN PyObject *_wrap_wrap_WebPEncodeRGB(PyObject *SWIGUNUSEDPARM(self), Py
int new_flags = SWIG_IsNewObj(res4) ? (SWIG_POINTER_OWN | 0 ) : 0 ; int new_flags = SWIG_IsNewObj(res4) ? (SWIG_POINTER_OWN | 0 ) : 0 ;
resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg4), SWIGTYPE_p_int, new_flags)); resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg4), SWIGTYPE_p_int, new_flags));
} }
{
PyBuffer_Release(&rgb_buffer1);
}
if (SWIG_IsNewObj(res2)) free((char*)arg2); if (SWIG_IsNewObj(res2)) free((char*)arg2);
if (SWIG_IsNewObj(res3)) free((char*)arg3); if (SWIG_IsNewObj(res3)) free((char*)arg3);
free(result); free(result);
return resultobj; return resultobj;
fail: fail:
{
PyBuffer_Release(&rgb_buffer1);
}
if (SWIG_IsNewObj(res2)) free((char*)arg2); if (SWIG_IsNewObj(res2)) free((char*)arg2);
if (SWIG_IsNewObj(res3)) free((char*)arg3); if (SWIG_IsNewObj(res3)) free((char*)arg3);
return NULL; return NULL;
@ -3839,8 +3868,7 @@ SWIGINTERN PyObject *_wrap_wrap_WebPEncodeBGR(PyObject *SWIGUNUSEDPARM(self), Py
int arg6 ; int arg6 ;
int arg7 ; int arg7 ;
float arg8 ; float arg8 ;
void *argp1 = 0 ; Py_buffer rgb_buffer1 ;
int res1 = 0 ;
int temp2 ; int temp2 ;
int res2 = 0 ; int res2 = 0 ;
int temp3 ; int temp3 ;
@ -3866,11 +3894,21 @@ SWIGINTERN PyObject *_wrap_wrap_WebPEncodeBGR(PyObject *SWIGUNUSEDPARM(self), Py
arg4 = &temp4; arg4 = &temp4;
if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:wrap_WebPEncodeBGR",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:wrap_WebPEncodeBGR",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_uint8_t, 0 | 0 ); {
if (!SWIG_IsOK(res1)) { // NB: with Python < 2.6 the old style buffer protocol may be used:
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "wrap_WebPEncodeBGR" "', argument " "1"" of type '" "uint8_t const *""'"); // Py_ssize_t unused;
// PyObject_AsReadBuffer(obj0, (const void**)(&arg1), &unused);
if (!PyObject_CheckBuffer(obj0)) {
SWIG_exception_fail(SWIG_TypeError,
"in method 'wrap_WebPEncodeBGR', argument 1"
" does not support the buffer interface");
}
if (PyObject_GetBuffer(obj0, &rgb_buffer1, PyBUF_SIMPLE)) {
SWIG_exception_fail(SWIG_RuntimeError,
"in method 'wrap_WebPEncodeBGR', unable to get buffer view");
}
arg1 = (uint8_t *)rgb_buffer1.buf;
} }
arg1 = (uint8_t *)(argp1);
if (!(SWIG_IsOK((res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2),SWIGTYPE_p_int,0))))) { if (!(SWIG_IsOK((res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2),SWIGTYPE_p_int,0))))) {
int val; int val;
int ecode = SWIG_AsVal_int(obj1, &val); int ecode = SWIG_AsVal_int(obj1, &val);
@ -3914,7 +3952,8 @@ SWIGINTERN PyObject *_wrap_wrap_WebPEncodeBGR(PyObject *SWIGUNUSEDPARM(self), Py
result = (uint8_t *)wrap_WebPEncodeBGR((uint8_t const *)arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8); result = (uint8_t *)wrap_WebPEncodeBGR((uint8_t const *)arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8);
{ {
resultobj = PyString_FromStringAndSize( resultobj = PyString_FromStringAndSize(
(const char*)result, ReturnedBufferSize("wrap_WebPEncodeBGR", arg3, arg4)); (const char*)result,
(result == NULL) ? 0 : ReturnedBufferSize("wrap_WebPEncodeBGR", arg3, arg4));
} }
if (SWIG_IsTmpObj(res4)) { if (SWIG_IsTmpObj(res4)) {
resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg4))); resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg4)));
@ -3922,11 +3961,17 @@ SWIGINTERN PyObject *_wrap_wrap_WebPEncodeBGR(PyObject *SWIGUNUSEDPARM(self), Py
int new_flags = SWIG_IsNewObj(res4) ? (SWIG_POINTER_OWN | 0 ) : 0 ; int new_flags = SWIG_IsNewObj(res4) ? (SWIG_POINTER_OWN | 0 ) : 0 ;
resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg4), SWIGTYPE_p_int, new_flags)); resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg4), SWIGTYPE_p_int, new_flags));
} }
{
PyBuffer_Release(&rgb_buffer1);
}
if (SWIG_IsNewObj(res2)) free((char*)arg2); if (SWIG_IsNewObj(res2)) free((char*)arg2);
if (SWIG_IsNewObj(res3)) free((char*)arg3); if (SWIG_IsNewObj(res3)) free((char*)arg3);
free(result); free(result);
return resultobj; return resultobj;
fail: fail:
{
PyBuffer_Release(&rgb_buffer1);
}
if (SWIG_IsNewObj(res2)) free((char*)arg2); if (SWIG_IsNewObj(res2)) free((char*)arg2);
if (SWIG_IsNewObj(res3)) free((char*)arg3); if (SWIG_IsNewObj(res3)) free((char*)arg3);
return NULL; return NULL;
@ -3943,8 +3988,7 @@ SWIGINTERN PyObject *_wrap_wrap_WebPEncodeRGBA(PyObject *SWIGUNUSEDPARM(self), P
int arg6 ; int arg6 ;
int arg7 ; int arg7 ;
float arg8 ; float arg8 ;
void *argp1 = 0 ; Py_buffer rgb_buffer1 ;
int res1 = 0 ;
int temp2 ; int temp2 ;
int res2 = 0 ; int res2 = 0 ;
int temp3 ; int temp3 ;
@ -3970,11 +4014,21 @@ SWIGINTERN PyObject *_wrap_wrap_WebPEncodeRGBA(PyObject *SWIGUNUSEDPARM(self), P
arg4 = &temp4; arg4 = &temp4;
if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:wrap_WebPEncodeRGBA",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:wrap_WebPEncodeRGBA",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_uint8_t, 0 | 0 ); {
if (!SWIG_IsOK(res1)) { // NB: with Python < 2.6 the old style buffer protocol may be used:
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "wrap_WebPEncodeRGBA" "', argument " "1"" of type '" "uint8_t const *""'"); // Py_ssize_t unused;
// PyObject_AsReadBuffer(obj0, (const void**)(&arg1), &unused);
if (!PyObject_CheckBuffer(obj0)) {
SWIG_exception_fail(SWIG_TypeError,
"in method 'wrap_WebPEncodeRGBA', argument 1"
" does not support the buffer interface");
}
if (PyObject_GetBuffer(obj0, &rgb_buffer1, PyBUF_SIMPLE)) {
SWIG_exception_fail(SWIG_RuntimeError,
"in method 'wrap_WebPEncodeRGBA', unable to get buffer view");
}
arg1 = (uint8_t *)rgb_buffer1.buf;
} }
arg1 = (uint8_t *)(argp1);
if (!(SWIG_IsOK((res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2),SWIGTYPE_p_int,0))))) { if (!(SWIG_IsOK((res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2),SWIGTYPE_p_int,0))))) {
int val; int val;
int ecode = SWIG_AsVal_int(obj1, &val); int ecode = SWIG_AsVal_int(obj1, &val);
@ -4018,7 +4072,8 @@ SWIGINTERN PyObject *_wrap_wrap_WebPEncodeRGBA(PyObject *SWIGUNUSEDPARM(self), P
result = (uint8_t *)wrap_WebPEncodeRGBA((uint8_t const *)arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8); result = (uint8_t *)wrap_WebPEncodeRGBA((uint8_t const *)arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8);
{ {
resultobj = PyString_FromStringAndSize( resultobj = PyString_FromStringAndSize(
(const char*)result, ReturnedBufferSize("wrap_WebPEncodeRGBA", arg3, arg4)); (const char*)result,
(result == NULL) ? 0 : ReturnedBufferSize("wrap_WebPEncodeRGBA", arg3, arg4));
} }
if (SWIG_IsTmpObj(res4)) { if (SWIG_IsTmpObj(res4)) {
resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg4))); resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg4)));
@ -4026,11 +4081,17 @@ SWIGINTERN PyObject *_wrap_wrap_WebPEncodeRGBA(PyObject *SWIGUNUSEDPARM(self), P
int new_flags = SWIG_IsNewObj(res4) ? (SWIG_POINTER_OWN | 0 ) : 0 ; int new_flags = SWIG_IsNewObj(res4) ? (SWIG_POINTER_OWN | 0 ) : 0 ;
resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg4), SWIGTYPE_p_int, new_flags)); resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg4), SWIGTYPE_p_int, new_flags));
} }
{
PyBuffer_Release(&rgb_buffer1);
}
if (SWIG_IsNewObj(res2)) free((char*)arg2); if (SWIG_IsNewObj(res2)) free((char*)arg2);
if (SWIG_IsNewObj(res3)) free((char*)arg3); if (SWIG_IsNewObj(res3)) free((char*)arg3);
free(result); free(result);
return resultobj; return resultobj;
fail: fail:
{
PyBuffer_Release(&rgb_buffer1);
}
if (SWIG_IsNewObj(res2)) free((char*)arg2); if (SWIG_IsNewObj(res2)) free((char*)arg2);
if (SWIG_IsNewObj(res3)) free((char*)arg3); if (SWIG_IsNewObj(res3)) free((char*)arg3);
return NULL; return NULL;
@ -4047,8 +4108,7 @@ SWIGINTERN PyObject *_wrap_wrap_WebPEncodeBGRA(PyObject *SWIGUNUSEDPARM(self), P
int arg6 ; int arg6 ;
int arg7 ; int arg7 ;
float arg8 ; float arg8 ;
void *argp1 = 0 ; Py_buffer rgb_buffer1 ;
int res1 = 0 ;
int temp2 ; int temp2 ;
int res2 = 0 ; int res2 = 0 ;
int temp3 ; int temp3 ;
@ -4074,11 +4134,21 @@ SWIGINTERN PyObject *_wrap_wrap_WebPEncodeBGRA(PyObject *SWIGUNUSEDPARM(self), P
arg4 = &temp4; arg4 = &temp4;
if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:wrap_WebPEncodeBGRA",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:wrap_WebPEncodeBGRA",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_uint8_t, 0 | 0 ); {
if (!SWIG_IsOK(res1)) { // NB: with Python < 2.6 the old style buffer protocol may be used:
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "wrap_WebPEncodeBGRA" "', argument " "1"" of type '" "uint8_t const *""'"); // Py_ssize_t unused;
// PyObject_AsReadBuffer(obj0, (const void**)(&arg1), &unused);
if (!PyObject_CheckBuffer(obj0)) {
SWIG_exception_fail(SWIG_TypeError,
"in method 'wrap_WebPEncodeBGRA', argument 1"
" does not support the buffer interface");
}
if (PyObject_GetBuffer(obj0, &rgb_buffer1, PyBUF_SIMPLE)) {
SWIG_exception_fail(SWIG_RuntimeError,
"in method 'wrap_WebPEncodeBGRA', unable to get buffer view");
}
arg1 = (uint8_t *)rgb_buffer1.buf;
} }
arg1 = (uint8_t *)(argp1);
if (!(SWIG_IsOK((res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2),SWIGTYPE_p_int,0))))) { if (!(SWIG_IsOK((res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2),SWIGTYPE_p_int,0))))) {
int val; int val;
int ecode = SWIG_AsVal_int(obj1, &val); int ecode = SWIG_AsVal_int(obj1, &val);
@ -4122,7 +4192,8 @@ SWIGINTERN PyObject *_wrap_wrap_WebPEncodeBGRA(PyObject *SWIGUNUSEDPARM(self), P
result = (uint8_t *)wrap_WebPEncodeBGRA((uint8_t const *)arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8); result = (uint8_t *)wrap_WebPEncodeBGRA((uint8_t const *)arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8);
{ {
resultobj = PyString_FromStringAndSize( resultobj = PyString_FromStringAndSize(
(const char*)result, ReturnedBufferSize("wrap_WebPEncodeBGRA", arg3, arg4)); (const char*)result,
(result == NULL) ? 0 : ReturnedBufferSize("wrap_WebPEncodeBGRA", arg3, arg4));
} }
if (SWIG_IsTmpObj(res4)) { if (SWIG_IsTmpObj(res4)) {
resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg4))); resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg4)));
@ -4130,11 +4201,17 @@ SWIGINTERN PyObject *_wrap_wrap_WebPEncodeBGRA(PyObject *SWIGUNUSEDPARM(self), P
int new_flags = SWIG_IsNewObj(res4) ? (SWIG_POINTER_OWN | 0 ) : 0 ; int new_flags = SWIG_IsNewObj(res4) ? (SWIG_POINTER_OWN | 0 ) : 0 ;
resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg4), SWIGTYPE_p_int, new_flags)); resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg4), SWIGTYPE_p_int, new_flags));
} }
{
PyBuffer_Release(&rgb_buffer1);
}
if (SWIG_IsNewObj(res2)) free((char*)arg2); if (SWIG_IsNewObj(res2)) free((char*)arg2);
if (SWIG_IsNewObj(res3)) free((char*)arg3); if (SWIG_IsNewObj(res3)) free((char*)arg3);
free(result); free(result);
return resultobj; return resultobj;
fail: fail:
{
PyBuffer_Release(&rgb_buffer1);
}
if (SWIG_IsNewObj(res2)) free((char*)arg2); if (SWIG_IsNewObj(res2)) free((char*)arg2);
if (SWIG_IsNewObj(res3)) free((char*)arg3); if (SWIG_IsNewObj(res3)) free((char*)arg3);
return NULL; return NULL;
@ -4150,8 +4227,7 @@ SWIGINTERN PyObject *_wrap_wrap_WebPEncodeLosslessRGB(PyObject *SWIGUNUSEDPARM(s
int arg5 ; int arg5 ;
int arg6 ; int arg6 ;
int arg7 ; int arg7 ;
void *argp1 = 0 ; Py_buffer rgb_buffer1 ;
int res1 = 0 ;
int temp2 ; int temp2 ;
int res2 = 0 ; int res2 = 0 ;
int temp3 ; int temp3 ;
@ -4174,11 +4250,21 @@ SWIGINTERN PyObject *_wrap_wrap_WebPEncodeLosslessRGB(PyObject *SWIGUNUSEDPARM(s
arg4 = &temp4; arg4 = &temp4;
if (!PyArg_ParseTuple(args,(char *)"OOOOOO:wrap_WebPEncodeLosslessRGB",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; if (!PyArg_ParseTuple(args,(char *)"OOOOOO:wrap_WebPEncodeLosslessRGB",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_uint8_t, 0 | 0 ); {
if (!SWIG_IsOK(res1)) { // NB: with Python < 2.6 the old style buffer protocol may be used:
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "wrap_WebPEncodeLosslessRGB" "', argument " "1"" of type '" "uint8_t const *""'"); // Py_ssize_t unused;
// PyObject_AsReadBuffer(obj0, (const void**)(&arg1), &unused);
if (!PyObject_CheckBuffer(obj0)) {
SWIG_exception_fail(SWIG_TypeError,
"in method 'wrap_WebPEncodeLosslessRGB', argument 1"
" does not support the buffer interface");
}
if (PyObject_GetBuffer(obj0, &rgb_buffer1, PyBUF_SIMPLE)) {
SWIG_exception_fail(SWIG_RuntimeError,
"in method 'wrap_WebPEncodeLosslessRGB', unable to get buffer view");
}
arg1 = (uint8_t *)rgb_buffer1.buf;
} }
arg1 = (uint8_t *)(argp1);
if (!(SWIG_IsOK((res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2),SWIGTYPE_p_int,0))))) { if (!(SWIG_IsOK((res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2),SWIGTYPE_p_int,0))))) {
int val; int val;
int ecode = SWIG_AsVal_int(obj1, &val); int ecode = SWIG_AsVal_int(obj1, &val);
@ -4217,7 +4303,8 @@ SWIGINTERN PyObject *_wrap_wrap_WebPEncodeLosslessRGB(PyObject *SWIGUNUSEDPARM(s
result = (uint8_t *)wrap_WebPEncodeLosslessRGB((uint8_t const *)arg1,arg2,arg3,arg4,arg5,arg6,arg7); result = (uint8_t *)wrap_WebPEncodeLosslessRGB((uint8_t const *)arg1,arg2,arg3,arg4,arg5,arg6,arg7);
{ {
resultobj = PyString_FromStringAndSize( resultobj = PyString_FromStringAndSize(
(const char*)result, ReturnedBufferSize("wrap_WebPEncodeLosslessRGB", arg3, arg4)); (const char*)result,
(result == NULL) ? 0 : ReturnedBufferSize("wrap_WebPEncodeLosslessRGB", arg3, arg4));
} }
if (SWIG_IsTmpObj(res4)) { if (SWIG_IsTmpObj(res4)) {
resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg4))); resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg4)));
@ -4225,11 +4312,17 @@ SWIGINTERN PyObject *_wrap_wrap_WebPEncodeLosslessRGB(PyObject *SWIGUNUSEDPARM(s
int new_flags = SWIG_IsNewObj(res4) ? (SWIG_POINTER_OWN | 0 ) : 0 ; int new_flags = SWIG_IsNewObj(res4) ? (SWIG_POINTER_OWN | 0 ) : 0 ;
resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg4), SWIGTYPE_p_int, new_flags)); resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg4), SWIGTYPE_p_int, new_flags));
} }
{
PyBuffer_Release(&rgb_buffer1);
}
if (SWIG_IsNewObj(res2)) free((char*)arg2); if (SWIG_IsNewObj(res2)) free((char*)arg2);
if (SWIG_IsNewObj(res3)) free((char*)arg3); if (SWIG_IsNewObj(res3)) free((char*)arg3);
free(result); free(result);
return resultobj; return resultobj;
fail: fail:
{
PyBuffer_Release(&rgb_buffer1);
}
if (SWIG_IsNewObj(res2)) free((char*)arg2); if (SWIG_IsNewObj(res2)) free((char*)arg2);
if (SWIG_IsNewObj(res3)) free((char*)arg3); if (SWIG_IsNewObj(res3)) free((char*)arg3);
return NULL; return NULL;
@ -4245,8 +4338,7 @@ SWIGINTERN PyObject *_wrap_wrap_WebPEncodeLosslessBGR(PyObject *SWIGUNUSEDPARM(s
int arg5 ; int arg5 ;
int arg6 ; int arg6 ;
int arg7 ; int arg7 ;
void *argp1 = 0 ; Py_buffer rgb_buffer1 ;
int res1 = 0 ;
int temp2 ; int temp2 ;
int res2 = 0 ; int res2 = 0 ;
int temp3 ; int temp3 ;
@ -4269,11 +4361,21 @@ SWIGINTERN PyObject *_wrap_wrap_WebPEncodeLosslessBGR(PyObject *SWIGUNUSEDPARM(s
arg4 = &temp4; arg4 = &temp4;
if (!PyArg_ParseTuple(args,(char *)"OOOOOO:wrap_WebPEncodeLosslessBGR",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; if (!PyArg_ParseTuple(args,(char *)"OOOOOO:wrap_WebPEncodeLosslessBGR",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_uint8_t, 0 | 0 ); {
if (!SWIG_IsOK(res1)) { // NB: with Python < 2.6 the old style buffer protocol may be used:
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "wrap_WebPEncodeLosslessBGR" "', argument " "1"" of type '" "uint8_t const *""'"); // Py_ssize_t unused;
// PyObject_AsReadBuffer(obj0, (const void**)(&arg1), &unused);
if (!PyObject_CheckBuffer(obj0)) {
SWIG_exception_fail(SWIG_TypeError,
"in method 'wrap_WebPEncodeLosslessBGR', argument 1"
" does not support the buffer interface");
}
if (PyObject_GetBuffer(obj0, &rgb_buffer1, PyBUF_SIMPLE)) {
SWIG_exception_fail(SWIG_RuntimeError,
"in method 'wrap_WebPEncodeLosslessBGR', unable to get buffer view");
}
arg1 = (uint8_t *)rgb_buffer1.buf;
} }
arg1 = (uint8_t *)(argp1);
if (!(SWIG_IsOK((res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2),SWIGTYPE_p_int,0))))) { if (!(SWIG_IsOK((res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2),SWIGTYPE_p_int,0))))) {
int val; int val;
int ecode = SWIG_AsVal_int(obj1, &val); int ecode = SWIG_AsVal_int(obj1, &val);
@ -4312,7 +4414,8 @@ SWIGINTERN PyObject *_wrap_wrap_WebPEncodeLosslessBGR(PyObject *SWIGUNUSEDPARM(s
result = (uint8_t *)wrap_WebPEncodeLosslessBGR((uint8_t const *)arg1,arg2,arg3,arg4,arg5,arg6,arg7); result = (uint8_t *)wrap_WebPEncodeLosslessBGR((uint8_t const *)arg1,arg2,arg3,arg4,arg5,arg6,arg7);
{ {
resultobj = PyString_FromStringAndSize( resultobj = PyString_FromStringAndSize(
(const char*)result, ReturnedBufferSize("wrap_WebPEncodeLosslessBGR", arg3, arg4)); (const char*)result,
(result == NULL) ? 0 : ReturnedBufferSize("wrap_WebPEncodeLosslessBGR", arg3, arg4));
} }
if (SWIG_IsTmpObj(res4)) { if (SWIG_IsTmpObj(res4)) {
resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg4))); resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg4)));
@ -4320,11 +4423,17 @@ SWIGINTERN PyObject *_wrap_wrap_WebPEncodeLosslessBGR(PyObject *SWIGUNUSEDPARM(s
int new_flags = SWIG_IsNewObj(res4) ? (SWIG_POINTER_OWN | 0 ) : 0 ; int new_flags = SWIG_IsNewObj(res4) ? (SWIG_POINTER_OWN | 0 ) : 0 ;
resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg4), SWIGTYPE_p_int, new_flags)); resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg4), SWIGTYPE_p_int, new_flags));
} }
{
PyBuffer_Release(&rgb_buffer1);
}
if (SWIG_IsNewObj(res2)) free((char*)arg2); if (SWIG_IsNewObj(res2)) free((char*)arg2);
if (SWIG_IsNewObj(res3)) free((char*)arg3); if (SWIG_IsNewObj(res3)) free((char*)arg3);
free(result); free(result);
return resultobj; return resultobj;
fail: fail:
{
PyBuffer_Release(&rgb_buffer1);
}
if (SWIG_IsNewObj(res2)) free((char*)arg2); if (SWIG_IsNewObj(res2)) free((char*)arg2);
if (SWIG_IsNewObj(res3)) free((char*)arg3); if (SWIG_IsNewObj(res3)) free((char*)arg3);
return NULL; return NULL;
@ -4340,8 +4449,7 @@ SWIGINTERN PyObject *_wrap_wrap_WebPEncodeLosslessRGBA(PyObject *SWIGUNUSEDPARM(
int arg5 ; int arg5 ;
int arg6 ; int arg6 ;
int arg7 ; int arg7 ;
void *argp1 = 0 ; Py_buffer rgb_buffer1 ;
int res1 = 0 ;
int temp2 ; int temp2 ;
int res2 = 0 ; int res2 = 0 ;
int temp3 ; int temp3 ;
@ -4364,11 +4472,21 @@ SWIGINTERN PyObject *_wrap_wrap_WebPEncodeLosslessRGBA(PyObject *SWIGUNUSEDPARM(
arg4 = &temp4; arg4 = &temp4;
if (!PyArg_ParseTuple(args,(char *)"OOOOOO:wrap_WebPEncodeLosslessRGBA",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; if (!PyArg_ParseTuple(args,(char *)"OOOOOO:wrap_WebPEncodeLosslessRGBA",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_uint8_t, 0 | 0 ); {
if (!SWIG_IsOK(res1)) { // NB: with Python < 2.6 the old style buffer protocol may be used:
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "wrap_WebPEncodeLosslessRGBA" "', argument " "1"" of type '" "uint8_t const *""'"); // Py_ssize_t unused;
// PyObject_AsReadBuffer(obj0, (const void**)(&arg1), &unused);
if (!PyObject_CheckBuffer(obj0)) {
SWIG_exception_fail(SWIG_TypeError,
"in method 'wrap_WebPEncodeLosslessRGBA', argument 1"
" does not support the buffer interface");
}
if (PyObject_GetBuffer(obj0, &rgb_buffer1, PyBUF_SIMPLE)) {
SWIG_exception_fail(SWIG_RuntimeError,
"in method 'wrap_WebPEncodeLosslessRGBA', unable to get buffer view");
}
arg1 = (uint8_t *)rgb_buffer1.buf;
} }
arg1 = (uint8_t *)(argp1);
if (!(SWIG_IsOK((res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2),SWIGTYPE_p_int,0))))) { if (!(SWIG_IsOK((res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2),SWIGTYPE_p_int,0))))) {
int val; int val;
int ecode = SWIG_AsVal_int(obj1, &val); int ecode = SWIG_AsVal_int(obj1, &val);
@ -4407,7 +4525,8 @@ SWIGINTERN PyObject *_wrap_wrap_WebPEncodeLosslessRGBA(PyObject *SWIGUNUSEDPARM(
result = (uint8_t *)wrap_WebPEncodeLosslessRGBA((uint8_t const *)arg1,arg2,arg3,arg4,arg5,arg6,arg7); result = (uint8_t *)wrap_WebPEncodeLosslessRGBA((uint8_t const *)arg1,arg2,arg3,arg4,arg5,arg6,arg7);
{ {
resultobj = PyString_FromStringAndSize( resultobj = PyString_FromStringAndSize(
(const char*)result, ReturnedBufferSize("wrap_WebPEncodeLosslessRGBA", arg3, arg4)); (const char*)result,
(result == NULL) ? 0 : ReturnedBufferSize("wrap_WebPEncodeLosslessRGBA", arg3, arg4));
} }
if (SWIG_IsTmpObj(res4)) { if (SWIG_IsTmpObj(res4)) {
resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg4))); resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg4)));
@ -4415,11 +4534,17 @@ SWIGINTERN PyObject *_wrap_wrap_WebPEncodeLosslessRGBA(PyObject *SWIGUNUSEDPARM(
int new_flags = SWIG_IsNewObj(res4) ? (SWIG_POINTER_OWN | 0 ) : 0 ; int new_flags = SWIG_IsNewObj(res4) ? (SWIG_POINTER_OWN | 0 ) : 0 ;
resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg4), SWIGTYPE_p_int, new_flags)); resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg4), SWIGTYPE_p_int, new_flags));
} }
{
PyBuffer_Release(&rgb_buffer1);
}
if (SWIG_IsNewObj(res2)) free((char*)arg2); if (SWIG_IsNewObj(res2)) free((char*)arg2);
if (SWIG_IsNewObj(res3)) free((char*)arg3); if (SWIG_IsNewObj(res3)) free((char*)arg3);
free(result); free(result);
return resultobj; return resultobj;
fail: fail:
{
PyBuffer_Release(&rgb_buffer1);
}
if (SWIG_IsNewObj(res2)) free((char*)arg2); if (SWIG_IsNewObj(res2)) free((char*)arg2);
if (SWIG_IsNewObj(res3)) free((char*)arg3); if (SWIG_IsNewObj(res3)) free((char*)arg3);
return NULL; return NULL;
@ -4435,8 +4560,7 @@ SWIGINTERN PyObject *_wrap_wrap_WebPEncodeLosslessBGRA(PyObject *SWIGUNUSEDPARM(
int arg5 ; int arg5 ;
int arg6 ; int arg6 ;
int arg7 ; int arg7 ;
void *argp1 = 0 ; Py_buffer rgb_buffer1 ;
int res1 = 0 ;
int temp2 ; int temp2 ;
int res2 = 0 ; int res2 = 0 ;
int temp3 ; int temp3 ;
@ -4459,11 +4583,21 @@ SWIGINTERN PyObject *_wrap_wrap_WebPEncodeLosslessBGRA(PyObject *SWIGUNUSEDPARM(
arg4 = &temp4; arg4 = &temp4;
if (!PyArg_ParseTuple(args,(char *)"OOOOOO:wrap_WebPEncodeLosslessBGRA",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; if (!PyArg_ParseTuple(args,(char *)"OOOOOO:wrap_WebPEncodeLosslessBGRA",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_uint8_t, 0 | 0 ); {
if (!SWIG_IsOK(res1)) { // NB: with Python < 2.6 the old style buffer protocol may be used:
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "wrap_WebPEncodeLosslessBGRA" "', argument " "1"" of type '" "uint8_t const *""'"); // Py_ssize_t unused;
// PyObject_AsReadBuffer(obj0, (const void**)(&arg1), &unused);
if (!PyObject_CheckBuffer(obj0)) {
SWIG_exception_fail(SWIG_TypeError,
"in method 'wrap_WebPEncodeLosslessBGRA', argument 1"
" does not support the buffer interface");
}
if (PyObject_GetBuffer(obj0, &rgb_buffer1, PyBUF_SIMPLE)) {
SWIG_exception_fail(SWIG_RuntimeError,
"in method 'wrap_WebPEncodeLosslessBGRA', unable to get buffer view");
}
arg1 = (uint8_t *)rgb_buffer1.buf;
} }
arg1 = (uint8_t *)(argp1);
if (!(SWIG_IsOK((res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2),SWIGTYPE_p_int,0))))) { if (!(SWIG_IsOK((res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2),SWIGTYPE_p_int,0))))) {
int val; int val;
int ecode = SWIG_AsVal_int(obj1, &val); int ecode = SWIG_AsVal_int(obj1, &val);
@ -4502,7 +4636,8 @@ SWIGINTERN PyObject *_wrap_wrap_WebPEncodeLosslessBGRA(PyObject *SWIGUNUSEDPARM(
result = (uint8_t *)wrap_WebPEncodeLosslessBGRA((uint8_t const *)arg1,arg2,arg3,arg4,arg5,arg6,arg7); result = (uint8_t *)wrap_WebPEncodeLosslessBGRA((uint8_t const *)arg1,arg2,arg3,arg4,arg5,arg6,arg7);
{ {
resultobj = PyString_FromStringAndSize( resultobj = PyString_FromStringAndSize(
(const char*)result, ReturnedBufferSize("wrap_WebPEncodeLosslessBGRA", arg3, arg4)); (const char*)result,
(result == NULL) ? 0 : ReturnedBufferSize("wrap_WebPEncodeLosslessBGRA", arg3, arg4));
} }
if (SWIG_IsTmpObj(res4)) { if (SWIG_IsTmpObj(res4)) {
resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg4))); resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg4)));
@ -4510,11 +4645,17 @@ SWIGINTERN PyObject *_wrap_wrap_WebPEncodeLosslessBGRA(PyObject *SWIGUNUSEDPARM(
int new_flags = SWIG_IsNewObj(res4) ? (SWIG_POINTER_OWN | 0 ) : 0 ; int new_flags = SWIG_IsNewObj(res4) ? (SWIG_POINTER_OWN | 0 ) : 0 ;
resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg4), SWIGTYPE_p_int, new_flags)); resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg4), SWIGTYPE_p_int, new_flags));
} }
{
PyBuffer_Release(&rgb_buffer1);
}
if (SWIG_IsNewObj(res2)) free((char*)arg2); if (SWIG_IsNewObj(res2)) free((char*)arg2);
if (SWIG_IsNewObj(res3)) free((char*)arg3); if (SWIG_IsNewObj(res3)) free((char*)arg3);
free(result); free(result);
return resultobj; return resultobj;
fail: fail:
{
PyBuffer_Release(&rgb_buffer1);
}
if (SWIG_IsNewObj(res2)) free((char*)arg2); if (SWIG_IsNewObj(res2)) free((char*)arg2);
if (SWIG_IsNewObj(res3)) free((char*)arg3); if (SWIG_IsNewObj(res3)) free((char*)arg3);
return NULL; return NULL;