From patchwork Tue Sep 24 11:02:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cheng-Hao Yang X-Patchwork-Id: 21342 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 13575C0F1B for ; Tue, 24 Sep 2024 11:04:04 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 01FE963510; Tue, 24 Sep 2024 13:04:02 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Zk3AFWxV"; dkim-atps=neutral Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 785E863500 for ; Tue, 24 Sep 2024 13:04:00 +0200 (CEST) Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-71971d20a95so3682189b3a.3 for ; Tue, 24 Sep 2024 04:04:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727175838; x=1727780638; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=pilcf9aNKRLy8d6JiUspRF8gMb/GojilYehEApJVc00=; b=Zk3AFWxVk9Q7qG1rvFe/fupgSIqpCS40PPtEwklceMdIWMDB6tJMbFcS2bnj2QHUAz Le9pwXWxipz6KrjIJrzRlRkM5QIQLUYqYaYh84Xyj/uLZAkAEEi5yKwBaZHDBvT2vvMw 7mt3EEy6vk2ahfYL/sfFaObg3T8jlQoeE/KxA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727175838; x=1727780638; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=pilcf9aNKRLy8d6JiUspRF8gMb/GojilYehEApJVc00=; b=pkwI1EA+52H4ATtFgG4xpQeQgH8gyl+Ve+HNG24pei8t8OFuLI3TVNYaaEOUBcTCx2 gUazAJhRYtbIpmX4ofMJQOMudz7WPvb7jEwAlpn4km1dLtm3EknM/lYC0ngO199YUJC2 RX4jFnyltqRTDk59m29TYmeF+/Q+njM5y/HKs1YXUF4nhIctL8wqOLjB1K3sCPOFYZed zkFzeh8Tu1EIhZE/6sPTDGpqk8RnqQrUMefSYItezA70dgADTpBTw03KAP8LDSf3COF5 6fQjv/V9AnglENxMH1B0V4TQaXcRpomxQT/LuKymF8TUxc/n2v32PXnFwH5stAfP1HRx /Kmw== X-Gm-Message-State: AOJu0YzDJvY+0Yb8HfPdUgbqJl9x3DalA1mMBOgQv+DT0+657tSsKi6M atv7oBmVLbrs3Uq5SRZRu5F2esSM9kTrLzUz0zA0PewUpk3oWGQTDo2Bvjs31BiEv9tMWWd1Wm4 = X-Google-Smtp-Source: AGHT+IF3daJfK2F6NbeZaka38R4Atmm2xfV7hdsKuG+lYiwCNl7QV0O3pZW+R0A/VzwKNjBNp8dIZA== X-Received: by 2002:a05:6a21:9208:b0:1cf:5c1d:83dd with SMTP id adf61e73a8af0-1d30a92688dmr21442956637.2.1727175838629; Tue, 24 Sep 2024 04:03:58 -0700 (PDT) Received: from chenghaoyang-low.c.googlers.com.com (208.158.221.35.bc.googleusercontent.com. [35.221.158.208]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71afc9833c3sm993326b3a.182.2024.09.24.04.03.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Sep 2024 04:03:58 -0700 (PDT) From: Harvey Yang X-Google-Original-From: Harvey Yang To: libcamera-devel@lists.libcamera.org Cc: Harvey Yang Subject: [PATCH v7 0/3] Add Face Detection Controls Date: Tue, 24 Sep 2024 11:02:43 +0000 Message-ID: <20240924110353.2025397-1-chenghaoyang@google.com> X-Mailer: git-send-email 2.46.0.792.g87dc391469-goog MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Hi folks, This series of patches adds face detection controls in the control ids, the corresponding usages, and a c'tor of libcamera::Rectangle to construct it easiler with face detection results. It passed gitlab pipeline checks: https://gitlab.freedesktop.org/chenghaoyang/libcamera/-/pipelines/1276999 This is one of the series cherry-picked from cros mtkisp7 branch. The corresponding CLs in cros are: https://chromium-review.googlesource.com/c/chromiumos/third_party/libcamera/+/4741266 https://chromium-review.googlesource.com/c/chromiumos/third_party/libcamera/+/4741267 https://chromium-review.googlesource.com/c/chromiumos/third_party/libcamera/+/5669229 https://chromium-review.googlesource.com/c/chromiumos/third_party/libcamera/+/5669232 The usages in pipeline handler mtkisp7 will be added later. The checkstyle's suggestion on the second patch is ignored, as it changes the style of previous code. v7: Fixed comments. v6: - Added control_ids_android as the new control id list. - Moved the new control ids there, instead of in draft. v5: - Rewrote Rectangle's c'tor that allows any two diagonal points. - Added unit tests. v4: - Added support of FaceDetectModeFull and FaceDetectFaceIds. - Fixed descriptions of control sizes. v3: Applied fixes according to Jacopo's comments. - Moved the new face detection controls from core to draft. - Amended new controls' descriptions. v2: - Squashed the fourth CL into the last patch, as it's a fix. - Fixed CLs based on checkstyle's suggestions. Harvey Yang (1): libcamera: android: Add face detection control support Yudhistira Erlandinata (2): libcamera: Add rectangle two-point constructor libcamera: Add face detection controls include/libcamera/controls.h | 6 ++ include/libcamera/geometry.h | 7 ++ include/libcamera/meson.build | 3 +- src/android/camera_capabilities.cpp | 45 ++++++++++-- src/android/camera_device.cpp | 73 ++++++++++++++++++- src/libcamera/control_ids_android.yaml | 98 ++++++++++++++++++++++++++ src/libcamera/control_ranges.yaml | 4 +- src/libcamera/controls.cpp | 6 ++ src/libcamera/geometry.cpp | 7 ++ test/geometry.cpp | 14 ++++ 10 files changed, 255 insertions(+), 8 deletions(-) create mode 100644 src/libcamera/control_ids_android.yaml