Welcome to mirror list, hosted at ThFree Co, Russian Federation.

point_to_integer.hpp « coding - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: afd46b90d670354aa4ff894ac14024dc3251a08e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#pragma once

#include "geometry/cellid.hpp"
#include "geometry/rect2d.hpp"

#include <utility>

#define POINT_COORD_BITS 30

m2::PointU PointD2PointU(double x, double y, uint32_t coordBits);
inline m2::PointU PointD2PointU(m2::PointD const & pt, uint32_t coordBits)
{
  return PointD2PointU(pt.x, pt.y, coordBits);
}

m2::PointD PointU2PointD(m2::PointU const & p, uint32_t coordBits);

int64_t PointToInt64(double x, double y, uint32_t coordBits);
inline int64_t PointToInt64(m2::PointD const & pt, uint32_t coordBits)
{
  return PointToInt64(pt.x, pt.y, coordBits);
}

m2::PointD Int64ToPoint(int64_t v, uint32_t coordBits);

std::pair<int64_t, int64_t> RectToInt64(m2::RectD const & r, uint32_t coordBits);
m2::RectD Int64ToRect(std::pair<int64_t, int64_t> const & p, uint32_t coordBits);

uint32_t DoubleToUint32(double x, double min, double max, uint32_t coordBits);

double Uint32ToDouble(uint32_t x, double min, double max, uint32_t coordBits);