]> git.sesse.net Git - nageru/blob - jpeg_frame_view.h
Actually start showing JPEGs on the screen.
[nageru] / jpeg_frame_view.h
1 #ifndef _JPEG_FRAME_VIEW_H
2 #define _JPEG_FRAME_VIEW_H 1
3
4 #include <QGraphicsView>
5 #include <QGraphicsPixmapItem>
6 #include <QGraphicsScene>
7
8 #include <stdint.h>
9
10 class JPEGFrameView : public QGraphicsView {
11         Q_OBJECT
12
13 public:
14         JPEGFrameView(QWidget *parent);
15
16         void setFrame(unsigned stream_idx, int64_t pts)
17         {
18                 this->stream_idx = stream_idx;
19                 this->pts = pts;
20                 update();
21         }
22
23 protected:
24         void resizeEvent(QResizeEvent *event) override;
25
26 private:
27         void update();
28
29         QGraphicsPixmapItem item;
30         QGraphicsScene scene;
31
32         unsigned stream_idx;
33         int64_t pts;
34 };
35
36 #endif  // !defined(_JPEG_FRAME_VIEW_H)