| Message ID | 20260922155035.235817-2-barnabas.pocze@ideasonboard.com |
|---|---|
| State | New |
| Headers | show |
| Series |
|
| Related | show |
Quoting Barnabás Pőcze (2026-09-22 16:50:35) > `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> That looks easy :) Reviewed-by: Kieran Bingham <kieran.bingham@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(-) > > diff --git a/src/ipa/libipa/lsc.h b/src/ipa/libipa/lsc.h > index ad378cc6ce..cb9c582d9e 100644 > --- a/src/ipa/libipa/lsc.h > +++ b/src/ipa/libipa/lsc.h > @@ -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); > diff --git a/src/ipa/libipa/lsc_base.h b/src/ipa/libipa/lsc_base.h > index 0f417f5b92..2442bce135 100644 > --- a/src/ipa/libipa/lsc_base.h > +++ b/src/ipa/libipa/lsc_base.h > @@ -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 */ > diff --git a/src/ipa/libipa/lsc_polynomial.cpp b/src/ipa/libipa/lsc_polynomial.cpp > index da1659c759..1a9deb947a 100644 > --- a/src/ipa/libipa/lsc_polynomial.cpp > +++ b/src/ipa/libipa/lsc_polynomial.cpp > @@ -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; > diff --git a/src/ipa/libipa/lsc_polynomial.h b/src/ipa/libipa/lsc_polynomial.h > index 72d874f45c..12031b9509 100644 > --- a/src/ipa/libipa/lsc_polynomial.h > +++ b/src/ipa/libipa/lsc_polynomial.h > @@ -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, > diff --git a/src/ipa/libipa/lsc_table.h b/src/ipa/libipa/lsc_table.h > index 5af6eec137..49959dca32 100644 > --- a/src/ipa/libipa/lsc_table.h > +++ b/src/ipa/libipa/lsc_table.h > @@ -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"; > -- > 2.55.0 >
diff --git a/src/ipa/libipa/lsc.h b/src/ipa/libipa/lsc.h index ad378cc6ce..cb9c582d9e 100644 --- a/src/ipa/libipa/lsc.h +++ b/src/ipa/libipa/lsc.h @@ -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); diff --git a/src/ipa/libipa/lsc_base.h b/src/ipa/libipa/lsc_base.h index 0f417f5b92..2442bce135 100644 --- a/src/ipa/libipa/lsc_base.h +++ b/src/ipa/libipa/lsc_base.h @@ -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 */ diff --git a/src/ipa/libipa/lsc_polynomial.cpp b/src/ipa/libipa/lsc_polynomial.cpp index da1659c759..1a9deb947a 100644 --- a/src/ipa/libipa/lsc_polynomial.cpp +++ b/src/ipa/libipa/lsc_polynomial.cpp @@ -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; diff --git a/src/ipa/libipa/lsc_polynomial.h b/src/ipa/libipa/lsc_polynomial.h index 72d874f45c..12031b9509 100644 --- a/src/ipa/libipa/lsc_polynomial.h +++ b/src/ipa/libipa/lsc_polynomial.h @@ -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, diff --git a/src/ipa/libipa/lsc_table.h b/src/ipa/libipa/lsc_table.h index 5af6eec137..49959dca32 100644 --- a/src/ipa/libipa/lsc_table.h +++ b/src/ipa/libipa/lsc_table.h @@ -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(-)