slackbuilds_ponce/graphics/gmic/zart-opencv4.patch
Willy Sudiarto Raharjo 661923c633 graphics/gmic: Add missing patch.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
2019-11-01 07:41:55 +07:00

59 lines
1.7 KiB
Diff

diff --git a/include/VideoFileSource.h b/include/VideoFileSource.h
index 0fda14e..8c15178 100644
--- a/include/VideoFileSource.h
+++ b/include/VideoFileSource.h
@@ -50,5 +50,7 @@
#include <QString>
#include <opencv2/opencv.hpp>
+#include <opencv2/videoio.hpp>
+#include <opencv2/videoio/videoio_c.h>
#include "ImageSource.h"
class VideoFileSource : public ImageSource {
diff --git a/include/WebcamSource.h b/include/WebcamSource.h
index 8c1911a..9194385 100644
--- a/include/WebcamSource.h
+++ b/include/WebcamSource.h
@@ -53,6 +53,8 @@
#include <QString>
#include <QVector>
#include <opencv2/opencv.hpp>
+#include <opencv2/videoio.hpp>
+#include <opencv2/videoio/videoio_c.h>
#include "ImageSource.h"
class QSplashScreen;
diff --git a/zart.pro b/zart.pro
index d98a192..ddb2d3b 100644
--- a/zart.pro
+++ b/zart.pro
@@ -19,7 +19,7 @@
CONFIG += warn_on
QT_CONFIG -= no-pkg-config
CONFIG += link_pkgconfig
-PKGCONFIG += opencv fftw3 zlib
+PKGCONFIG += opencv4 fftw3 zlib
# LIBS += -lfftw3_threads
DEFINES += cimg_use_fftw3 cimg_use_zlib
diff --git a/src/ImageConverter.cpp b/src/ImageConverter.cpp
--- a/src/ImageConverter.cpp
+++ b/src/ImageConverter.cpp
@@ -70,7 +70,7 @@
cv::Mat tmp(in->cols, in->rows, in->depth());
- cvtColor(*in, tmp, (in->channels() == 1) ? CV_GRAY2RGB : CV_BGR2RGB);
+ cvtColor(*in, tmp, (in->channels() == 1) ? cv::COLOR_GRAY2RGB : cv::COLOR_BGR2RGB);
const unsigned int w3 = 3 * tmp.cols;
unsigned char * src = reinterpret_cast<unsigned char *>(tmp.ptr());
@@ -106,7 +106,7 @@
dst += step;
}
}
- cvtColor(**out, **out, CV_BGR2RGB);
+ cvtColor(**out, **out, cv::COLOR_BGR2RGB);
}
void ImageConverter::convert(const cimg_library::CImg<float> & in, QImage * out)