1 /* ***** BEGIN LICENSE BLOCK *****
7 * Copyright (c) 2008 BBC Research
9 * Permission is hereby granted, free of charge, to any person obtaining a copy
10 * of this software and associated documentation files (the "Software"), to deal
11 * in the Software without restriction, including without limitation the rights
12 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 * copies of the Software, and to permit persons to whom the Software is
14 * furnished to do so, subject to the following conditions:
16 * The above copyright notice and this permission notice shall be included in
17 * all copies or substantial portions of the Software.
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
27 * ***** END LICENSE BLOCK ***** */
35 #include "colourSpace.h"
39 class MainWindow
: public QMainWindow
48 void setZoom(QAction
*);
49 void setYUVdisplayMode(QAction
*);
50 void setRGBScaling(QAction
*);
51 void setColourMatrix(QAction
*);
52 void setCustomSize(bool);
53 void setPresetSize(QAction
*);
54 void setYUVimageDepth(QAction
*);
55 void setYUVimageFormat(QAction
*);
56 void setScrollBar(QAction
*);
57 void setFullScreen(bool);
58 void toggleFullScreen();
59 void escapeFullScreen();
62 void processSize(QSize
&);
63 void viewImageZoomChanged(float);
64 void processSequencePosition(const QString
&, int, int, int, int);
65 void processHasHeader(bool);
66 void processBitDepth(int);
67 void jumpToFirstFrame();
68 void jumpToFrameRelative(QAction
*);
69 void jumpToFrameAbsolute();
70 void jumpToLastFrame();
73 void openRecentFile();
74 void closeEvent(QCloseEvent
*event
);
78 void helpViewerClosed();
83 void updateRecentFileActions();
84 void updateRgbScaling(bool scaled
);
85 void updateDisplayMode(View::YUVdisplayMode mode
);
86 void updateColourMatrix(ColourSpace::MatrixType matrix
);
87 void updateRawImageSize(SequenceReader::ImageSizes size
);
88 void updateYUVbitDepth(int depth
);
89 void updateYUVFormat(int format
);
90 void updateZoom(double zoom
);
91 void updateScrollBarPolicy(Qt::ScrollBarPolicy policy
);
94 void createStatusBar();
96 void initializeAssistant();
98 QProcess
*assistantClientProcess
;
99 bool assistantClientStarted
;
102 QStringList recentFiles
;
103 QAction
*recentFileSeperatorAct
;
104 enum {MaxRecentFiles
= 5};
105 QAction
*recentFileAct
[MaxRecentFiles
];
107 //view menu actions and groups
108 QActionGroup
*YUVModeGroup
; //YUV display mode
110 QActionGroup
*zoomGroup
;
112 QActionGroup
*rgbScalingGroup
; //YUV->RGB scaling is 1:1 or 255/219
113 QActionGroup
*matrixGroup
; //Use either the HDTV or SDTV colour matrix
114 QActionGroup
*scrollBarGroup
;
116 QAction
*toggleToolBarAct
;
118 //image menu actions and groups
119 QMenu
*imageFormatMenu
;
120 QActionGroup
*imageFormatGroup
;
122 QMenu
*imageSizeMenu
;
123 QMenu
*imageDepthMenu
;
124 QActionGroup
*imageSizeGroup
;
125 QAction
*imageSizeSetCustomAct
;
127 QActionGroup
*imageDepthGroup
;
131 SequenceReader reader
;
134 QStatusBar
*myStatusBar
;
135 QLabel
*fileFormatLabel
;
136 QLabel
*fileSizeLabel
;
137 QLabel
*fileZoomLabel
;
138 QLabel
*fileNameLabel
;
142 QSpinBox
*jumpToFrameSpin
;