From patchwork Tue Aug 23 17:43:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 17186 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 A0B60C0DA4 for ; Tue, 23 Aug 2022 17:43:22 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C8DCD61FBE; Tue, 23 Aug 2022 19:43:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1661276601; bh=FxUgzQ03VuzgVC9x/q2zOxR/+W62CaCJuGRUCvWE7EI=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=cX0H6i2V8paStaLGJbpOQpN98PO/2/tdHuLow7kC4cXXrbhWbdZkeW5RcnPguhXnH tpT2SMCv4ka1P7qT+1Y0antQH8bbpElJyYAaCLrLByuSaHFoCLTjJvMB8i7emZLlHD WmvfT1J2uzQVge0JGqHKlWhEZF6NzcyT15R25MrcPIBkFAmgBwy8i2qrKZvCrvLNT8 flOZayLnuha307QAWG9+MmysN5ojRR0NcfOMsEa7uEa4yMg6bb2d+xTFIlycf+usj2 fuegJNOGMeH0LO0AUfI9TeSFgz/o3kkV+0mZtBwPN0FVKp7SL6610hMzbKagbc+8OJ OQjQru1Y8M3fg== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2143D603E3 for ; Tue, 23 Aug 2022 19:43:20 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="mc+oG1FM"; dkim-atps=neutral Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 6A41D2B3 for ; Tue, 23 Aug 2022 19:43:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1661276599; bh=FxUgzQ03VuzgVC9x/q2zOxR/+W62CaCJuGRUCvWE7EI=; h=From:To:Subject:Date:From; b=mc+oG1FMGWPLGriZTQtOLYnnaIYbRWUYO9xj1nlS5PShYWHnJto3V4aXx+pGc6kBN s9DW7OlNFnTHZkICPQF2KQSAaA3TwZQCWbAbK5mGylYH7FuDcrFS5J34hMw+pP//rA gaBr5DMP05nz8pB/bVM7xw/kR7PXgqmU3e1SkRrU= To: libcamera-devel@lists.libcamera.org Date: Tue, 23 Aug 2022 20:43:08 +0300 Message-Id: <20220823174314.14881-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 0/6] libcamera: Add support for color spaces to rkisp1 pipeline handler 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: , X-Patchwork-Original-From: Laurent Pinchart via libcamera-devel From: Laurent Pinchart Reply-To: Laurent Pinchart Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Hello, This patch series adds support for color spaces to the rkisp1 pipeline handler. The series starts in 1/6 with an improvement to the StringSplitter::iterator class that makes it usable as arguments to constructors of various containers (to be used in patch 3/6). Patch 2/6 reorders the members of the ColorSpace class in color_space.cpp to prepare for 3/6, which adds a ColorSpace::fromString() function. Patch 4/6 then adds a missing unit test for the ColorSpace class. Patch 5/6 then adds color space support to the rkisp1 pipeline handler. This is currently limited to configuring the YCbCr encoding and quantization range. The color primaries and transfer functions need to be configured through the ISP parameters buffers, which needs to involve the IPA module. I would have included the necessary code here, if it wasn't for the fact that the tone mapping configuration isn't supported by the rkisp1 driver yet. Finally, patch 6/6 adds support for setting color spaces to the cam application, as I needed a test tool. Laurent Pinchart (6): utils: Satisfy LegacyInputIterator with StringSplitter::iterator libcamera: color_space: Reorder members in the same order as the header libcamera: color_space: Add fromString() function test: Add a ColorSpace test libcamera: pipeline: rkisp1: Implement color space support cam: Add color space support include/libcamera/base/utils.h | 6 + include/libcamera/color_space.h | 2 + src/cam/stream_options.cpp | 7 + src/libcamera/color_space.cpp | 293 +++++++++++++++-------- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 38 ++- test/color-space.cpp | 105 ++++++++ test/meson.build | 1 + test/utils.cpp | 8 + 8 files changed, 353 insertions(+), 107 deletions(-) create mode 100644 test/color-space.cpp