Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cd4beed

Browse files
author
Steve Chaplin
committed
SC 2005/03/19
svn path=/trunk/matplotlib/; revision=1090
1 parent c29362c commit cd4beed

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

src/_backend_gdk.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,34 +24,33 @@ static PyTypeObject *_PyGdkPixbuf_Type;
2424
static PyObject *
2525
pixbuf_get_pixels_array(PyObject *self, PyObject *args)
2626
{
27-
/* 1) read in Python pixbuf, get the underlying C pixbuf */
27+
/* 1) read in Python pixbuf, get the underlying gdk_pixbuf */
2828
PyGObject *py_pixbuf;
29-
GdkPixbuf *pixbuf;
29+
GdkPixbuf *gdk_pixbuf;
3030
PyArrayObject *array;
3131
int dims[3] = { 0, 0, 3 };
3232

3333
if (!PyArg_ParseTuple(args, "O!:pixbuf_get_pixels_array",
3434
&PyGdkPixbuf_Type, &py_pixbuf))
3535
return NULL;
3636

37-
pixbuf = GDK_PIXBUF(py_pixbuf->obj);
37+
gdk_pixbuf = GDK_PIXBUF(py_pixbuf->obj);
3838

3939
/* 2) same as pygtk/gtk/gdk.c _wrap_gdk_pixbuf_get_pixels_array()
4040
* with 'self' changed to py_pixbuf
4141
*/
4242

43-
dims[0] = gdk_pixbuf_get_height(pixbuf);
44-
dims[1] = gdk_pixbuf_get_width(pixbuf);
45-
if (gdk_pixbuf_get_has_alpha(pixbuf))
43+
dims[0] = gdk_pixbuf_get_height(gdk_pixbuf);
44+
dims[1] = gdk_pixbuf_get_width(gdk_pixbuf);
45+
if (gdk_pixbuf_get_has_alpha(gdk_pixbuf))
4646
dims[2] = 4;
4747

4848
array = (PyArrayObject *)PyArray_FromDimsAndData(3, dims, PyArray_UBYTE,
49-
(char *)gdk_pixbuf_get_pixels(pixbuf));
50-
49+
(char *)gdk_pixbuf_get_pixels(gdk_pixbuf));
5150
if (array == NULL)
5251
return NULL;
5352

54-
array->strides[0] = gdk_pixbuf_get_rowstride(pixbuf);
53+
array->strides[0] = gdk_pixbuf_get_rowstride(gdk_pixbuf);
5554
/* the array holds a ref to the pixbuf pixels through this wrapper*/
5655
Py_INCREF(py_pixbuf);
5756
array->base = (PyObject *)py_pixbuf;

0 commit comments

Comments
 (0)