64 uint32_t w, uint32_t
h, uint32_t requested, uint32_t min_extent = 16)
67 layout.
level[0] = { .ox = 0, .oy = 0, .w = w, .h =
h };
71 uint32_t column_h = 0;
72 uint32_t column_w = 0;
74 while (
count < wanted) {
76 const uint32_t lw = (above.w + 1U) / 2U;
77 const uint32_t lh = (above.h + 1U) / 2U;
78 if (std::min(lw, lh) < min_extent)
81 layout.
level[
count] = { .ox = w, .oy = column_h, .w = lw, .h = lh };
83 column_w = std::max(column_w, lw);
89 layout.
atlas_h = std::max(
h, column_h);
PyramidLayout pyramid_layout(uint32_t w, uint32_t h, uint32_t requested, uint32_t min_extent=16)
Place up to requested pyramid levels for a w x h base image.