[{"id":37702,"web_url":"https://patchwork.libcamera.org/comment/37702/","msgid":"<aad72c36-3dbf-453a-8988-f11e3c7d0ed8@ideasonboard.com>","date":"2026-01-16T17:33:45","subject":"Re: [PATCH v3 09/14] 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. 14. 12:30 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.\n> \n> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n> ---\n>   src/ipa/simple/algorithms/adjust.cpp |  8 ++++++++\n>   src/ipa/simple/algorithms/adjust.h   |  2 ++\n>   src/ipa/simple/algorithms/lut.cpp    | 12 +++++++-----\n>   src/ipa/simple/ipa_context.h         |  4 +++-\n>   4 files changed, 20 insertions(+), 6 deletions(-)\n> \n> diff --git a/src/ipa/simple/algorithms/adjust.cpp b/src/ipa/simple/algorithms/adjust.cpp\n> index 27ae2a53a..cfbc39610 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 = std::optional<double>();\n\nIs the `std::optional` necessary? I know that the others already use it,\nbut it seems to me that doing `... = kDefaultGamma` would work just\nas well, no?\n\n\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;\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> [...]","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 8AA5BC3226\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 16 Jan 2026 17:33:52 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DF49761FA3;\n\tFri, 16 Jan 2026 18:33:51 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B2C5F615B2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 16 Jan 2026 18:33:50 +0100 (CET)","from [192.168.33.22] (185.221.143.114.nat.pool.zt.hu\n\t[185.221.143.114])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id D2D45352;\n\tFri, 16 Jan 2026 18:33:21 +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=\"cV8yIY6k\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1768584802;\n\tbh=0nez0C5OjHUv1+BK7+dTSgSDXIyCu0DmKJyRHJaRN8g=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=cV8yIY6k5IrBNcM4uLAQdYr2dmSi+Z0fFQZim9pGIkuJ9uHWjeJkYwYnOMIXbtYMr\n\taB/AFREYUq2s3C7Y3Ef87yUAFdJYpSZ6ZVJu0IxDm/xFxs1GkczD1FymV+EgcJSF9F\n\tcN2ccx7qwM3/MvIkLiUuf1n/MlWtgT+RkZIzKsFc=","Message-ID":"<aad72c36-3dbf-453a-8988-f11e3c7d0ed8@ideasonboard.com>","Date":"Fri, 16 Jan 2026 18:33:45 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v3 09/14] 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":"<20260114113016.25162-1-mzamazal@redhat.com>\n\t<20260114113016.25162-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":"<20260114113016.25162-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>"}},{"id":37704,"web_url":"https://patchwork.libcamera.org/comment/37704/","msgid":"<85qzrp4b3a.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","date":"2026-01-16T19:22:01","subject":"Re: [PATCH v3 09/14] libcamera: ipa: simple: Make gamma adjustable","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Hi Barnabás,\n\nthank you for review.\n\nBarnabás Pőcze <barnabas.pocze@ideasonboard.com> writes:\n\n> 2026. 01. 14. 12:30 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.\n>> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n>> ---\n>>   src/ipa/simple/algorithms/adjust.cpp |  8 ++++++++\n>>   src/ipa/simple/algorithms/adjust.h   |  2 ++\n>>   src/ipa/simple/algorithms/lut.cpp    | 12 +++++++-----\n>>   src/ipa/simple/ipa_context.h         |  4 +++-\n>>   4 files changed, 20 insertions(+), 6 deletions(-)\n>> diff --git a/src/ipa/simple/algorithms/adjust.cpp b/src/ipa/simple/algorithms/adjust.cpp\n>> index 27ae2a53a..cfbc39610 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>>     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 = std::optional<double>();\n>\n> Is the `std::optional` necessary? I know that the others already use it,\n> but it seems to me that doing `... = kDefaultGamma` would work just\n> as well, no?\n\nMaybe there is a reason why it should be optional, see below.\n\n>>   \tcontext.activeState.knobs.contrast = std::optional<double>();\n>>   \tcontext.activeState.knobs.saturation = std::optional<double>();\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;\n\nI wonder whether it should actually be:\n\n  context.activeState.knobs.gamma = controls.get(controls::Gamma);\n\nWith the rationale that if the control stops providing a value\n(possible?), the activeState value should get reset to the default\nvalue.\n\nThe same for the other controls here.\n\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>> [...]\n\nA missing piece: The gamma value should be reported in metadata.","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 0B48EC3226\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 16 Jan 2026 19:22:09 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id AFD7861FBC;\n\tFri, 16 Jan 2026 20:22:08 +0100 (CET)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.133.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 203AC615B2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 16 Jan 2026 20:22:07 +0100 (CET)","from mail-wm1-f72.google.com (mail-wm1-f72.google.com\n\t[209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-462-w5PKc25vP_y92zkB0m5LHA-1; Fri, 16 Jan 2026 14:22:04 -0500","by mail-wm1-f72.google.com with SMTP id\n\t5b1f17b1804b1-47edc79ff28so15665465e9.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 16 Jan 2026 11:22:04 -0800 (PST)","from mzamazal-thinkpadp1gen7.tpbc.csb\n\t(ip-77-48-47-2.net.vodafone.cz. [77.48.47.2])\n\tby smtp.gmail.com with ESMTPSA id\n\t5b1f17b1804b1-4801fe78fcfsm21714655e9.19.2026.01.16.11.22.01\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 16 Jan 2026 11:22:02 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"XZJy4YbM\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1768591326;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tcontent-transfer-encoding:content-transfer-encoding:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=ibLMGgGaL05xGsEuqi2lNfqFFB1hOfAvpjC7dPL6I+s=;\n\tb=XZJy4YbMpD0VaizZLNYYC108HyZBGadCOrSGF/lWDCao7eapNaNGmfUpPV7WDNh31c1zUu\n\t3NJ+ROZDdrOoo0eDCahcUH6FwS2uFuCBesBLD6qA3OQ4pjdWUtckrbDmPA/S66D7NL2kKO\n\tgBqh6eKNeaFtnWRaA5ethmKFfzmY6V0=","X-MC-Unique":"w5PKc25vP_y92zkB0m5LHA-1","X-Mimecast-MFC-AGG-ID":"w5PKc25vP_y92zkB0m5LHA_1768591323","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1768591323; x=1769196123;\n\th=content-transfer-encoding:mime-version:user-agent:message-id:date\n\t:references:in-reply-to:subject:cc:to:from:x-gm-gg\n\t:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;\n\tbh=M1c9DPzFKubgfQ9qzeh7JQWMCDVbl7zXYpRMYRcC9B8=;\n\tb=kUVKy35n5jQjP4gNFGIlu3w/kPuKoZS/dsWhyVuT/ye+nNccOcCCrWEqoPTObqXKDy\n\tZ82oxS/tyKzONoYtfjAVKBUeoZH/0dQgiSH0cqyuVw+jakgOyM4ZBGM1URDJIFGJSUAu\n\t1QRPjHD3KRiZPfXPAcJ7XGmxim84GtzLpoT8eMXMrxvjLhbEkdwOg2nDBQfeMl1AYf8m\n\tFm4VTxTs3UZ5KD5+UtcXZDw51c+C04ukdnmZXeNCISuteZYCJ9ZnTamcHqfFKil/WPjF\n\twey/7ip6Z4976CG2i5A9bXWFsEPzE41Xpfc2ip2aNFR3g3rndU/jBzPlcuDmnYDXRVmq\n\twh2w==","X-Gm-Message-State":"AOJu0YxP5KTxBdWdX01YOP7YlRcyXZVxe2jiH8DQV6kJH9aIlY0Anuk1\n\tNBy9f+9mHz4G/VgHf6L52KzF6D1WnyZkqQvg21TSmFgUGGTgFHNCOabzqnpCtnXedeQ36ZDHUAH\n\tQsjqF8IaZ9yUBMHaSak30xUzJEafy69i94W8HRowhbyMSPwDj3K8sXzcFNMExom+gX7WkxFE/JK\n\tBxPFyXrzs=","X-Gm-Gg":"AY/fxX6dq5PXqL4B/cre2bQHjksttOOM1R3wcK0+RWljoBf+4T/WgZK4lXEswFu+Kwl\n\tatxLMZogZxsJ5dfmzcB0eLQNGGBGv5Q3EZgY0CZ1X3oIfwyBRoqfLFb65UHCR6o6egf1/b5EArF\n\tLqYm6jxE2joZleBMOPjscIha9Pgg/OG7Ke1nPAdbSxgY89Qz/HfHKGdwrCTXykvZ3BasK3uwhvM\n\testQl7Rhbgbey3110Xdu15Rw+PtZOuevNwRDmmft2RovCWG+2dKooy81+pwD3yLn3TBTFjHGkxD\n\tAXGJbXxJExvYK9X3JYWSBRga9gCdR5HXRvco1yz1FCwgG5WSkHISVZYsLxdquUMC01FaHQ1qHSC\n\tbAv0v4JEiyTNzLOmV02UB2aX40yiYVpWi+cx6q02IIafW68H33oLY8QPLhVMugJ4=","X-Received":["by 2002:a05:600c:3554:b0:47a:8154:33e3 with SMTP id\n\t5b1f17b1804b1-4801e34cac0mr44896285e9.28.1768591323230; \n\tFri, 16 Jan 2026 11:22:03 -0800 (PST)","by 2002:a05:600c:3554:b0:47a:8154:33e3 with SMTP id\n\t5b1f17b1804b1-4801e34cac0mr44896145e9.28.1768591322770; \n\tFri, 16 Jan 2026 11:22:02 -0800 (PST)"],"From":"Milan Zamazal <mzamazal@redhat.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org,  Kieran Bingham\n\t<kieran.bingham@ideasonboard.com>","Subject":"Re: [PATCH v3 09/14] libcamera: ipa: simple: Make gamma adjustable","In-Reply-To":"<aad72c36-3dbf-453a-8988-f11e3c7d0ed8@ideasonboard.com> (\n\t=?utf-8?b?IkJhcm5hYsOhcyBQxZFjemUiJ3M=?= message of \"Fri,\n\t16 Jan 2026  18:33:45 +0100\")","References":"<20260114113016.25162-1-mzamazal@redhat.com>\n\t<20260114113016.25162-10-mzamazal@redhat.com>\n\t<aad72c36-3dbf-453a-8988-f11e3c7d0ed8@ideasonboard.com>","Date":"Fri, 16 Jan 2026 20:22:01 +0100","Message-ID":"<85qzrp4b3a.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","User-Agent":"Gnus/5.13 (Gnus v5.13)","MIME-Version":"1.0","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"a1QRGjIqdrHUpEVxgNKSW2q7vNKTsjuZ771MaJXUWVw_1768591323","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"quoted-printable","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":37720,"web_url":"https://patchwork.libcamera.org/comment/37720/","msgid":"<6db3bad5-5583-4170-96a5-e53b30b57217@ideasonboard.com>","date":"2026-01-19T08:33:02","subject":"Re: [PATCH v3 09/14] 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. 16. 20:22 keltezéssel, Milan Zamazal írta:\n> Hi Barnabás,\n> \n> thank you for review.\n> \n> Barnabás Pőcze <barnabas.pocze@ideasonboard.com> writes:\n> \n>> 2026. 01. 14. 12:30 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.\n>>> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n>>> ---\n>>>    src/ipa/simple/algorithms/adjust.cpp |  8 ++++++++\n>>>    src/ipa/simple/algorithms/adjust.h   |  2 ++\n>>>    src/ipa/simple/algorithms/lut.cpp    | 12 +++++++-----\n>>>    src/ipa/simple/ipa_context.h         |  4 +++-\n>>>    4 files changed, 20 insertions(+), 6 deletions(-)\n>>> diff --git a/src/ipa/simple/algorithms/adjust.cpp b/src/ipa/simple/algorithms/adjust.cpp\n>>> index 27ae2a53a..cfbc39610 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>>>      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 = std::optional<double>();\n>>\n>> Is the `std::optional` necessary? I know that the others already use it,\n>> but it seems to me that doing `... = kDefaultGamma` would work just\n>> as well, no?\n> \n> Maybe there is a reason why it should be optional, see below.\n> \n>>>    \tcontext.activeState.knobs.contrast = std::optional<double>();\n>>>    \tcontext.activeState.knobs.saturation = std::optional<double>();\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;\n> \n> I wonder whether it should actually be:\n> \n>    context.activeState.knobs.gamma = controls.get(controls::Gamma);\n> \n> With the rationale that if the control stops providing a value\n> (possible?), the activeState value should get reset to the default\n> value.\n> \n> The same for the other controls here.\n\nDoesn't that mean that an application would have to continuously provide e.g.\nthe Gamma control otherwise it will go back to its default? If that is the case,\nthat does not match the current expectations, I think; which is that most controls\nare \"stateful\", it has to keep its last set value until the camera is stopped or\nthe control is modified, I believe.\n\n\n> \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>>> [...]\n> \n> A missing piece: The gamma value should be reported in metadata.\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 31453C3220\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 19 Jan 2026 08:33:10 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 145E261FC3;\n\tMon, 19 Jan 2026 09:33:09 +0100 (CET)","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 480C761F9F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 19 Jan 2026 09:33:07 +0100 (CET)","from [192.168.33.17] (185.221.143.114.nat.pool.zt.hu\n\t[185.221.143.114])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 32DAA2D9;\n\tMon, 19 Jan 2026 09:32:36 +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=\"su5GubMl\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1768811556;\n\tbh=/PGuTWKMwQCrqIjcDYnPnCgyXpumCSlZ9y0TaheB5xc=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=su5GubMl6ZF8kNGQ5txy1EsVKdzcX95SxNSg5XSK17+lvk/d5l6cHIbsvigy6VFSh\n\tY56z0GR8qiDtTPg/nslW+ycmIU86d+6/FttF92zxdUTgOC9by0wKCI2ZHrQiOxYykw\n\ta1XLkjOfZh0A4ocVxXhg9sxXZbxE+GlXyGz7Uk6w=","Message-ID":"<6db3bad5-5583-4170-96a5-e53b30b57217@ideasonboard.com>","Date":"Mon, 19 Jan 2026 09:33:02 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v3 09/14] libcamera: ipa: simple: Make gamma adjustable","To":"Milan Zamazal <mzamazal@redhat.com>, =?utf-8?b?QmFybmFiw6FzIFDFkWN6?=\n\t=?utf-8?q?e?= <barnabas.pocze@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>","References":"<20260114113016.25162-1-mzamazal@redhat.com>\n\t<20260114113016.25162-10-mzamazal@redhat.com>\n\t<aad72c36-3dbf-453a-8988-f11e3c7d0ed8@ideasonboard.com>\n\t<Fn4aWUD1gJyI3AKGmIKeyxBm-EwK0sJZoqg8_CPG29DmqXcsBQHfPC-N63HfMNcXu756QZ63DPQ9HgcP4WF1Jw==@protonmail.internalid>\n\t<85qzrp4b3a.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<85qzrp4b3a.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","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>"}},{"id":37725,"web_url":"https://patchwork.libcamera.org/comment/37725/","msgid":"<85tswh3j84.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","date":"2026-01-19T12:00:43","subject":"Re: [PATCH v3 09/14] libcamera: ipa: simple: Make gamma adjustable","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Barnabás Pőcze <barnabas.pocze@ideasonboard.com> writes:\n\n> 2026. 01. 16. 20:22 keltezéssel, Milan Zamazal írta:\n>> Hi Barnabás,\n>> thank you for review.\n>> Barnabás Pőcze <barnabas.pocze@ideasonboard.com> writes:\n>> \n>>> 2026. 01. 14. 12:30 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.\n>>>> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n>>>> ---\n>>>>    src/ipa/simple/algorithms/adjust.cpp |  8 ++++++++\n>>>>    src/ipa/simple/algorithms/adjust.h   |  2 ++\n>>>>    src/ipa/simple/algorithms/lut.cpp    | 12 +++++++-----\n>>>>    src/ipa/simple/ipa_context.h         |  4 +++-\n>>>>    4 files changed, 20 insertions(+), 6 deletions(-)\n>>>> diff --git a/src/ipa/simple/algorithms/adjust.cpp b/src/ipa/simple/algorithms/adjust.cpp\n>>>> index 27ae2a53a..cfbc39610 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>>>>      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 = std::optional<double>();\n>>>\n>>> Is the `std::optional` necessary? I know that the others already use it,\n>>> but it seems to me that doing `... = kDefaultGamma` would work just\n>>> as well, no?\n>> Maybe there is a reason why it should be optional, see below.\n>> \n>>>>    \tcontext.activeState.knobs.contrast = std::optional<double>();\n>>>>    \tcontext.activeState.knobs.saturation = std::optional<double>();\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;\n>> I wonder whether it should actually be:\n>>    context.activeState.knobs.gamma = controls.get(controls::Gamma);\n>> With the rationale that if the control stops providing a value\n>> (possible?), the activeState value should get reset to the default\n>> value.\n>> The same for the other controls here.\n>\n> Doesn't that mean that an application would have to continuously provide e.g.\n> the Gamma control otherwise it will go back to its default? If that is the case,\n> that does not match the current expectations, I think; which is that most controls\n> are \"stateful\", it has to keep its last set value until the camera is stopped or\n> the control is modified, I believe.\n\nThank you for clarification.  Then indeed, I can't see a reason to have\nit optional.\n\n>> \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>>>> [...]\n>> A missing piece: The gamma value should be reported in metadata.\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 9B185BDCBF\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 19 Jan 2026 12:00:51 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C6C8A61FBC;\n\tMon, 19 Jan 2026 13:00:50 +0100 (CET)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.133.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 01106606D5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 19 Jan 2026 13:00:48 +0100 (CET)","from mail-wr1-f72.google.com (mail-wr1-f72.google.com\n\t[209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-676-bsMTavz7M9WlemynTdvJQA-1; Mon, 19 Jan 2026 07:00:46 -0500","by mail-wr1-f72.google.com with SMTP id\n\tffacd0b85a97d-43284f60a8aso3749063f8f.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 19 Jan 2026 04:00:46 -0800 (PST)","from mzamazal-thinkpadp1gen7.tpbc.csb\n\t(ip-77-48-47-2.net.vodafone.cz. [77.48.47.2])\n\tby smtp.gmail.com with ESMTPSA id\n\t5b1f17b1804b1-4801fdefed9sm83326595e9.3.2026.01.19.04.00.43\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 19 Jan 2026 04:00:44 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"bPAL5SEs\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1768824047;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tcontent-transfer-encoding:content-transfer-encoding:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=uVzKmxde6RU5NUAfTBrbqfwq4x4/fxyQJxh92J25jw0=;\n\tb=bPAL5SEsRcO0jLhoIvSf/kyZjrNEOCrAbkwfJtyNPgMxC7Zx4/xzKBvpffx4gtP7rMGL0l\n\ty0bXvAozVGBqip28Gyc4EfopbraDg/2qeE4501ZbO0TQ0g2NWDysrZsNzGEpiEQGhGLD/q\n\thCUuiqoMXei8TzO31ooDRpfa2zBrmec=","X-MC-Unique":"bsMTavz7M9WlemynTdvJQA-1","X-Mimecast-MFC-AGG-ID":"bsMTavz7M9WlemynTdvJQA_1768824045","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1768824045; x=1769428845;\n\th=content-transfer-encoding:mime-version:user-agent:message-id:date\n\t:references:in-reply-to:subject:cc:to:from:x-gm-gg\n\t:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;\n\tbh=jv4TouMQGtEwei/bxOrsNSfgmy1sas5oLqkdH6W7ZtY=;\n\tb=UQWnM+Worca7SEBQjtbLflK+se4t6Lzc5fbq1Zajvqc89GhPfd7j4v4PzPoTkV6MGA\n\tu8bODMPeS0OIst6Y008ej9vxL8VUcGeFr6732eoaTWgcDKKOit8jGnQ1JyUOq0j6oeLS\n\t4aIcBR+j9rkVFezG7K9EQ/JbGBlcKb71dcpcDHcYMmVQaKr1nWE3KqhEqgsTNZgv/zYC\n\t2QlXguooWZDx9iVLeE6kncQgDDqRCepkhZz0gTDG2eyxfiPVKd0X9uYpIQ/R8zZjr2Fj\n\tUYDJ9VVc47gj9aM4Dy1k0x+80XgeYbMRejD4H3x5OshNnICTJcH83i7l9zvllqwPIwyv\n\t5R7w==","X-Gm-Message-State":"AOJu0Yx1vO7q1LkbOB8wUbbD3jOsWKodl0T7NJjkatkHco1LrF7ySvh6\n\tzup9f95n1RFTaUTaxQv05lP5A/wbIrXEPjEjIGxL7n0hpLpRcgRX31kwhvsz3fn44k6Dvvb5Qb1\n\t+6b8rep31V0vVQjX5w+jUm87dFC0VzlkGZ4acDcHLqCaMF5E9QJeiPlIMjdUlhXDU0UtTCzqDfs\n\t4=","X-Gm-Gg":"AY/fxX7I+3GP1T5jvsUYZgdcloe3CpRfZUYPO+2BlUe4+VbbnQiI/3YgCzX8QWMa1wq\n\ttn5LFnNSpMXaE9J6MokZePq1FzLYXkAJx/X9hEDOnuMHa5TaJO9ha/02iOFRrrBJQMc7TYOOYbJ\n\tkt/Mff8J+tZYQaRmFoFBHdKD+7dhhe1t8o4U/VdPohN2WfbYWjTYmUw097y67UCMv5KWFABF2Po\n\t7+C6v9PQ705swnAk9i35x7fJKLS4cDSxk2wUgTrKWFTL27C5meSBU+FMQcraC71Z5G9aP0NjdoY\n\tJmGjbBoAey+hSqQ35cGrA0SB9vwp9BfmynMg1RG15sd5kkE3ecURq8GxMkWlWbapsn2bj24eObM\n\toJzVh6dPhzBh3J/vLOMhq9CVc56HftBazRp6NeKKh1y0TsEAd3nL9mEnzdqQJznU=","X-Received":["by 2002:a05:600c:8a1a:10b0:480:1f6b:d495 with SMTP id\n\t5b1f17b1804b1-4801f6bd602mr99817235e9.32.1768824045283; \n\tMon, 19 Jan 2026 04:00:45 -0800 (PST)","by 2002:a05:600c:8a1a:10b0:480:1f6b:d495 with SMTP id\n\t5b1f17b1804b1-4801f6bd602mr99816745e9.32.1768824044851; \n\tMon, 19 Jan 2026 04:00:44 -0800 (PST)"],"From":"Milan Zamazal <mzamazal@redhat.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org,  Kieran Bingham\n\t<kieran.bingham@ideasonboard.com>","Subject":"Re: [PATCH v3 09/14] libcamera: ipa: simple: Make gamma adjustable","In-Reply-To":"<6db3bad5-5583-4170-96a5-e53b30b57217@ideasonboard.com> (\n\t=?utf-8?b?IkJhcm5hYsOhcyBQxZFjemUiJ3M=?= message of \"Mon,\n\t19 Jan 2026  09:33:02 +0100\")","References":"<20260114113016.25162-1-mzamazal@redhat.com>\n\t<20260114113016.25162-10-mzamazal@redhat.com>\n\t<aad72c36-3dbf-453a-8988-f11e3c7d0ed8@ideasonboard.com>\n\t<Fn4aWUD1gJyI3AKGmIKeyxBm-EwK0sJZoqg8_CPG29DmqXcsBQHfPC-N63HfMNcXu756QZ63DPQ9HgcP4WF1Jw==@protonmail.internalid>\n\t<85qzrp4b3a.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>\n\t<6db3bad5-5583-4170-96a5-e53b30b57217@ideasonboard.com>","Date":"Mon, 19 Jan 2026 13:00:43 +0100","Message-ID":"<85tswh3j84.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","User-Agent":"Gnus/5.13 (Gnus v5.13)","MIME-Version":"1.0","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"fkywebUQjVKCDX9OhPo7UhIykwUx-pH7WsnZon8INM8_1768824045","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"quoted-printable","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":37765,"web_url":"https://patchwork.libcamera.org/comment/37765/","msgid":"<0ec91110-93f8-4b99-b1ef-de94ecf70cd3@ideasonboard.com>","date":"2026-01-20T15:41:38","subject":"Re: [PATCH v3 09/14] 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. 14. 12:30 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.\n> \n> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n> ---\n>   src/ipa/simple/algorithms/adjust.cpp |  8 ++++++++\n>   src/ipa/simple/algorithms/adjust.h   |  2 ++\n>   src/ipa/simple/algorithms/lut.cpp    | 12 +++++++-----\n>   src/ipa/simple/ipa_context.h         |  4 +++-\n>   4 files changed, 20 insertions(+), 6 deletions(-)\n> \n> diff --git a/src/ipa/simple/algorithms/adjust.cpp b/src/ipa/simple/algorithms/adjust.cpp\n> index 27ae2a53a..cfbc39610 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 = std::optional<double>();\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;\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\nI believe this is missing the reporting of `controls::Gamma` in the metadata.\n\n\n> diff --git a/src/ipa/simple/algorithms/adjust.h b/src/ipa/simple/algorithms/adjust.h\n> index c4baa2503..190d2079f 100644\n> --- a/src/ipa/simple/algorithms/adjust.h\n> +++ b/src/ipa/simple/algorithms/adjust.h\n> @@ -19,6 +19,8 @@ namespace libcamera {\n>   \n>   namespace ipa::soft::algorithms {\n>   \n> +const 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..25b188b91 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,8 @@ int Lut::configure(IPAContext &context,\n>   void Lut::updateGammaTable(IPAContext &context)\n>   {\n>   \tconst auto blackLevel = context.activeState.blc.level;\n> +\tconst auto gamma =\n> +\t\t1.0 / context.activeState.knobs.gamma.value_or(kDefaultGamma);\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 +54,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 +66,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 +133,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 58dcad290..680b72eb9 100644\n> --- a/src/ipa/simple/ipa_context.h\n> +++ b/src/ipa/simple/ipa_context.h\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> @@ -67,6 +67,7 @@ struct IPAActiveState {\n>   \tbool matrixChanged = false;\n>   \n>   \tstruct {\n> +\t\tstd::optional<float> gamma;\n>   \t\t/* 0..2 range, 1.0 = normal */\n>   \t\tstd::optional<double> contrast;\n>   \t\tstd::optional<float> saturation;\n> @@ -86,6 +87,7 @@ struct IPAFrameContext : public FrameContext {\n>   \t\tdouble blue;\n>   \t} gains;\n>   \n> +\tstd::optional<float> 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 1ACEEC3220\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 20 Jan 2026 15:41:45 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 44E6361FC5;\n\tTue, 20 Jan 2026 16:41:44 +0100 (CET)","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 36B6261FBF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 20 Jan 2026 16:41:42 +0100 (CET)","from [192.168.33.23] (185.221.143.114.nat.pool.zt.hu\n\t[185.221.143.114])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id CBE0E2169;\n\tTue, 20 Jan 2026 16:41:10 +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=\"vpIu/RJY\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1768923671;\n\tbh=nn/ZtGH7bYm3fi9XiapczVXD9HGR1VJjLNVMFMZ35mw=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=vpIu/RJYbkb2722U3nWLbKmUtWc1RPqL6tgD7A4BFbakivsKDFLCGJGbdrHUSmM/2\n\tI9u8G6LKtncA821Tldbtfak5MjPlAgvzwxBgi6oCggKtmwxCp38qVnwohNSs6Wd7s/\n\tFjv25nxJFS63KQeg5/wUzwblXGJwxaPcI6DeKBek=","Message-ID":"<0ec91110-93f8-4b99-b1ef-de94ecf70cd3@ideasonboard.com>","Date":"Tue, 20 Jan 2026 16:41:38 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v3 09/14] 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":"<20260114113016.25162-1-mzamazal@redhat.com>\n\t<20260114113016.25162-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":"<20260114113016.25162-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>"}},{"id":37769,"web_url":"https://patchwork.libcamera.org/comment/37769/","msgid":"<853440w70t.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","date":"2026-01-20T17:03:46","subject":"Re: [PATCH v3 09/14] libcamera: ipa: simple: Make gamma adjustable","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Barnabás Pőcze <barnabas.pocze@ideasonboard.com> writes:\n\n> 2026. 01. 14. 12:30 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.\n>> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n>> ---\n>>   src/ipa/simple/algorithms/adjust.cpp |  8 ++++++++\n>>   src/ipa/simple/algorithms/adjust.h   |  2 ++\n>>   src/ipa/simple/algorithms/lut.cpp    | 12 +++++++-----\n>>   src/ipa/simple/ipa_context.h         |  4 +++-\n>>   4 files changed, 20 insertions(+), 6 deletions(-)\n>> diff --git a/src/ipa/simple/algorithms/adjust.cpp b/src/ipa/simple/algorithms/adjust.cpp\n>> index 27ae2a53a..cfbc39610 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>>     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 = std::optional<double>();\n>>   \tcontext.activeState.knobs.contrast = std::optional<double>();\n>>   \tcontext.activeState.knobs.saturation = std::optional<double>();\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;\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>\n> I believe this is missing the reporting of `controls::Gamma` in the metadata.\n\nYes, I've already mentioned that and I'll add it.\n\n>> diff --git a/src/ipa/simple/algorithms/adjust.h b/src/ipa/simple/algorithms/adjust.h\n>> index c4baa2503..190d2079f 100644\n>> --- a/src/ipa/simple/algorithms/adjust.h\n>> +++ b/src/ipa/simple/algorithms/adjust.h\n>> @@ -19,6 +19,8 @@ namespace libcamera {\n>>     namespace ipa::soft::algorithms {\n>>   +const 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..25b188b91 100644\n>> --- a/src/ipa/simple/algorithms/lut.cpp\n>> +++ b/src/ipa/simple/algorithms/lut.cpp\n>> @@ -18,6 +18,8 @@\n>>     #include \"simple/ipa_context.h\"\n>>   +#include \"adjust.h\"\n>> +\n>>   namespace libcamera {\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>>     \treturn 0;\n>> @@ -37,6 +37,8 @@ int Lut::configure(IPAContext &context,\n>>   void Lut::updateGammaTable(IPAContext &context)\n>>   {\n>>   \tconst auto blackLevel = context.activeState.blc.level;\n>> +\tconst auto gamma =\n>> +\t\t1.0 / context.activeState.knobs.gamma.value_or(kDefaultGamma);\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 +54,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 +66,7 @@ void Lut::updateGammaTable(IPAContext &context)\n>>   \t\t\t  gammaTable[blackIndex]);\n>>   \t}\n>>   +\tcontext.activeState.gamma.gamma = gamma;\n>>   \tcontext.activeState.gamma.blackLevel = blackLevel;\n>>   \tcontext.activeState.gamma.contrastExp = contrastExp;\n>>   }\n>> @@ -131,7 +133,7 @@ void Lut::prepare(IPAContext &context,\n>>   \t\tcontext.activeState.matrixChanged = false;\n>>   \t}\n>>   -\tparams->gamma = context.configuration.gamma;\n>> +\tparams->gamma = context.activeState.gamma.gamma;\n>>   \tparams->contrastExp = context.activeState.gamma.contrastExp;\n>>   }\n>>   diff --git a/src/ipa/simple/ipa_context.h b/src/ipa/simple/ipa_context.h\n>> index 58dcad290..680b72eb9 100644\n>> --- a/src/ipa/simple/ipa_context.h\n>> +++ b/src/ipa/simple/ipa_context.h\n>> @@ -25,7 +25,6 @@ namespace libcamera {\n>>   namespace ipa::soft {\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>> @@ -67,6 +67,7 @@ struct IPAActiveState {\n>>   \tbool matrixChanged = false;\n>>     \tstruct {\n>> +\t\tstd::optional<float> gamma;\n>>   \t\t/* 0..2 range, 1.0 = normal */\n>>   \t\tstd::optional<double> contrast;\n>>   \t\tstd::optional<float> saturation;\n>> @@ -86,6 +87,7 @@ struct IPAFrameContext : public FrameContext {\n>>   \t\tdouble blue;\n>>   \t} gains;\n>>   +\tstd::optional<float> 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 79979C3220\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 20 Jan 2026 17:03:54 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A54B361FC9;\n\tTue, 20 Jan 2026 18:03:53 +0100 (CET)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.129.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 18D2A61A35\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 20 Jan 2026 18:03:51 +0100 (CET)","from mail-wm1-f70.google.com (mail-wm1-f70.google.com\n\t[209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-57-fiF0uFBOO6KjZSQofnLKYg-1; Tue, 20 Jan 2026 12:03:49 -0500","by mail-wm1-f70.google.com with SMTP id\n\t5b1f17b1804b1-4803e8b6007so5773835e9.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 20 Jan 2026 09:03:49 -0800 (PST)","from mzamazal-thinkpadp1gen7.tpbc.csb\n\t(ip-77-48-47-2.net.vodafone.cz. [77.48.47.2])\n\tby smtp.gmail.com with ESMTPSA id\n\t5b1f17b1804b1-4801fe12342sm114020785e9.5.2026.01.20.09.03.46\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 20 Jan 2026 09:03:47 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"QvZ3/uH/\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1768928631;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tcontent-transfer-encoding:content-transfer-encoding:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=iAqexpWOo63W67u0pqbpnhvlDIl06akqbFkSKSrkCqg=;\n\tb=QvZ3/uH/buAT7Ydxfx/YkCsIDHKo4OmfAGFt7ktPHIRa/QpmF8nx8innkPZPZq4vtTsSw5\n\t+c3nLMLYbIapkjD3fMPLKFi9PoJDQPosmhaLuOCaqPSysl7iiinAi25a4v5P0lt4MzETG6\n\tx4X2hpnI6qy05bxXgURptQl3e3VaE/E=","X-MC-Unique":"fiF0uFBOO6KjZSQofnLKYg-1","X-Mimecast-MFC-AGG-ID":"fiF0uFBOO6KjZSQofnLKYg_1768928629","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1768928628; x=1769533428;\n\th=content-transfer-encoding:mime-version:user-agent:message-id:date\n\t:references:in-reply-to:subject:cc:to:from:x-gm-gg\n\t:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;\n\tbh=GR1tk8x+QrmQoQg361ZrE/YLR8fzbgD9aArL/YTfp28=;\n\tb=r09QMFZoW8M2zwWwNr7LD8fDUmy1Nhi4kwelP0vzOrh6QKmNvGeUKHFaFwHUJ5qSYX\n\t+SuQbJUuKP45smr/NmpjyQUMYK9G9c+KLSzgSlQlpWeXqKjPiUbBScv04oRreHSxSuQ3\n\tzsvZIDErwOZA5w0ZybWmj9WwWqNRdtx9TgFs2Vagq6fsbp7kr3kWG5taxmqgh5WkYOOv\n\tLtaI5DpKe5110XmnVxBcFQyYHDs01LLHYP6pkr7hP+lXa+x8/+SaHU3S/AtNWcCc0N0N\n\tLZxC2NmaD7Jo7524FItY3Z82vqKpFRh1Qqgs6+v0LTfzM2489BTd8MfWEfuYagzc5MsB\n\tYDZg==","X-Gm-Message-State":"AOJu0Yz5E1QRT3yHXDOdIJrrLCHSixynMwTsMuG0RWSCE9fgwf/THA49\n\tZsOKbX79bqwdfGyX6yxnlM2HN2mdOxi8casZJvqgViu6R85RhnFfFWwqt9qBJKqLpVQi5ndJ+mt\n\tVr+FcMvcGQVUyPueJvikhBaOmWQPC2GUyOfI5SGbUE2LdNRNIHQoY+Z06/hyqN33zRL+6Ylp4U2\n\tgWJA2n9XM=","X-Gm-Gg":"AY/fxX71lzWWN+943IdMwcKOUWKR4ZzXPbpHZYtqWQLeyofOJD1zNUUHNqFZA7tvRao\n\tkaZwBaYqtLA/3/fLX0lN5+ZW0hKI29sQgcco9zsDZ2Y+V13wcE1a82LtJ8x3aUIl1RiXNihHYtw\n\tfcraMFMMdsOVf/+q7z3WTqCrrPfGk2uQ18sNeU+xkQ07KrW1I2cBRnu6cWDBI7HKcQ3L5OI/3KK\n\tsFy3ptUqreUiKNdBPK8gynlxp5PygW/2VU8Zg1NYXMPMieFy00wi7oOy2msxKpGNq6FrKVARqi4\n\tvkjRaxacxPI/WeqawImWnjxbUL7Fr5EAs3ElJ8j6zBmZy+QKnGaRpmG7jVBM8kSOckMHRVDi8fQ\n\tEMJw7Su82EQOkO1z5HI3AnsGBXcVtozbUewWtm0xvSg7xQJ+snllIZTsau1C9njI=","X-Received":["by 2002:a05:600c:4692:b0:46f:d682:3c3d with SMTP id\n\t5b1f17b1804b1-4803e7a4b90mr32846785e9.13.1768928628186; \n\tTue, 20 Jan 2026 09:03:48 -0800 (PST)","by 2002:a05:600c:4692:b0:46f:d682:3c3d with SMTP id\n\t5b1f17b1804b1-4803e7a4b90mr32846215e9.13.1768928627662; \n\tTue, 20 Jan 2026 09:03:47 -0800 (PST)"],"From":"Milan Zamazal <mzamazal@redhat.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org,  Kieran Bingham\n\t<kieran.bingham@ideasonboard.com>","Subject":"Re: [PATCH v3 09/14] libcamera: ipa: simple: Make gamma adjustable","In-Reply-To":"<0ec91110-93f8-4b99-b1ef-de94ecf70cd3@ideasonboard.com> (\n\t=?utf-8?b?IkJhcm5hYsOhcyBQxZFjemUiJ3M=?= message of \"Tue,\n\t20 Jan 2026  16:41:38 +0100\")","References":"<20260114113016.25162-1-mzamazal@redhat.com>\n\t<20260114113016.25162-10-mzamazal@redhat.com>\n\t<0ec91110-93f8-4b99-b1ef-de94ecf70cd3@ideasonboard.com>","Date":"Tue, 20 Jan 2026 18:03:46 +0100","Message-ID":"<853440w70t.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","User-Agent":"Gnus/5.13 (Gnus v5.13)","MIME-Version":"1.0","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"oVLIocFJB54LWq2zB-3e91nnEQ8wC6tUQibcU-Rs9k0_1768928629","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"quoted-printable","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":37801,"web_url":"https://patchwork.libcamera.org/comment/37801/","msgid":"<e4b8671e-614b-4b39-b1ce-70695e934708@ideasonboard.com>","date":"2026-01-21T15:22:39","subject":"Re: [PATCH v3 09/14] 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. 20. 18:03 keltezéssel, Milan Zamazal írta:\n> Barnabás Pőcze <barnabas.pocze@ideasonboard.com> writes:\n> \n>> 2026. 01. 14. 12:30 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.\n>>> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n>>> ---\n>>>    src/ipa/simple/algorithms/adjust.cpp |  8 ++++++++\n>>>    src/ipa/simple/algorithms/adjust.h   |  2 ++\n>>>    src/ipa/simple/algorithms/lut.cpp    | 12 +++++++-----\n>>>    src/ipa/simple/ipa_context.h         |  4 +++-\n>>>    4 files changed, 20 insertions(+), 6 deletions(-)\n>>> diff --git a/src/ipa/simple/algorithms/adjust.cpp b/src/ipa/simple/algorithms/adjust.cpp\n>>> index 27ae2a53a..cfbc39610 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>>>    @@ -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;\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>>\n>> I believe this is missing the reporting of `controls::Gamma` in the metadata.\n> \n> Yes, I've already mentioned that and I'll add it.\n\nOf course, you're right, sorry. I did not notice it in your other reply.","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 5818FBDCBF\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 21 Jan 2026 15:22:44 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0B15161FC9;\n\tWed, 21 Jan 2026 16:22:44 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id AEAB661F9F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 21 Jan 2026 16:22:42 +0100 (CET)","from [192.168.33.24] (185.221.143.114.nat.pool.zt.hu\n\t[185.221.143.114])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id C518F1C6;\n\tWed, 21 Jan 2026 16:22:10 +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=\"OaDoORcI\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1769008930;\n\tbh=uNL0fr1XVOfP433YtPb+kekJmfobns5GscWRQtId1JI=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=OaDoORcIQfGaY8n9mBdwk8vkLjMJDlEwJIGeLF9FGxDTnvHvZ0fxScJDNXZ4M7xju\n\twauMDE9Xr1lp5OnI7AoQc1kHsgk9AEosW978VkmULiZoyhsyG1YCYmO4nKje6fqVhM\n\taE5KhcB5dtVclmMcQeSJtmrPGLOKPMYb6LYXq8V8=","Message-ID":"<e4b8671e-614b-4b39-b1ce-70695e934708@ideasonboard.com>","Date":"Wed, 21 Jan 2026 16:22:39 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v3 09/14] libcamera: ipa: simple: Make gamma adjustable","To":"Milan Zamazal <mzamazal@redhat.com>","Cc":"libcamera-devel@lists.libcamera.org,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>","References":"<20260114113016.25162-1-mzamazal@redhat.com>\n\t<20260114113016.25162-10-mzamazal@redhat.com>\n\t<0ec91110-93f8-4b99-b1ef-de94ecf70cd3@ideasonboard.com>\n\t<853440w70t.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<853440w70t.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","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>"}}]