YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
videoproducer.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: LGPL-2.1-or-later
4 */
5
6#ifndef VIDEOPRODUCER_H
7#define VIDEOPRODUCER_H
8
9#include <QObject>
10#include <QMutex>
11#include <QAbstractVideoSurface>
12#include <QVideoSurfaceFormat>
13
19class VideoProducer : public QObject
20{
21 Q_OBJECT
22 Q_PROPERTY(QAbstractVideoSurface *videoSurface READ videoSurface WRITE setVideoSurface)
23 Q_PROPERTY(int frameWidth READ getWidth)
24 Q_PROPERTY(int frameHeight READ getHeight)
25
26public:
27 VideoProducer(QObject *parent = 0);
29 QString getPixelAsStr(int x, int y);
30
31 QAbstractVideoSurface *videoSurface() const;
32 void setVideoSurface(QAbstractVideoSurface *surface);
33
34 int getWidth();
35 int getHeight();
36
37private:
38 QAbstractVideoSurface *m_surface;
39 QVideoSurfaceFormat *m_format;
40 QVideoFrame *m_frame; // Stores the value of the current video frame to allow "color picking"
41 QMutex mutex;
42
43signals:
45
46public slots:
47 void onNewVideoContentReceived(QVideoFrame *frame);
48
49
50};
51
52#endif // VIDEOPRODUCER_H
The videoproducer class.
void setVideoSurface(QAbstractVideoSurface *surface)
sets the abstract surface
void resizeWindowRequest()
QString getPixelAsStr(int x, int y)
Pics the rgb value of the pixel specified by x and y and return it as a string.
QAbstractVideoSurface * videoSurface
int getHeight()
returns the height of the surface
int getWidth()
returns the width of the surface
void onNewVideoContentReceived(QVideoFrame *frame)
This gets the frame and presents it to the abstract surface.