From patchwork Fri Sep 11 13:28:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 9572 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 96D1DC3B5B for ; Fri, 11 Sep 2020 13:28:30 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1479962D86; Fri, 11 Sep 2020 15:28:30 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="YXoZSIyp"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 59DEB60534 for ; Fri, 11 Sep 2020 15:28:29 +0200 (CEST) Received: from Q.local (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id D44F4A17; Fri, 11 Sep 2020 15:28:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1599830909; bh=X6SINdmhevs82wSE9tb5ikQe8KefPmfatqN8+d2opKc=; h=From:To:Cc:Subject:Date:From; b=YXoZSIypWaDGdSSCEKwOBkgukmGGu1aQonmscvqIa3ZaX5ZaUoV0es7MMv0Oe6CcT Lg3dXlYQXjuMQgjfOuuGZIRiZSQXvtq7GbH/+Zp7UFQannQ+S3/Dz9Bjg5peTti2Be WsP7ePy0CTV5GMQ19EvV/4hFMt9MeLoxOrqlPY5w= From: Kieran Bingham To: libcamera devel Date: Fri, 11 Sep 2020 14:28:24 +0100 Message-Id: <20200911132824.1287513-1-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] qcam: format_converter: Support R8 Greyscale 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" Support Greyscale images in the format converter by expanding the R8 component to each of the output RGB components. Signed-off-by: Kieran Bingham Reviewed-by: Laurent Pinchart Reviewed-by: Niklas Söderlund --- This enables viewing of my IR camera with Qcam. src/qcam/format_converter.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/qcam/format_converter.cpp b/src/qcam/format_converter.cpp index 4b9722d4ecf7..b63d077e41cc 100644 --- a/src/qcam/format_converter.cpp +++ b/src/qcam/format_converter.cpp @@ -68,6 +68,13 @@ int FormatConverter::configure(const libcamera::PixelFormat &format, nvSwap_ = true; break; + case libcamera::formats::R8: + formatFamily_ = RGB; + r_pos_ = 0; + g_pos_ = 0; + b_pos_ = 0; + bpp_= 1; + break; case libcamera::formats::RGB888: formatFamily_ = RGB; r_pos_ = 2;