2021-04-10 15:27:40 +02:00
|
|
|
#ifndef IMG_RASTER_H
|
|
|
|
#define IMG_RASTER_H
|
2021-01-25 21:37:07 +01:00
|
|
|
|
|
|
|
#include <QRect>
|
|
|
|
#include <QDebug>
|
|
|
|
#include "common/rectc.h"
|
|
|
|
#include "common/garmin.h"
|
|
|
|
|
2021-04-10 15:27:40 +02:00
|
|
|
namespace IMG {
|
|
|
|
|
2021-01-27 21:18:06 +01:00
|
|
|
class LBLFile;
|
|
|
|
|
2021-01-25 21:37:07 +01:00
|
|
|
class Raster {
|
|
|
|
public:
|
2021-01-27 21:18:06 +01:00
|
|
|
Raster() : _lbl(0) {}
|
|
|
|
Raster(const LBLFile *lbl, quint32 id, const QRect &rect)
|
|
|
|
: _lbl(lbl), _id(id), _rect(rect) {}
|
2021-01-25 21:37:07 +01:00
|
|
|
|
2021-01-27 21:18:06 +01:00
|
|
|
const LBLFile *lbl() const {return _lbl;}
|
|
|
|
quint32 id() const {return _id;}
|
2021-01-25 21:37:07 +01:00
|
|
|
const RectC rect() const
|
|
|
|
{
|
2021-09-20 21:43:17 +02:00
|
|
|
return RectC(Coordinates(Garmin::toWGS32(_rect.left()),
|
|
|
|
Garmin::toWGS32(_rect.top())), Coordinates(
|
|
|
|
Garmin::toWGS32(_rect.right()), Garmin::toWGS32(_rect.bottom())));
|
2021-01-25 21:37:07 +01:00
|
|
|
}
|
2021-01-27 21:18:06 +01:00
|
|
|
bool isValid() const {return (_lbl != 0);}
|
2021-01-25 21:37:07 +01:00
|
|
|
|
|
|
|
private:
|
2021-01-27 21:18:06 +01:00
|
|
|
const LBLFile *_lbl;
|
|
|
|
quint32 _id;
|
2021-01-25 21:37:07 +01:00
|
|
|
QRect _rect;
|
|
|
|
};
|
|
|
|
|
2021-04-10 15:27:40 +02:00
|
|
|
}
|
|
|
|
|
2021-01-25 21:37:07 +01:00
|
|
|
#ifndef QT_NO_DEBUG
|
2021-04-10 15:27:40 +02:00
|
|
|
inline QDebug operator<<(QDebug dbg, const IMG::Raster &raster)
|
2021-01-25 21:37:07 +01:00
|
|
|
{
|
2021-01-27 21:18:06 +01:00
|
|
|
dbg.nospace() << "Raster(" << raster.rect() << ")";
|
2021-01-25 21:37:07 +01:00
|
|
|
return dbg.space();
|
|
|
|
}
|
|
|
|
#endif // QT_NO_DEBUG
|
|
|
|
|
2021-04-10 15:27:40 +02:00
|
|
|
#endif // IMG_RASTER_H
|