-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainwindow.h
86 lines (61 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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QWidget>
#include <QPushButton>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QLabel>
#include <QPixmap>
#include <QFont>
#include <QSpacerItem>
#include <QString>
#include <QFileDialog>
#include <QBoxLayout>
#include <QMessageBox>
#include <QFile>
#include <QTextStream>
#include <QDebug>
#include <QSlider>
#include <cmath>
#include "picture.h"
#include "logslider.h"
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = nullptr); //konstruktor
~MainWindow(); //dedtruktor
void setLayout(); //funkce pro nastavení layoutu
private slots:
void on_actionOpen_triggered(); //otevření obrázku
void on_actionImage_triggered(); //uložení ASCII obrázku jako obrázek
void on_actionText_triggered(); //uložení ASCII obrázku jako text
void on_actionboth_triggered(); //uložení původního obrázku a ASCII obrázku do jednoho souboru
void PictureChange(); //změna jasu nebo kontrastu obrázku
private:
Ui::MainWindow *ui;
Picture* data = new Picture();
QFont *AsciiFont = new QFont("Monospace");
//function
QLabel* setPicJpg(); //funkce vrátí label připravený na náhled obrázku
QLabel* setPicAscii(); //funkce vrátí label pro ascii obrazek
void setAsciiFont(); //nastaveví font pro zobrazení ascii obrázku
void setPictureLayout();
QImage MergeImage(QImage origin,QImage ascii, bool horizontal = true);
//message box
QMessageBox *msg_box = new QMessageBox();
//widget
QLabel* pic_jpg;
QLabel* pic_Ascii;
QWidget *pic_ascii_w;
QLabel *Brightness_l;
QSlider *Brightness;
QLabel *Contrast_l;
logSlider *Contrast;
//event
};
#endif // MAINWINDOW_H