mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-10-07 15:23:22 +02:00
38 lines
805 B
C
38 lines
805 B
C
|
#ifndef RASTER_H
|
||
|
#define RASTER_H
|
||
|
|
||
|
#include <QRect>
|
||
|
#include <QByteArray>
|
||
|
#include <QDebug>
|
||
|
#include "common/rectc.h"
|
||
|
#include "common/garmin.h"
|
||
|
|
||
|
class Raster {
|
||
|
public:
|
||
|
Raster() {}
|
||
|
Raster(const QByteArray &img, const QRect &rect) : _img(img), _rect(rect) {}
|
||
|
|
||
|
const QByteArray &img() const {return _img;}
|
||
|
const RectC rect() const
|
||
|
{
|
||
|
return RectC(Coordinates(toWGS32(_rect.left()), toWGS32(_rect.top())),
|
||
|
Coordinates(toWGS32(_rect.right()), toWGS32(_rect.bottom())));
|
||
|
}
|
||
|
bool isValid() const {return !_img.isNull();}
|
||
|
|
||
|
private:
|
||
|
QByteArray _img;
|
||
|
QRect _rect;
|
||
|
};
|
||
|
|
||
|
#ifndef QT_NO_DEBUG
|
||
|
inline QDebug operator<<(QDebug dbg, const Raster &raster)
|
||
|
{
|
||
|
dbg.nospace() << "Raster(" << raster.img().size() << ", " << raster.rect()
|
||
|
<< ")";
|
||
|
return dbg.space();
|
||
|
}
|
||
|
#endif // QT_NO_DEBUG
|
||
|
|
||
|
#endif // RASTER_H
|