From patchwork Tue Apr 7 22:01:09 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 26489 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 75F6DC32F5 for ; Tue, 7 Apr 2026 22:02:59 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E8DD562DEC; Wed, 8 Apr 2026 00:02:50 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="bgERZKK4"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2B24B62DA0 for ; Wed, 8 Apr 2026 00:02:42 +0200 (CEST) Received: from [192.168.0.204] (ams.linuxembedded.co.uk [209.38.108.23]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 78A296A6; Wed, 8 Apr 2026 00:01:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1775599274; bh=PBHUldN1WdxIrokwZoMzPpOP155RcwSuQlPOXE1uJ0A=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=bgERZKK4Nhw9Sy89KtooRcd7pA+3IBHjr1S8TUtIBACCOZkj/SM4Ug1saw/hXUfQp pd5cvjc7x3m8cSdrOiFhCFmavwyWTssXRhsYDfiMdLcaKGjsiV6MXHnq8vXkvld1cO aHzxIljVtAHBVnOZsW3DVxRUXx+MQ3ho0HLt3egA= From: Kieran Bingham Date: Tue, 07 Apr 2026 23:01:09 +0100 Subject: [PATCH 06/13] ipa: libipa: provide lux context structures MIME-Version: 1.0 Message-Id: <20260407-kbingham-awb-split-v1-6-a39af3f4dc20@ideasonboard.com> References: <20260407-kbingham-awb-split-v1-0-a39af3f4dc20@ideasonboard.com> In-Reply-To: <20260407-kbingham-awb-split-v1-0-a39af3f4dc20@ideasonboard.com> To: libcamera-devel@lists.libcamera.org Cc: Kieran Bingham X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1775599360; l=2818; i=kieran.bingham@ideasonboard.com; s=20260204; h=from:subject:message-id; bh=PBHUldN1WdxIrokwZoMzPpOP155RcwSuQlPOXE1uJ0A=; b=b3vzdNwxd8c+kUZvqQSG79kZmYvRoBk3WPgYoPJT7VwsA/KXGINOZd48fKjVjzcqwGiJqGQdX bkxxcf9bphUCCdiLbkGj1SAmdfRcNef5DZMK/plTYOJTpPUN24tiayr X-Developer-Key: i=kieran.bingham@ideasonboard.com; a=ed25519; pk=IOxS2C6nWHNjLfkDR71Iesk904i6wJDfEERqV7hDBdY= 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" Move the ActiveState and FrameContext as used by the RKISP1 lux to be exposed by the libipa implementation for re-use. Signed-off-by: Kieran Bingham --- src/ipa/libipa/lux.cpp | 16 ++++++++++++++++ src/ipa/libipa/lux.h | 12 ++++++++++++ src/ipa/rkisp1/ipa_context.h | 13 +++++-------- 3 files changed, 33 insertions(+), 8 deletions(-) diff --git a/src/ipa/libipa/lux.cpp b/src/ipa/libipa/lux.cpp index 899e88248f04fbe0d6986528c81b468384fe4a9f..012c6fb367142ce40f60f5e102e3addb142c4a6b 100644 --- a/src/ipa/libipa/lux.cpp +++ b/src/ipa/libipa/lux.cpp @@ -33,6 +33,22 @@ LOG_DEFINE_CATEGORY(Lux) namespace ipa { +/** + * \struct lux::ActiveState + * \brief Active lux estimation state shared across frames + * + * \var lux::ActiveState::lux + * \brief The most recently estimated lux value + */ + +/** + * \struct lux::FrameContext + * \brief Per-frame lux estimation context + * + * \var lux::FrameContext::lux + * \brief The lux value estimation used for processing the frame + */ + /** * \class Lux * \brief Class that implements lux estimation diff --git a/src/ipa/libipa/lux.h b/src/ipa/libipa/lux.h index d95bcdafcfcdb44641ddb12306e4705157dc09ae..2aa630a1097e4bc672c792395d2d179dc084c7d8 100644 --- a/src/ipa/libipa/lux.h +++ b/src/ipa/libipa/lux.h @@ -16,6 +16,18 @@ class YamlObject; namespace ipa { +namespace lux { + +struct ActiveState { + double lux; +}; + +struct FrameContext { + double lux; +}; + +} /* namespace lux */ + class Histogram; class Lux diff --git a/src/ipa/rkisp1/ipa_context.h b/src/ipa/rkisp1/ipa_context.h index e61391bb1510bb642dafc544ee7775390e6948d6..63a6f2b7d884bfff2553175fa32e45ae747fb4c7 100644 --- a/src/ipa/rkisp1/ipa_context.h +++ b/src/ipa/rkisp1/ipa_context.h @@ -28,6 +28,7 @@ #include "libipa/camera_sensor_helper.h" #include "libipa/fc_queue.h" #include "libipa/fixedpoint.h" +#include "libipa/lux.h" namespace libcamera { @@ -78,6 +79,8 @@ struct IPASessionConfiguration { }; struct IPAActiveState { + ipa::lux::ActiveState lux; + struct { struct { uint32_t exposure; @@ -137,10 +140,6 @@ struct IPAActiveState { double gamma; } goc; - struct { - double lux; - } lux; - struct { controls::WdrModeEnum mode; AgcMeanLuminance::AgcConstraint constraint; @@ -154,6 +153,8 @@ struct IPAActiveState { }; struct IPAFrameContext : public FrameContext { + ipa::lux::FrameContext lux; + struct { uint32_t exposure; double gain; @@ -219,10 +220,6 @@ struct IPAFrameContext : public FrameContext { Matrix ccm; } ccm; - struct { - double lux; - } lux; - struct { controls::WdrModeEnum mode; double strength;