[libcamera-devel] [PATCH] qcam: format_converter: Support R8 Greyscale

Laurent Pinchart laurent.pinchart at ideasonboard.com
Fri Sep 11 19:38:27 CEST 2020


Hi Kieran,

Thank you for the patch.

On Fri, Sep 11, 2020 at 02:28:24PM +0100, Kieran Bingham wrote:
> Support Greyscale images in the format converter by expanding the R8
> component to each of the output RGB components.
> 
> Signed-off-by: Kieran Bingham <kieran.bingham at ideasonboard.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>

> ---
> 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;

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list