mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix compilation with Visual Studio
This commit is contained in:
parent
404153b591
commit
59da7ed5be
@ -5,8 +5,9 @@
|
|||||||
* Distributed under terms of the GPL3 license.
|
* Distributed under terms of the GPL3 license.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "imageops.h"
|
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
#include "imageops.h"
|
||||||
|
#include <QColor>
|
||||||
|
|
||||||
#define SQUARE(x) (x)*(x)
|
#define SQUARE(x) (x)*(x)
|
||||||
#define MAX(x, y) ((x) > (y)) ? (x) : (y)
|
#define MAX(x, y) ((x) > (y)) ? (x) : (y)
|
||||||
|
@ -7,10 +7,10 @@
|
|||||||
%Import QtGui/QtGuimod.sip
|
%Import QtGui/QtGuimod.sip
|
||||||
%ModuleCode
|
%ModuleCode
|
||||||
#include <imageops.h>
|
#include <imageops.h>
|
||||||
#define PREFIX \
|
#define IMAGEOPS_PREFIX \
|
||||||
QImage ans; \
|
QImage ans; \
|
||||||
try {
|
try {
|
||||||
#define SUFFIX \
|
#define IMAGEOPS_SUFFIX \
|
||||||
if (PyErr_Occurred()) return NULL; \
|
if (PyErr_Occurred()) return NULL; \
|
||||||
sipRes = new (std::nothrow) QImage(ans); \
|
sipRes = new (std::nothrow) QImage(ans); \
|
||||||
if (sipRes == NULL) return PyErr_NoMemory(); \
|
if (sipRes == NULL) return PyErr_NoMemory(); \
|
||||||
@ -22,14 +22,14 @@
|
|||||||
|
|
||||||
QImage* remove_borders(const QImage &image, double fuzz);
|
QImage* remove_borders(const QImage &image, double fuzz);
|
||||||
%MethodCode
|
%MethodCode
|
||||||
PREFIX
|
IMAGEOPS_PREFIX
|
||||||
ans = remove_borders(*a0, a1);
|
ans = remove_borders(*a0, a1);
|
||||||
SUFFIX
|
IMAGEOPS_SUFFIX
|
||||||
%End
|
%End
|
||||||
|
|
||||||
QImage* grayscale(const QImage &image);
|
QImage* grayscale(const QImage &image);
|
||||||
%MethodCode
|
%MethodCode
|
||||||
PREFIX
|
IMAGEOPS_PREFIX
|
||||||
ans = grayscale(*a0);
|
ans = grayscale(*a0);
|
||||||
SUFFIX
|
IMAGEOPS_SUFFIX
|
||||||
%End
|
%End
|
||||||
|
Loading…
x
Reference in New Issue
Block a user