Show a patch.

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

{
    "id": 1017,
    "url": "https://patchwork.libcamera.org/api/patches/1017/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/1017/",
    "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": "<20190416220839.1577-9-laurent.pinchart@ideasonboard.com>",
    "date": "2019-04-16T22:08:34",
    "name": "[libcamera-devel,v2,08/13] libcamera: utils: Add set_overlap() function",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "b620aae046db7f92270cd77e3647b4c05a4ffb49",
    "submitter": {
        "id": 2,
        "url": "https://patchwork.libcamera.org/api/people/2/?format=api",
        "name": "Laurent Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/1017/mbox/",
    "series": [
        {
            "id": 253,
            "url": "https://patchwork.libcamera.org/api/series/253/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=253",
            "date": "2019-04-16T22:08:26",
            "name": "Rockchip ISP pipeline handler",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/253/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/1017/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/1017/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<laurent.pinchart@ideasonboard.com>",
        "Received": [
            "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 27E8D60DCB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 17 Apr 2019 00:08:54 +0200 (CEST)",
            "from pendragon.bb.dnainternet.fi\n\t(dfj612yhrgyx302h3jwwy-3.rev.dnainternet.fi\n\t[IPv6:2001:14ba:21f5:5b00:ce28:277f:58d7:3ca4])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id BFB732BA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 17 Apr 2019 00:08:53 +0200 (CEST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1555452533;\n\tbh=ZYd1SJs0RXKjpv+tW9G+JC/iNNeE9LETC1uoqYqMHk0=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=nldVa4AXcSgkjZLSDGNGULwHIoI3kRumZshLV4qRFKG4bTjuzBkIL2QzIUUEgbh/O\n\t1G9jeu9vpIL2Vmd2UvM/1zMSO2TKTUK4vFSApkG8wuJxcdAqXSWcI7nGgpeZC8CrvS\n\teTpSU0u53B0RjyLwyA1yX1jux893C+I4muT7Ke2k=",
        "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed, 17 Apr 2019 01:08:34 +0300",
        "Message-Id": "<20190416220839.1577-9-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.21.0",
        "In-Reply-To": "<20190416220839.1577-1-laurent.pinchart@ideasonboard.com>",
        "References": "<20190416220839.1577-1-laurent.pinchart@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v2 08/13] libcamera: utils: Add\n\tset_overlap() function",
        "X-BeenThere": "libcamera-devel@lists.libcamera.org",
        "X-Mailman-Version": "2.1.23",
        "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>",
        "X-List-Received-Date": "Tue, 16 Apr 2019 22:08:55 -0000"
    },
    "content": "The new set_overlap() function counts the number of overlapping elements\nin the intersection of two sorted ranges defined by their beginning and\nending iterators.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/include/utils.h | 19 +++++++++++++++++++\n src/libcamera/utils.cpp       | 12 ++++++++++++\n 2 files changed, 31 insertions(+)",
    "diff": "diff --git a/src/libcamera/include/utils.h b/src/libcamera/include/utils.h\nindex 79038a96feab..97bd470a45b0 100644\n--- a/src/libcamera/include/utils.h\n+++ b/src/libcamera/include/utils.h\n@@ -26,6 +26,25 @@ std::unique_ptr<T> make_unique(Args&&... args)\n \n char *secure_getenv(const char *name);\n \n+template<class InputIt1, class InputIt2>\n+unsigned int set_overlap(InputIt1 first1, InputIt1 last1,\n+\t\t\t InputIt2 first2, InputIt2 last2)\n+{\n+\tunsigned int count = 0;\n+\n+\twhile (first1 != last1 && first2 != last2) {\n+\t\tif (*first1 < *first2) {\n+\t\t\t++first1;\n+\t\t} else {\n+\t\t\tif (!(*first2 < *first1))\n+\t\t\t\tcount++;\n+\t\t\t++first2;\n+\t\t}\n+\t}\n+\n+\treturn count;\n+}\n+\n } /* namespace utils */\n \n } /* namespace libcamera */\ndiff --git a/src/libcamera/utils.cpp b/src/libcamera/utils.cpp\nindex cd0fd7614cc7..e38f32684bb1 100644\n--- a/src/libcamera/utils.cpp\n+++ b/src/libcamera/utils.cpp\n@@ -68,6 +68,18 @@ char *secure_getenv(const char *name)\n  * \\brief Constructs an object of type T and wraps it in a std::unique_ptr.\n  */\n \n+/**\n+ * \\fn libcamera::utils::set_overlap(InputIt1 first1, InputIt1 last1,\n+ *\t\t\t\t     InputIt2 first2, InputIt2 last2)\n+ * \\brief Count the number of elements in the intersection of two ranges\n+ *\n+ * Count the number of elements in the intersection of the sorted ranges [\\a\n+ * first1, \\a last1) and [\\a first1, \\a last2). Elements are compared using\n+ * operator< and the ranges must be sorted with respect to the same.\n+ *\n+ * \\return The number of elements in the intersection of the two ranges\n+ */\n+\n } /* namespace utils */\n \n } /* namespace libcamera */\n",
    "prefixes": [
        "libcamera-devel",
        "v2",
        "08/13"
    ]
}