libcamera: Use utils::abs_diff()
Use the new utils::abs_diff() function where appropriate to replace manual implementations. While at it fix a header ordering issue in src/libcamera/pipeline/raspberrypi/raspberrypi.cpp. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
This commit is contained in:
parent
f413f944d7
commit
e788807371
5 changed files with 10 additions and 9 deletions
|
@ -12,6 +12,7 @@
|
|||
#include <cmath>
|
||||
|
||||
#include <libcamera/base/log.h>
|
||||
#include <libcamera/base/utils.h>
|
||||
|
||||
#include <libcamera/ipa/core_ipa_interface.h>
|
||||
|
||||
|
@ -145,7 +146,7 @@ void Agc::computeExposure(IPAContext &context, double yGain)
|
|||
kMaxAnalogueGain);
|
||||
|
||||
/* Consider within 1% of the target as correctly exposed. */
|
||||
if (std::abs(yGain - 1.0) < 0.01)
|
||||
if (utils::abs_diff(yGain, 1.0) < 0.01)
|
||||
return;
|
||||
|
||||
/* extracted from Rpi::Agc::computeTargetExposure. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue