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

45 lines
879 B
C
Raw Normal View History

2021-04-10 15:27:40 +02:00
#ifndef IMG_RASTER_H
#define IMG_RASTER_H
#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;
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-27 21:18:06 +01:00
const LBLFile *lbl() const {return _lbl;}
quint32 id() const {return _id;}
const RectC rect() const
{
return RectC(Coordinates(toWGS32(_rect.left()), toWGS32(_rect.top())),
Coordinates(toWGS32(_rect.right()), toWGS32(_rect.bottom())));
}
2021-01-27 21:18:06 +01:00
bool isValid() const {return (_lbl != 0);}
private:
2021-01-27 21:18:06 +01:00
const LBLFile *_lbl;
quint32 _id;
QRect _rect;
};
2021-04-10 15:27:40 +02:00
}
#ifndef QT_NO_DEBUG
2021-04-10 15:27:40 +02:00
inline QDebug operator<<(QDebug dbg, const IMG::Raster &raster)
{
2021-01-27 21:18:06 +01:00
dbg.nospace() << "Raster(" << raster.rect() << ")";
return dbg.space();
}
#endif // QT_NO_DEBUG
2021-04-10 15:27:40 +02:00
#endif // IMG_RASTER_H