jaulib v1.3.6
Jau Support Library (C++, Java, ..)
Loading...
Searching...
No Matches
jau::math::RectI< Value_type, > Class Template Reference

Rectangle with x, y, width and height value_type components. More...

#include <recti.hpp>

Inheritance diagram for jau::math::RectI< Value_type, >:
Collaboration diagram for jau::math::RectI< Value_type, >:

Public Types

typedef const value_typeconst_iterator
 
typedef const value_typeconst_pointer
 
typedef const value_typeconst_reference
 
typedef value_typeiterator
 
typedef value_typepointer
 
typedef value_typereference
 
typedef Value_type value_type
 

Public Member Functions

constexpr RectI () noexcept
 
constexpr RectI (const RectI &o) noexcept=default
 
constexpr RectI (const value_type x, const value_type y, const value_type width, const value_type height) noexcept
 
constexpr RectI (const value_type xywh[]) noexcept
 
constexpr RectI (const Vector2I< value_type > &pos, const Vector2I< value_type > &size) noexcept
 
constexpr RectI (RectI &&o) noexcept=default
 
iterator get (iterator xywh) const noexcept
 xywh = this, returns xywh.
 
constexpr Vector2I< value_typegetPosition () const noexcept
 
constexpr Vector2I< value_typegetSize () const noexcept
 
constexpr value_type height () const noexcept
 
constexpr bool is_zero () const noexcept
 Return true if area is zero.
 
constexpr RectIoperator= (const RectI &) noexcept=default
 
constexpr RectIoperator= (RectI &&) noexcept=default
 
constexpr bool operator== (const RectI &rhs) const noexcept
 
constexpr RectIset (const value_type x, const value_type y, const value_type width, const value_type height) noexcept
 this = { x, y, width, height }, returns this.
 
constexpr RectIset (const Vector2I< value_type > &pos, const Vector2I< value_type > &size) noexcept
 TODO constexpr bool operator<=>(const Recti_t& rhs ) const noexcept { return ... }.
 
constexpr RectIset (const_iterator xywh) noexcept
 this = xywh, returns this.
 
constexpr void setHeight (const value_type height) noexcept
 
constexpr void setPosition (const Vector2I< value_type > &pos) noexcept
 
constexpr void setSize (const Vector2I< value_type > &size) noexcept
 
constexpr void setWidth (const value_type width) noexcept
 
constexpr void setX (const value_type x) noexcept
 
constexpr void setY (const value_type y) noexcept
 
std::string toString () const noexcept
 
constexpr value_type width () const noexcept
 
constexpr value_type x () const noexcept
 
constexpr value_type y () const noexcept
 

Static Public Attributes

static constexpr const size_t byte_size = components * sizeof(value_type)
 Size in bytes with value_alignment.
 
static constexpr const size_t components = 4
 Number of value_type components.
 
static constexpr int value_alignment = sizeof(value_type)
 value alignment is sizeof(value_type)
 

Detailed Description

template<typename Value_type, std::enable_if_t< std::is_integral_v< Value_type > &&sizeof(Value_type)==alignof(Value_type), bool > = true>
class jau::math::RectI< Value_type, >

Rectangle with x, y, width and height value_type components.

Component and overall alignment is natural as sizeof(value_type), i.e. sizeof(value_type) == alignof(value_type)

Definition at line 48 of file recti.hpp.

Member Typedef Documentation

◆ value_type

template<typename Value_type, std::enable_if_t< std::is_integral_v< Value_type > &&sizeof(Value_type)==alignof(Value_type), bool > = true>
typedef Value_type jau::math::RectI< Value_type, >::value_type

Definition at line 50 of file recti.hpp.

◆ pointer

template<typename Value_type, std::enable_if_t< std::is_integral_v< Value_type > &&sizeof(Value_type)==alignof(Value_type), bool > = true>
typedef value_type* jau::math::RectI< Value_type, >::pointer

Definition at line 51 of file recti.hpp.

◆ const_pointer

