pygimp: add override for gimp_zoom_preview_get_source

This commit is contained in:
Kristian Rietveld 2016-05-01 21:31:54 +02:00
parent a2d7a04700
commit b1117908f4
1 changed files with 26 additions and 0 deletions

View File

@ -2035,3 +2035,29 @@ _wrap_gimp_color_display_stack_convert_surface(PyGObject *self, PyObject *args,
Py_INCREF(Py_None);
return Py_None;
}
%%
override gimp_zoom_preview_get_source noargs
static PyObject *
_wrap_gimp_zoom_preview_get_source(PyGObject *self)
{
gint width, height, bpp;
guchar *image;
PyObject *pyimage;
image = gimp_zoom_preview_get_source(GIMP_ZOOM_PREVIEW(self->obj),
&width, &height, &bpp);
if (image)
{
pyimage = PyByteArray_FromStringAndSize((const char *)image,
width * height * bpp);
g_free (image);
}
else
{
Py_INCREF(Py_None);
pyimage = Py_None;
}
return Py_BuildValue("(Niii)", pyimage, width, height, bpp);
}