-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathycbcrlabview.h
222 lines (171 loc) · 7.18 KB
/
ycbcrlabview.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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
/*******************************************************************************
YCbCr Exporter
A tool to aid filmmakers / artists to manipulate YCbCr files to
maximize quality.
Copyright (C) 2013 Troy James Sobotka, [email protected]
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 3 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, see <http://www.gnu.org/licenses/>.
*******************************************************************************/
#ifndef YCBCRLABVIEW_H
#define YCBCRLABVIEW_H
#include <QtGui>
#include <exception>
#include "textpill.h"
#include "ffsequence.h"
#include "qbasegraphicsview.h"
#include "qgraphicstrimslider.h"
#define YCBCRVIEW_SCALE_INCREMENT 10
// Default speed of scaling for zooming in and out.
#define YCBCRVIEW_WHEEL_SCALEFACTOR 1.15f
#define YCBCRVIEW_OVERLAY_MARGIN 80
// Animations and Transitions
#define YCBCRVIEW_DURATION_INTROFADEIN 250
#define INITANIM 10
#define PROGRESS_FADE_DURATION 1000
#define PROGRESS_HEIGHT 6
#define PROGRESS_MAXIMUM 1000
#define YCBCRVIEW_TRANSPARENT 0.0
#define YCBCRVIEW_OPAQUE 1.0
#define TIMELINE_DURATION 350
#define TIMELINE_ZOOM_UPDATE 16
#define TIMELINE_PROGRESS_UPDATE 16
#define TIMELINE_PROGRESS_DELAY 0.05
#define DEFAULT_PADDING 10
#define TEXT_PADDING_X DEFAULT_PADDING
#define TEXT_PADDING_Y DEFAULT_PADDING
#define SLIDER_OPACITY 0.70
#define MAXIMUM_SCALE 100.00
#define MINIMUM_SCALE 0.250
class QffSequence : public QObject, public ffSequence
{
Q_OBJECT
signals:
void signal_progressStart(void);
void signal_progress(double);
void signal_progressEnd(void);
void signal_justLoading(void);
void signal_justOpened(void);
void signal_justClosed(void);
void signal_justErrored(void);
// setFunction() Events
void signal_exportTrimChanged(long, long, void*);
void signal_exportPlaneChanged(ffExportDetails::ExportPlane, void *);
void signal_exportPathChanged(std::string, void *);
void signal_exportFormatChanged(ffExportDetails::ExportFormat, void *);
void signal_frameChanged(long, void *);
private:
void onProgressStart(void);
void onProgress(double);
void onProgressEnd(void);
void onJustLoading(void);
void onJustOpened(void);
void onJustClosed(void);
// void onJustErrored(void);
void onExportTrimChanged(long, long, void *);
void onExportPlaneChanged(ffExportDetails::ExportPlane, void *);
void onExportPathChanged(std::string, void *);
void onExportFormatChanged(ffExportDetails::ExportFormat, void *);
void onFrameChanged(long, void *);
public:
explicit QffSequence(QWidget *parent = 0);
};
class YCbCrLabView : public QWidget
{
Q_OBJECT
public:
enum Default
{
SliderPadding = 10
};
explicit YCbCrLabView(QWidget *parent = 0);
~YCbCrLabView();
void resetTransform(void);
void fitToView(void);
long getTotalFrames(void);
long getCurrentFrame(void);
void setCurrentFrame(long, void *sender);
QString getFileURI(void);
ffViewer::ViewerPlane getViewerPlane(void);
void setViewerPlane(ffViewer::ViewerPlane);
ffSequenceState getState(void);
void openSequence(char *);
void saveSequence(void);
void closeSequence(void);
QffSequence * getQffSequence(void);
QGraphicsPixmapItem* getGraphicsPixmapItem(void);
QTextPill* getTextPillItem(void);
signals:
void signal_frameChange(long, void *);
void signal_trimChange(long, long, void *);
void signal_error(QString);
void signal_stateChanged(ffSequenceState);
public slots:
void onSliderChanged(long);
void onScaleTimeslice(qreal x);
void onScaleAnimFinished(void);
// void onError(QString);
// ffSequence Events
void onProgressStart(void);
void onProgress(double);
void onProgressEnd(void);
void onProgressAnimation(qreal);
void onJustLoading(void);
void onJustOpened(void);
void onJustClosed(void);
// void onJustErrored(void);
void onStateChanged(ffSequenceState);
// ffSequence setFunction Events
void onFrameChanged(long, void *);
void onExportTrimChanged(long in, long out, void *);
void onExportTrimInPressed(void);
void onExportTrimOutPressed(void);
void onExportPlaneChanged(ffExportDetails::ExportPlane, void *);
void onFrameForward(void);
void onFrameBack(void);
private:
QGraphicsAnchorLayout *m_pGraphicsAnchorLayout;
QBaseGraphicsView *m_pGraphicsView;
QBaseGraphicsView *m_pGraphicsViewOverlay;
QGraphicsWidget *m_pOverlayAnchor;
QGraphicsScene *m_pGraphicsScene;
QGraphicsScene *m_pGraphicsSceneOverlay;
QGraphicsPixmapItem *m_pGraphicsPixmapItem;
QffSequence *m_pffSequence;
QTimeLine *m_pTimeLine;
QGraphicsOpacityEffect *m_pFadePixmap;
QPropertyAnimation *m_pFadePixmapAnimation;
QGraphicsOpacityEffect *m_pFadeProgressBar;
QPropertyAnimation *m_pFadeProgressBarAnimation;
QGraphicsOpacityEffect *m_pFadeFrameScrubber;
QPropertyAnimation *m_pFadeFrameScrubberAnimation;
QTimeLine *m_pProgressTimeline;
QProgressBar *m_pProgressBar;
QGraphicsWidget *m_pgwProgressBar;
QTextPill *m_pTextPill;
QGraphicsTrimSlider *m_pSlider;
ffViewer::ViewerPlane m_viewerPlane;
QShortcut *m_pShortcutTrimIn;
QShortcut *m_pShortcutTrimOut;
QShortcut *m_pShortcutSingleFrameAhead;
QShortcut *m_pShortcutSingleFrameBack;
int m_numScheduledScalings;
int m_targetProgress;
void createObjects(void);
void createActions(void);
void createAnimations(void);
void initObjects(void);
void wheelEvent(QWheelEvent *);
void resizeEvent(QResizeEvent *);
void mouseReleaseEvent(QMouseEvent *);
void mousePressEvent(QMouseEvent *);
void mouseMoveEvent(QMouseEvent *);
};
#endif // YCBCRLABVIEW_H