[{"id":11401,"web_url":"https://patchwork.libcamera.org/comment/11401/","msgid":"<20200715063517.GG3051471@oden.dyn.berto.se>","date":"2020-07-15T06:35:17","subject":"Re: [libcamera-devel] [PATCH 4/5] libcamera: geometry: Turn Size\n\tand Rectangle into classes","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:08 +0300, Laurent Pinchart wrote:\n> SizeRange is defined as a class while Size and Rectangle are defined as\n> struct. This is confusing for users in forward declarations. Simplify it\n> by turning both structures into classes.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nAhh, maybe I shall finish my morning coffee before I start my review \nround :-)\n\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\n> ---\n>  include/libcamera/geometry.h              | 10 +++++++---\n>  src/libcamera/pipeline/ipu3/cio2.h        |  2 +-\n>  src/libcamera/pipeline/ipu3/imgu.h        |  2 +-\n>  src/libcamera/pipeline/simple/converter.h |  2 +-\n>  4 files changed, 10 insertions(+), 6 deletions(-)\n> \n> diff --git a/include/libcamera/geometry.h b/include/libcamera/geometry.h\n> index 380248ac9a50..16c94a4861d6 100644\n> --- a/include/libcamera/geometry.h\n> +++ b/include/libcamera/geometry.h\n> @@ -2,7 +2,7 @@\n>  /*\n>   * Copyright (C) 2019, Google Inc.\n>   *\n> - * geometry.h - Geometry-related structure\n> + * geometry.h - Geometry-related classes\n>   */\n>  \n>  #ifndef __LIBCAMERA_GEOMETRY_H__\n> @@ -13,7 +13,9 @@\n>  \n>  namespace libcamera {\n>  \n> -struct Size {\n> +class Size\n> +{\n> +public:\n>  \tSize()\n>  \t\t: Size(0, 0)\n>  \t{\n> @@ -126,7 +128,9 @@ static inline bool operator!=(const SizeRange &lhs, const SizeRange &rhs)\n>  \treturn !(lhs == rhs);\n>  }\n>  \n> -struct Rectangle {\n> +class Rectangle\n> +{\n> +public:\n>  \tRectangle()\n>  \t\t: Rectangle(0, 0, 0, 0)\n>  \t{\n> diff --git a/src/libcamera/pipeline/ipu3/cio2.h b/src/libcamera/pipeline/ipu3/cio2.h\n> index 4fd949f8e513..956355a0aa58 100644\n> --- a/src/libcamera/pipeline/ipu3/cio2.h\n> +++ b/src/libcamera/pipeline/ipu3/cio2.h\n> @@ -21,8 +21,8 @@ class CameraSensor;\n>  class FrameBuffer;\n>  class MediaDevice;\n>  class Request;\n> +class Size;\n>  class V4L2Subdevice;\n> -struct Size;\n>  struct StreamConfiguration;\n>  \n>  class CIO2Device\n> diff --git a/src/libcamera/pipeline/ipu3/imgu.h b/src/libcamera/pipeline/ipu3/imgu.h\n> index 5c124af2e9fe..23ec1ca1c6ae 100644\n> --- a/src/libcamera/pipeline/ipu3/imgu.h\n> +++ b/src/libcamera/pipeline/ipu3/imgu.h\n> @@ -17,7 +17,7 @@ namespace libcamera {\n>  \n>  class FrameBuffer;\n>  class MediaDevice;\n> -struct Size;\n> +class Size;\n>  struct StreamConfiguration;\n>  \n>  class ImgUDevice\n> diff --git a/src/libcamera/pipeline/simple/converter.h b/src/libcamera/pipeline/simple/converter.h\n> index 8ca88912b4be..78296680aa14 100644\n> --- a/src/libcamera/pipeline/simple/converter.h\n> +++ b/src/libcamera/pipeline/simple/converter.h\n> @@ -20,7 +20,7 @@ namespace libcamera {\n>  \n>  class FrameBuffer;\n>  class MediaDevice;\n> -struct Size;\n> +class Size;\n>  class SizeRange;\n>  struct StreamConfiguration;\n>  class V4L2M2MDevice;\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 60CF5BD792\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 15 Jul 2020 06:35:20 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 30B916093B;\n\tWed, 15 Jul 2020 08:35:20 +0200 (CEST)","from mail-lj1-x242.google.com (mail-lj1-x242.google.com\n\t[IPv6:2a00:1450:4864:20::242])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id AE14960925\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 15 Jul 2020 08:35:18 +0200 (CEST)","by mail-lj1-x242.google.com with SMTP id q4so1339044lji.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 14 Jul 2020 23:35:18 -0700 (PDT)","from localhost (h-209-203.A463.priv.bahnhof.se. [155.4.209.203])\n\tby smtp.gmail.com with ESMTPSA id\n\tr11sm260931ljj.76.2020.07.14.23.35.17\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 14 Jul 2020 23:35:17 -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=\"GEN4++/B\"; 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=5Kiaw8Bojvzwpt9kKuRPrgex+HSUknq62zfQ+TC71wo=;\n\tb=GEN4++/BZ+n5qWUjh0QQkS8sFCU4iyF2wOATDAyyAl3Azk0KxZAneHYqGBexjSFh/E\n\tgA+gcSL2pzsAWLy+cijlTP8JIiO84VebtZ9Uj4htUDGFa9CaMqaktXeYpxzzpsQO2TUR\n\tnjcNjpklThQIsZ1Ro4oimBUGMkG4RBEwS6Gd+on2kpeMH3r9Ca5KPGAK3cMLQdLQS9s4\n\tkVCbxX9Mtq+hwp4Rd81Q2Ax9Jr7g4hYyFb3mwxTECagrlHPCQXUmoFUGh5AlYDWkxT3L\n\tlfEFOROpkL6klZAFOF3np5Q24WgXn1cwttjVTIrZu9/cRoOBtr7RGmLBa7ySmBwBv0bU\n\tmjPQ==","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=5Kiaw8Bojvzwpt9kKuRPrgex+HSUknq62zfQ+TC71wo=;\n\tb=E9Ad0Mt1bK9M1auziiIK3kuwLApBWWHhszcuGhpXmzDqGVYaRXZRgJvFZKNvOb+c4b\n\thG6AoMgDddC/gTgP9fYLqnJNjRIkwUTHMvwWdNfzLqRiv9unn39pEV9v1qNbIrXzvvyg\n\t//QOXKnQ0QkhFWPsvB2Y56Fz4A0ch9EZo3SVgw7F2TJjvf5gpG/8KiFVrWUUjQXatxoh\n\tasbPA0MhUP+E/DYwVwgIpD2O4YKbY0PSawT88PVfDdDl+HlteSHPpESRdwK5spM1b/Ex\n\tqn4M06mVMvNoTZVzPWKx045Q/H324D4Pwmvo+VAB5FiXFDyWCIsM7OlSb+JUS1FfCTuH\n\tDqgw==","X-Gm-Message-State":"AOAM531pETiW8Ppzmg1YdtYdw6dylxFU/EyMzNlx30kwDfBzBrxFI0HZ\n\toJlG7H39OwCk7wnIIvxfh4cnmw==","X-Google-Smtp-Source":"ABdhPJx9lb21ibwTgQcfZSjj57VVVsyDJq82ERreF/GMgEws7Ad1t8NSHudXnKLWRBSVKi2hywb1Qw==","X-Received":"by 2002:a2e:9dcc:: with SMTP id\n\tx12mr4389804ljj.261.1594794918128; \n\tTue, 14 Jul 2020 23:35:18 -0700 (PDT)","Date":"Wed, 15 Jul 2020 08:35:17 +0200","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Message-ID":"<20200715063517.GG3051471@oden.dyn.berto.se>","References":"<20200714234009.16596-1-laurent.pinchart@ideasonboard.com>\n\t<20200714234009.16596-5-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20200714234009.16596-5-laurent.pinchart@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH 4/5] libcamera: geometry: Turn Size\n\tand Rectangle into classes","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>"}}]