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