Show a patch.

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

{
    "id": 19141,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/19141/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/19141/",
    "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": "<20231013074841.16972-18-naush@raspberrypi.com>",
    "date": "2023-10-13T07:48:38",
    "name": "[libcamera-devel,v2,17/20] ipa: rpi: contrast: Allow adaptive contrast enhancement to be disabled",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "5ef192b5d007de35fe1d3e0ee96fa66fd5e9b261",
    "submitter": {
        "id": 34,
        "url": "https://patchwork.libcamera.org/api/1.1/people/34/?format=api",
        "name": "Naushir Patuck",
        "email": "naush@raspberrypi.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/19141/mbox/",
    "series": [
        {
            "id": 4049,
            "url": "https://patchwork.libcamera.org/api/1.1/series/4049/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4049",
            "date": "2023-10-13T07:48:21",
            "name": "Raspberry Pi: Preliminary PiSP support",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/4049/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/19141/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/19141/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 228B7C32C1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 13 Oct 2023 07:49:09 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B8931629AA;\n\tFri, 13 Oct 2023 09:49:08 +0200 (CEST)",
            "from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com\n\t[IPv6:2a00:1450:4864:20::32b])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 48D45629A2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 13 Oct 2023 09:48:59 +0200 (CEST)",
            "by mail-wm1-x32b.google.com with SMTP id\n\t5b1f17b1804b1-405361bb9f7so19232215e9.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 13 Oct 2023 00:48:59 -0700 (PDT)",
            "from localhost.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\tm16-20020a7bca50000000b003fee6e170f9sm1791890wml.45.2023.10.13.00.48.57\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 13 Oct 2023 00:48:58 -0700 (PDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1697183348;\n\tbh=BVzzOqrgaQi3OOBwyfJcTJA7cdtOwtsPIxk8KKuR/zU=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=jayeQbMFPbkAKFDiAbgsUluec8SNoTzDkw15xqb9jiwHy+l3KW4TfQtkTvfIM0iWX\n\t4eSHrNZtAzyWPSAj+SEq4TDTmVV3I/OHIWZj31wfF0WdCXdCx/m23rkyv6nEXG0Cvd\n\ta8mfUe0p+KNgNjzza3t+DO9TB5R6YKnoRx75FMluXLjQ8ptGrGS5KdCq+EagP37ILD\n\tZw91onrteMm39O47JbOvChaeGvYjfXg9J4bCky9u9ahNWwN5i8AhNUSZ/NNrEn4Ukg\n\tslRYa63/rCWm8rC7ZvtsxCMMD5eedgjLSs6SxUQ56PrCIwGBtBnsllG/+/SveHgBSV\n\t4iwyF1vpiJIsg==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1697183338; x=1697788138;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=1blZHZTcVda6hrHqBicD9uRzvwISRZzuZpzkStU5tQo=;\n\tb=lze3JkQ9veRQ2GFQhjUgjG5bmygMwvpmfPIF7JZtun3JITObjL8Y3Fu2EyZnHul5b6\n\tDxmlLZ2Ian3DjveymmEueMqVFYJYyZPJsS2ReKom87htHkAu1X6x4oyCZrqjQJHRmsZI\n\thFJ8md3kT1M4ktl1A/h/xFbpknGdcnj4tILwNdoLq+neo9Yimb+LANwTJ411mmy7gT8O\n\tshGUQNMBGcUpwbap9GbzvwJRQ/RnZ/TSFDQbWctlMWTsiVwc1u93zdZ4GoYCPHKaQ8K4\n\tYDYD2pWzaR5Kdwi72GvZUWMREx2bQ1cT5ShgIa5oMXuZS/0/UuySDEZ17WqYSNv96ekb\n\t9BXA=="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"lze3JkQ9\"; dkim-atps=neutral",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1697183338; x=1697788138;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=1blZHZTcVda6hrHqBicD9uRzvwISRZzuZpzkStU5tQo=;\n\tb=soDjX5OS2wAkYq0e4ldzc//6P8q6LX52AYHac6ZxahZ1lDa7kX7pcXtgPC/TcVwviH\n\t1k9h2VKY0kXrIjhfwvb8nV3I92z3uVFc/DtLW3IeqABdpB+7q+sJsuIFznW1O5BZMxQR\n\tjc1FnFq+q87tGtGzN3Uq5BsabZcpod7LlQCLBSJAHNLORgGkV3sXlMhzZlSmQa/FqADx\n\tuJ4Ye/77Naa/G/NLW4arATOXIigjT3TzaFNnixzQ0pfTDzYDRXFFWMYSV8bIoLGd7AAW\n\tc6ZmErI3LlPnFNJWS1U0eBwKw4XqbIEeqALnOekIIx6bLX7C9EIbOc63Kv9INpcHgEDd\n\tYh6Q==",
        "X-Gm-Message-State": "AOJu0YyBQbifFG+p2thldhRKBvYYJE+NtkUomXdkZR8WN8l2k+sA0iTp\n\t2f+1LMkoVOnzNHMkr7vaqm2o+UALKM0k860xrtpzpg==",
        "X-Google-Smtp-Source": "AGHT+IHM+LJfWfg+jjk/jtUZvVjq8/xJs4dS03UyHWIOjejYOnjU1kfyNM7K9NqkMcwfVUnx9YpHWA==",
        "X-Received": "by 2002:a7b:cb8b:0:b0:3fb:e189:3532 with SMTP id\n\tm11-20020a7bcb8b000000b003fbe1893532mr22844142wmi.20.1697183338702; \n\tFri, 13 Oct 2023 00:48:58 -0700 (PDT)",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Fri, 13 Oct 2023 08:48:38 +0100",
        "Message-Id": "<20231013074841.16972-18-naush@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "In-Reply-To": "<20231013074841.16972-1-naush@raspberrypi.com>",
        "References": "<20231013074841.16972-1-naush@raspberrypi.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v2 17/20] ipa: rpi: contrast: Allow\n\tadaptive contrast enhancement to be disabled",
        "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>",
        "From": "Naushir Patuck via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>",
        "Reply-To": "Naushir Patuck <naush@raspberrypi.com>",
        "Cc": "Jacopo Mondi <jacopo.mondi@ideasonboard.com>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "From: David Plowman <david.plowman@raspberrypi.com>\n\nThe enableCe() function enables or disables adaptive contrast\nenhancement and the restoreCe() function sets it back to its normal\nstate (which is what was read from the tuning file).\n\nIn future, algorithms like HDR might want to take over tonemapping\nfunctions, so any dynamic behaviour here would upset them.\n\nSigned-off-by: David Plowman <david.plowman@raspberrypi.com>\nReviewed-by: Naushir Patuck <naush@raspberrypi.com>\nReviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n---\n src/ipa/rpi/controller/contrast_algorithm.h |  2 ++\n src/ipa/rpi/controller/rpi/contrast.cpp     | 13 ++++++++++++-\n src/ipa/rpi/controller/rpi/contrast.h       |  3 +++\n 3 files changed, 17 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/src/ipa/rpi/controller/contrast_algorithm.h b/src/ipa/rpi/controller/contrast_algorithm.h\nindex ce17a4f949b9..895b36b0a80f 100644\n--- a/src/ipa/rpi/controller/contrast_algorithm.h\n+++ b/src/ipa/rpi/controller/contrast_algorithm.h\n@@ -17,6 +17,8 @@ public:\n \t/* A contrast algorithm must provide the following: */\n \tvirtual void setBrightness(double brightness) = 0;\n \tvirtual void setContrast(double contrast) = 0;\n+\tvirtual void enableCe(bool enable) = 0;\n+\tvirtual void restoreCe() = 0;\n };\n \n } /* namespace RPiController */\ndiff --git a/src/ipa/rpi/controller/rpi/contrast.cpp b/src/ipa/rpi/controller/rpi/contrast.cpp\nindex bee1eadd3657..4e038a021d8a 100644\n--- a/src/ipa/rpi/controller/rpi/contrast.cpp\n+++ b/src/ipa/rpi/controller/rpi/contrast.cpp\n@@ -42,6 +42,7 @@ int Contrast::read(const libcamera::YamlObject &params)\n {\n \t// enable adaptive enhancement by default\n \tconfig_.ceEnable = params[\"ce_enable\"].get<int>(1);\n+\tceEnable_ = config_.ceEnable;\n \t// the point near the bottom of the histogram to move\n \tconfig_.loHistogram = params[\"lo_histogram\"].get<double>(0.01);\n \t// where in the range to try and move it to\n@@ -65,6 +66,16 @@ void Contrast::setContrast(double contrast)\n \tcontrast_ = contrast;\n }\n \n+void Contrast::enableCe(bool enable)\n+{\n+\tceEnable_ = enable;\n+}\n+\n+void Contrast::restoreCe()\n+{\n+\tceEnable_ = config_.ceEnable;\n+}\n+\n void Contrast::initialise()\n {\n \t/*\n@@ -150,7 +161,7 @@ void Contrast::process(StatisticsPtr &stats,\n \t * histogram down, and possibly push the end up.\n \t */\n \tPwl gammaCurve = config_.gammaCurve;\n-\tif (config_.ceEnable) {\n+\tif (ceEnable_) {\n \t\tif (config_.loMax != 0 || config_.hiMax != 0)\n \t\t\tgammaCurve = computeStretchCurve(histogram, config_).compose(gammaCurve);\n \t\t/*\ndiff --git a/src/ipa/rpi/controller/rpi/contrast.h b/src/ipa/rpi/controller/rpi/contrast.h\nindex 9c81277a0450..59aa70dceeb9 100644\n--- a/src/ipa/rpi/controller/rpi/contrast.h\n+++ b/src/ipa/rpi/controller/rpi/contrast.h\n@@ -37,6 +37,8 @@ public:\n \tint read(const libcamera::YamlObject &params) override;\n \tvoid setBrightness(double brightness) override;\n \tvoid setContrast(double contrast) override;\n+\tvoid enableCe(bool enable) override;\n+\tvoid restoreCe() override;\n \tvoid initialise() override;\n \tvoid prepare(Metadata *imageMetadata) override;\n \tvoid process(StatisticsPtr &stats, Metadata *imageMetadata) override;\n@@ -46,6 +48,7 @@ private:\n \tdouble brightness_;\n \tdouble contrast_;\n \tContrastStatus status_;\n+\tdouble ceEnable_;\n };\n \n } /* namespace RPiController */\n",
    "prefixes": [
        "libcamera-devel",
        "v2",
        "17/20"
    ]
}