Compilation fixes for imageops on linux

This commit is contained in:
Kovid Goyal 2016-05-10 16:38:08 +05:30
parent cc42267ba8
commit 090a8f8605
4 changed files with 8 additions and 4 deletions

View File

@ -5,8 +5,8 @@
* Distributed under terms of the GPL3 license. * Distributed under terms of the GPL3 license.
*/ */
#include <stdexcept>
#include "imageops.h" #include "imageops.h"
#include <stdexcept>
#include <QVector> #include <QVector>
#include <cmath> #include <cmath>

View File

@ -7,8 +7,8 @@
#pragma once #pragma once
#include <QImage>
#include <Python.h> #include <Python.h>
#include <QImage>
QImage remove_borders(const QImage &image, double fuzz); QImage remove_borders(const QImage &image, double fuzz);
QImage grayscale(const QImage &image); QImage grayscale(const QImage &image);

View File

@ -7,6 +7,7 @@
%Import QtGui/QtGuimod.sip %Import QtGui/QtGuimod.sip
%ModuleCode %ModuleCode
#include <imageops.h> #include <imageops.h>
#include <stdexcept>
#define IMAGEOPS_PREFIX \ #define IMAGEOPS_PREFIX \
if (a0->isNull()) { PyErr_SetString(PyExc_ValueError, "Cannot operate on null QImage"); return NULL; } \ if (a0->isNull()) { PyErr_SetString(PyExc_ValueError, "Cannot operate on null QImage"); return NULL; } \
try { try {

View File

@ -12,12 +12,12 @@
* Distributed under terms of the GPL3 license. * Distributed under terms of the GPL3 license.
*/ */
#include <algorithm> #include "imageops.h"
#include <stdexcept>
#include <cmath> #include <cmath>
#include <stdio.h> #include <stdio.h>
#include <QVector> #include <QVector>
#include <QStringList> #include <QStringList>
#include "imageops.h"
// Increasing this number improves quality but also increases running time and memory consumption // Increasing this number improves quality but also increases running time and memory consumption
static const size_t MAX_LEAVES = 2000; static const size_t MAX_LEAVES = 2000;
@ -31,6 +31,9 @@ static inline double log2(double x) { return log(x) / log((double)2) ; }
#endif #endif
#else #else
#include <stdint.h> #include <stdint.h>
#ifndef UINT64_MAX
#define UINT64_MAX 18446744073709551615ULL
#endif
#endif #endif
#define MAX_DEPTH 8 #define MAX_DEPTH 8
#define MAX_COLORS 256 #define MAX_COLORS 256