Louvre v2.14.0-1
C++ library for Wayland compositors
|
Template for 2D vectors. More...
#include <LPoint.h>
Public Member Functions | |
constexpr | LPointTemplate () noexcept |
Initializes the vector with (0,0). | |
constexpr | LPointTemplate (T x, T y) noexcept |
Initializes the vector with (x,y). | |
constexpr | LPointTemplate (T n) noexcept |
Initializes the vector with (n,n). | |
template<class N > | |
constexpr | LPointTemplate (const LPointTemplate< N > &point) noexcept |
Copy constructor. | |
constexpr T | x () const noexcept |
First component of the vector. | |
constexpr T | y () const noexcept |
Second component of the vector. | |
constexpr T | w () const noexcept |
First component of the vector (equivalent to x()) | |
constexpr T | h () const noexcept |
Second component of the vector (equivalent to y()) | |
constexpr T | width () const noexcept |
First component of the vector (equivalent to x()) | |
constexpr T | height () const noexcept |
Second component of the vector (equivalent to y()) | |
constexpr T | area () const noexcept |
Product of the components (x*y) | |
constexpr void | setX (T x) noexcept |
Assigns the value to the first component of the vector. | |
constexpr void | setY (T y) noexcept |
Assigns the value to the second component of the vector. | |
constexpr void | setW (T x) noexcept |
Assigns the value to the first component of the vector (equivalent to setX()) | |
constexpr void | setH (T y) noexcept |
Assigns the value to the second component of the vector (equivalent to setY()) | |
constexpr void | setWidth (T x) noexcept |
Assigns the value to the first component of the vector (equivalent to setX()) | |
constexpr void | setHeight (T y) noexcept |
Assigns the value to the second component of the vector (equivalent to setY()) | |
template<class N > | |
constexpr LPointTemplate< T > | constrainedToHeight (N size) const noexcept |
Assigns the second component while maintaining proportion with the first. | |
template<class N > | |
constexpr T | distanceFrom (const LPointTemplate< N > &point) const noexcept |
Distance from another point. | |
Template for 2D vectors.
The LPointTemplate class is a template for creating two-dimensional vectors.
The library uses this template to generate the LPoint and LSize classes, which work with 32-bit integers, and LPointF and LSizeF, which work with 32-bit floating-point numbers.
|
inlineconstexprnoexcept |
Initializes the vector with (0,0).
|
inlineconstexprnoexcept |
Initializes the vector with (x,y).
|
inlineconstexprnoexcept |
Initializes the vector with (n,n).
|
inlineconstexprnoexcept |
Copy constructor.
First component of the vector (equivalent to x())
Second component of the vector (equivalent to y())
First component of the vector (equivalent to x())
Second component of the vector (equivalent to y())
Product of the components (x*y)
Assigns the value to the first component of the vector.
Assigns the value to the second component of the vector.
Assigns the value to the first component of the vector (equivalent to setX())
Assigns the value to the second component of the vector (equivalent to setY())
Assigns the value to the first component of the vector (equivalent to setX())
Assigns the value to the second component of the vector (equivalent to setY())
|
inlineconstexprnoexcept |
Assigns the second component while maintaining proportion with the first.