mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
2e2db4fae1
commit
9efc0f2d5a
@ -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…
x
Reference in New Issue
Block a user