From patchwork Tue Jul 26 12:45:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 16778 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 94885C3275 for ; Tue, 26 Jul 2022 12:46:05 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3A09463326; Tue, 26 Jul 2022 14:46:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1658839565; bh=lDvGYPRcazwRmcermwVxjPDD0hNDFO5mFeGMMesCWpE=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=WvutWdAi4tF40s/eNb7e0U6zjHYZ68mLy8X3UW27wg2i7kfl0/2fv31R6Y0OkbvbA CvEqwY2vzrueRwnuxLEnJ8ALV17Rac6RVsOyd1QDaW+GnDvMYsUbs/Tnkj0nSSrQoi tVEn1R51bGk/UF1QUraOAmzd5ktuvAtFYXnz11KhNyLi4/a1cm41HWTpi7CX+3Egqd q3X+IZOe5l3WsEmdpktHKPAj0kzYbTr+Z4IV4bI0eRFJmvOeef+gNvfCULV5zwBuO3 ytdtqjHcokjZ53/lVzQ5wubma2q5KlXzUpYIUealk1nFP04Yb4SW3qU3BQEYJ52cor WhtJQ0eRWJ5HQ== Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id AF1A16330E for ; Tue, 26 Jul 2022 14:46:00 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="a74xHkTg"; dkim-atps=neutral Received: by mail-wr1-x429.google.com with SMTP id m17so19703732wrw.7 for ; Tue, 26 Jul 2022 05:46:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HyCZgSRw/lm8W2bEDr6DY60O+3rTN1NvLKjzS8uxivY=; b=a74xHkTgHhQspZrYfFX1qZSStWE/iIQ7k4BJNqNQdFsq45wJqbhn03rRLITq0UXtS6 Aaym9j+yGsj03ZI2LBJ0XOwXKOE4EkqRfTgtpya/KzEVVYepCKNQOm8/t5kDG4HsPTTH 4hPguPGC4Vf1shdogSaOZUTdL7GAcHntSB5PamgcfXTwoFJkilYmB8iVUMuRnHlprxiV 1MsZcGHUaCxjZ8BSNrv9FEK1nU81KkykSUVbhW2bJx1ffLm0zKmi7dl5YKIVHjeM8Lcd dQYhunJyk7T7lG/D7drUbyrm4YvodlFXNz7LpdwaYaWtUHiEjDAyv9DgIwM8pZof/M3B BaQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HyCZgSRw/lm8W2bEDr6DY60O+3rTN1NvLKjzS8uxivY=; b=xL0EIi7bv4qir7C9IcXi6eygyBEar76dw/2U2WdEbswpqrgk4ZJkDramG3iEyxEng0 DahOlr3SLjlMhJ9DFXrmPLqa7P/eqEZK/ax+0/6Z+ITqb094OdCwYGuFCc2WejYSplzN RE0FdvNsRtWMflp6yIxlBKVvLUmW7qRsFYjmI4WF9tYoMPi1FyPzYmd9sgUnB93BmZ6c P23ZpQdPG/TbkSAmECJX+m6I7L9RQNFaP+puJ9zcopcWojBjaklRGPSmhrY7ycs9EDmx OE8d2whwKELF8gJNZPwSRwg6DSjW8PbRY+pzDtktCq13BpzISAqI/QECGO01XpkgKorG 1BEQ== X-Gm-Message-State: AJIora8WWcIlVKtkq7AOUyHLryc/9cs0JOc+bKaBP5x/2XjzGTBzxK7D LdR5ifEodOUYKZOxugQYJYpLLOb5vzm9pw== X-Google-Smtp-Source: AGRyM1vxetiW3qfJk31A79PuF1Ts4/7J7eUDBRp4mfVcl5jsPALbEXJFgxg4/gMltUQWIONufFhxZg== X-Received: by 2002:a5d:6d0a:0:b0:21d:6f28:5ead with SMTP id e10-20020a5d6d0a000000b0021d6f285eadmr10611430wrq.95.1658839560009; Tue, 26 Jul 2022 05:46:00 -0700 (PDT) Received: from naush-laptop.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id y17-20020adfd091000000b0021e87ec980bsm5948460wrh.84.2022.07.26.05.45.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Jul 2022 05:45:59 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Tue, 26 Jul 2022 13:45:37 +0100 Message-Id: <20220726124549.1646-6-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 Subject: [libcamera-devel] [PATCH 05/17] DNI: ipa: raspberrypi: Code refactoring to match style guidelines X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Naushir Patuck via libcamera-devel From: Naushir Patuck Reply-To: Naushir Patuck Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" 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 Reviewed-by: Laurent Pinchart --- .../controller/denoise_algorithm.hpp | 2 +- .../raspberrypi/controller/denoise_status.h | 4 ++-- .../raspberrypi/controller/device_status.cpp | 18 +++++++++--------- src/ipa/raspberrypi/controller/device_status.h | 16 ++++++++-------- src/ipa/raspberrypi/controller/noise_status.h | 4 ++-- 5 files changed, 22 insertions(+), 22 deletions(-) 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/denoise_status.h b/src/ipa/raspberrypi/controller/denoise_status.h index 67a3c361387e..fe304d098253 100644 --- a/src/ipa/raspberrypi/controller/denoise_status.h +++ b/src/ipa/raspberrypi/controller/denoise_status.h @@ -13,8 +13,8 @@ extern "C" { #endif struct DenoiseStatus { - double noise_constant; - double noise_slope; + double noiseConstant; + double noiseSlope; double strength; unsigned int mode; }; 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 lens_position; + std::optional lensPosition; /* 1/f so that brightness quadruples when this doubles, or 0 if unknown */ std::optional aperture; /* proportional to brightness with 0 = no flash, 1 = maximum flash */ - std::optional flash_intensity; + std::optional flashIntensity; /* Sensor reported temperature value (in degrees) */ - std::optional sensor_temperature; + std::optional sensorTemperature; }; diff --git a/src/ipa/raspberrypi/controller/noise_status.h b/src/ipa/raspberrypi/controller/noise_status.h index 8439a40213aa..358af4fe869b 100644 --- a/src/ipa/raspberrypi/controller/noise_status.h +++ b/src/ipa/raspberrypi/controller/noise_status.h @@ -13,8 +13,8 @@ extern "C" { #endif struct NoiseStatus { - double noise_constant; - double noise_slope; + double noiseConstant; + double noiseSlope; }; #ifdef __cplusplus