Mercurial > public > ostc_companion
comparison ostc45_icon.h @ 11:6fba58c4964b
Minor changes done by automatic style checker
| author | Ideenmodellierer |
|---|---|
| date | Mon, 12 Jan 2026 13:57:24 +0000 |
| parents | 115cfa4a3239 |
| children |
comparison
equal
deleted
inserted
replaced
| 10:9a3c1a6f9833 | 11:6fba58c4964b |
|---|---|
| 1 #ifndef OSTC45_ICON_H | 1 #ifndef OSTC45_ICON_H |
| 2 #define OSTC45_ICON_H | 2 #define OSTC45_ICON_H |
| 3 | 3 |
| 4 #include <cstdint> | 4 #include <QByteArray> |
| 5 #include <vector> | 5 #include <QFile> |
| 6 #include <stdexcept> | 6 #include <QIODevice> |
| 7 #include <iostream> | |
| 8 #include <QString> | 7 #include <QString> |
| 9 #include <QVector> | 8 #include <QVector> |
| 10 #include <QIODevice> | 9 #include <cstdint> |
| 11 #include <QFile> | 10 #include <iostream> |
| 12 #include <QByteArray> | 11 #include <stdexcept> |
| 12 #include <vector> | |
| 13 | 13 |
| 14 class BmpToArray | 14 class BmpToArray |
| 15 { | 15 { |
| 16 public: | 16 public: |
| 17 struct CLUTEntry { | 17 struct CLUTEntry |
| 18 { | |
| 18 uint8_t b; | 19 uint8_t b; |
| 19 uint8_t g; | 20 uint8_t g; |
| 20 uint8_t r; | 21 uint8_t r; |
| 21 uint8_t a; // BMP setzt meist 0 | 22 uint8_t a; // BMP setzt meist 0 |
| 22 }; | 23 }; |
| 23 | 24 |
| 24 QByteArray getTransferBytes() const; | 25 QByteArray getTransferBytes() const; |
| 25 void getImageXY(uint32_t* x, uint32_t* y); | 26 void getImageXY(uint32_t *x, uint32_t *y); |
| 26 BmpToArray(const QString& fileName); | 27 BmpToArray(const QString &fileName); |
| 27 | 28 |
| 28 private: | 29 private: |
| 29 void loadBMP(const QString& filename); | 30 void loadBMP(const QString &filename); |
| 30 | 31 |
| 31 QVector<CLUTEntry> clut; | 32 QVector<CLUTEntry> clut; |
| 32 QVector<uint8_t> pixelData; // Pixel-Indizes | 33 QVector<uint8_t> pixelData; // Pixel-Indizes |
| 33 QVector<uint32_t> clut32; // 32-Bit Palette | 34 QVector<uint32_t> clut32; // 32-Bit Palette |
| 34 uint32_t width = 0; | 35 uint32_t width = 0; |
| 35 uint32_t height = 0; | 36 uint32_t height = 0; |
| 36 }; | 37 }; |
| 37 #endif // OSTC45_ICON_H | 38 #endif // OSTC45_ICON_H |
