Patch Detail
Show a patch.
GET /api/patches/16776/?format=api
{ "id": 16776, "url": "https://patchwork.libcamera.org/api/patches/16776/?format=api", "web_url": "https://patchwork.libcamera.org/patch/16776/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20220726124549.1646-4-naush@raspberrypi.com>", "date": "2022-07-26T12:45:35", "name": "[libcamera-devel,03/17] DNI: ipa: raspberrypi: Code refactoring to match style guidelines", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "be6aa19aa2fe052377732de55708fb4e8ff054fd", "submitter": { "id": 34, "url": "https://patchwork.libcamera.org/api/people/34/?format=api", "name": "Naushir Patuck", "email": "naush@raspberrypi.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/16776/mbox/", "series": [ { "id": 3325, "url": "https://patchwork.libcamera.org/api/series/3325/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3325", "date": "2022-07-26T12:45:32", "name": "Raspberry Pi IPA code refactor", "version": 1, "mbox": "https://patchwork.libcamera.org/series/3325/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/16776/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/16776/checks/", "tags": {}, "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 C870FC3275\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 26 Jul 2022 12:46:03 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 69BE86331B;\n\tTue, 26 Jul 2022 14:46:03 +0200 (CEST)", "from mail-wr1-x433.google.com (mail-wr1-x433.google.com\n\t[IPv6:2a00:1450:4864:20::433])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 72C0560487\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 26 Jul 2022 14:45:58 +0200 (CEST)", "by mail-wr1-x433.google.com with SMTP id d8so19897595wrp.6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 26 Jul 2022 05:45:58 -0700 (PDT)", "from naush-laptop.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\ty17-20020adfd091000000b0021e87ec980bsm5948460wrh.84.2022.07.26.05.45.56\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 26 Jul 2022 05:45:56 -0700 (PDT)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1658839563;\n\tbh=A9qFVsr4ysD6H31zQ+LpZvDY/RnDf/oQQaUK0g3K3kE=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=WyERdKHrHdIoN4KgGq2JggLVN+5fGLK6I8hYxDsUV3opcJ6cqvaMKNQZBrkeM8t4e\n\t9FTlJgTkJGERXaUqvix49vSI0w68qFUFODUiMUgfAi1TYWs2ycxibpJnHuUx8gEhf9\n\tdA9YZWhwgFpBUPZiRMmvY8k0JXyvp1cy9S6rjOotHOiKE+g25Q6tTxQrKlliJJEt7l\n\tlB41acn142nNjljm3jwn7a9WwkzoxdLlev5uju6U6mNNv6YgAbah0jOhd5qvNSTz/7\n\twJhUWzcpkZMTTbJYv0KcNn7uqUhvHDX5q2JdWTmdqODr1eEd8dEM+wk64DsC6F64ct\n\t29iz7MthAPkAw==", "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=C3mG9N/O4kjLV5Q756klG3p/Rxqeg7NfD57FGce0BGs=;\n\tb=PsOHaaYvPctkAir9sNFtTN7thp2xGVQ6EM+YUnwFtsSLUCSxk+vlWLPz9ox54FpGXw\n\ta4q/MvcgUHsycPbOgFgV+W2vJhoDQ/tIINttIamPdAK5czGAwSxFSOawhxKyYP6uy8WS\n\tdDavDxdemekGIM53hHEP0Mhg6W9sFUoF+gf4UsWzrm952sbQ9zjZAujYDhb+EhGRAWbr\n\t1FYKyGy4yo55jZ82nmy/nH8dxPXSGQVAoJtgBZ3HOGXA+sxZwXsRrN5H1W8d99be9MEv\n\t9CgKXIFzEkLj9oH7ryLWgH5qMF4UN6t4tjarslQKeeYpULZRWYCXwZJ6kBoisUKsvLlW\n\ttIuA==" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"PsOHaaYv\"; dkim-atps=neutral", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=C3mG9N/O4kjLV5Q756klG3p/Rxqeg7NfD57FGce0BGs=;\n\tb=fVhAyfGBwohNGKIa0wVfGWD9hk4JVerJZNn7S8t0d9Lb4RlYkPlOUfpLjs5HtbkdLs\n\txXoEFPSI2HCpP2YqE65MR6/OggiHSXBi1pEsEoKTMmzb6zKwN05lbZ6TOT84U/XZENon\n\t91MXSBv/zmne9A3ddykzcDEUYVytBcMHNxy3UWc5gpRuc6EaSoYZiECFnFADYVPfBUNg\n\t+NKnxDyggbRBh8FuBgOVSRnR2b7DZ92lrBS3VEW7rdPDjvPODCZTq2WUJ5rtMyYVVL8N\n\tmr4Pxwj+C3pPF1qQMyQcY32jLo90s2Vvvt9bh99Z90+gOOk2wOEFg9sKucQ7KTR51vMA\n\tuLMQ==", "X-Gm-Message-State": "AJIora+AvjWVmmOxww+XCBkHPxxLIpUIc58mYJlumHOfI8Tn1TTeH4DY\n\tTxveSmFStldfWotFowj7bs1PgkXQ9I21kw==", "X-Google-Smtp-Source": "AGRyM1si9HOcuUc5Ad+6hrUwxsb9YBEHgLt98sAV4nSuNtflCTTzakzc7Qcvq+5fQI3vCY0LJcgWFg==", "X-Received": "by 2002:a5d:5147:0:b0:21e:832e:7f0f with SMTP id\n\tu7-20020a5d5147000000b0021e832e7f0fmr7971116wrt.651.1658839557712; \n\tTue, 26 Jul 2022 05:45:57 -0700 (PDT)", "To": "libcamera-devel@lists.libcamera.org", "Date": "Tue, 26 Jul 2022 13:45:35 +0100", "Message-Id": "<20220726124549.1646-4-naush@raspberrypi.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20220726124549.1646-1-naush@raspberrypi.com>", "References": "<20220726124549.1646-1-naush@raspberrypi.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH 03/17] DNI: ipa: raspberrypi: Code\n\trefactoring to match style guidelines", "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>", "From": "Naushir Patuck via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>", "Reply-To": "Naushir Patuck <naush@raspberrypi.com>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "Refactor the source files under src/ipa/raspberrypi/controller/a* to match the\nrecommended formatting guidelines for the libcamera project. The vast majority\nof changes in this commit comprise of switching from snake_case to CamelCase,\nand starting class member functions with a lower case character.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n .../raspberrypi/controller/agc_algorithm.hpp | 19 +++++++-------\n src/ipa/raspberrypi/controller/agc_status.h | 22 ++++++++--------\n src/ipa/raspberrypi/controller/algorithm.cpp | 20 +++++++-------\n src/ipa/raspberrypi/controller/algorithm.hpp | 26 +++++++++----------\n .../raspberrypi/controller/awb_algorithm.hpp | 6 ++---\n src/ipa/raspberrypi/controller/awb_status.h | 8 +++---\n 6 files changed, 51 insertions(+), 50 deletions(-)", "diff": "diff --git a/src/ipa/raspberrypi/controller/agc_algorithm.hpp b/src/ipa/raspberrypi/controller/agc_algorithm.hpp\nindex 61595ea2b006..51900b687778 100644\n--- a/src/ipa/raspberrypi/controller/agc_algorithm.hpp\n+++ b/src/ipa/raspberrypi/controller/agc_algorithm.hpp\n@@ -17,16 +17,15 @@ class AgcAlgorithm : public Algorithm\n public:\n \tAgcAlgorithm(Controller *controller) : Algorithm(controller) {}\n \t// An AGC algorithm must provide the following:\n-\tvirtual unsigned int GetConvergenceFrames() const = 0;\n-\tvirtual void SetEv(double ev) = 0;\n-\tvirtual void SetFlickerPeriod(libcamera::utils::Duration flicker_period) = 0;\n-\tvirtual void SetFixedShutter(libcamera::utils::Duration fixed_shutter) = 0;\n-\tvirtual void SetMaxShutter(libcamera::utils::Duration max_shutter) = 0;\n-\tvirtual void SetFixedAnalogueGain(double fixed_analogue_gain) = 0;\n-\tvirtual void SetMeteringMode(std::string const &metering_mode_name) = 0;\n-\tvirtual void SetExposureMode(std::string const &exposure_mode_name) = 0;\n-\tvirtual void\n-\tSetConstraintMode(std::string const &contraint_mode_name) = 0;\n+\tvirtual unsigned int getConvergenceFrames() const = 0;\n+\tvirtual void setEv(double ev) = 0;\n+\tvirtual void setFlickerPeriod(libcamera::utils::Duration flickerPeriod) = 0;\n+\tvirtual void setFixedShutter(libcamera::utils::Duration fixedShutter) = 0;\n+\tvirtual void setMaxShutter(libcamera::utils::Duration maxShutter) = 0;\n+\tvirtual void setFixedAnalogueGain(double fixedAnalogueGain) = 0;\n+\tvirtual void setMeteringMode(std::string const &meteringModeName) = 0;\n+\tvirtual void setExposureMode(std::string const &exposureModeName) = 0;\n+\tvirtual void setConstraintMode(std::string const &contraintModeName) = 0;\n };\n \n } // namespace RPiController\ndiff --git a/src/ipa/raspberrypi/controller/agc_status.h b/src/ipa/raspberrypi/controller/agc_status.h\nindex 20cb1b624b33..5d04c61d04bd 100644\n--- a/src/ipa/raspberrypi/controller/agc_status.h\n+++ b/src/ipa/raspberrypi/controller/agc_status.h\n@@ -20,19 +20,19 @@ extern \"C\" {\n // ignored until then.\n \n struct AgcStatus {\n-\tlibcamera::utils::Duration total_exposure_value; // value for all exposure and gain for this image\n-\tlibcamera::utils::Duration target_exposure_value; // (unfiltered) target total exposure AGC is aiming for\n-\tlibcamera::utils::Duration shutter_time;\n-\tdouble analogue_gain;\n-\tchar exposure_mode[32];\n+\tlibcamera::utils::Duration totalExposureValue; // value for all exposure and gain for this image\n+\tlibcamera::utils::Duration targetExposureValue; // (unfiltered) target total exposure AGC is aiming for\n+\tlibcamera::utils::Duration shutterTime;\n+\tdouble analogueGain;\n+\tchar exposureMode[32];\n \tchar constraint_mode[32];\n-\tchar metering_mode[32];\n+\tchar meteringMode[32];\n \tdouble ev;\n-\tlibcamera::utils::Duration flicker_period;\n-\tint floating_region_enable;\n-\tlibcamera::utils::Duration fixed_shutter;\n-\tdouble fixed_analogue_gain;\n-\tdouble digital_gain;\n+\tlibcamera::utils::Duration flickerPeriod;\n+\tint floatingRegionEnable;\n+\tlibcamera::utils::Duration fixedShutter;\n+\tdouble fixedAnalogueGain;\n+\tdouble digitalGain;\n \tint locked;\n };\n \ndiff --git a/src/ipa/raspberrypi/controller/algorithm.cpp b/src/ipa/raspberrypi/controller/algorithm.cpp\nindex 43ad0a2be222..cfcd18a96c93 100644\n--- a/src/ipa/raspberrypi/controller/algorithm.cpp\n+++ b/src/ipa/raspberrypi/controller/algorithm.cpp\n@@ -9,36 +9,38 @@\n \n using namespace RPiController;\n \n-void Algorithm::Read([[maybe_unused]] boost::property_tree::ptree const ¶ms)\n+void Algorithm::read([[maybe_unused]] boost::property_tree::ptree const ¶ms)\n {\n }\n \n-void Algorithm::Initialise() {}\n+void Algorithm::initialise()\n+{\n+}\n \n-void Algorithm::SwitchMode([[maybe_unused]] CameraMode const &camera_mode,\n+void Algorithm::switchMode([[maybe_unused]] CameraMode const &cameraMode,\n \t\t\t [[maybe_unused]] Metadata *metadata)\n {\n }\n \n-void Algorithm::Prepare([[maybe_unused]] Metadata *image_metadata)\n+void Algorithm::prepare([[maybe_unused]] Metadata *imageMetadata)\n {\n }\n \n-void Algorithm::Process([[maybe_unused]] StatisticsPtr &stats,\n-\t\t\t[[maybe_unused]] Metadata *image_metadata)\n+void Algorithm::process([[maybe_unused]] StatisticsPtr &stats,\n+\t\t\t[[maybe_unused]] Metadata *imageMetadata)\n {\n }\n \n // For registering algorithms with the system:\n \n static std::map<std::string, AlgoCreateFunc> algorithms;\n-std::map<std::string, AlgoCreateFunc> const &RPiController::GetAlgorithms()\n+std::map<std::string, AlgoCreateFunc> const &RPiController::getAlgorithms()\n {\n \treturn algorithms;\n }\n \n RegisterAlgorithm::RegisterAlgorithm(char const *name,\n-\t\t\t\t AlgoCreateFunc create_func)\n+\t\t\t\t AlgoCreateFunc createFunc)\n {\n-\talgorithms[std::string(name)] = create_func;\n+\talgorithms[std::string(name)] = createFunc;\n }\ndiff --git a/src/ipa/raspberrypi/controller/algorithm.hpp b/src/ipa/raspberrypi/controller/algorithm.hpp\nindex 5123c87bab34..a33b14da2726 100644\n--- a/src/ipa/raspberrypi/controller/algorithm.hpp\n+++ b/src/ipa/raspberrypi/controller/algorithm.hpp\n@@ -29,18 +29,18 @@ public:\n \t{\n \t}\n \tvirtual ~Algorithm() = default;\n-\tvirtual char const *Name() const = 0;\n-\tvirtual bool IsPaused() const { return paused_; }\n-\tvirtual void Pause() { paused_ = true; }\n-\tvirtual void Resume() { paused_ = false; }\n-\tvirtual void Read(boost::property_tree::ptree const ¶ms);\n-\tvirtual void Initialise();\n-\tvirtual void SwitchMode(CameraMode const &camera_mode, Metadata *metadata);\n-\tvirtual void Prepare(Metadata *image_metadata);\n-\tvirtual void Process(StatisticsPtr &stats, Metadata *image_metadata);\n-\tMetadata &GetGlobalMetadata() const\n+\tvirtual char const *name() const = 0;\n+\tvirtual bool isPaused() const { return paused_; }\n+\tvirtual void pause() { paused_ = true; }\n+\tvirtual void resume() { paused_ = false; }\n+\tvirtual void read(boost::property_tree::ptree const ¶ms);\n+\tvirtual void initialise();\n+\tvirtual void switchMode(CameraMode const &cameraMode, Metadata *metadata);\n+\tvirtual void prepare(Metadata *imageMetadata);\n+\tvirtual void process(StatisticsPtr &stats, Metadata *imageMetadata);\n+\tMetadata &getGlobalMetadata() const\n \t{\n-\t\treturn controller_->GetGlobalMetadata();\n+\t\treturn controller_->getGlobalMetadata();\n \t}\n \n private:\n@@ -53,8 +53,8 @@ private:\n \n typedef Algorithm *(*AlgoCreateFunc)(Controller *controller);\n struct RegisterAlgorithm {\n-\tRegisterAlgorithm(char const *name, AlgoCreateFunc create_func);\n+\tRegisterAlgorithm(char const *name, AlgoCreateFunc createFunc);\n };\n-std::map<std::string, AlgoCreateFunc> const &GetAlgorithms();\n+std::map<std::string, AlgoCreateFunc> const &getAlgorithms();\n \n } // namespace RPiController\ndiff --git a/src/ipa/raspberrypi/controller/awb_algorithm.hpp b/src/ipa/raspberrypi/controller/awb_algorithm.hpp\nindex 96f88afc3a8d..c5d2ca90263c 100644\n--- a/src/ipa/raspberrypi/controller/awb_algorithm.hpp\n+++ b/src/ipa/raspberrypi/controller/awb_algorithm.hpp\n@@ -15,9 +15,9 @@ class AwbAlgorithm : public Algorithm\n public:\n \tAwbAlgorithm(Controller *controller) : Algorithm(controller) {}\n \t// An AWB algorithm must provide the following:\n-\tvirtual unsigned int GetConvergenceFrames() const = 0;\n-\tvirtual void SetMode(std::string const &mode_name) = 0;\n-\tvirtual void SetManualGains(double manual_r, double manual_b) = 0;\n+\tvirtual unsigned int getConvergenceFrames() const = 0;\n+\tvirtual void setMode(std::string const &modeName) = 0;\n+\tvirtual void setManualGains(double manualR, double manualB) = 0;\n };\n \n } // namespace RPiController\ndiff --git a/src/ipa/raspberrypi/controller/awb_status.h b/src/ipa/raspberrypi/controller/awb_status.h\nindex 46d7c842299a..bc428ed3206a 100644\n--- a/src/ipa/raspberrypi/controller/awb_status.h\n+++ b/src/ipa/raspberrypi/controller/awb_status.h\n@@ -15,10 +15,10 @@ extern \"C\" {\n \n struct AwbStatus {\n \tchar mode[32];\n-\tdouble temperature_K;\n-\tdouble gain_r;\n-\tdouble gain_g;\n-\tdouble gain_b;\n+\tdouble temperatureK;\n+\tdouble gainR;\n+\tdouble gainG;\n+\tdouble gainB;\n };\n \n #ifdef __cplusplus\n", "prefixes": [ "libcamera-devel", "03/17" ] }