#ifndef IMAGEPROVIDER_H #define IMAGEPROVIDER_H #include "EgoInterface.h" #include #include #include 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; }; //摄像头视频数据展示到qt界面 class ShowImage : public QObject, public IRender { Q_OBJECT public: explicit ShowImage(QObject *parent,RenderPosition _pos); ImageProvider *m_pImgProvider; virtual void OnRender(std::unique_ptr &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_; }; #endif // IMAGEPROVIDER_H