libcamera: matrix: Add a Span based constructor
When one wants to create a Matrix from existing data, currently the only way is via std::array. Add a Span based constructor to allow creation from vectors and alike. Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
This commit is contained in:
@@ -34,6 +34,11 @@ public:
|
||||
std::copy(data.begin(), data.end(), data_.begin());
|
||||
}
|
||||
|
||||
Matrix(const Span<const T, Rows * Cols> data)
|
||||
{
|
||||
std::copy(data.begin(), data.end(), data_.begin());
|
||||
}
|
||||
|
||||
static constexpr Matrix identity()
|
||||
{
|
||||
Matrix ret;
|
||||
|
||||
Reference in New Issue
Block a user