From patchwork Wed Dec 10 16:15:20 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 25470 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 A9B00C326B for ; Wed, 10 Dec 2025 16:41:10 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 53682614B4; Wed, 10 Dec 2025 17:41:09 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="RUA5rFfl"; dkim-atps=neutral Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id BE945614A5 for ; Wed, 10 Dec 2025 17:41:03 +0100 (CET) Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-477ba2c1ca2so92553875e9.2 for ; Wed, 10 Dec 2025 08:41:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1765384863; x=1765989663; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QLlvmGgcOMsYAJYOTv4cJBu9eq16xZuXXiVWbWJ1GqE=; b=RUA5rFflb2OdJLz8uy8UzkDOkx9H+GsJ87xzbYHxMyTouuspxy4I+479fSUQL8ozGA +X9n5WuhAGkVmsPRZUYHZko3nrim71uS1iAx8hrf/oIypeUtkyrm7Xpxo0TruttFjovc qpWXvyMOKkJMt2pLrLYywu1xoDIaYAkWcwfAwciyXwkF2IIIm6uvTPENYkCbZ4IqGpSV Ey5dOAwUdJj7nvmrGs7EbjfkqDLuNZdIeTl82Nyn7kJNl1GgLTX5aATJsKe06a5/tlZG JjrJWEazjbm1SMs35mwmaT0M/rIlMOr8h5Kf1fNPavhZXmA+z8N1/5pZ6Smsshypp+II 7pGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765384863; x=1765989663; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=QLlvmGgcOMsYAJYOTv4cJBu9eq16xZuXXiVWbWJ1GqE=; b=OjoPgkI2XveTdKZN5PGF/sUHR5d0NrBRTyAGqnn2FDQRP5mId9Eib04Ob0aghFk2F2 5UzsIyTJtK6/q0QLBpieg+51A5+Wg/9SkGJSCsBEEqBBXrOJWNKGVaFDhmkT/JACC+ry nDeCwkZwD6TrQmfgEeqtbbFBcCGq53uKHGSOmgEbDIdTKwePOq3Ta8OVT03ImXUvj1EZ JNl6/NcXY5jNQhD/WvJ3QkMn7t7lZVcJauSt4KYH+0Dd91IMkMiWzpPgNjIQmJXb6J6e TYV5tOTd1a3+LnYbQd9PdJrgqdMPEGGMykAwxDqTLddBc4fKKH5bzgIdOayBZeTBXlHi E4Zg== X-Gm-Message-State: AOJu0YwgCnjSfINWAIC9WtpinlC09W52DW9XTSkjQtPn9NzGuCllzAvM bFxLyvGa6oVZKluHpiJvAw5vaVLJ0toxWl2v9NBU5QBThkaqyQheI/O2yg4wPubCssPwW1Fmngj DK4ah X-Gm-Gg: ASbGnctCGphQD1GKwd8UKfW+nt5PKRq9eWvJ3JQ1Iax0+xX+8GnLNYxx2HeY0aouU2M 5gvEAxYGXzjPOq4e3e9zjog+xL/pZxmYm7X6IllEAHVAOpYd0YUI25KJjBDKV9IQpUtVjTo925y p+TQVXt5O9rUKOX4SWrilXlQqyJskWcIYKSvTy64G5T8TrgpEkv+QlUuy0wPKKA6unQyB1IhrJG kJaTqJAzUZvqNu2V33N2/RWfyQ+foqioB+K724EWJ+k5sHOAAHidbL4JCuZCi9AzpFPpPguPEWK 1D1TMBoBz4Q6MNQLFH/K+eMRyYemvmlozVRqgMaZi6f94oPa4DvsMINM9I7N3V9hvOMh23XTJuY a40XhND7y/vnRY8mZGE3WX+RA/98wKQu0NTO+Ihdg6YanFiC+OQJzk+yXdfsFVb3MlgAAn0XHUx DNcOB5MenG3q41Gh3uK0M/B9D0i0nU2or2xsExDonezU9W2R/3MktVSXPTgTqEHW7Ci9L+iFQl6 Z+W6iHMY9VBD7HEhPOzxzVkyKKUoA== X-Google-Smtp-Source: AGHT+IGbWLCI6qNynvO0NNDwj5j0b70UVlp4oHGjDa1pjXb0k76VKYw8AB/cMjVGs3gHab4XtlWfeQ== X-Received: by 2002:a05:600c:1909:b0:471:115e:87bd with SMTP id 5b1f17b1804b1-47a8384cfa1mr30526515e9.26.1765384862859; Wed, 10 Dec 2025 08:41:02 -0800 (PST) Received: from davidp-pi5.pitowers.org ([2a00:1098:3142:1f:88ea:c658:5b20:5e46]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47a88371e13sm1270415e9.11.2025.12.10.08.41.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Dec 2025 08:41:02 -0800 (PST) From: David Plowman To: libcamera-devel@lists.libcamera.org Cc: David Plowman Subject: [PATCH 05/11] ipa: rpi: cam_helper: Add CamHelperDefault class Date: Wed, 10 Dec 2025 16:15:20 +0000 Message-ID: <20251210164055.17856-6-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251210164055.17856-1-david.plowman@raspberrypi.com> References: <20251210164055.17856-1-david.plowman@raspberrypi.com> MIME-Version: 1.0 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" This will help make "memory cameras" work where there is no real sensor. This implementation does not really have to do anything except provide a few default values to satisfy any calling code. We use "memory cameras" to process raw camera images obtained from other sources, when in fact no actual camera may be present at all. Signed-off-by: David Plowman --- src/ipa/rpi/cam_helper/cam_helper_default.cpp | 45 +++++++++++++++++++ src/ipa/rpi/cam_helper/meson.build | 1 + 2 files changed, 46 insertions(+) create mode 100644 src/ipa/rpi/cam_helper/cam_helper_default.cpp diff --git a/src/ipa/rpi/cam_helper/cam_helper_default.cpp b/src/ipa/rpi/cam_helper/cam_helper_default.cpp new file mode 100644 index 00000000..99801cc3 --- /dev/null +++ b/src/ipa/rpi/cam_helper/cam_helper_default.cpp @@ -0,0 +1,45 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ +/* + * Copyright (C) 2025, Raspberry Pi Ltd + * + * default camera helper for unknown sensors + */ + +#include +#include +#include +#include + +#include "cam_helper.h" + +using namespace RPiController; + +class CamHelperDefault : public CamHelper +{ +public: + CamHelperDefault(); + uint32_t gainCode(double gain) const override; + double gain(uint32_t gainCode) const override; +}; + +CamHelperDefault::CamHelperDefault() + : CamHelper({}, 0) +{ +} + +uint32_t CamHelperDefault::gainCode([[maybe_unused]] double gain) const +{ + return 0; +} + +double CamHelperDefault::gain([[maybe_unused]] uint32_t gainCode) const +{ + return 1.0; +} + +static CamHelper *create() +{ + return new CamHelperDefault(); +} + +static RegisterCamHelper reg("default", &create); diff --git a/src/ipa/rpi/cam_helper/meson.build b/src/ipa/rpi/cam_helper/meson.build index c1eac689..0c968033 100644 --- a/src/ipa/rpi/cam_helper/meson.build +++ b/src/ipa/rpi/cam_helper/meson.build @@ -2,6 +2,7 @@ rpi_ipa_cam_helper_sources = files([ 'cam_helper.cpp', + 'cam_helper_default.cpp', 'cam_helper_ov5647.cpp', 'cam_helper_imx219.cpp', 'cam_helper_imx283.cpp',