template<typename Value_type, std::enable_if_t< std::is_integral_v< Value_type > &&sizeof(Value_type)==alignof(Value_type), bool > = true>
typedef const value_type* jau::math::RectI< Value_type, >::const_pointer

Definition at line 52 of file recti.hpp.

◆ reference

template<typename Value_type, std::enable_if_t< std::is_integral_v< Value_type > &&sizeof(Value_type)==alignof(Value_type), bool > = true>
typedef value_type& jau::math::RectI< Value_type, >::reference

Definition at line 53 of file recti.hpp.

◆ const_reference

template<typename Value_type, std::enable_if_t< std::is_integral_v< Value_type > &&sizeof(Value_type)==alignof(Value_type), bool > = true>
typedef const value_type& jau::math::RectI< Value_type, >::const_reference

Definition at line 54 of file recti.hpp.

◆ iterator

template<typename Value_type, std::enable_if_t< std::is_integral_v< Value_type > &&sizeof(Value_type)==alignof(Value_type), bool > = true>
typedef value_type* jau::math::RectI< Value_type, >::iterator

Definition at line 55 of file recti.hpp.

◆ const_iterator

template<typename Value_type, std::enable_if_t< std::is_integral_v< Value_type > &&sizeof(Value_type)==alignof(Value_type), bool > = true>
typedef const value_type* jau::math::RectI< Value_type, >::const_iterator

Definition at line 56 of file recti.hpp.

Constructor & Destructor Documentation

◆ RectI() [1/6]

template<typename Value_type, std::enable_if_t< std::is_integral_v< Value_type > &&sizeof(Value_type)==alignof(Value_type), bool > = true>
jau::math::RectI< Value_type, >::RectI ( )
inlineconstexprnoexcept

Definition at line 74 of file recti.hpp.

◆ RectI() [2/6]

template<typename Value_type, std::enable_if_t< std::is_integral_v< Value_type > &&sizeof(Value_type)==alignof(Value_type), bool > = true>
jau::math::RectI< Value_type, >::RectI ( const value_type xywh[])
inlineconstexprnoexcept

Definition at line 77 of file recti.hpp.

◆ RectI() [3/6]

template<typename Value_type, std::enable_if_t< std::is_integral_v< Value_type > &&sizeof(Value_type)==alignof(Value_type), bool > = true>
jau::math::RectI< Value_type, >::RectI ( const Vector2I< value_type > & pos,
const Vector2I< value_type > & size )
inlineconstexprnoexcept

Definition at line 81 of file recti.hpp.

◆ RectI() [4/6]

template<typename Value_type, std::enable_if_t< std::is_integral_v< Value_type > &&sizeof(Value_type)==alignof(Value_type), bool > = true>
jau::math::RectI< Value_type, >::RectI ( const value_type x,
const value_type y,
const value_type width,
const value_type height )
inlineconstexprnoexcept

Definition at line 85 of file recti.hpp.

◆ RectI() [5/6]

template<typename Value_type, std::enable_if_t< std::is_integral_v< Value_type > &&sizeof(Value_type)==alignof(Value_type), bool > = true>
jau::math::RectI< Value_type, >::RectI ( const RectI< Value_type, > & o)
constexprdefaultnoexcept

◆ RectI() [6/6]

template<typename Value_type, std::enable_if_t< std::is_integral_v< Value_type > &&sizeof(Value_type)==alignof(Value_type), bool > = true>
jau::math::RectI< Value_type, >::RectI ( RectI< Value_type, > && o)
constexprdefaultnoexcept

Member Function Documentation

◆ operator=() [1/2]

template<typename Value_type, std::enable_if_t< std::is_integral_v< Value_type > &&sizeof(Value_type)==alignof(Value_type), bool > = true>
RectI & jau::math::RectI< Value_type, >::operator= ( const RectI< Value_type, > & )
constexprdefaultnoexcept

◆ operator=() [2/2]

