diff options
author | Naushir Patuck <naush@raspberrypi.com> | 2022-07-27 09:55:23 +0100 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2022-07-27 18:12:18 +0300 |
commit | d1c89a1824416a03da10ebd078869cba79b6015c (patch) | |
tree | 4152532504e20902e519027bea3f05ed24a92156 /src/ipa/raspberrypi/controller/rpi/awb.cpp | |
parent | 8757cc7c4291420e94047ea54a735cbaa1eb6adb (diff) |
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 <naush@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/ipa/raspberrypi/controller/rpi/awb.cpp')
-rw-r--r-- | src/ipa/raspberrypi/controller/rpi/awb.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
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<Awb::RGB> &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 << ")"; }); |