-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainwindow.h
88 lines (73 loc) · 1.87 KB
/
mainwindow.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
77
78
79
80
81
82
83
84
85
86
87
88
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include<QPushButton>
#include <QLabel>
#include <QScrollArea>
#include <QScrollBar>
#include <QUndoStack>
#include <vector>
#include "EffectLayer.h"
//#include "ConvertImage.h"
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE
class MainWindow : public QMainWindow
{
Q_OBJECT
public slots:
//Main options
void OpenFile();
bool SaveImage();
void SetPropertiesPage();
void SetDefaultValues();
void ZoomIn();
void ZoomOut();
void UndoAction();
void RedoAction();
void CheckDifferences();
//Apply effects
void ShowGrayscaleEffect();
void ShowBrightnessEffect();
void ShowContrastEffect();
void ShowExposureEffect();
void ShowHueEffect();
void ShowSaturationEffect();
void ShowLightnessEffect();
void ShowBlurEffect();
void ShowNoiseEffect();
//Rotation and flipping
void RotateClockwise();
void RotateCounterClockwise();
void RotateUpsideDown();
void FlipVertical();
void FlipHorizontal();
void Crop();
public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
void AddScale();
void SetConnections();
void EnableInterface(bool);
void SetupEffectLayers();
void DisplayImage(QImage);
void UpdateImage();
void ScaleImage(double);
void UpdateScaleLabel();
void UpdateResolutionLabel();
void UpdateSliderValues();
private:
void closeEvent(QCloseEvent *event);
QLabel* scaleLabel=nullptr;
QLabel* resolutionLabel = nullptr;
Ui::MainWindow *ui;
bool isSaved;
QUndoStack* undoStack = nullptr;
cv::Mat imgForEditing, imgForDisplay, originalImage, noiseMat;
QImage image;
Effects effect;
std::vector<EffectLayer> previousState;
std::vector<EffectLayer> effectLayers;
double scaleValue = 1.0;
};
#endif // MAINWINDOW_H