[{"id":1365,"web_url":"https://patchwork.libcamera.org/comment/1365/","msgid":"<20190415205736.GW1980@bigcity.dyn.berto.se>","date":"2019-04-15T20:57:36","subject":"Re: [libcamera-devel] [PATCH 06/11] libcamera: geometry: Add\n\tcomparison operators to geometry 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 2019-04-15 19:56:55 +0300, Laurent Pinchart wrote:\n> Add equality and inequality comparison operators for the Rectangle, Size\n> and SizeRange classes.\n> \n> For the Size class, also add ordering operators. Sizes are first\n> compared on combined width and height, then on area, and finally on\n> width only to achieve a stable ordering.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nI love to read repetitive documentation, you think you spot an error, \nreread it and it's once more correct. I did not managed to read it a \nthird time and spot any errors,\n\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\n> ---\n>  include/libcamera/geometry.h |  35 ++++++++++++\n>  src/libcamera/geometry.cpp   | 102 +++++++++++++++++++++++++++++++++++\n>  2 files changed, 137 insertions(+)\n> \n> diff --git a/include/libcamera/geometry.h b/include/libcamera/geometry.h\n> index 80f79c6ba2d3..3dbbced5c76f 100644\n> --- a/include/libcamera/geometry.h\n> +++ b/include/libcamera/geometry.h\n> @@ -21,6 +21,12 @@ struct Rectangle {\n>  \tconst std::string toString() const;\n>  };\n>  \n> +bool operator==(const Rectangle &lhs, const Rectangle &rhs);\n> +static inline bool operator!=(const Rectangle &lhs, const Rectangle &rhs)\n> +{\n> +\treturn !(lhs == rhs);\n> +}\n> +\n>  struct Size {\n>  \tSize()\n>  \t\t: Size(0, 0)\n> @@ -36,6 +42,29 @@ struct Size {\n>  \tunsigned int height;\n>  };\n>  \n> +bool operator==(const Size &lhs, const Size &rhs);\n> +bool operator<(const Size &lhs, const Size &rhs);\n> +\n> +static inline bool operator!=(const Size &lhs, const Size &rhs)\n> +{\n> +\treturn !(lhs == rhs);\n> +}\n> +\n> +static inline bool operator<=(const Size &lhs, const Size &rhs)\n> +{\n> +\treturn lhs < rhs || lhs == rhs;\n> +}\n> +\n> +static inline bool operator>(const Size &lhs, const Size &rhs)\n> +{\n> +\treturn !(lhs <= rhs);\n> +}\n> +\n> +static inline bool operator>=(const Size &lhs, const Size &rhs)\n> +{\n> +\treturn !(lhs < rhs);\n> +}\n> +\n>  struct SizeRange {\n>  \tSizeRange()\n>  \t{\n> @@ -51,6 +80,12 @@ struct SizeRange {\n>  \tSize max;\n>  };\n>  \n> +bool operator==(const SizeRange &lhs, const SizeRange &rhs);\n> +static inline bool operator!=(const SizeRange &lhs, const SizeRange &rhs)\n> +{\n> +\treturn !(lhs == rhs);\n> +}\n> +\n>  } /* namespace libcamera */\n>  \n>  #endif /* __LIBCAMERA_GEOMETRY_H__ */\n> diff --git a/src/libcamera/geometry.cpp b/src/libcamera/geometry.cpp\n> index c1c7daed7259..7b65e63f2ebd 100644\n> --- a/src/libcamera/geometry.cpp\n> +++ b/src/libcamera/geometry.cpp\n> @@ -6,6 +6,7 @@\n>   */\n>  \n>  #include <sstream>\n> +#include <stdint.h>\n>  \n>  #include <libcamera/geometry.h>\n>  \n> @@ -62,6 +63,22 @@ const std::string Rectangle::toString() const\n>  \treturn ss.str();\n>  }\n>  \n> +/**\n> + * \\brief Compare rectangles for equality\n> + * \\return True if the two rectangles are equal, false otherwise\n> + */\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> +}\n> +\n> +/**\n> + * \\fn bool operator!=(const Rectangle &lhs, const Rectangle &rhs)\n> + * \\brief Compare rectangles for inequality\n> + * \\return True if the two rectangles are not equal, false otherwise\n> + */\n> +\n>  /**\n>   * \\struct Size\n>   * \\brief Describe a two-dimensional size\n> @@ -91,6 +108,76 @@ const std::string Rectangle::toString() const\n>   * \\brief The Size height\n>   */\n>  \n> +/**\n> + * \\brief Compare sizes for equality\n> + * \\return True if the two sizes are equal, false otherwise\n> + */\n> +bool operator==(const Size &lhs, const Size &rhs)\n> +{\n> +\treturn lhs.width == rhs.width && lhs.height == rhs.height;\n> +}\n> +\n> +/**\n> + * \\brief Compare sizes for smaller than order\n> + *\n> + * Sizes are compared on three criteria, in the following order.\n> + *\n> + * - A size with smaller width and smaller height is smaller.\n> + * - A size with smaller area is smaller.\n> + * - A size with smaller width is smaller.\n> + *\n> + * \\return True if the left hand size is smaller than the right hand size, false\n> + * otherwise\n> + */\n> +bool operator<(const Size &lhs, const Size &rhs)\n> +{\n> +\tif (lhs.width < rhs.width && lhs.height < rhs.height)\n> +\t\treturn true;\n> +\telse if (lhs.width >= rhs.width && lhs.height >= rhs.height)\n> +\t\treturn false;\n> +\n> +\tuint64_t larea = static_cast<uint64_t>(lhs.width) *\n> +\t\t\t static_cast<uint64_t>(lhs.height);\n> +\tuint64_t rarea = static_cast<uint64_t>(rhs.width) *\n> +\t\t\t static_cast<uint64_t>(rhs.height);\n> +\tif (larea < rarea)\n> +\t\treturn true;\n> +\telse if (larea > rarea)\n> +\t\treturn false;\n> +\n> +\treturn lhs.width < rhs.width;\n> +}\n> +\n> +/**\n> + * \\fn bool operator!=(const Size &lhs, const Size &rhs)\n> + * \\brief Compare sizes for inequality\n> + * \\return True if the two sizes are not equal, false otherwise\n> + */\n> +\n> +/**\n> + * \\fn bool operator<=(const Size &lhs, const Size &rhs)\n> + * \\brief Compare sizes for smaller than or equal to order\n> + * \\return True if the left hand size is smaller than or equal to the right\n> + * hand size, false otherwise\n> + * \\sa bool operator<(const Size &lhs, const Size &rhs)\n> + */\n> +\n> +/**\n> + * \\fn bool operator>(const Size &lhs, const Size &rhs)\n> + * \\brief Compare sizes for greater than order\n> + * \\return True if the left hand size is greater than the right hand size,\n> + * false otherwise\n> + * \\sa bool operator<(const Size &lhs, const Size &rhs)\n> + */\n> +\n> +/**\n> + * \\fn bool operator>=(const Size &lhs, const Size &rhs)\n> + * \\brief Compare sizes for greater than or equal to order\n> + * \\return True if the left hand size is greater than or equal to the right\n> + * hand size, false otherwise\n> + * \\sa bool operator<(const Size &lhs, const Size &rhs)\n> + */\n> +\n>  /**\n>   * \\struct SizeRange\n>   * \\brief Describe a range of sizes\n> @@ -124,4 +211,19 @@ const std::string Rectangle::toString() const\n>   * \\brief The maximum size\n>   */\n>  \n> +/**\n> + * \\brief Compare size ranges for equality\n> + * \\return True if the two size ranges are equal, false otherwise\n> + */\n> +bool operator==(const SizeRange &lhs, const SizeRange &rhs)\n> +{\n> +\treturn lhs.min == rhs.min && lhs.max == rhs.max;\n> +}\n> +\n> +/**\n> + * \\fn bool operator!=(const SizeRange &lhs, const SizeRange &rhs)\n> + * \\brief Compare size ranges for inequality\n> + * \\return True if the two size ranges are not equal, false otherwise\n> + */\n> +\n>  } /* namespace libcamera */\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":"<niklas.soderlund@ragnatech.se>","Received":["from mail-lf1-x141.google.com (mail-lf1-x141.google.com\n\t[IPv6:2a00:1450:4864:20::141])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 260B860B2E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 15 Apr 2019 22:57:39 +0200 (CEST)","by mail-lf1-x141.google.com with SMTP id h18so14161331lfj.11\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 15 Apr 2019 13:57:39 -0700 (PDT)","from localhost (89-233-230-99.cust.bredband2.com. [89.233.230.99])\n\tby smtp.gmail.com with ESMTPSA id\n\tt29sm10039051ljd.82.2019.04.15.13.57.36\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tMon, 15 Apr 2019 13:57:37 -0700 (PDT)"],"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\t:user-agent; bh=Nqdo8kOWbK+uktj2uRkkZty8C0wrOY62PZ+1g/8fyx8=;\n\tb=DqKa9avEpG3i81p6aNhQe4hXKzPWMw+ETGuGZI/POxZMyzop6u/3UNwisgtPn4V9hr\n\tlWsIyRXqE1d217prTAEIIl60occ21jczwgR94trcd4pLz025faweAP4i1DB1tgFC1soE\n\tijHhlfV6P2CmwbercevQzpHNWXW/NKByhe3FjxmFeWe7bQYQ8x6XU7rG8FBAbetMS9B7\n\thNcLhJeCkN0b6I4zWIRW2K+Mja+wJoNHa4luWgAjBkl3p5vncrfW1D1vhU/Gpl0LwUSE\n\tWHipSZV8IBRQod1dojoXuhVzOb9d0BU7o4ZUrKmuJmNsXSfab1r53MuIWWGcgkTBmzT6\n\t1ynA==","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:user-agent;\n\tbh=Nqdo8kOWbK+uktj2uRkkZty8C0wrOY62PZ+1g/8fyx8=;\n\tb=hCPw3IKahnkcVQ/f6YmYCU1+ZXRV3nFsm+GDKRzxt8xrS81Sh91w9FR3p9ZpCnEO16\n\t2abkScymJ0qbyy5Hym9/aOPi8V5eafhyxQVFPef+4XVJaCZb5d5BysHoLjYnsPghwDGS\n\tyX7HpX+pdb74IdNC2TKpfY93208sZLM29N+iDbD8DA+TE4UnjAnGqwDoPxXNB+eBdiDz\n\tflZa+/tOxp2oG8GweIhcx8Tw2x7NZWujWA97FEnjtl+P48XthWtQc+Hz9mzKJaZAQGOA\n\tqW+FBCJgAubjT/fG+lwCT6rFtAYGso74i1mYnk+wz1YGmWewL+Pn3g+NbhybwnXGw9BP\n\t4Y+w==","X-Gm-Message-State":"APjAAAVaRKiNz8Q0Vj+4ctmigPUa+k9RphJVVCUz0sLMsgucF9YG/QtS\n\tE21BbeTFDWbcl/qn7bvCUB5E8oc5Jo4=","X-Google-Smtp-Source":"APXvYqxeRAwbo4Xw2595EZxaF7eO4k+T9RWtKsnicBHCEPYkReL2KQYpXTEg26Jx5mko/WHknbDMTA==","X-Received":"by 2002:ac2:4285:: with SMTP id m5mr6925133lfh.103.1555361858396;\n\tMon, 15 Apr 2019 13:57:38 -0700 (PDT)","Date":"Mon, 15 Apr 2019 22:57:36 +0200","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190415205736.GW1980@bigcity.dyn.berto.se>","References":"<20190415165700.22970-1-laurent.pinchart@ideasonboard.com>\n\t<20190415165700.22970-7-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20190415165700.22970-7-laurent.pinchart@ideasonboard.com>","User-Agent":"Mutt/1.11.3 (2019-02-01)","Subject":"Re: [libcamera-devel] [PATCH 06/11] libcamera: geometry: Add\n\tcomparison operators to geometry classes","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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":"Mon, 15 Apr 2019 20:57:39 -0000"}},{"id":1392,"web_url":"https://patchwork.libcamera.org/comment/1392/","msgid":"<20190416150950.3nmbnijalledssqq@uno.localdomain>","date":"2019-04-16T15:09:50","subject":"Re: [libcamera-devel] [PATCH 06/11] libcamera: geometry: Add\n\tcomparison operators to geometry classes","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Laurent,\n   very nice, thanks\n\nOn Mon, Apr 15, 2019 at 07:56:55PM +0300, Laurent Pinchart wrote:\n> Add equality and inequality comparison operators for the Rectangle, Size\n> and SizeRange classes.\n>\n> For the Size class, also add ordering operators. Sizes are first\n> compared on combined width and height, then on area, and finally on\n> width only to achieve a stable ordering.\n>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nThe only comment I have is that we usually put a blank line in\ndocumentation between a \\brief and a \\return statement.\n\nAlso, \"left hand Size\" and \"right hand Size\" could be replaced by\nparameters name.\n\nMinor stuff though:\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\nThanks\n  j\n> ---\n>  include/libcamera/geometry.h |  35 ++++++++++++\n>  src/libcamera/geometry.cpp   | 102 +++++++++++++++++++++++++++++++++++\n>  2 files changed, 137 insertions(+)\n>\n> diff --git a/include/libcamera/geometry.h b/include/libcamera/geometry.h\n> index 80f79c6ba2d3..3dbbced5c76f 100644\n> --- a/include/libcamera/geometry.h\n> +++ b/include/libcamera/geometry.h\n> @@ -21,6 +21,12 @@ struct Rectangle {\n>  \tconst std::string toString() const;\n>  };\n>\n> +bool operator==(const Rectangle &lhs, const Rectangle &rhs);\n> +static inline bool operator!=(const Rectangle &lhs, const Rectangle &rhs)\n> +{\n> +\treturn !(lhs == rhs);\n> +}\n> +\n>  struct Size {\n>  \tSize()\n>  \t\t: Size(0, 0)\n> @@ -36,6 +42,29 @@ struct Size {\n>  \tunsigned int height;\n>  };\n>\n> +bool operator==(const Size &lhs, const Size &rhs);\n> +bool operator<(const Size &lhs, const Size &rhs);\n> +\n> +static inline bool operator!=(const Size &lhs, const Size &rhs)\n> +{\n> +\treturn !(lhs == rhs);\n> +}\n> +\n> +static inline bool operator<=(const Size &lhs, const Size &rhs)\n> +{\n> +\treturn lhs < rhs || lhs == rhs;\n> +}\n> +\n> +static inline bool operator>(const Size &lhs, const Size &rhs)\n> +{\n> +\treturn !(lhs <= rhs);\n> +}\n> +\n> +static inline bool operator>=(const Size &lhs, const Size &rhs)\n> +{\n> +\treturn !(lhs < rhs);\n> +}\n> +\n>  struct SizeRange {\n>  \tSizeRange()\n>  \t{\n> @@ -51,6 +80,12 @@ struct SizeRange {\n>  \tSize max;\n>  };\n>\n> +bool operator==(const SizeRange &lhs, const SizeRange &rhs);\n> +static inline bool operator!=(const SizeRange &lhs, const SizeRange &rhs)\n> +{\n> +\treturn !(lhs == rhs);\n> +}\n> +\n>  } /* namespace libcamera */\n>\n>  #endif /* __LIBCAMERA_GEOMETRY_H__ */\n> diff --git a/src/libcamera/geometry.cpp b/src/libcamera/geometry.cpp\n> index c1c7daed7259..7b65e63f2ebd 100644\n> --- a/src/libcamera/geometry.cpp\n> +++ b/src/libcamera/geometry.cpp\n> @@ -6,6 +6,7 @@\n>   */\n>\n>  #include <sstream>\n> +#include <stdint.h>\n>\n>  #include <libcamera/geometry.h>\n>\n> @@ -62,6 +63,22 @@ const std::string Rectangle::toString() const\n>  \treturn ss.str();\n>  }\n>\n> +/**\n> + * \\brief Compare rectangles for equality\n> + * \\return True if the two rectangles are equal, false otherwise\n> + */\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> +}\n> +\n> +/**\n> + * \\fn bool operator!=(const Rectangle &lhs, const Rectangle &rhs)\n> + * \\brief Compare rectangles for inequality\n> + * \\return True if the two rectangles are not equal, false otherwise\n> + */\n> +\n>  /**\n>   * \\struct Size\n>   * \\brief Describe a two-dimensional size\n> @@ -91,6 +108,76 @@ const std::string Rectangle::toString() const\n>   * \\brief The Size height\n>   */\n>\n> +/**\n> + * \\brief Compare sizes for equality\n> + * \\return True if the two sizes are equal, false otherwise\n> + */\n> +bool operator==(const Size &lhs, const Size &rhs)\n> +{\n> +\treturn lhs.width == rhs.width && lhs.height == rhs.height;\n> +}\n> +\n> +/**\n> + * \\brief Compare sizes for smaller than order\n> + *\n> + * Sizes are compared on three criteria, in the following order.\n> + *\n> + * - A size with smaller width and smaller height is smaller.\n> + * - A size with smaller area is smaller.\n> + * - A size with smaller width is smaller.\n> + *\n> + * \\return True if the left hand size is smaller than the right hand size, false\n> + * otherwise\n> + */\n> +bool operator<(const Size &lhs, const Size &rhs)\n> +{\n> +\tif (lhs.width < rhs.width && lhs.height < rhs.height)\n> +\t\treturn true;\n> +\telse if (lhs.width >= rhs.width && lhs.height >= rhs.height)\n> +\t\treturn false;\n> +\n> +\tuint64_t larea = static_cast<uint64_t>(lhs.width) *\n> +\t\t\t static_cast<uint64_t>(lhs.height);\n> +\tuint64_t rarea = static_cast<uint64_t>(rhs.width) *\n> +\t\t\t static_cast<uint64_t>(rhs.height);\n> +\tif (larea < rarea)\n> +\t\treturn true;\n> +\telse if (larea > rarea)\n> +\t\treturn false;\n> +\n> +\treturn lhs.width < rhs.width;\n> +}\n> +\n> +/**\n> + * \\fn bool operator!=(const Size &lhs, const Size &rhs)\n> + * \\brief Compare sizes for inequality\n> + * \\return True if the two sizes are not equal, false otherwise\n> + */\n> +\n> +/**\n> + * \\fn bool operator<=(const Size &lhs, const Size &rhs)\n> + * \\brief Compare sizes for smaller than or equal to order\n> + * \\return True if the left hand size is smaller than or equal to the right\n> + * hand size, false otherwise\n> + * \\sa bool operator<(const Size &lhs, const Size &rhs)\n> + */\n> +\n> +/**\n> + * \\fn bool operator>(const Size &lhs, const Size &rhs)\n> + * \\brief Compare sizes for greater than order\n> + * \\return True if the left hand size is greater than the right hand size,\n> + * false otherwise\n> + * \\sa bool operator<(const Size &lhs, const Size &rhs)\n> + */\n> +\n> +/**\n> + * \\fn bool operator>=(const Size &lhs, const Size &rhs)\n> + * \\brief Compare sizes for greater than or equal to order\n> + * \\return True if the left hand size is greater than or equal to the right\n> + * hand size, false otherwise\n> + * \\sa bool operator<(const Size &lhs, const Size &rhs)\n> + */\n> +\n>  /**\n>   * \\struct SizeRange\n>   * \\brief Describe a range of sizes\n> @@ -124,4 +211,19 @@ const std::string Rectangle::toString() const\n>   * \\brief The maximum size\n>   */\n>\n> +/**\n> + * \\brief Compare size ranges for equality\n> + * \\return True if the two size ranges are equal, false otherwise\n> + */\n> +bool operator==(const SizeRange &lhs, const SizeRange &rhs)\n> +{\n> +\treturn lhs.min == rhs.min && lhs.max == rhs.max;\n> +}\n> +\n> +/**\n> + * \\fn bool operator!=(const SizeRange &lhs, const SizeRange &rhs)\n> + * \\brief Compare size ranges for inequality\n> + * \\return True if the two size ranges are not equal, false otherwise\n> + */\n> +\n>  } /* namespace libcamera */\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":"<jacopo@jmondi.org>","Received":["from relay12.mail.gandi.net (relay12.mail.gandi.net\n\t[217.70.178.232])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4321060DB4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 16 Apr 2019 17:08:59 +0200 (CEST)","from uno.localdomain (2-224-242-101.ip172.fastwebnet.it\n\t[2.224.242.101]) (Authenticated sender: jacopo@jmondi.org)\n\tby relay12.mail.gandi.net (Postfix) with ESMTPSA id B8920200012;\n\tTue, 16 Apr 2019 15:08:58 +0000 (UTC)"],"Date":"Tue, 16 Apr 2019 17:09:50 +0200","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190416150950.3nmbnijalledssqq@uno.localdomain>","References":"<20190415165700.22970-1-laurent.pinchart@ideasonboard.com>\n\t<20190415165700.22970-7-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\"; boundary=\"db3axrrrpvg4coxg\"","Content-Disposition":"inline","In-Reply-To":"<20190415165700.22970-7-laurent.pinchart@ideasonboard.com>","User-Agent":"NeoMutt/20180716","Subject":"Re: [libcamera-devel] [PATCH 06/11] libcamera: geometry: Add\n\tcomparison operators to geometry classes","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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":"Tue, 16 Apr 2019 15:08:59 -0000"}},{"id":1402,"web_url":"https://patchwork.libcamera.org/comment/1402/","msgid":"<20190416200838.GA4822@pendragon.ideasonboard.com>","date":"2019-04-16T20:08:38","subject":"Re: [libcamera-devel] [PATCH 06/11] libcamera: geometry: Add\n\tcomparison operators to geometry classes","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nOn Tue, Apr 16, 2019 at 05:09:50PM +0200, Jacopo Mondi wrote:\n> Hi Laurent,\n>    very nice, thanks\n\nThank you :-)\n\n> On Mon, Apr 15, 2019 at 07:56:55PM +0300, Laurent Pinchart wrote:\n> > Add equality and inequality comparison operators for the Rectangle, Size\n> > and SizeRange classes.\n> >\n> > For the Size class, also add ordering operators. Sizes are first\n> > compared on combined width and height, then on area, and finally on\n> > width only to achieve a stable ordering.\n> >\n> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> \n> The only comment I have is that we usually put a blank line in\n> documentation between a \\brief and a \\return statement.\n\nActually we don't in many cases. Both variants are used. I think it\nwould make sense to standardize on one of them, and I can send a patch\non top of this series. The question is, what should we standardize on ?\n:-) I propose\n\n/**\n * \\fn\n * \\brief\n * \\param[in,out]\n *\n * Text\n *\n * \\return\n */\n\n\\fn is required if the function is defined in the .cpp file and not\nallowed otherwise. \\brief is required. \\param is required if the\nfunction takes parameters, and the [in] and [out] specifiers are\nrequired. The text is optional, and if present shall be surrounded by\nempty lines. \\return is required if the function returns a value and not\nallowed otherwise.\n\nThis would mean no new line between \\brief (or \\param when present) and\n\\return if a long text is present.\n\n> Also, \"left hand Size\" and \"right hand Size\" could be replaced by\n> parameters name.\n\nGood point. I'll do so.\n\n> Minor stuff though:\n> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n> \n> > ---\n> >  include/libcamera/geometry.h |  35 ++++++++++++\n> >  src/libcamera/geometry.cpp   | 102 +++++++++++++++++++++++++++++++++++\n> >  2 files changed, 137 insertions(+)\n> >\n> > diff --git a/include/libcamera/geometry.h b/include/libcamera/geometry.h\n> > index 80f79c6ba2d3..3dbbced5c76f 100644\n> > --- a/include/libcamera/geometry.h\n> > +++ b/include/libcamera/geometry.h\n> > @@ -21,6 +21,12 @@ struct Rectangle {\n> >  \tconst std::string toString() const;\n> >  };\n> >\n> > +bool operator==(const Rectangle &lhs, const Rectangle &rhs);\n> > +static inline bool operator!=(const Rectangle &lhs, const Rectangle &rhs)\n> > +{\n> > +\treturn !(lhs == rhs);\n> > +}\n> > +\n> >  struct Size {\n> >  \tSize()\n> >  \t\t: Size(0, 0)\n> > @@ -36,6 +42,29 @@ struct Size {\n> >  \tunsigned int height;\n> >  };\n> >\n> > +bool operator==(const Size &lhs, const Size &rhs);\n> > +bool operator<(const Size &lhs, const Size &rhs);\n> > +\n> > +static inline bool operator!=(const Size &lhs, const Size &rhs)\n> > +{\n> > +\treturn !(lhs == rhs);\n> > +}\n> > +\n> > +static inline bool operator<=(const Size &lhs, const Size &rhs)\n> > +{\n> > +\treturn lhs < rhs || lhs == rhs;\n> > +}\n> > +\n> > +static inline bool operator>(const Size &lhs, const Size &rhs)\n> > +{\n> > +\treturn !(lhs <= rhs);\n> > +}\n> > +\n> > +static inline bool operator>=(const Size &lhs, const Size &rhs)\n> > +{\n> > +\treturn !(lhs < rhs);\n> > +}\n> > +\n> >  struct SizeRange {\n> >  \tSizeRange()\n> >  \t{\n> > @@ -51,6 +80,12 @@ struct SizeRange {\n> >  \tSize max;\n> >  };\n> >\n> > +bool operator==(const SizeRange &lhs, const SizeRange &rhs);\n> > +static inline bool operator!=(const SizeRange &lhs, const SizeRange &rhs)\n> > +{\n> > +\treturn !(lhs == rhs);\n> > +}\n> > +\n> >  } /* namespace libcamera */\n> >\n> >  #endif /* __LIBCAMERA_GEOMETRY_H__ */\n> > diff --git a/src/libcamera/geometry.cpp b/src/libcamera/geometry.cpp\n> > index c1c7daed7259..7b65e63f2ebd 100644\n> > --- a/src/libcamera/geometry.cpp\n> > +++ b/src/libcamera/geometry.cpp\n> > @@ -6,6 +6,7 @@\n> >   */\n> >\n> >  #include <sstream>\n> > +#include <stdint.h>\n> >\n> >  #include <libcamera/geometry.h>\n> >\n> > @@ -62,6 +63,22 @@ const std::string Rectangle::toString() const\n> >  \treturn ss.str();\n> >  }\n> >\n> > +/**\n> > + * \\brief Compare rectangles for equality\n> > + * \\return True if the two rectangles are equal, false otherwise\n> > + */\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> > +}\n> > +\n> > +/**\n> > + * \\fn bool operator!=(const Rectangle &lhs, const Rectangle &rhs)\n> > + * \\brief Compare rectangles for inequality\n> > + * \\return True if the two rectangles are not equal, false otherwise\n> > + */\n> > +\n> >  /**\n> >   * \\struct Size\n> >   * \\brief Describe a two-dimensional size\n> > @@ -91,6 +108,76 @@ const std::string Rectangle::toString() const\n> >   * \\brief The Size height\n> >   */\n> >\n> > +/**\n> > + * \\brief Compare sizes for equality\n> > + * \\return True if the two sizes are equal, false otherwise\n> > + */\n> > +bool operator==(const Size &lhs, const Size &rhs)\n> > +{\n> > +\treturn lhs.width == rhs.width && lhs.height == rhs.height;\n> > +}\n> > +\n> > +/**\n> > + * \\brief Compare sizes for smaller than order\n> > + *\n> > + * Sizes are compared on three criteria, in the following order.\n> > + *\n> > + * - A size with smaller width and smaller height is smaller.\n> > + * - A size with smaller area is smaller.\n> > + * - A size with smaller width is smaller.\n> > + *\n> > + * \\return True if the left hand size is smaller than the right hand size, false\n> > + * otherwise\n> > + */\n> > +bool operator<(const Size &lhs, const Size &rhs)\n> > +{\n> > +\tif (lhs.width < rhs.width && lhs.height < rhs.height)\n> > +\t\treturn true;\n> > +\telse if (lhs.width >= rhs.width && lhs.height >= rhs.height)\n> > +\t\treturn false;\n> > +\n> > +\tuint64_t larea = static_cast<uint64_t>(lhs.width) *\n> > +\t\t\t static_cast<uint64_t>(lhs.height);\n> > +\tuint64_t rarea = static_cast<uint64_t>(rhs.width) *\n> > +\t\t\t static_cast<uint64_t>(rhs.height);\n> > +\tif (larea < rarea)\n> > +\t\treturn true;\n> > +\telse if (larea > rarea)\n> > +\t\treturn false;\n> > +\n> > +\treturn lhs.width < rhs.width;\n> > +}\n> > +\n> > +/**\n> > + * \\fn bool operator!=(const Size &lhs, const Size &rhs)\n> > + * \\brief Compare sizes for inequality\n> > + * \\return True if the two sizes are not equal, false otherwise\n> > + */\n> > +\n> > +/**\n> > + * \\fn bool operator<=(const Size &lhs, const Size &rhs)\n> > + * \\brief Compare sizes for smaller than or equal to order\n> > + * \\return True if the left hand size is smaller than or equal to the right\n> > + * hand size, false otherwise\n> > + * \\sa bool operator<(const Size &lhs, const Size &rhs)\n> > + */\n> > +\n> > +/**\n> > + * \\fn bool operator>(const Size &lhs, const Size &rhs)\n> > + * \\brief Compare sizes for greater than order\n> > + * \\return True if the left hand size is greater than the right hand size,\n> > + * false otherwise\n> > + * \\sa bool operator<(const Size &lhs, const Size &rhs)\n> > + */\n> > +\n> > +/**\n> > + * \\fn bool operator>=(const Size &lhs, const Size &rhs)\n> > + * \\brief Compare sizes for greater than or equal to order\n> > + * \\return True if the left hand size is greater than or equal to the right\n> > + * hand size, false otherwise\n> > + * \\sa bool operator<(const Size &lhs, const Size &rhs)\n> > + */\n> > +\n> >  /**\n> >   * \\struct SizeRange\n> >   * \\brief Describe a range of sizes\n> > @@ -124,4 +211,19 @@ const std::string Rectangle::toString() const\n> >   * \\brief The maximum size\n> >   */\n> >\n> > +/**\n> > + * \\brief Compare size ranges for equality\n> > + * \\return True if the two size ranges are equal, false otherwise\n> > + */\n> > +bool operator==(const SizeRange &lhs, const SizeRange &rhs)\n> > +{\n> > +\treturn lhs.min == rhs.min && lhs.max == rhs.max;\n> > +}\n> > +\n> > +/**\n> > + * \\fn bool operator!=(const SizeRange &lhs, const SizeRange &rhs)\n> > + * \\brief Compare size ranges for inequality\n> > + * \\return True if the two size ranges are not equal, false otherwise\n> > + */\n> > +\n> >  } /* namespace libcamera */","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 46D5B60004\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 16 Apr 2019 22:08:48 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(dfj612yhrgyx302h3jwwy-3.rev.dnainternet.fi\n\t[IPv6:2001:14ba:21f5:5b00:ce28:277f:58d7:3ca4])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 6B7E8E2;\n\tTue, 16 Apr 2019 22:08:47 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1555445327;\n\tbh=YKvlqkFrBCBgicDBm5lrrpEKrNqTr0ID/QVRNQYZcKg=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=tKEZFVrwuboNDcl+jBR9urq4eJEIxSBl+mmhaKo/TSYTaWqlV5r31aoitiYZglNfH\n\tq/EFevQhpduZZm1hEnHtcSIbxzCCJNytoUzLUIJfQyniTCPWouIFpkBd6ioRz+wu8j\n\t88FzJqK+IU8CY5VuNOvyt2vuTD+0uuvTFFpfZuzk=","Date":"Tue, 16 Apr 2019 23:08:38 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190416200838.GA4822@pendragon.ideasonboard.com>","References":"<20190415165700.22970-1-laurent.pinchart@ideasonboard.com>\n\t<20190415165700.22970-7-laurent.pinchart@ideasonboard.com>\n\t<20190416150950.3nmbnijalledssqq@uno.localdomain>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20190416150950.3nmbnijalledssqq@uno.localdomain>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH 06/11] libcamera: geometry: Add\n\tcomparison operators to geometry classes","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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":"Tue, 16 Apr 2019 20:08:48 -0000"}},{"id":1407,"web_url":"https://patchwork.libcamera.org/comment/1407/","msgid":"<20190416210816.GF28515@bigcity.dyn.berto.se>","date":"2019-04-16T21:08:16","subject":"Re: [libcamera-devel] [PATCH 06/11] libcamera: geometry: Add\n\tcomparison operators to geometry classes","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hello,\n\nOn 2019-04-16 23:08:38 +0300, Laurent Pinchart wrote:\n> Hi Jacopo,\n> \n> On Tue, Apr 16, 2019 at 05:09:50PM +0200, Jacopo Mondi wrote:\n> > Hi Laurent,\n> >    very nice, thanks\n> \n> Thank you :-)\n> \n> > On Mon, Apr 15, 2019 at 07:56:55PM +0300, Laurent Pinchart wrote:\n> > > Add equality and inequality comparison operators for the Rectangle, Size\n> > > and SizeRange classes.\n> > >\n> > > For the Size class, also add ordering operators. Sizes are first\n> > > compared on combined width and height, then on area, and finally on\n> > > width only to achieve a stable ordering.\n> > >\n> > > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > \n> > The only comment I have is that we usually put a blank line in\n> > documentation between a \\brief and a \\return statement.\n> \n> Actually we don't in many cases. Both variants are used. I think it\n> would make sense to standardize on one of them, and I can send a patch\n> on top of this series. The question is, what should we standardize on ?\n> :-) I propose\n> \n> /**\n>  * \\fn\n>  * \\brief\n>  * \\param[in,out]\n>  *\n>  * Text\n>  *\n>  * \\return\n>  */\n> \n> \\fn is required if the function is defined in the .cpp file and not\n> allowed otherwise. \\brief is required. \\param is required if the\n> function takes parameters, and the [in] and [out] specifiers are\n> required. The text is optional, and if present shall be surrounded by\n> empty lines. \\return is required if the function returns a value and not\n> allowed otherwise.\n> \n> This would mean no new line between \\brief (or \\param when present) and\n> \\return if a long text is present.\n> \n\nI would support this format.","headers":{"Return-Path":"<niklas.soderlund@ragnatech.se>","Received":["from mail-lj1-x243.google.com (mail-lj1-x243.google.com\n\t[IPv6:2a00:1450:4864:20::243])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DEDE860004\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 16 Apr 2019 23:08:17 +0200 (CEST)","by mail-lj1-x243.google.com with SMTP id v22so20398250lje.9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 16 Apr 2019 14:08:17 -0700 (PDT)","from localhost (89-233-230-99.cust.bredband2.com. [89.233.230.99])\n\tby smtp.gmail.com with ESMTPSA id\n\tf4sm10693767ljg.37.2019.04.16.14.08.16\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tTue, 16 Apr 2019 14:08:16 -0700 (PDT)"],"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\t:user-agent; bh=4h/iiXynVQjKazeZtK/v0VpD6bIE94NoO6fvX/h2EpE=;\n\tb=gzDOzaNC4ziCloI/qjA+0EU5QDaj0GqfQSfenp6E0vLAXO+XFkTG9kfXVUfzmePmNi\n\tMyCLLs6HcJtYXmvRZU4NfWwqh9bcCF8jjPVWMXOhGERQabvORuMhJ+Woq7RNDfVpPu36\n\teGHvc0ROUy0pedEeYKKKTfSESiX73NzpH/WMMAF0FAOwcc1Xl/Sc+qw0O+wtj5Cd12nC\n\t81ssOPb2LHQD4rStX7wwp6GP1CUFVMLMl4vv8C5GfZKxerTakEZoP2eMWKoKQMxks/BO\n\twFrlSko3OM8CX9rbmbB8edCHzu7cQBhXiSaKcgncXGe4Vi24WlrB5+QHg6+nxHNiD4aZ\n\tc+RA==","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:user-agent;\n\tbh=4h/iiXynVQjKazeZtK/v0VpD6bIE94NoO6fvX/h2EpE=;\n\tb=cV7M1gZYNpuPaW+4479VDeDMkpsgqpWxDDEbdWTRLZFkKeu/PaNMg5sUGAEYSGK6tQ\n\tXiiY6Klyf6TTikehzgVFG/F7uOTItOmVKHWLhHyoQMcVoD/p7ifC2SDkZTxsA58jmek7\n\tw2Y5n1GcBE7J9QML4+tB/7rS9fSPmWKVeRBs/RqpNdMGUeOagQ8vx3gCs9o7MCJmDwmC\n\tBHIBVfReVkMOO07fbo7LJJUZo4kfA7tzxllEVJoeG+7auEKFZIQeAAXo5IY2mIomvxCK\n\tbi/Ovve1xHi22pYT3w/LxWWlzyplWGJEyc8WeQlpBJCeCHFlN6QAnWWOFcXUuX9xlOly\n\tkPdQ==","X-Gm-Message-State":"APjAAAVRP/OeLtjjg4rEZ6cEybKgrkW3LGhqHgB6SLHSKbQ/15Vkw0Ws\n\tyyRCn6pIhF9ayiurZE5GuWvi9A==","X-Google-Smtp-Source":"APXvYqz53eynBhYlknvtZTRsT2E6Gj9YLIbefWyNsXJlYUiq2tMU7yUsdgkqP5m0e74y3n0ArAYBsQ==","X-Received":"by 2002:a2e:29da:: with SMTP id\n\tp87mr44153325ljp.33.1555448897207; \n\tTue, 16 Apr 2019 14:08:17 -0700 (PDT)","Date":"Tue, 16 Apr 2019 23:08:16 +0200","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"Jacopo Mondi <jacopo@jmondi.org>, libcamera-devel@lists.libcamera.org","Message-ID":"<20190416210816.GF28515@bigcity.dyn.berto.se>","References":"<20190415165700.22970-1-laurent.pinchart@ideasonboard.com>\n\t<20190415165700.22970-7-laurent.pinchart@ideasonboard.com>\n\t<20190416150950.3nmbnijalledssqq@uno.localdomain>\n\t<20190416200838.GA4822@pendragon.ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20190416200838.GA4822@pendragon.ideasonboard.com>","User-Agent":"Mutt/1.11.3 (2019-02-01)","Subject":"Re: [libcamera-devel] [PATCH 06/11] libcamera: geometry: Add\n\tcomparison operators to geometry classes","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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":"Tue, 16 Apr 2019 21:08:18 -0000"}},{"id":1422,"web_url":"https://patchwork.libcamera.org/comment/1422/","msgid":"<20190417073109.7enfkwlntpae7itx@uno.localdomain>","date":"2019-04-17T07:31:09","subject":"Re: [libcamera-devel] [PATCH 06/11] libcamera: geometry: Add\n\tcomparison operators to geometry classes","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi,\n\nOn Tue, Apr 16, 2019 at 11:08:16PM +0200, Niklas Söderlund wrote:\n> Hello,\n>\n> On 2019-04-16 23:08:38 +0300, Laurent Pinchart wrote:\n> > Hi Jacopo,\n> >\n> > On Tue, Apr 16, 2019 at 05:09:50PM +0200, Jacopo Mondi wrote:\n> > > Hi Laurent,\n> > >    very nice, thanks\n> >\n> > Thank you :-)\n> >\n> > > On Mon, Apr 15, 2019 at 07:56:55PM +0300, Laurent Pinchart wrote:\n> > > > Add equality and inequality comparison operators for the Rectangle, Size\n> > > > and SizeRange classes.\n> > > >\n> > > > For the Size class, also add ordering operators. Sizes are first\n> > > > compared on combined width and height, then on area, and finally on\n> > > > width only to achieve a stable ordering.\n> > > >\n> > > > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > >\n> > > The only comment I have is that we usually put a blank line in\n> > > documentation between a \\brief and a \\return statement.\n> >\n> > Actually we don't in many cases. Both variants are used. I think it\n> > would make sense to standardize on one of them, and I can send a patch\n> > on top of this series. The question is, what should we standardize on ?\n> > :-) I propose\n> >\n> > /**\n> >  * \\fn\n> >  * \\brief\n> >  * \\param[in,out]\n> >  *\n> >  * Text\n> >  *\n> >  * \\return\n> >  */\n> >\n> > \\fn is required if the function is defined in the .cpp file and not\n> > allowed otherwise. \\brief is required. \\param is required if the\n> > function takes parameters, and the [in] and [out] specifiers are\n> > required. The text is optional, and if present shall be surrounded by\n> > empty lines. \\return is required if the function returns a value and not\n> > allowed otherwise.\n> >\n> > This would mean no new line between \\brief (or \\param when present) and\n> > \\return if a long text is present.\n> >\n>\n> I would support this format.\n>\n\nI can't tell why, but I like the empty line before the \\return.\nAnyway, this is really not an issue worth discussing about, I welcome\nany of the two if they are consistent though the code base.\n\nThanks\n  j\n\n> --\n> Regards,\n> Niklas Söderlund","headers":{"Return-Path":"<jacopo@jmondi.org>","Received":["from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net\n\t[217.70.183.195])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9ACFC60DB4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 17 Apr 2019 09:30:18 +0200 (CEST)","from uno.localdomain (2-224-242-101.ip172.fastwebnet.it\n\t[2.224.242.101]) (Authenticated sender: jacopo@jmondi.org)\n\tby relay3-d.mail.gandi.net (Postfix) with ESMTPSA id E206D60003;\n\tWed, 17 Apr 2019 07:30:17 +0000 (UTC)"],"X-Originating-IP":"2.224.242.101","Date":"Wed, 17 Apr 2019 09:31:09 +0200","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Niklas =?utf-8?q?S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","Cc":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Message-ID":"<20190417073109.7enfkwlntpae7itx@uno.localdomain>","References":"<20190415165700.22970-1-laurent.pinchart@ideasonboard.com>\n\t<20190415165700.22970-7-laurent.pinchart@ideasonboard.com>\n\t<20190416150950.3nmbnijalledssqq@uno.localdomain>\n\t<20190416200838.GA4822@pendragon.ideasonboard.com>\n\t<20190416210816.GF28515@bigcity.dyn.berto.se>","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\"; boundary=\"xtwbg53tl3oul3v4\"","Content-Disposition":"inline","In-Reply-To":"<20190416210816.GF28515@bigcity.dyn.berto.se>","User-Agent":"NeoMutt/20180716","Subject":"Re: [libcamera-devel] [PATCH 06/11] libcamera: geometry: Add\n\tcomparison operators to geometry classes","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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":"Wed, 17 Apr 2019 07:30:18 -0000"}}]