libcamera
v0.4.0
Supporting cameras in Linux since 2019
|
Public Member Functions | |
constexpr | Vector ()=default |
Construct an uninitialized vector. | |
constexpr | Vector (T scalar) |
Construct a vector filled with a scalar value. More... | |
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 Vector< T, Rows > | operator- () const |
Negate a Vector by negating both all of its coordinates. More... | |
constexpr Vector | operator+ (const Vector &other) const |
Calculate the sum of this vector and other element-wise. More... | |
constexpr Vector | operator+ (T scalar) const |
Calculate the sum of this vector and scalar element-wise. More... | |
constexpr Vector | operator- (const Vector &other) const |
Calculate the difference of this vector and other element-wise. More... | |
constexpr Vector | operator- (T scalar) const |
Calculate the difference of this vector and scalar element-wise. More... | |
constexpr Vector | operator* (const Vector &other) const |
Calculate the product of this vector and other element-wise. More... | |
constexpr Vector | operator* (T scalar) const |
Calculate the product of this vector and scalar element-wise. More... | |
constexpr Vector | operator/ (const Vector &other) const |
Calculate the quotient of this vector and other element-wise. More... | |
constexpr Vector | operator/ (T scalar) const |
Calculate the quotient of this vector and scalar element-wise. More... | |
Vector & | operator+= (const Vector &other) |
Add other element-wise to this vector. More... | |
Vector & | operator+= (T scalar) |
Add scalar element-wise to this vector. More... | |
Vector & | operator-= (const Vector &other) |
Subtract other element-wise from this vector. More... | |
Vector & | operator-= (T scalar) |
Subtract scalar element-wise from this vector. More... | |
Vector & | operator*= (const Vector &other) |
Multiply this vector by other element-wise. More... | |
Vector & | operator*= (T scalar) |
Multiply this vector by scalar element-wise. More... | |
Vector & | operator/= (const Vector &other) |
Divide this vector by other element-wise. More... | |
Vector & | operator/= (T scalar) |
Divide this vector by scalar element-wise. More... | |
constexpr Vector | min (const Vector &other) const |
Calculate the minimum of this vector and other element-wise. More... | |
constexpr Vector | min (T scalar) const |
Calculate the minimum of this vector and scalar element-wise. More... | |
constexpr Vector | max (const Vector &other) const |
Calculate the maximum of this vector and other element-wise. More... | |
constexpr Vector | max (T scalar) const |
Calculate the maximum of this vector and scalar element-wise. More... | |
constexpr T | dot (const Vector< T, Rows > &other) const |
Compute the dot product. More... | |
constexpr const T & | x () const |
Convenience function to access the first element of the vector. More... | |
constexpr const T & | y () const |
Convenience function to access the second element of the vector. More... | |
constexpr const T & | z () const |
Convenience function to access the third element of the vector. More... | |
constexpr T & | x () |
Convenience function to access the first element of the vector. More... | |
constexpr T & | y () |
Convenience function to access the second element of the vector. More... | |
constexpr T & | z () |
Convenience function to access the third element of the vector. More... | |
constexpr const T & | r () const |
Convenience function to access the first element of the vector. More... | |
constexpr const T & | g () const |
Convenience function to access the second element of the vector. More... | |
constexpr const T & | b () const |
Convenience function to access the third element of the vector. More... | |
constexpr T & | r () |
Convenience function to access the first element of the vector. More... | |
constexpr T & | g () |
Convenience function to access the second element of the vector. More... | |
constexpr T & | b () |
Convenience function to access the third element of the vector. More... | |
constexpr double | length2 () const |
Get the squared length of the vector. More... | |
constexpr double | length () const |
Get the length of the vector. More... | |
template<typename R = T> | |
constexpr R | sum () const |
Calculate the sum of all the vector elements. More... | |
Vector class.
T | Type of numerical values to be stored in the vector |
Rows | Number of dimension of the vector (= number of elements) |
|
inlineexplicit |
Construct a vector filled with a scalar value.
[in] | scalar | The scalar value |
|
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 |
Convenience function to access the third element of the vector.
|
inline |
Convenience function to access the third element of the vector.
|
inline |
Compute the dot product.
[in] | other | The other vector |
|
inline |
Convenience function to access the second element of the vector.
|
inline |
Convenience function to access the second element of the vector.
|
inline |
Get the length of the vector.
|
inline |
Get the squared length of the vector.
|
inline |
Calculate the maximum of this vector and other element-wise.
[in] | other | The other vector |
|
inline |
Calculate the maximum of this vector and scalar element-wise.
[in] | scalar | The scalar |
|
inline |
Calculate the minimum of this vector and other element-wise.
[in] | other | The other vector |
|
inline |
Calculate the minimum of this vector and scalar element-wise.
[in] | scalar | The scalar |
|
inline |
Calculate the product of this vector and other element-wise.
[in] | other | The other vector |
|
inline |
Calculate the product of this vector and scalar element-wise.
[in] | scalar | The scalar |
|
inline |
Multiply this vector by other element-wise.
[in] | other | The other vector |
|
inline |
Multiply this vector by scalar element-wise.
[in] | scalar | The scalar |
|
inline |
Calculate the sum of this vector and other element-wise.
[in] | other | The other vector |
|
inline |
Calculate the sum of this vector and scalar element-wise.
[in] | scalar | The scalar |
|
inline |
Add other element-wise to this vector.
[in] | other | The other vector |
|
inline |
Add scalar element-wise to this vector.
[in] | scalar | The scalar |
|
inline |
Negate a Vector by negating both all of its coordinates.
|
inline |
Calculate the difference of this vector and other element-wise.
[in] | other | The other vector |
|
inline |
Calculate the difference of this vector and scalar element-wise.
[in] | scalar | The scalar |
|
inline |
Subtract other element-wise from this vector.
[in] | other | The other vector |
|
inline |
Subtract scalar element-wise from this vector.
[in] | scalar | The scalar |
|
inline |
Calculate the quotient of this vector and other element-wise.
[in] | other | The other vector |
|
inline |
Calculate the quotient of this vector and scalar element-wise.
[in] | scalar | The scalar |
|
inline |
Divide this vector by other element-wise.
[in] | other | The other vector |
|
inline |
Divide this vector by scalar element-wise.
[in] | scalar | The scalar |
|
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 first element of the vector.
|
inline |
Calculate the sum of all the vector elements.
R | The type of the sum |
The type R of the sum defaults to the type T of the elements, but can be set explicitly to use a different type in case the type T would risk overflowing.
|
inline |
Convenience function to access the first element of the vector.
|
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 second element of the vector.
|
inline |
Convenience function to access the third element of the vector.
|
inline |
Convenience function to access the third element of the vector.