libcamera
v0.3.1+12-19bbca3c
Supporting cameras in Linux since 2019
|
Public Member Functions | |
constexpr | Vector ()=default |
Construct a zero vector. | |
constexpr | Vector (const std::array< T, Rows > &data) |
Construct vector from supplied data. More... | |
const T & | operator[] (size_t i) const |
Index to an element in the vector. More... | |
T & | operator[] (size_t i) |
Index to an element in the vector. More... | |
constexpr T | x () const |
Convenience function to access the first element of the vector. More... | |
constexpr T | y () const |
Convenience function to access the second element of the vector. More... | |
constexpr T | z () const |
Convenience function to access the third element of the vector. More... | |
constexpr Vector< T, Rows > | operator- () const |
Negate a Vector by negating both all of its coordinates. More... | |
constexpr Vector< T, Rows > | operator- (const Vector< T, Rows > &other) const |
Subtract one vector from another. More... | |
constexpr Vector< T, Rows > | operator+ (const Vector< T, Rows > &other) const |
Add two vectors together. More... | |
constexpr T | operator* (const Vector< T, Rows > &other) const |
Compute the dot product. More... | |
constexpr Vector< T, Rows > | operator* (T factor) const |
Multiply the vector by a scalar. More... | |
constexpr Vector< T, Rows > | operator/ (T factor) const |
Divide the vector by a scalar. More... | |
constexpr double | length2 () const |
Get the squared length of the vector. More... | |
constexpr double | length () const |
Get the length of the vector. More... | |
Vector class.
T | Type of numerical values to be stored in the vector |
Rows | Number of dimension of the vector (= number of elements) |
|
inline |
Construct vector from supplied data.
data | Data from which to construct a vector |
The size of data must be equal to the dimension size Rows of the vector.
|
inline |
Get the length of the vector.
|
inline |
Get the squared length of the vector.
|
inline |
Compute the dot product.
[in] | other | The other vector |
|
inline |
Multiply the vector by a scalar.
[in] | factor | The factor |
|
inline |
Add two vectors together.
[in] | other | The other vector |
|
inline |
Negate a Vector by negating both all of its coordinates.
|
inline |
Subtract one vector from another.
[in] | other | The other vector |
|
inline |
Divide the vector by a scalar.
[in] | factor | The factor |
|
inline |
Index to an element in the vector.
i | Index of element to retrieve |
|
inline |
Index to an element in the vector.
i | Index of element to retrieve |
|
inline |
Convenience function to access the first element of the vector.
|
inline |
Convenience function to access the second element of the vector.
|
inline |
Convenience function to access the third element of the vector.