From patchwork Fri Aug 30 15:27:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milan Zamazal X-Patchwork-Id: 21109 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 0947FC32D7 for ; Fri, 30 Aug 2024 15:27:48 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4EF26634DD; Fri, 30 Aug 2024 17:27:48 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="ZrHs/hF4"; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8DA1C634CD for ; Fri, 30 Aug 2024 17:27:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725031659; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pGplRR87kOfW0wQVbOTmZ8UmxjSQD6qIhfe6qeyQVvo=; b=ZrHs/hF4RnHLrB//KArwILwTbqDABRnFMJiFii3o/QXx8tqK2t13k1KbbPq5PMPHKiL/JR cvNpRtbc0/Z1Y+0sQsfKs7Z/NlHfbPe02QNkMAReySDu5Ras6WBhZC9XxG3ZHN6FBS1jJq sbRoF4oMvaaMIoTZeHstjIVkPlzojnY= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-609-W8HZjzsuOZOCehhDV3wvvA-1; Fri, 30 Aug 2024 11:27:38 -0400 X-MC-Unique: W8HZjzsuOZOCehhDV3wvvA-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 518911955BFE for ; Fri, 30 Aug 2024 15:27:37 +0000 (UTC) Received: from nuthatch.redhat.com (unknown [10.45.225.65]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 3975D1956048; Fri, 30 Aug 2024 15:27:35 +0000 (UTC) From: Milan Zamazal To: libcamera-devel@lists.libcamera.org Cc: Milan Zamazal Subject: [PATCH v2 06/20] libcamera: rkisp1: Formatting improvements Date: Fri, 30 Aug 2024 17:27:03 +0200 Message-ID: <20240830152721.1420313-7-mzamazal@redhat.com> In-Reply-To: <20240830152721.1420313-1-mzamazal@redhat.com> References: <20240830152721.1420313-1-mzamazal@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The LSP autoformatter doesn't like some of the current formatting, let's make it happy. Signed-off-by: Milan Zamazal --- src/ipa/rkisp1/algorithms/awb.cpp | 18 +++++++++--------- src/ipa/rkisp1/algorithms/dpf.cpp | 4 ++-- src/ipa/rkisp1/rkisp1.cpp | 20 +++++++++++--------- 3 files changed, 22 insertions(+), 20 deletions(-) diff --git a/src/ipa/rkisp1/algorithms/awb.cpp b/src/ipa/rkisp1/algorithms/awb.cpp index a5972015..35435fe2 100644 --- a/src/ipa/rkisp1/algorithms/awb.cpp +++ b/src/ipa/rkisp1/algorithms/awb.cpp @@ -12,6 +12,7 @@ #include #include + #include /** @@ -209,10 +210,9 @@ void Awb::process(IPAContext &context, double blueMean; metadata.set(controls::AwbEnable, frameContext.awb.autoEnabled); - metadata.set(controls::ColourGains, { - static_cast(frameContext.awb.gains.red), - static_cast(frameContext.awb.gains.blue) - }); + metadata.set(controls::ColourGains, + { static_cast(frameContext.awb.gains.red), + static_cast(frameContext.awb.gains.blue) }); if (rgbMode_) { greenMean = awb->awb_mean[0].mean_y_or_g; @@ -305,11 +305,11 @@ void Awb::process(IPAContext &context, activeState.awb.gains.automatic.green = 1.0; LOG(RkISP1Awb, Debug) << std::showpoint - << "Means [" << redMean << ", " << greenMean << ", " << blueMean - << "], gains [" << activeState.awb.gains.automatic.red << ", " - << activeState.awb.gains.automatic.green << ", " - << activeState.awb.gains.automatic.blue << "], temp " - << activeState.awb.temperatureK << "K"; + << "Means [" << redMean << ", " << greenMean << ", " << blueMean + << "], gains [" << activeState.awb.gains.automatic.red << ", " + << activeState.awb.gains.automatic.green << ", " + << activeState.awb.gains.automatic.blue << "], temp " + << activeState.awb.temperatureK << "K"; } REGISTER_IPA_ALGORITHM(Awb, "Awb") diff --git a/src/ipa/rkisp1/algorithms/dpf.cpp b/src/ipa/rkisp1/algorithms/dpf.cpp index 94080b28..ef1f25d7 100644 --- a/src/ipa/rkisp1/algorithms/dpf.cpp +++ b/src/ipa/rkisp1/algorithms/dpf.cpp @@ -116,8 +116,8 @@ int Dpf::init([[maybe_unused]] IPAContext &context, } config_.rb_flt.fltsize = values.size() == RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS - ? RKISP1_CIF_ISP_DPF_RB_FILTERSIZE_13x9 - : RKISP1_CIF_ISP_DPF_RB_FILTERSIZE_9x9; + ? RKISP1_CIF_ISP_DPF_RB_FILTERSIZE_13x9 + : RKISP1_CIF_ISP_DPF_RB_FILTERSIZE_9x9; std::copy_n(values.begin(), values.size(), std::begin(config_.rb_flt.spatial_coeff)); diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp index 55269579..3c13c82e 100644 --- a/src/ipa/rkisp1/rkisp1.cpp +++ b/src/ipa/rkisp1/rkisp1.cpp @@ -17,10 +17,11 @@ #include #include +#include + #include #include #include -#include #include "libcamera/internal/formats.h" #include "libcamera/internal/mapped_framebuffer.h" @@ -162,8 +163,8 @@ int IPARkISP1::init(const IPASettings &settings, unsigned int hwRevision, return -ENODEV; } - context_.configuration.sensor.lineDuration = sensorInfo.minLineLength - * 1.0s / sensorInfo.pixelRate; + context_.configuration.sensor.lineDuration = + sensorInfo.minLineLength * 1.0s / sensorInfo.pixelRate; /* Load the tuning data file. */ File file(settings.configurationFile); @@ -264,12 +265,13 @@ int IPARkISP1::configure(const IPAConfigInfo &ipaConfig, context_.configuration.sensor.maxAnalogueGain = context_.camHelper->gain(maxGain); - context_.configuration.raw = std::any_of(streamConfig.begin(), streamConfig.end(), - [](auto &cfg) -> bool { - PixelFormat pixelFormat{ cfg.second.pixelFormat }; - const PixelFormatInfo &format = PixelFormatInfo::info(pixelFormat); - return format.colourEncoding == PixelFormatInfo::ColourEncodingRAW; - }); + context_.configuration.raw = + std::any_of(streamConfig.begin(), streamConfig.end(), + [](auto &cfg) -> bool { + PixelFormat pixelFormat{ cfg.second.pixelFormat }; + const PixelFormatInfo &format = PixelFormatInfo::info(pixelFormat); + return format.colourEncoding == PixelFormatInfo::ColourEncodingRAW; + }); for (auto const &a : algorithms()) { Algorithm *algo = static_cast(a.get());