@@ -8,6 +8,7 @@
#pragma once
#include <memory>
+#include <span>
#include <vector>
#include <libcamera/controls.h>
@@ -85,8 +86,8 @@ public:
LscAlgorithm() = default;
int configure(lsc::ActiveState &state, const Rectangle &analogCrop,
- const std::vector<double> &xPos,
- const std::vector<double> &yPos)
+ std::span<const double> xPos,
+ std::span<const double> yPos)
{
LscImplementation::ComponentsMap data =
impl_->sampleForCrop(analogCrop, xPos, yPos);
@@ -8,6 +8,7 @@
#pragma once
#include <map>
+#include <span>
#include <stdint.h>
#include <string>
#include <vector>
@@ -42,7 +43,7 @@ public:
virtual ComponentsMap
sampleForCrop(const Rectangle &cropRectangle,
- std::vector<double> xPos, std::vector<double> yPos) = 0;
+ std::span<const double> xPos, std::span<const double> yPos) = 0;
};
} /* namespace ipa */
@@ -196,7 +196,7 @@ int LscPolynomial::parseLscData(const ValueNode &sets,
*/
LscImplementation::ComponentsMap
LscPolynomial::sampleForCrop(const Rectangle &cropRectangle,
- std::vector<double> xPos, std::vector<double> yPos)
+ std::span<const double> xPos, std::span<const double> yPos)
{
LscImplementation::ComponentsMap components;
@@ -61,7 +61,7 @@ public:
LscImplementation::ComponentsMap
sampleForCrop(const Rectangle &cropRectangle,
- std::vector<double> xPos, std::vector<double> yPos) override;
+ std::span<const double> xPos, std::span<const double> yPos) override;
private:
std::vector<float> samplePolynomial(const lsc::Polynomial &poly,
@@ -30,8 +30,8 @@ public:
LscImplementation::ComponentsMap
sampleForCrop([[maybe_unused]] const Rectangle &cropRectangle,
- [[maybe_unused]] std::vector<double> xPos,
- [[maybe_unused]] std::vector<double> yPos) override
+ [[maybe_unused]] std::span<const double> xPos,
+ [[maybe_unused]] std::span<const double> yPos) override
{
LOG(LscTable, Warning)
<< "Tabular LSC data doesn't support resampling";
`LscPolynomial` already uses spans internally, and there is no reason to require a `std::vector`, so use `std::span`. Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> --- src/ipa/libipa/lsc.h | 5 +++-- src/ipa/libipa/lsc_base.h | 3 ++- src/ipa/libipa/lsc_polynomial.cpp | 2 +- src/ipa/libipa/lsc_polynomial.h | 2 +- src/ipa/libipa/lsc_table.h | 4 ++-- 5 files changed, 9 insertions(+), 7 deletions(-)