Show a patch.

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

{
    "id": 1014,
    "url": "https://patchwork.libcamera.org/api/patches/1014/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/1014/",
    "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-6-laurent.pinchart@ideasonboard.com>",
    "date": "2019-04-16T22:08:31",
    "name": "[libcamera-devel,v2,05/13] libcamera: geometry: Use Size to store min and max in SizeRange",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "30ffde17c2f9e288b73661487af0f623b05bfad6",
    "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/1014/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/1014/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/1014/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 4674360DC3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 17 Apr 2019 00:08:53 +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 D9506E2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 17 Apr 2019 00:08:52 +0200 (CEST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1555452533;\n\tbh=LtUpLXwg6GT3gbro5vW9+VO+ATz91tNYTtXBhWViPdw=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=WdZ5A+fmyvqmWrJyyq9d2oKLIXcElaShaN6MxgyCWA6U4fTaNmQdAR+dwIMiI4ZeH\n\tqdtstJm5TTmNDZOL/mBIaq4yYV1V5krqwBZAnH62wmx5JYBeUchYZuPVg5IpiNEzfN\n\tHPGX8LvRjmIjhdhchUgHhC2SRcHKNw7c8CF1jTbA=",
        "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed, 17 Apr 2019 01:08:31 +0300",
        "Message-Id": "<20190416220839.1577-6-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-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v2 05/13] libcamera: geometry: Use Size to\n\tstore min and max in SizeRange",
        "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": "Instead of storing four integers for the minimum and maximum width and\nheight in the SizeRange class, use two instance of the Size class for\nthe minimum and maximum sizes.\n\nWhile it at replace the mention of image size with size in the SizeRange\ndocumentation, as the Size class isn't limited to image sizes.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n include/libcamera/geometry.h         | 10 +++-------\n src/libcamera/geometry.cpp           | 26 ++++++++------------------\n src/libcamera/pipeline/ipu3/ipu3.cpp | 17 ++++++++---------\n test/v4l2_subdevice/list_formats.cpp |  8 ++++----\n 4 files changed, 23 insertions(+), 38 deletions(-)",
    "diff": "diff --git a/include/libcamera/geometry.h b/include/libcamera/geometry.h\nindex 7704ab5add21..80f79c6ba2d3 100644\n--- a/include/libcamera/geometry.h\n+++ b/include/libcamera/geometry.h\n@@ -38,21 +38,17 @@ struct Size {\n \n struct SizeRange {\n \tSizeRange()\n-\t\t: SizeRange(0, 0, 0, 0)\n \t{\n \t}\n \n \tSizeRange(unsigned int minW, unsigned int minH,\n \t\t  unsigned int maxW, unsigned int maxH)\n-\t\t: minWidth(minW), minHeight(minH), maxWidth(maxW),\n-\t\t  maxHeight(maxH)\n+\t\t: min(minW, minH), max(maxW, maxH)\n \t{\n \t}\n \n-\tunsigned int minWidth;\n-\tunsigned int minHeight;\n-\tunsigned int maxWidth;\n-\tunsigned int maxHeight;\n+\tSize min;\n+\tSize max;\n };\n \n } /* namespace libcamera */\ndiff --git a/src/libcamera/geometry.cpp b/src/libcamera/geometry.cpp\nindex 1f875bbe5f48..c1c7daed7259 100644\n--- a/src/libcamera/geometry.cpp\n+++ b/src/libcamera/geometry.cpp\n@@ -93,11 +93,11 @@ const std::string Rectangle::toString() const\n \n /**\n  * \\struct SizeRange\n- * \\brief Describe a range of image sizes\n+ * \\brief Describe a range of sizes\n  *\n- * SizeRange describes a range of image sizes included in the (minWidth,\n- * minHeight) - (maxWidth, maxHeight) interval. If the minimum and\n- * maximum sizes are identical it represents a single image resolution.\n+ * SizeRange describes a range of sizes included in the [min, max]\n+ * interval for both the width and the height. If the minimum and\n+ * maximum sizes are identical it represents a single size.\n  */\n \n /**\n@@ -115,23 +115,13 @@ const std::string Rectangle::toString() const\n  */\n \n /**\n- * \\var SizeRange::minWidth\n- * \\brief The minimum image width\n+ * \\var SizeRange::min\n+ * \\brief The minimum size\n  */\n \n /**\n- * \\var SizeRange::minHeight\n- * \\brief The minimum image height\n- */\n-\n-/**\n- * \\var SizeRange::maxWidth\n- * \\brief The maximum image width\n- */\n-\n-/**\n- * \\var SizeRange::maxHeight\n- * \\brief The maximum image height\n+ * \\var SizeRange::max\n+ * \\brief The maximum size\n  */\n \n } /* namespace libcamera */\ndiff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\nindex ff72be14d696..4ddd1ede1c81 100644\n--- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n@@ -1047,10 +1047,9 @@ int CIO2Device::init(const MediaDevice *media, unsigned int index)\n \t\t\tcontinue;\n \n \t\tfor (const SizeRange &size : it.second) {\n-\t\t\tif (maxSize_.width < size.maxWidth &&\n-\t\t\t    maxSize_.height < size.maxHeight) {\n-\t\t\t\tmaxSize_.width = size.maxWidth;\n-\t\t\t\tmaxSize_.height = size.maxHeight;\n+\t\t\tif (maxSize_.width < size.max.width &&\n+\t\t\t    maxSize_.height < size.max.height) {\n+\t\t\t\tmaxSize_ = size.max;\n \t\t\t\tmbusCode_ = mbusCode;\n \t\t\t}\n \t\t}\n@@ -1105,19 +1104,19 @@ int CIO2Device::configure(const StreamConfiguration &config,\n \t\t\t * as possible. This will need to be revisited when\n \t\t\t * implementing the scaling policy.\n \t\t\t */\n-\t\t\tif (size.maxWidth < config.width ||\n-\t\t\t    size.maxHeight < config.height)\n+\t\t\tif (size.max.width < config.width ||\n+\t\t\t    size.max.height < config.height)\n \t\t\t\tcontinue;\n \n-\t\t\tunsigned int diff = size.maxWidth * size.maxHeight\n+\t\t\tunsigned int diff = size.max.width * size.max.height\n \t\t\t\t\t  - imageSize;\n \t\t\tif (diff >= best)\n \t\t\t\tcontinue;\n \n \t\t\tbest = diff;\n \n-\t\t\tsensorFormat.width = size.maxWidth;\n-\t\t\tsensorFormat.height = size.maxHeight;\n+\t\t\tsensorFormat.width = size.max.width;\n+\t\t\tsensorFormat.height = size.max.height;\n \t\t\tsensorFormat.mbus_code = it.first;\n \t\t}\n \t}\ndiff --git a/test/v4l2_subdevice/list_formats.cpp b/test/v4l2_subdevice/list_formats.cpp\nindex 47ae3a1c1a28..09dec9abe854 100644\n--- a/test/v4l2_subdevice/list_formats.cpp\n+++ b/test/v4l2_subdevice/list_formats.cpp\n@@ -37,10 +37,10 @@ void ListFormatsTest::printFormats(unsigned int pad,\n \tfor (SizeRange &size : sizes) {\n \t\tcout << \"\tmbus code: 0x\" << setfill('0') << setw(4)\n \t\t     << hex << code << endl;\n-\t\tcout << \"\tmin width: \" << dec << size.minWidth << endl;\n-\t\tcout << \"\tmin height: \" << dec << size.minHeight << endl;\n-\t\tcout << \"\tmax width: \" << dec << size.maxWidth << endl;\n-\t\tcout << \"\tmax height: \" << dec << size.maxHeight << endl;\n+\t\tcout << \"\tmin width: \" << dec << size.min.width << endl;\n+\t\tcout << \"\tmin height: \" << dec << size.min.height << endl;\n+\t\tcout << \"\tmax width: \" << dec << size.max.width << endl;\n+\t\tcout << \"\tmax height: \" << dec << size.max.height << endl;\n \t}\n }\n \n",
    "prefixes": [
        "libcamera-devel",
        "v2",
        "05/13"
    ]
}