QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
ImageProtocolManager.h
Go to the documentation of this file.
1#pragma once
2
3#include "MAVLinkLib.h"
4
5#include <QtCore/QByteArray>
6#include <QtCore/QLoggingCategory>
7#include <QtCore/QObject>
8#include <QtGui/QImage>
9
10Q_DECLARE_LOGGING_CATEGORY(ImageProtocolManagerLog)
11
12
14class ImageProtocolManager : public QObject
15{
16 Q_OBJECT
17
18public:
19 ImageProtocolManager(QObject *parent = nullptr);
21
22 uint32_t flowImageIndex() const { return _flowImageIndex; }
23
24 bool requestImage(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t &message);
25 void cancelRequest(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t &message);
26
27signals:
28 void imageReady(const QImage &image);
29 void flowImageIndexChanged(uint32_t index);
30
31public slots:
32 void mavlinkMessageReceived(const mavlink_message_t &message);
33
34private:
35 QImage _getImage();
36
37 mavlink_data_transmission_handshake_t _imageHandshake = {};
38 QByteArray _imageBytes;
39 uint32_t _flowImageIndex = 0;
40};
Q_DECLARE_LOGGING_CATEGORY(AndroidSerialLog)
struct __mavlink_message mavlink_message_t
uint32_t flowImageIndex() const
void flowImageIndexChanged(uint32_t index)
void imageReady(const QImage &image)