From patchwork Mon Nov 16 16:49:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 10435 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 47383BE082 for ; Mon, 16 Nov 2020 16:49:33 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1769B632C8; Mon, 16 Nov 2020 17:49:33 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="dnHuGQ6+"; dkim-atps=neutral Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 99F78632D7 for ; Mon, 16 Nov 2020 17:49:30 +0100 (CET) Received: by mail-wm1-x32b.google.com with SMTP id w24so24214662wmi.0 for ; Mon, 16 Nov 2020 08:49:30 -0800 (PST) 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=aisa3uaRSaovPCtBa0hhRtIHRsyDdDRuZE0+SvpTmd4=; b=dnHuGQ6+EqVuy7vXu6PNA2i9Xmrufe7M7u4fnihV7ay6g2q+hmohWnUgZtxMn7mPhB zDro9fDSCUiOdc6cazpWSgY7GtHFypx13lEVsNNozoLXR2tc8Rmq82hsVCcXgFyACLvl x+1tbrmlgSq8BbvRnF/T9s/1sq5sRK2Xa5zM66qvTiYYJH2EYA7rX4x8NMyVMA9tm+C3 j8tLuGzvGHTKmEDzuH+HpEcs1ed1BWasSeheUEjGEm36LGrIkqS5PkVn8bNPsbjaYpp0 u4JKSygVOXu6KuHRNJ49dasPF2zO3vEffSJ1YU1J+GV8avMcuvMs4YHi9sxft+f2JAPf ZJRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=aisa3uaRSaovPCtBa0hhRtIHRsyDdDRuZE0+SvpTmd4=; b=CoYk5PBGwJ+htFqSe7OGAZTBY5GF2KBThoZDOMyhlOEv1X/34/URcfHzbdWPqOgLSH bwxH/t8MyQV32Y2Etq4x51UVHMMKufLlTa7JMh2rQUhVlfmsNUCBvU1jdUNGnQJIBE5l ZH6mDI2QvxjQdmg1Eun5iiGXE9+HJtqnQrRqK7WS73u4XUpVkEUksMRbE+EE2s4dgEEK xOO7zuShplbczKMKkis3Yf8tIPn3rzZ34XbbC0cHWs2k1il6x9nG9FmK2b/Q11RRKCnj kv3jJPAr6KVlbbr8hAHBZB9guA/AnlJ/YPbKj66ZbNVryD+TbVrXKlTdWFr7raehbbaE uKnQ== X-Gm-Message-State: AOAM530rUGKBD5WWmHbLwyRiCuj+OopsiIiyPIRpugDu7tjGFMx/DPKF zAXMvHCm93yn79vzWcrsmzlkUqDCQJxkYA== X-Google-Smtp-Source: ABdhPJz0lTJz43rMZ2AKhCd1mGPILHMOoCgD9F4UIOAMhrTQwogF0CblH2YVmDV19dnwtEOxV4E23w== X-Received: by 2002:a1c:103:: with SMTP id 3mr16101819wmb.81.1605545370018; Mon, 16 Nov 2020 08:49:30 -0800 (PST) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id q16sm23716973wrn.13.2020.11.16.08.49.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Nov 2020 08:49:29 -0800 (PST) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Mon, 16 Nov 2020 16:49:14 +0000 Message-Id: <20201116164918.2055-7-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201116164918.2055-1-david.plowman@raspberrypi.com> References: <20201116164918.2055-1-david.plowman@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 06/10] libcamera: ipa: raspberrypi: awb: Add SwitchMode method to output AWB status 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 Awb class now implements a SwitchMode method which outputs its AwbStatus for other algorithms to read, should they be interested. Signed-off-by: David Plowman Reviewed-by: Naushir Patuck --- src/ipa/raspberrypi/controller/rpi/awb.cpp | 14 ++++++++++++++ src/ipa/raspberrypi/controller/rpi/awb.hpp | 1 + 2 files changed, 15 insertions(+) diff --git a/src/ipa/raspberrypi/controller/rpi/awb.cpp b/src/ipa/raspberrypi/controller/rpi/awb.cpp index 469d0e53..020825e3 100644 --- a/src/ipa/raspberrypi/controller/rpi/awb.cpp +++ b/src/ipa/raspberrypi/controller/rpi/awb.cpp @@ -179,6 +179,20 @@ void Awb::SetManualGains(double manual_r, double manual_b) manual_b_ = manual_b; } +void Awb::SwitchMode([[maybe_unused]] CameraMode const &camera_mode, + Metadata *metadata) +{ + // If fixed colour gains have been set, we should let other algorithms + // know by writing it into the image metadata. + if (manual_r_ != 0.0 && manual_b_ != 0.0) { + prev_sync_results_.gain_r = manual_r_; + prev_sync_results_.gain_g = 1.0; + prev_sync_results_.gain_b = manual_b_; + sync_results_ = prev_sync_results_; + } + metadata->Set("awb.status", prev_sync_results_); +} + void Awb::fetchAsyncResults() { RPI_LOG("Fetch AWB results"); diff --git a/src/ipa/raspberrypi/controller/rpi/awb.hpp b/src/ipa/raspberrypi/controller/rpi/awb.hpp index 9124d042..545d85a8 100644 --- a/src/ipa/raspberrypi/controller/rpi/awb.hpp +++ b/src/ipa/raspberrypi/controller/rpi/awb.hpp @@ -84,6 +84,7 @@ public: void Read(boost::property_tree::ptree const ¶ms) override; void SetMode(std::string const &name) override; void SetManualGains(double manual_r, double manual_b) override; + void SwitchMode(CameraMode const &camera_mode, Metadata *metadata) override; void Prepare(Metadata *image_metadata) override; void Process(StatisticsPtr &stats, Metadata *image_metadata) override; struct RGB {