comparison ostc45_icon.h @ 5:115cfa4a3239 default tip

Added icon upload function for OSTC 4/5 For the upload the same process as the one for the firmware update is used => CRC functionality has been copied from the ostc_pack SW
author Ideenmodellierer
date Tue, 30 Dec 2025 21:41:02 +0100
parents
children
comparison
equal deleted inserted replaced
4:e30f00f760d3 5:115cfa4a3239
1 #ifndef OSTC45_ICON_H
2 #define OSTC45_ICON_H
3
4 #include <cstdint>
5 #include <vector>
6 #include <stdexcept>
7 #include <iostream>
8 #include <QString>
9 #include <QVector>
10 #include <QIODevice>
11 #include <QFile>
12 #include <QByteArray>
13
14 class BmpToArray
15 {
16 public:
17 struct CLUTEntry {
18 uint8_t b;
19 uint8_t g;
20 uint8_t r;
21 uint8_t a; // BMP setzt meist 0
22 };
23
24 QByteArray getTransferBytes() const;
25 void getImageXY(uint32_t* x, uint32_t* y);
26 BmpToArray(const QString& fileName);
27
28 private:
29 void loadBMP(const QString& filename);
30
31 QVector<CLUTEntry> clut;
32 QVector<uint8_t> pixelData; // Pixel-Indizes
33 QVector<uint32_t> clut32; // 32-Bit Palette
34 uint32_t width = 0;
35 uint32_t height = 0;
36 };
37 #endif // OSTC45_ICON_H