[{"id":11056,"web_url":"https://patchwork.libcamera.org/comment/11056/","msgid":"<20200701165028.GL2399385@oden.dyn.berto.se>","date":"2020-07-01T16:50:28","subject":"Re: [libcamera-devel] [PATCH 11/15] libcamera: geometry: Add\n\tisNull() function to Rectangle class","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Jacopo,\n\nThanks for your patch.\n\nOn 2020-07-01 14:30:32 +0200, Jacopo Mondi wrote:\n> It's common for code to check if a rectangle is null. Add a helper function\n> to do so.\n> \n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\n> ---\n>  include/libcamera/geometry.h | 1 +\n>  src/libcamera/geometry.cpp   | 6 ++++++\n>  2 files changed, 7 insertions(+)\n> \n> diff --git a/include/libcamera/geometry.h b/include/libcamera/geometry.h\n> index 7d4b8bcfe3d8..44561d9cc5a4 100644\n> --- a/include/libcamera/geometry.h\n> +++ b/include/libcamera/geometry.h\n> @@ -18,6 +18,7 @@ struct Rectangle {\n>  \tunsigned int width;\n>  \tunsigned int height;\n>  \n> +\tbool isNull() const { return !width && !height; }\n>  \tconst std::string toString() const;\n>  };\n>  \n> diff --git a/src/libcamera/geometry.cpp b/src/libcamera/geometry.cpp\n> index 24c44fb43acf..af29ed1119fe 100644\n> --- a/src/libcamera/geometry.cpp\n> +++ b/src/libcamera/geometry.cpp\n> @@ -49,6 +49,12 @@ namespace libcamera {\n>   * \\brief The distance between the top and bottom sides\n>   */\n>  \n> +/**\n> + * \\fn bool Rectangle::isNull() const\n> + * \\brief Check if the rectangle is null\n> + * \\return True if both the width and height are 0, or false otherwise\n> + */\n> +\n>  /**\n>   * \\brief Assemble and return a string describing the rectangle\n>   * \\return A string describing the Rectangle\n> -- \n> 2.27.0\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 A2C44BFFE2\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  1 Jul 2020 16:50:31 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6A47360C58;\n\tWed,  1 Jul 2020 18:50:31 +0200 (CEST)","from mail-lf1-x143.google.com (mail-lf1-x143.google.com\n\t[IPv6:2a00:1450:4864:20::143])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id F299A60C53\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  1 Jul 2020 18:50:29 +0200 (CEST)","by mail-lf1-x143.google.com with SMTP id m26so14076101lfo.13\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 01 Jul 2020 09:50:29 -0700 (PDT)","from localhost (h-209-203.A463.priv.bahnhof.se. [155.4.209.203])\n\tby smtp.gmail.com with ESMTPSA id\n\ti197sm2246022lfi.58.2020.07.01.09.50.28\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 01 Jul 2020 09:50:28 -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=\"CJwtye/9\"; 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=0HQlwGczX+HgnNkuUc92hqACnfNc5ImeFZekZ0vBpeM=;\n\tb=CJwtye/9Y6F4Ul3UjJJoMx7dGVCQLku6L5ppZQixzPHOXUa/Ze9fJJnNSVeZyHtU00\n\tRrs9K6rkRf8FV16vOJLlhE2Mf+aKy8FZJ32W2bPvS8CBvB3ZtjuB5nIJYHyJNJd6D5Vz\n\tJlPVoi1QFXpIDpTaOPQfeHlL+qxBtte2Kv0IpUThD35inZPoO9BzpOYZevtoIbsxF5xo\n\tL/aolxLH1/h7kRUzJak07EZzv2KMBrBQD/kTNqaoNfjvDpUrebus7l/zoVTRnrb3BqbS\n\ttjzMsCb9IEcsMzB/w5mZUgVGBHBkM0c2z3qq9ThLpYeiL7sEZZDER2I7Qemdhc4n1a5o\n\tbCYw==","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=0HQlwGczX+HgnNkuUc92hqACnfNc5ImeFZekZ0vBpeM=;\n\tb=NXWAJea5VulKx1v1KgJiL4/VC4Q7VconVwyUdWqeg45E+SWt+yYwpzNlzO32i4BM4C\n\tSRvp7ZrW3jf5SkJosNWnw7othjdW+bWt33shTwYhJnT6DS1DWJbwffjhScu7qGLJDEym\n\teFX5M9AtKHbmz4eCjqiTc7HsgfpLnApquwkw3L8jvdDw7S6PsRV+4or11oQaGWbRMkQC\n\tP6hLwmkcRxsY9NW0KTWwvM3jML8uKZ9cFjALFreKVt5hz6LrJHj23Aoa/oWdFkdb7yqv\n\txt+DbcSqcX9jTEoIKcq6GRRLuUTZewKSD2ehDukjh48tjOLLSjQJY0qa4cD9PwILjbMa\n\tLMMQ==","X-Gm-Message-State":"AOAM532/KzmRQeolxR1pupUFV4+g95x9945aBq3eqBWiHy693YBbz9/0\n\tTavdww4CJZjDpAaRj5O1L+BgIA==","X-Google-Smtp-Source":"ABdhPJxN049NvPxmi3J9myW1mjBfX9911OIwntiQgvGk+TxZMSpWTCo0VvORL32VnngASqzo6hidbw==","X-Received":"by 2002:a05:6512:3190:: with SMTP id\n\ti16mr15626852lfe.158.1593622229417; \n\tWed, 01 Jul 2020 09:50:29 -0700 (PDT)","Date":"Wed, 1 Jul 2020 18:50:28 +0200","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<20200701165028.GL2399385@oden.dyn.berto.se>","References":"<20200701123036.51922-1-jacopo@jmondi.org>\n\t<20200701123036.51922-12-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20200701123036.51922-12-jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [PATCH 11/15] libcamera: geometry: Add\n\tisNull() function to Rectangle class","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>"}}]