mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-12 18:26:17 +03:00
box blur dummy
This commit is contained in:
parent
9634e437ef
commit
d49459f5b2
24
_imaging.c
24
_imaging.c
|
@ -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
8
libImaging/BoxBlur.c
Normal file
|
@ -0,0 +1,8 @@
|
|||
#include "Python.h"
|
||||
#include "Imaging.h"
|
||||
|
||||
|
||||
Imaging ImagingBoxBlur(Imaging im, Imaging imOut, int radius)
|
||||
{
|
||||
return imOut;
|
||||
}
|
|
@ -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);
|
||||
|
|
2
setup.py
2
setup.py
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue
Block a user