mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-27 10:33:18 +02:00
...
This commit is contained in:
parent
2e2db4fae1
commit
9efc0f2d5a
1 changed files with 4 additions and 6 deletions
|
|
@ -8,10 +8,8 @@
|
|||
%ModuleCode
|
||||
#include <imageops.h>
|
||||
#define IMAGEOPS_PREFIX \
|
||||
QImage ans; \
|
||||
try {
|
||||
#define IMAGEOPS_SUFFIX \
|
||||
sipRes = new QImage(ans); \
|
||||
} catch (std::out_of_range &exc) { PyErr_SetString(PyExc_ValueError, exc.what()); return NULL; \
|
||||
} catch (std::bad_alloc &) { PyErr_NoMemory(); return NULL; \
|
||||
} catch (std::exception &exc) { PyErr_SetString(PyExc_Exception, exc.what()); return NULL; \
|
||||
|
|
@ -21,27 +19,27 @@
|
|||
QImage* remove_borders(const QImage &image, double fuzz);
|
||||
%MethodCode
|
||||
IMAGEOPS_PREFIX
|
||||
ans = remove_borders(*a0, a1);
|
||||
sipRes = new QImage(remove_borders(*a0, a1));
|
||||
IMAGEOPS_SUFFIX
|
||||
%End
|
||||
|
||||
QImage* grayscale(const QImage &image);
|
||||
%MethodCode
|
||||
IMAGEOPS_PREFIX
|
||||
ans = grayscale(*a0);
|
||||
sipRes = new QImage(grayscale(*a0));
|
||||
IMAGEOPS_SUFFIX
|
||||
%End
|
||||
|
||||
QImage gaussian_sharpen(const QImage &img, const float radius, const float sigma, const bool high_quality=true);
|
||||
%MethodCode
|
||||
IMAGEOPS_PREFIX
|
||||
ans = gaussian_sharpen(*a0, a1, a2, a3);
|
||||
sipRes = new QImage(gaussian_sharpen(*a0, a1, a2, a3));
|
||||
IMAGEOPS_SUFFIX
|
||||
%End
|
||||
|
||||
QImage gaussian_blur(const QImage &img, const float radius, const float sigma);
|
||||
%MethodCode
|
||||
IMAGEOPS_PREFIX
|
||||
ans = gaussian_blur(*a0, a1, a2);
|
||||
sipRes = new QImage(gaussian_blur(*a0, a1, a2));
|
||||
IMAGEOPS_SUFFIX
|
||||
%End
|
||||
|
|
|
|||
Loading…
Reference in a new issue