Show a patch.

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

{
    "id": 9434,
    "url": "https://patchwork.libcamera.org/api/patches/9434/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/9434/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/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": "<20200829115429.30010-9-david.plowman@raspberrypi.com>",
    "date": "2020-08-29T11:54:29",
    "name": "[libcamera-devel,v5,8/8] libcamera: ipa: raspberrypi: ALSC: Handle user transform",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "925b363fef36d092def50ce22ca02dce4058de08",
    "submitter": {
        "id": 42,
        "url": "https://patchwork.libcamera.org/api/people/42/?format=api",
        "name": "David Plowman",
        "email": "david.plowman@raspberrypi.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/9434/mbox/",
    "series": [
        {
            "id": 1252,
            "url": "https://patchwork.libcamera.org/api/series/1252/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1252",
            "date": "2020-08-29T11:54:21",
            "name": "2D transforms",
            "version": 5,
            "mbox": "https://patchwork.libcamera.org/series/1252/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/9434/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/9434/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 650E8BF019\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat, 29 Aug 2020 11:54:45 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2DE1662949;\n\tSat, 29 Aug 2020 13:54:45 +0200 (CEST)",
            "from mail-wr1-x443.google.com (mail-wr1-x443.google.com\n\t[IPv6:2a00:1450:4864:20::443])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 94D466293D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 29 Aug 2020 13:54:41 +0200 (CEST)",
            "by mail-wr1-x443.google.com with SMTP id w5so1545533wrp.8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 29 Aug 2020 04:54:41 -0700 (PDT)",
            "from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72])\n\tby smtp.gmail.com with ESMTPSA id\n\tv16sm3071523wmj.14.2020.08.29.04.54.40\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tSat, 29 Aug 2020 04:54:40 -0700 (PDT)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"Uc2eS+Zh\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=yqzzfDnOwH0Awzrjn/UOHYIemK1WmVNHkZJX33QDD+s=;\n\tb=Uc2eS+ZhSzmHaCXNo5noUxlX+hYu0qMKw7cPflvDH2sRPBhFGcLi4334Qxt6ChNE9y\n\tGRxJZaS4dXnpUMSxlvD999iQOOqaVEUUo2H1Qk3bdFX/MJKiu5ryQ4el1Y13xJ7CrIt9\n\t/K0iiG5XI0ryZt2tloDpE/oN8Wq1n36XjZxcSA2OuH/ytQSoo2os1OgKnzTeitOWZVJC\n\tE5dMAGFcF6x56wSvwGupqeA9qpL+duP5jK2tyx5Uh9G+Q04u6LkwrARl0COxjXpUYC5n\n\tKB7Iiw5+xWgYoRbHZdF5KAT7h8tMQUBeg0Mza7Wt6xkH3KPXdDMcbldh+psEL/5syqVq\n\tslNA==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=yqzzfDnOwH0Awzrjn/UOHYIemK1WmVNHkZJX33QDD+s=;\n\tb=jB3DmbFU8UsIBICoDo7XnJYCZsDn1dU/Cu0YC6pMH9Yg7+IXw3glbwn4wUmKXC7DQT\n\trq2XBQY6GUc0hEf4SiKYkD1W1md8AnTchhjmiZtDJ0RLJ7Hqlpc1JP3zjYt+NUyatFp+\n\tUGj+bvrjTfyBYmsO7lD7XEJsTMgV5PX/AmWIHl+KpzSM17e0jY/15/JgL957Mk3q/Dqe\n\tJ/mRm1DCzBFglU5yQgNuXEiWH9sXIOqYI1dgYO+8hInZsZ1F3YIkF/XVqF4BPkD06T5y\n\ttMQ4VQahJWYS9AnSHr/PmMDHlgaY0Jy+KHdDCnY06RS8dO2nqstFbus9tsOnJlF5Lcit\n\tZvZg==",
        "X-Gm-Message-State": "AOAM531Rm48ojDH5eSDjrrh4RxMgCCU8SD0oFRYJmGGrmUpFPFBLv743\n\ts+fyz8vT2H+qo0pDggJGp19qRV9n5pOQiA==",
        "X-Google-Smtp-Source": "ABdhPJwKKElD/Gy7KFniGN8PUW+FAbFYeS8r+8DWQv4tO4pzn+3SZ3bxgSt8kdGNUx2p4+bQGjDpWQ==",
        "X-Received": "by 2002:adf:a48d:: with SMTP id\n\tg13mr3227683wrb.212.1598702081052; \n\tSat, 29 Aug 2020 04:54:41 -0700 (PDT)",
        "From": "David Plowman <david.plowman@raspberrypi.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Sat, 29 Aug 2020 12:54:29 +0100",
        "Message-Id": "<20200829115429.30010-9-david.plowman@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20200829115429.30010-1-david.plowman@raspberrypi.com>",
        "References": "<20200829115429.30010-1-david.plowman@raspberrypi.com>",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH v5 8/8] libcamera: ipa: raspberrypi: ALSC:\n\tHandle user transform",
        "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>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Update ALSC (Auto Lens Shading Correction) to handle correctly the\nuser transform now passed in the camera mode.\n\nThe user transform is applied directly in the sensor so the image\nstatistics already incorporate it, and the adaptive algorithm is\nentirely agnostic towards it, so all we have to do is flip the\ncalibrated tables to match. (These tables will have been calibrated\nwithout the user transform.)\n\nSigned-off-by: David Plowman <david.plowman@raspberrypi.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/ipa/raspberrypi/controller/rpi/alsc.cpp | 13 ++++++++++++-\n 1 file changed, 12 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/src/ipa/raspberrypi/controller/rpi/alsc.cpp b/src/ipa/raspberrypi/controller/rpi/alsc.cpp\nindex 0d0e0b0..f610de2 100644\n--- a/src/ipa/raspberrypi/controller/rpi/alsc.cpp\n+++ b/src/ipa/raspberrypi/controller/rpi/alsc.cpp\n@@ -184,7 +184,10 @@ void Alsc::waitForAysncThread()\n \n static bool compare_modes(CameraMode const &cm0, CameraMode const &cm1)\n {\n-\t// Return true if the modes crop from the sensor significantly differently.\n+\t// Return true if the modes crop from the sensor significantly differently,\n+\t// or if the user transform has changed.\n+\tif (cm0.transform != cm1.transform)\n+\t\treturn true;\n \tint left_diff = abs(cm0.crop_x - cm1.crop_x);\n \tint top_diff = abs(cm0.crop_y - cm1.crop_y);\n \tint right_diff = fabs(cm0.crop_x + cm0.scale_x * cm0.width -\n@@ -428,6 +431,10 @@ void resample_cal_table(double const cal_table_in[XY],\n \t\txf[i] = x - x_lo[i];\n \t\tx_hi[i] = std::min(x_lo[i] + 1, X - 1);\n \t\tx_lo[i] = std::max(x_lo[i], 0);\n+\t\tif (!!(camera_mode.transform & libcamera::Transform::HFlip)) {\n+\t\t\tx_lo[i] = X - 1 - x_lo[i];\n+\t\t\tx_hi[i] = X - 1 - x_hi[i];\n+\t\t}\n \t}\n \t// Now march over the output table generating the new values.\n \tdouble scale_y = camera_mode.sensor_height /\n@@ -440,6 +447,10 @@ void resample_cal_table(double const cal_table_in[XY],\n \t\tdouble yf = y - y_lo;\n \t\tint y_hi = std::min(y_lo + 1, Y - 1);\n \t\ty_lo = std::max(y_lo, 0);\n+\t\tif (!!(camera_mode.transform & libcamera::Transform::VFlip)) {\n+\t\t\ty_lo = Y - 1 - y_lo;\n+\t\t\ty_hi = Y - 1 - y_hi;\n+\t\t}\n \t\tdouble const *row_above = cal_table_in + X * y_lo;\n \t\tdouble const *row_below = cal_table_in + X * y_hi;\n \t\tfor (int i = 0; i < X; i++) {\n",
    "prefixes": [
        "libcamera-devel",
        "v5",
        "8/8"
    ]
}