From patchwork Mon Sep 28 11:13:58 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Scally X-Patchwork-Id: 28388 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 291A7BDCBC for ; Mon, 28 Sep 2026 11:14:24 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E374768A5C; Mon, 28 Sep 2026 13:14:19 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="X95WpQWt"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 32FFB68A4B for ; Mon, 28 Sep 2026 13:14:15 +0200 (CEST) Received: from [127.0.1.1] (chfd-03-b2-v4wan-176392-cust229.vm15.cable.virginm.net [82.19.20.230]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id B26E813D9; Mon, 28 Sep 2026 13:12:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1790593944; bh=jHByg/sDAjHaCoGYfgbJUrD7r54dF9uBkw8vTovkmCc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=X95WpQWtS2Oe1IDUj4WmsXlKJv7/R+2tzZ6xNzycsyZf+Zv5yrG0LmiOJbCQ97MOp +0NklLDssbT+1x81KC1nrQUN0p++hqSHIDP0aWTx61jPH82f66YZP68+VFQtjDNubF cCE3TDVqHjENhptGVdzt24n8Fu/BYhM7PsZxFGWk= From: Daniel Scally Date: Mon, 28 Sep 2026 12:13:58 +0100 Subject: [PATCH 2/5] libcamera: vector: Add more comparison operators MIME-Version: 1.0 Message-Id: <20260928-awb-state-v1-2-9b1bb8b9e51b@ideasonboard.com> References: <20260928-awb-state-v1-0-9b1bb8b9e51b@ideasonboard.com> In-Reply-To: <20260928-awb-state-v1-0-9b1bb8b9e51b@ideasonboard.com> To: libcamera-devel@lists.libcamera.org Cc: Daniel Scally X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1834; i=dan.scally@ideasonboard.com; h=from:subject:message-id; bh=jHByg/sDAjHaCoGYfgbJUrD7r54dF9uBkw8vTovkmCc=; b=owEBbQKS/ZANAwAKAchJV3psRXUyAcsmYgBqukwFvrSinWevG91849lLq7DopsnhivR0PixOz fxaRiBrueyJAjMEAAEKAB0WIQQqyuwyDnZdb+mxmm/ISVd6bEV1MgUCarpMBQAKCRDISVd6bEV1 MoXpD/9Vh42TQMrw47M/W5fWWTXEFCXna/AMWcmMuFyq0h5xhCgYdEL+JoU+iWMKFft+trnZcmx 3Q8ugO2mAeRLNPKbexZ6jpdJd4QDRJmB5l3FNEXeOaEH/oAuXlZamp54Ri8fYJlC/9z8ab/fKXb GUbTXP5MFdIJWa8YVLooyx9pcSY7YwGnRc28ZftsDPDqW4YOCS8qk0x/j8Lvx3OENfrLRoBk+nr vkt+JeXCDu6E1SuhoTYmzR3KxKeAOHYF7TBbM+IOh/iwIWLSJXRSh+gbsKVg1loq76iwyEHJK7U iwNQ3yKHDaS+Or0ZZZkRBSY8t2Fi1a6rVPugxZieuUDzY/3HqbM7ojcMT56VbGjVUBSwHgGD8Bc ec1jyfUMIgjySDJpPB7Qv0o4FZikZbBR95oY/VV8gu+RSxLwMVMarAfycu49VTvSEzFxacf9O+k VOqgc8ep/eP/JzzdFcYYRIAuVAk513Mq15qSlj//7azbNjTrOhJjbe7XPEqR7xoKRyuIyRCwPrJ 4dvjJv0CpIBYGNWmJrh7wqJnfdZnYaWMP7yZn/5rUTMdJ0Nq0UAtT2TQaILJxN/jfgucadnGke3 FXMDZghdeS9rHQVyCH84bPPBoOMwegcSG8+PsR99G2386GwZANd5suZ2K2/RnBsv6SS8eeXYcdR zjZwsERrtuj893g== X-Developer-Key: i=dan.scally@ideasonboard.com; a=openpgp; fpr=EEC699ACA1B7CB5D31330C0BBD501C2A3546CCF6 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" We want to be able to compare Vectors of gains to see if any of the vector values are larger / smaller than the other. Add four new operators for <, >, <= and >=. Signed-off-by: Daniel Scally --- include/libcamera/internal/vector.h | 44 +++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/include/libcamera/internal/vector.h b/include/libcamera/internal/vector.h index 4fb610dbc0aec12a934d7f971c8ee62375a6d726..b89239aa9253209726450a63f29af97b8a808cb8 100644 --- a/include/libcamera/internal/vector.h +++ b/include/libcamera/internal/vector.h @@ -343,6 +343,50 @@ bool operator==(const Vector &lhs, const Vector &rhs) return true; } +template +bool operator>(const Vector &lhs, const Vector &rhs) +{ + for (unsigned int i = 0; i < Rows; i++) { + if (lhs[i] > rhs[i]) + return true; + } + + return false; +} + +template +bool operator>=(const Vector &lhs, const Vector &rhs) +{ + for (unsigned int i = 0; i < Rows; i++) { + if (lhs[i] >= rhs[i]) + return true; + } + + return false; +} + +template +bool operator<=(const Vector &lhs, const Vector &rhs) +{ + for (unsigned int i = 0; i < Rows; i++) { + if (lhs[i] <= rhs[i]) + return true; + } + + return false; +} + +template +bool operator<(const Vector &lhs, const Vector &rhs) +{ + for (unsigned int i = 0; i < Rows; i++) { + if (lhs[i] < rhs[i]) + return true; + } + + return false; +} + template bool operator!=(const Vector &lhs, const Vector &rhs) {