[{"id":4504,"web_url":"https://patchwork.libcamera.org/comment/4504/","msgid":"<20200425005029.GA19672@pendragon.ideasonboard.com>","date":"2020-04-25T00:50:29","subject":"Re: [libcamera-devel] [PATCH v3 01/13] libcamera: geometry: Rename\n\tRectangle fields","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nThank you for the patch.\n\nOn Fri, Apr 24, 2020 at 11:52:52PM +0200, Jacopo Mondi wrote:\n> The Rectangle class members that represents the rectangle horizontal and\n> vertical sizes are named 'w' and 'h', in contrast with the Size and\n> SizeRange classes which use 'width' and 'height', resulting in having to\n> look at class definition every time to know which names to use.\n> \n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  include/libcamera/geometry.h         | 4 ++--\n>  src/libcamera/geometry.cpp           | 8 ++++----\n>  src/libcamera/pipeline/ipu3/ipu3.cpp | 4 ++--\n>  src/libcamera/v4l2_subdevice.cpp     | 8 ++++----\n>  src/libcamera/v4l2_videodevice.cpp   | 8 ++++----\n>  5 files changed, 16 insertions(+), 16 deletions(-)\n> \n> diff --git a/include/libcamera/geometry.h b/include/libcamera/geometry.h\n> index 7f1b29fe8c19..2d364891858c 100644\n> --- a/include/libcamera/geometry.h\n> +++ b/include/libcamera/geometry.h\n> @@ -15,8 +15,8 @@ namespace libcamera {\n>  struct Rectangle {\n>  \tint x;\n>  \tint y;\n> -\tunsigned int w;\n> -\tunsigned int h;\n> +\tunsigned int width;\n> +\tunsigned int height;\n>  \n>  \tconst std::string toString() const;\n>  };\n> diff --git a/src/libcamera/geometry.cpp b/src/libcamera/geometry.cpp\n> index 13f642be526f..fd78cf2c0ab7 100644\n> --- a/src/libcamera/geometry.cpp\n> +++ b/src/libcamera/geometry.cpp\n> @@ -40,12 +40,12 @@ namespace libcamera {\n>   */\n>  \n>  /**\n> - * \\var Rectangle::w\n> + * \\var Rectangle::width\n>   * \\brief The distance between the left and right sides\n>   */\n>  \n>  /**\n> - * \\var Rectangle::h\n> + * \\var Rectangle::height\n>   * \\brief The distance between the top and bottom sides\n>   */\n>  \n> @@ -57,7 +57,7 @@ const std::string Rectangle::toString() const\n>  {\n>  \tstd::stringstream ss;\n>  \n> -\tss << \"(\" << x << \"x\" << y << \")/\" << w << \"x\" << h;\n> +\tss << \"(\" << x << \"x\" << y << \")/\" << width << \"x\" << height;\n>  \n>  \treturn ss.str();\n>  }\n> @@ -69,7 +69,7 @@ const std::string Rectangle::toString() const\n>  bool operator==(const Rectangle &lhs, const Rectangle &rhs)\n>  {\n>  \treturn lhs.x == rhs.x && lhs.y == rhs.y &&\n> -\t       lhs.w == rhs.w && lhs.h == rhs.h;\n> +\t       lhs.width == rhs.width && lhs.height == rhs.height;\n>  }\n>  \n>  /**\n> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> index 36ac571a0b06..b45900159d06 100644\n> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> @@ -1132,8 +1132,8 @@ int ImgUDevice::configureInput(const Size &size,\n>  \tRectangle rect = {\n>  \t\t.x = 0,\n>  \t\t.y = 0,\n> -\t\t.w = inputFormat->size.width,\n> -\t\t.h = inputFormat->size.height,\n> +\t\t.width = inputFormat->size.width,\n> +\t\t.height = inputFormat->size.height,\n>  \t};\n>  \tret = imgu_->setCrop(PAD_INPUT, &rect);\n>  \tif (ret)\n> diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp\n> index c28e591ba51a..5a479a96b795 100644\n> --- a/src/libcamera/v4l2_subdevice.cpp\n> +++ b/src/libcamera/v4l2_subdevice.cpp\n> @@ -355,8 +355,8 @@ int V4L2Subdevice::setSelection(unsigned int pad, unsigned int target,\n>  \n>  \tsel.r.left = rect->x;\n>  \tsel.r.top = rect->y;\n> -\tsel.r.width = rect->w;\n> -\tsel.r.height = rect->h;\n> +\tsel.r.width = rect->width;\n> +\tsel.r.height = rect->height;\n>  \n>  \tint ret = ioctl(VIDIOC_SUBDEV_S_SELECTION, &sel);\n>  \tif (ret < 0) {\n> @@ -368,8 +368,8 @@ int V4L2Subdevice::setSelection(unsigned int pad, unsigned int target,\n>  \n>  \trect->x = sel.r.left;\n>  \trect->y = sel.r.top;\n> -\trect->w = sel.r.width;\n> -\trect->h = sel.r.height;\n> +\trect->width = sel.r.width;\n> +\trect->height = sel.r.height;\n>  \n>  \treturn 0;\n>  }\n> diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\n> index a959cfe65c43..beeec3ebe869 100644\n> --- a/src/libcamera/v4l2_videodevice.cpp\n> +++ b/src/libcamera/v4l2_videodevice.cpp\n> @@ -1121,8 +1121,8 @@ int V4L2VideoDevice::setSelection(unsigned int target, Rectangle *rect)\n>  \n>  \tsel.r.left = rect->x;\n>  \tsel.r.top = rect->y;\n> -\tsel.r.width = rect->w;\n> -\tsel.r.height = rect->h;\n> +\tsel.r.width = rect->width;\n> +\tsel.r.height = rect->height;\n>  \n>  \tint ret = ioctl(VIDIOC_S_SELECTION, &sel);\n>  \tif (ret < 0) {\n> @@ -1133,8 +1133,8 @@ int V4L2VideoDevice::setSelection(unsigned int target, Rectangle *rect)\n>  \n>  \trect->x = sel.r.left;\n>  \trect->y = sel.r.top;\n> -\trect->w = sel.r.width;\n> -\trect->h = sel.r.height;\n> +\trect->width = sel.r.width;\n> +\trect->height = sel.r.height;\n>  \n>  \treturn 0;\n>  }","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D80B062E45\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 25 Apr 2020 02:50:44 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 4D01E4F7;\n\tSat, 25 Apr 2020 02:50:44 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"KJ/KHy03\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1587775844;\n\tbh=zo8lW0GgfGWcpzetc/wpgqS9vML7gZOLKe0xn2mR7Uk=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=KJ/KHy03S+vvaavNU4qIduW11PBdMMKAynHURvl+He+rJCvjJdfwc4AZisd61o5I5\n\tizhpdjAy8qrsTdzFyDQNomHDwSqmzOtzHsEK5ea48bgO6YYONZsXonB3AbUbuGRtSO\n\tKtZrYEUy0jKIS2RLFjckYagc7QYhj0yHSmP5ud2Y=","Date":"Sat, 25 Apr 2020 03:50:29 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20200425005029.GA19672@pendragon.ideasonboard.com>","References":"<20200424215304.558317-1-jacopo@jmondi.org>\n\t<20200424215304.558317-2-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20200424215304.558317-2-jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [PATCH v3 01/13] libcamera: geometry: Rename\n\tRectangle fields","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Sat, 25 Apr 2020 00:50:45 -0000"}}]