libcamera  v0.3.1+12-19bbca3c
Supporting cameras in Linux since 2019
Public Member Functions | List of all members
libcamera::ipa::Vector< T, Rows > Class Template Reference

Vector class. More...

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...
 

Detailed Description

template<typename T, unsigned int Rows>
class libcamera::ipa::Vector< T, Rows >

Vector class.

Template Parameters
TType of numerical values to be stored in the vector
RowsNumber of dimension of the vector (= number of elements)

Constructor & Destructor Documentation

◆ Vector()

template<typename T, unsigned int Rows>
libcamera::ipa::Vector< T, Rows >::Vector ( const std::array< T, Rows > &  data)
inline

Construct vector from supplied data.

Parameters
dataData from which to construct a vector

The size of data must be equal to the dimension size Rows of the vector.

Member Function Documentation

◆ length()

template<typename T, unsigned int Rows>
libcamera::ipa::Vector< T, Rows >::length ( ) const
inline

Get the length of the vector.

Returns
The length of the vector

◆ length2()

template<typename T, unsigned int Rows>
libcamera::ipa::Vector< T, Rows >::length2 ( ) const
inline

Get the squared length of the vector.

Returns
The squared length of the vector

◆ operator*() [1/2]

template<typename T, unsigned int Rows>
libcamera::ipa::Vector< T, Rows >::operator* ( const Vector< T, Rows > &  other) const
inline

Compute the dot product.

Parameters
[in]otherThe other vector
Returns
The dot product of the two vectors

◆ operator*() [2/2]

template<typename T, unsigned int Rows>
libcamera::ipa::Vector< T, Rows >::operator* ( factor) const
inline

Multiply the vector by a scalar.

Parameters
[in]factorThe factor
Returns
The vector multiplied by factor

◆ operator+()

template<typename T, unsigned int Rows>
libcamera::ipa::Vector< T, Rows >::operator+ ( const Vector< T, Rows > &  other) const
inline

Add two vectors together.

Parameters
[in]otherThe other vector
Returns
The sum of the two vectors

◆ operator-() [1/2]

template<typename T, unsigned int Rows>
libcamera::ipa::Vector< T, Rows >::operator- ( ) const
inline

Negate a Vector by negating both all of its coordinates.

Returns
The negated vector

◆ operator-() [2/2]

template<typename T, unsigned int Rows>
libcamera::ipa::Vector< T, Rows >::operator- ( const Vector< T, Rows > &  other) const
inline

Subtract one vector from another.

Parameters
[in]otherThe other vector
Returns
The difference of other from this vector

◆ operator/()

template<typename T, unsigned int Rows>
libcamera::ipa::Vector< T, Rows >::operator/ ( factor) const
inline

Divide the vector by a scalar.

Parameters
[in]factorThe factor
Returns
The vector divided by factor

◆ operator[]() [1/2]

template<typename T, unsigned int Rows>
T libcamera::ipa::Vector< T, Rows >::operator[] ( size_t  i) const
inline

Index to an element in the vector.

Parameters
iIndex of element to retrieve
Returns
Element at index i from the vector

◆ operator[]() [2/2]

template<typename T, unsigned int Rows>
T & libcamera::ipa::Vector< T, Rows >::operator[] ( size_t  i)
inline

Index to an element in the vector.

Parameters
iIndex of element to retrieve
Returns
Element at index i from the vector

◆ x()

template<typename T, unsigned int Rows>
libcamera::ipa::Vector< T, Rows >::x ( ) const
inline

Convenience function to access the first element of the vector.

Returns
The first element of the vector

◆ y()

template<typename T, unsigned int Rows>
libcamera::ipa::Vector< T, Rows >::y ( ) const
inline

Convenience function to access the second element of the vector.

Returns
The second element of the vector

◆ z()

template<typename T, unsigned int Rows>
libcamera::ipa::Vector< T, Rows >::z ( ) const
inline

Convenience function to access the third element of the vector.

Returns
The third element of the vector

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