box blur dummy

This commit is contained in:
homm 2014-10-12 16:30:00 +04:00
parent 9634e437ef
commit d49459f5b2
4 changed files with 33 additions and 2 deletions

View File

@ -1791,7 +1791,6 @@ _unsharp_mask(ImagingObject* self, PyObject* args)
if (!PyArg_ParseTuple(args, "fii", &radius, &percent, &threshold))
return NULL;
imIn = self->image;
imOut = ImagingNew(imIn->mode, imIn->xsize, imIn->ysize);
if (!imOut)
@ -1804,6 +1803,27 @@ _unsharp_mask(ImagingObject* self, PyObject* args)
}
#endif
static PyObject*
_box_blur(ImagingObject* self, PyObject* args)
{
Imaging imIn;
Imaging imOut;
int radius;
if (!PyArg_ParseTuple(args, "i", &radius))
return NULL;
imIn = self->image;
imOut = ImagingNew(imIn->mode, imIn->xsize, imIn->ysize);
if (!imOut)
return NULL;
if (!ImagingBoxBlur(imIn, imOut, radius))
return NULL;
return PyImagingNew(imOut);
}
/* -------------------------------------------------------------------- */
static PyObject*
@ -3078,6 +3098,8 @@ static struct PyMethodDef methods[] = {
{"unsharp_mask", (PyCFunction)_unsharp_mask, 1},
#endif
{"box_blur", (PyCFunction)_box_blur, 1},
#ifdef WITH_EFFECTS
/* Special effects */
{"effect_spread", (PyCFunction)_effect_spread, 1},

8
libImaging/BoxBlur.c Normal file
View File

@ -0,0 +1,8 @@
#include "Python.h"
#include "Imaging.h"
Imaging ImagingBoxBlur(Imaging im, Imaging imOut, int radius)
{
return imOut;
}

View File

@ -308,6 +308,7 @@ extern Imaging ImagingTransform(
int fill);
extern Imaging ImagingUnsharpMask(
Imaging im, Imaging imOut, float radius, int percent, int threshold);
extern Imaging ImagingBoxBlur(Imaging im, Imaging imOut, int radius);
extern Imaging ImagingCopy2(Imaging imOut, Imaging imIn);
extern Imaging ImagingConvert2(Imaging imOut, Imaging imIn);

View File

@ -37,7 +37,7 @@ _LIB_IMAGING = (
"RankFilter", "RawDecode", "RawEncode", "Storage", "SunRleDecode",
"TgaRleDecode", "Unpack", "UnpackYCC", "UnsharpMask", "XbmDecode",
"XbmEncode", "ZipDecode", "ZipEncode", "TiffDecode", "Incremental",
"Jpeg2KDecode", "Jpeg2KEncode")
"Jpeg2KDecode", "Jpeg2KEncode", "BoxBlur")
def _add_directory(path, dir, where=None):