1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-28 21:51:17 +01:00
GPXSee/src/map/IMG/raster.h

46 lines
916 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
{
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-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