1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-10-07 15:23:22 +02:00
GPXSee/src/map/IMG/lblfile.h

72 lines
1.9 KiB
C
Raw Normal View History

2021-02-03 23:34:03 +01:00
#ifndef LBLFILE_H
2019-05-10 18:56:19 +02:00
#define LBLFILE_H
2021-01-27 21:18:06 +01:00
#include <QImage>
#include "common/textcodec.h"
2019-05-10 18:56:19 +02:00
#include "subfile.h"
2019-06-30 20:39:22 +02:00
#include "label.h"
2019-05-10 18:56:19 +02:00
class HuffmanText;
class RGNFile;
2019-05-10 18:56:19 +02:00
class LBLFile : public SubFile
{
public:
LBLFile(IMG *img)
: SubFile(img), _huffmanText(0), _table(0), _offset(0), _size(0),
2021-01-27 21:18:06 +01:00
_poiOffset(0), _poiSize(0), _imgOffsetIdSize(0), _poiMultiplier(0),
_multiplier(0), _encoding(0) {}
LBLFile(const QString *path)
: SubFile(path), _huffmanText(0), _table(0), _offset(0), _size(0),
2021-01-27 21:18:06 +01:00
_poiOffset(0), _poiSize(0), _imgOffsetIdSize(0), _poiMultiplier(0),
_multiplier(0), _encoding(0) {}
LBLFile(SubFile *gmp, quint32 offset) : SubFile(gmp, offset),
_huffmanText(0), _table(0), _offset(0), _size(0), _poiOffset(0),
2021-01-27 21:18:06 +01:00
_poiSize(0), _imgOffsetIdSize(0), _poiMultiplier(0), _multiplier(0),
_encoding(0) {}
~LBLFile();
bool load(Handle &hdl, const RGNFile *rgn, Handle &rgnHdl);
void clear();
2019-05-10 18:56:19 +02:00
2020-02-16 12:57:40 +01:00
Label label(Handle &hdl, quint32 offset, bool poi = false,
bool capitalize = true) const;
2019-05-10 18:56:19 +02:00
quint8 imageIdSize() const {return _imgOffsetIdSize;}
2021-01-27 21:18:06 +01:00
QImage readImage(Handle &hdl, quint32 id) const;
2019-05-10 18:56:19 +02:00
private:
2021-01-27 21:18:06 +01:00
struct File {
File() : offset(0), size(0) {}
File(quint32 offset, quint32 size) : offset(offset), size(size) {}
quint32 offset;
quint32 size;
};
Label str2label(const QVector<quint8> &str, bool capitalize) const;
2020-02-16 12:57:40 +01:00
Label label6b(Handle &hdl, quint32 offset, bool capitalize) const;
Label label8b(Handle &hdl, quint32 offset, bool capitalize) const;
Label labelHuffman(Handle &hdl, quint32 offset, bool capitalize) const;
2021-01-27 21:18:06 +01:00
bool loadFiles(Handle &hdl, quint32 count, quint32 offset,
quint32 recordSize);
HuffmanText *_huffmanText;
quint32 *_table;
TextCodec _codec;
2019-05-10 18:56:19 +02:00
quint32 _offset;
quint32 _size;
quint32 _poiOffset;
quint32 _poiSize;
quint32 _imgOffset;
quint32 _imgSize;
quint8 _imgOffsetIdSize;
2019-08-12 22:20:12 +02:00
quint8 _poiMultiplier;
2019-05-10 18:56:19 +02:00
quint8 _multiplier;
quint8 _encoding;
2021-01-27 21:18:06 +01:00
QVector<File> _rasters;
2019-05-10 18:56:19 +02:00
};
#endif // LBLFILE_H