From patchwork Tue Apr 23 18:19:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milan Zamazal X-Patchwork-Id: 19930 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id F0166BE08B for ; Tue, 23 Apr 2024 18:20:22 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A7D89633EC; Tue, 23 Apr 2024 20:20:22 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="VsEsCQNp"; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8EA6661AC9 for ; Tue, 23 Apr 2024 20:20:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1713896420; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ej4J5SFxOLBaVAU2/GxZbptxItgAs3voArS0ckiAhY4=; b=VsEsCQNp63ayZflM6eQOnzShfVxuq8gTvjAfCYpIl5L5tyWtaa3Hqsp3XAA0npUrwJonfl Axz2GBUsyhDXS0dX+iwfK/OqwHpps3Xzxpmi7phiMgYNifHE30fnRsCEE8BnWNtXftaNVa 6/E1szXtRYw6EO5tflah+c5oNwnzLM4= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-227-WcX68h_iOFOJ9vT1dNlL_Q-1; Tue, 23 Apr 2024 14:20:18 -0400 X-MC-Unique: WcX68h_iOFOJ9vT1dNlL_Q-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A09901049C93 for ; Tue, 23 Apr 2024 18:20:18 +0000 (UTC) Received: from nuthatch.redhat.com (unknown [10.45.225.63]) by smtp.corp.redhat.com (Postfix) with ESMTP id E2187151EF; Tue, 23 Apr 2024 18:20:17 +0000 (UTC) From: Milan Zamazal To: libcamera-devel@lists.libcamera.org Cc: Milan Zamazal Subject: [PATCH 1/5] libcamera: software_isp: Use a specific integer type for black level Date: Tue, 23 Apr 2024 20:19:56 +0200 Message-ID: <20240423182000.1527425-2-mzamazal@redhat.com> In-Reply-To: <20240423182000.1527425-1-mzamazal@redhat.com> References: <20240423182000.1527425-1-mzamazal@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The documented range of values corresponds to uint8_t, so let's use that type. Signed-off-by: Milan Zamazal Reviewed-by: Laurent Pinchart --- src/ipa/simple/black_level.cpp | 3 ++- src/ipa/simple/black_level.h | 4 ++-- 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..a9ab12a3 100644 --- a/src/ipa/simple/black_level.cpp +++ b/src/ipa/simple/black_level.cpp @@ -8,6 +8,7 @@ #include "black_level.h" #include +#include #include @@ -43,7 +44,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..85bc5d8e 100644 --- a/src/ipa/simple/black_level.h +++ b/src/ipa/simple/black_level.h @@ -17,11 +17,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_; };