From patchwork Mon Nov 23 07:38:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 10465 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 810FDBE08A for ; Mon, 23 Nov 2020 07:38:38 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4FAD76332E; Mon, 23 Nov 2020 08:38:38 +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="jGML+XRY"; dkim-atps=neutral Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 280F960332 for ; Mon, 23 Nov 2020 08:38:36 +0100 (CET) Received: by mail-wm1-x32d.google.com with SMTP id s13so16276193wmh.4 for ; Sun, 22 Nov 2020 23:38:36 -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=43bWmHG17Nxr2zP+ZJpDTRe06JALjHw0tSt03Ca7jmI=; b=jGML+XRYoGfb3GJwgBAY+P3km6lJGuAVLQ8UTtxpLXbnjIMlD+/eptmL4/oZSoUJVc NkHmVTGiCm/QjOUd5pFNbb6dFFHZ8H9BIt2x51Pw/btNcxfoz8FrnF/ZdKDAT1iz9Wrb 52uUPICYEhvoxlAviTrqfoN11pZm2675o4YB8PBe4jpKrC8fq99unlsdwKqcB+Ob9oQF hePcZRbroOaNtAGd+iVex/VNkS+6IBz0gSiI8tCPvMloVlU7TP80PwUFfKwjRdbngqqb e56JnOKXd2gbc+IL2LG+x+uYn1ArldOnSWi9NoQSIWrkADh9DLuybc8jcjw7BK4uSj47 67KA== 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=43bWmHG17Nxr2zP+ZJpDTRe06JALjHw0tSt03Ca7jmI=; b=GRy6x7OgpdwE13j5r0B0zsRAhQch1+mgzyEKh9HndtNe3pKG9K44/83aPqIHXVgLCM JKpT580QUVAGsMg/wIezefkusmDlXmuWcZel8eNCCZqYLWKgyBb3qFrPsHrpKG3bkEI+ IJTIKl/1m+ejdFJYVAB1uN4gbo9jFb26tsiS3vUaWZrre8DYOJ4e5WMSLANanRRAXFZ0 UvJA62sTCi1C8R2luiKk34zRgUtKCnv5/MuF+tNHoaOT2rHObh1EOsOxTStGNmc+Krf9 E6KATZaXpXvfxv95hvY5lUHqEWsjMjt/CMs0v4Hmwb7ocknhZpCrCHWYv9unLnsyQhsQ vboA== X-Gm-Message-State: AOAM530yW0EBlDVvxY0bqzhlPatOz5+yCOy9Fv7x8jRICtPBTzFSBEpS oyRY8tE5an/geW676GUJIzU+vAH2+XKIXdOJ X-Google-Smtp-Source: ABdhPJzde+fxoVyqCC/BPSc4bbK7xe2NVtmz9X9EKSdalQvkZ6YqB7J+hgbxGQ+w5NAWs96IDSVg1w== X-Received: by 2002:a7b:c5cf:: with SMTP id n15mr23347401wmk.9.1606117115574; Sun, 22 Nov 2020 23:38:35 -0800 (PST) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id h15sm17841822wrw.15.2020.11.22.23.38.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Nov 2020 23:38:34 -0800 (PST) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Mon, 23 Nov 2020 07:38:00 +0000 Message-Id: <20201123073804.3125-7-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201123073804.3125-1-david.plowman@raspberrypi.com> References: <20201123073804.3125-1-david.plowman@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 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 {