Show a patch.

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

{
    "id": 21126,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/21126/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/21126/",
    "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": "<20240830210313.30691-3-chenghaoyang@chromium.org>",
    "date": "2024-08-30T21:00:20",
    "name": "[v3,2/3] libcamera: Add face detection controls",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "cf29684ca3cc7bdaa67ead139a80f5a0fe849e68",
    "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/21126/mbox/",
    "series": [
        {
            "id": 4553,
            "url": "https://patchwork.libcamera.org/api/1.1/series/4553/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4553",
            "date": "2024-08-30T21:00:18",
            "name": "Add Face Detection Controls",
            "version": 3,
            "mbox": "https://patchwork.libcamera.org/series/4553/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/21126/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/21126/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 0FB1BC32C2\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 30 Aug 2024 21:03:25 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DB1C263471;\n\tFri, 30 Aug 2024 23:03:21 +0200 (CEST)",
            "from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com\n\t[IPv6:2a00:1450:4864:20::32a])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6002C61E4A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 30 Aug 2024 23:03:17 +0200 (CEST)",
            "by mail-wm1-x32a.google.com with SMTP id\n\t5b1f17b1804b1-42bbbff40bbso8872195e9.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 30 Aug 2024 14:03:17 -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-3749efb37efsm4935529f8f.109.2024.08.30.14.03.15\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 30 Aug 2024 14:03:16 -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=\"m6j3JRmx\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=chromium.org; s=google; t=1725051797; x=1725656597;\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=r/I/asyNDPgFivOcw3MnOP+duUL4cdodULyhKmUniNk=;\n\tb=m6j3JRmxFh9hBxvmBID2Q62NkbQyo8qFwhtXaWSQq1zOM6fdvo27KnI+HdaydE8IGZ\n\t7WhAM9dHSvsxzzn/jSg54TMbDbA5VPmKhm04aVN9hwoHDgmRKRvR+W8DaoqNBFT6kvW+\n\tWHSgu2a4tuPM6HPF1o7NW6MyolUUaxxBVbaLU=",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1725051797; x=1725656597;\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=r/I/asyNDPgFivOcw3MnOP+duUL4cdodULyhKmUniNk=;\n\tb=T881DNY8IjZfxULXy+rFPX61psQBKxy0V9t4fhNPYcEfULcAr+7hx1X01xyI09wD2t\n\tEmNiW2+unHH2PyzuzbzIHwYREl0kUPLrKk5HajWWf2p8Bus8pY9cZiGs+H2+RQ4Bf0wJ\n\tWKHq+sJpSrB7to8lkvLVJS0PifwlKcjEDH5tlwUM7S/oJ2fYX2ttFEfdYFH5/3sfjRi+\n\tO0pCXZBNEQGgvToZvb0he2pPQM1bD8MfeG2yn/dRmggtPmRTV/LGp0E0cUuFrxUPMkgJ\n\tiqQcyF5TaqMwWv7R1UybqMN7Q1pff65vLwJuCaXqL2l8ggxABVDZ/0f5fDfIhWaX0ThS\n\tfsow==",
        "X-Gm-Message-State": "AOJu0YxM03ZAWI9hZh+06V3/LjwUJJMdeBIlb4JD2XcX4/6hyz4eZQ7v\n\tdenRmxrKJ/aaY2p7YlilPrrhra4OYTIh/CO/MPKKy4Qv+cioPrtjyX4OlEpzSYzYvlPYKqYEiWh\n\t8tA==",
        "X-Google-Smtp-Source": "AGHT+IHQznniGc0rKRGuRGQJriVB6WM6hAcyb1WL+lJJ5+TMXFOxA7Q0kNLyhnf45BpaF37XaNM+gg==",
        "X-Received": "by 2002:a05:600c:1c9e:b0:426:61af:e1d6 with SMTP id\n\t5b1f17b1804b1-42bbb44023emr24955075e9.29.1725051796598; \n\tFri, 30 Aug 2024 14:03:16 -0700 (PDT)",
        "From": "Harvey Yang <chenghaoyang@chromium.org>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "Yudhistira Erlandinata <yerlandinata@chromium.org>,\n\tbecker hsieh <beckerh@chromium.org>,\n\tHarvey Yang <chenghaoyang@chromium.org>",
        "Subject": "[PATCH v3 2/3] libcamera: Add face detection controls",
        "Date": "Fri, 30 Aug 2024 21:00:20 +0000",
        "Message-ID": "<20240830210313.30691-3-chenghaoyang@chromium.org>",
        "X-Mailer": "git-send-email 2.46.0.469.g59c65b2a67-goog",
        "In-Reply-To": "<20240830210313.30691-1-chenghaoyang@chromium.org>",
        "References": "<20240830210313.30691-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 FaceDetectMode, FaceDetectFaceRectangles, FaceDetectFaceScores,\nand FaceDetectFaceLandmark. Also add ControlTypePoint for supporting\nFaceDetectFaceLandmark.\n\nSigned-off-by: Yudhistira Erlandinata <yerlandinata@chromium.org>\nCo-developed-by: becker hsieh <beckerh@chromium.org>\nCo-developed-by: Harvey Yang <chenghaoyang@chromium.org>\n---\n include/libcamera/controls.h         |  6 +++\n src/libcamera/control_ids_draft.yaml | 63 ++++++++++++++++++++++++++++\n src/libcamera/controls.cpp           |  6 +++\n 3 files changed, 75 insertions(+)",
    "diff": "diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h\nindex 7c2bb2872..bf1b8609c 100644\n--- a/include/libcamera/controls.h\n+++ b/include/libcamera/controls.h\n@@ -34,6 +34,7 @@ enum ControlType {\n \tControlTypeString,\n \tControlTypeRectangle,\n \tControlTypeSize,\n+\tControlTypePoint,\n };\n \n namespace details {\n@@ -87,6 +88,11 @@ struct control_type<Size> {\n \tstatic constexpr ControlType value = ControlTypeSize;\n };\n \n+template<>\n+struct control_type<Point> {\n+\tstatic constexpr ControlType value = ControlTypePoint;\n+};\n+\n template<typename T, std::size_t N>\n struct control_type<Span<T, N>> : public control_type<std::remove_cv_t<T>> {\n };\ndiff --git a/src/libcamera/control_ids_draft.yaml b/src/libcamera/control_ids_draft.yaml\nindex 9bef5bf15..23e09bff8 100644\n--- a/src/libcamera/control_ids_draft.yaml\n+++ b/src/libcamera/control_ids_draft.yaml\n@@ -227,4 +227,67 @@ controls:\n             value. All of the custom test patterns will be static (that is the\n             raw image must not vary from frame to frame).\n \n+  - FaceDetectMode:\n+      type: uint8_t\n+      description: |\n+        Reporting mode of face detection.\n+\n+      enum:\n+        - name: FaceDetectModeOff\n+          value: 0\n+          description: |\n+            Pipeline should not report face detection result.\n+        - name: FaceDetectModeSimple\n+          value: 1\n+          description: |\n+            Pipeline should at least report faces boundary rectangles, in\n+            metadata FaceDetectFaceRectangles, and confidence score,\n+            in metadata FaceDetectFaceScores, for each of them.\n+            FaceDetectFaceLandmark is optional.\n+\n+            The number of faces in each list must be the same.\n+\n+            \\sa FaceDetectFaceRectangles\n+            \\sa FaceDetectFaceScores\n+            \\sa FaceDetectFaceLandmark\n+\n+  - FaceDetectFaceRectangles:\n+      type: Rectangle\n+      description: |\n+        Boundary rectangle of the detected faces in format:\n+        [..., xmin_i, ymin_i, xmax_i, ymax_i, ...], where (0,0) is top-left\n+        of active pixel area.\n+        The number of values should be 3 * the number of faces.\n+\n+        The FaceDetectFaceRectangles control can only be returned in metadata.\n+\n+      size: [n]\n+\n+  - FaceDetectFaceScores:\n+      type: uint8_t\n+      description: |\n+        Confidence score of each of the detected faces by face detector.\n+        The range of score is [0, 100].\n+        The FaceDetectFaceScores control can only be returned in metadata.\n+        The number of values should be the number of faces.\n+\n+        Currently identical to ANDROID_STATISTICS_FACE_SCORES.\n+\n+      size: [n]\n+\n+  - FaceDetectFaceLandmark:\n+      type: Point\n+      description: |\n+        Array of human face landmark coordinates in format:\n+        [..., left_eye_i, right_eye_i, mouth_i, left_eye_i+1, ...],\n+        with i = index of face.\n+        The number of values should be 6 * the number of faces.\n+\n+        The FaceDetectFaceLandmark control can only be returned in metadata.\n+\n+        Currently identical to ANDROID_STATISTICS_FACE_LANDMARKS.\n+\n+      size: [n]\n+\n+\n ...\ndiff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp\nindex 11d35321c..ce73ae9d7 100644\n--- a/src/libcamera/controls.cpp\n+++ b/src/libcamera/controls.cpp\n@@ -61,6 +61,7 @@ static constexpr size_t ControlValueSize[] = {\n \t[ControlTypeString]\t\t= sizeof(char),\n \t[ControlTypeRectangle]\t\t= sizeof(Rectangle),\n \t[ControlTypeSize]\t\t= sizeof(Size),\n+\t[ControlTypePoint]\t\t= sizeof(Point),\n };\n \n } /* namespace */\n@@ -255,6 +256,11 @@ std::string ControlValue::toString() const\n \t\t\tstr += value->toString();\n \t\t\tbreak;\n \t\t}\n+\t\tcase ControlTypePoint: {\n+\t\t\tconst Point *value = reinterpret_cast<const Point *>(data);\n+\t\t\tstr += value->toString();\n+\t\t\tbreak;\n+\t\t}\n \t\tcase ControlTypeNone:\n \t\tcase ControlTypeString:\n \t\t\tbreak;\n",
    "prefixes": [
        "v3",
        "2/3"
    ]
}