template<typename Value_type, std::enable_if_t< std::is_integral_v< Value_type > &&sizeof(Value_type)==alignof(Value_type), bool > = true>
RectI & jau::math::RectI< Value_type, >::operator= ( RectI< Value_type, > && )
constexprdefaultnoexcept

◆ operator==()

template<typename Value_type, std::enable_if_t< std::is_integral_v< Value_type > &&sizeof(Value_type)==alignof(Value_type), bool > = true>
bool jau::math::RectI< Value_type, >::operator== ( const RectI< Value_type, > & rhs) const
inlineconstexprnoexcept

Definition at line 94 of file recti.hpp.

◆ set() [1/3]

template<typename Value_type, std::enable_if_t< std::is_integral_v< Value_type > &&sizeof(Value_type)==alignof(Value_type), bool > = true>
RectI & jau::math::RectI< Value_type, >::set ( const Vector2I< value_type > & pos,
const Vector2I< value_type > & size )
inlineconstexprnoexcept

TODO constexpr bool operator<=>(const Recti_t& rhs ) const noexcept { return ... }.

Definition at line 107 of file recti.hpp.

Here is the caller graph for this function:

◆ set() [2/3]

template<typename Value_type, std::enable_if_t< std::is_integral_v< Value_type > &&sizeof(Value_type)==alignof(Value_type), bool > = true>
RectI & jau::math::RectI< Value_type, >::set ( const value_type x,
const value_type y,
const value_type width,
const value_type height )
inlineconstexprnoexcept

this = { x, y, width, height }, returns this.

Definition at line 111 of file recti.hpp.

◆ set() [3/3]

template<typename Value_type, std::enable_if_t< std::is_integral_v< Value_type > &&sizeof(Value_type)==alignof(Value_type), bool > = true>
RectI & jau::math::RectI< Value_type, >::set ( const_iterator xywh)
inlineconstexprnoexcept

this = xywh, returns this.

Definition at line 115 of file recti.hpp.

◆ get()

template<typename Value_type, std::enable_if_t< std::is_integral_v< Value_type > &&sizeof(Value_type)==alignof(Value_type), bool > = true>
iterator jau::math::RectI< Value_type, >::get ( iterator xywh) const
inlinenoexcept

xywh = this, returns xywh.

Definition at line 119 of file recti.hpp.

◆ x()

template<typename Value_type, std::enable_if_t< std::is_integral_v< Value_type > &&sizeof(Value_type)==alignof(Value_type), bool > = true>
value_type jau::math::RectI< Value_type, >::x ( ) const
inlineconstexprnoexcept

Definition at line 122 of file recti.hpp.

◆ y()

template<typename Value_type, std::enable_if_t< std::is_integral_v< Value_type > &&sizeof(Value_type)==alignof(Value_type), bool > = true>
value_type jau::math::RectI< Value_type, >::y ( ) const
inlineconstexprnoexcept

Definition at line 123 of file recti.hpp.

◆ width()

template<typename Value_type, std::enable_if_t< std::is_integral_v< Value_type > &&sizeof(Value_type)==alignof(Value_type), bool > = true>
value_type jau::math::RectI< Value_type, >::width ( ) const
inlineconstexprnoexcept

Definition at line 124 of file recti.hpp.

◆ height()

template<typename Value_type, std::enable_if_t< std::is_integral_v< Value_type > &&sizeof(Value_type)==alignof(Value_type), bool > = true>
value_type jau::math::RectI< Value_type, >::height ( ) const
inlineconstexprnoexcept

Definition at line 125 of file recti.hpp.

◆ getPosition()

template<typename Value_type, std::enable_if_t< std::is_integral_v< Value_type > &&sizeof(Value_type)==alignof(Value_type), bool > = true>
Vector2I< value_type > jau::math::RectI< Value_type, >::getPosition ( ) const
inlineconstexprnoexcept

Definition at line 126 of file recti.hpp.

◆ getSize()

