From patchwork Mon Oct 11 12:48:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siyuan Fan X-Patchwork-Id: 14083 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 90127C323E for ; Mon, 11 Oct 2021 12:48:38 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0B77468F50; Mon, 11 Oct 2021 14:48:38 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=foxmail.com header.i=@foxmail.com header.b="yZHLxLfp"; dkim-atps=neutral Received: from out203-205-221-153.mail.qq.com (out203-205-221-153.mail.qq.com [203.205.221.153]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B62E16012B for ; Mon, 11 Oct 2021 14:48:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1633956510; bh=4lNCq3NSsh4bs2xqdhTjA537TG4js5UXWvZRWRt4yLI=; h=From:To:Cc:Subject:Date; b=yZHLxLfpeNGjnGYp0Fs74exKGEVvb8Nyn8CyJeHb3eN2xT7EPKs81uouqF7Sx2qHH u79Ul24yL2vlkL/ZkECnSDqIIz6Zru96eV6/8OZAbshiuCjE332WWU+/nlb+P90ik9 Ptd8xg49L+swV9u4RlYkKLxj5Hrt+0C0gg71Oeao= Received: from localhost.localdomain ([36.112.203.237]) by newxmesmtplogicsvrszb6.qq.com (NewEsmtp) with SMTP id C1AB4444; Mon, 11 Oct 2021 20:48:26 +0800 X-QQ-mid: xmsmtpt1633956506toxwbmoxx Message-ID: X-QQ-XMAILINFO: MHMAY6vlphTX2rkY/SFXpD1x/JxpH/q49rD+N/XMDqlMz5y/uwPTY0sRIoIgET z1axKATaKhnJ9OsNZxPnqBe8qbrPPsB0Cy1KbIFhqA1CLokVWS8eqPe/xbfjHiJfTpBcuCRVFKPD MlYVtStGC90A/rbhhwNuXw85YlgzlCFmRAQ8l9rtxw/aXReSzsDaWlyEWhb34xezWPS0nv7NNWeu JDvVmFasxyZ8rcCe+Jm+OxDYQhwzzbqhCvoSHDS2kWfWKtYFLVit3Vh1r8dQjabw400ju0jOx44+ Skq5+LzHq1Pr9YqFSNUaotDeAkEN9E8UBuf1MBvEKDClVB6vCFi7QBVeAnB217j2PMxbXCkuXt/2 kuQZlId0NoYolbJflbdZMmrYCTlxk5rQ1l972MsqUVpXndORPc06435HK+lJplqEr155rF+XYOOK op/OWBGWWMSyoClWoS2vmFnfiIXkxLmRkeJiljJNJjJesiOJ4eonuyQ0uOKPWrCZS+3LWEwxQlpN ggUYkwraZj/bBCY1jKJbTZ7rHs35LE41WGOuwpD1eYdWtMYAqY5sH9JXQbX6PUU6JmythIAgc8w8 4vJ85Mp2HtbpqG1h4yEchoKP6pPvpW+mBzyAgeppA8r0GenMrs9RiLgRsZ14kBCWIJJX7hqZSusQ pXbKz90WRwSRh018Bo42WEEtftdXT9cDoqUO5GU7vpOF/LCxzNwhKyBQhtX/9eaUr8SFoCTI3ebm VHpHpiaqQrihp4vKwW2BiFN9YtaKH0sANMl/4YRVGh6aNIW8YwnGOSjvrU1rdLFxyy6al1jBm9vZ LKePfT+C2lRbdVck7y+hAq4iZd38gppS+kLXqL4tdAsoOVq8R4aheHWlsJdRT/2rnC4rO2EYVTIA == From: Siyuan Fan To: libcamera-devel@lists.libcamera.org Date: Mon, 11 Oct 2021 13:48:24 +0100 X-OQ-MSGID: <20211011124824.4756-1-siyuan.fan@foxmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH v2] libcamera: isp: Add ISP class 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" From: Fan Siyuan This version adds the isp statistics struct and two signals, which should be connected to corresponding seperate functions. Signed-off-by: Fan Siyuan --- include/libcamera/internal/isp.h | 102 +++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 include/libcamera/internal/isp.h diff --git a/include/libcamera/internal/isp.h b/include/libcamera/internal/isp.h new file mode 100644 index 00000000..4b4c38e7 --- /dev/null +++ b/include/libcamera/internal/isp.h @@ -0,0 +1,102 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2021, Siyuan Fan + * + * isp.h - The software ISP abstract base class + */ +#ifndef __LIBCAMERA_INTERNAL_ISP_H__ +#define __LIBCAMERA_INTERNAL_ISP_H__ + +#include +#include + +#include +#include +#include +#include + +#include "libcamera/base/object.h" +#include "libcamera/base/signal.h" + +namespace libcamera{ + +class ISP : public Object +{ +public: + ISP() {} + + virtual ~ISP() {} + + virtual int configure(PixelFormat &inputFormat, PixelFormat &outputFormat, Size &inputSize, Size &outputSize) = 0; + + virtual void processing(struct isp_stats *stats, FrameBuffer *srcBuffer, FrameBuffer *dstBuffer, int width, int height) = 0; + + virtual void calculating(struct isp_stats* stats, FrameBuffer *srcBuffer) = 0; + + virtual int exportBuffers(std::vector> *buffers, unsigned int count, int width, int height) = 0; + + virtual int exportStats(struct isp_stats *stats) = 0; + + virtual void start() = 0; + + virtual void stop() = 0; + + Signal ispCompleted; + Signal calcStats; + Signal imgProcess; + + struct isp_black_level { + __u32 enabled; + __u16 bl_r; + __u16 bl_gr; + __u16 bl_gb; + __u16 bl_b; + }; + + struct isp_lens_shading { + __u32 enabled; + __u16 grid[16][16]; + }; + + struct isp_denoise_raw { + __u32 enabled; + }; + + struct isp_auto_white_balance { + __u32 enabled; + __u64 r_mean; + __u64 g_mean; + __u64 b_mean; + }; + + struct isp_gamma_correct { + __u32 enabled; + __u16 gammaX[33]; + __u16 gammaY[33]; + }; + + struct isp_color_correct { + __u32 enabled; + __s32 ccm[3][3]; + }; + + struct isp_histogram { + __u32 r_hist[1024]; + __u32 g_hist[1024]; + __u32 b_hist[1024]; + }; + + struct isp_stats { + struct isp_black_level isp_bl; + struct isp_lens_shading isp_ls; + struct isp_denoise_raw isp_dr; + struct isp_auto_white_balance isp_awb; + struct isp_gamma_correct isp_gc; + struct isp_color_correct isp_cc; + struct isp_histogram isp_hist; + }; +}; + +} /* namespace libcamera */ + +#endif /* __LIBCAMERA_INTERNAL_ISP_H__ */