[{"id":29597,"web_url":"https://patchwork.libcamera.org/comment/29597/","msgid":"<171641585434.2920551.1427747112171857289@ping.linuxembedded.co.uk>","date":"2024-05-22T22:10:54","subject":"Re: [PATCH v2 2/4] libcamera: Add gamma control id","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Stefan Klug (2024-05-22 15:54:36)\n> A camera gamma of roughly 2.2 is necessary to produce correct output\n> images on a standard monitor. Add a control for that.\n> \n> Further information is available here:\n> https://en.wikipedia.org/wiki/SRGB\n> https://www.cambridgeincolour.com/tutorials/gamma-correction.htm\n> \n> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>\n> ---\n> \n> v1 -> v2:\n> - small change in description\n> \n>  src/libcamera/control_ids_core.yaml | 7 +++++++\n>  1 file changed, 7 insertions(+)\n> \n> diff --git a/src/libcamera/control_ids_core.yaml b/src/libcamera/control_ids_core.yaml\n> index bf1f1a83..303b0d32 100644\n> --- a/src/libcamera/control_ids_core.yaml\n> +++ b/src/libcamera/control_ids_core.yaml\n> @@ -243,6 +243,13 @@ controls:\n>          Specify a fixed contrast parameter. Normal contrast is given by the\n>          value 1.0; larger values produce images with more contrast.\n>  \n> +  - Gamma:\n> +      type: float\n> +      description:  |\n> +        Specify a fixed gamma value. Default must be 2.2 which closely mimics \n> +        sRGB gamma. Note that this is camera gamma, so it is applied as \n> +        1.0/gamma\n\nWill this interact with the existing 'Contrast' control at all ? Do they\nwork independently? Or are they otherwise related?\n\nI see src/ipa/rpi/controller/rpi/contrast provides the ability to modify\nthe gamma curve based on both a brightness and contrast manual control -\nso I think this tells me they are actually independent, and it's just\nthat the brightness and contrast handling are managed by applying\nchanges to the gamma curve on top of the configured gamma..\n\nI think I've already convinced myself that this is separate enough...\nBut I wonder what impact this will have for RPi who currently store a\ngamma curve directly in the tuning file. Presumably a manual control for\nGamma in that case would override the configured curve and regenerate a\nnew Pwl or such based on the gamma value... (not that it has to be\nadded there, if it's not reported as a supported control ...)\n\nI think I've satisfied myself on this for now, but I am curious to hear\nwhat David/Laurent's feedback will be on this control.\n\n\nBut still ... for me so far...\n\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n\n> +\n>    - Lux:\n>        type: float\n>        description: |\n> -- \n> 2.40.1\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 BB6D0BD87C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 22 May 2024 22:11:38 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D374A63499;\n\tThu, 23 May 2024 00:11:34 +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 1DCDC61A55\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 23 May 2024 00:11:20 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 26C3F475;\n\tThu, 23 May 2024 00:10:44 +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=\"nJUZPtym\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1716415844;\n\tbh=dHmCsDaBBQ+7fbNWBmmQpC0R4WITwZMfIr7ULcw/hsA=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=nJUZPtymDo0vwZ3pMJTaZCDbvFjigNRVCmN0r5xpgI3cv2vv48+oRVFC5/zb/lP8V\n\ts0rYt63BOvICZlCxLQt3+zhHJLg66FJTXPGCq2OIUfuLbITflaLewL8+CVsj4laN6D\n\tEssbtCNXh+XB0aaSqFDNxprcT5GQBdwnKFqYNzlo=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20240522145438.436688-3-stefan.klug@ideasonboard.com>","References":"<20240522145438.436688-1-stefan.klug@ideasonboard.com>\n\t<20240522145438.436688-3-stefan.klug@ideasonboard.com>","Subject":"Re: [PATCH v2 2/4] libcamera: Add gamma control id","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Stefan Klug <stefan.klug@ideasonboard.com>,\n\tDaniel Scally <dan.scally@ideasonboard.com>","To":"Stefan Klug <stefan.klug@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Wed, 22 May 2024 23:10:54 +0100","Message-ID":"<171641585434.2920551.1427747112171857289@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","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>"}}]