[{"id":11400,"web_url":"https://patchwork.libcamera.org/comment/11400/","msgid":"<20200715063345.GF3051471@oden.dyn.berto.se>","date":"2020-07-15T06:33:45","subject":"Re: [libcamera-devel] [PATCH 3/5] libcamera: geometry: Give\n\tconstructors to Rectangle","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Laurent,\n\nThanks for your work.\n\nOn 2020-07-15 02:40:07 +0300, Laurent Pinchart wrote:\n> Rectangle, unlike Size, has no constructor, requiring the users to\n> explicitly initialize the instances. This is error-prone, add\n> constructors.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>  include/libcamera/geometry.h                  | 15 +++++++++++++\n>  src/libcamera/camera_sensor.cpp               |  2 +-\n>  src/libcamera/geometry.cpp                    | 22 +++++++++++++++++++\n>  src/libcamera/pipeline/ipu3/imgu.cpp          |  7 +-----\n>  .../pipeline/raspberrypi/raspberrypi.cpp      |  7 +-----\n>  src/libcamera/pipeline/vimc/vimc.cpp          |  7 +-----\n>  6 files changed, 41 insertions(+), 19 deletions(-)\n> \n> diff --git a/include/libcamera/geometry.h b/include/libcamera/geometry.h\n> index f3088d33fa2c..380248ac9a50 100644\n> --- a/include/libcamera/geometry.h\n> +++ b/include/libcamera/geometry.h\n> @@ -127,6 +127,21 @@ static inline bool operator!=(const SizeRange &lhs, const SizeRange &rhs)\n>  }\n>  \n>  struct Rectangle {\n\nI wonder if we should not turn Size and Rectangle into classes instead \nof structs when we start to add methods to them. Or is there an \nadvantage to keep them as structs?\n\n> +\tRectangle()\n> +\t\t: Rectangle(0, 0, 0, 0)\n> +\t{\n> +\t}\n> +\n> +\tRectangle(int xpos, int ypos, const Size &size)\n> +\t\t: x(xpos), y(ypos), width(size.width), height(size.height)\n> +\t{\n> +\t}\n> +\n> +\tRectangle(int xpos, int ypos, unsigned int w, unsigned int h)\n> +\t\t: x(xpos), y(ypos), width(w), height(h)\n> +\t{\n> +\t}\n> +\n>  \tint x;\n>  \tint y;\n>  \tunsigned int width;\n> diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp\n> index b14b4051dca6..6e93cc51155b 100644\n> --- a/src/libcamera/camera_sensor.cpp\n> +++ b/src/libcamera/camera_sensor.cpp\n> @@ -487,7 +487,7 @@ int CameraSensor::sensorInfo(CameraSensorInfo *info) const\n>  \tinfo->model = model();\n>  \n>  \t/* Get the active area size. */\n> -\tRectangle rect = {};\n> +\tRectangle rect;\n>  \tint ret = subdev_->getSelection(pad_, V4L2_SEL_TGT_CROP_DEFAULT, &rect);\n>  \tif (ret) {\n>  \t\tLOG(CameraSensor, Error)\n> diff --git a/src/libcamera/geometry.cpp b/src/libcamera/geometry.cpp\n> index 5a0bcf7c1e12..3a3784df39e6 100644\n> --- a/src/libcamera/geometry.cpp\n> +++ b/src/libcamera/geometry.cpp\n> @@ -297,6 +297,28 @@ bool operator==(const SizeRange &lhs, const SizeRange &rhs)\n>   * refers to, are defined by the context were rectangle is used.\n>   */\n>  \n> +/**\n> + * \\fn Rectangle::Rectangle()\n> + * \\brief Construct a Rectangle with all coordinates set to 0\n> + */\n> +\n> +/**\n> + * \\fn Rectangle::Rectangle(int x, int y, const Size &size)\n> + * \\brief Construct a Rectangle with the given position and size\n> + * \\param[in] x The horizontal coordinate of the top-left corner\n> + * \\param[in] y The vertical coordinate of the top-left corner\n> + * \\param[in] size The size\n> + */\n> +\n> +/**\n> + * \\fn Rectangle::Rectangle(int x, int y, unsigned int width, unsigned int height)\n> + * \\brief Construct a Rectangle with the given position and size\n> + * \\param[in] x The horizontal coordinate of the top-left corner\n> + * \\param[in] y The vertical coordinate of the top-left corner\n> + * \\param[in] width The width\n> + * \\param[in] height The height\n> + */\n> +\n>  /**\n>   * \\var Rectangle::x\n>   * \\brief The horizontal coordinate of the rectangle's top-left corner\n> diff --git a/src/libcamera/pipeline/ipu3/imgu.cpp b/src/libcamera/pipeline/ipu3/imgu.cpp\n> index d7f4173d3607..4bec4b2f1a76 100644\n> --- a/src/libcamera/pipeline/ipu3/imgu.cpp\n> +++ b/src/libcamera/pipeline/ipu3/imgu.cpp\n> @@ -100,12 +100,7 @@ int ImgUDevice::configureInput(const Size &size,\n>  \t * to configure the crop/compose rectangles, contradicting the\n>  \t * V4L2 specification.\n>  \t */\n> -\tRectangle rect = {\n> -\t\t.x = 0,\n> -\t\t.y = 0,\n> -\t\t.width = inputFormat->size.width,\n> -\t\t.height = inputFormat->size.height,\n> -\t};\n> +\tRectangle rect{ 0, 0, inputFormat->size };\n\nOut out curiosity why do you use list initialization ?\n\nQuestions for my education apart,\n\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\n>  \tret = imgu_->setSelection(PAD_INPUT, V4L2_SEL_TGT_CROP, &rect);\n>  \tif (ret)\n>  \t\treturn ret;\n> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> index 009e502b288c..2d848ac3c735 100644\n> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> @@ -752,12 +752,7 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config)\n>  \t}\n>  \n>  \t/* Adjust aspect ratio by providing crops on the input image. */\n> -\tRectangle crop = {\n> -\t\t.x = 0,\n> -\t\t.y = 0,\n> -\t\t.width = sensorFormat.size.width,\n> -\t\t.height = sensorFormat.size.height\n> -\t};\n> +\tRectangle crop{ 0, 0, sensorFormat.size };\n>  \n>  \tint ar = maxSize.height * sensorFormat.size.width - maxSize.width * sensorFormat.size.height;\n>  \tif (ar > 0)\n> diff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp\n> index a6f457c71fb1..4f461b928514 100644\n> --- a/src/libcamera/pipeline/vimc/vimc.cpp\n> +++ b/src/libcamera/pipeline/vimc/vimc.cpp\n> @@ -256,12 +256,7 @@ int PipelineHandlerVimc::configure(Camera *camera, CameraConfiguration *config)\n>  \t\treturn ret;\n>  \n>  \tif (data->media_->version() >= KERNEL_VERSION(5, 6, 0)) {\n> -\t\tRectangle crop = {\n> -\t\t\t.x = 0,\n> -\t\t\t.y = 0,\n> -\t\t\t.width = subformat.size.width,\n> -\t\t\t.height = subformat.size.height,\n> -\t\t};\n> +\t\tRectangle crop{ 0, 0, subformat.size };\n>  \t\tret = data->scaler_->setSelection(0, V4L2_SEL_TGT_CROP, &crop);\n>  \t\tif (ret)\n>  \t\t\treturn ret;\n> -- \n> Regards,\n> \n> Laurent Pinchart\n> \n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 1BF3BBD792\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 15 Jul 2020 06:33:50 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6E99E60930;\n\tWed, 15 Jul 2020 08:33:49 +0200 (CEST)","from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com\n\t[IPv6:2a00:1450:4864:20::22d])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CC19D60925\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 15 Jul 2020 08:33:47 +0200 (CEST)","by mail-lj1-x22d.google.com with SMTP id b25so1287959ljp.6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 14 Jul 2020 23:33:47 -0700 (PDT)","from localhost (h-209-203.A463.priv.bahnhof.se. [155.4.209.203])\n\tby smtp.gmail.com with ESMTPSA id\n\tq23sm157185lfc.88.2020.07.14.23.33.45\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 14 Jul 2020 23:33:46 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=ragnatech-se.20150623.gappssmtp.com\n\theader.i=@ragnatech-se.20150623.gappssmtp.com\n\theader.b=\"zB8ss5Xa\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to;\n\tbh=CGCIelk/1rNvop9VBay6+jB+r9pHHx1uYYincWYEFkE=;\n\tb=zB8ss5XaZhRbGwUrCk+wfCto4iVmvtyW61Zr0rnFpZxuftkLObyCyYHMZJ3/63a4ll\n\tN9EEBxUpaELd/2nlVWmWkQSdb5ZjroIIonUrJcnCcdQ8B2WQdjC/0vjxHGD5DnHGQGZ3\n\taRyjp3pyMybqS/foJUsn9wiZ0t4nrczGcYUqBv11wsGHyfmfqvSX8rARxqlpwSY4BxUA\n\tyBKTlnxeEUFXepw/ZzSHh97zN+gGfJJXoGdOr+QCpoca+RdqFGkA+r8RKjRMaIn/+YjQ\n\tyEIji7h2e3jTvISK+0mLVwfD/YdkLoFpO6hHmrLfV1CxdbdSMdSYk/JlnT+gP8RuyPNt\n\tWXOw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to;\n\tbh=CGCIelk/1rNvop9VBay6+jB+r9pHHx1uYYincWYEFkE=;\n\tb=D9CTMJJvYao6RB6BqMElsMQUdiILG8JOCBA3lzI53hibwgNJssWISZq2ykT8UVxeGl\n\tA6cyXhZptDWRawgXPbRkJkIUVNh7Ae+OSQMuYwTIDDq836BhWB8H1CspnUC6vgah4Tgk\n\tEj8j5nev3CDtoKI5EiJ6Zq8wS7XJOp5VAYwI8ksOm+zBikQKB4OZXOg2vHlWLHzXAUjz\n\tu6z/wYrv2GZsKLWXuQceYwWh+5Ofrz23H6RfFJPXs3jrHXqqU0quuwQqYS5BBoBed+fH\n\t/0eF8yhS7GjDWgYS8C0Dw8kMtL7oxa0ZzSFQA848MbEZYiJ3gHE/hVxOWTBm/cUdp/mX\n\toPIg==","X-Gm-Message-State":"AOAM530fBF/rfit2/DiblaiUozRt/MmNWkVPgdodyqFoh17uevCbvpTR\n\t1zu8fOMwzd356+VRoLv28FnOHMeQLXU=","X-Google-Smtp-Source":"ABdhPJwyW4/ssb3qR4cMWuSQ+KwDujAQWIQn+PGCwl6nJuJV3EXDj7i1qwl7ceTnzLFAd+Xj5PFOIA==","X-Received":"by 2002:a2e:5141:: with SMTP id b1mr3753666lje.336.1594794827083;\n\tTue, 14 Jul 2020 23:33:47 -0700 (PDT)","Date":"Wed, 15 Jul 2020 08:33:45 +0200","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Message-ID":"<20200715063345.GF3051471@oden.dyn.berto.se>","References":"<20200714234009.16596-1-laurent.pinchart@ideasonboard.com>\n\t<20200714234009.16596-4-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20200714234009.16596-4-laurent.pinchart@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH 3/5] libcamera: geometry: Give\n\tconstructors to Rectangle","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>","Cc":"libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"iso-8859-1\"","Content-Transfer-Encoding":"quoted-printable","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":11405,"web_url":"https://patchwork.libcamera.org/comment/11405/","msgid":"<20200715093146.GA6144@pendragon.ideasonboard.com>","date":"2020-07-15T09:31:46","subject":"Re: [libcamera-devel] [PATCH 3/5] libcamera: geometry: Give\n\tconstructors to Rectangle","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Niklas,\n\nOn Wed, Jul 15, 2020 at 08:33:45AM +0200, Niklas Söderlund wrote:\n> On 2020-07-15 02:40:07 +0300, Laurent Pinchart wrote:\n> > Rectangle, unlike Size, has no constructor, requiring the users to\n> > explicitly initialize the instances. This is error-prone, add\n> > constructors.\n> > \n> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > ---\n> >  include/libcamera/geometry.h                  | 15 +++++++++++++\n> >  src/libcamera/camera_sensor.cpp               |  2 +-\n> >  src/libcamera/geometry.cpp                    | 22 +++++++++++++++++++\n> >  src/libcamera/pipeline/ipu3/imgu.cpp          |  7 +-----\n> >  .../pipeline/raspberrypi/raspberrypi.cpp      |  7 +-----\n> >  src/libcamera/pipeline/vimc/vimc.cpp          |  7 +-----\n> >  6 files changed, 41 insertions(+), 19 deletions(-)\n> > \n> > diff --git a/include/libcamera/geometry.h b/include/libcamera/geometry.h\n> > index f3088d33fa2c..380248ac9a50 100644\n> > --- a/include/libcamera/geometry.h\n> > +++ b/include/libcamera/geometry.h\n> > @@ -127,6 +127,21 @@ static inline bool operator!=(const SizeRange &lhs, const SizeRange &rhs)\n> >  }\n> >  \n> >  struct Rectangle {\n> \n> I wonder if we should not turn Size and Rectangle into classes instead \n> of structs when we start to add methods to them. Or is there an \n> advantage to keep them as structs?\n\nSee the rest of the series :-)\n\n> > +\tRectangle()\n> > +\t\t: Rectangle(0, 0, 0, 0)\n> > +\t{\n> > +\t}\n> > +\n> > +\tRectangle(int xpos, int ypos, const Size &size)\n> > +\t\t: x(xpos), y(ypos), width(size.width), height(size.height)\n> > +\t{\n> > +\t}\n> > +\n> > +\tRectangle(int xpos, int ypos, unsigned int w, unsigned int h)\n> > +\t\t: x(xpos), y(ypos), width(w), height(h)\n> > +\t{\n> > +\t}\n> > +\n> >  \tint x;\n> >  \tint y;\n> >  \tunsigned int width;\n> > diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp\n> > index b14b4051dca6..6e93cc51155b 100644\n> > --- a/src/libcamera/camera_sensor.cpp\n> > +++ b/src/libcamera/camera_sensor.cpp\n> > @@ -487,7 +487,7 @@ int CameraSensor::sensorInfo(CameraSensorInfo *info) const\n> >  \tinfo->model = model();\n> >  \n> >  \t/* Get the active area size. */\n> > -\tRectangle rect = {};\n> > +\tRectangle rect;\n> >  \tint ret = subdev_->getSelection(pad_, V4L2_SEL_TGT_CROP_DEFAULT, &rect);\n> >  \tif (ret) {\n> >  \t\tLOG(CameraSensor, Error)\n> > diff --git a/src/libcamera/geometry.cpp b/src/libcamera/geometry.cpp\n> > index 5a0bcf7c1e12..3a3784df39e6 100644\n> > --- a/src/libcamera/geometry.cpp\n> > +++ b/src/libcamera/geometry.cpp\n> > @@ -297,6 +297,28 @@ bool operator==(const SizeRange &lhs, const SizeRange &rhs)\n> >   * refers to, are defined by the context were rectangle is used.\n> >   */\n> >  \n> > +/**\n> > + * \\fn Rectangle::Rectangle()\n> > + * \\brief Construct a Rectangle with all coordinates set to 0\n> > + */\n> > +\n> > +/**\n> > + * \\fn Rectangle::Rectangle(int x, int y, const Size &size)\n> > + * \\brief Construct a Rectangle with the given position and size\n> > + * \\param[in] x The horizontal coordinate of the top-left corner\n> > + * \\param[in] y The vertical coordinate of the top-left corner\n> > + * \\param[in] size The size\n> > + */\n> > +\n> > +/**\n> > + * \\fn Rectangle::Rectangle(int x, int y, unsigned int width, unsigned int height)\n> > + * \\brief Construct a Rectangle with the given position and size\n> > + * \\param[in] x The horizontal coordinate of the top-left corner\n> > + * \\param[in] y The vertical coordinate of the top-left corner\n> > + * \\param[in] width The width\n> > + * \\param[in] height The height\n> > + */\n> > +\n> >  /**\n> >   * \\var Rectangle::x\n> >   * \\brief The horizontal coordinate of the rectangle's top-left corner\n> > diff --git a/src/libcamera/pipeline/ipu3/imgu.cpp b/src/libcamera/pipeline/ipu3/imgu.cpp\n> > index d7f4173d3607..4bec4b2f1a76 100644\n> > --- a/src/libcamera/pipeline/ipu3/imgu.cpp\n> > +++ b/src/libcamera/pipeline/ipu3/imgu.cpp\n> > @@ -100,12 +100,7 @@ int ImgUDevice::configureInput(const Size &size,\n> >  \t * to configure the crop/compose rectangles, contradicting the\n> >  \t * V4L2 specification.\n> >  \t */\n> > -\tRectangle rect = {\n> > -\t\t.x = 0,\n> > -\t\t.y = 0,\n> > -\t\t.width = inputFormat->size.width,\n> > -\t\t.height = inputFormat->size.height,\n> > -\t};\n> > +\tRectangle rect{ 0, 0, inputFormat->size };\n> \n> Out out curiosity why do you use list initialization ?\n> \n> Questions for my education apart,\n\nMostly because the code was already using curly braces :-)\n\nThere are a few important differences between \n\n\tRectangle rect{ 0, 0, inputFormat->size };\n\nand\n\n\tRectangle rect(0, 0, inputFormat->size);\n\nOne is that the former will not narrow arguments through implicit cast.\nSee https://en.cppreference.com/w/cpp/language/list_initialization:\n\n\"[...] all constructors of T participate in overload resolution against\nthe set of arguments that consists of the elements of the\nbraced-init-list, with the restriction that only non-narrowing\nconversions are allowed.\"\n\nIt's commonly considered as a good practice as the default\ninitialization mechanism. There are however drawbacks,\nhttps://stackoverflow.com/questions/18222926/why-is-list-initialization-using-curly-braces-better-than-the-alternatives\nexplains some of them.\n\n> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> \n> >  \tret = imgu_->setSelection(PAD_INPUT, V4L2_SEL_TGT_CROP, &rect);\n> >  \tif (ret)\n> >  \t\treturn ret;\n> > diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> > index 009e502b288c..2d848ac3c735 100644\n> > --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> > +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> > @@ -752,12 +752,7 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config)\n> >  \t}\n> >  \n> >  \t/* Adjust aspect ratio by providing crops on the input image. */\n> > -\tRectangle crop = {\n> > -\t\t.x = 0,\n> > -\t\t.y = 0,\n> > -\t\t.width = sensorFormat.size.width,\n> > -\t\t.height = sensorFormat.size.height\n> > -\t};\n> > +\tRectangle crop{ 0, 0, sensorFormat.size };\n> >  \n> >  \tint ar = maxSize.height * sensorFormat.size.width - maxSize.width * sensorFormat.size.height;\n> >  \tif (ar > 0)\n> > diff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp\n> > index a6f457c71fb1..4f461b928514 100644\n> > --- a/src/libcamera/pipeline/vimc/vimc.cpp\n> > +++ b/src/libcamera/pipeline/vimc/vimc.cpp\n> > @@ -256,12 +256,7 @@ int PipelineHandlerVimc::configure(Camera *camera, CameraConfiguration *config)\n> >  \t\treturn ret;\n> >  \n> >  \tif (data->media_->version() >= KERNEL_VERSION(5, 6, 0)) {\n> > -\t\tRectangle crop = {\n> > -\t\t\t.x = 0,\n> > -\t\t\t.y = 0,\n> > -\t\t\t.width = subformat.size.width,\n> > -\t\t\t.height = subformat.size.height,\n> > -\t\t};\n> > +\t\tRectangle crop{ 0, 0, subformat.size };\n> >  \t\tret = data->scaler_->setSelection(0, V4L2_SEL_TGT_CROP, &crop);\n> >  \t\tif (ret)\n> >  \t\t\treturn ret;","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 0369CBD790\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 15 Jul 2020 09:31:55 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 63D4260940;\n\tWed, 15 Jul 2020 11:31:54 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id BDCFA6048C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 15 Jul 2020 11:31:53 +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 41A0F564;\n\tWed, 15 Jul 2020 11:31:53 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"v21eHwhF\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1594805513;\n\tbh=SpvKwO90R6PM618G61MoMHYtVzze0TQkxrJ03+eJ/VA=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=v21eHwhFZSRHE0lmXGDu03QJ8gKnm8y7GP26lasv8TOxyduHnQVBYeXxAJUSczKgN\n\te4J4L0Gg25XtcXIyk2pfewT2ZC1YHoUIJDkX3P8S5OWMrXLhE+qjhP/0FIGsMW6A6I\n\taCc4uMQQ+IBdLEAGyujWRs9gOnsHRDsmbVJSG/VQ=","Date":"Wed, 15 Jul 2020 12:31:46 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Niklas =?utf-8?q?S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","Message-ID":"<20200715093146.GA6144@pendragon.ideasonboard.com>","References":"<20200714234009.16596-1-laurent.pinchart@ideasonboard.com>\n\t<20200714234009.16596-4-laurent.pinchart@ideasonboard.com>\n\t<20200715063345.GF3051471@oden.dyn.berto.se>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20200715063345.GF3051471@oden.dyn.berto.se>","Subject":"Re: [libcamera-devel] [PATCH 3/5] libcamera: geometry: Give\n\tconstructors to Rectangle","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>","Cc":"libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]