#include <GREM/core/extents.hpp>
|
| constexpr | operator Offset< 2 > () const noexcept |
| | Convert this extent to an offset.
|
| constexpr | operator vec2 () const noexcept |
| | Convert this extent to a floating-point 2D vector.
|
| constexpr | operator dvec2 () const noexcept |
| | Convert this extent to a double-precision floating-point 2D vector.
|
| constexpr | operator ivec2 () const noexcept |
| | Convert this extent to an integer 2D vector.
|
| constexpr | operator u32vec2 () const noexcept |
| | Convert this extent to an unsigned integer 2D vector.
|
| constexpr | operator Extent< 3 > () const noexcept |
| | Convert this extent to a 3D extent.
|
| constexpr bool | operator== (const Extent2D &other) const =default |
| | Compare this extent to another for equality.
|
| float | getAspectRatio () const |
| | Get the aspect ratio of the extent (width / height).
|
| uint32_t | fitIntegerScaled (Extent targetSize) |
| | Fit the extents into a target size at the largest positive integer scale of its original size that still fits within the target.
|
|
| static constexpr Extent< 2 > | from (u32vec2 v) noexcept |
| | Create an extent from a vector of integers.
|
| static Extent< 2 > | round (vec2 v) |
| | Create an extent from a vector of floating-point numbers, rounded to their nearest integer values before conversion.
|
| static Extent< 2 > | floor (vec2 v) |
| | Create an extent from a vector of floating-point numbers, rounded down to their floor integer values before conversion.
|
| static Extent< 2 > | ceil (vec2 v) |
| | Create an extent from a vector of floating-point numbers, rounded up to their ceiling integer values before conversion.
|
| static Extent< 2 > | trunc (vec2 v) |
| | Create an extent from a vector of floating-point numbers, rounded to their truncated integer values before conversion.
|
|
| uint32_t | width |
| | Horizontal extent of the region.
|
| uint32_t | height = width |
| | Vertical extent of the region.
|
◆ from()
|
|
inlinestaticnodiscardconstexprnoexcept |
Create an extent from a vector of integers.
- Parameters
-
- Returns
- the corresponding extent.
◆ round()
Create an extent from a vector of floating-point numbers, rounded to their nearest integer values before conversion.
- Parameters
-
- Returns
- the rounded extent.
◆ floor()
Create an extent from a vector of floating-point numbers, rounded down to their floor integer values before conversion.
- Parameters
-
- Returns
- the floor-rounded extent.
◆ ceil()
Create an extent from a vector of floating-point numbers, rounded up to their ceiling integer values before conversion.
- Parameters
-
- Returns
- the ceiling-rounded extent.
◆ trunc()
Create an extent from a vector of floating-point numbers, rounded to their truncated integer values before conversion.
- Parameters
-
- Returns
- the truncated extent.
◆ operator Offset< 2 >()
|
|
inlineexplicitconstexprnoexcept |
Convert this extent to an offset.
- Returns
- an offset with the width and height of the extent as its x and y components, respectively.
◆ operator vec2()
Convert this extent to a floating-point 2D vector.
- Returns
- a 2D vector holding the width and height of the extent in its x and y components, respectively.
◆ operator dvec2()
Convert this extent to a double-precision floating-point 2D vector.
- Returns
- a 2D vector holding the width and height of the extent in its x and y components, respectively.
◆ operator ivec2()
Convert this extent to an integer 2D vector.
- Returns
- a 2D vector holding the width and height of the extent in its x and y components, respectively.
◆ operator u32vec2()
Convert this extent to an unsigned integer 2D vector.
- Returns
- a 2D vector holding the width and height of the extent in its x and y components, respectively.
◆ operator Extent< 3 >()
Convert this extent to a 3D extent.
- Returns
- the equivalent 3D extent, with a depth of 1.
◆ operator==()
|
|
nodiscardconstexprdefault |
Compare this extent to another for equality.
- Parameters
-
| other | the extent to compare this one to. |
- Returns
- true if the extents are equal, false otherwise.
◆ getAspectRatio()
Get the aspect ratio of the extent (width / height).
- Returns
- width / height as a float.
◆ fitIntegerScaled()
Fit the extents into a target size at the largest positive integer scale of its original size that still fits within the target.
- Parameters
-
| targetSize | target size to fit the extents into. |
- Returns
- the integer scale that was chosen.
- Note
- If the original size cannot fit within the target, then the chosen scale will be 1.
◆ width
Horizontal extent of the region.
◆ height
Vertical extent of the region.
The documentation for this struct was generated from the following file: