libcamera: vector: Add a Span based constructor
When one wants to create a Vector from existing data, currently the only way is via std::array. Add a Span based constructor to allow creation from std::vectors and alike. While at it, replace the manual loop with std::copy. Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
This commit is contained in:
parent
aca9042abd
commit
bcba580546
2 changed files with 14 additions and 2 deletions
|
@ -44,6 +44,14 @@ LOG_DEFINE_CATEGORY(Vector)
|
|||
* The size of \a data must be equal to the dimension size Rows of the vector.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \fn Vector::Vector(const Span<const T, Rows> data)
|
||||
* \brief Construct vector from supplied data
|
||||
* \param data Data from which to construct a vector
|
||||
*
|
||||
* The size of \a data must be equal to the dimension size Rows of the vector.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \fn T Vector::operator[](size_t i) const
|
||||
* \brief Index to an element in the vector
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue