[libcamera-devel,05/15] DNI: ipa: raspberrypi: Code refactoring to match style guidelines
diff mbox series

Message ID 20220725134639.4572-6-naush@raspberrypi.com
State Superseded
Headers show
Series
  • Raspberry Pi IPA code refactor
Related show

Commit Message

Naushir Patuck July 25, 2022, 1:46 p.m. UTC
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@raspberrypi.com>
---
 .../controller/denoise_algorithm.hpp           |  2 +-
 .../raspberrypi/controller/device_status.cpp   | 18 +++++++++---------
 src/ipa/raspberrypi/controller/device_status.h | 16 ++++++++--------
 3 files changed, 18 insertions(+), 18 deletions(-)

Comments

Laurent Pinchart July 25, 2022, 7:57 p.m. UTC | #1
Hi Naush,

Thank you for the patch.

On Mon, Jul 25, 2022 at 02:46:29PM +0100, Naushir Patuck via libcamera-devel wrote:
> 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@raspberrypi.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  .../controller/denoise_algorithm.hpp           |  2 +-
>  .../raspberrypi/controller/device_status.cpp   | 18 +++++++++---------
>  src/ipa/raspberrypi/controller/device_status.h | 16 ++++++++--------
>  3 files changed, 18 insertions(+), 18 deletions(-)

Patch
diff mbox series

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/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;
 };