Show a patch.

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

{
    "id": 10796,
    "url": "https://patchwork.libcamera.org/api/patches/10796/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/10796/",
    "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": "<20201231155336.7058-3-sebastian.fricke.linux@gmail.com>",
    "date": "2020-12-31T15:53:34",
    "name": "[libcamera-devel,v2,2/4] libcamera: Overload ==/!= operators for BayerFormats",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "cb21140f0ca9ff69cba37ab36a82e453ba791d9a",
    "submitter": {
        "id": 73,
        "url": "https://patchwork.libcamera.org/api/people/73/?format=api",
        "name": "Sebastian Fricke",
        "email": "sebastian.fricke.linux@gmail.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/10796/mbox/",
    "series": [
        {
            "id": 1564,
            "url": "https://patchwork.libcamera.org/api/series/1564/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1564",
            "date": "2020-12-31T15:53:32",
            "name": "Improve BayerFormat class",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/1564/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/10796/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/10796/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 687A7C0F1A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 31 Dec 2020 15:54:34 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 33855615B2;\n\tThu, 31 Dec 2020 16:54:34 +0100 (CET)",
            "from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com\n\t[IPv6:2a00:1450:4864:20::42b])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 768346031D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 31 Dec 2020 16:54:32 +0100 (CET)",
            "by mail-wr1-x42b.google.com with SMTP id i9so20397581wrc.4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 31 Dec 2020 07:54:32 -0800 (PST)",
            "from basti-TUXEDO-Book-XA1510.fritz.box\n\t(p200300d1ff267500b10aabf0e84cdf75.dip0.t-ipconnect.de.\n\t[2003:d1:ff26:7500:b10a:abf0:e84c:df75])\n\tby smtp.gmail.com with ESMTPSA id\n\ts63sm14595787wms.18.2020.12.31.07.54.31\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 31 Dec 2020 07:54:31 -0800 (PST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"osYXTBqp\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=lPJc7eMqmCuuqQDJUp+L5inJ3xbXv9i5YL4l+Jypyu4=;\n\tb=osYXTBqpexYfFDs2+fLXx+YVp0zDKqAGffZAdqFbLpmxA5etMGfzxRj/8c6Cm+qHZq\n\tLQJt+oMwPjAr1p4MaWmZG2sNzIMBdGgVD2Yn3xogK8XwW3E7oPUCcwnfx13jU8PkuIaN\n\tZFEG7VCR9XnY3sUlu4YmRyKlrlZ/zBf70CCZc0NwMayfMfa/h79xcXSbvxMCP48O1vcG\n\tjNWcvng6q3/YomKlGA8CE5QY7rKNCLlhzUEN20DQNQINMl4vNbsRVT2ouoFf7b/e+9gh\n\tf2VIM5ot2+HWyGYw8OaTWHlDBy7ry7adohN2Wsn/8qQYn8JdMKySx19xhAaZ4+mEw0Of\n\t8hbw==",
        "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=lPJc7eMqmCuuqQDJUp+L5inJ3xbXv9i5YL4l+Jypyu4=;\n\tb=WLM+m4ZlMYYNKkrGF+JZWZTTSQwE15XT0ukGSSHzoKlkJCD4odcJz2/mWwqGHxIZh9\n\tnVwjGmp3toADfD/ah/+0vJ1O3ZVOqZlq0eUBGektnzDNfF2Tq7tg5s/fmdA4L+aqHjZj\n\tIbGbW4FmprtQOrV/AJXasOUCsN2Qkzz8azszcv0ev6m+cLVInOkDadOreSWRPmY1m3rm\n\tXp8Lu7b+MtKqTjSbl43v99KAztwAmxLyOxL96ZJA7GKkSDhpD9uxzEZY9992W75fzP1r\n\tC3y6z+tV3EyZEKtWpePVmWfeGu8HiznbPLrJ/jOZzilSDWrevX52BejwmSvofKGvBwQX\n\tgkiw==",
        "X-Gm-Message-State": "AOAM530dpqJYZvCFb27Cznr1DT8U2G/6wunji8GXsNSwEcvMYZfp/onc\n\t1Fw97tM1XWEEqxlhZsIwAOYHIWiPxJA=",
        "X-Google-Smtp-Source": "ABdhPJxCi+/+erB7nTAj3Aq22K32N2/VdV3Sa2F99YfQDQu85+VcpLbeuZZbL/5EcHB7GzFB3iin5A==",
        "X-Received": "by 2002:a5d:5227:: with SMTP id i7mr66899659wra.68.1609430072259;\n\tThu, 31 Dec 2020 07:54:32 -0800 (PST)",
        "From": "Sebastian Fricke <sebastian.fricke.linux@gmail.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Thu, 31 Dec 2020 16:53:34 +0100",
        "Message-Id": "<20201231155336.7058-3-sebastian.fricke.linux@gmail.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20201231155336.7058-1-sebastian.fricke.linux@gmail.com>",
        "References": "<20201231155336.7058-1-sebastian.fricke.linux@gmail.com>",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH v2 2/4] libcamera: Overload ==/!=\n\toperators for BayerFormats",
        "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": "Enable to test two Bayer formats for equality by checking if the order\nof the color channels, the bit depth of the pattern, and the packing\nscheme match. Additionally, add the reverse operation (!=), which negates\nthe equality test result.\n\nSigned-off-by: Sebastian Fricke <sebastian.fricke.linux@gmail.com>\n---\n include/libcamera/internal/bayer_format.h |  7 +++++++\n src/libcamera/bayer_format.cpp            | 10 ++++++++++\n 2 files changed, 17 insertions(+)",
    "diff": "diff --git a/include/libcamera/internal/bayer_format.h b/include/libcamera/internal/bayer_format.h\nindex 8efe1382..298756e3 100644\n--- a/include/libcamera/internal/bayer_format.h\n+++ b/include/libcamera/internal/bayer_format.h\n@@ -57,6 +57,13 @@ public:\n \tPacking packing;\n };\n \n+bool operator==(const BayerFormat &lhs, const BayerFormat &rhs);\n+static inline bool operator!=(const BayerFormat &lhs,\n+\t\t\t      const BayerFormat &rhs)\n+{\n+\treturn !(lhs == rhs);\n+}\n+\n } /* namespace libcamera */\n \n #endif /* __LIBCAMERA_INTERNAL_BAYER_FORMAT_H__ */\ndiff --git a/src/libcamera/bayer_format.cpp b/src/libcamera/bayer_format.cpp\nindex 26065b66..b8635e15 100644\n--- a/src/libcamera/bayer_format.cpp\n+++ b/src/libcamera/bayer_format.cpp\n@@ -160,6 +160,16 @@ std::string BayerFormat::toString() const\n \treturn result;\n }\n \n+/**\n+ * \\brief Compare two BayerFormats for equality\n+ * \\return True if order, bitDepth and packing are equal, otherwise false\n+ */\n+bool operator==(const BayerFormat &lhs, const BayerFormat &rhs)\n+{\n+\treturn lhs.order == rhs.order && lhs.bitDepth == rhs.bitDepth &&\n+\t       lhs.packing == rhs.packing;\n+}\n+\n /**\n  * \\brief Convert a BayerFormat into the corresponding V4L2PixelFormat\n  * \\return The V4L2PixelFormat corresponding to this BayerFormat\n",
    "prefixes": [
        "libcamera-devel",
        "v2",
        "2/4"
    ]
}