From patchwork Tue Jul 14 23:40:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 8804 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 5BB0CBDB1C for ; Tue, 14 Jul 2020 23:40:25 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 24AD260939; Wed, 15 Jul 2020 01:40:25 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="KhN+u/85"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A5EB260905 for ; Wed, 15 Jul 2020 01:40:21 +0200 (CEST) Received: from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 4701671D for ; Wed, 15 Jul 2020 01:40:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1594770021; bh=detGMdE8pu6zBfzhpVatFuJPitvKO/s97GBeJhxMryI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=KhN+u/85DacML7Liw4Yj4EoaBSMmzCeUo9WeXgqlrVVK9c6LgsXsLXBKAmcfV413O cc/SW3Pqq/Fnsf6CPK2tWs7ttZQjgfGXiHxnXYCm1QVlY4pQmjxVbQTbocB/LdsE/g 66StzPKZ+y5yT29Wf+81KuiW6+SM0jFovNXjiQq4= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Wed, 15 Jul 2020 02:40:08 +0300 Message-Id: <20200714234009.16596-5-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200714234009.16596-1-laurent.pinchart@ideasonboard.com> References: <20200714234009.16596-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 4/5] libcamera: geometry: Turn Size and Rectangle into classes 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" SizeRange is defined as a class while Size and Rectangle are defined as struct. This is confusing for users in forward declarations. Simplify it by turning both structures into classes. Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund --- include/libcamera/geometry.h | 10 +++++++--- src/libcamera/pipeline/ipu3/cio2.h | 2 +- src/libcamera/pipeline/ipu3/imgu.h | 2 +- src/libcamera/pipeline/simple/converter.h | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/include/libcamera/geometry.h b/include/libcamera/geometry.h index 380248ac9a50..16c94a4861d6 100644 --- a/include/libcamera/geometry.h +++ b/include/libcamera/geometry.h @@ -2,7 +2,7 @@ /* * Copyright (C) 2019, Google Inc. * - * geometry.h - Geometry-related structure + * geometry.h - Geometry-related classes */ #ifndef __LIBCAMERA_GEOMETRY_H__ @@ -13,7 +13,9 @@ namespace libcamera { -struct Size { +class Size +{ +public: Size() : Size(0, 0) { @@ -126,7 +128,9 @@ static inline bool operator!=(const SizeRange &lhs, const SizeRange &rhs) return !(lhs == rhs); } -struct Rectangle { +class Rectangle +{ +public: Rectangle() : Rectangle(0, 0, 0, 0) { diff --git a/src/libcamera/pipeline/ipu3/cio2.h b/src/libcamera/pipeline/ipu3/cio2.h index 4fd949f8e513..956355a0aa58 100644 --- a/src/libcamera/pipeline/ipu3/cio2.h +++ b/src/libcamera/pipeline/ipu3/cio2.h @@ -21,8 +21,8 @@ class CameraSensor; class FrameBuffer; class MediaDevice; class Request; +class Size; class V4L2Subdevice; -struct Size; struct StreamConfiguration; class CIO2Device diff --git a/src/libcamera/pipeline/ipu3/imgu.h b/src/libcamera/pipeline/ipu3/imgu.h index 5c124af2e9fe..23ec1ca1c6ae 100644 --- a/src/libcamera/pipeline/ipu3/imgu.h +++ b/src/libcamera/pipeline/ipu3/imgu.h @@ -17,7 +17,7 @@ namespace libcamera { class FrameBuffer; class MediaDevice; -struct Size; +class Size; struct StreamConfiguration; class ImgUDevice diff --git a/src/libcamera/pipeline/simple/converter.h b/src/libcamera/pipeline/simple/converter.h index 8ca88912b4be..78296680aa14 100644 --- a/src/libcamera/pipeline/simple/converter.h +++ b/src/libcamera/pipeline/simple/converter.h @@ -20,7 +20,7 @@ namespace libcamera { class FrameBuffer; class MediaDevice; -struct Size; +class Size; class SizeRange; struct StreamConfiguration; class V4L2M2MDevice;