[libcamera-devel] [PATCH 05/17] DNI: ipa: raspberrypi: Code refactoring to match style guidelines
Naushir Patuck
naush at raspberrypi.com
Tue Jul 26 14:45:37 CEST 2022
Refactor the source files under src/ipa/raspberrypi/controller/d* to match the
recommended formatting guidelines for the libcamera project. The vast majority
of changes in this commit comprise of switching from snake_case to CamelCase,
and starting class member functions with a lower case character.
Signed-off-by: Naushir Patuck <naush at raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
---
.../controller/denoise_algorithm.hpp | 2 +-
.../raspberrypi/controller/denoise_status.h | 4 ++--
.../raspberrypi/controller/device_status.cpp | 18 +++++++++---------
src/ipa/raspberrypi/controller/device_status.h | 16 ++++++++--------
src/ipa/raspberrypi/controller/noise_status.h | 4 ++--
5 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/src/ipa/raspberrypi/controller/denoise_algorithm.hpp b/src/ipa/raspberrypi/controller/denoise_algorithm.hpp
index 39fcd7e94df2..48de542ac4f3 100644
--- a/src/ipa/raspberrypi/controller/denoise_algorithm.hpp
+++ b/src/ipa/raspberrypi/controller/denoise_algorithm.hpp
@@ -17,7 +17,7 @@ class DenoiseAlgorithm : public Algorithm
public:
DenoiseAlgorithm(Controller *controller) : Algorithm(controller) {}
// A Denoise algorithm must provide the following:
- virtual void SetMode(DenoiseMode mode) = 0;
+ virtual void setMode(DenoiseMode mode) = 0;
};
} // namespace RPiController
diff --git a/src/ipa/raspberrypi/controller/denoise_status.h b/src/ipa/raspberrypi/controller/denoise_status.h
index 67a3c361387e..fe304d098253 100644
--- a/src/ipa/raspberrypi/controller/denoise_status.h
+++ b/src/ipa/raspberrypi/controller/denoise_status.h
@@ -13,8 +13,8 @@ extern "C" {
#endif
struct DenoiseStatus {
- double noise_constant;
- double noise_slope;
+ double noiseConstant;
+ double noiseSlope;
double strength;
unsigned int mode;
};
diff --git a/src/ipa/raspberrypi/controller/device_status.cpp b/src/ipa/raspberrypi/controller/device_status.cpp
index a389c40dafed..f8ed77354a0a 100644
--- a/src/ipa/raspberrypi/controller/device_status.cpp
+++ b/src/ipa/raspberrypi/controller/device_status.cpp
@@ -10,21 +10,21 @@ using namespace libcamera; /* for the Duration operator<< overload */
std::ostream &operator<<(std::ostream &out, const DeviceStatus &d)
{
- out << "Exposure: " << d.shutter_speed
- << " Frame length: " << d.frame_length
- << " Gain: " << d.analogue_gain;
+ out << "Exposure: " << d.shutterSpeed
+ << " Frame length: " << d.frameLength
+ << " Gain: " << d.analogueGain;
if (d.aperture)
out << " Aperture: " << *d.aperture;
- if (d.lens_position)
- out << " Lens: " << *d.lens_position;
+ if (d.lensPosition)
+ out << " Lens: " << *d.lensPosition;
- if (d.flash_intensity)
- out << " Flash: " << *d.flash_intensity;
+ if (d.flashIntensity)
+ out << " Flash: " << *d.flashIntensity;
- if (d.sensor_temperature)
- out << " Temperature: " << *d.sensor_temperature;
+ if (d.sensorTemperature)
+ out << " Temperature: " << *d.sensorTemperature;
return out;
}
diff --git a/src/ipa/raspberrypi/controller/device_status.h b/src/ipa/raspberrypi/controller/device_status.h
index b33f0d093ff3..ebcd7da2586b 100644
--- a/src/ipa/raspberrypi/controller/device_status.h
+++ b/src/ipa/raspberrypi/controller/device_status.h
@@ -18,24 +18,24 @@
struct DeviceStatus {
DeviceStatus()
- : shutter_speed(std::chrono::seconds(0)), frame_length(0),
- analogue_gain(0.0)
+ : shutterSpeed(std::chrono::seconds(0)), frameLength(0),
+ analogueGain(0.0)
{
}
friend std::ostream &operator<<(std::ostream &out, const DeviceStatus &d);
/* time shutter is open */
- libcamera::utils::Duration shutter_speed;
+ libcamera::utils::Duration shutterSpeed;
/* frame length given in number of lines */
- uint32_t frame_length;
- double analogue_gain;
+ uint32_t frameLength;
+ double analogueGain;
/* 1.0/distance-in-metres, or 0 if unknown */
- std::optional<double> lens_position;
+ std::optional<double> lensPosition;
/* 1/f so that brightness quadruples when this doubles, or 0 if unknown */
std::optional<double> aperture;
/* proportional to brightness with 0 = no flash, 1 = maximum flash */
- std::optional<double> flash_intensity;
+ std::optional<double> flashIntensity;
/* Sensor reported temperature value (in degrees) */
- std::optional<double> sensor_temperature;
+ std::optional<double> sensorTemperature;
};
diff --git a/src/ipa/raspberrypi/controller/noise_status.h b/src/ipa/raspberrypi/controller/noise_status.h
index 8439a40213aa..358af4fe869b 100644
--- a/src/ipa/raspberrypi/controller/noise_status.h
+++ b/src/ipa/raspberrypi/controller/noise_status.h
@@ -13,8 +13,8 @@ extern "C" {
#endif
struct NoiseStatus {
- double noise_constant;
- double noise_slope;
+ double noiseConstant;
+ double noiseSlope;
};
#ifdef __cplusplus
--
2.25.1
More information about the libcamera-devel
mailing list