-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathneuralstylerwindow.h
167 lines (126 loc) · 4.18 KB
/
neuralstylerwindow.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
/*
NeuralStyler,Artistic style for your videos/photos
Copyright(C) 2016 Rupesh Sreeraman
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
paint icon :http://findicons.com/icon/85674/paint?id=85674
*/
#ifndef NEURALSTYLERWINDOW_H
#define NEURALSTYLERWINDOW_H
#include <QMainWindow>
#include <QFileDialog>
#include <ffmpegprocess.h>
#include <stylechainer.h>
#include <QDebug>
#include <QProcess>
#include <QDir>
#include <paths.h>
#include <QTime>
#include <QDesktopServices>
#include <QMessageBox>
#include <aboutdialog.h>
#include <QPointer>
#include <QTimer>
#include <QSettings>
#include <QPainter>
#include <styleintensitydialog.h>
#include <QBitArray>
#include "qxtspanslider.h"
#include <QCloseEvent>
#include "framedialog.h"
#include <QDropEvent>
#include <QDragEnterEvent>
#include <QMimeData>
#include <mplayer.h>
namespace Ui {
class NeuralStylerWindow;
}
class NeuralStylerWindow : public QMainWindow
{
Q_OBJECT
public:
explicit NeuralStylerWindow(QWidget *parent = 0);
~NeuralStylerWindow();
static int const EXIT_CODE_REBOOT = -123456789;
signals:
void updatePreviewFrame(QString);
private slots:
void on_pushButonBrowseFile_clicked();
void on_pushButtonProcess_clicked();
void fpsStarted();
void fpsCompleted(int ec);
void frameExtratorStarted();
void frameExtratorCompleted(int ec);
void audioExtratorStarted();
void audioExtratorCompleted(int ec);
void fastNeuralStyleStarted();
void fastNeuralStyleCompleted(int ec);
void styledVideoStarted();
void styledVideoCompleted(int ec);
void gotFrame(QString fnum);
void on_comboBoxStyles_currentIndexChanged(const QString &arg1);
void on_pushButtonOpenOutput_clicked();
void on_actionAbout_triggered();
void update();
void finishStyling();
void seek(int pos);
void setSliderRange(float duration);
bool isImageOrGif();
bool isGif();
void on_pushButtonPause_clicked();
void on_checkBoxNoScale_clicked();
void on_pushButonBrowseFileSave_clicked();
void on_actionGet_more_styles_triggered();
void on_sliderStyleStrength_valueChanged(int value);
void on_comboBoxResolution_currentIndexChanged(const QString &arg1);
void engineState(bool save);
void initVideoTrim();
void showEvent(QShowEvent * event);
void closeEvent(QCloseEvent *event);
void on_action_Help_triggered();
void on_pushButtonReset_clicked();
void on_pushButtonViewFrame_clicked();
void dropEvent(QDropEvent* event);
void dragMoveEvent(QDragMoveEvent *event);
void dragEnterEvent(QDragEnterEvent *event);
private:
Ui::NeuralStylerWindow *ui;
QPointer<FfmpegProcess> ffmpeg;
QPointer<StyleChainer> fastNeuralStyle;
Paths *paths;
//MpvWidget *m_mpv;
QPointer<Mplayer> mp;
QLabel *mplayerVideo;
QStringList lstFrames;
void getFramePerSec();//Get fps using ffmpeg
void extractFrames(); //Extract all frames
void extractAudio(); //Extract Audio
void styleFrames(); //Style frames
void chainerProcess();//invoke fast neural style transfer
void createStyledVideo();//Save video
long processingFrameCount;
QString strFramesPerSec;
QString strDuration;
long elaspsedTime;
int64_t frameCount;
AboutDialog *aboutDlg;
StyleIntensityDialog *styleIntensityDlg;
FrameDialog *frameDlg;
QTime tElapsed;
QTimer *timer;
QLabel *videoTimeLabel;
QLabel *videoStatusLabel;
QSettings *settings;
QBitArray *bitSettingsFirstRun;
QString mPath;
};
#endif // NEURALSTYLERWINDOW_H