From d05f6710eb939f2629251988817a3cac3e74dc4f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 22 Nov 2021 11:12:06 +0530 Subject: [PATCH] Better port of QVector --- src/calibre/utils/imageops/imageops.sip | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/calibre/utils/imageops/imageops.sip b/src/calibre/utils/imageops/imageops.sip index 4bfc05a11a..000ba1fe09 100644 --- a/src/calibre/utils/imageops/imageops.sip +++ b/src/calibre/utils/imageops/imageops.sip @@ -73,12 +73,10 @@ QImage oil_paint(const QImage &image, const float radius=-1, const bool high_qua sipRes = new QImage(oil_paint(*a0, a1, a2)); IMAGEOPS_SUFFIX %End -QImage quantize(const QImage &image, unsigned int maximum_colors, bool dither, SIP_PYTUPLE); +QImage quantize(const QImage &image, unsigned int maximum_colors, bool dither, const QList &palette); %MethodCode - QVector palette(PyTuple_GET_SIZE(a3)); - for (int i = 0; i < PyTuple_GET_SIZE(a3); i++) palette[i] = PyLong_AsUnsignedLong(PyTuple_GET_ITEM(a3, i)); IMAGEOPS_PREFIX - sipRes = new QImage(quantize(*a0, a1, a2, palette)); + sipRes = new QImage(quantize(*a0, a1, a2, *a3)); IMAGEOPS_SUFFIX %End