From patchwork Mon Sep 23 14:45:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harvey Yang X-Patchwork-Id: 21334 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 7E000C0F1B for ; Mon, 23 Sep 2024 14:49:32 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id AE4C96037E; Mon, 23 Sep 2024 16:49:31 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="F1Pm6BS9"; dkim-atps=neutral Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A980D6037E for ; Mon, 23 Sep 2024 16:49:29 +0200 (CEST) Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-2057c6c57b5so26785085ad.1 for ; Mon, 23 Sep 2024 07:49:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727102968; x=1727707768; 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=vcnUXSKSGMw58q684C0Vc0QM95lUGpHcGZC31UT2GyM=; b=F1Pm6BS9ZLsQFzHAwFNkcZEn6fyNXOUQGTMCxulIfCmzGwASTfzOebnkQ5CMrUlXEf 6rfhqyMb0CgZ8dm7m423QUJVdpu1AD4aSrHc56uYcFRTb6GLm4BwHGUhtGHd94Vo3cRa zqfA/hjSY8NzBk31cvxntPh+m0EH6lT9iN/VE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727102968; x=1727707768; 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=vcnUXSKSGMw58q684C0Vc0QM95lUGpHcGZC31UT2GyM=; b=iX93uezf6fjtJ2RK5PnSxDgWnfSldjlbIMUwOCuVaG7nBAj8eBDm9ozy1ruh1BRbiG 3gc3V7G4Y6jLZkSq6WBoKmlaM84dsHEEFUg04cyHF3u8XXst6krdFtQKJ8L1CPI08vPW lP1HDf9nJtQkcJv5UqUf6oQqpktO1T20rRW4WDLgJ3lxcG6K+7cnwp3WWsFqR9ZLeYs3 6eNwzvw2FyZpNuHESb2VLpwogKkByJR3ffGty2NhVQHp/FHxuXHfWJXZdwqvoItE3xSJ yof/14E4ac3KKaiJLh1lcSF2a8PqeBC3Rtk6WOTKtUAB8jxVJcYnyQbOpE3ncY0JkpVF uvzw== X-Gm-Message-State: AOJu0Ywb3UWHYvg5+xsqbtyXRoSSs+D4rme7OAQnBe0mOcw9lhe1e4Nb TBz2r+unG5TCvDwvx8OKx6WMxmJPQo081rJ6S+T1dX4AEK0EIQmwfDzbgFnj7bNM/2p9/ne/CHQ = X-Google-Smtp-Source: AGHT+IF9bsGUJ3JWAB5Rq4Poq4iWBExDH6HICQOGiIzb5f2vdDqbapL/+fafxurnf01Zeq9uQCoTsA== X-Received: by 2002:a17:902:e80e:b0:205:6121:1b2d with SMTP id d9443c01a7336-208cb895e5cmr240684765ad.3.1727102967777; Mon, 23 Sep 2024 07:49:27 -0700 (PDT) Received: from chenghaoyang-low.c.googlers.com.com (0.223.81.34.bc.googleusercontent.com. [34.81.223.0]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20794735719sm133857435ad.275.2024.09.23.07.49.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 07:49:27 -0700 (PDT) From: Harvey Yang X-Google-Original-From: Harvey Yang To: libcamera-devel@lists.libcamera.org Cc: Harvey Yang Subject: [PATCH v6 0/3] Add Face Detection Controls Date: Mon, 23 Sep 2024 14:45:02 +0000 Message-ID: <20240923144921.1729183-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/1276509 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. 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 | 1 + src/libcamera/controls.cpp | 6 ++ src/libcamera/geometry.cpp | 7 ++ test/geometry.cpp | 14 ++++ 10 files changed, 253 insertions(+), 7 deletions(-) create mode 100644 src/libcamera/control_ids_android.yaml