Show a patch.

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

{
    "id": 11026,
    "url": "https://patchwork.libcamera.org/api/patches/11026/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/11026/",
    "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": "<20210126184854.46156-4-sebastian.fricke@posteo.net>",
    "date": "2021-01-26T18:48:52",
    "name": "[libcamera-devel,v3,3/5] libcamera: Overload ==/!= operators for BayerFormats",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "df4e7083871cd4d25ae425a899e53de8f3b23ced",
    "submitter": {
        "id": 78,
        "url": "https://patchwork.libcamera.org/api/people/78/?format=api",
        "name": "Sebastian Fricke",
        "email": "sebastian.fricke@posteo.net"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/11026/mbox/",
    "series": [
        {
            "id": 1613,
            "url": "https://patchwork.libcamera.org/api/series/1613/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1613",
            "date": "2021-01-26T18:48:49",
            "name": "Improve BayerFormat class",
            "version": 3,
            "mbox": "https://patchwork.libcamera.org/series/1613/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/11026/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/11026/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 EF22DC0F2B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 26 Jan 2021 18:49:15 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C1D7D68325;\n\tTue, 26 Jan 2021 19:49:15 +0100 (CET)",
            "from mout01.posteo.de (mout01.posteo.de [185.67.36.65])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2F0BB6831B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 26 Jan 2021 19:49:13 +0100 (CET)",
            "from submission (posteo.de [89.146.220.130]) \n\tby mout01.posteo.de (Postfix) with ESMTPS id 63CE4160065\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 26 Jan 2021 19:49:12 +0100 (CET)",
            "from customer (localhost [127.0.0.1])\n\tby submission (posteo.de) with ESMTPSA id 4DQG3q4HmWz6tm9;\n\tTue, 26 Jan 2021 19:49:11 +0100 (CET)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=posteo.net header.i=@posteo.net\n\theader.b=\"O/UtsOXt\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;\n\tt=1611686952; bh=+00HLx0KNbfNb3pJkp3DsR3jnsaHQiRJZjK7sADvAMI=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=O/UtsOXty7ld0Mvi/1tmY/2MxICd90a6q3iJHFjgvjNpzsIMHl1szZ/4T8lMSbZX0\n\tW1R0H60Zmj0hkAfFoBtk5ZBxyQ9ZeWse+IF+U4pj+0f/B4PA221AnwzeMLtYg2qhws\n\tH50TaChDwtIfpOi0jFoeewyjoLg+1NhxocpHFBWCmhrdmQn3zka/U//Xi1IkcVNvFF\n\t2dFEPAY0G5Vf9x5xurYcQSXAwxjorIHg8/GCwUg43gRzc7kKnDb3qwfbah2CEuehEn\n\tSqoEyaW6EK87fzzyPqCHPhr3KsfIwbJ1UKbPducGTDzXmbQIFq3hdtzahNOxcG1JIa\n\t7sM/DY5F48Dhw==",
        "From": "Sebastian Fricke <sebastian.fricke@posteo.net>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Tue, 26 Jan 2021 19:48:52 +0100",
        "Message-Id": "<20210126184854.46156-4-sebastian.fricke@posteo.net>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20210126184854.46156-1-sebastian.fricke@posteo.net>",
        "References": "<20210126184854.46156-1-sebastian.fricke@posteo.net>",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH v3 3/5] 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@posteo.net>\n---\n include/libcamera/internal/bayer_format.h |  6 ++++++\n src/libcamera/bayer_format.cpp            | 17 +++++++++++++++++\n 2 files changed, 23 insertions(+)",
    "diff": "diff --git a/include/libcamera/internal/bayer_format.h b/include/libcamera/internal/bayer_format.h\nindex 62814154..5b8c1dc9 100644\n--- a/include/libcamera/internal/bayer_format.h\n+++ b/include/libcamera/internal/bayer_format.h\n@@ -57,6 +57,12 @@ public:\n \tPacking packing;\n };\n \n+bool operator==(const BayerFormat &lhs, const BayerFormat &rhs);\n+static inline bool operator!=(const BayerFormat &lhs, 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 1acf91d4..d4e7f142 100644\n--- a/src/libcamera/bayer_format.cpp\n+++ b/src/libcamera/bayer_format.cpp\n@@ -215,6 +215,23 @@ 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+ * \\fn bool operator!=(const BayerFormat &lhs, const BayerFormat &rhs)\n+ * \\brief Compare two BayerFormats for inequality\n+ * \\return True if either order, bitdepth or packing are not equal, otherwise\n+ * false.\n+ */\n+\n /**\n  * \\brief Convert a BayerFormat into the corresponding V4L2PixelFormat\n  * \\return The V4L2PixelFormat corresponding to this BayerFormat\n",
    "prefixes": [
        "libcamera-devel",
        "v3",
        "3/5"
    ]
}