Skip to content

Commit 9658047

Browse files
author
svenstaro
committed
PySFML 1.6 and 2.0: Fixed SetSmooth and implemented IsSmooth
git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/trunk@1531 4e206d99-4929-0410-ac5d-dfc041789085
1 parent 5c0dfbb commit 9658047

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

python/src/Image.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,12 @@ PySfImage_SetSmooth (PySfImage *self, PyObject *args)
210210
Py_RETURN_NONE;
211211
}
212212

213+
static PyObject *
214+
PySfImage_IsSmooth (PySfImage *self)
215+
{
216+
return PyBool_FromLong(self->obj->IsSmooth());
217+
}
218+
213219
static PyObject *
214220
PySfImage_GetWidth(PySfImage *self)
215221
{
@@ -233,7 +239,7 @@ static PyObject *
233239
PySfImage_GetTexCoords(PySfImage* self, PyObject *args)
234240
{
235241
PySfIntRect *RectArg = NULL;
236-
242+
237243
if (!PyArg_ParseTuple(args, "O!:Image.GetTextCoords", &PySfIntRectType, &RectArg))
238244
return NULL;
239245

@@ -295,7 +301,8 @@ Create the image from the current contents of the given window. Return True if c
295301
{"GetPixels", (PyCFunction)PySfImage_GetPixels, METH_NOARGS, "GetPixels()\nGet a string representing the array of pixels (8 bits integers RGBA). String length is GetWidth() x GetHeight() x 4. This string becomes invalid if you reload or resize the image."},
296302
{"CreateMaskFromColor", (PyCFunction)PySfImage_CreateMaskFromColor, METH_O, "CreateMaskFromColor(Color)\nCreate transparency mask from a specified colorkey."},
297303
{"Bind", (PyCFunction)PySfImage_Bind, METH_NOARGS, "Bind()\nBind the image for rendering."},
298-
{"SetSmooth", (PyCFunction)PySfImage_SetSmooth, METH_VARARGS, "SetSmooth(Smooth)\nEnable or disable image smooth filter."},
304+
{"SetSmooth", (PyCFunction)PySfImage_SetSmooth, METH_O, "SetSmooth(Smooth)\nEnable or disable image smooth filter."},
305+
{"IsSmooth", (PyCFunction)PySfImage_IsSmooth, METH_NOARGS, "IsOpened(Smooth)\nTells whether the smooth filtering is enabled or not."},
299306
{"GetWidth", (PyCFunction)PySfImage_GetWidth, METH_NOARGS, "GetWidth()\nReturn the width of the image."},
300307
{"GetHeight", (PyCFunction)PySfImage_GetHeight, METH_NOARGS, "GetHeight()\nReturn the height of the image."},
301308
{"GetTexCoords", (PyCFunction)PySfImage_GetTexCoords, METH_VARARGS, "GetTexCoords(Rect)\nConvert a subrect expressed in pixels, into float texture coordinates. Returns texture coordinates corresponding to the sub-rectangle (sf.FloatRect instance)\n\
@@ -379,7 +386,7 @@ PySfImage_Copy(PySfImage* self, PyObject *args, PyObject *kwds)
379386
unsigned int DestX, DestY;
380387
PyObject *PyApplyAlpha = NULL;
381388
bool ApplyAlpha = false;
382-
389+
383390
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!II|O!O:Image.Copy", (char **)kwlist, &PySfImageType, &Source, &DestX, &DestY, &PySfIntRectType, &SourceRect, &PyApplyAlpha))
384391
return NULL;
385392

0 commit comments

Comments
 (0)