123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- #ifndef IMAGEPROVIDER_H
- #define IMAGEPROVIDER_H
- #include "EgoInterface.h"
- #include <QImage>
- #include <QQuickImageProvider>
- #include <mutex>
- #include"YOLOv5Detector.h"
- 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<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_;
- YOLOv5Detector *detector;
- };
- #endif // IMAGEPROVIDER_H
|