libcamera: libcamera::ipa::Vector< T, Rows > Class Template Reference

libcamera v0.3.2 Supporting cameras in Linux since 2019

Loading...
Searching...
No Matches
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.
const T & | operator[] (size_t i) const
| Index to an element in the vector.
T & | operator[] (size_t i)
| Index to an element in the vector.
constexpr T | x () const
| Convenience function to access the first element of the vector.
constexpr T | y () const
| Convenience function to access the second element of the vector.
constexpr T | z () const
| Convenience function to access the third element of the vector.
constexpr Vector< T, Rows > | operator- () const
| Negate a Vector by negating both all of its coordinates.
constexpr Vector< T, Rows > | operator- (const Vector< T, Rows > &other) const
| Subtract one vector from another.
constexpr Vector< T, Rows > | operator+ (const Vector< T, Rows > &other) const
| Add two vectors together.
constexpr T | operator* (const Vector< T, Rows > &other) const
| Compute the dot product.
constexpr Vector< T, Rows > | operator* (T factor) const
| Multiply the vector by a scalar.
constexpr Vector< T, Rows > | operator/ (T factor) const
| Divide the vector by a scalar.
constexpr double | length2 () const
| Get the squared length of the vector.
constexpr double | length () const
| Get the length of the vector.

## Detailed Description

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

Vector class.

Template Parameters

  T | Type of numerical values to be stored in the vector
  Rows | Number 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 | ) |
| inlineconstexpr

Construct vector from supplied data.

Parameters

  data | Data 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>

double libcamera::ipa::Vector< T, Rows >::length | ( |  | ) | const
| inlineconstexpr

Get the length of the vector.

Returns
  The length of the vector

## ◆ length2()

template<typename T , unsigned int Rows>

double libcamera::ipa::Vector< T, Rows >::length2 | ( |  | ) | const
| inlineconstexpr

Get the squared length of the vector.

Returns
  The squared length of the vector

## ◆ operator*() [1/2]

template<typename T , unsigned int Rows>

T libcamera::ipa::Vector< T, Rows >::operator* | ( | const Vector< T, Rows > & | other | ) | const
| inlineconstexpr

Compute the dot product.

Parameters

  [in] | other | The other vector

Returns
  The dot product of the two vectors

## ◆ operator*() [2/2]

template<typename T , unsigned int Rows>

Vector< T, Rows > libcamera::ipa::Vector< T, Rows >::operator* | ( | T | factor | ) | const
| inlineconstexpr

Multiply the vector by a scalar.

Parameters

  [in] | factor | The factor

Returns
  The vector multiplied by factor

## ◆ operator+()

template<typename T , unsigned int Rows>

Vector< T, Rows > libcamera::ipa::Vector< T, Rows >::operator+ | ( | const Vector< T, Rows > & | other | ) | const
| inlineconstexpr

Add two vectors together.

Parameters

  [in] | other | The other vector

Returns
  The sum of the two vectors

## ◆ operator-() [1/2]

template<typename T , unsigned int Rows>

Vector< T, Rows > libcamera::ipa::Vector< T, Rows >::operator- | ( |  | ) | const
| inlineconstexpr

Negate a Vector by negating both all of its coordinates.

Returns
  The negated vector

## ◆ operator-() [2/2]

template<typename T , unsigned int Rows>

Vector< T, Rows > libcamera::ipa::Vector< T, Rows >::operator- | ( | const Vector< T, Rows > & | other | ) | const
| inlineconstexpr

Subtract one vector from another.

Parameters

  [in] | other | The other vector

Returns
  The difference of other from this vector

## ◆ operator/()

template<typename T , unsigned int Rows>

Vector< T, Rows > libcamera::ipa::Vector< T, Rows >::operator/ | ( | T | factor | ) | const
| inlineconstexpr

Divide the vector by a scalar.

Parameters

  [in] | factor | The 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 | ) |
| inline

Index to an element in the vector.

Parameters

  i | Index of element to retrieve

Returns
  Element at index i from the vector

## ◆ operator[]() [2/2]

template<typename T , unsigned int Rows>

const T & libcamera::ipa::Vector< T, Rows >::operator[] | ( | size_t | i | ) | const
| inline

Index to an element in the vector.

Parameters

  i | Index of element to retrieve

Returns
  Element at index i from the vector

## ◆ x()

template<typename T , unsigned int Rows>

T libcamera::ipa::Vector< T, Rows >::x | ( |  | ) | const
| inlineconstexpr

Convenience function to access the first element of the vector.

Returns
  The first element of the vector

## ◆ y()

template<typename T , unsigned int Rows>

T libcamera::ipa::Vector< T, Rows >::y | ( |  | ) | const
| inlineconstexpr

Convenience function to access the second element of the vector.

Returns
  The second element of the vector

## ◆ z()

template<typename T , unsigned int Rows>

T libcamera::ipa::Vector< T, Rows >::z | ( |  | ) | const
| inlineconstexpr

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:

- src/ipa/libipa/vector.h
- src/ipa/libipa/vector.cpp