From patchwork Tue Nov 24 17:46:31 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 29086 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 9D13BBDE17 for ; Tue, 24 Nov 2026 17:46:37 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7BE586A9D9; Tue, 24 Nov 2026 18:46:36 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="JreLQSb6"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A0E206A9D4 for ; Tue, 24 Nov 2026 18:46:34 +0100 (CET) Received: from pb-laptop.local (185.182.215.119.nat.pool.zt.hu [185.182.215.119]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 7ABA2B5 for ; Tue, 24 Nov 2026 18:44:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1795542241; bh=LZBMTNlvu46Pw1otvLrMsZ3jN3IOS8pn/c8Vp0JJayc=; h=From:To:Subject:Date:From; b=JreLQSb6W7Fga2z/rspvdxkO9sva9McUJNRsG2bVXQyGsofSEyfqHMs9AbdcBfc9X 6XCAQ3451hW+GmwOWDOSwk1stGJywAEFF2gS4Is03rgy2H9VJBfPSEe1VdYjnmYnRx uslLdr6YnWpha4ntwqk0qWzMrbMz4OwXTBITNiKk= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [PATCH v1] libcamera: geometry: Mark `SizeRange` constructors constexpr Date: Tue, 24 Nov 2026 18:46:31 +0100 Message-ID: <20261124174631.1344455-1-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.56.1 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" The other geometry related types already have `constexpr` constructors, so make the `SizeRange` type have `constexpr` constructors as well. Signed-off-by: Barnabás Pőcze --- include/libcamera/geometry.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/libcamera/geometry.h b/include/libcamera/geometry.h index 572a07e2cf..d203483891 100644 --- a/include/libcamera/geometry.h +++ b/include/libcamera/geometry.h @@ -204,22 +204,22 @@ std::ostream &operator<<(std::ostream &out, const Size &s); class SizeRange { public: - SizeRange() + constexpr SizeRange() : hStep(0), vStep(0) { } - SizeRange(const Size &size) + constexpr SizeRange(const Size &size) : min(size), max(size), hStep(1), vStep(1) { } - SizeRange(const Size &minSize, const Size &maxSize) + constexpr SizeRange(const Size &minSize, const Size &maxSize) : min(minSize), max(maxSize), hStep(1), vStep(1) { } - SizeRange(const Size &minSize, const Size &maxSize, + constexpr SizeRange(const Size &minSize, const Size &maxSize, unsigned int hstep, unsigned int vstep) : min(minSize), max(maxSize), hStep(hstep), vStep(vstep) {