7#include <boost/pfr/ops_fields.hpp>
15 static constexpr int size = 256;
25 auto n = std::max<>({ext.x(), ext.y(),
size});
26 return std::bit_width(
unsigned((n - 1) /
size));
33 for (
int i = lim; i > 0; --i)
47 if (ext.x() <= 0 || ext.y() <= 0)
50 auto nx = ext.x() / tl + (ext.x() % tl != 0);
51 auto ny = ext.y() / tl + (ext.y() % tl != 0);
52 for (
int y{};
y < ny; ++
y)
53 for (
int x{};
x < nx; ++
x)
54 co_yield {.z =
zoom, .y =
y, .x =
x};
62 {std::clamp(
x * tl, 0, ext.x()), std::clamp(
y * tl, 0, ext.y())},
63 {std::clamp((
x + 1) * tl, 0, ext.x()),
64 std::clamp((
y + 1) * tl, 0, ext.y())}};
72 auto nx = w / px + (w % px != 0);
73 auto ny = h / px + (h % px != 0);
75 {{double(w) / nx, 0., double(
x)},
76 {0., double(h) / ny, double(
y)},
84struct std::hash<
boat::tile> {
constexpr auto xywh
Definition vocabulary.hpp:120
boost::qvm::mat< double, 3, 3 > matrix
Definition vocabulary.hpp:104
model::box< point > box
Definition vocabulary.hpp:71
model::d2::point_xy< int, cs::cartesian > point
Definition vocabulary.hpp:65
friend auto operator<=>(tile const &, tile const &)=default
static constexpr int size
Maximum tile side in pixels.
Definition tile.hpp:15
static int zoom(geometry::raster::point ext, double scale)
Definition tile.hpp:29
int y
Definition tile.hpp:13
geometry::raster::box rect(geometry::raster::point ext) const
Clips the tile window to the raster extent.
Definition tile.hpp:58
static int scale(geometry::raster::point ext, int zoom)
Raster pixels per tile pixel.
Definition tile.hpp:40
static std::generator< tile > all(geometry::raster::point ext, int zoom)
Definition tile.hpp:45
friend auto hash_value(tile const &v)
Definition tile.hpp:20
auto affine(geometry::raster::point ext) const
Maps tile pixels to raster pixels.
Definition tile.hpp:68
int z
Definition tile.hpp:13
int x
Definition tile.hpp:13
static int zmax(geometry::raster::point ext)
One raster pixel per tile pixel.
Definition tile.hpp:23
static constexpr int half_size
Definition tile.hpp:16
static auto operator()(boat::tile const &v)
Definition tile.hpp:85