forked from organicmaps/organicmaps
Pass coordBits (point precision) as a parameter to point conversion function.
This commit is contained in:
parent
1815a87575
commit
3a82b688a3
2 changed files with 12 additions and 8 deletions
|
@ -14,7 +14,7 @@
|
|||
namespace
|
||||
{
|
||||
|
||||
inline double CoordSize() { return (1 << POINT_COORD_BITS); }
|
||||
inline double CoordSize(uint32_t coordBits) { return (1 << coordBits); }
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -5,18 +5,22 @@
|
|||
|
||||
#include "../std/utility.hpp"
|
||||
|
||||
#define COORD_BITS 30
|
||||
|
||||
typedef double CoordT;
|
||||
typedef pair<CoordT, CoordT> CoordPointT;
|
||||
|
||||
typedef m2::CellId<19> RectId;
|
||||
|
||||
m2::PointU PointD2PointU(CoordT x, CoordT y);
|
||||
CoordPointT PointU2PointD(m2::PointU const & p);
|
||||
m2::PointU PointD2PointU(CoordT x, CoordT y, uint32_t coordBits = COORD_BITS);
|
||||
CoordPointT PointU2PointD(m2::PointU const & p, uint32_t coordBits = COORD_BITS);
|
||||
|
||||
int64_t PointToInt64(CoordT x, CoordT y);
|
||||
inline int64_t PointToInt64(CoordPointT const & pt) { return PointToInt64(pt.first, pt.second); }
|
||||
CoordPointT Int64ToPoint(int64_t v);
|
||||
int64_t PointToInt64(CoordT x, CoordT y, uint32_t coordBits = COORD_BITS);
|
||||
inline int64_t PointToInt64(CoordPointT const & pt, uint32_t coordBits = COORD_BITS)
|
||||
{
|
||||
return PointToInt64(pt.first, pt.second, coordBits);
|
||||
}
|
||||
CoordPointT Int64ToPoint(int64_t v, uint32_t coordBits = COORD_BITS);
|
||||
|
||||
pair<int64_t, int64_t> RectToInt64(m2::RectD const & r);
|
||||
m2::RectD Int64ToRect(pair<int64_t, int64_t> const & p);
|
||||
pair<int64_t, int64_t> RectToInt64(m2::RectD const & r, uint32_t coordBits = COORD_BITS);
|
||||
m2::RectD Int64ToRect(pair<int64_t, int64_t> const & p, uint32_t coordBits = COORD_BITS);
|
||||
|
|
Loading…
Add table
Reference in a new issue