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 <naush@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Naushir Patuck 2022-07-27 09:55:17 +01:00 committed by Laurent Pinchart
parent b4a3eb6b98
commit 177df04d2b
63 changed files with 2093 additions and 2161 deletions

View file

@ -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);