12#include <QCoreApplication>
13#include <QDoubleSpinBox>
25#include "iselection.h"
28#include "BlurAlgorithm.h"
29#include "blurlaplacian.h"
31#include "blurtenengrad.h"
33#define DESCRIPTION_STYLE \
34 "color: rgb(58, 58, 58); border-left: 6px solid rgb(58, 58, 58); " \
35 "border-top-right-radius: 5px; border-bottom-right-radius: 5px; " \
36 "background-color: lightblue;"
37#define WINDOW_SIZE "Window size"
38#define LOCAL_DEVIATION "Local deviation"
39#define USED_BLUR "Blur"
56 Q_PLUGIN_METADATA(IID
"iVS3D.IBase")
73 QString
getName()
const override;
74 QMap<QString, QVariant>
getSettings()
const override;
87 volatile bool& cancelFlag)
override;
90 void syncSettingsWidget(
const QString& algorithmName,
92 double localDeviation,
93 const QString& infoText);
96 void slot_blurAlgoChanged(
const QString& name);
97 void slot_wsChanged(
int ws);
98 void slot_ldChanged(
double ld);
101 std::unique_ptr<QWidget> createSettingsWidget();
102 std::vector<uint> sampleKeyframes(
Reader* reader,
103 volatile bool& cancelFlag,
104 const std::vector<uint>& indices);
105 QString progressMessage(
int curr,
int total)
const;
106 QString currentInfoText()
const;
107 void invalidateCache();
109 Reader* m_reader =
nullptr;
110 QComboBox* m_comboBoxBlur =
nullptr;
111 QSpinBox* m_spinBoxWS =
nullptr;
112 QDoubleSpinBox* m_spinBoxLD =
nullptr;
113 QLabel* m_infoLabel =
nullptr;
115 int m_windowSize = 30;
116 double m_localDeviation = 95.0;
117 std::vector<BlurAlgorithm*> m_blurAlgorithms = {};
120 std::vector<double> m_cachedBlurValues = {};
121 uint m_cachedPicCount = 0;
122 QString m_cachedAlgoName;
123 uint m_currentIndex = 0;
124 bool m_useCuda =
false;
The BlurAlgorithm interface provides an interface for different algorithms calculating blur values fo...
Definition BlurAlgorithm.h:27
The Blur class selects keyframes based on blur/sharpness values computed by the selected BlurAlgorith...
Definition blur.h:54
void onIndexChanged(uint index) override
onIndexChanged is called when the currently displayed frame index changes in the viewer.
Definition blur.cpp:131
QString getName() const override
getName Returns the plugin Name
Definition blur.cpp:63
VIS::VisualizationResult generatePreview(const PLUG::PreviewData &data) override
Generates a preview visualization based on the provided data. This function is executed asynchronousl...
Definition blur.cpp:137
QMap< QString, QVariant > getSettings() const override
getSettings retrieves the current settings of the plugin as a map of key-value pairs....
Definition blur.cpp:65
PLUG::InputLoadedResult onInputLoaded(const PLUG::InputData &input) override
onInputLoaded is called when a new input video or image set is loaded.
Definition blur.cpp:118
void onCudaChanged(bool enabled) override
onCudaChanged is called when the CUDA usage setting is changed in iVS3D.
Definition blur.cpp:111
PLUG::ApplySettingsResult applySettings(const QMap< QString, QVariant > &settings) override
applySettings applies the provided settings to the plugin. This method is used to restore plugin conf...
Definition blur.cpp:73
Blur()
Blur Constructor which creates an instance of every BlurAlgorithm and stets standard values (WindowSi...
Definition blur.cpp:40
PLUG::SettingsWidgetResult getSettingsWidget() override
getSettingsWidget creates and returns a settings QWidget for this plugin.
Definition blur.cpp:59
PLUG::SelectionResult selectImages(const PLUG::SelectionData &data, volatile bool &cancelFlag) override
Selects images based on the provided selection data.
Definition blur.cpp:212
void activate() override
activate is called when the plugin is activated in iVS3D. Plugins can override this method to perform...
Definition blur.cpp:107
void deactivate() override
deactivate is called when the plugin is deactivated in iVS3D. Plugins can override this method to per...
Definition blur.cpp:109
The IBase interface provides a base class for all plugin interfaces in iVS3D. It inherits from QObjec...
Definition ibase.h:102
The IPreview interface defines the contract for preview plugins in iVS3D. Plugins implementing this i...
Definition ipreview.h:41
Interface for keyframe/image-selection plugins in iVS3D.
Definition iselection.h:53
The Reader interface defines functions which are used for reading and parsing the import.
Definition reader.h:23
tl::expected< void, Error > InputLoadedResult
Type alias for the result of handling an input loaded event, which can be either a successful void re...
Definition ibase.h:58
tl::expected< void, Error > ApplySettingsResult
Type alias for the result of applying settings to a plugin, which can be either a successful void res...
Definition ibase.h:51
tl::expected< std::unique_ptr< QWidget >, Error > SettingsWidgetResult
Type alias for the result of a settings widget creation operation, which can be either a successful u...
Definition ibase.h:44
Struct containing data required to generate a preview. The image is resized to the working resolution...
Definition ipreview.h:16
Data available for image selection in ISelection plugins.
Definition iselection.h:31