Patch Detail
Show a patch.
GET /api/1.1/patches/21152/?format=api
{ "id": 21152, "url": "https://patchwork.libcamera.org/api/1.1/patches/21152/?format=api", "web_url": "https://patchwork.libcamera.org/patch/21152/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/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": "<20240903103810.3288042-2-chenghaoyang@chromium.org>", "date": "2024-09-03T10:35:25", "name": "[v4,1/3] libcamera: Add rectangle two-point constructor", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "bf7c3623e53907c2d7186ff1ca30e15305e23f91", "submitter": { "id": 117, "url": "https://patchwork.libcamera.org/api/1.1/people/117/?format=api", "name": "Cheng-Hao Yang", "email": "chenghaoyang@chromium.org" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/21152/mbox/", "series": [ { "id": 4558, "url": "https://patchwork.libcamera.org/api/1.1/series/4558/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4558", "date": "2024-09-03T10:35:24", "name": "Add Face Detection Controls", "version": 4, "mbox": "https://patchwork.libcamera.org/series/4558/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/21152/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/21152/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 82DD1C324C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 3 Sep 2024 10:38:18 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 61123634E5;\n\tTue, 3 Sep 2024 12:38:16 +0200 (CEST)", "from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com\n\t[IPv6:2a00:1450:4864:20::32d])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5A180634CB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 3 Sep 2024 12:38:14 +0200 (CEST)", "by mail-wm1-x32d.google.com with SMTP id\n\t5b1f17b1804b1-42bb72a5e0bso45351025e9.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 03 Sep 2024 03:38:14 -0700 (PDT)", "from chenghaoyang-germany.c.googlers.com.com\n\t(161.126.77.34.bc.googleusercontent.com. [34.77.126.161])\n\tby smtp.gmail.com with ESMTPSA id\n\tffacd0b85a97d-374bfbfc7b7sm8929393f8f.88.2024.09.03.03.38.13\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 03 Sep 2024 03:38:13 -0700 (PDT)" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"Mx864aX2\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=chromium.org; s=google; t=1725359894; x=1725964694;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=G4Ba3c7hJrcxKDqyLM6k3uK9nWWuDQPgRDSBllLf93U=;\n\tb=Mx864aX2E1XpwRy5cAw/R1stUB+kKL/THeWQklhaHBPM+cK9iqNpAo0KWNlEdqzsn9\n\tMsQi4HoZZ/dZpTLhqSDiiuFyuEwfWHakAZnfpJq6gTg70uNybfaYwMoGlzSBHKtaq4bK\n\thzRqU6jkTu4XgZLbyF5+UI2AW3PkHN1yQY+Ec=", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1725359894; x=1725964694;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=G4Ba3c7hJrcxKDqyLM6k3uK9nWWuDQPgRDSBllLf93U=;\n\tb=MwzdN8BP+nNe70S3SW49jz0p9oyFKLHF+wNUOy15fWXZrwJgyqqEsirFqgL7kPGy3X\n\tKfBCc3fV1bc/4mivC6UK+I5Un55hy9Z9m7zRJrufIYAuf6QSrs5ui19f28vadTbC7gJE\n\tAWUXL1Ws/cLjk9AA4d6yCBpgXibytTP3DLChFqJ0G40E/xHeBbphGrdPuRF2JradSxxy\n\tab0rZiS3j4jOddRNkuhEK/IFpjp/T+7hEN4dsOXtzhkeeo5mB23Ltz/Hf48c49jeULSX\n\t3QhrtyMf2iSsDe/AEGc7DCvavD9Mcn1IQtSW+27IIaYPhun7kSf0HJHRNX+zrvldXip/\n\tJyRA==", "X-Gm-Message-State": "AOJu0Yx/Zt1KVJIiE9eR59EfqDAiD9TEi7v9qATQRWBr2pzELVW9Er1Z\n\t2zBQqTUmaa/1LPq5l8SFPVBL//aO5xwjqufEKQFqUSaqQoO6a/G5nuPNiSzEES1DeO/WXh0EW0X\n\t01w==", "X-Google-Smtp-Source": "AGHT+IHbi2T8U/X3wv4woOhAGf+DD0lD90uD9ZCMDiGYs0a0Imw3L+NcP15bJospwbMKKJCjp7gDsw==", "X-Received": "by 2002:a5d:46d2:0:b0:374:ba83:8d73 with SMTP id\n\tffacd0b85a97d-374ba838e6bmr6787577f8f.8.1725359893455; \n\tTue, 03 Sep 2024 03:38:13 -0700 (PDT)", "From": "Harvey Yang <chenghaoyang@chromium.org>", "To": "libcamera-devel@lists.libcamera.org", "Cc": "Yudhistira Erlandinata <yerlandinata@chromium.org>,\n\tHarvey Yang <chenghaoyang@chromium.org>", "Subject": "[PATCH v4 1/3] libcamera: Add rectangle two-point constructor", "Date": "Tue, 3 Sep 2024 10:35:25 +0000", "Message-ID": "<20240903103810.3288042-2-chenghaoyang@chromium.org>", "X-Mailer": "git-send-email 2.46.0.469.g59c65b2a67-goog", "In-Reply-To": "<20240903103810.3288042-1-chenghaoyang@chromium.org>", "References": "<20240903103810.3288042-1-chenghaoyang@chromium.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "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>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "From: Yudhistira Erlandinata <yerlandinata@chromium.org>\n\nAdd a Rectangle constructor that accepts two points:\ntopLeft and bottomRight.\n\nSigned-off-by: Yudhistira Erlandinata <yerlandinata@chromium.org>\nCo-developed-by: Harvey Yang <chenghaoyang@chromium.org>\n---\n include/libcamera/geometry.h | 2 ++\n src/libcamera/geometry.cpp | 14 ++++++++++++++\n 2 files changed, 16 insertions(+)", "diff": "diff --git a/include/libcamera/geometry.h b/include/libcamera/geometry.h\nindex 3e6f0f5d7..dc56f180f 100644\n--- a/include/libcamera/geometry.h\n+++ b/include/libcamera/geometry.h\n@@ -262,6 +262,8 @@ public:\n \t{\n \t}\n \n+\tconstexpr Rectangle(const Point &topLeft, const Point &bottomRight);\n+\n \tint x;\n \tint y;\n \tunsigned int width;\ndiff --git a/src/libcamera/geometry.cpp b/src/libcamera/geometry.cpp\nindex 000151364..029b8dad2 100644\n--- a/src/libcamera/geometry.cpp\n+++ b/src/libcamera/geometry.cpp\n@@ -629,6 +629,20 @@ std::ostream &operator<<(std::ostream &out, const SizeRange &sr)\n * \\param[in] size The desired Rectangle size\n */\n \n+/**\n+ * \\fn Rectangle::Rectangle(const Point &topLeft, const Point &bottomRight)\n+ * \\brief Construct a Rectangle with the two given points\n+ * \\param[in] topLeft The top-left corner\n+ * \\param[in] bottomRight The bottom-right corner\n+ */\n+constexpr Rectangle::Rectangle(const Point &topLeft, const Point &bottomRight)\n+\t: x(topLeft.x), y(topLeft.y),\n+\t width(bottomRight.x - x),\n+\t height(bottomRight.y - y)\n+{\n+\tASSERT(bottomRight.x >= x && bottomRight.y >= y);\n+}\n+\n /**\n * \\var Rectangle::x\n * \\brief The horizontal coordinate of the rectangle's top-left corner\n", "prefixes": [ "v4", "1/3" ] }