Show a patch.

GET /api/1.1/patches/21024/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 21024,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/21024/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/21024/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api",
        "name": "libcamera",
        "link_name": "libcamera",
        "list_id": "libcamera_core",
        "list_email": "libcamera-devel@lists.libcamera.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20240826161709.524293-6-jacopo.mondi@ideasonboard.com>",
    "date": "2024-08-26T16:17:04",
    "name": "[v3,5/9] ipa: rkisp1: Add ISP parameters abstraction class",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "0a7af1470a3e4efb3dba4deba90a0a5dd2f93022",
    "submitter": {
        "id": 143,
        "url": "https://patchwork.libcamera.org/api/1.1/people/143/?format=api",
        "name": "Jacopo Mondi",
        "email": "jacopo.mondi@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/21024/mbox/",
    "series": [
        {
            "id": 4541,
            "url": "https://patchwork.libcamera.org/api/1.1/series/4541/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4541",
            "date": "2024-08-26T16:16:59",
            "name": "rkisp1: Support BLS on i.MX8MP",
            "version": 3,
            "mbox": "https://patchwork.libcamera.org/series/4541/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/21024/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/21024/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<libcamera-devel-bounces@lists.libcamera.org>",
        "X-Original-To": "parsemail@patchwork.libcamera.org",
        "Delivered-To": "parsemail@patchwork.libcamera.org",
        "Received": [
            "from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 0FA1BC32C2\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 26 Aug 2024 16:17:34 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5E5AD63437;\n\tMon, 26 Aug 2024 18:17:33 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 98E7E633DE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 26 Aug 2024 18:17:21 +0200 (CEST)",
            "from ideasonboard.com (mob-5-90-142-90.net.vodafone.it\n\t[5.90.142.90])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 67D826CA;\n\tMon, 26 Aug 2024 18:16:14 +0200 (CEST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"QkYEE54s\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1724688975;\n\tbh=w+QAbg++MOONxAT7BqhijsY5wIstv6h/Z4+HZaTGSFU=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=QkYEE54sd3CbHns3Dpp1J4hIpYPwowa4+fbpnuWFC63SM/1mawcJw3qaCSPafqlnP\n\trtPm0F6lmbA4CPFKWOdcX8n9rSUoaDqqqsSY4OFh1KFP/cZz5bhF16Bhjwvp+PmroX\n\tbsznhiJ55lrCk1Y718/RITqcPvfiEM71ceBFS32w=",
        "From": "Jacopo Mondi <jacopo.mondi@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tPaul Elder <paul.elder@ideasonboard.com>,\n\tStefan Klug <stefan.klug@ideasonboard.com>,\n\tJacopo Mondi <jacopo.mondi@ideasonboard.com>",
        "Subject": "[PATCH v3 5/9] ipa: rkisp1: Add ISP parameters abstraction class",
        "Date": "Mon, 26 Aug 2024 18:17:04 +0200",
        "Message-ID": "<20240826161709.524293-6-jacopo.mondi@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.45.2",
        "In-Reply-To": "<20240826161709.524293-1-jacopo.mondi@ideasonboard.com>",
        "References": "<20240826161709.524293-1-jacopo.mondi@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "libcamera-devel@lists.libcamera.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "<libcamera-devel.lists.libcamera.org>",
        "List-Unsubscribe": "<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>",
        "List-Archive": "<https://lists.libcamera.org/pipermail/libcamera-devel/>",
        "List-Post": "<mailto:libcamera-devel@lists.libcamera.org>",
        "List-Help": "<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>",
        "List-Subscribe": "<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nIndividual algorithms of the rkisp1 IPA module access their\ncorresponding ISP parameters through the top-level structure\nrkisp1_params_cfg. This will not work anymore with the new parameters\nformat. In order to ease the transition to the new format, abstract the\nISP parameters in a new RkISP1Params class that offers the same\ninterface regardless of the format.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\nReviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\nSigned-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n---\n src/ipa/rkisp1/meson.build |   1 +\n src/ipa/rkisp1/params.cpp  | 222 +++++++++++++++++++++++++++++++++++++\n src/ipa/rkisp1/params.h    | 163 +++++++++++++++++++++++++++\n 3 files changed, 386 insertions(+)\n create mode 100644 src/ipa/rkisp1/params.cpp\n create mode 100644 src/ipa/rkisp1/params.h",
    "diff": "diff --git a/src/ipa/rkisp1/meson.build b/src/ipa/rkisp1/meson.build\nindex 160ef52dd52e..34844f1498f9 100644\n--- a/src/ipa/rkisp1/meson.build\n+++ b/src/ipa/rkisp1/meson.build\n@@ -7,6 +7,7 @@ ipa_name = 'ipa_rkisp1'\n \n rkisp1_ipa_sources = files([\n     'ipa_context.cpp',\n+    'params.cpp',\n     'rkisp1.cpp',\n     'utils.cpp',\n ])\ndiff --git a/src/ipa/rkisp1/params.cpp b/src/ipa/rkisp1/params.cpp\nnew file mode 100644\nindex 000000000000..8fec3d1c8d27\n--- /dev/null\n+++ b/src/ipa/rkisp1/params.cpp\n@@ -0,0 +1,222 @@\n+/* SPDX-License-Identifier: LGPL-2.1-or-later */\n+/*\n+ * Copyright (C) 2024, Ideas On Board\n+ *\n+ * RkISP1 ISP Parameters\n+ */\n+\n+#include \"params.h\"\n+\n+#include <map>\n+#include <stddef.h>\n+#include <string.h>\n+\n+#include <linux/rkisp1-config.h>\n+#include <linux/videodev2.h>\n+\n+#include <libcamera/base/log.h>\n+#include <libcamera/base/utils.h>\n+\n+namespace libcamera {\n+\n+LOG_DEFINE_CATEGORY(RkISP1Params)\n+\n+namespace ipa::rkisp1 {\n+\n+namespace {\n+\n+struct BlockTypeInfo {\n+\tenum rkisp1_ext_params_block_type type;\n+\tsize_t size;\n+\tsize_t offset;\n+\tuint32_t enableBit;\n+};\n+\n+#define RKISP1_BLOCK_TYPE_ENTRY(block, id, type, category, bit)\t\t\t\\\n+\t{ Block::block, {\t\t\t\t\t\t\t\\\n+\t\tRKISP1_EXT_PARAMS_BLOCK_TYPE_##id,\t\t\t\t\\\n+\t\tsizeof(struct rkisp1_cif_isp_##type##_config),\t\t\t\\\n+\t\toffsetof(struct rkisp1_params_cfg, category.type##_config),\t\\\n+\t\tRKISP1_CIF_ISP_MODULE_##bit,\t\t\t\t\t\\\n+\t} }\n+\n+#define RKISP1_BLOCK_TYPE_ENTRY_MEAS(block, id, type)\t\t\t\t\\\n+\tRKISP1_BLOCK_TYPE_ENTRY(block, id##_MEAS, type, meas, id)\n+\n+#define RKISP1_BLOCK_TYPE_ENTRY_OTHERS(block, id, type)\t\t\t\t\\\n+\tRKISP1_BLOCK_TYPE_ENTRY(block, id, type, others, id)\n+\n+#define RKISP1_BLOCK_TYPE_ENTRY_EXT(block, id, type)\t\t\t\t\\\n+\t{ Block::block, {\t\t\t\t\t\t\t\\\n+\t\tRKISP1_EXT_PARAMS_BLOCK_TYPE_##id,\t\t\t\t\\\n+\t\tsizeof(struct rkisp1_cif_isp_##type##_config),\t\t\t\\\n+\t\t0, 0,\t\t\t\t\t\t\t\t\\\n+\t} }\n+\n+const std::map<Block, BlockTypeInfo> kBlockTypeInfo = {\n+\tRKISP1_BLOCK_TYPE_ENTRY_OTHERS(Bls, BLS, bls),\n+\tRKISP1_BLOCK_TYPE_ENTRY_OTHERS(Dpcc, DPCC, dpcc),\n+\tRKISP1_BLOCK_TYPE_ENTRY_OTHERS(Sdg, SDG, sdg),\n+\tRKISP1_BLOCK_TYPE_ENTRY_OTHERS(AwbGain, AWB_GAIN, awb_gain),\n+\tRKISP1_BLOCK_TYPE_ENTRY_OTHERS(Flt, FLT, flt),\n+\tRKISP1_BLOCK_TYPE_ENTRY_OTHERS(Bdm, BDM, bdm),\n+\tRKISP1_BLOCK_TYPE_ENTRY_OTHERS(Ctk, CTK, ctk),\n+\tRKISP1_BLOCK_TYPE_ENTRY_OTHERS(Goc, GOC, goc),\n+\tRKISP1_BLOCK_TYPE_ENTRY_OTHERS(Dpf, DPF, dpf),\n+\tRKISP1_BLOCK_TYPE_ENTRY_OTHERS(DpfStrength, DPF_STRENGTH, dpf_strength),\n+\tRKISP1_BLOCK_TYPE_ENTRY_OTHERS(Cproc, CPROC, cproc),\n+\tRKISP1_BLOCK_TYPE_ENTRY_OTHERS(Ie, IE, ie),\n+\tRKISP1_BLOCK_TYPE_ENTRY_OTHERS(Lsc, LSC, lsc),\n+\tRKISP1_BLOCK_TYPE_ENTRY_MEAS(Awb, AWB, awb_meas),\n+\tRKISP1_BLOCK_TYPE_ENTRY_MEAS(Hst, HST, hst),\n+\tRKISP1_BLOCK_TYPE_ENTRY_MEAS(Aec, AEC, aec),\n+\tRKISP1_BLOCK_TYPE_ENTRY_MEAS(Afc, AFC, afc),\n+\tRKISP1_BLOCK_TYPE_ENTRY_EXT(CompandBls, COMPAND_BLS, compand_bls),\n+\tRKISP1_BLOCK_TYPE_ENTRY_EXT(CompandExpand, COMPAND_EXPAND, compand_curve),\n+\tRKISP1_BLOCK_TYPE_ENTRY_EXT(CompandCompress, COMPAND_COMPRESS, compand_curve),\n+};\n+\n+} /* namespace */\n+\n+RkISP1ParamsBlockBase::RkISP1ParamsBlockBase(RkISP1Params *params, Block type,\n+\t\t\t\t\t     const Span<uint8_t> &data)\n+\t: params_(params), type_(type)\n+{\n+\tif (params_->format() == V4L2_META_FMT_RK_ISP1_EXT_PARAMS) {\n+\t\theader_ = data.subspan(0, sizeof(rkisp1_ext_params_block_header));\n+\t\tdata_ = data.subspan(sizeof(rkisp1_ext_params_block_header));\n+\t} else {\n+\t\tdata_ = data;\n+\t}\n+}\n+\n+void RkISP1ParamsBlockBase::setEnabled(bool enabled)\n+{\n+\t/*\n+\t * For the legacy fixed format, blocks are enabled in the top-level\n+\t * header. Delegate to the RkISP1Params class.\n+\t */\n+\tif (params_->format() == V4L2_META_FMT_RK_ISP1_PARAMS)\n+\t\treturn params_->setBlockEnabled(type_, enabled);\n+\n+\t/*\n+\t * For the extensible format, set the enable field in the block header\n+\t * directly.\n+\t */\n+\tstruct rkisp1_ext_params_block_header *header =\n+\t\treinterpret_cast<struct rkisp1_ext_params_block_header *>(header_.data());\n+\theader->flags &= ~(RKISP1_EXT_PARAMS_FL_BLOCK_ENABLE |\n+\t\t\t   RKISP1_EXT_PARAMS_FL_BLOCK_DISABLE);\n+\theader->flags |= enabled ? RKISP1_EXT_PARAMS_FL_BLOCK_ENABLE\n+\t\t       : RKISP1_EXT_PARAMS_FL_BLOCK_DISABLE;\n+}\n+\n+RkISP1Params::RkISP1Params(uint32_t format, Span<uint8_t> data)\n+\t: format_(format), data_(data), used_(0)\n+{\n+\tif (format_ == V4L2_META_FMT_RK_ISP1_EXT_PARAMS) {\n+\t\tstruct rkisp1_ext_params_cfg *cfg =\n+\t\t\treinterpret_cast<struct rkisp1_ext_params_cfg *>(data.data());\n+\n+\t\tcfg->version = RKISP1_EXT_PARAM_BUFFER_V1;\n+\t\tcfg->data_size = 0;\n+\n+\t\tused_ += offsetof(struct rkisp1_ext_params_cfg, data);\n+\t} else {\n+\t\tmemset(data.data(), 0, data.size());\n+\t\tused_ = sizeof(struct rkisp1_params_cfg);\n+\t}\n+}\n+\n+void RkISP1Params::setBlockEnabled(Block type, bool enabled)\n+{\n+\tconst BlockTypeInfo &info = kBlockTypeInfo.at(type);\n+\n+\tstruct rkisp1_params_cfg *cfg =\n+\t\treinterpret_cast<struct rkisp1_params_cfg *>(data_.data());\n+\tif (enabled)\n+\t\tcfg->module_ens |= info.enableBit;\n+\telse\n+\t\tcfg->module_ens &= ~info.enableBit;\n+}\n+\n+Span<uint8_t> RkISP1Params::block(Block type)\n+{\n+\tauto infoIt = kBlockTypeInfo.find(type);\n+\tif (infoIt == kBlockTypeInfo.end()) {\n+\t\tLOG(RkISP1Params, Error)\n+\t\t\t<< \"Invalid parameters block type \"\n+\t\t\t<< utils::to_underlying(type);\n+\t\treturn {};\n+\t}\n+\n+\tconst BlockTypeInfo &info = infoIt->second;\n+\n+\t/*\n+\t * For the legacy format, return a block referencing the fixed location\n+\t * of the data.\n+\t */\n+\tif (format_ == V4L2_META_FMT_RK_ISP1_PARAMS) {\n+\t\t/*\n+\t\t * Blocks available in extended parameters only have an offset\n+\t\t * of 0. Return nullptr in that case.\n+\t\t */\n+\t\tif (info.offset == 0) {\n+\t\t\tLOG(RkISP1Params, Error)\n+\t\t\t\t<< \"Block type \" << utils::to_underlying(type)\n+\t\t\t\t<< \" unavailable in fixed parameters format\";\n+\t\t\treturn {};\n+\t\t}\n+\n+\t\tstruct rkisp1_params_cfg *cfg =\n+\t\t\treinterpret_cast<struct rkisp1_params_cfg *>(data_.data());\n+\n+\t\tcfg->module_cfg_update |= info.enableBit;\n+\t\tcfg->module_en_update |= info.enableBit;\n+\n+\t\treturn data_.subspan(info.offset, info.size);\n+\t}\n+\n+\t/*\n+\t * For the extensible format, allocate memory for the block, including\n+\t * the header. Look up the block in the cache first. If an algorithm\n+\t * requests the same block type twice, it should get the same block.\n+\t */\n+\tauto cacheIt = blocks_.find(type);\n+\tif (cacheIt != blocks_.end())\n+\t\treturn cacheIt->second;\n+\n+\t/* Make sure we don't run out of space. */\n+\tsize_t size = sizeof(struct rkisp1_ext_params_block_header)\n+\t\t    + ((info.size + 7) & ~7);\n+\tif (size > data_.size() - used_) {\n+\t\tLOG(RkISP1Params, Error)\n+\t\t\t<< \"Out of memory to allocate block type \"\n+\t\t\t<< utils::to_underlying(type);\n+\t\treturn {};\n+\t}\n+\n+\t/* Allocate a new block, clear its memory, and initialize its header. */\n+\tSpan<uint8_t> block = data_.subspan(used_, size);\n+\tused_ += size;\n+\n+\tstruct rkisp1_ext_params_cfg *cfg =\n+\t\treinterpret_cast<struct rkisp1_ext_params_cfg *>(data_.data());\n+\tcfg->data_size += size;\n+\n+\tmemset(block.data(), 0, block.size());\n+\n+\tstruct rkisp1_ext_params_block_header *header =\n+\t\treinterpret_cast<struct rkisp1_ext_params_block_header *>(block.data());\n+\theader->type = info.type;\n+\theader->size = block.size();\n+\n+\t/* Update the cache. */\n+\tblocks_[type] = block;\n+\n+\treturn block;\n+}\n+\n+} /* namespace ipa::rkisp1 */\n+\n+} /* namespace libcamera */\ndiff --git a/src/ipa/rkisp1/params.h b/src/ipa/rkisp1/params.h\nnew file mode 100644\nindex 000000000000..3d15102da20c\n--- /dev/null\n+++ b/src/ipa/rkisp1/params.h\n@@ -0,0 +1,163 @@\n+/* SPDX-License-Identifier: LGPL-2.1-or-later */\n+/*\n+ * Copyright (C) 2024, Ideas On Board\n+ *\n+ * RkISP1 ISP Parameters\n+ */\n+\n+#pragma once\n+\n+#include <map>\n+#include <stdint.h>\n+\n+#include <linux/rkisp1-config.h>\n+\n+#include <libcamera/base/class.h>\n+#include <libcamera/base/span.h>\n+\n+namespace libcamera {\n+\n+namespace ipa::rkisp1 {\n+\n+enum class Block {\n+\tBls,\n+\tDpcc,\n+\tSdg,\n+\tAwbGain,\n+\tFlt,\n+\tBdm,\n+\tCtk,\n+\tGoc,\n+\tDpf,\n+\tDpfStrength,\n+\tCproc,\n+\tIe,\n+\tLsc,\n+\tAwb,\n+\tHst,\n+\tAec,\n+\tAfc,\n+\tCompandBls,\n+\tCompandExpand,\n+\tCompandCompress,\n+};\n+\n+namespace details {\n+\n+template<Block B>\n+struct block_type {\n+};\n+\n+#define RKISP1_DEFINE_BLOCK_TYPE(blockType, blockStruct)\t\t\\\n+template<>\t\t\t\t\t\t\t\t\\\n+struct block_type<Block::blockType> {\t\t\t\t\t\\\n+\tusing type = struct rkisp1_cif_isp_##blockStruct##_config;\t\\\n+};\n+\n+RKISP1_DEFINE_BLOCK_TYPE(Bls, bls)\n+RKISP1_DEFINE_BLOCK_TYPE(Dpcc, dpcc)\n+RKISP1_DEFINE_BLOCK_TYPE(Sdg, sdg)\n+RKISP1_DEFINE_BLOCK_TYPE(AwbGain, awb_gain)\n+RKISP1_DEFINE_BLOCK_TYPE(Flt, flt)\n+RKISP1_DEFINE_BLOCK_TYPE(Bdm, bdm)\n+RKISP1_DEFINE_BLOCK_TYPE(Ctk, ctk)\n+RKISP1_DEFINE_BLOCK_TYPE(Goc, goc)\n+RKISP1_DEFINE_BLOCK_TYPE(Dpf, dpf)\n+RKISP1_DEFINE_BLOCK_TYPE(DpfStrength, dpf_strength)\n+RKISP1_DEFINE_BLOCK_TYPE(Cproc, cproc)\n+RKISP1_DEFINE_BLOCK_TYPE(Ie, ie)\n+RKISP1_DEFINE_BLOCK_TYPE(Lsc, lsc)\n+RKISP1_DEFINE_BLOCK_TYPE(Awb, awb_meas)\n+RKISP1_DEFINE_BLOCK_TYPE(Hst, hst)\n+RKISP1_DEFINE_BLOCK_TYPE(Aec, aec)\n+RKISP1_DEFINE_BLOCK_TYPE(Afc, afc)\n+RKISP1_DEFINE_BLOCK_TYPE(CompandBls, compand_bls)\n+RKISP1_DEFINE_BLOCK_TYPE(CompandExpand, compand_curve)\n+RKISP1_DEFINE_BLOCK_TYPE(CompandCompress, compand_curve)\n+\n+} /* namespace details */\n+\n+class RkISP1Params;\n+\n+class RkISP1ParamsBlockBase\n+{\n+public:\n+\tRkISP1ParamsBlockBase(RkISP1Params *params, Block type,\n+\t\t\t      const Span<uint8_t> &data);\n+\n+\tSpan<uint8_t> data() const { return data_; }\n+\n+\tvoid setEnabled(bool enabled);\n+\n+private:\n+\tLIBCAMERA_DISABLE_COPY(RkISP1ParamsBlockBase);\n+\n+\tRkISP1Params *params_;\n+\tBlock type_;\n+\tSpan<uint8_t> header_;\n+\tSpan<uint8_t> data_;\n+};\n+\n+template<Block B>\n+class RkISP1ParamsBlock : public RkISP1ParamsBlockBase\n+{\n+public:\n+\tusing Type = typename details::block_type<B>::type;\n+\n+\tRkISP1ParamsBlock(RkISP1Params *params, const Span<uint8_t> &data)\n+\t\t: RkISP1ParamsBlockBase(params, B, data)\n+\t{\n+\t}\n+\n+\tconst Type *operator->() const\n+\t{\n+\t\treturn reinterpret_cast<const Type *>(data().data());\n+\t}\n+\n+\tType *operator->()\n+\t{\n+\t\treturn reinterpret_cast<Type *>(data().data());\n+\t}\n+\n+\tconst Type &operator*() const &\n+\t{\n+\t\treturn *reinterpret_cast<const Type *>(data().data());\n+\t}\n+\n+\tType &operator*() &\n+\t{\n+\t\treturn *reinterpret_cast<Type *>(data().data());\n+\t}\n+};\n+\n+class RkISP1Params\n+{\n+public:\n+\tRkISP1Params(uint32_t format, Span<uint8_t> data);\n+\n+\ttemplate<Block B>\n+\tRkISP1ParamsBlock<B> block()\n+\t{\n+\t\treturn RkISP1ParamsBlock<B>(this, block(B));\n+\t}\n+\n+\tuint32_t format() const { return format_; }\n+\tsize_t size() const { return used_; }\n+\n+private:\n+\tfriend class RkISP1ParamsBlockBase;\n+\n+\tSpan<uint8_t> block(Block type);\n+\tvoid setBlockEnabled(Block type, bool enabled);\n+\n+\tuint32_t format_;\n+\n+\tSpan<uint8_t> data_;\n+\tsize_t used_;\n+\n+\tstd::map<Block, Span<uint8_t>> blocks_;\n+};\n+\n+} /* namespace ipa::rkisp1 */\n+\n+} /* namespace libcamera*/\n",
    "prefixes": [
        "v3",
        "5/9"
    ]
}