File include/brisk/graphics/Geometry.hpp
¶
FloatTypeFor
class (Internal::FloatTypeFor
)¶
template <typename T> FloatTypeFor
FloatTypeFor
PointOf
class¶
template <typename T> PointOf
A template struct representing a point in 2D Cartesian coordinates.
The struct holds the x and y coordinates of a point. It provides various constructors,
operator overloads, and utility functions for manipulating points in a Cartesian coordinate system.
Template param T
The type of the coordinates, typically a numeric type such as float or double.
SizeOf
class¶
template <typename T> SizeOf
A structure representing a 2D size with width and height.
This structure allows operations on sizes, such as addition, subtraction,
and comparison. It can also represent the size as a union of its components
for easy access.
Template param T
The type of the components (e.g., float, int).
EdgesOf
class¶
template <typename T> EdgesOf
A structure representing the edges of a rectangle or bounding box in 2D space.
This structure defines the edges using four coordinates: (x1, y1) for one corner
and (x2, y2) for the opposite corner. It provides methods for constructing, accessing,
and manipulating these edges.
Template param T
The type of the edge coordinates (e.g., int, float).
CornersOf
class¶
template <typename T> CornersOf
A structure representing the corners of a rectangle or bounding box in 2D space.
This structure defines four corner points of a rectangle using two-dimensional coordinates:
(x1y1) for the top-left corner, (x2y1) for the top-right corner,
(x1y2) for the bottom-left corner, and (x2y2) for the bottom-right corner. It provides methods for
constructing, accessing, and manipulating these corners.
Template param T
The type of the corner coordinates (e.g., int, float).
RectangleOf
class¶
template <typename T> RectangleOf
A template structure representing a rectangle in a 2D space.
This structure provides methods for manipulating and querying a rectangle's properties
defined by two corner points (x1, y1) and (x2, y2), where (x1, y1) is the top-left
corner and (x2, y2) is the bottom-right corner.
Template param T
The data type for the coordinates.
PolarOf
class¶
template <typename T> PolarOf
A template struct representing a point in polar coordinates.
This struct holds the radius and angle of a point in a polar coordinate system.
The radius
represents the distance from the origin, while the angle
represents
the direction of the point in radians.
Template param T
The type of the radius and angle, typically a numeric type such as float or double.
radius
variable (PolarOf::radius
)¶
T radius
The radius of the polar coordinate.
This value represents the distance from the origin (0, 0).
angle
variable (PolarOf::angle
)¶
T angle
The angle of the polar coordinate.
This value represents the angle in radians.
operator==
function (PolarOf::operator==
)¶
constexpr bool
operator==(const PolarOf &c) const noexcept = default
Equality operator for comparing two PolarOf objects.
operator!=
function (PolarOf::operator!=
)¶
constexpr bool
operator!=(const PolarOf &c) const noexcept = default
Inequality operator for comparing two PolarOf objects.
PointOf
class¶
template <typename T> PointOf
A template struct representing a point in 2D Cartesian coordinates.
The struct holds the x and y coordinates of a point. It provides various constructors,
operator overloads, and utility functions for manipulating points in a Cartesian coordinate system.
Template param T
The type of the coordinates, typically a numeric type such as float or double.
PointOf<T>
function (PointOf::PointOf<T>
)¶
constexpr PointOf() noexcept : x(), y()
Default constructor.
Initializes the coordinates to zero.
constexpr PointOf(T x, T y) noexcept : x(x), y(y)
Parameterized constructor.
Initializes the coordinates with the given values.
Param x
The x-coordinate.
Param y
The y-coordinate.
constexpr PointOf(const PointOf &p) noexcept = default
Copy constructor.
Initializes a new PointOf instance by copying the given point.
Param p
The PointOf instance to copy.
operator==
function (PointOf::operator==
)¶
constexpr bool operator==(const PointOf &c) const noexcept
Equality operator.
Compares two PointOf instances for equality based on their coordinates.
Param c
The PointOf instance to compare against.
Returns true if the points are equal, false otherwise.
operator!=
function (PointOf::operator!=
)¶
constexpr bool operator!=(const PointOf &c) const noexcept
Inequality operator.
Compares two PointOf instances for inequality.
Param c
The PointOf instance to compare against.
Returns true if the points are not equal, false otherwise.
flipped
function (PointOf::flipped
)¶
constexpr PointOf flipped() const noexcept
Flips the point coordinates.
Swaps the x and y coordinates of the point.
Returns A new PointOf instance with flipped coordinates.
flippedIf
function (PointOf::flippedIf
)¶
constexpr PointOf flippedIf(bool flip) const noexcept
Conditionally flips the point coordinates.
If the flip parameter is true, the coordinates are flipped; otherwise, the original point is returned.
Param flip
A boolean indicating whether to flip the coordinates.
Returns A new PointOf instance, either flipped or unchanged.
operator[]
function (PointOf::operator[]
)¶
T operator[](size_t i) const noexcept
Access operator for point components.
Provides read access to the point's components via index.
Param i
The index of the component (0 for x, 1 for y).
Returns The component at the specified index.
T &operator[](size_t i) noexcept
Access operator for point components.
Provides write access to the point's components via index.
Param i
The index of the component (0 for x, 1 for y).
Returns A reference to the component at the specified index.
components
variable (PointOf::components
)¶
T components[2]
Array of components for indexed access.
(anonymous)
class (PointOf::(anonymous struct at /src/include/brisk/graphics/Geometry.hpp:184:9)
)¶
(anonymous struct at / src / include / brisk / graphics /
Geometry.hpp : 184 : 9)
x
variable (PointOf::(anonymous struct at /src/include/brisk/graphics/Geometry.hpp:184:9)::x
)¶
T x
The x-coordinate.
y
variable (PointOf::(anonymous struct at /src/include/brisk/graphics/Geometry.hpp:184:9)::y
)¶
T y
The y-coordinate.
Reflection
variable (PointOf::Reflection
)¶
constexpr static std::tuple Reflection
Reflection data for introspection.
This static member provides reflection information about the PointOf struct, including its fields and their corresponding names.
PointOf
class¶
template <SIMDCompatible T> PointOf
A specialized template struct for SIMD-compatible points in 2D Cartesian coordinates.
This version of PointOf uses SIMD (Single Instruction, Multiple Data) types for efficient
vectorized computations.
Template param T
The SIMD type representing the point coordinates, must be SIMD compatible.
PointOf<type-parameter-0-0>
function (PointOf::PointOf<type-parameter-0-0>
)¶
constexpr PointOf() noexcept : v()
Default constructor.
Initializes the SIMD vector to zero.
constexpr explicit PointOf(const SIMD<T, 2> &v) noexcept
: v(v)
Parameterized constructor from a SIMD vector.
Initializes the point with the given SIMD vector.
Param v
The SIMD vector representing the point.
constexpr PointOf(T x, T y) noexcept : v(x, y)
Parameterized constructor from two coordinates.
Initializes the point with the specified x and y values.
Param x
The x-coordinate.
Param y
The y-coordinate.
constexpr PointOf(const SizeOf<T> &sz) noexcept : v(sz.v)
Constructor from a SizeOf object.
Initializes the point using the size vector from a SizeOf object.
Param sz
The SizeOf object from which to initialize the point.
constexpr PointOf(const PointOf &p) noexcept = default
Copy constructor.
Initializes a new PointOf instance by copying the given point.
Param p
The PointOf instance to copy.
operator PointOf<type-parameter-1-0>
function (PointOf::operator PointOf<type-parameter-1-0>
)¶
template <typename U> operator PointOf<U>() const noexcept
Conversion operator to a PointOf<U>.
Converts this PointOf instance to another type PointOf<U>.
Template param U
The target type for conversion.
Returns A PointOf<U> instance.
operator==
function (PointOf::operator==
)¶
constexpr bool operator==(const PointOf &c) const noexcept
Equality operator.
Compares two PointOf instances for equality based on their SIMD vector.
Param c
The PointOf instance to compare against.
Returns true if the points are equal, false otherwise.
operator!=
function (PointOf::operator!=
)¶
constexpr bool operator!=(const PointOf &c) const noexcept
Inequality operator.
Compares two PointOf instances for inequality.
Param c
The PointOf instance to compare against.
Returns true if the points are not equal, false otherwise.
PointOf<type-parameter-0-0>
function (PointOf::PointOf<type-parameter-0-0>
)¶
constexpr PointOf(const PolarOf<T> &p) noexcept
Constructor from a PolarOf<T>.
Converts a polar coordinate to Cartesian coordinates.
Param p
The PolarOf instance to convert.
operator PolarOf<type-parameter-0-0>
function (PointOf::operator PolarOf<type-parameter-0-0>
)¶
constexpr operator PolarOf<T>() noexcept
Conversion operator to PolarOf<T>.
Converts this Cartesian point to a polar coordinate representation.
Returns A PolarOf<T> instance representing the polar coordinates.
operator+=
function (PointOf::operator+=
)¶
constexpr PointOf &operator+=(const PointOf &p2) noexcept
Compound addition assignment operator.
Adds another PointOf instance to this one and returns the updated instance.
Param p2
The PointOf instance to add.
Returns A reference to the updated PointOf instance.
operator-=
function (PointOf::operator-=
)¶
constexpr PointOf &operator-=(const PointOf &p2) noexcept
Compound subtraction assignment operator.
Subtracts another PointOf instance from this one and returns the updated instance.
Param p2
The PointOf instance to subtract.
Returns A reference to the updated PointOf instance.
operator*=
function (PointOf::operator*=
)¶
constexpr PointOf &operator*=(const PointOf &p2) noexcept
Compound multiplication assignment operator.
Multiplies this PointOf instance by another and returns the updated instance.
Param p2
The PointOf instance to multiply by.
Returns A reference to the updated PointOf instance.
operator/=
function (PointOf::operator/=
)¶
constexpr PointOf &operator/=(const PointOf &p2) noexcept
Compound division assignment operator.
Divides this PointOf instance by another and returns the updated instance.
Param p2
The PointOf instance to divide by.
Returns A reference to the updated PointOf instance.
operator+=
function (PointOf::operator+=
)¶
constexpr PointOf &operator+=(T v2) noexcept
Compound addition assignment operator for scalar.
Adds a scalar value to this PointOf instance and returns the updated instance.
Param v2
The scalar value to add.
Returns A reference to the updated PointOf instance.
operator-=
function (PointOf::operator-=
)¶
constexpr PointOf &operator-=(T v2) noexcept
Compound subtraction assignment operator for scalar.
Subtracts a scalar value from this PointOf instance and returns the updated instance.
Param v2
The scalar value to subtract.
Returns A reference to the updated PointOf instance.
operator*=
function (PointOf::operator*=
)¶
constexpr PointOf &operator*=(T v2) noexcept
Compound multiplication assignment operator for scalar.
Multiplies this PointOf instance by a scalar value and returns the updated instance.
Param v2
The scalar value to multiply by.
Returns A reference to the updated PointOf instance.
operator/=
function (PointOf::operator/=
)¶
constexpr PointOf &operator/=(T v2) noexcept
Compound division assignment operator for scalar.
Divides this PointOf instance by a scalar value and returns the updated instance.
Param v2
The scalar value to divide by.
Returns A reference to the updated PointOf instance.
flipped
function (PointOf::flipped
)¶
constexpr PointOf flipped() const noexcept
Flips the point coordinates.
Swaps the x and y coordinates of the point.
Returns A new PointOf instance with flipped coordinates.
flippedIf
function (PointOf::flippedIf
)¶
constexpr PointOf flippedIf(bool flip) const noexcept
Conditionally flips the point coordinates.
If the flip parameter is true, the coordinates are flipped; otherwise, the original point is returned.
Param flip
A boolean indicating whether to flip the coordinates.
Returns A new PointOf instance, either flipped or unchanged.
distance
function (PointOf::distance
)¶
T distance(const PointOf &pt) const noexcept
Calculates the Euclidean distance to another point.
Computes the distance from this point to the specified point.
Param pt
The PointOf instance to calculate the distance to.
Returns The Euclidean distance to the other point.
distanceManhattan
function (PointOf::distanceManhattan
)¶
T distanceManhattan(const PointOf &pt) const noexcept
Calculates the Manhattan distance to another point.
Computes the Manhattan distance from this point to the specified point.
Param pt
The PointOf instance to calculate the distance to.
Returns The Manhattan distance to the other point.
operator[]
function (PointOf::operator[]
)¶
T operator[](size_t i) const noexcept
Access operator for point components.
Provides read access to the point's components via index.
Param i
The index of the component (0 for x, 1 for y).
Returns The component at the specified index.
T &operator[](size_t i) noexcept
Access operator for point components.
Provides write access to the point's components via index.
Param i
The index of the component (0 for x, 1 for y).
Returns A reference to the component at the specified index.
alignedRect
function (PointOf::alignedRect
)¶
RectangleOf<T>
alignedRect(const SizeOf<T> &innerSize,
const PointOf<Tfloat> &alignment) const noexcept
Creates an aligned rectangle around the point.
Generates a rectangle centered around the point with specified dimensions and alignment.
Param innerSize
The size of the rectangle.
Param alignment
The alignment of the rectangle.
Returns A RectangleOf instance representing the aligned rectangle.
RectangleOf<T> alignedRect(T width, T height, Tfloat alignX,
Tfloat alignY) const noexcept
Creates an aligned rectangle around the point with specified dimensions.
Generates a rectangle centered around the point with specified width, height, and alignment.
Param width
The width of the rectangle.
Param height
The height of the rectangle.
Param alignX
The alignment factor in the X direction.
Param alignY
The alignment factor in the Y direction.
Returns A RectangleOf instance representing the aligned rectangle.
round
function (PointOf::round
)¶
constexpr PointOf round() const noexcept
Rounds the point components.
Applies rounding to the x and y components of the point.
Returns A new PointOf instance with rounded components.
floor
function (PointOf::floor
)¶
constexpr PointOf floor() const noexcept
Applies floor to the point components.
Computes the largest integer values less than or equal to the x and y components of the point.
Returns A new PointOf instance with floored components.
ceil
function (PointOf::ceil
)¶
constexpr PointOf ceil() const noexcept
Applies ceil to the point components.
Computes the smallest integer values greater than or equal to the x and y components of the point.
Returns A new PointOf instance with ceiled components.
trunc
function (PointOf::trunc
)¶
constexpr PointOf trunc() const noexcept
Applies truncation to the point components.
Computes the integer part of the x and y components of the point.
Returns A new PointOf instance with truncated components.
vec_type
typedef (PointOf::vec_type
)¶
vec_type = SIMD<T, 2>
Type representing the SIMD vector type.
v
variable (PointOf::v
)¶
vec_type v
SIMD vector representation of the point.
components
variable (PointOf::components
)¶
T components[2]
Array of components for direct access.
(anonymous)
class (PointOf::(anonymous struct at /src/include/brisk/graphics/Geometry.hpp:696:9)
)¶
(anonymous struct at / src / include / brisk / graphics /
Geometry.hpp : 696 : 9)
x
variable (PointOf::(anonymous struct at /src/include/brisk/graphics/Geometry.hpp:696:9)::x
)¶
T x
X component of the point.
y
variable (PointOf::(anonymous struct at /src/include/brisk/graphics/Geometry.hpp:696:9)::y
)¶
T y
Y component of the point.
Reflection
variable (PointOf::Reflection
)¶
constexpr static std::tuple Reflection
Reflection metadata for the PointOf struct.
min
function¶
template <typename T>
PointOf<T> min(const PointOf<T> &a,
const PointOf<T> &b) noexcept
Computes the minimum point from two PointOf instances.
Template param T
The type of the point components.
Param a
The first PointOf instance.
Param b
The second PointOf instance.
Returns A new PointOf instance representing the minimum point.
max
function¶
template <typename T>
PointOf<T> max(const PointOf<T> &a,
const PointOf<T> &b) noexcept
Computes the maximum point from two PointOf instances.
Template param T
The type of the point components.
Param a
The first PointOf instance.
Param b
The second PointOf instance.
Returns A new PointOf instance representing the maximum point.
SizeOf
class¶
template <typename T> SizeOf
A structure representing a 2D size with width and height.
This structure allows operations on sizes, such as addition, subtraction,
and comparison. It can also represent the size as a union of its components
for easy access.
Template param T
The type of the components (e.g., float, int).
SizeOf<T>
function (SizeOf::SizeOf<T>
)¶
constexpr SizeOf() noexcept : x
Default constructor that initializes size to (0, 0).
constexpr SizeOf(T x, T y) noexcept : x(x), y(y)
Constructor that initializes size with specific values.
Param x
The width component.
Param y
The height component.
constexpr SizeOf(T xy) noexcept : x(xy), y(xy)
Constructor that initializes width and height to the same value.
Param xy
The value for both width and height.
template <std::convertible_to<T> U>
constexpr SizeOf(U v) : SizeOf(static_cast<T>(v))
Constructor that converts from a type convertible to T.
Template param U
The type to convert from.
Param v
The value to convert and initialize.
constexpr SizeOf(const SizeOf &s) noexcept = default
Copy constructor.
Param s
The SizeOf instance to copy from.
operator[]
function (SizeOf::operator[]
)¶
T operator[](size_t i) const noexcept
Access operator for retrieving component by index.
Param i
The index of the component (0 for x, 1 for y).
Returns The component value at index i.
T &operator[](size_t i) noexcept
Access operator for modifying component by index.
Param i
The index of the component (0 for x, 1 for y).
Returns A reference to the component value at index i.
flipped
function (SizeOf::flipped
)¶
constexpr SizeOf flipped() const noexcept
Returns a new SizeOf instance with x and y flipped.
Returns A SizeOf instance with flipped dimensions.
flippedIf
function (SizeOf::flippedIf
)¶
constexpr SizeOf flippedIf(bool flip) const noexcept
Conditionally flips the dimensions based on the provided flag.
Param flip
If true, dimensions are flipped; otherwise, unchanged.
Returns A SizeOf instance that is either flipped or unchanged.
operator==
function (SizeOf::operator==
)¶
constexpr bool operator==(const SizeOf &c) const noexcept
Checks if two SizeOf instances are equal.
Param c
The SizeOf instance to compare against.
Returns True if both instances are equal; otherwise false.
operator!=
function (SizeOf::operator!=
)¶
constexpr bool operator!=(const SizeOf &c) const noexcept
Checks if two SizeOf instances are not equal.
Param c
The SizeOf instance to compare against.
Returns True if both instances are not equal; otherwise false.
components
variable (SizeOf::components
)¶
T components[2]
An array to access the components directly.
(anonymous)
class (SizeOf::(anonymous struct at /src/include/brisk/graphics/Geometry.hpp:816:9)
)¶
(anonymous struct at / src / include / brisk / graphics /
Geometry.hpp : 816 : 9)
Struct for accessing components as x and y.
x
variable (SizeOf::(anonymous struct at /src/include/brisk/graphics/Geometry.hpp:816:9)::x
)¶
T x
The width component.
y
variable (SizeOf::(anonymous struct at /src/include/brisk/graphics/Geometry.hpp:816:9)::y
)¶
T y
The height component.
(anonymous)
class (SizeOf::(anonymous struct at /src/include/brisk/graphics/Geometry.hpp:822:9)
)¶
(anonymous struct at / src / include / brisk / graphics /
Geometry.hpp : 822 : 9)
Struct for accessing components as width and height.
width
variable (SizeOf::(anonymous struct at /src/include/brisk/graphics/Geometry.hpp:822:9)::width
)¶
T width
The width component.
height
variable (SizeOf::(anonymous struct at /src/include/brisk/graphics/Geometry.hpp:822:9)::height
)¶
T height
The height component.
SizeOf
class¶
template <SIMDCompatible T> SizeOf
A specialized SizeOf structure for SIMD-compatible types.
This specialization leverages SIMD operations for better performance
on two-dimensional sizes. It allows for various arithmetic and utility
operations using SIMD vectors.
Template param T
The SIMD-compatible type of the components.
SizeOf<type-parameter-0-0>
function (SizeOf::SizeOf<type-parameter-0-0>
)¶
constexpr SizeOf() noexcept : x
Default constructor that initializes size to (0, 0).
constexpr SizeOf(T x, T y) noexcept : x(x), y(y)
Constructor that initializes size with specific values.
Param x
The width component.
Param y
The height component.
constexpr explicit SizeOf(T xy) noexcept : x(xy), y(xy)
Constructor that initializes width and height to the same value.
Param xy
The value for both width and height.
SizeOf(const SIMD<T, 2> &v) noexcept : v(v)
Constructor that initializes from a SIMD vector.
Param v
The SIMD vector to initialize from.
constexpr SizeOf(const SizeOf &s) noexcept = default
Copy constructor.
Param s
The SizeOf instance to copy from.
operator SizeOf<type-parameter-1-0>
function (SizeOf::operator SizeOf<type-parameter-1-0>
)¶
template <typename U> operator SizeOf<U>() const noexcept
Conversion operator to a different SizeOf type.
Template param U
The type to convert to.
Returns A new SizeOf instance of type U.
empty
function (SizeOf::empty
)¶
constexpr bool empty() const noexcept
Checks if the size is empty (both components <= 0).
Returns True if the size is empty; otherwise false.
shortestSide
function (SizeOf::shortestSide
)¶
constexpr T shortestSide() const noexcept
Gets the length of the shortest side.
Returns The value of the shortest side.
longestSide
function (SizeOf::longestSide
)¶
constexpr T longestSide() const noexcept
Gets the length of the longest side.
Returns The value of the longest side.
round
function (SizeOf::round
)¶
constexpr SizeOf round() const noexcept
Rounds the dimensions to the nearest integer.
Returns A SizeOf instance with rounded dimensions.
floor
function (SizeOf::floor
)¶
constexpr SizeOf floor() const noexcept
Floors the dimensions to the nearest lower integer.
Returns A SizeOf instance with floored dimensions.
ceil
function (SizeOf::ceil
)¶
constexpr SizeOf ceil() const noexcept
Ceils the dimensions to the nearest higher integer.
Returns A SizeOf instance with ceiled dimensions.
trunc
function (SizeOf::trunc
)¶
constexpr SizeOf trunc() const noexcept
Truncates the dimensions towards zero.
Returns A SizeOf instance with truncated dimensions.
flipped
function (SizeOf::flipped
)¶
constexpr SizeOf flipped() const noexcept
Returns a new SizeOf instance with dimensions flipped.
Returns A SizeOf instance with flipped dimensions.
flippedIf
function (SizeOf::flippedIf
)¶
constexpr SizeOf flippedIf(bool flip) const noexcept
Conditionally flips dimensions based on a provided flag.
Param flip
If true, dimensions are flipped; otherwise, unchanged.
Returns A SizeOf instance that is either flipped or unchanged.
area
function (SizeOf::area
)¶
constexpr T area() const noexcept
Calculates the area of the size.
Returns The area as the product of width and height.
operator[]
function (SizeOf::operator[]
)¶
T operator[](size_t i) const noexcept
Access operator for retrieving component by index.
Param i
The index of the component (0 for x, 1 for y).
Returns The component value at index i.
T &operator[](size_t i) noexcept
Access operator for modifying component by index.
Param i
The index of the component (0 for x, 1 for y).
Returns A reference to the component value at index i.
operator==
function (SizeOf::operator==
)¶
constexpr bool operator==(const SizeOf &c) const noexcept
Checks if two SizeOf instances are equal.
Param c
The SizeOf instance to compare against.
Returns True if both instances are equal; otherwise false.
operator!=
function (SizeOf::operator!=
)¶
constexpr bool operator!=(const SizeOf &c) const noexcept
Checks if two SizeOf instances are not equal.
Param c
The SizeOf instance to compare against.
Returns True if both instances are not equal; otherwise false.
v
variable (SizeOf::v
)¶
vec_type v
The SIMD vector representing size.
components
variable (SizeOf::components
)¶
T components[2]
An array to access the components directly.
(anonymous)
class (SizeOf::(anonymous struct at /src/include/brisk/graphics/Geometry.hpp:1047:9)
)¶
(anonymous struct at / src / include / brisk / graphics /
Geometry.hpp : 1047 : 9)
x
variable (SizeOf::(anonymous struct at /src/include/brisk/graphics/Geometry.hpp:1047:9)::x
)¶
T x
The width component.
y
variable (SizeOf::(anonymous struct at /src/include/brisk/graphics/Geometry.hpp:1047:9)::y
)¶
T y
The height component.
(anonymous)
class (SizeOf::(anonymous struct at /src/include/brisk/graphics/Geometry.hpp:1052:9)
)¶
(anonymous struct at / src / include / brisk / graphics /
Geometry.hpp : 1052 : 9)
width
variable (SizeOf::(anonymous struct at /src/include/brisk/graphics/Geometry.hpp:1052:9)::width
)¶
T width
The width component.
height
variable (SizeOf::(anonymous struct at /src/include/brisk/graphics/Geometry.hpp:1052:9)::height
)¶
T height
The height component.
min
function¶
template <typename T>
SizeOf<T> min(const SizeOf<T> &a,
const SizeOf<T> &b) noexcept
Computes the element-wise minimum of two SizeOf instances.
Template param T
The type of the components.
Param a
The first SizeOf instance.
Param b
The second SizeOf instance.
Returns A SizeOf instance representing the minimum size.
max
function¶
template <typename T>
SizeOf<T> max(const SizeOf<T> &a,
const SizeOf<T> &b) noexcept
Computes the element-wise maximum of two SizeOf instances .
Template param T
The type of the components.
Param a
The first SizeOf instance.
Param b
The second SizeOf instance.
Returns A SizeOf instance representing the maximum size.
EdgesOf
class¶
template <typename T> EdgesOf
A structure representing the edges of a rectangle or bounding box in 2D space.
This structure defines the edges using four coordinates: (x1, y1) for one corner
and (x2, y2) for the opposite corner. It provides methods for constructing, accessing,
and manipulating these edges.
Template param T
The type of the edge coordinates (e.g., int, float).
EdgesOf<T>
function (EdgesOf::EdgesOf<T>
)¶
constexpr EdgesOf() noexcept : x1
Default constructor that initializes edges to (0, 0, 0, 0).
constexpr EdgesOf(T value) noexcept
: x1(value), y1(value), x2(value), y2(value)
Constructor that initializes all edges to a specific value.
Param value
The value to initialize all edge coordinates.
template <std::convertible_to<T> U>
constexpr EdgesOf(U v) : EdgesOf(static_cast<T>(v))
Constructor that initializes edges from a convertible type.
Template param U
The type to convert from.
Param v
The value to convert and initialize edges.
constexpr EdgesOf(T h, T v) noexcept
: x1(h), y1(v), x2(h), y2(v)
Constructor that initializes edges with specified horizontal and vertical values.
Param h
The horizontal value for x1 and x2.
Param v
The vertical value for y1 and y2.
constexpr EdgesOf(T x1, T y1, T x2, T y2) noexcept
: x1(x1), y1(y1), x2(x2), y2(y2)
Constructor that initializes edges with four specified coordinates.
Param x1
The x-coordinate of the first edge.
Param y1
The y-coordinate of the first edge.
Param x2
The x-coordinate of the second edge.
Param y2
The y-coordinate of the second edge.
constexpr EdgesOf(const EdgesOf &b) noexcept = default
Copy constructor.
Param b
The EdgesOf instance to copy from.
operator[]
function (EdgesOf::operator[]
)¶
T operator[](size_t i) const noexcept
Access operator for retrieving edge coordinate by index.
Param i
The index of the coordinate (0 for x1, 1 for y1, 2 for x2, 3 for y2).
Returns The coordinate value at index i.
T &operator[](size_t i) noexcept
Access operator for modifying edge coordinate by index.
Param i
The index of the coordinate (0 for x1, 1 for y1, 2 for x2, 3 for y2).
Returns A reference to the coordinate value at index i.
operator==
function (EdgesOf::operator==
)¶
constexpr bool operator==(const EdgesOf &c) const noexcept
Checks if two EdgesOf instances are equal.
Param c
The EdgesOf instance to compare against.
Returns True if both instances are equal; otherwise false.
operator!=
function (EdgesOf::operator!=
)¶
constexpr bool operator!=(const EdgesOf &c) const noexcept
Checks if two EdgesOf instances are not equal.
Param c
The EdgesOf instance to compare against.
Returns True if both instances are not equal; otherwise false.
components
variable (EdgesOf::components
)¶
T components[4]
An array to access the edge coordinates directly.
(anonymous)
class (EdgesOf::(anonymous struct at /src/include/brisk/graphics/Geometry.hpp:1162:9)
)¶
(anonymous struct at / src / include / brisk / graphics /
Geometry.hpp : 1162 : 9)
x1
variable (EdgesOf::(anonymous struct at /src/include/brisk/graphics/Geometry.hpp:1162:9)::x1
)¶
T x1
The x-coordinate of the first edge.
y1
variable (EdgesOf::(anonymous struct at /src/include/brisk/graphics/Geometry.hpp:1162:9)::y1
)¶
T y1
The y-coordinate of the first edge.
x2
variable (EdgesOf::(anonymous struct at /src/include/brisk/graphics/Geometry.hpp:1162:9)::x2
)¶
T x2
The x-coordinate of the second edge.
y2
variable (EdgesOf::(anonymous struct at /src/include/brisk/graphics/Geometry.hpp:1162:9)::y2
)¶
T y2
The y-coordinate of the second edge.
EdgesOf
class¶
template <SIMDCompatible T> EdgesOf
A specialized EdgesOf structure for SIMD-compatible types.
This specialization leverages SIMD operations for better performance
when working with edges. It allows for various arithmetic and utility
operations using SIMD vectors.
Template param T
The SIMD-compatible type of the edge coordinates.
EdgesOf<type-parameter-0-0>
function (EdgesOf::EdgesOf<type-parameter-0-0>
)¶
constexpr EdgesOf() noexcept : v()
Default constructor that initializes edges to (0, 0, 0, 0).
constexpr explicit EdgesOf(T value) noexcept : v(value)
Constructor that initializes all edges to a specific value.
Param value
The value to initialize all edge coordinates.
constexpr EdgesOf(T h, T v) noexcept : v(h, v, h, v)
Constructor that initializes edges with specified horizontal and vertical values.
Param h
The horizontal value for x1 and x2.
Param v
The vertical value for y1 and y2.
constexpr EdgesOf(T x1, T y1, T x2, T y2) noexcept
: v(x1, y1, x2, y2)
Constructor that initializes edges with four specified coordinates.
Param x1
The x-coordinate of the first edge.
Param y1
The y-coordinate of the first edge.
Param x2
The x-coordinate of the second edge.
Param y2
The y-coordinate of the second edge.
constexpr explicit EdgesOf(const SIMD<T, 4> &v) noexcept
: v(v)
Constructor that initializes from a SIMD vector.
Param v
The SIMD vector to initialize edges from.
constexpr EdgesOf(const EdgesOf &b) noexcept = default
Copy constructor.
Param b
The EdgesOf instance to copy from.
operator EdgesOf<type-parameter-1-0>
function (EdgesOf::operator EdgesOf<type-parameter-1-0>
)¶
template <typename U> operator EdgesOf<U>() const noexcept
Conversion operator to a different EdgesOf type.
Template param U
The type to convert to.
Returns A new EdgesOf instance of type U.
round
function (EdgesOf::round
)¶
constexpr EdgesOf round() const noexcept
Rounds the edge coordinates to the nearest integer.
Returns A new EdgesOf instance with rounded coordinates.
floor
function (EdgesOf::floor
)¶
constexpr EdgesOf floor() const noexcept
Floors the edge coordinates to the nearest lower integer.
Returns A new EdgesOf instance with floored coordinates.
ceil
function (EdgesOf::ceil
)¶
constexpr EdgesOf ceil() const noexcept
Ceils the edge coordinates to the nearest higher integer.
Returns A new EdgesOf instance with ceiled coordinates.
trunc
function (EdgesOf::trunc
)¶
constexpr EdgesOf trunc() const noexcept
Truncates the edge coordinates towards zero.
Returns A new EdgesOf instance with truncated coordinates.
size
function (EdgesOf::size
)¶
SizeOf<T> size() const noexcept
Returns the size of the edges as a SizeOf instance.
Returns A SizeOf instance representing the total width and height.
operator*
function (EdgesOf::operator*
)¶
EdgesOf operator*(T value) const noexcept
Multiplies the edges by a scalar value.
Param value
The scalar value to multiply.
Returns A new EdgesOf instance with multiplied edges.
operator+
function (EdgesOf::operator+
)¶
EdgesOf operator+(T value) const noexcept
Adds a scalar value to the edges.
Param value
The scalar value to add.
Returns A new EdgesOf instance with added edges.
operator-
function (EdgesOf::operator-
)¶
EdgesOf operator-(T value) const noexcept
Subtracts a scalar value from the edges.
Param value
The scalar value to subtract.
Returns A new EdgesOf instance with subtracted edges.
horizontal
function (EdgesOf::horizontal
)¶
T horizontal() const noexcept
Gets the horizontal size of the edges.
Returns The width of the edges.
vertical
function (EdgesOf::vertical
)¶
T vertical() const noexcept
Gets the vertical size of the edges.
Returns The height of the edges.
empty
function (EdgesOf::empty
)¶
bool empty() const noexcept
Checks if the edges are empty.
Returns True if the sum of horizontal dimensions is zero; otherwise false.
min
function (EdgesOf::min
)¶
T min() const noexcept
Gets the minimum coordinate among the edges.
Returns The minimum edge coordinate.
max
function (EdgesOf::max
)¶
T max() const noexcept
Gets the maximum coordinate among the edges.
Returns The maximum edge coordinate.
leading
function (EdgesOf::leading
)¶
PointOf<T> leading() const noexcept
Returns the leading edge point.
Returns A PointOf instance representing the leading edge.
trailing
function (EdgesOf::trailing
)¶
PointOf<T> trailing() const noexcept
Returns the trailing edge point.
Returns A PointOf instance representing the trailing edge.
operator[]
function (EdgesOf::operator[]
)¶
T operator[](size_t i) const noexcept
Access operator for retrieving edge coordinate by index.
Param i
The index of the coordinate (0 for x1, 1 for y1, 2 for x2, 3 for y2).
Returns The coordinate value at index i.
T &operator[](size_t i) noexcept
Access operator for modifying edge coordinate by index.
Param i
The index of the coordinate (0 for x1, 1 for y1, 2 for x2, 3 for y2).
Returns A reference to the coordinate value at index i.
operator==
function (EdgesOf::operator==
)¶
constexpr bool operator==(const EdgesOf &c) const noexcept
Checks if two EdgesOf instances are equal.
Param c
The EdgesOf instance to compare against.
Returns True if both instances are equal; otherwise false.
operator!=
function (EdgesOf::operator!=
)¶
constexpr bool operator!=(const EdgesOf &c) const noexcept
Checks if two EdgesOf instances are not equal.
Param c
The EdgesOf instance to compare against.
Returns True if both instances are not equal; otherwise false.
v
variable (EdgesOf::v
)¶
SIMD<T, 4> v
The SIMD vector representing the edges.
components
variable (EdgesOf::components
)¶
T components[4]
An array to access the edge coordinates directly.
(anonymous)
class (EdgesOf::(anonymous struct at /src/include/brisk/graphics/Geometry.hpp:1367:9)
)¶
(anonymous struct at / src / include / brisk / graphics /
Geometry.hpp : 1367 : 9)
x1
variable (EdgesOf::(anonymous struct at /src/include/brisk/graphics/Geometry.hpp:1367:9)::x1
)¶
T x1
The x-coordinate of the first edge.
y1
variable (EdgesOf::(anonymous struct at /src/include/brisk/graphics/Geometry.hpp:1367:9)::y1
)¶
T y1
The y-coordinate of the first edge.
x2
variable (EdgesOf::(anonymous struct at /src/include/brisk/graphics/Geometry.hpp:1367:9)::x2
)¶
T x2
The x-coordinate of the second edge.
y2
variable (EdgesOf::(anonymous struct at /src/include/brisk/graphics/Geometry.hpp:1367:9)::y2
)¶
T y2
The y-coordinate of the second edge.
min
function¶
template <typename T>
EdgesOf<T> min(const EdgesOf<T> &a,
const EdgesOf<T> &b) noexcept
Computes the element-wise minimum of two EdgesOf instances.
Template param T
The type of the edge coordinates.
Param a
The first EdgesOf instance.
Param b
The second EdgesOf instance.
Returns A new EdgesOf instance representing the minimum edges.
max
function¶
template <typename T>
EdgesOf<T> max(const EdgesOf<T> &a,
const EdgesOf<T> &b) noexcept
Computes the element-wise maximum of two EdgesOf instances.
Template param T
The type of the edge coordinates.
Param a
The first EdgesOf instance.
Param b
The second EdgesOf instance.
Returns A new EdgesOf instance representing the maximum edges.
CornersOf
class¶
template <typename T> CornersOf
A structure representing the corners of a rectangle or bounding box in 2D space.
This structure defines four corner points of a rectangle using two-dimensional coordinates:
(x1y1) for the top-left corner, (x2y1) for the top-right corner,
(x1y2) for the bottom-left corner, and (x2y2) for the bottom-right corner. It provides methods for
constructing, accessing, and manipulating these corners.
Template param T
The type of the corner coordinates (e.g., int, float).
CornersOf<T>
function (CornersOf::CornersOf<T>
)¶
constexpr CornersOf() noexcept : x1y1
Default constructor that initializes corners to zero.
constexpr CornersOf(T value) noexcept
: x1y1(value), x2y1(value), x1y2(value), x2y2(value)
Constructor that initializes all corners to a specific value.
Param value
The value to initialize all corner coordinates.
template <std::convertible_to<T> U>
constexpr CornersOf(U v) : CornersOf(static_cast<T>(v))
Constructor that initializes corners from a convertible type.
Template param U
The type to convert from.
Param v
The value to convert and initialize corners.
constexpr CornersOf(T x1y1, T x2y1, T x1y2, T x2y2) noexcept
: x1y1(x1y1), x2y1(x2y1), x1y2(x1y2), x2y2(x2y2)
Constructor that initializes corners with specified coordinates.
Param x1y1
The coordinate of the top-left corner.
Param x2y1
The coordinate of the top-right corner.
Param x1y2
The coordinate of the bottom-left corner.
Param x2y2
The coordinate of the bottom-right corner.
constexpr CornersOf(const CornersOf &b) noexcept = default
Copy constructor.
Param b
The CornersOf instance to copy from.
operator[]
function (CornersOf::operator[]
)¶
T operator[](size_t i) const noexcept
Access operator for retrieving corner coordinate by index.
Param i
The index of the coordinate (0 for x1y1, 1 for x2y1, 2 for x1y2, 3 for x2y2).
Returns The coordinate value at index i.
T &operator[](size_t i) noexcept
Access operator for modifying corner coordinate by index.
Param i
The index of the coordinate (0 for x1y1, 1 for x2y1, 2 for x1y2, 3 for x2y2).
Returns A reference to the coordinate value at index i.
operator==
function (CornersOf::operator==
)¶
constexpr bool operator==(const CornersOf &c) const noexcept
Checks if two CornersOf instances are equal.
Param c
The CornersOf instance to compare against.
Returns True if both instances are equal; otherwise false.
components
variable (CornersOf::components
)¶
T components[4]
An array to access the corner coordinates directly.
(anonymous)
class (CornersOf::(anonymous struct at /src/include/brisk/graphics/Geometry.hpp:1471:9)
)¶
(anonymous struct at / src / include / brisk / graphics /
Geometry.hpp : 1471 : 9)
x1y1
variable (CornersOf::(anonymous struct at /src/include/brisk/graphics/Geometry.hpp:1471:9)::x1y1
)¶
T x1y1
The coordinate of the bottom-left corner.
x2y1
variable (CornersOf::(anonymous struct at /src/include/brisk/graphics/Geometry.hpp:1471:9)::x2y1
)¶
T x2y1
The coordinate of the bottom-right corner.
x1y2
variable (CornersOf::(anonymous struct at /src/include/brisk/graphics/Geometry.hpp:1471:9)::x1y2
)¶
T x1y2
The coordinate of the top-left corner.
x2y2
variable (CornersOf::(anonymous struct at /src/include/brisk/graphics/Geometry.hpp:1471:9)::x2y2
)¶
T x2y2
The coordinate of the top-right corner.
CornersOf
class¶
template <SIMDCompatible T> CornersOf
A specialized CornersOf structure for SIMD-compatible types.
This specialization leverages SIMD operations for better performance when working with corners.
It allows for various arithmetic and utility operations using SIMD vectors.
Template param T
The SIMD-compatible type of the corner coordinates.
CornersOf<type-parameter-0-0>
function (CornersOf::CornersOf<type-parameter-0-0>
)¶
constexpr CornersOf() noexcept : v()
Default constructor that initializes corners to zero.
constexpr CornersOf(T value) noexcept : v(value)
Constructor that initializes all corners to a specific value.
Param value
The value to initialize all corner coordinates.
template <std::convertible_to<T> U>
constexpr CornersOf(U v) : CornersOf(static_cast<T>(v))
Constructor that initializes corners from a convertible type.
Template param U
The type to convert from.
Param v
The value to convert and initialize corners.
constexpr CornersOf(T x1y1, T x2y1, T x1y2, T x2y2) noexcept
: v(x1y1, x2y1, x1y2, x2y2)
Constructor that initializes corners with specified coordinates.
Param x1y1
The coordinate of the top-left corner.
Param x2y1
The coordinate of the top-right corner.
Param x1y2
The coordinate of the bottom-left corner.
Param x2y2
The coordinate of the bottom-right corner.
constexpr CornersOf(const CornersOf &b) noexcept = default
Copy constructor.
Param b
The CornersOf instance to copy from.
operator CornersOf<type-parameter-1-0>
function (CornersOf::operator CornersOf<type-parameter-1-0>
)¶
template <typename U> operator CornersOf<U>() const noexcept
Conversion operator to a different CornersOf type.
Template param U
The type to convert to.
Returns A new CornersOf instance of type U.
operator[]
function (CornersOf::operator[]
)¶
T operator[](size_t i) const noexcept
Access operator for retrieving corner coordinate by index.
Param i
The index of the coordinate (0 for x1y1, 1 for x2y1, 2 for x1y2, 3 for x2y2).
Returns The coordinate value at index i.
T &operator[](size_t i) noexcept
Access operator for modifying corner coordinate by index.
Param i
The index of the coordinate (0 for x1y1, 1 for x2y1, 2 for x1y2, 3 for x2y2).
Returns A reference to the coordinate value at index i.
operator==
function (CornersOf::operator==
)¶
constexpr bool operator==(const CornersOf &c) const noexcept
Checks if two CornersOf instances are equal.
Param c
The CornersOf instance to compare against.
Returns True if both instances are equal; otherwise false.
min
function (CornersOf::min
)¶
T min() const noexcept
Gets the minimum coordinate among the corners.
Returns The minimum corner coordinate.
max
function (CornersOf::max
)¶
T max() const noexcept
Gets the maximum coordinate among the corners.
Returns The maximum corner coordinate.
empty
function (CornersOf::empty
)¶
bool empty() const noexcept
Checks if the corners are empty.
Returns True if the sum of corner coordinates is zero; otherwise false.
v
variable (CornersOf::v
)¶
SIMD<T, 4> v
The SIMD vector representing the corners.
components
variable (CornersOf::components
)¶
T components[4]
An array to access the corner coordinates directly.
(anonymous)
class (CornersOf::(anonymous struct at /src/include/brisk/graphics/Geometry.hpp:1582:9)
)¶
(anonymous struct at / src / include / brisk / graphics /
Geometry.hpp : 1582 : 9)
x1y1
variable (CornersOf::(anonymous struct at /src/include/brisk/graphics/Geometry.hpp:1582:9)::x1y1
)¶
T x1y1
The coordinate of the bottom-left corner.
x2y1
variable (CornersOf::(anonymous struct at /src/include/brisk/graphics/Geometry.hpp:1582:9)::x2y1
)¶
T x2y1
The coordinate of the bottom-right corner.
x1y2
variable (CornersOf::(anonymous struct at /src/include/brisk/graphics/Geometry.hpp:1582:9)::x1y2
)¶
T x1y2
The coordinate of the top-left corner.
x2y2
variable (CornersOf::(anonymous struct at /src/include/brisk/graphics/Geometry.hpp:1582:9)::x2y2
)¶
T x2y2
The coordinate of the top-right corner.
RectangleOf
class¶
template <typename T> RectangleOf
A template structure representing a rectangle in a 2D space.
This structure provides methods for manipulating and querying a rectangle's properties
defined by two corner points (x1, y1) and (x2, y2), where (x1, y1) is the top-left
corner and (x2, y2) is the bottom-right corner.
Template param T
The data type for the coordinates.
RectangleOf<T>
function (RectangleOf::RectangleOf<T>
)¶
constexpr RectangleOf(T x1, T y1, T x2, T y2) noexcept
: v(x1, y1, x2, y2)
Constructs a rectangle using the given corner coordinates.
Param x1
The x-coordinate of the top-left corner.
Param y1
The y-coordinate of the top-left corner.
Param x2
The x-coordinate of the bottom-right corner.
Param y2
The y-coordinate of the bottom-right corner.
constexpr explicit RectangleOf(const SIMD<T, 4> &v) noexcept
: v(v)
Constructs a rectangle from a SIMD vector.
Param v
A SIMD vector representing the rectangle's corners.
constexpr RectangleOf(const RectangleOf &r) noexcept =
default
Copy constructor for the rectangle.
Param r
The rectangle to copy from.
operator RectangleOf<type-parameter-1-0>
function (RectangleOf::operator RectangleOf<type-parameter-1-0>
)¶
template <typename U>
operator RectangleOf<U>() const noexcept
Converts this rectangle to a rectangle of a different type.
Template param U
The type to convert to.
Returns A new rectangle of type U.
RectangleOf<T>
function (RectangleOf::RectangleOf<T>
)¶
constexpr RectangleOf(const PointOf<T> &point,
const SizeOf<T> &size) noexcept
: v(concat(point.v, point.v + size.v))
Constructs a rectangle from a point and size.
Param point
The starting point of the rectangle.
Param size
The size of the rectangle.
constexpr RectangleOf(const PointOf<T> &point1,
const PointOf<T> &point2) noexcept
: v(concat(point1.v, point2.v))
Constructs a rectangle from two corner points.
Param point1
The first corner point of the rectangle.
Param point2
The second corner point of the rectangle.
constexpr RectangleOf(
const PointOf<T> &base, const SizeOf<T> &dim,
const PointOf<Tfloat> &alignment) noexcept
: RectangleOf(base.alignedRect(dim, alignment))
Constructs an aligned rectangle given a base point, size, and alignment.
Param base
The base point of the rectangle.
Param dim
The size of the rectangle.
Param alignment
The alignment for the rectangle.
constexpr RectangleOf() noexcept : v()
Default constructor for the rectangle.
empty
function (RectangleOf::empty
)¶
constexpr bool empty() const noexcept
Checks if the rectangle is empty.
Returns True if the rectangle is empty, false otherwise.
size
function (RectangleOf::size
)¶
constexpr SizeOf<T> size() const noexcept
Gets the size of the rectangle.
Returns The size of the rectangle as a SizeOf<T> object.
area
function (RectangleOf::area
)¶
constexpr T area() const noexcept
Calculates the area of the rectangle.
Returns The area of the rectangle.
width
function (RectangleOf::width
)¶
constexpr T width() const noexcept
Calculates the width of the rectangle.
Returns The width of the rectangle.
height
function (RectangleOf::height
)¶
constexpr T height() const noexcept
Calculates the height of the rectangle.
Returns The height of the rectangle.
shortestSide
function (RectangleOf::shortestSide
)¶
constexpr T shortestSide() const noexcept
Gets the shortest side length of the rectangle.
Returns The length of the shortest side.
longestSide
function (RectangleOf::longestSide
)¶
constexpr T longestSide() const noexcept
Gets the longest side length of the rectangle.
Returns The length of the longest side.
orientation
function (RectangleOf::orientation
)¶
Orientation orientation() const noexcept
Determines the orientation of the rectangle.
Returns The orientation (Horizontal or Vertical).
slice
function (RectangleOf::slice
)¶
RectangleOf slice(Orientation orientation, Tfloat start,
Tfloat stop) const noexcept
Creates a slice of the rectangle based on the given orientation.
Param orientation
The orientation of the slice.
Param start
The normalized start coordinate.
Param stop
The normalized stop coordinate.
Returns A new RectangleOf that represents the slice.
center
function (RectangleOf::center
)¶
PointOf<T> center() const noexcept
Gets the center point of the rectangle.
Returns The center point as a PointOf<T>.
toNormCoord
function (RectangleOf::toNormCoord
)¶
PointOf<Tfloat>
toNormCoord(const PointOf<T> &pt) const noexcept
Converts a point to normalized coordinates based on the rectangle.
Param pt
The point to normalize.
Returns The normalized coordinates as a PointOf<Tfloat>.
PointOf<Tfloat>
toNormCoord(const PointOf<T> &pt,
const PointOf<T> &ifoutside) const noexcept
Converts a point to normalized coordinates with a fallback point if outside.
Param pt
The point to normalize.
Param ifoutside
The fallback point if the original point is outside the rectangle.
Returns The normalized coordinates or the fallback point.
split
function (RectangleOf::split
)¶
RectangleOf split(const PointOf<Tfloat> &point1,
const SizeOf<Tfloat> &size) const noexcept
Splits the rectangle based on a point and size.
Param point1
The starting point of the split.
Param size
The size of the split rectangle.
Returns A new RectangleOf representing the split area.
RectangleOf split(Tfloat x, Tfloat y, Tfloat w,
Tfloat h) const noexcept
Splits the rectangle based on individual coordinates.
Param x
The x-coordinate of the top-left corner of the split rectangle.
Param y
The y-coordinate of the top-left corner of the split rectangle.
Param w
The width of the split rectangle.
Param h
The height of the split rectangle.
Returns A new RectangleOf representing the split area.
at
function (RectangleOf::at
)¶
PointOf<T> at(const PointOf<Tfloat> &pt) const noexcept
Gets the point at a normalized coordinate within the rectangle.
Param pt
The normalized coordinates.
Returns The point as a PointOf<T>.
PointOf<T> at(Tfloat x, Tfloat y) const noexcept
Gets the point at a normalized coordinate within the rectangle.
Param x
The normalized x-coordinate.
Param y
The normalized y-coordinate.
Returns The point as a PointOf<T>.
applyStart
function (RectangleOf::applyStart
)¶
void applyStart(const PointOf<T> &p) noexcept
Applies a new starting point to the rectangle.
Param p
The new starting point.
void applyStart(T x, T y) noexcept
Applies a new starting point using individual coordinates.
Param x
The x-coordinate of the new starting point.
Param y
The y-coordinate of the new starting point.
applySize
function (RectangleOf::applySize
)¶
void applySize(const SizeOf<T> &s) noexcept
Applies a new size to the rectangle.
Param s
The new size.
void applySize(T w, T h) noexcept
Applies a new size using individual dimensions.
Param w
The new width.
Param h
The new height.
applyWidth
function (RectangleOf::applyWidth
)¶
void applyWidth(T w) noexcept
Applies a new width to the rectangle, keeping the height unchanged.
Param w
The new width.
applyHeight
function (RectangleOf::applyHeight
)¶
void applyHeight(T h) noexcept
Applies a new height to the rectangle, keeping the width unchanged.
Param h
The new height.
applyOffset
function (RectangleOf::applyOffset
)¶
void applyOffset(T x, T y) noexcept
Applies an offset to the rectangle's position.
Param x
The x offset.
Param y
The y offset.
void applyOffset(const PointOf<T> &p) noexcept
Applies an offset using a point.
Param p
The point to offset by.
applyScale
function (RectangleOf::applyScale
)¶
void applyScale(T x, T y) noexcept
Applies a scale factor to the rectangle.
Param x
The x scale factor.
Param y
The y scale factor.
applyMargin
function (RectangleOf::applyMargin
)¶
void applyMargin(T h, T v) noexcept
Applies a margin to the rectangle.
Param h
The horizontal margin.
Param v
The vertical margin.
applyPadding
function (RectangleOf::applyPadding
)¶
void applyPadding(T h, T v) noexcept
Applies padding to the rectangle.
Param h
The horizontal padding.
Param v
The vertical padding.
applyMargin
function (RectangleOf::applyMargin
)¶
void applyMargin(T m) noexcept
Applies a uniform margin to the rectangle.
Param m
The margin value.
applyPadding
function (RectangleOf::applyPadding
)¶
void applyPadding(T p) noexcept
Applies a uniform padding to the rectangle.
Param p
The padding value.
applyMargin
function (RectangleOf::applyMargin
)¶
void applyMargin(const EdgesOf<T> &m) noexcept
Applies a margin defined by edges to the rectangle.
Param m
The margin edges.
applyPadding
function (RectangleOf::applyPadding
)¶
void applyPadding(const EdgesOf<T> &p) noexcept
Applies padding defined by edges to the rectangle.
Param p
The padding edges.
void applyPadding(T x1, T y1, T x2, T y2) noexcept
Applies padding to the rectangle using individual dimensions.
Param x1
The left padding.
Param y1
The top padding.
Param x2
The right padding.
Param y2
The bottom padding.
alignedRect
function (RectangleOf::alignedRect
)¶
RectangleOf
alignedRect(const SizeOf<T> &innerSize,
const PointOf<Tfloat> &alignment) const noexcept
Creates an aligned rectangle with specified inner size and alignment.
Param innerSize
The inner size of the rectangle.
Param alignment
The alignment for the rectangle.
Returns A new aligned RectangleOf.
RectangleOf alignedRect(T width, T height, Tfloat alignX,
Tfloat alignY) const noexcept
Creates an aligned rectangle using width, height, and alignment factors.
Param width
The width of the rectangle.
Param height
The height of the rectangle.
Param alignX
The horizontal alignment factor.
Param alignY
The vertical alignment factor.
Returns A new aligned RectangleOf.
withStart
function (RectangleOf::withStart
)¶
constexpr RectangleOf
withStart(const PointOf<T> &p) const noexcept
Creates a new rectangle with a specified starting point.
Param p
The new starting point.
Returns A new RectangleOf with the specified starting point.
constexpr RectangleOf withStart(T x, T y) const noexcept
Creates a new rectangle with a specified starting point using coordinates.
Param x
The x-coordinate of the new starting point.
Param y
The y-coordinate of the new starting point.
Returns A new RectangleOf with the specified starting point.
withSize
function (RectangleOf::withSize
)¶
constexpr RectangleOf
withSize(const SizeOf<T> &s) const noexcept
Creates a new rectangle with a specified size.
Param s
The new size.
Returns A new RectangleOf with the specified size.
constexpr RectangleOf withSize(T w, T h) const noexcept
Creates a new rectangle with a specified size using dimensions.
Param w
The new width.
Param h
The new height.
Returns A new RectangleOf with the specified size.
withWidth
function (RectangleOf::withWidth
)¶
constexpr RectangleOf withWidth(T w) const noexcept
Creates a new rectangle with a specified width.
Param w
The new width.
Returns A new RectangleOf with the specified width.
withHeight
function (RectangleOf::withHeight
)¶
constexpr RectangleOf withHeight(T h) const noexcept
Creates a new rectangle with a specified height.
Param h
The new height.
Returns A new RectangleOf with the specified height.
withOffset
function (RectangleOf::withOffset
)¶
constexpr RectangleOf
withOffset(const PointOf<T> &p) const noexcept
Creates a new rectangle with a specified offset.
Param p
The point to offset by.
Returns A new RectangleOf with the specified offset.
constexpr RectangleOf withOffset(T x, T y) const noexcept
Creates a new rectangle with a specified offset using coordinates.
Param x
The x offset.
Param y
The y offset.
Returns A new RectangleOf with the specified offset.
withScale
function (RectangleOf::withScale
)¶
constexpr RectangleOf withScale(T x, T y) const noexcept
Creates a new rectangle with applied scaling factors.
Param x
The x scaling factor.
Param y
The y scaling factor.
Returns A new RectangleOf with the applied scaling factors.
withMargin
function (RectangleOf::withMargin
)¶
constexpr RectangleOf withMargin(T h, T v) const noexcept
Creates a new rectangle with applied margin.
Param h
The horizontal margin.
Param v
The vertical margin.
Returns A new RectangleOf with the applied margin.
withPadding
function (RectangleOf::withPadding
)¶
constexpr RectangleOf withPadding(T h, T v) const noexcept
Creates a new rectangle with applied padding.
Param h
The horizontal padding.
Param v
The vertical padding.
Returns A new RectangleOf with the applied padding.
constexpr RectangleOf withPadding(T x1, T y1, T x2,
T y2) const noexcept
Creates a new rectangle with applied padding using dimensions.
Param x1
The left padding.
Param y1
The top padding.
Param x2
The right padding.
Param y2
The bottom padding.
Returns A new RectangleOf with the applied padding.
withMargin
function (RectangleOf::withMargin
)¶
constexpr RectangleOf withMargin(T m) const noexcept
Creates a new rectangle with applied margin.
Param m
The margin value.
Returns A new RectangleOf with the applied margin.
withPadding
function (RectangleOf::withPadding
)¶
constexpr RectangleOf withPadding(T p) const noexcept
Creates a new rectangle with applied padding.
Param p
The padding value.
Returns A new RectangleOf with the applied padding.
constexpr RectangleOf
withPadding(const EdgesOf<T> &p) const noexcept
Creates a new rectangle with applied padding defined by edges.
Param p
The padding edges.
Returns A new RectangleOf with the applied padding.
withMargin
function (RectangleOf::withMargin
)¶
constexpr RectangleOf
withMargin(const EdgesOf<T> &m) const noexcept
Creates a new rectangle with applied margin defined by edges.
Param m
The margin edges.
Returns A new RectangleOf with the applied margin.
flipped
function (RectangleOf::flipped
)¶
constexpr RectangleOf flipped() const noexcept
Creates a new rectangle that is flipped horizontally.
Returns A new RectangleOf that is flipped.
flippedIf
function (RectangleOf::flippedIf
)¶
constexpr RectangleOf flippedIf(bool flip) const noexcept
Creates a new rectangle that is conditionally flipped.
Param flip
A flag indicating whether to flip the rectangle.
Returns A new RectangleOf that is flipped or the original.
round
function (RectangleOf::round
)¶
constexpr RectangleOf round() const noexcept
Rounds the rectangle's coordinates.
Returns A new RectangleOf with rounded coordinates.
floor
function (RectangleOf::floor
)¶
constexpr RectangleOf floor() const noexcept
Floors the rectangle's coordinates.
Returns A new RectangleOf with floored coordinates.
ceil
function (RectangleOf::ceil
)¶
constexpr RectangleOf ceil() const noexcept
Ceils the rectangle's coordinates.
Returns A new RectangleOf with ceiled coordinates.
trunc
function (RectangleOf::trunc
)¶
constexpr RectangleOf trunc() const noexcept
Truncates the rectangle's coordinates.
Returns A new RectangleOf with truncated coordinates.
contains
function (RectangleOf::contains
)¶
bool contains(const PointOf<T> &pt) const noexcept
Checks if a point is contained within the rectangle.
Param pt
The point to check.
Returns True if the point is contained; otherwise, false.
operator<<
function (RectangleOf::operator<<
)¶
bool operator<<(const PointOf<T> &pt) const noexcept
Checks if a point is contained within the rectangle using the << operator.
Param pt
The point to check.
Returns True if the point is contained; otherwise, false.
operator==
function (RectangleOf::operator==
)¶
constexpr bool
operator==(const RectangleOf &c) const noexcept
Compares two rectangles for equality.
Param c
The rectangle to compare against.
Returns True if both rectangles are equal; otherwise, false.
operator!=
function (RectangleOf::operator!=
)¶
constexpr bool
operator!=(const RectangleOf &c) const noexcept
Compares two rectangles for inequality.
Param c
The rectangle to compare against.
Returns True if the rectangles are not equal; otherwise, false.
union_
function (RectangleOf::union_
)¶
constexpr RectangleOf
union_(const RectangleOf &c) const noexcept
Creates a new rectangle that is the union of this rectangle and another.
Param c
The other rectangle.
Returns A new RectangleOf that is the union of both rectangles.
intersection
function (RectangleOf::intersection
)¶
constexpr RectangleOf
intersection(const RectangleOf &c) const noexcept
Creates a new rectangle that is the intersection of this rectangle and another.
Param c
The other rectangle.
Returns A new RectangleOf that is the intersection of both rectangles.
operator[]
function (RectangleOf::operator[]
)¶
T operator[](size_t i) const noexcept
Accesses a specific component of the rectangle.
Param i
The index of the component (0: x1, 1: y1, 2: x2, 3: y2).
Returns The component at the specified index.
T &operator[](size_t i) noexcept
Accesses a specific component of the rectangle.
Param i
The index of the component (0: x1, 1: y1, 2: x2, 3: y2).
Returns A reference to the component at the specified index.
v
variable (RectangleOf::v
)¶
SIMD<T, 4> v
SIMD representation of the rectangle.
components
variable (RectangleOf::components
)¶
T components[4]
Array representation of the rectangle components.
(anonymous)
class (RectangleOf::(anonymous struct at /src/include/brisk/graphics/Geometry.hpp:2339:9)
)¶
(anonymous struct at / src / include / brisk / graphics /
Geometry.hpp : 2339 : 9)
x1
variable (RectangleOf::(anonymous struct at /src/include/brisk/graphics/Geometry.hpp:2339:9)::x1
)¶
T x1
The x-coordinate of the top-left corner.
y1
variable (RectangleOf::(anonymous struct at /src/include/brisk/graphics/Geometry.hpp:2339:9)::y1
)¶
T y1
The y-coordinate of the top-left corner.
x2
variable (RectangleOf::(anonymous struct at /src/include/brisk/graphics/Geometry.hpp:2339:9)::x2
)¶
T x2
The x-coordinate of the bottom-right corner.
y2
variable (RectangleOf::(anonymous struct at /src/include/brisk/graphics/Geometry.hpp:2339:9)::y2
)¶
T y2
The y-coordinate of the bottom-right corner.
(anonymous)
class (RectangleOf::(anonymous struct at /src/include/brisk/graphics/Geometry.hpp:2346:9)
)¶
(anonymous struct at / src / include / brisk / graphics /
Geometry.hpp : 2346 : 9)
p1
variable (RectangleOf::(anonymous struct at /src/include/brisk/graphics/Geometry.hpp:2346:9)::p1
)¶
PointOf<T> p1
The top-left corner point.
p2
variable (RectangleOf::(anonymous struct at /src/include/brisk/graphics/Geometry.hpp:2346:9)::p2
)¶
PointOf<T> p2
The bottom-right corner point.
Point
typedef¶
Point = PointOf<int32_t>
Type alias for a point using 32-bit integers.
PointF
typedef¶
PointF = PointOf<float>
Type alias for a point using single-precision floating-point numbers.
Size
typedef¶
Size = SizeOf<int32_t>
Type alias for a size using 32-bit integers.
SizeF
typedef¶
SizeF = SizeOf<float>
Type alias for a size using single-precision floating-point numbers.
Edges
typedef¶
Edges = EdgesOf<int32_t>
Type alias for edges using 32-bit integers.
EdgesF
typedef¶
EdgesF = EdgesOf<float>
Type alias for edges using single-precision floating-point numbers.
Corners
typedef¶
Corners = CornersOf<int32_t>
Type alias for corners using 32-bit integers.
CornersF
typedef¶
CornersF = CornersOf<float>
Type alias for corners using single-precision floating-point numbers.
Rectangle
typedef¶
Rectangle = RectangleOf<int32_t>
Type alias for a rectangle using 32-bit integers.
RectangleF
typedef¶
RectangleF = RectangleOf<float>
Type alias for a rectangle using single-precision floating-point numbers.
Auto-generated from sources, Revision , https://github.com/brisklib/brisk/blob//include/brisk/