libcamera: Replace last users of math.h
As described in the coding style document, libcamera favours <cmath> over <math.h>. Replace the last few occurrences of the latter with the former and adapt the code accordingly. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
This commit is contained in:
@@ -8,9 +8,9 @@
|
||||
#include "libcamera/internal/camera_sensor.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <float.h>
|
||||
#include <limits.h>
|
||||
#include <math.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <libcamera/base/utils.h>
|
||||
@@ -719,7 +719,7 @@ V4L2SubdeviceFormat CameraSensor::getFormat(const std::vector<unsigned int> &mbu
|
||||
continue;
|
||||
|
||||
float ratio = static_cast<float>(sz.width) / sz.height;
|
||||
float ratioDiff = fabsf(ratio - desiredRatio);
|
||||
float ratioDiff = std::abs(ratio - desiredRatio);
|
||||
unsigned int area = sz.width * sz.height;
|
||||
unsigned int areaDiff = area - desiredArea;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user