GREM 3.12.0
Game/Rendering Engine Modules for C++
Loading...
Searching...
No Matches
extents.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 Ivar Härnqvist
2// SPDX-License-Identifier: MIT
3
4#ifndef GREM_CORE_EXTENTS_HPP
5#define GREM_CORE_EXTENTS_HPP
6
8
10#include <GREM/core/math.hpp>
11
12namespace grem {
13
19template <size_t N>
20struct Offset;
23
29template <size_t N>
30struct Extent;
33
34template <>
35struct Offset<3> {
43 [[nodiscard]] static constexpr Offset<3> from(i32vec3 v) noexcept {
44 return {.x = v.x, .y = v.y, .z = v.z};
45 }
46
55 [[nodiscard]] static Offset<3> round(vec3 v) {
56 return {
57 .x = static_cast<int32_t>(grem::round(v.x)),
58 .y = static_cast<int32_t>(grem::round(v.y)),
59 .z = static_cast<int32_t>(grem::round(v.z)),
60 };
61 }
62
71 [[nodiscard]] static Offset<3> floor(vec3 v) {
72 return {
73 .x = static_cast<int32_t>(grem::floor(v.x)),
74 .y = static_cast<int32_t>(grem::floor(v.y)),
75 .z = static_cast<int32_t>(grem::floor(v.z)),
76 };
77 }
78
87 [[nodiscard]] static Offset<3> ceil(vec3 v) {
88 return {
89 .x = static_cast<int32_t>(grem::ceil(v.x)),
90 .y = static_cast<int32_t>(grem::ceil(v.y)),
91 .z = static_cast<int32_t>(grem::ceil(v.z)),
92 };
93 }
94
103 [[nodiscard]] static Offset<3> trunc(vec3 v) {
104 return {
105 .x = static_cast<int32_t>(grem::trunc(v.x)),
106 .y = static_cast<int32_t>(grem::trunc(v.y)),
107 .z = static_cast<int32_t>(grem::trunc(v.z)),
108 };
109 }
110
111 int32_t x;
112 int32_t y;
113 int32_t z;
114
120 constexpr operator vec3() const noexcept {
121 return vec3{static_cast<float>(x), static_cast<float>(y), static_cast<float>(z)};
122 }
123
129 constexpr operator dvec3() const noexcept {
130 return dvec3{static_cast<double>(x), static_cast<double>(y), static_cast<double>(z)};
131 }
132
138 constexpr operator ivec3() const noexcept {
139 return ivec3{static_cast<int>(x), static_cast<int>(y), static_cast<int>(z)};
140 }
141
147 constexpr operator u32vec3() const noexcept {
148 return u32vec3{static_cast<uint32_t>(x), static_cast<uint32_t>(y), static_cast<uint32_t>(z)};
149 }
150
158 [[nodiscard]] constexpr bool operator==(const Offset<3>& other) const = default;
159};
160
161template <>
162struct Extent<3> {
170 [[nodiscard]] static constexpr Extent<3> from(u32vec3 v) noexcept {
171 return {.width = v.x, .height = v.y, .depth = v.z};
172 }
173
182 [[nodiscard]] static Extent<3> round(vec3 v) {
183 return {
184 .width = static_cast<uint32_t>(grem::round(v.x)),
185 .height = static_cast<uint32_t>(grem::round(v.y)),
186 .depth = static_cast<uint32_t>(grem::round(v.z)),
187 };
188 }
189
198 [[nodiscard]] static Extent<3> floor(vec3 v) {
199 return {
200 .width = static_cast<uint32_t>(grem::floor(v.x)),
201 .height = static_cast<uint32_t>(grem::floor(v.y)),
202 .depth = static_cast<uint32_t>(grem::floor(v.z)),
203 };
204 }
205
214 [[nodiscard]] static Extent<3> ceil(vec3 v) {
215 return {
216 .width = static_cast<uint32_t>(grem::ceil(v.x)),
217 .height = static_cast<uint32_t>(grem::ceil(v.y)),
218 .depth = static_cast<uint32_t>(grem::ceil(v.z)),
219 };
220 }
221
230 [[nodiscard]] static Extent<3> trunc(vec3 v) {
231 return {
232 .width = static_cast<uint32_t>(grem::trunc(v.x)),
233 .height = static_cast<uint32_t>(grem::trunc(v.y)),
234 .depth = static_cast<uint32_t>(grem::trunc(v.z)),
235 };
236 }
237
238 uint32_t width;
239 uint32_t height = width;
240 uint32_t depth = 1;
241
248 constexpr explicit operator Offset<3>() const noexcept {
249 return Offset<3>{.x = static_cast<int32_t>(width), .y = static_cast<int32_t>(height), .z = static_cast<int32_t>(depth)};
250 }
251
258 constexpr operator vec3() const noexcept {
259 return vec3{static_cast<float>(width), static_cast<float>(height), static_cast<float>(depth)};
260 }
261
268 constexpr operator dvec3() const noexcept {
269 return dvec3{static_cast<double>(width), static_cast<double>(height), static_cast<double>(depth)};
270 }
271
278 constexpr operator ivec3() const noexcept {
279 return ivec3{static_cast<int>(width), static_cast<int>(height), static_cast<int>(depth)};
280 }
281
288 constexpr operator u32vec3() const noexcept {
289 return u32vec3{width, height, depth};
290 }
291
299 [[nodiscard]] constexpr bool operator==(const Extent<3>& other) const = default;
300
312 uint32_t fitIntegerScaled(Extent targetSize) {
313 uint32_t scale = 1;
314 const uint32_t originalWidth = width;
315 const uint32_t originalHeight = height;
316 const uint32_t originalDepth = depth;
317 while (true) {
318 const uint32_t nextWidth = originalWidth * (scale + 1);
319 const uint32_t nextHeight = originalHeight * (scale + 1);
320 const uint32_t nextDepth = originalDepth * (scale + 1);
321 if (nextWidth > targetSize.width || nextHeight > targetSize.height || nextDepth > targetSize.depth) {
322 break;
323 }
324 width = nextWidth;
325 height = nextHeight;
326 depth = nextDepth;
327 ++scale;
328 }
329 return scale;
330 }
331};
332
333template <>
334struct Offset<2> {
342 [[nodiscard]] static constexpr Offset<2> from(i32vec2 v) noexcept {
343 return {.x = v.x, .y = v.y};
344 }
345
354 [[nodiscard]] static Offset<2> round(vec2 v) {
355 return {
356 .x = static_cast<int32_t>(grem::round(v.x)),
357 .y = static_cast<int32_t>(grem::round(v.y)),
358 };
359 }
360
369 [[nodiscard]] static Offset<2> floor(vec2 v) {
370 return {
371 .x = static_cast<int32_t>(grem::floor(v.x)),
372 .y = static_cast<int32_t>(grem::floor(v.y)),
373 };
374 }
375
384 [[nodiscard]] static Offset<2> ceil(vec2 v) {
385 return {
386 .x = static_cast<int32_t>(grem::ceil(v.x)),
387 .y = static_cast<int32_t>(grem::ceil(v.y)),
388 };
389 }
390
399 [[nodiscard]] static Offset<2> trunc(vec2 v) {
400 return {
401 .x = static_cast<int32_t>(grem::trunc(v.x)),
402 .y = static_cast<int32_t>(grem::trunc(v.y)),
403 };
404 }
405
406 int32_t x;
407 int32_t y;
408
414 constexpr operator Offset<3>() const noexcept {
415 return Offset<3>{.x = x, .y = y, .z = 0};
416 }
417
423 constexpr operator vec2() const noexcept {
424 return vec2{static_cast<float>(x), static_cast<float>(y)};
425 }
426
432 constexpr operator dvec2() const noexcept {
433 return dvec2{static_cast<double>(x), static_cast<double>(y)};
434 }
435
441 constexpr operator ivec2() const noexcept {
442 return ivec2{static_cast<int>(x), static_cast<int>(y)};
443 }
444
450 constexpr operator u32vec2() const noexcept {
451 return u32vec2{static_cast<uint32_t>(x), static_cast<uint32_t>(y)};
452 }
453
461 [[nodiscard]] constexpr bool operator==(const Offset<2>& other) const = default;
462};
463
464template <>
465struct Extent<2> {
473 [[nodiscard]] static constexpr Extent<2> from(u32vec2 v) noexcept {
474 return {.width = v.x, .height = v.y};
475 }
476
485 [[nodiscard]] static Extent<2> round(vec2 v) {
486 return {
487 .width = static_cast<uint32_t>(grem::round(v.x)),
488 .height = static_cast<uint32_t>(grem::round(v.y)),
489 };
490 }
491
500 [[nodiscard]] static Extent<2> floor(vec2 v) {
501 return {
502 .width = static_cast<uint32_t>(grem::floor(v.x)),
503 .height = static_cast<uint32_t>(grem::floor(v.y)),
504 };
505 }
506
515 [[nodiscard]] static Extent<2> ceil(vec2 v) {
516 return {
517 .width = static_cast<uint32_t>(grem::ceil(v.x)),
518 .height = static_cast<uint32_t>(grem::ceil(v.y)),
519 };
520 }
521
530 [[nodiscard]] static Extent<2> trunc(vec2 v) {
531 return {
532 .width = static_cast<uint32_t>(grem::trunc(v.x)),
533 .height = static_cast<uint32_t>(grem::trunc(v.y)),
534 };
535 }
536
537 uint32_t width;
538 uint32_t height = width;
539
546 constexpr explicit operator Offset<2>() const noexcept {
547 return Offset<2>{.x = static_cast<int32_t>(width), .y = static_cast<int32_t>(height)};
548 }
549
556 constexpr operator vec2() const noexcept {
557 return vec2{static_cast<float>(width), static_cast<float>(height)};
558 }
559
566 constexpr operator dvec2() const noexcept {
567 return dvec2{static_cast<double>(width), static_cast<double>(height)};
568 }
569
576 constexpr operator ivec2() const noexcept {
577 return ivec2{static_cast<int>(width), static_cast<int>(height)};
578 }
579
586 constexpr operator u32vec2() const noexcept {
587 return u32vec2{width, height};
588 }
589
595 constexpr operator Extent<3>() const noexcept {
596 return Extent<3>{.width = width, .height = height, .depth = 1};
597 }
598
606 [[nodiscard]] constexpr bool operator==(const Extent2D& other) const = default;
607
613 [[nodiscard]] float getAspectRatio() const {
614 return static_cast<float>(width) / static_cast<float>(height);
615 }
616
628 uint32_t fitIntegerScaled(Extent targetSize) {
629 uint32_t scale = 1;
630 const uint32_t originalWidth = width;
631 const uint32_t originalHeight = height;
632 while (true) {
633 const uint32_t nextWidth = originalWidth * (scale + 1);
634 const uint32_t nextHeight = originalHeight * (scale + 1);
635 if (nextWidth > targetSize.width || nextHeight > targetSize.height) {
636 break;
637 }
638 width = nextWidth;
639 height = nextHeight;
640 ++scale;
641 }
642 return scale;
643 }
644};
645
646constexpr Offset2D& operator+=(Offset2D& a, Offset2D b) noexcept {
647 a.x += b.x;
648 a.y += b.y;
649 return a;
650}
651
652constexpr Offset2D& operator+=(Offset2D& a, Extent2D b) noexcept {
653 a.x += static_cast<int32_t>(b.width);
654 a.y += static_cast<int32_t>(b.height);
655 return a;
656}
657
658constexpr Offset2D& operator-=(Offset2D& a, Extent2D b) noexcept {
659 a.x -= static_cast<int32_t>(b.width);
660 a.y -= static_cast<int32_t>(b.height);
661 return a;
662}
663
664[[nodiscard]] constexpr Offset2D operator-(Offset2D a) noexcept {
665 return {.x = -a.x, .y = -a.y};
666}
667
668[[nodiscard]] constexpr Offset2D operator+(Offset2D a, Offset2D b) noexcept {
669 return {.x = a.x + b.x, .y = a.y + b.y};
670}
671
672[[nodiscard]] constexpr Offset2D operator+(Offset2D a, Extent2D b) noexcept {
673 return {.x = a.x + static_cast<int32_t>(b.width), .y = a.y + static_cast<int32_t>(b.height)};
674}
675
676[[nodiscard]] constexpr Offset2D operator+(Extent2D a, Offset2D b) noexcept {
677 return {.x = static_cast<int32_t>(a.width) + b.x, .y = static_cast<int32_t>(a.height) + b.y};
678}
679
680[[nodiscard]] constexpr Offset2D operator-(Offset2D a, Offset2D b) noexcept {
681 return {.x = a.x - b.x, .y = a.y - b.y};
682}
683
684[[nodiscard]] constexpr Offset2D operator-(Offset2D a, Extent2D b) noexcept {
685 return {.x = a.x - static_cast<int32_t>(b.width), .y = a.y - static_cast<int32_t>(b.height)};
686}
687
688[[nodiscard]] constexpr Offset2D operator-(Extent2D a, Offset2D b) noexcept {
689 return {.x = static_cast<int32_t>(a.width) - b.x, .y = static_cast<int32_t>(a.height) - b.y};
690}
691
692[[nodiscard]] constexpr Offset2D operator*(Offset2D a, int32_t b) noexcept {
693 return {.x = a.x * b, .y = a.y * b};
694}
695
696[[nodiscard]] constexpr Offset2D operator*(int32_t a, Offset2D b) noexcept {
697 return {.x = a * b.x, .y = a * b.y};
698}
699
700[[nodiscard]] constexpr Offset2D operator/(Offset2D a, int32_t b) noexcept {
701 return {.x = a.x / b, .y = a.y / b};
702}
703
704[[nodiscard]] constexpr Offset2D operator/(int32_t a, Offset2D b) noexcept {
705 return {.x = a / b.x, .y = a / b.y};
706}
707
708[[nodiscard]] constexpr Offset2D operator*(Offset2D a, uint32_t b) noexcept {
709 return a * static_cast<int32_t>(b);
710}
711
712[[nodiscard]] constexpr Offset2D operator*(uint32_t a, Offset2D b) noexcept {
713 return static_cast<int32_t>(a) * b;
714}
715
716[[nodiscard]] constexpr Offset2D operator/(Offset2D a, uint32_t b) noexcept {
717 return a / static_cast<int32_t>(b);
718}
719
720[[nodiscard]] constexpr Offset2D operator/(uint32_t a, Offset2D b) noexcept {
721 return static_cast<int32_t>(a) / b;
722}
723
724constexpr Extent2D& operator+=(Extent2D& a, Extent2D b) noexcept {
725 a.width += b.width;
726 a.height += b.height;
727 return a;
728}
729
730constexpr Extent2D& operator-=(Extent2D& a, Extent2D b) noexcept {
731 a.width -= b.width;
732 a.height -= b.height;
733 return a;
734}
735
736constexpr Extent2D& operator*=(Extent2D& a, uint32_t b) noexcept {
737 a.width *= b;
738 a.height *= b;
739 return a;
740}
741
742constexpr Extent2D& operator/=(Extent2D& a, uint32_t b) noexcept {
743 a.width /= b;
744 a.height /= b;
745 return a;
746}
747
748[[nodiscard]] constexpr Extent2D operator+(Extent2D a, Extent2D b) noexcept {
749 return {.width = a.width + b.width, .height = a.height + b.height};
750}
751
752[[nodiscard]] constexpr Extent2D operator-(Extent2D a, Extent2D b) noexcept {
753 return {.width = a.width - b.width, .height = a.height - b.height};
754}
755
756[[nodiscard]] constexpr Extent2D operator*(Extent2D a, uint32_t b) noexcept {
757 return {.width = a.width * b, .height = a.height * b};
758}
759
760[[nodiscard]] constexpr Extent2D operator*(uint32_t a, Extent2D b) noexcept {
761 return {.width = a * b.width, .height = a * b.height};
762}
763
764[[nodiscard]] constexpr Extent2D operator/(Extent2D a, uint32_t b) noexcept {
765 return {.width = a.width / b, .height = a.height / b};
766}
767
768[[nodiscard]] constexpr Extent2D operator/(uint32_t a, Extent2D b) noexcept {
769 return {.width = a / b.width, .height = a / b.height};
770}
771
777template <size_t N>
778struct Region {
781
789 [[nodiscard]] constexpr bool operator==(const Region<N>& other) const = default;
790
798 [[nodiscard]] constexpr bool contains(Offset<N> point) const noexcept {
799 return point.x >= offset.x && point.y >= offset.y && static_cast<uint32_t>(point.x - offset.x) < size.width && static_cast<uint32_t>(point.y - offset.y) < size.height;
800 }
801
813 uint32_t fitCenteredIntegerScaled(Region targetRegion) {
814 const uint32_t scale = size.fitIntegerScaled(targetRegion.size);
815 offset = targetRegion.offset + (static_cast<Offset<N>>(targetRegion.size) - size) / 2;
816 return scale;
817 }
818};
821
822} // namespace grem
823
824#endif
Definition aliases.hpp:9
vec< 3, uint32_t > u32vec3
Definition math.hpp:419
constexpr Offset2D & operator+=(Offset2D &a, Offset2D b) noexcept
Definition extents.hpp:646
vec< 2, float > vec2
Definition math.hpp:438
GREM_ALWAYS_INLINE constexpr vec< N, T > GREM_VECTORCALL floor(vec< N, T > a)
Definition math.hpp:1421
constexpr Offset2D operator-(Offset2D a) noexcept
Definition extents.hpp:664
constexpr Offset2D operator/(Offset2D a, int32_t b) noexcept
Definition extents.hpp:700
vec< 3, int32_t > i32vec3
Definition math.hpp:415
Region< 3 > Region3D
Rectangular region of 3D data.
Definition extents.hpp:820
vec< 3, float > vec3
Definition math.hpp:439
Extent< 2 > Extent2D
Size of a 2D data region.
Definition extents.hpp:31
constexpr Offset2D operator*(Offset2D a, int32_t b) noexcept
Definition extents.hpp:692
Region< 2 > Region2D
Rectangular region of 2D data.
Definition extents.hpp:819
Offset< 2 > Offset2D
Offset in a 2D data region.
Definition extents.hpp:21
constexpr Offset2D & operator-=(Offset2D &a, Extent2D b) noexcept
Definition extents.hpp:658
GREM_ALWAYS_INLINE constexpr vec< N, T > GREM_VECTORCALL ceil(vec< N, T > a)
Definition math.hpp:1422
GREM_ALWAYS_INLINE constexpr vec< N, T > GREM_VECTORCALL trunc(vec< N, T > a)
Definition math.hpp:1420
vec< 3, double > dvec3
Definition math.hpp:443
vec< 2, int32_t > i32vec2
Definition math.hpp:414
Offset< 3 > Offset3D
Offset in a 3D data region.
Definition extents.hpp:22
GREM_ALWAYS_INLINE constexpr vec< N, T > GREM_VECTORCALL round(vec< N, T > a)
Definition math.hpp:1418
Extent< 3 > Extent3D
Size of a 3D data region.
Definition extents.hpp:32
vec< 3, int > ivec3
Definition math.hpp:391
GREM_ALWAYS_INLINE constexpr mat< 3, 3, T > GREM_VECTORCALL scale(vec< 2, T > scale)
Create a scale matrix describing a 2D scale.
Definition math.hpp:2665
constexpr auto operator+(const ConstantString< CharT, LengthA > &a, const ConstantString< CharT, LengthB > &b)
Definition ConstantString.hpp:656
vec< 2, uint32_t > u32vec2
Definition math.hpp:418
vec< 2, double > dvec2
Definition math.hpp:442
constexpr Extent2D & operator*=(Extent2D &a, uint32_t b) noexcept
Definition extents.hpp:736
constexpr Extent2D & operator/=(Extent2D &a, uint32_t b) noexcept
Definition extents.hpp:742
vec< 2, int > ivec2
Definition math.hpp:390
static Extent< 2 > trunc(vec2 v)
Create an extent from a vector of floating-point numbers, rounded to their truncated integer values b...
Definition extents.hpp:530
static Extent< 2 > floor(vec2 v)
Create an extent from a vector of floating-point numbers, rounded down to their floor integer values ...
Definition extents.hpp:500
float getAspectRatio() const
Get the aspect ratio of the extent (width / height).
Definition extents.hpp:613
uint32_t fitIntegerScaled(Extent targetSize)
Fit the extents into a target size at the largest positive integer scale of its original size that st...
Definition extents.hpp:628
static Extent< 2 > ceil(vec2 v)
Create an extent from a vector of floating-point numbers, rounded up to their ceiling integer values ...
Definition extents.hpp:515
constexpr bool operator==(const Extent2D &other) const =default
Compare this extent to another for equality.
static constexpr Extent< 2 > from(u32vec2 v) noexcept
Create an extent from a vector of integers.
Definition extents.hpp:473
static Extent< 2 > round(vec2 v)
Create an extent from a vector of floating-point numbers, rounded to their nearest integer values bef...
Definition extents.hpp:485
uint32_t width
Horizontal extent of the region.
Definition extents.hpp:537
uint32_t height
Vertical extent of the region.
Definition extents.hpp:538
static Extent< 3 > trunc(vec3 v)
Create an extent from a vector of floating-point numbers, rounded to their truncated integer values b...
Definition extents.hpp:230
static Extent< 3 > ceil(vec3 v)
Create an extent from a vector of floating-point numbers, rounded up to their ceiling integer values ...
Definition extents.hpp:214
static Extent< 3 > floor(vec3 v)
Create an extent from a vector of floating-point numbers, rounded down to their floor integer values ...
Definition extents.hpp:198
static constexpr Extent< 3 > from(u32vec3 v) noexcept
Create an extent from a vector of integers.
Definition extents.hpp:170
uint32_t height
Vertical extent.
Definition extents.hpp:239
constexpr bool operator==(const Extent< 3 > &other) const =default
Compare this extent to another for equality.
uint32_t fitIntegerScaled(Extent targetSize)
Fit the extents into a target size at the largest positive integer scale of its original size that st...
Definition extents.hpp:312
uint32_t width
Horizontal extent.
Definition extents.hpp:238
static Extent< 3 > round(vec3 v)
Create an extent from a vector of floating-point numbers, rounded to their nearest integer values bef...
Definition extents.hpp:182
uint32_t depth
Number of layers.
Definition extents.hpp:240
Size of a data region.
Definition extents.hpp:30
int32_t x
Horizontal offset.
Definition extents.hpp:406
constexpr bool operator==(const Offset< 2 > &other) const =default
Compare this offset to another for equality.
static constexpr Offset< 2 > from(i32vec2 v) noexcept
Create an offset from a vector of integers.
Definition extents.hpp:342
static Offset< 2 > trunc(vec2 v)
Create an offset from a vector of floating-point numbers, rounded to their truncated integer values b...
Definition extents.hpp:399
static Offset< 2 > floor(vec2 v)
Create an offset from a vector of floating-point numbers, rounded down to their floor integer values ...
Definition extents.hpp:369
int32_t y
Vertical offset.
Definition extents.hpp:407
static Offset< 2 > ceil(vec2 v)
Create an offset from a vector of floating-point numbers, rounded up to their ceiling integer values ...
Definition extents.hpp:384
static Offset< 2 > round(vec2 v)
Create an offset from a vector of floating-point numbers, rounded to their nearest integer values bef...
Definition extents.hpp:354
int32_t x
Horizontal offset.
Definition extents.hpp:111
static constexpr Offset< 3 > from(i32vec3 v) noexcept
Create an offset from a vector of integers.
Definition extents.hpp:43
int32_t z
Depth offset.
Definition extents.hpp:113
static Offset< 3 > ceil(vec3 v)
Create an offset from a vector of floating-point numbers, rounded up to their ceiling integer values ...
Definition extents.hpp:87
static Offset< 3 > trunc(vec3 v)
Create an offset from a vector of floating-point numbers, rounded to their truncated integer values b...
Definition extents.hpp:103
static Offset< 3 > floor(vec3 v)
Create an offset from a vector of floating-point numbers, rounded down to their floor integer values ...
Definition extents.hpp:71
constexpr bool operator==(const Offset< 3 > &other) const =default
Compare this offset to another for equality.
static Offset< 3 > round(vec3 v)
Create an offset from a vector of floating-point numbers, rounded to their nearest integer values bef...
Definition extents.hpp:55
int32_t y
Vertical offset.
Definition extents.hpp:112
Offset in a data region.
Definition extents.hpp:20
Rectangular region of data.
Definition extents.hpp:778
constexpr bool operator==(const Region< N > &other) const =default
Compare this region's offset and extents to another for equality.
uint32_t fitCenteredIntegerScaled(Region targetRegion)
Fit the region into the middle of a target region at the largest positive integer scale of its origin...
Definition extents.hpp:813
constexpr bool contains(Offset< N > point) const noexcept
Check if a given point is contained within the extents of this region.
Definition extents.hpp:798
Extent< N > size
Definition extents.hpp:780
Offset< N > offset
Definition extents.hpp:779