[RFC,v2,11/13] libcamera: ipa: simple: Use float type for adjustment controls
diff mbox series

Message ID 20251120104548.80268-12-mzamazal@redhat.com
State New
Headers show
Series
  • Simple pipeline IPA cleanup
Related show

Commit Message

Milan Zamazal Nov. 20, 2025, 10:45 a.m. UTC
control_ids.h defines the contrast type as float, let's use the same in
simple IPA, instead of double.  Saturation and gamma already use float,
except for the knobs, let's use float for the knobs too.

Signed-off-by: Milan Zamazal <mzamazal@redhat.com>
---
 src/ipa/simple/algorithms/adjust.cpp | 6 +++---
 src/ipa/simple/ipa_context.h         | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

Patch
diff mbox series

diff --git a/src/ipa/simple/algorithms/adjust.cpp b/src/ipa/simple/algorithms/adjust.cpp
index 600fd3c7b..57ed4f6bf 100644
--- a/src/ipa/simple/algorithms/adjust.cpp
+++ b/src/ipa/simple/algorithms/adjust.cpp
@@ -33,9 +33,9 @@  int Adjust::init(IPAContext &context, [[maybe_unused]] const YamlObject &tuningD
 int Adjust::configure(IPAContext &context,
 		      [[maybe_unused]] const IPAConfigInfo &configInfo)
 {
-	context.activeState.knobs.gamma = std::optional<double>();
-	context.activeState.knobs.contrast = std::optional<double>();
-	context.activeState.knobs.saturation = std::optional<double>();
+	context.activeState.knobs.gamma = std::optional<float>();
+	context.activeState.knobs.contrast = std::optional<float>();
+	context.activeState.knobs.saturation = std::optional<float>();
 
 	return 0;
 }
diff --git a/src/ipa/simple/ipa_context.h b/src/ipa/simple/ipa_context.h
index 8f56c25bf..fb063b091 100644
--- a/src/ipa/simple/ipa_context.h
+++ b/src/ipa/simple/ipa_context.h
@@ -58,7 +58,7 @@  struct IPAActiveState {
 		std::array<double, kGammaLookupSize> gammaTable;
 		uint8_t blackLevel;
 		float gamma;
-		double contrast;
+		float contrast;
 	} gamma;
 
 	Matrix<float, 3, 3> ccm;
@@ -68,7 +68,7 @@  struct IPAActiveState {
 	struct {
 		std::optional<float> gamma;
 		/* 0..2 range, 1.0 = normal */
-		std::optional<double> contrast;
+		std::optional<float> contrast;
 		std::optional<float> saturation;
 	} knobs;
 };
@@ -87,7 +87,7 @@  struct IPAFrameContext : public FrameContext {
 	} gains;
 
 	std::optional<float> gamma;
-	std::optional<double> contrast;
+	std::optional<float> contrast;
 	std::optional<float> saturation;
 };