-
Notifications
You must be signed in to change notification settings - Fork 10
/
QVideoFrameBits.h
50 lines (39 loc) · 1.56 KB
/
QVideoFrameBits.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
#ifndef __QVideoFrameBits__
#define __QVideoFrameBits__
#include <QImage>
#include <QRect>
#include <QSize>
#include <QPoint>
#include <QVideoFrame>
#include <QVideoSurfaceFormat>
class QVideoFrameBits
{
public:
QVideoFrameBits( QImage* image = nullptr, QVideoFrame* videoFrame = nullptr, const QVideoSurfaceFormat& surfaceFormat = QVideoSurfaceFormat(), int videoOutputOrientation = 0 );
void setSource( uchar* bits, const QSize& sourceSize, const QPoint& sourceDelta, bool topToBottom = true );
void setSource( QImage& image, QVideoFrame* videoFrame = nullptr, const QVideoSurfaceFormat& surfaceFormat = QVideoSurfaceFormat() );
const QRect& sourceClipRect() const { return m_SourceClipRect; }
void setSourceClipRect( const QRect& sourceClipRect );
int videoOutputOrientation() { return m_VideoOutputOrientation; }
void setVideoOutputOrientation( int videoOutputOrientation );
bool mirror() const { return m_Mirror; }
void setMirror( bool mirror );
void getScanLine( int y, uchar* bits );
uchar* getPixelAddress( int x, int y );
inline int width() const { return m_TransformSize.width(); }
inline int height() const { return m_TransformSize.height(); }
inline QPoint transformDelta() const { return m_TransformDelta; }
protected:
uchar* m_SourceBits;
QSize m_SourceSize;
bool m_SourceTopToBottom;
QPoint m_SourceDelta;
QRect m_SourceClipRect;
int m_VideoOutputOrientation;
bool m_Mirror;
uchar* m_TransformBits;
QSize m_TransformSize;
QPoint m_TransformDelta;
void update();
};
#endif