iVS3D v2.0.0
Loading...
Searching...
No Matches
itransform.h
1#ifndef ITRANSFORM_H
2#define ITRANSFORM_H
3
4#include <QObject>
5#include <tl/expected.hpp>
6#include "opencv2/core.hpp"
7#include "cvmat_qmetadata.h"
8#include "resolution.h"
9#include "roi.h"
10#include "iVS3D-pluginInterface_global.h"
11#include "ierror.h"
12
13using TransformResult = tl::expected<cv::Mat, Error>;
14Q_DECLARE_METATYPE(TransformResult)
15
16
87class IVS3DPLUGININTERFACE_EXPORT ITransform : public QObject
88{
89 Q_OBJECT
90
91public:
92
93 virtual ~ITransform() {}
101 virtual QWidget* getSettingsWidget(QWidget* parent) = 0;
102
107 virtual QString getName() const = 0;
108
113 virtual ITransform *copy() = 0;
114
122 virtual TransformResult transform(uint idx, const cv::Mat &img, const Resolution &resolution, const ROI &roi) = 0;
123
128 virtual void enableCuda(bool enabled) = 0;
129
134 virtual void setSettings(QMap<QString, QVariant> settings) = 0;
135
140 virtual QMap<QString, QVariant> getSettings() = 0;
141
146 virtual void activate() {}
147
153 virtual void deactivate() {}
154
155
156signals:
162 void sendToGui(uint idx, const cv::Mat &img);
163};
164
165Q_DECLARE_INTERFACE(ITransform, "iVS3D.ITransform")
166
167#endif // ITRANSFORM_H
The ITransform interface is used for algorithms to create additional image files from the source imag...
Definition itransform.h:88
virtual TransformResult transform(uint idx, const cv::Mat &img, const Resolution &resolution, const ROI &roi)=0
transform generates additional images from the given image. The signal sendToGui can be used to updat...
virtual QMap< QString, QVariant > getSettings()=0
getter for plugin's settings
virtual void setSettings(QMap< QString, QVariant > settings)=0
setter for plugin's settings
virtual QString getName() const =0
getName returns the display name for the plugin.
virtual ITransform * copy()=0
copy creates a new ITransform instance which is a deep copy.
void sendToGui(uint idx, const cv::Mat &img)
[signal] sendToGui is emitted if the ITransform instance has an image to display to the user.
virtual QWidget * getSettingsWidget(QWidget *parent)=0
getSettingsWidget is provides an QWidget to display plugin specific settings to the user....
virtual void enableCuda(bool enabled)=0
enableCuda enables use of the CUDA api to accelerate computations.
virtual void deactivate()
deactivate will be called when the plugin is no longer used, i.e. when the user deselects it in the s...
Definition itransform.h:153
virtual void activate()
activate will be called before the plugin is used, i.e. when the user selects it in the seampling win...
Definition itransform.h:146
The ROI class manages a region of interest represented as a rectangle in the [0,1]x[0,...
Definition roi.h:21
The Resolution class encapsulates an image resolution (width and height). It provides functionality f...
Definition resolution.h:17