Make plug-in compile with updated G'MIC API (gmic_library/gmic_image/gmic_list).

This commit is contained in:
David Tschumperle 2022-12-04 14:22:38 +01:00
parent 64b2cc60fb
commit 9f55f4b0fa
14 changed files with 89 additions and 89 deletions

View File

@ -29,11 +29,11 @@
#include <memory>
#include "GmicQt.h"
namespace cimg_library
namespace gmic_library
{
template <typename T> struct CImg;
template <typename T> struct CImgList;
} // namespace cimg_library
template <typename T> struct gmic_image;
template <typename T> struct gmic_list;
} // namespace gmic_library
namespace GmicQt
{
@ -41,13 +41,13 @@ class CroppedActiveLayerProxy {
public:
CroppedActiveLayerProxy() = delete;
static void get(cimg_library::CImg<gmic_pixel_type> & image, double x, double y, double width, double height);
static void get(gmic_library::gmic_image<gmic_pixel_type> & image, double x, double y, double width, double height);
static QSize getSize(double x, double y, double width, double height);
static void clear();
private:
static void update(double x, double y, double width, double height);
static std::unique_ptr<cimg_library::CImg<float>> _cachedImage;
static std::unique_ptr<gmic_library::gmic_image<float>> _cachedImage;
static double _x;
static double _y;
static double _width;

View File

@ -28,11 +28,11 @@
#include <memory>
#include "GmicQt.h"
namespace cimg_library
namespace gmic_library
{
template <typename T> struct CImg;
template <typename T> struct CImgList;
} // namespace cimg_library
template <typename T> struct gmic_list;
} // namespace gmic_library
namespace GmicQt
{
@ -41,13 +41,13 @@ class CroppedImageListProxy {
public:
CroppedImageListProxy() = delete;
static void get(cimg_library::CImgList<gmic_pixel_type> & images, cimg_library::CImgList<char> & imageNames, double x, double y, double width, double height, InputMode mode, double zoom);
static void get(gmic_library::gmic_list<gmic_pixel_type> & images, gmic_library::gmic_list<char> & imageNames, double x, double y, double width, double height, InputMode mode, double zoom);
static void update(double x, double y, double width, double height, InputMode mode, double zoom);
static void clear();
private:
static std::unique_ptr<cimg_library::CImgList<float>> _cachedImageList;
static std::unique_ptr<cimg_library::CImgList<char>> _cachedImageNames;
static std::unique_ptr<gmic_library::gmic_list<float>> _cachedImageList;
static std::unique_ptr<gmic_library::gmic_list<char>> _cachedImageNames;
static double _x;
static double _y;
static double _width;

View File

@ -34,9 +34,9 @@
#include "Host/GmicQtHost.h"
class QObject;
namespace cimg_library
namespace gmic_library
{
template <typename T> struct CImgList;
template <typename T> struct gmic_list;
}
namespace GmicQt
@ -49,12 +49,12 @@ public:
virtual ~FilterSyncRunner();
void setArguments(const QString &);
void setInputImages(const cimg_library::CImgList<float> & list);
void setImageNames(const cimg_library::CImgList<char> & imageNames);
void swapImages(cimg_library::CImgList<float> & images);
const cimg_library::CImgList<float> & images() const;
const cimg_library::CImgList<char> & imageNames() const;
cimg_library::CImg<char> & persistentMemoryOutput();
void setInputImages(const gmic_library::gmic_list<float> & list);
void setImageNames(const gmic_library::gmic_list<char> & imageNames);
void swapImages(gmic_library::gmic_list<float> & images);
const gmic_library::gmic_list<float> & images() const;
const gmic_library::gmic_list<char> & imageNames() const;
gmic_library::gmic_image<char> & persistentMemoryOutput();
QStringList gmicStatus() const;
QList<int> parametersVisibilityStates() const;
QString errorMessage() const;
@ -70,9 +70,9 @@ private:
QString _command;
QString _arguments;
QString _environment;
cimg_library::CImgList<float> * _images;
cimg_library::CImgList<char> * _imageNames;
cimg_library::CImg<char> * _persistentMemoryOuptut;
gmic_library::gmic_list<float> * _images;
gmic_library::gmic_list<char> * _imageNames;
gmic_library::gmic_image<char> * _persistentMemoryOuptut;
bool _gmicAbort;
bool _failed;
QString _gmicStatus;

View File

@ -32,9 +32,9 @@
#include "GmicQt.h"
#include "Host/GmicQtHost.h"
namespace cimg_library
namespace gmic_library
{
template <typename T> struct CImgList;
template <typename T> struct gmic_list;
}
namespace GmicQt
@ -47,12 +47,12 @@ public:
FilterThread(QObject * parent, const QString & command, const QString & arguments, const QString & environment);
~FilterThread() override;
void setInputImages(const cimg_library::CImgList<float> & list);
void setImageNames(const cimg_library::CImgList<char> & imageNames);
void swapImages(cimg_library::CImgList<float> & images);
const cimg_library::CImgList<float> & images() const;
const cimg_library::CImgList<char> & imageNames() const;
cimg_library::CImg<char> & persistentMemoryOutput();
void setInputImages(const gmic_library::gmic_list<float> & list);
void setImageNames(const gmic_library::gmic_list<char> & imageNames);
void swapImages(gmic_library::gmic_list<float> & images);
const gmic_library::gmic_list<float> & images() const;
const gmic_library::gmic_list<char> & imageNames() const;
gmic_library::gmic_image<char> & persistentMemoryOutput();
QStringList gmicStatus() const;
QList<int> parametersVisibilityStates() const;
QString errorMessage() const;
@ -79,9 +79,9 @@ private:
QString _command;
const QString _arguments;
QString _environment;
cimg_library::CImgList<float> * _images;
cimg_library::CImgList<char> * _imageNames;
cimg_library::CImg<char> * _persistentMemoryOuptut;
gmic_library::gmic_list<float> * _images;
gmic_library::gmic_list<char> * _imageNames;
gmic_library::gmic_image<char> * _persistentMemoryOuptut;
bool _gmicAbort;
bool _failed;
QString _gmicStatus;

View File

@ -38,11 +38,11 @@
#include "GmicQt.h"
#include "InputOutputState.h"
namespace cimg_library
namespace gmic_library
{
template <typename T> struct CImgList;
template <typename T> struct CImg;
} // namespace cimg_library
template <typename T> struct gmic_list;
template <typename T> struct gmic_image;
} // namespace gmic_library
namespace GmicQt
{
@ -94,7 +94,7 @@ public:
bool isIdle() const;
bool hasUnfinishedAbortedThreads() const;
const cimg_library::CImg<float> & previewImage() const;
const gmic_library::gmic_image<float> & previewImage() const;
const QStringList & gmicStatus() const;
const QList<int> & parametersVisibilityStates() const;
void setGmicStatusQuotedParameters(const QVector<bool> & quotedParameters);
@ -128,14 +128,14 @@ private slots:
void hideWaitingCursor();
private:
void updateImageNames(cimg_library::CImgList<char> & imageNames);
void updateImageNames(gmic_library::gmic_list<char> & imageNames);
void abortCurrentFilterThread();
void manageSynchonousRunner(FilterSyncRunner & runner);
FilterThread * _filterThread;
FilterContext _filterContext;
cimg_library::CImgList<float> * _gmicImages;
cimg_library::CImg<float> * _previewImage;
gmic_library::gmic_list<float> * _gmicImages;
gmic_library::gmic_image<float> * _previewImage;
QList<FilterThread *> _unfinishedAbortedThreads;
unsigned int _previewRandomSeed;

View File

@ -25,11 +25,11 @@
#ifndef GMIC_QT_GMIC_QT_H
#define GMIC_QT_GMIC_QT_H
namespace cimg_library
namespace gmic_library
{
template <typename T> struct CImg;
template <typename T> struct CImgList;
} // namespace cimg_library
template <typename T> struct gmic_image;
template <typename T> struct gmic_list;
} // namespace gmic_library
#ifndef gmic_pixel_type
#define gmic_pixel_type float
@ -138,11 +138,11 @@ int run(UserInterfaceMode interfaceMode = UserInterfaceMode::Full,
* Instantiated for T in {unsigned char, gmic_pixel_type}
*/
template <typename T> //
void calibrateImage(cimg_library::CImg<T> & img, const int spectrum, const bool isPreview);
void calibrateImage(gmic_library::gmic_image<T> & img, const int spectrum, const bool isPreview);
void convertCImgToQImage(const cimg_library::CImg<float> & in, QImage & out);
void convertCImgToQImage(const gmic_library::gmic_image<float> & in, QImage & out);
void convertQImageToCImg(const QImage & in, cimg_library::CImg<float> & out);
void convertQImageToCImg(const QImage & in, gmic_library::gmic_image<float> & out);
} // namespace GmicQt

View File

@ -31,9 +31,9 @@
#include <QVector>
#include "GmicQt.h"
namespace cimg_library
namespace gmic_library
{
template <typename T> struct CImgList;
template <typename T> struct gmic_list;
}
namespace GmicQt
@ -66,7 +66,7 @@ signals:
private:
void endApplication(const QString & errorMessage);
FilterThread * _filterThread;
cimg_library::CImgList<float> * _gmicImages;
gmic_library::gmic_list<float> * _gmicImages;
ProgressInfoWindow * _progressWindow;
QTimer _timer;
QString _filterName;

View File

@ -27,11 +27,11 @@
#include <QString>
#include "GmicQt.h"
namespace cimg_library
namespace gmic_library
{
template <typename T> struct CImg;
template <typename T> struct CImgList;
} // namespace cimg_library
template <typename T> struct gmic_image;
template <typename T> struct gmic_list;
} // namespace gmic_library
namespace GmicQtHost
{
@ -64,8 +64,8 @@ void getLayersExtent(int * width, int * height, GmicQt::InputMode);
* @param height Normalized height of the layers w.r.t. image/extends height
* @param mode Input mode
*/
void getCroppedImages(cimg_library::CImgList<gmic_pixel_type> & images, //
cimg_library::CImgList<char> & imageNames, //
void getCroppedImages(gmic_library::gmic_list<gmic_pixel_type> & images, //
gmic_library::gmic_list<char> & imageNames, //
double x, //
double y, //
double width, //
@ -79,14 +79,14 @@ void getCroppedImages(cimg_library::CImgList<gmic_pixel_type> & images, //
* @param imageNames Layers labels
* @param mode Output mode (\see GmicQt.h)
*/
void outputImages(cimg_library::CImgList<gmic_pixel_type> & images, const cimg_library::CImgList<char> & imageNames, GmicQt::OutputMode mode);
void outputImages(gmic_library::gmic_list<gmic_pixel_type> & images, const gmic_library::gmic_list<char> & imageNames, GmicQt::OutputMode mode);
/**
* @brief Apply a color profile to a given image
*
* @param [in,out] images An image
*/
void applyColorProfile(cimg_library::CImg<gmic_pixel_type> & images);
void applyColorProfile(gmic_library::gmic_image<gmic_pixel_type> & images);
/**
* @brief Display a message in the host application.

View File

@ -40,9 +40,9 @@
#include "Globals.h"
#include "GmicQt.h"
namespace cimg_library
namespace gmic_library
{
template <typename T> struct CImg;
template <typename T> struct gmic_image;
}
namespace gmic_qt_standalone
@ -51,7 +51,7 @@ namespace gmic_qt_standalone
class ImageView : public QWidget {
public:
ImageView(QWidget * parent);
void setImage(const cimg_library::CImg<gmic_pixel_type> & image);
void setImage(const gmic_library::gmic_image<gmic_pixel_type> & image);
void setImage(const QImage & image);
bool save(const QString & filename, int quality);
void paintEvent(QPaintEvent *) override;
@ -65,7 +65,7 @@ class ImageDialog : public QDialog {
Q_OBJECT
public:
ImageDialog(QWidget * parent);
void addImage(const cimg_library::CImg<gmic_pixel_type> & image, const QString & name);
void addImage(const gmic_library::gmic_image<gmic_pixel_type> & image, const QString & name);
const QImage & currentImage() const;
int currentImageIndex() const;
static void supportedImageFormats(QStringList & extensions, QString & filters);

View File

@ -28,19 +28,19 @@
#include "Common.h"
#include "GmicQt.h"
namespace cimg_library
namespace gmic_library
{
template <typename T> struct CImg;
template <typename T> struct CImgList;
} // namespace cimg_library
template <typename T> struct gmic_image;
template <typename T> struct gmic_list;
} // namespace gmic_library
namespace GmicQt
{
bool checkImageSpectrumAtMost4(const cimg_library::CImgList<float> & images, unsigned int & index);
void buildPreviewImage(const cimg_library::CImgList<float> & images, cimg_library::CImg<float> & result);
bool checkImageSpectrumAtMost4(const gmic_library::gmic_list<float> & images, unsigned int & index);
void buildPreviewImage(const gmic_library::gmic_list<float> & images, gmic_library::gmic_image<float> & result);
template <typename T> bool hasAlphaChannel(const cimg_library::CImg<T> & image);
template <typename T> bool hasAlphaChannel(const gmic_library::gmic_image<T> & image);
} // namespace GmicQt

View File

@ -41,9 +41,9 @@ namespace Ui
class MainWindow;
}
namespace cimg_library
namespace gmic_library
{
template <typename T> struct CImgList;
template <typename T> struct gmic_list;
}
namespace GmicQt

View File

@ -25,9 +25,9 @@
#ifndef GMIC_QT__PERSISTENTMEMORY_H
#define GMIC_QT__PERSISTENTMEMORY_H
#include <memory>
namespace cimg_library
namespace gmic_library
{
template <typename T> struct CImg;
template <typename T> struct gmic_image;
}
namespace GmicQt
@ -35,12 +35,12 @@ namespace GmicQt
class PersistentMemory {
public:
static cimg_library::CImg<char> & image();
static gmic_library::gmic_image<char> & image();
static void clear();
static void move_from(cimg_library::CImg<char> & buffer);
static void move_from(gmic_library::gmic_image<char> & buffer);
private:
static std::unique_ptr<cimg_library::CImg<char>> _image;
static std::unique_ptr<gmic_library::gmic_image<char>> _image;
};
} // namespace GmicQt

View File

@ -39,11 +39,11 @@
#include "KeypointList.h"
#include "ZoomConstraint.h"
namespace cimg_library
namespace gmic_library
{
template <typename T> struct CImgList;
template <typename T> struct CImg;
} // namespace cimg_library
template <typename T> struct gmic_list;
template <typename T> struct gmic_image;
} // namespace gmic_library
namespace GmicQt
{
@ -64,11 +64,11 @@ public:
double defaultZoomFactor() const;
void updateVisibleRect();
void centerVisibleRect();
void setPreviewImage(const cimg_library::CImg<float> & image);
void setPreviewImage(const gmic_library::gmic_image<float> & image);
void setOverlayMessage(const QString &);
void clearOverlayMessage();
void setPreviewErrorMessage(const QString &);
const cimg_library::CImg<float> & image() const;
const gmic_library::gmic_image<float> & image() const;
void translateNormalized(double dx, double dy);
void translateFullImage(double dx, double dy);
void setPreviewEnabled(bool on);
@ -131,7 +131,7 @@ public slots:
private:
void paintPreview(QPainter &);
void paintOriginalImage(QPainter &);
void getOriginalImageCrop(cimg_library::CImg<float> & image);
void getOriginalImageCrop(gmic_library::gmic_image<float> & image);
void updateOriginalImagePosition();
void updateErrorImage();
@ -143,8 +143,8 @@ private:
QSize originalImageCropSize();
void saveVisibleCenter();
cimg_library::CImg<float> * _image;
cimg_library::CImg<float> * _savedPreview;
gmic_library::gmic_image<float> * _image;
gmic_library::gmic_image<float> * _savedPreview;
QSize _fullImageSize;
double _currentZoomFactor;
ZoomConstraint _zoomConstraint;

View File

@ -35,9 +35,9 @@ namespace Ui
class ProgressInfoWindow;
}
namespace cimg_library
namespace gmic_library
{
template <typename T> struct CImgList;
template <typename T> struct gmic_list;
}
namespace GmicQt