template<typename Value_type, std::enable_if_t< std::is_integral_v< Value_type > &&sizeof(Value_type)==alignof(Value_type), bool > = true>
Vector2I< value_type > jau::math::RectI< Value_type, >::getSize ( ) const
inlineconstexprnoexcept

Definition at line 127 of file recti.hpp.

◆ setX()

template<typename Value_type, std::enable_if_t< std::is_integral_v< Value_type > &&sizeof(Value_type)==alignof(Value_type), bool > = true>
void jau::math::RectI< Value_type, >::setX ( const value_type x)
inlineconstexprnoexcept

Definition at line 129 of file recti.hpp.

◆ setY()

template<typename Value_type, std::enable_if_t< std::is_integral_v< Value_type > &&sizeof(Value_type)==alignof(Value_type), bool > = true>
void jau::math::RectI< Value_type, >::setY ( const value_type y)
inlineconstexprnoexcept

Definition at line 130 of file recti.hpp.

◆ setWidth()

template<typename Value_type, std::enable_if_t< std::is_integral_v< Value_type > &&sizeof(Value_type)==alignof(Value_type), bool > = true>
void jau::math::RectI< Value_type, >::setWidth ( const value_type width)
inlineconstexprnoexcept

Definition at line 131 of file recti.hpp.

◆ setHeight()

template<typename Value_type, std::enable_if_t< std::is_integral_v< Value_type > &&sizeof(Value_type)==alignof(Value_type), bool > = true>
void jau::math::RectI< Value_type, >::setHeight ( const value_type height)
inlineconstexprnoexcept

Definition at line 132 of file recti.hpp.

◆ setPosition()

template<typename Value_type, std::enable_if_t< std::is_integral_v< Value_type > &&sizeof(Value_type)==alignof(Value_type), bool > = true>
void jau::math::RectI< Value_type, >::setPosition ( const Vector2I< value_type > & pos)
inlineconstexprnoexcept

Definition at line 133 of file recti.hpp.

◆ setSize()

template<typename Value_type, std::enable_if_t< std::is_integral_v< Value_type > &&sizeof(Value_type)==alignof(Value_type), bool > = true>
void jau::math::RectI< Value_type, >::setSize ( const Vector2I< value_type > & size)
inlineconstexprnoexcept

Definition at line 134 of file recti.hpp.

◆ is_zero()

template<typename Value_type, std::enable_if_t< std::is_integral_v< Value_type > &&sizeof(Value_type)==alignof(Value_type), bool > = true>
bool jau::math::RectI< Value_type, >::is_zero ( ) const
inlineconstexprnoexcept

Return true if area is zero.

Definition at line 137 of file recti.hpp.

◆ toString()

template<typename Value_type, std::enable_if_t< std::is_integral_v< Value_type > &&sizeof(Value_type)==alignof(Value_type), bool > = true>
std::string jau::math::RectI< Value_type, >::toString ( ) const
inlinenoexcept

Definition at line 141 of file recti.hpp.

Member Data Documentation

◆ value_alignment

template<typename Value_type, std::enable_if_t< std::is_integral_v< Value_type > &&sizeof(Value_type)==alignof(Value_type), bool > = true>
int jau::math::RectI< Value_type, >::value_alignment = sizeof(value_type)
staticconstexpr

value alignment is sizeof(value_type)

Definition at line 59 of file recti.hpp.

◆ components

template<typename Value_type, std::enable_if_t< std::is_integral_v< Value_type > &&sizeof(Value_type)==alignof(Value_type), bool > = true>
const size_t jau::math::RectI< Value_type, >::components = 4
staticconstexpr

Number of value_type components.

Definition at line 62 of file recti.hpp.

◆ byte_size

template<typename Value_type, std::enable_if_t< std::is_integral_v< Value_type > &&sizeof(Value_type)==alignof(Value_type), bool > = true>
const size_t jau::math::RectI< Value_type, >::byte_size = components * sizeof(value_type)
staticconstexpr

Size in bytes with value_alignment.

Definition at line 65 of file recti.hpp.


The documentation for this class was generated from the following file: