[PATCH v2 1/5] libcamera: software_isp: Use a specific integer type for black level
Andrei Konovalov
andrey.konovalov.ynk at gmail.com
Wed May 22 11:45:06 CEST 2024
Hi Milan,
Thank you for the patch!
Reviewed-by: Andrei Konovalov <andrey.konovalov.ynk at gmail.com>
On 30.04.2024 20:34, Milan Zamazal wrote:
> The documented range of values corresponds to uint8_t, so let's use that
> type.
>
> Signed-off-by: Milan Zamazal <mzamazal at redhat.com>
> Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> ---
> src/ipa/simple/black_level.cpp | 2 +-
> src/ipa/simple/black_level.h | 5 +++--
> 2 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/src/ipa/simple/black_level.cpp b/src/ipa/simple/black_level.cpp
> index c7e8d8b7..410dc17b 100644
> --- a/src/ipa/simple/black_level.cpp
> +++ b/src/ipa/simple/black_level.cpp
> @@ -43,7 +43,7 @@ BlackLevel::BlackLevel()
> * \return The black level, in the range from 0 (minimum) to 255 (maximum).
> * If the black level couldn't be determined yet, return 0.
> */
> -unsigned int BlackLevel::get() const
> +uint8_t BlackLevel::get() const
> {
> return blackLevelSet_ ? blackLevel_ : 0;
> }
> diff --git a/src/ipa/simple/black_level.h b/src/ipa/simple/black_level.h
> index 7e37757e..e6cfa7ed 100644
> --- a/src/ipa/simple/black_level.h
> +++ b/src/ipa/simple/black_level.h
> @@ -8,6 +8,7 @@
> #pragma once
>
> #include <array>
> +#include <stdint.h>
>
> #include "libcamera/internal/software_isp/swisp_stats.h"
>
> @@ -17,11 +18,11 @@ class BlackLevel
> {
> public:
> BlackLevel();
> - unsigned int get() const;
> + uint8_t get() const;
> void update(SwIspStats::Histogram &yHistogram);
>
> private:
> - unsigned int blackLevel_;
> + uint8_t blackLevel_;
> bool blackLevelSet_;
> };
>
More information about the libcamera-devel
mailing list