1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- #ifndef IMAGEPROVIDER_H
- #define IMAGEPROVIDER_H
- #include "EgoInterface.h"
- #include <QImage>
- #include <QQuickImageProvider>
- #include <mutex>
- /*
- 请求视频数据类
- 提供数据图像给qt界面使用
- */
- class ImageProvider : public QQuickImageProvider {
- public:
- ImageProvider();
- QImage requestImage(const QString& id, QSize* size,
- const QSize& requestedSize);
- QPixmap requestPixmap(const QString& id, QSize* size,
- const QSize& requestedSize);
- QImage img;
- };
- /*
- 展示视频数据类
- 管理图像数据与qml界面的交互
- */
- class ShowImage : public QObject, public IRender {
- Q_OBJECT
- public:
- explicit ShowImage(QObject* parent, RenderPosition _pos);
- ImageProvider* m_pImgProvider;
- virtual void OnRender(std::unique_ptr<uint8_t>& pBuffer, int32_t width,
- int32_t height) override;
- virtual void Empty() override;
- public slots:
- void sendFrontImage();
- void sendBackImage();
- void sendLeftImage();
- void sendRightImage();
- void sendLeftAnchor();
- void sendRightAnchor();
- //void sendPanelImage(QImage);
- signals:
- void callQmlRefeshFrontImg();
- void callQmlRefeshBackImg();
- void callQmlRefeshRightImg();
- void callQmlRefeshLeftImg();
- void callQmlRefeshLeftAnchor();
- void callQmlRefeshRightAnchor();
- void callQmlRefeshPanelImg();
- //void sendPic(QImage image);
- private:
- QImage m_image;
- RenderPosition campos;
- std::mutex buffer_lock_;
- quint16 m_CountF = 0;
- };
- #endif // IMAGEPROVIDER_H
|