From 177df04d2b7f357ebe41f1a9809ab68b6f948082 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Wed, 27 Jul 2022 09:55:17 +0100 Subject: ipa: raspberrypi: Code refactoring to match style guidelines Refactor all the source files in src/ipa/raspberrypi/ 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 Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart --- src/ipa/raspberrypi/cam_helper_imx296.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/ipa/raspberrypi/cam_helper_imx296.cpp') diff --git a/src/ipa/raspberrypi/cam_helper_imx296.cpp b/src/ipa/raspberrypi/cam_helper_imx296.cpp index a1a771cb..15674335 100644 --- a/src/ipa/raspberrypi/cam_helper_imx296.cpp +++ b/src/ipa/raspberrypi/cam_helper_imx296.cpp @@ -19,10 +19,10 @@ class CamHelperImx296 : public CamHelper { public: CamHelperImx296(); - uint32_t GainCode(double gain) const override; - double Gain(uint32_t gain_code) const override; - uint32_t ExposureLines(Duration exposure) const override; - Duration Exposure(uint32_t exposure_lines) const override; + uint32_t gainCode(double gain) const override; + double gain(uint32_t gainCode) const override; + uint32_t exposureLines(Duration exposure) const override; + Duration exposure(uint32_t exposureLines) const override; private: static constexpr uint32_t maxGainCode = 239; @@ -40,30 +40,30 @@ CamHelperImx296::CamHelperImx296() { } -uint32_t CamHelperImx296::GainCode(double gain) const +uint32_t CamHelperImx296::gainCode(double gain) const { uint32_t code = 20 * std::log10(gain) * 10; return std::min(code, maxGainCode); } -double CamHelperImx296::Gain(uint32_t gain_code) const +double CamHelperImx296::gain(uint32_t gainCode) const { - return std::pow(10.0, gain_code / 200.0); + return std::pow(10.0, gainCode / 200.0); } -uint32_t CamHelperImx296::ExposureLines(Duration exposure) const +uint32_t CamHelperImx296::exposureLines(Duration exposure) const { return (exposure - 14.26us) / timePerLine; } -Duration CamHelperImx296::Exposure(uint32_t exposure_lines) const +Duration CamHelperImx296::exposure(uint32_t exposureLines) const { - return exposure_lines * timePerLine + 14.26us; + return exposureLines * timePerLine + 14.26us; } -static CamHelper *Create() +static CamHelper *create() { return new CamHelperImx296(); } -static RegisterCamHelper reg("imx296", &Create); +static RegisterCamHelper reg("imx296", &create); -- cgit v1.2.1