[{"id":18009,"web_url":"https://patchwork.libcamera.org/comment/18009/","msgid":"<43112e0a-8a12-c6c7-0ec4-cdee3c2a200b@ideasonboard.com>","date":"2021-07-07T10:52:26","subject":"Re: [libcamera-devel] [PATCH v1 1/7] ipa: libipa: Fixups in\n\tCameraSensorHelpers","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Hi JM,\n\nOn 28/06/2021 21:22, Jean-Michel Hautbois wrote:\n> A few lines needed to be wrapped under 80 lines.\n> Remove some uneeded documentation and minor typos.\n\ns/uneeded/unneeded/\n\n\n> \n> Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n> ---\n>  src/ipa/libipa/camera_sensor_helper.cpp | 79 +++++++++++++------------\n>  src/ipa/libipa/camera_sensor_helper.h   | 32 +++++-----\n>  2 files changed, 58 insertions(+), 53 deletions(-)\n> \n> diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp\n> index 23335ed6..848842ce 100644\n> --- a/src/ipa/libipa/camera_sensor_helper.cpp\n> +++ b/src/ipa/libipa/camera_sensor_helper.cpp\n> @@ -2,11 +2,12 @@\n>  /*\n>   * Copyright (C) 2021, Google Inc.\n>   *\n> - * camera_sensor_helper.cpp - Helper class that performs sensor-specific parameter computations\n> + * camera_sensor_helper.cpp - Helper class that performs sensor-specific\n> + * parameter computations\n>   */\n>  #include \"camera_sensor_helper.h\"\n>  \n> -#include \"libcamera/base/log.h\"\n> +#include <libcamera/base/log.h>\n>  \n>  /**\n>   * \\file camera_sensor_helper.h\n> @@ -29,17 +30,18 @@ namespace ipa {\n>  \n>  /**\n>   * \\class CameraSensorHelper\n> - * \\brief Base class for computing sensor tuning parameters using sensor-specific constants\n> + * \\brief Base class for computing sensor tuning parameters using\n> + * sensor-specific constants\n>   *\n> - * Instances derived from CameraSensorHelper class are sensor specific.\n> + * Instances derived from CameraSensorHelper class are sensor-specific.\n>   * Each supported sensor will have an associated base class defined.\n>   */\n>  \n>  /**\n>   * \\brief Construct a CameraSensorHelper instance\n>   *\n> - * CameraSensorHelper derived class instances shall never be constructed manually\n> - * but always through the CameraSensorHelperFactory::create() method.\n> + * CameraSensorHelper derived class instances shall never be constructed\n> + * manually but always through the CameraSensorHelperFactory::create() method.\n>   */\n>  \n>  /**\n> @@ -52,11 +54,11 @@ namespace ipa {\n>   * The parameters come from the MIPI Alliance Camera Specification for\n>   * Camera Command Set (CCS).\n>   *\n> - * \\return The gain code to pass to V4l2\n> + * \\return The gain code to pass to V4L2\n>   */\n>  uint32_t CameraSensorHelper::gainCode(double gain) const\n>  {\n> -\tASSERT((analogueGainConstants_.m0 == 0) || (analogueGainConstants_.m1 == 0));\n> +\tASSERT(analogueGainConstants_.m0 == 0 || analogueGainConstants_.m1 == 0);\n>  \tASSERT(analogueGainConstants_.type == AnalogueGainLinear);\n>  \n>  \treturn (analogueGainConstants_.c0 - analogueGainConstants_.c1 * gain) /\n> @@ -64,8 +66,8 @@ uint32_t CameraSensorHelper::gainCode(double gain) const\n>  }\n>  \n>  /**\n> - * \\brief Compute the real gain from the V4l2 subdev control gain code\n> - * \\param[in] gainCode The V4l2 subdev control gain\n> + * \\brief Compute the real gain from the V4L2 subdev control gain code\n> + * \\param[in] gainCode The V4L2 subdev control gain\n>   *\n>   * This function aims to abstract the calculation of the gain letting the IPA\n>   * use the real gain for its estimations. It is the counterpart of the function\n> @@ -78,7 +80,7 @@ uint32_t CameraSensorHelper::gainCode(double gain) const\n>   */\n>  double CameraSensorHelper::gain(uint32_t gainCode) const\n>  {\n> -\tASSERT((analogueGainConstants_.m0 == 0) || (analogueGainConstants_.m1 == 0));\n> +\tASSERT(analogueGainConstants_.m0 == 0 || analogueGainConstants_.m1 == 0);\n>  \tASSERT(analogueGainConstants_.type == AnalogueGainLinear);\n>  \n>  \treturn (analogueGainConstants_.m0 * static_cast<double>(gainCode) + analogueGainConstants_.c0) /\n> @@ -90,7 +92,7 @@ double CameraSensorHelper::gain(uint32_t gainCode) const\n>   * \\brief The gain calculation modes as defined by the MIPI CCS\n>   *\n>   * Describes the image sensor analogue gain capabilities.\n> - * Two modes are possible, depending on the sensor: Global and Alternate.\n> + * Two modes are possible, depending on the sensor: Linear and Exponential.\n>   */\n>  \n>  /**\n> @@ -114,11 +116,12 @@ double CameraSensorHelper::gain(uint32_t gainCode) const\n>  \n>  /**\n>   * \\var CameraSensorHelper::AnalogueGainExponential\n> - * \\brief Gain is computed using exponential gain estimation (introduced in CCS v1.1)\n> + * \\brief Gain is computed using exponential gain estimation\n> + * (introduced in CCS v1.1)\n>   *\n>   * Starting with CCS v1.1, Alternate Global Analogue Gain is also available.\n> - * If the image sensor supports it, then the global analogue gain can be controlled\n> - * by linear and exponential gain formula:\n> + * If the image sensor supports it, then the global analogue gain can be\n> + * controlled by linear and exponential gain formula:\n>   *\n>   * \\f$gain = analogLinearGainGlobal * 2^{analogExponentialGainGlobal}\\f$\n>   * \\todo not implemented in libipa\n> @@ -194,11 +197,13 @@ CameraSensorHelperFactory::CameraSensorHelperFactory(const std::string name)\n>  }\n>  \n>  /**\n> - * \\brief Create an instance of the CameraSensorHelper corresponding to the factory\n> + * \\brief Create an instance of the CameraSensorHelper corresponding to\n> + * a named factory\n>   * \\param[in] name Name of the factory\n>   *\n>   * \\return A unique pointer to a new instance of the CameraSensorHelper subclass\n> - * corresponding to the factory\n> + * corresponding to the named factory or a null pointer if no such factory\n> + * exists\n>   */\n>  std::unique_ptr<CameraSensorHelper> CameraSensorHelperFactory::create(const std::string &name)\n>  {\n> @@ -220,33 +225,35 @@ std::unique_ptr<CameraSensorHelper> CameraSensorHelperFactory::create(const std:\n>   * \\brief Add a camera sensor helper class to the registry\n>   * \\param[in] factory Factory to use to construct the camera sensor helper\n>   *\n> - * The caller is responsible to guarantee the uniqueness of the camera sensor helper\n> - * name.\n> + * The caller is responsible to guarantee the uniqueness of the camera sensor\n> + * helper name.\n>   */\n>  void CameraSensorHelperFactory::registerType(CameraSensorHelperFactory *factory)\n>  {\n> -\tstd::vector<CameraSensorHelperFactory *> &factories = CameraSensorHelperFactory::factories();\n> +\tstd::vector<CameraSensorHelperFactory *> &factories =\n> +\t\tCameraSensorHelperFactory::factories();\n>  \n>  \tfactories.push_back(factory);\n>  }\n>  \n>  /**\n>   * \\brief Retrieve the list of all camera sensor helper factories\n> - *\n> - * The static factories map is defined inside the function to ensures it gets\n> - * initialized on first use, without any dependency on link order.\n> - *\n>   * \\return The list of camera sensor helper factories\n>   */\n>  std::vector<CameraSensorHelperFactory *> &CameraSensorHelperFactory::factories()\n>  {\n> +\t/* The static factories map is defined inside the function to ensures\n\n\t/*\n\t * Multiline comments start with their own /*\n\t * on its own line.\n\t * I tried to implement this in checkstyle once. Maybe I should\n\t * dig that out and revitalise it...\n\t */\n\n\nWith that,\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n\n> +\t * it gets initialized on first use, without any dependency on link\n> +\t * order.\n> +\t */\n>  \tstatic std::vector<CameraSensorHelperFactory *> factories;\n>  \treturn factories;\n>  }\n>  \n>  /**\n>   * \\fn CameraSensorHelperFactory::createInstance()\n> - * \\brief Create an instance of the CameraSensorHelper corresponding to the factory\n> + * \\brief Create an instance of the CameraSensorHelper corresponding to the\n> + * factory\n>   *\n>   * This virtual function is implemented by the REGISTER_CAMERA_SENSOR_HELPER()\n>   * macro. It creates a camera sensor helper instance associated with the camera\n> @@ -267,14 +274,16 @@ std::vector<CameraSensorHelperFactory *> &CameraSensorHelperFactory::factories()\n>   * \\param[in] name Sensor model name used to register the class\n>   * \\param[in] helper Class name of CameraSensorHelper derived class to register\n>   *\n> - * Register a CameraSensorHelper subclass with the factory and make it available to\n> - * try and match devices.\n> + * Register a CameraSensorHelper subclass with the factory and make it available\n> + * to try and match sensors.\n>   */\n>  \n> -/**\n> - * \\class CameraSensorHelperImx219\n> - * \\brief Create and give helpers for the imx219 sensor\n> +/* -----------------------------------------------------------------------------\n> + * Sensor-specific subclasses\n>   */\n> +\n> +#ifndef __DOXYGEN__\n> +\n>  class CameraSensorHelperImx219 : public CameraSensorHelper\n>  {\n>  public:\n> @@ -285,10 +294,6 @@ public:\n>  };\n>  REGISTER_CAMERA_SENSOR_HELPER(\"imx219\", CameraSensorHelperImx219)\n>  \n> -/**\n> - * \\class CameraSensorHelperOv5670\n> - * \\brief Create and give helpers for the ov5670 sensor\n> - */\n>  class CameraSensorHelperOv5670 : public CameraSensorHelper\n>  {\n>  public:\n> @@ -299,10 +304,6 @@ public:\n>  };\n>  REGISTER_CAMERA_SENSOR_HELPER(\"ov5670\", CameraSensorHelperOv5670)\n>  \n> -/**\n> - * \\class CameraSensorHelperOv5693\n> - * \\brief Create and give helpers for the ov5693 sensor\n> - */\n>  class CameraSensorHelperOv5693 : public CameraSensorHelper\n>  {\n>  public:\n> @@ -313,6 +314,8 @@ public:\n>  };\n>  REGISTER_CAMERA_SENSOR_HELPER(\"ov5693\", CameraSensorHelperOv5693)\n>  \n> +#endif /* __DOXYGEN__ */\n> +\n>  } /* namespace ipa */\n>  \n>  } /* namespace libcamera */\n> diff --git a/src/ipa/libipa/camera_sensor_helper.h b/src/ipa/libipa/camera_sensor_helper.h\n> index 1c47e8d5..a7e4ab3b 100644\n> --- a/src/ipa/libipa/camera_sensor_helper.h\n> +++ b/src/ipa/libipa/camera_sensor_helper.h\n> @@ -30,8 +30,8 @@ public:\n>  \n>  protected:\n>  \tenum AnalogueGainType {\n> -\t\tAnalogueGainLinear = 0,\n> -\t\tAnalogueGainExponential = 2,\n> +\t\tAnalogueGainLinear,\n> +\t\tAnalogueGainExponential,\n>  \t};\n>  \n>  \tstruct AnalogueGainConstants {\n> @@ -60,24 +60,26 @@ public:\n>  \tstatic std::vector<CameraSensorHelperFactory *> &factories();\n>  \n>  protected:\n> -\tLIBCAMERA_DISABLE_COPY_AND_MOVE(CameraSensorHelperFactory)\n>  \tvirtual CameraSensorHelper *createInstance() = 0;\n>  \n> +private:\n> +\tLIBCAMERA_DISABLE_COPY_AND_MOVE(CameraSensorHelperFactory)\n> +\n>  \tstd::string name_;\n>  };\n>  \n> -#define REGISTER_CAMERA_SENSOR_HELPER(name, helper)\t\t  \\\n> -class helper##Factory final : public CameraSensorHelperFactory\t  \\\n> -{                                                                 \\\n> -public:                                                           \\\n> -\thelper##Factory() : CameraSensorHelperFactory(name) {}\t  \\\n> -\t\t\t\t\t\t\t\t  \\\n> -private:                                                          \\\n> -\tCameraSensorHelper *createInstance()\t\t\t  \\\n> -\t{\t\t\t\t\t\t\t  \\\n> -\t\treturn new helper();\t\t\t\t  \\\n> -\t}\t\t\t\t\t\t\t  \\\n> -};\t\t\t\t\t\t\t\t  \\\n> +#define REGISTER_CAMERA_SENSOR_HELPER(name, helper)\t\t\\\n> +class helper##Factory final : public CameraSensorHelperFactory\t\\\n> +{\t\t\t\t\t\t\t\t\\\n> +public: \t\t\t\t\t\t\t\\\n> +\thelper##Factory() : CameraSensorHelperFactory(name) {}\t\\\n> +\t\t\t\t\t\t\t\t\\\n> +private:\t\t\t\t\t\t\t\\\n> +\tCameraSensorHelper *createInstance()\t\t\t\\\n> +\t{\t\t\t\t\t\t\t\\\n> +\t\treturn new helper();\t\t\t\t\\\n> +\t}\t\t\t\t\t\t\t\\\n> +};\t\t\t\t\t\t\t\t\\\n>  static helper##Factory global_##helper##Factory;\n>  \n>  } /* namespace ipa */\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id ADA2BC3224\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  7 Jul 2021 10:52:31 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2359B68500;\n\tWed,  7 Jul 2021 12:52:31 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7FDAB60284\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  7 Jul 2021 12:52:29 +0200 (CEST)","from [192.168.0.20]\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 07BF32E4;\n\tWed,  7 Jul 2021 12:52:28 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"VbckaF2E\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1625655149;\n\tbh=TU1upCJkrIhs7ZCVpMrsXQi4kdvRv1u//F/XgHw/B8w=;\n\th=Subject:To:References:From:Date:In-Reply-To:From;\n\tb=VbckaF2ESaX/SjzSE3fLZtQ0+SwbUn95SF+Pbz7PGrtKzcWq0XJLynBF3pnmhFXro\n\t87bnvOBgErN3p1ulPVust57bL7N2PJ9uWAesVTwEFCobHkYc6Mtc5CRK+J/Oh3vYQ+\n\tHLx2ic9wZgI3g9fMTn3QeuV2y2eG95cvc1hldmic=","To":"Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20210628202255.138874-1-jeanmichel.hautbois@ideasonboard.com>\n\t<20210628202255.138874-2-jeanmichel.hautbois@ideasonboard.com>","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<43112e0a-8a12-c6c7-0ec4-cdee3c2a200b@ideasonboard.com>","Date":"Wed, 7 Jul 2021 11:52:26 +0100","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101\n\tThunderbird/78.11.0","MIME-Version":"1.0","In-Reply-To":"<20210628202255.138874-2-jeanmichel.hautbois@ideasonboard.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-GB","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH v1 1/7] ipa: libipa: Fixups in\n\tCameraSensorHelpers","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":18025,"web_url":"https://patchwork.libcamera.org/comment/18025/","msgid":"<YObJoQC8IHI9uKWi@pendragon.ideasonboard.com>","date":"2021-07-08T09:47:13","subject":"Re: [libcamera-devel] [PATCH v1 1/7] ipa: libipa: Fixups in\n\tCameraSensorHelpers","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jean-Michel,\n\nThank you for the patch.\n\nOn Mon, Jun 28, 2021 at 10:22:49PM +0200, Jean-Michel Hautbois wrote:\n> A few lines needed to be wrapped under 80 lines.\n> Remove some uneeded documentation and minor typos.\n> \n> Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n\nWith Kieran's comments addressed,\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  src/ipa/libipa/camera_sensor_helper.cpp | 79 +++++++++++++------------\n>  src/ipa/libipa/camera_sensor_helper.h   | 32 +++++-----\n>  2 files changed, 58 insertions(+), 53 deletions(-)\n> \n> diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp\n> index 23335ed6..848842ce 100644\n> --- a/src/ipa/libipa/camera_sensor_helper.cpp\n> +++ b/src/ipa/libipa/camera_sensor_helper.cpp\n> @@ -2,11 +2,12 @@\n>  /*\n>   * Copyright (C) 2021, Google Inc.\n>   *\n> - * camera_sensor_helper.cpp - Helper class that performs sensor-specific parameter computations\n> + * camera_sensor_helper.cpp - Helper class that performs sensor-specific\n> + * parameter computations\n>   */\n>  #include \"camera_sensor_helper.h\"\n>  \n> -#include \"libcamera/base/log.h\"\n> +#include <libcamera/base/log.h>\n>  \n>  /**\n>   * \\file camera_sensor_helper.h\n> @@ -29,17 +30,18 @@ namespace ipa {\n>  \n>  /**\n>   * \\class CameraSensorHelper\n> - * \\brief Base class for computing sensor tuning parameters using sensor-specific constants\n> + * \\brief Base class for computing sensor tuning parameters using\n> + * sensor-specific constants\n>   *\n> - * Instances derived from CameraSensorHelper class are sensor specific.\n> + * Instances derived from CameraSensorHelper class are sensor-specific.\n>   * Each supported sensor will have an associated base class defined.\n>   */\n>  \n>  /**\n>   * \\brief Construct a CameraSensorHelper instance\n>   *\n> - * CameraSensorHelper derived class instances shall never be constructed manually\n> - * but always through the CameraSensorHelperFactory::create() method.\n> + * CameraSensorHelper derived class instances shall never be constructed\n> + * manually but always through the CameraSensorHelperFactory::create() method.\n>   */\n>  \n>  /**\n> @@ -52,11 +54,11 @@ namespace ipa {\n>   * The parameters come from the MIPI Alliance Camera Specification for\n>   * Camera Command Set (CCS).\n>   *\n> - * \\return The gain code to pass to V4l2\n> + * \\return The gain code to pass to V4L2\n>   */\n>  uint32_t CameraSensorHelper::gainCode(double gain) const\n>  {\n> -\tASSERT((analogueGainConstants_.m0 == 0) || (analogueGainConstants_.m1 == 0));\n> +\tASSERT(analogueGainConstants_.m0 == 0 || analogueGainConstants_.m1 == 0);\n>  \tASSERT(analogueGainConstants_.type == AnalogueGainLinear);\n>  \n>  \treturn (analogueGainConstants_.c0 - analogueGainConstants_.c1 * gain) /\n> @@ -64,8 +66,8 @@ uint32_t CameraSensorHelper::gainCode(double gain) const\n>  }\n>  \n>  /**\n> - * \\brief Compute the real gain from the V4l2 subdev control gain code\n> - * \\param[in] gainCode The V4l2 subdev control gain\n> + * \\brief Compute the real gain from the V4L2 subdev control gain code\n> + * \\param[in] gainCode The V4L2 subdev control gain\n>   *\n>   * This function aims to abstract the calculation of the gain letting the IPA\n>   * use the real gain for its estimations. It is the counterpart of the function\n> @@ -78,7 +80,7 @@ uint32_t CameraSensorHelper::gainCode(double gain) const\n>   */\n>  double CameraSensorHelper::gain(uint32_t gainCode) const\n>  {\n> -\tASSERT((analogueGainConstants_.m0 == 0) || (analogueGainConstants_.m1 == 0));\n> +\tASSERT(analogueGainConstants_.m0 == 0 || analogueGainConstants_.m1 == 0);\n>  \tASSERT(analogueGainConstants_.type == AnalogueGainLinear);\n>  \n>  \treturn (analogueGainConstants_.m0 * static_cast<double>(gainCode) + analogueGainConstants_.c0) /\n> @@ -90,7 +92,7 @@ double CameraSensorHelper::gain(uint32_t gainCode) const\n>   * \\brief The gain calculation modes as defined by the MIPI CCS\n>   *\n>   * Describes the image sensor analogue gain capabilities.\n> - * Two modes are possible, depending on the sensor: Global and Alternate.\n> + * Two modes are possible, depending on the sensor: Linear and Exponential.\n>   */\n>  \n>  /**\n> @@ -114,11 +116,12 @@ double CameraSensorHelper::gain(uint32_t gainCode) const\n>  \n>  /**\n>   * \\var CameraSensorHelper::AnalogueGainExponential\n> - * \\brief Gain is computed using exponential gain estimation (introduced in CCS v1.1)\n> + * \\brief Gain is computed using exponential gain estimation\n> + * (introduced in CCS v1.1)\n>   *\n>   * Starting with CCS v1.1, Alternate Global Analogue Gain is also available.\n> - * If the image sensor supports it, then the global analogue gain can be controlled\n> - * by linear and exponential gain formula:\n> + * If the image sensor supports it, then the global analogue gain can be\n> + * controlled by linear and exponential gain formula:\n>   *\n>   * \\f$gain = analogLinearGainGlobal * 2^{analogExponentialGainGlobal}\\f$\n>   * \\todo not implemented in libipa\n> @@ -194,11 +197,13 @@ CameraSensorHelperFactory::CameraSensorHelperFactory(const std::string name)\n>  }\n>  \n>  /**\n> - * \\brief Create an instance of the CameraSensorHelper corresponding to the factory\n> + * \\brief Create an instance of the CameraSensorHelper corresponding to\n> + * a named factory\n>   * \\param[in] name Name of the factory\n>   *\n>   * \\return A unique pointer to a new instance of the CameraSensorHelper subclass\n> - * corresponding to the factory\n> + * corresponding to the named factory or a null pointer if no such factory\n> + * exists\n>   */\n>  std::unique_ptr<CameraSensorHelper> CameraSensorHelperFactory::create(const std::string &name)\n>  {\n> @@ -220,33 +225,35 @@ std::unique_ptr<CameraSensorHelper> CameraSensorHelperFactory::create(const std:\n>   * \\brief Add a camera sensor helper class to the registry\n>   * \\param[in] factory Factory to use to construct the camera sensor helper\n>   *\n> - * The caller is responsible to guarantee the uniqueness of the camera sensor helper\n> - * name.\n> + * The caller is responsible to guarantee the uniqueness of the camera sensor\n> + * helper name.\n>   */\n>  void CameraSensorHelperFactory::registerType(CameraSensorHelperFactory *factory)\n>  {\n> -\tstd::vector<CameraSensorHelperFactory *> &factories = CameraSensorHelperFactory::factories();\n> +\tstd::vector<CameraSensorHelperFactory *> &factories =\n> +\t\tCameraSensorHelperFactory::factories();\n>  \n>  \tfactories.push_back(factory);\n>  }\n>  \n>  /**\n>   * \\brief Retrieve the list of all camera sensor helper factories\n> - *\n> - * The static factories map is defined inside the function to ensures it gets\n> - * initialized on first use, without any dependency on link order.\n> - *\n>   * \\return The list of camera sensor helper factories\n>   */\n>  std::vector<CameraSensorHelperFactory *> &CameraSensorHelperFactory::factories()\n>  {\n> +\t/* The static factories map is defined inside the function to ensures\n> +\t * it gets initialized on first use, without any dependency on link\n> +\t * order.\n> +\t */\n>  \tstatic std::vector<CameraSensorHelperFactory *> factories;\n>  \treturn factories;\n>  }\n>  \n>  /**\n>   * \\fn CameraSensorHelperFactory::createInstance()\n> - * \\brief Create an instance of the CameraSensorHelper corresponding to the factory\n> + * \\brief Create an instance of the CameraSensorHelper corresponding to the\n> + * factory\n>   *\n>   * This virtual function is implemented by the REGISTER_CAMERA_SENSOR_HELPER()\n>   * macro. It creates a camera sensor helper instance associated with the camera\n> @@ -267,14 +274,16 @@ std::vector<CameraSensorHelperFactory *> &CameraSensorHelperFactory::factories()\n>   * \\param[in] name Sensor model name used to register the class\n>   * \\param[in] helper Class name of CameraSensorHelper derived class to register\n>   *\n> - * Register a CameraSensorHelper subclass with the factory and make it available to\n> - * try and match devices.\n> + * Register a CameraSensorHelper subclass with the factory and make it available\n> + * to try and match sensors.\n>   */\n>  \n> -/**\n> - * \\class CameraSensorHelperImx219\n> - * \\brief Create and give helpers for the imx219 sensor\n> +/* -----------------------------------------------------------------------------\n> + * Sensor-specific subclasses\n>   */\n> +\n> +#ifndef __DOXYGEN__\n> +\n>  class CameraSensorHelperImx219 : public CameraSensorHelper\n>  {\n>  public:\n> @@ -285,10 +294,6 @@ public:\n>  };\n>  REGISTER_CAMERA_SENSOR_HELPER(\"imx219\", CameraSensorHelperImx219)\n>  \n> -/**\n> - * \\class CameraSensorHelperOv5670\n> - * \\brief Create and give helpers for the ov5670 sensor\n> - */\n>  class CameraSensorHelperOv5670 : public CameraSensorHelper\n>  {\n>  public:\n> @@ -299,10 +304,6 @@ public:\n>  };\n>  REGISTER_CAMERA_SENSOR_HELPER(\"ov5670\", CameraSensorHelperOv5670)\n>  \n> -/**\n> - * \\class CameraSensorHelperOv5693\n> - * \\brief Create and give helpers for the ov5693 sensor\n> - */\n>  class CameraSensorHelperOv5693 : public CameraSensorHelper\n>  {\n>  public:\n> @@ -313,6 +314,8 @@ public:\n>  };\n>  REGISTER_CAMERA_SENSOR_HELPER(\"ov5693\", CameraSensorHelperOv5693)\n>  \n> +#endif /* __DOXYGEN__ */\n> +\n>  } /* namespace ipa */\n>  \n>  } /* namespace libcamera */\n> diff --git a/src/ipa/libipa/camera_sensor_helper.h b/src/ipa/libipa/camera_sensor_helper.h\n> index 1c47e8d5..a7e4ab3b 100644\n> --- a/src/ipa/libipa/camera_sensor_helper.h\n> +++ b/src/ipa/libipa/camera_sensor_helper.h\n> @@ -30,8 +30,8 @@ public:\n>  \n>  protected:\n>  \tenum AnalogueGainType {\n> -\t\tAnalogueGainLinear = 0,\n> -\t\tAnalogueGainExponential = 2,\n> +\t\tAnalogueGainLinear,\n> +\t\tAnalogueGainExponential,\n>  \t};\n>  \n>  \tstruct AnalogueGainConstants {\n> @@ -60,24 +60,26 @@ public:\n>  \tstatic std::vector<CameraSensorHelperFactory *> &factories();\n>  \n>  protected:\n> -\tLIBCAMERA_DISABLE_COPY_AND_MOVE(CameraSensorHelperFactory)\n>  \tvirtual CameraSensorHelper *createInstance() = 0;\n>  \n> +private:\n> +\tLIBCAMERA_DISABLE_COPY_AND_MOVE(CameraSensorHelperFactory)\n> +\n>  \tstd::string name_;\n>  };\n>  \n> -#define REGISTER_CAMERA_SENSOR_HELPER(name, helper)\t\t  \\\n> -class helper##Factory final : public CameraSensorHelperFactory\t  \\\n> -{                                                                 \\\n> -public:                                                           \\\n> -\thelper##Factory() : CameraSensorHelperFactory(name) {}\t  \\\n> -\t\t\t\t\t\t\t\t  \\\n> -private:                                                          \\\n> -\tCameraSensorHelper *createInstance()\t\t\t  \\\n> -\t{\t\t\t\t\t\t\t  \\\n> -\t\treturn new helper();\t\t\t\t  \\\n> -\t}\t\t\t\t\t\t\t  \\\n> -};\t\t\t\t\t\t\t\t  \\\n> +#define REGISTER_CAMERA_SENSOR_HELPER(name, helper)\t\t\\\n> +class helper##Factory final : public CameraSensorHelperFactory\t\\\n> +{\t\t\t\t\t\t\t\t\\\n> +public: \t\t\t\t\t\t\t\\\n> +\thelper##Factory() : CameraSensorHelperFactory(name) {}\t\\\n> +\t\t\t\t\t\t\t\t\\\n> +private:\t\t\t\t\t\t\t\\\n> +\tCameraSensorHelper *createInstance()\t\t\t\\\n> +\t{\t\t\t\t\t\t\t\\\n> +\t\treturn new helper();\t\t\t\t\\\n> +\t}\t\t\t\t\t\t\t\\\n> +};\t\t\t\t\t\t\t\t\\\n>  static helper##Factory global_##helper##Factory;\n>  \n>  } /* namespace ipa */","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id C7A29C3224\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  8 Jul 2021 09:47:59 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 44BF56851A;\n\tThu,  8 Jul 2021 11:47:59 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8A71E68509\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  8 Jul 2021 11:47:58 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 06D9BE7;\n\tThu,  8 Jul 2021 11:47:57 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"sezqfmEo\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1625737678;\n\tbh=M9T4Wokqxo/uMkF7NnhQHKV9v9+0559ZFble729xcqc=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=sezqfmEoN+rjbtnoy2GNSlPn3cioMGAzEHneo+1ksNW3bJjAcjIa3kdF3YGq1Gi8D\n\trjcwo1nhdGxpxQjDLk5O6DKhyLB6ciiGNv9vYvOpx9aauYwXHcZTvcOefskGMfJbON\n\t9/lC2w4bxaEuyiWwvp1ujrytRE5sHSpU4eOwY8MU=","Date":"Thu, 8 Jul 2021 12:47:13 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>","Message-ID":"<YObJoQC8IHI9uKWi@pendragon.ideasonboard.com>","References":"<20210628202255.138874-1-jeanmichel.hautbois@ideasonboard.com>\n\t<20210628202255.138874-2-jeanmichel.hautbois@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20210628202255.138874-2-jeanmichel.hautbois@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v1 1/7] ipa: libipa: Fixups in\n\tCameraSensorHelpers","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]