[{"id":29344,"web_url":"https://patchwork.libcamera.org/comment/29344/","msgid":"<20240425171716.GH28454@pendragon.ideasonboard.com>","date":"2024-04-25T17:17:16","subject":"Re: [PATCH 1/5] libcamera: software_isp: Use a specific integer type\n\tfor black level","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Milan,\n\nThank you for the patch.\n\nOn Tue, Apr 23, 2024 at 08:19:56PM +0200, Milan Zamazal wrote:\n> The documented range of values corresponds to uint8_t, so let's use that\n> type.\n> \n> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n> ---\n>  src/ipa/simple/black_level.cpp | 3 ++-\n>  src/ipa/simple/black_level.h   | 4 ++--\n>  2 files changed, 4 insertions(+), 3 deletions(-)\n> \n> diff --git a/src/ipa/simple/black_level.cpp b/src/ipa/simple/black_level.cpp\n> index c7e8d8b7..a9ab12a3 100644\n> --- a/src/ipa/simple/black_level.cpp\n> +++ b/src/ipa/simple/black_level.cpp\n> @@ -8,6 +8,7 @@\n>  #include \"black_level.h\"\n>  \n>  #include <numeric>\n> +#include <stdint.h>\n\nThis should go to black_level.h, as you're using the type there. With\nthat,\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n>  \n>  #include <libcamera/base/log.h>\n>  \n> @@ -43,7 +44,7 @@ BlackLevel::BlackLevel()\n>   * \\return The black level, in the range from 0 (minimum) to 255 (maximum).\n>   * If the black level couldn't be determined yet, return 0.\n>   */\n> -unsigned int BlackLevel::get() const\n> +uint8_t BlackLevel::get() const\n>  {\n>  \treturn blackLevelSet_ ? blackLevel_ : 0;\n>  }\n> diff --git a/src/ipa/simple/black_level.h b/src/ipa/simple/black_level.h\n> index 7e37757e..85bc5d8e 100644\n> --- a/src/ipa/simple/black_level.h\n> +++ b/src/ipa/simple/black_level.h\n> @@ -17,11 +17,11 @@ class BlackLevel\n>  {\n>  public:\n>  \tBlackLevel();\n> -\tunsigned int get() const;\n> +\tuint8_t get() const;\n>  \tvoid update(SwIspStats::Histogram &yHistogram);\n>  \n>  private:\n> -\tunsigned int blackLevel_;\n> +\tuint8_t blackLevel_;\n>  \tbool blackLevelSet_;\n>  };\n>","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 F10D4BE08B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 25 Apr 2024 17:17:26 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C8025633FD;\n\tThu, 25 Apr 2024 19:17:25 +0200 (CEST)","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 0DD9C61B43\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 25 Apr 2024 19:17:24 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(117.145-247-81.adsl-dyn.isp.belgacom.be [81.247.145.117])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 2907A82A;\n\tThu, 25 Apr 2024 19:16:31 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"oTbO6aMl\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1714065391;\n\tbh=ROGsc+F3USn2qHkrsCDti+bntKaC9TWkBgyzDALvdeY=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=oTbO6aMlI7ltjmccyDgsTIeagVwZOHkScgw3EBYvjw4UcWv0ALX38LWRqyzU4c6xn\n\tq71XzfT4E98jQzgHYGiEBsy/L2/x1P0aj4+43KrLewhM5962HZ/iX3amHJGK1l477B\n\t7kcF+cEKecoi6EDUYtFeoAUw7jk6QKP6QAMkNS+s=","Date":"Thu, 25 Apr 2024 20:17:16 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Milan Zamazal <mzamazal@redhat.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH 1/5] libcamera: software_isp: Use a specific integer type\n\tfor black level","Message-ID":"<20240425171716.GH28454@pendragon.ideasonboard.com>","References":"<20240423182000.1527425-1-mzamazal@redhat.com>\n\t<20240423182000.1527425-2-mzamazal@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20240423182000.1527425-2-mzamazal@redhat.com>","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]