From 09c291192c58fcf37a997aab273e3b0409a79277 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Thu, 26 Sep 2024 12:29:28 +0300 Subject: ipa: rpi: Replace last users of math.h As described in the coding style document, libcamera favours over . Replace the last few occurrences of the latter with the former in the Raspberry Pi IPA and adapt the code accordingly. In some cases, the include is simply dropped as it isn't needed. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham Reviewed-by: Naushir Patuck --- src/ipa/rpi/controller/histogram.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/ipa/rpi/controller/histogram.cpp') diff --git a/src/ipa/rpi/controller/histogram.cpp b/src/ipa/rpi/controller/histogram.cpp index ba5b25dd..13089839 100644 --- a/src/ipa/rpi/controller/histogram.cpp +++ b/src/ipa/rpi/controller/histogram.cpp @@ -4,7 +4,7 @@ * * histogram calculations */ -#include +#include #include #include "histogram.h" @@ -49,9 +49,9 @@ double Histogram::interBinMean(double binLo, double binHi) const { assert(binHi >= binLo); double sumBinFreq = 0, cumulFreq = 0; - for (double binNext = floor(binLo) + 1.0; binNext <= ceil(binHi); + for (double binNext = std::floor(binLo) + 1.0; binNext <= std::ceil(binHi); binLo = binNext, binNext += 1.0) { - int bin = floor(binLo); + int bin = std::floor(binLo); double freq = (cumulative_[bin + 1] - cumulative_[bin]) * (std::min(binNext, binHi) - binLo); sumBinFreq += bin * freq; -- cgit v1.2.1