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 ***** */
33 #include "colourSpace.h"
34 #include "sequenceReader.h"
36 #include <QGraphicsView>
40 class View
: public QGraphicsView
44 View(QWidget
*parent
= 0);
46 enum ProcessType
{processResample
=0, processColour
, processDisplay
, processScene
};
56 int getRotation(void);
59 void pixelInfoMessage(const QString
&, int);
60 void zoomChanged(float);
64 void setYUVRGBScaling(bool scaled
);
65 void setYUVColourMatrix(ColourSpace::MatrixType
);
66 void setYUVdisplayMode(YUVdisplayMode
);
67 void setYUVbitDepth(int); //the bit depth from the gui menu
68 void setYUVnativeBitDepth(int); //the bit depth of the original file, or 0 if unknown
72 void showFrame(const RawFrame
*);
75 void invalidateFrame();
76 void processImage(const ProcessType type
);
78 //deal with mouse interaction
79 void wheelEvent(QWheelEvent
* wheelEvent
);
80 void mouseDoubleClickEvent(QMouseEvent
* e
);
85 //QGraphicsView *graphicsView;
86 QGraphicsScene
*scene
;
88 //information for displaying a YUV image from a headerless file
90 int yuvImageNativeBitDepth
;
91 bool yuvImageRGBScaling
;
92 ColourSpace::MatrixType yuvImageColourMatrix
;
93 RawFrame::Chroma inChroma
;
94 SequenceReader::RawType yuvFormat
;
96 //stores for loading, resampling and colour converting the input
101 //settings that change the appearance of the image
102 YUVdisplayMode yuvDisplayMode
;