[{"id":37959,"web_url":"https://patchwork.libcamera.org/comment/37959/","msgid":"<57e5fb98-199f-4225-a362-6e7cd53d5574@collabora.com>","date":"2026-01-26T16:02:23","subject":"Re: [PATCH v4 09/15] libcamera: ipa: simple: Make gamma adjustable","submitter":{"id":140,"url":"https://patchwork.libcamera.org/api/people/140/","name":"Robert Mader","email":"robert.mader@collabora.com"},"content":"Reviewed-by: Robert Mader <robert.mader@collabora.com>\n\nOn 22.01.26 17:19, Milan Zamazal wrote:\n> The gamma value is fixed in software ISP.  Let's make it adjustable,\n> similarly to contrast and saturation, and report it in metadata.\n>\n> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n> ---\n>   src/ipa/simple/algorithms/adjust.cpp | 12 ++++++++++++\n>   src/ipa/simple/algorithms/adjust.h   |  4 +++-\n>   src/ipa/simple/algorithms/lut.cpp    | 11 ++++++-----\n>   src/ipa/simple/ipa_context.h         |  6 ++++--\n>   4 files changed, 25 insertions(+), 8 deletions(-)\n>\n> diff --git a/src/ipa/simple/algorithms/adjust.cpp b/src/ipa/simple/algorithms/adjust.cpp\n> index 27ae2a53a..a067f7b84 100644\n> --- a/src/ipa/simple/algorithms/adjust.cpp\n> +++ b/src/ipa/simple/algorithms/adjust.cpp\n> @@ -23,6 +23,7 @@ LOG_DEFINE_CATEGORY(IPASoftAdjust)\n>   \n>   int Adjust::init(IPAContext &context, [[maybe_unused]] const YamlObject &tuningData)\n>   {\n> +\tcontext.ctrlMap[&controls::Gamma] = ControlInfo(0.1f, 10.0f, kDefaultGamma);\n>   \tcontext.ctrlMap[&controls::Contrast] = ControlInfo(0.0f, 2.0f, 1.0f);\n>   \tif (context.ccmEnabled)\n>   \t\tcontext.ctrlMap[&controls::Saturation] = ControlInfo(0.0f, 2.0f, 1.0f);\n> @@ -32,6 +33,7 @@ int Adjust::init(IPAContext &context, [[maybe_unused]] const YamlObject &tuningD\n>   int Adjust::configure(IPAContext &context,\n>   \t\t      [[maybe_unused]] const IPAConfigInfo &configInfo)\n>   {\n> +\tcontext.activeState.knobs.gamma = kDefaultGamma;\n>   \tcontext.activeState.knobs.contrast = std::optional<double>();\n>   \tcontext.activeState.knobs.saturation = std::optional<double>();\n>   \n> @@ -43,6 +45,12 @@ void Adjust::queueRequest(typename Module::Context &context,\n>   \t\t\t  [[maybe_unused]] typename Module::FrameContext &frameContext,\n>   \t\t\t  const ControlList &controls)\n>   {\n> +\tconst auto &gamma = controls.get(controls::Gamma);\n> +\tif (gamma.has_value()) {\n> +\t\tcontext.activeState.knobs.gamma = gamma.value();\n> +\t\tLOG(IPASoftAdjust, Debug) << \"Setting gamma to \" << gamma.value();\n> +\t}\n> +\n>   \tconst auto &contrast = controls.get(controls::Contrast);\n>   \tif (contrast.has_value()) {\n>   \t\tcontext.activeState.knobs.contrast = contrast;\n> @@ -83,6 +91,7 @@ void Adjust::prepare(IPAContext &context,\n>   \t\t     IPAFrameContext &frameContext,\n>   \t\t     [[maybe_unused]] DebayerParams *params)\n>   {\n> +\tframeContext.gamma = context.activeState.knobs.gamma;\n>   \tframeContext.contrast = context.activeState.knobs.contrast;\n>   \n>   \tif (!context.ccmEnabled)\n> @@ -105,6 +114,9 @@ void Adjust::process([[maybe_unused]] IPAContext &context,\n>   \t\t     [[maybe_unused]] const SwIspStats *stats,\n>   \t\t     ControlList &metadata)\n>   {\n> +\tconst auto &gamma = frameContext.gamma;\n> +\tmetadata.set(controls::Gamma, gamma);\n> +\n>   \tconst auto &contrast = frameContext.contrast;\n>   \tif (contrast)\n>   \t\tmetadata.set(controls::Contrast, contrast.value());\n> diff --git a/src/ipa/simple/algorithms/adjust.h b/src/ipa/simple/algorithms/adjust.h\n> index c4baa2503..7644138ff 100644\n> --- a/src/ipa/simple/algorithms/adjust.h\n> +++ b/src/ipa/simple/algorithms/adjust.h\n> @@ -1,6 +1,6 @@\n>   /* SPDX-License-Identifier: LGPL-2.1-or-later */\n>   /*\n> - * Copyright (C) 2024-2025, Red Hat Inc.\n> + * Copyright (C) 2024-2026, Red Hat Inc.\n>    *\n>    * Color correction matrix\n>    */\n> @@ -19,6 +19,8 @@ namespace libcamera {\n>   \n>   namespace ipa::soft::algorithms {\n>   \n> +constexpr float kDefaultGamma = 2.2f;\n> +\n>   class Adjust : public Algorithm\n>   {\n>   public:\n> diff --git a/src/ipa/simple/algorithms/lut.cpp b/src/ipa/simple/algorithms/lut.cpp\n> index 3a00bf4ee..9740f8c8d 100644\n> --- a/src/ipa/simple/algorithms/lut.cpp\n> +++ b/src/ipa/simple/algorithms/lut.cpp\n> @@ -18,6 +18,8 @@\n>   \n>   #include \"simple/ipa_context.h\"\n>   \n> +#include \"adjust.h\"\n> +\n>   namespace libcamera {\n>   \n>   LOG_DEFINE_CATEGORY(IPASoftLut)\n> @@ -27,8 +29,6 @@ namespace ipa::soft::algorithms {\n>   int Lut::configure(IPAContext &context,\n>   \t\t   [[maybe_unused]] const IPAConfigInfo &configInfo)\n>   {\n> -\t/* Gamma value is fixed */\n> -\tcontext.configuration.gamma = 1.0 / 2.2;\n>   \tupdateGammaTable(context);\n>   \n>   \treturn 0;\n> @@ -37,6 +37,7 @@ int Lut::configure(IPAContext &context,\n>   void Lut::updateGammaTable(IPAContext &context)\n>   {\n>   \tconst auto blackLevel = context.activeState.blc.level;\n> +\tconst auto gamma = 1.0 / context.activeState.knobs.gamma;\n>   \tconst auto contrast = context.activeState.knobs.contrast.value_or(1.0);\n>   \t/* Convert 0..2 to 0..infinity; avoid actual inifinity at tan(pi/2) */\n>   \tdouble contrastExp = tan(std::clamp(contrast * M_PI_4, 0.0, M_PI_2 - 0.00001));\n> @@ -52,8 +53,7 @@ void Lut::updateGammaTable(IPAContext &context)\n>   \t\t\t\tnormalized = 0.5 * std::pow(normalized / 0.5, contrastExp);\n>   \t\t\telse\n>   \t\t\t\tnormalized = 1.0 - 0.5 * std::pow((1.0 - normalized) / 0.5, contrastExp);\n> -\t\t\tgammaTable[i] = UINT8_MAX *\n> -\t\t\t\t\tstd::pow(normalized, context.configuration.gamma);\n> +\t\t\tgammaTable[i] = UINT8_MAX * std::pow(normalized, gamma);\n>   \t\t}\n>   \t\t/*\n>   \t\t * Due to CCM operations, the table lookup may reach indices below the black\n> @@ -65,6 +65,7 @@ void Lut::updateGammaTable(IPAContext &context)\n>   \t\t\t  gammaTable[blackIndex]);\n>   \t}\n>   \n> +\tcontext.activeState.gamma.gamma = gamma;\n>   \tcontext.activeState.gamma.blackLevel = blackLevel;\n>   \tcontext.activeState.gamma.contrastExp = contrastExp;\n>   }\n> @@ -131,7 +132,7 @@ void Lut::prepare(IPAContext &context,\n>   \t\tcontext.activeState.matrixChanged = false;\n>   \t}\n>   \n> -\tparams->gamma = context.configuration.gamma;\n> +\tparams->gamma = context.activeState.gamma.gamma;\n>   \tparams->contrastExp = context.activeState.gamma.contrastExp;\n>   }\n>   \n> diff --git a/src/ipa/simple/ipa_context.h b/src/ipa/simple/ipa_context.h\n> index a3ff3d038..eeade9d35 100644\n> --- a/src/ipa/simple/ipa_context.h\n> +++ b/src/ipa/simple/ipa_context.h\n> @@ -1,6 +1,6 @@\n>   /* SPDX-License-Identifier: LGPL-2.1-or-later */\n>   /*\n> - * Copyright (C) 2024-2025 Red Hat, Inc.\n> + * Copyright (C) 2024-2026 Red Hat, Inc.\n>    *\n>    * Simple pipeline IPA Context\n>    */\n> @@ -25,7 +25,6 @@ namespace libcamera {\n>   namespace ipa::soft {\n>   \n>   struct IPASessionConfiguration {\n> -\tfloat gamma;\n>   \tstruct {\n>   \t\tint32_t exposureMin, exposureMax;\n>   \t\tdouble againMin, againMax, again10, againMinStep;\n> @@ -58,6 +57,7 @@ struct IPAActiveState {\n>   \tstruct {\n>   \t\tstd::array<double, kGammaLookupSize> gammaTable;\n>   \t\tuint8_t blackLevel;\n> +\t\tfloat gamma;\n>   \t\tdouble contrast;\n>   \t\tdouble contrastExp;\n>   \t} gamma;\n> @@ -66,6 +66,7 @@ struct IPAActiveState {\n>   \tbool matrixChanged = false;\n>   \n>   \tstruct {\n> +\t\tfloat gamma;\n>   \t\t/* 0..2 range, 1.0 = normal */\n>   \t\tstd::optional<double> contrast;\n>   \t\tstd::optional<float> saturation;\n> @@ -85,6 +86,7 @@ struct IPAFrameContext : public FrameContext {\n>   \t\tdouble blue;\n>   \t} gains;\n>   \n> +\tfloat gamma;\n>   \tstd::optional<double> contrast;\n>   \tstd::optional<float> saturation;\n>   };","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 D2836C3220\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 26 Jan 2026 16:02:32 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 07CCC61FD0;\n\tMon, 26 Jan 2026 17:02:32 +0100 (CET)","from sender4-pp-e104.zoho.com (sender4-pp-e104.zoho.com\n\t[136.143.188.104])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id AAB4661FC5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 26 Jan 2026 17:02:29 +0100 (CET)","by mx.zohomail.com with SMTPS id 1769443345785765.1973798908816;\n\tMon, 26 Jan 2026 08:02:25 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=collabora.com\n\theader.i=robert.mader@collabora.com header.b=\"EZ7IPNZ1\"; \n\tdkim-atps=neutral","ARC-Seal":"i=1; a=rsa-sha256; t=1769443347; cv=none; \n\td=zohomail.com; s=zohoarc; \n\tb=aP1TXezdWlfMk34Re4+4lLLejGn5Qbq+5Daq43mqIzUxj6cC05Q+KLqLoXUGxRaZpvAfGgO6f5XREs+TczteEgJMDf0ek7y0ZzBIAiy7tfw7QpEiT85+fiRl9yDmmLesidlusFFv6VcYR/0SP2XxJ33pe/hOj6BRONZlgP8Pvs4=","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; \n\ts=zohoarc; t=1769443347;\n\th=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To:Cc;\n\tbh=BzCv+FYr4FEQ5UGUaMeYQoz4HK74lxPCRJk0lceK+TY=; \n\tb=X9ymTU9dnbS/9vt0WdekBNZ+3UXj0mKV74kEHLjPH5MCMdu6zZQEYz8GgN8mII/k2jFG9oksMWf1sAbKDnDuLoz+d9y6xDWpUEkXrmUmpRt6c5Gtyxh9Oy4j38LAAfdHT9y5U8JmoZH0ozTSSK9Parhoa4DwaNN+0wXT7m9sU7Y=","ARC-Authentication-Results":"i=1; mx.zohomail.com;\n\tdkim=pass  header.i=collabora.com;\n\tspf=pass  smtp.mailfrom=robert.mader@collabora.com;\n\tdmarc=pass header.from=<robert.mader@collabora.com>","DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1769443347;\n\ts=zohomail; d=collabora.com; i=robert.mader@collabora.com;\n\th=Message-ID:Date:Date:MIME-Version:Subject:Subject:To:To:References:From:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To:Cc;\n\tbh=BzCv+FYr4FEQ5UGUaMeYQoz4HK74lxPCRJk0lceK+TY=;\n\tb=EZ7IPNZ1LWKdUlMrKGNEoMW+hKCOod9iiWUb60BUNYXid7P8GyL/+a5YxEobZM2s\n\t8LoKLlh9FMjDMouEfo46S8M06Kro/F1RVFxdjDL+HCzPyZCwh/EHElyGBMeHJNmVreL\n\tIPZeKh36y4zBIUqgcCTqBPJWX0Bp99C9ks5d3XN4=","Message-ID":"<57e5fb98-199f-4225-a362-6e7cd53d5574@collabora.com>","Date":"Mon, 26 Jan 2026 17:02:23 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v4 09/15] libcamera: ipa: simple: Make gamma adjustable","To":"libcamera-devel@lists.libcamera.org","References":"<20260122161935.208562-1-mzamazal@redhat.com>\n\t<20260122161935.208562-10-mzamazal@redhat.com>","Content-Language":"en-US, de-DE","From":"Robert Mader <robert.mader@collabora.com>","In-Reply-To":"<20260122161935.208562-10-mzamazal@redhat.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","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>"}},{"id":37965,"web_url":"https://patchwork.libcamera.org/comment/37965/","msgid":"<eb66f37f-5904-4fa9-8666-0d4ad5eb545c@ideasonboard.com>","date":"2026-01-27T10:01:27","subject":"Re: [PATCH v4 09/15] libcamera: ipa: simple: Make gamma adjustable","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"2026. 01. 22. 17:19 keltezéssel, Milan Zamazal írta:\n> The gamma value is fixed in software ISP.  Let's make it adjustable,\n> similarly to contrast and saturation, and report it in metadata.\n> \n> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n> ---\n\nSeems fine to me.\n\nReviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n\n\n>   src/ipa/simple/algorithms/adjust.cpp | 12 ++++++++++++\n>   src/ipa/simple/algorithms/adjust.h   |  4 +++-\n>   src/ipa/simple/algorithms/lut.cpp    | 11 ++++++-----\n>   src/ipa/simple/ipa_context.h         |  6 ++++--\n>   4 files changed, 25 insertions(+), 8 deletions(-)\n> \n> diff --git a/src/ipa/simple/algorithms/adjust.cpp b/src/ipa/simple/algorithms/adjust.cpp\n> index 27ae2a53a..a067f7b84 100644\n> --- a/src/ipa/simple/algorithms/adjust.cpp\n> +++ b/src/ipa/simple/algorithms/adjust.cpp\n> @@ -23,6 +23,7 @@ LOG_DEFINE_CATEGORY(IPASoftAdjust)\n>   \n>   int Adjust::init(IPAContext &context, [[maybe_unused]] const YamlObject &tuningData)\n>   {\n> +\tcontext.ctrlMap[&controls::Gamma] = ControlInfo(0.1f, 10.0f, kDefaultGamma);\n>   \tcontext.ctrlMap[&controls::Contrast] = ControlInfo(0.0f, 2.0f, 1.0f);\n>   \tif (context.ccmEnabled)\n>   \t\tcontext.ctrlMap[&controls::Saturation] = ControlInfo(0.0f, 2.0f, 1.0f);\n> @@ -32,6 +33,7 @@ int Adjust::init(IPAContext &context, [[maybe_unused]] const YamlObject &tuningD\n>   int Adjust::configure(IPAContext &context,\n>   \t\t      [[maybe_unused]] const IPAConfigInfo &configInfo)\n>   {\n> +\tcontext.activeState.knobs.gamma = kDefaultGamma;\n>   \tcontext.activeState.knobs.contrast = std::optional<double>();\n>   \tcontext.activeState.knobs.saturation = std::optional<double>();\n>   \n> @@ -43,6 +45,12 @@ void Adjust::queueRequest(typename Module::Context &context,\n>   \t\t\t  [[maybe_unused]] typename Module::FrameContext &frameContext,\n>   \t\t\t  const ControlList &controls)\n>   {\n> +\tconst auto &gamma = controls.get(controls::Gamma);\n> +\tif (gamma.has_value()) {\n> +\t\tcontext.activeState.knobs.gamma = gamma.value();\n> +\t\tLOG(IPASoftAdjust, Debug) << \"Setting gamma to \" << gamma.value();\n> +\t}\n> +\n>   \tconst auto &contrast = controls.get(controls::Contrast);\n>   \tif (contrast.has_value()) {\n>   \t\tcontext.activeState.knobs.contrast = contrast;\n> @@ -83,6 +91,7 @@ void Adjust::prepare(IPAContext &context,\n>   \t\t     IPAFrameContext &frameContext,\n>   \t\t     [[maybe_unused]] DebayerParams *params)\n>   {\n> +\tframeContext.gamma = context.activeState.knobs.gamma;\n>   \tframeContext.contrast = context.activeState.knobs.contrast;\n>   \n>   \tif (!context.ccmEnabled)\n> @@ -105,6 +114,9 @@ void Adjust::process([[maybe_unused]] IPAContext &context,\n>   \t\t     [[maybe_unused]] const SwIspStats *stats,\n>   \t\t     ControlList &metadata)\n>   {\n> +\tconst auto &gamma = frameContext.gamma;\n> +\tmetadata.set(controls::Gamma, gamma);\n> +\n>   \tconst auto &contrast = frameContext.contrast;\n>   \tif (contrast)\n>   \t\tmetadata.set(controls::Contrast, contrast.value());\n> diff --git a/src/ipa/simple/algorithms/adjust.h b/src/ipa/simple/algorithms/adjust.h\n> index c4baa2503..7644138ff 100644\n> --- a/src/ipa/simple/algorithms/adjust.h\n> +++ b/src/ipa/simple/algorithms/adjust.h\n> @@ -1,6 +1,6 @@\n>   /* SPDX-License-Identifier: LGPL-2.1-or-later */\n>   /*\n> - * Copyright (C) 2024-2025, Red Hat Inc.\n> + * Copyright (C) 2024-2026, Red Hat Inc.\n>    *\n>    * Color correction matrix\n>    */\n> @@ -19,6 +19,8 @@ namespace libcamera {\n>   \n>   namespace ipa::soft::algorithms {\n>   \n> +constexpr float kDefaultGamma = 2.2f;\n> +\n>   class Adjust : public Algorithm\n>   {\n>   public:\n> diff --git a/src/ipa/simple/algorithms/lut.cpp b/src/ipa/simple/algorithms/lut.cpp\n> index 3a00bf4ee..9740f8c8d 100644\n> --- a/src/ipa/simple/algorithms/lut.cpp\n> +++ b/src/ipa/simple/algorithms/lut.cpp\n> @@ -18,6 +18,8 @@\n>   \n>   #include \"simple/ipa_context.h\"\n>   \n> +#include \"adjust.h\"\n> +\n>   namespace libcamera {\n>   \n>   LOG_DEFINE_CATEGORY(IPASoftLut)\n> @@ -27,8 +29,6 @@ namespace ipa::soft::algorithms {\n>   int Lut::configure(IPAContext &context,\n>   \t\t   [[maybe_unused]] const IPAConfigInfo &configInfo)\n>   {\n> -\t/* Gamma value is fixed */\n> -\tcontext.configuration.gamma = 1.0 / 2.2;\n>   \tupdateGammaTable(context);\n>   \n>   \treturn 0;\n> @@ -37,6 +37,7 @@ int Lut::configure(IPAContext &context,\n>   void Lut::updateGammaTable(IPAContext &context)\n>   {\n>   \tconst auto blackLevel = context.activeState.blc.level;\n> +\tconst auto gamma = 1.0 / context.activeState.knobs.gamma;\n>   \tconst auto contrast = context.activeState.knobs.contrast.value_or(1.0);\n>   \t/* Convert 0..2 to 0..infinity; avoid actual inifinity at tan(pi/2) */\n>   \tdouble contrastExp = tan(std::clamp(contrast * M_PI_4, 0.0, M_PI_2 - 0.00001));\n> @@ -52,8 +53,7 @@ void Lut::updateGammaTable(IPAContext &context)\n>   \t\t\t\tnormalized = 0.5 * std::pow(normalized / 0.5, contrastExp);\n>   \t\t\telse\n>   \t\t\t\tnormalized = 1.0 - 0.5 * std::pow((1.0 - normalized) / 0.5, contrastExp);\n> -\t\t\tgammaTable[i] = UINT8_MAX *\n> -\t\t\t\t\tstd::pow(normalized, context.configuration.gamma);\n> +\t\t\tgammaTable[i] = UINT8_MAX * std::pow(normalized, gamma);\n>   \t\t}\n>   \t\t/*\n>   \t\t * Due to CCM operations, the table lookup may reach indices below the black\n> @@ -65,6 +65,7 @@ void Lut::updateGammaTable(IPAContext &context)\n>   \t\t\t  gammaTable[blackIndex]);\n>   \t}\n>   \n> +\tcontext.activeState.gamma.gamma = gamma;\n>   \tcontext.activeState.gamma.blackLevel = blackLevel;\n>   \tcontext.activeState.gamma.contrastExp = contrastExp;\n>   }\n> @@ -131,7 +132,7 @@ void Lut::prepare(IPAContext &context,\n>   \t\tcontext.activeState.matrixChanged = false;\n>   \t}\n>   \n> -\tparams->gamma = context.configuration.gamma;\n> +\tparams->gamma = context.activeState.gamma.gamma;\n>   \tparams->contrastExp = context.activeState.gamma.contrastExp;\n>   }\n>   \n> diff --git a/src/ipa/simple/ipa_context.h b/src/ipa/simple/ipa_context.h\n> index a3ff3d038..eeade9d35 100644\n> --- a/src/ipa/simple/ipa_context.h\n> +++ b/src/ipa/simple/ipa_context.h\n> @@ -1,6 +1,6 @@\n>   /* SPDX-License-Identifier: LGPL-2.1-or-later */\n>   /*\n> - * Copyright (C) 2024-2025 Red Hat, Inc.\n> + * Copyright (C) 2024-2026 Red Hat, Inc.\n>    *\n>    * Simple pipeline IPA Context\n>    */\n> @@ -25,7 +25,6 @@ namespace libcamera {\n>   namespace ipa::soft {\n>   \n>   struct IPASessionConfiguration {\n> -\tfloat gamma;\n>   \tstruct {\n>   \t\tint32_t exposureMin, exposureMax;\n>   \t\tdouble againMin, againMax, again10, againMinStep;\n> @@ -58,6 +57,7 @@ struct IPAActiveState {\n>   \tstruct {\n>   \t\tstd::array<double, kGammaLookupSize> gammaTable;\n>   \t\tuint8_t blackLevel;\n> +\t\tfloat gamma;\n>   \t\tdouble contrast;\n>   \t\tdouble contrastExp;\n>   \t} gamma;\n> @@ -66,6 +66,7 @@ struct IPAActiveState {\n>   \tbool matrixChanged = false;\n>   \n>   \tstruct {\n> +\t\tfloat gamma;\n>   \t\t/* 0..2 range, 1.0 = normal */\n>   \t\tstd::optional<double> contrast;\n>   \t\tstd::optional<float> saturation;\n> @@ -85,6 +86,7 @@ struct IPAFrameContext : public FrameContext {\n>   \t\tdouble blue;\n>   \t} gains;\n>   \n> +\tfloat gamma;\n>   \tstd::optional<double> contrast;\n>   \tstd::optional<float> saturation;\n>   };","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 E460BC3220\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 27 Jan 2026 10:01:33 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CE67561FC7;\n\tTue, 27 Jan 2026 11:01:32 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2A6A861F9F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 27 Jan 2026 11:01:31 +0100 (CET)","from [192.168.33.37] (185.221.142.123.nat.pool.zt.hu\n\t[185.221.142.123])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B23F978E;\n\tTue, 27 Jan 2026 11:00:54 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"ZaHHc6qZ\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1769508054;\n\tbh=eR46nD98/M6NHed+8i4yRn8k0PdLnkcAA6FjJvMKM68=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=ZaHHc6qZXDOf3tNUEdEvgl6q+2h6vhdoM3bW8fkBRKYJ7LnBy0AB4rX5Gn4uI5LvB\n\tgpfjIA8g99kUjgI4mTzl3cUA66Fi4xM+zVNmLoZ1bVI5b4KgAHd9oj6OsRm/4v8A2N\n\toRG3EgdIA02t6IJq7EQTtC4WDSLpjTrp90CUU34c=","Message-ID":"<eb66f37f-5904-4fa9-8666-0d4ad5eb545c@ideasonboard.com>","Date":"Tue, 27 Jan 2026 11:01:27 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v4 09/15] libcamera: ipa: simple: Make gamma adjustable","To":"Milan Zamazal <mzamazal@redhat.com>, libcamera-devel@lists.libcamera.org","Cc":"Kieran Bingham <kieran.bingham@ideasonboard.com>","References":"<20260122161935.208562-1-mzamazal@redhat.com>\n\t<20260122161935.208562-10-mzamazal@redhat.com>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<20260122161935.208562-10-mzamazal@redhat.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","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>"}}]