Optimization
[GPXSee.git] / src / map / worldfilemap.h
blob4de8439762bb59f35438a37e8985a967f8abed93
1 #ifndef WORLDFILEMAP_H
2 #define WORLDFILEMAP_H
4 #include "transform.h"
5 #include "projection.h"
6 #include "map.h"
8 class Image;
10 class WorldFileMap : public Map
12 Q_OBJECT
14 public:
15 WorldFileMap(const QString &fileName, QObject *parent = 0);
16 ~WorldFileMap();
18 RectC llBounds(const Projection &proj);
19 QRectF bounds();
20 QPointF ll2xy(const Coordinates &c);
21 Coordinates xy2ll(const QPointF &p);
23 void draw(QPainter *painter, const QRectF &rect, Flags flags);
25 void load(const Projection &in, const Projection &out, qreal deviceRatio,
26 bool hidpi);
27 void unload();
29 bool isValid() const {return _valid;}
30 QString errorString() const {return _errorString;}
32 static Map *create(const QString &path, bool *isDir);
34 private:
35 Projection _projection;
36 Transform _transform;
37 Image *_img;
38 QSize _size;
39 qreal _mapRatio;
40 QString _imgFile;
41 bool _hasPRJ;
43 bool _valid;
44 QString _errorString;
47 #endif // WORLDFILEMAP_H