From patchwork Fri Apr 24 21:52:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 3519 Return-Path: Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B9AD5603FC for ; Fri, 24 Apr 2020 23:50:02 +0200 (CEST) X-Originating-IP: 87.3.55.240 Received: from uno.homenet.telecomitalia.it (host240-55-dynamic.3-87-r.retail.telecomitalia.it [87.3.55.240]) (Authenticated sender: jacopo@jmondi.org) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id EB12460002; Fri, 24 Apr 2020 21:50:01 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Fri, 24 Apr 2020 23:52:52 +0200 Message-Id: <20200424215304.558317-2-jacopo@jmondi.org> X-Mailer: git-send-email 2.26.1 In-Reply-To: <20200424215304.558317-1-jacopo@jmondi.org> References: <20200424215304.558317-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 01/13] libcamera: geometry: Rename Rectangle fields 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: , X-List-Received-Date: Fri, 24 Apr 2020 21:50:02 -0000 The Rectangle class members that represents the rectangle horizontal and vertical sizes are named 'w' and 'h', in contrast with the Size and SizeRange classes which use 'width' and 'height', resulting in having to look at class definition every time to know which names to use. Signed-off-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- include/libcamera/geometry.h | 4 ++-- src/libcamera/geometry.cpp | 8 ++++---- src/libcamera/pipeline/ipu3/ipu3.cpp | 4 ++-- src/libcamera/v4l2_subdevice.cpp | 8 ++++---- src/libcamera/v4l2_videodevice.cpp | 8 ++++---- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/include/libcamera/geometry.h b/include/libcamera/geometry.h index 7f1b29fe8c19..2d364891858c 100644 --- a/include/libcamera/geometry.h +++ b/include/libcamera/geometry.h @@ -15,8 +15,8 @@ namespace libcamera { struct Rectangle { int x; int y; - unsigned int w; - unsigned int h; + unsigned int width; + unsigned int height; const std::string toString() const; }; diff --git a/src/libcamera/geometry.cpp b/src/libcamera/geometry.cpp index 13f642be526f..fd78cf2c0ab7 100644 --- a/src/libcamera/geometry.cpp +++ b/src/libcamera/geometry.cpp @@ -40,12 +40,12 @@ namespace libcamera { */ /** - * \var Rectangle::w + * \var Rectangle::width * \brief The distance between the left and right sides */ /** - * \var Rectangle::h + * \var Rectangle::height * \brief The distance between the top and bottom sides */ @@ -57,7 +57,7 @@ const std::string Rectangle::toString() const { std::stringstream ss; - ss << "(" << x << "x" << y << ")/" << w << "x" << h; + ss << "(" << x << "x" << y << ")/" << width << "x" << height; return ss.str(); } @@ -69,7 +69,7 @@ const std::string Rectangle::toString() const bool operator==(const Rectangle &lhs, const Rectangle &rhs) { return lhs.x == rhs.x && lhs.y == rhs.y && - lhs.w == rhs.w && lhs.h == rhs.h; + lhs.width == rhs.width && lhs.height == rhs.height; } /** diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index 36ac571a0b06..b45900159d06 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -1132,8 +1132,8 @@ int ImgUDevice::configureInput(const Size &size, Rectangle rect = { .x = 0, .y = 0, - .w = inputFormat->size.width, - .h = inputFormat->size.height, + .width = inputFormat->size.width, + .height = inputFormat->size.height, }; ret = imgu_->setCrop(PAD_INPUT, &rect); if (ret) diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp index c28e591ba51a..5a479a96b795 100644 --- a/src/libcamera/v4l2_subdevice.cpp +++ b/src/libcamera/v4l2_subdevice.cpp @@ -355,8 +355,8 @@ int V4L2Subdevice::setSelection(unsigned int pad, unsigned int target, sel.r.left = rect->x; sel.r.top = rect->y; - sel.r.width = rect->w; - sel.r.height = rect->h; + sel.r.width = rect->width; + sel.r.height = rect->height; int ret = ioctl(VIDIOC_SUBDEV_S_SELECTION, &sel); if (ret < 0) { @@ -368,8 +368,8 @@ int V4L2Subdevice::setSelection(unsigned int pad, unsigned int target, rect->x = sel.r.left; rect->y = sel.r.top; - rect->w = sel.r.width; - rect->h = sel.r.height; + rect->width = sel.r.width; + rect->height = sel.r.height; return 0; } diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp index a959cfe65c43..beeec3ebe869 100644 --- a/src/libcamera/v4l2_videodevice.cpp +++ b/src/libcamera/v4l2_videodevice.cpp @@ -1121,8 +1121,8 @@ int V4L2VideoDevice::setSelection(unsigned int target, Rectangle *rect) sel.r.left = rect->x; sel.r.top = rect->y; - sel.r.width = rect->w; - sel.r.height = rect->h; + sel.r.width = rect->width; + sel.r.height = rect->height; int ret = ioctl(VIDIOC_S_SELECTION, &sel); if (ret < 0) { @@ -1133,8 +1133,8 @@ int V4L2VideoDevice::setSelection(unsigned int target, Rectangle *rect) rect->x = sel.r.left; rect->y = sel.r.top; - rect->w = sel.r.width; - rect->h = sel.r.height; + rect->width = sel.r.width; + rect->height = sel.r.height; return 0; }