-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkernelapproximator.h
76 lines (62 loc) · 1.67 KB
/
kernelapproximator.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#ifndef KERNELAPPROXIMATOR_H
#define KERNELAPPROXIMATOR_H
#include <QObject>
#include <QImage>
#include <QList>
#include <QCoreApplication>
#include <QWidget>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QGridLayout>
#include <QLabel>
#include <QPushButton>
#include <QGroupBox>
#include <QRadioButton>
#include <QString>
#include <QLineEdit>
#include <QDoubleValidator>
#include <QSpinBox>
#include <QElapsedTimer>
#include "base.h"
#include <math.h>
#include <omp.h>
namespace Kernel {
class Settings;
class Approximator : public BaseApproximator{
Q_OBJECT
protected:
double calculateKernelDivisor(const QList<double> &kernel);
public:
Approximator(BaseSettings*);
QImage applyKernel(QImage orig, const QList<double> &kernel, const bool &absolute);
QImage combine_maximum(QList<QImage> images);
QImage combine_extreme_channels(QList<QImage> images);
QImage combine_extreme_pixels(QList<QImage> images);
public slots:
void processImage(QImage orig);
};
class Settings : public BaseSettings{
Q_OBJECT
public:
explicit Settings();
void addNewKernel(QList<double> kernel = {0,0,0,0,0,0,0,0,0}); // adds to the list a new kernel
QList<QList<double> > getKernels();
int getNumberPasses();
bool getIfAbsolute();
public slots:
void numberKernelsChange();
void signedUnsignedToggled();
virtual QString getApproximatorName();
protected:
QHBoxLayout *globalLayout;
QGroupBox *quantitySelection;
QVBoxLayout *quantityLayout;
QSpinBox *numberPasses,*numberKernels;
QGroupBox *toggleSelection;
QVBoxLayout *toggleLayout;
QPushButton *signedUnsignedToggle;
QList<QGroupBox*> kernelGroups;
QDoubleValidator doubleValidator;
};
}//namespace
#endif // KERNELAPPROXIMATOR_H