mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-12 14:59:44 +03:00
libcamera: matrix: Add read-only accessor to internal data
Add a data() function to the Matrix class to access the internal data. This is useful for code that needs to use the matrix contents as a linear array, as shown by the RkISP1::Ccm::process() function that needs to copy the matrix data to a local variable. Simplify that function by using the new accessor. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Milan Zamazal <mzamazal@redhat.com>
This commit is contained in:
parent
7fdfe648a4
commit
7e5d811842
3 changed files with 14 additions and 6 deletions
|
@ -66,6 +66,8 @@ public:
|
|||
return out.str();
|
||||
}
|
||||
|
||||
Span<const T, Rows * Cols> data() const { return data_; }
|
||||
|
||||
Span<const T, Cols> operator[](size_t i) const
|
||||
{
|
||||
return Span<const T, Cols>{ &data_.data()[i * Cols], Cols };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue