forked from NautiluX/slide
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmainwindow.h
More file actions
53 lines (41 loc) · 1.3 KB
/
mainwindow.h
File metadata and controls
53 lines (41 loc) · 1.3 KB
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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QPixmap>
namespace Ui {
class MainWindow;
}
class QLabel;
class QKeyEvent;
class Overlay;
class ExifHelper;
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
void keyPressEvent(QKeyEvent* event);
void resizeEvent(QResizeEvent* event);
~MainWindow();
void setImage(std::string path);
void setBlurRadius(unsigned int blurRadius);
void setBackgroundOpacity(unsigned int opacity);
void warn(std::string text);
void setOverlay(Overlay* overlay);
private:
Ui::MainWindow *ui;
std::string currentImage;
unsigned int blurRadius = 20;
unsigned int backgroundOpacity = 150;
Overlay* overlay;
void drawText(QPixmap& image, int margin, int fontsize, QString text, int alignment);
void updateImage(bool immediately);
QPixmap getBlurredBackground(const QPixmap& originalSize, const QPixmap& scaled);
QPixmap getRotatedPixmap(const QPixmap& p);
QPixmap getScaledPixmap(const QPixmap& p);
void drawBackground(const QPixmap& originalSize, const QPixmap& scaled);
void drawForeground(QPixmap& background, const QPixmap& foreground);
QPixmap blur(const QPixmap& input);
ExifHelper *m_exifHelper;
};
#endif // MAINWINDOW_H