From d8685a579ccf3246b11eef404786cdd9f19f087e Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Mon, 27 Mar 2023 13:20:26 +0100 Subject: ipa: raspberrypi: Generalise the contrast algorithm Generalise the contrast algorithm code by removing any hard-coded assumptions about the target hardware platform. Instead, the algorithm code creates a generic Pwl that gets returned to the IPA, where it gets converted to the bcm2835 hardware specific lookup table. As a drive-by, remove an unused mutex. Signed-off-by: Naushir Patuck Reviewed-by: David Plowman Reviewed-by: Jacopo Mondi Signed-off-by: Kieran Bingham --- src/ipa/raspberrypi/controller/contrast_status.h | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/ipa/raspberrypi/controller/contrast_status.h') diff --git a/src/ipa/raspberrypi/controller/contrast_status.h b/src/ipa/raspberrypi/controller/contrast_status.h index ef2a7c68..fb9fe4ba 100644 --- a/src/ipa/raspberrypi/controller/contrast_status.h +++ b/src/ipa/raspberrypi/controller/contrast_status.h @@ -6,20 +6,15 @@ */ #pragma once +#include "pwl.h" + /* * The "contrast" algorithm creates a gamma curve, optionally doing a little bit * of contrast stretching based on the AGC histogram. */ -constexpr unsigned int ContrastNumPoints = 33; - -struct ContrastPoint { - uint16_t x; - uint16_t y; -}; - struct ContrastStatus { - struct ContrastPoint points[ContrastNumPoints]; + RPiController::Pwl gammaCurve; double brightness; double contrast; }; -- cgit v1.2.1