From d1c89a1824416a03da10ebd078869cba79b6015c Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Wed, 27 Jul 2022 09:55:23 +0100 Subject: ipa: raspberrypi: Remove #define constants Replace all #define constant values with equivalent constexpr definitions. As a drive-by, remove the CAMERA_MODE_NAME_LEN constant as it is unused. Signed-off-by: Naushir Patuck Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart --- src/ipa/raspberrypi/controller/rpi/awb.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/ipa/raspberrypi/controller/rpi/awb.cpp') diff --git a/src/ipa/raspberrypi/controller/rpi/awb.cpp b/src/ipa/raspberrypi/controller/rpi/awb.cpp index c1bef96c..6c2b627d 100644 --- a/src/ipa/raspberrypi/controller/rpi/awb.cpp +++ b/src/ipa/raspberrypi/controller/rpi/awb.cpp @@ -18,8 +18,8 @@ LOG_DEFINE_CATEGORY(RPiAwb) #define NAME "rpi.awb" -#define AWB_STATS_SIZE_X DEFAULT_AWB_REGIONS_X -#define AWB_STATS_SIZE_Y DEFAULT_AWB_REGIONS_Y +static constexpr unsigned int AwbStatsSizeX = DEFAULT_AWB_REGIONS_X; +static constexpr unsigned int AwbStatsSizeY = DEFAULT_AWB_REGIONS_Y; /* * todo - the locking in this algorithm needs some tidying up as has been done @@ -357,7 +357,7 @@ static void generateStats(std::vector &zones, bcm2835_isp_stats_region *stats, double minPixels, double minG) { - for (int i = 0; i < AWB_STATS_SIZE_X * AWB_STATS_SIZE_Y; i++) { + for (unsigned int i = 0; i < AwbStatsSizeX * AwbStatsSizeY; i++) { Awb::RGB zone; double counted = stats[i].counted; if (counted >= minPixels) { @@ -599,7 +599,7 @@ void Awb::awbBayes() * valid... not entirely sure about this. */ Pwl prior = interpolatePrior(); - prior *= zones_.size() / (double)(AWB_STATS_SIZE_X * AWB_STATS_SIZE_Y); + prior *= zones_.size() / (double)(AwbStatsSizeX * AwbStatsSizeY); prior.map([](double x, double y) { LOG(RPiAwb, Debug) << "(" << x << "," << y << ")"; }); -- cgit v1.2.1