libcamera: src/libcamera/software_isp/debayer.h Source File

libcamera v0.3.2 Supporting cameras in Linux since 2019

Loading...
Searching...
No Matches
debayer.h
1/* SPDX-License-Identifier: LGPL-2.1-or-later */
2/*
3 * Copyright (C) 2023, Linaro Ltd
4 * Copyright (C) 2023, Red Hat Inc.
5 *
6 * Authors:
7 * Hans de Goede <hdegoede@redhat.com>
8 *
9 * debayering base class
10 */
11
12#pragma once
13
14#include <stdint.h>
15
16#include <libcamera/base/log.h>
17#include <libcamera/base/signal.h>
18
19#include <libcamera/geometry.h>
20#include <libcamera/stream.h>
21
22#include "libcamera/internal/software_isp/debayer_params.h"
23
24namespace libcamera {
25
26class FrameBuffer;
27
28 LOG_DECLARE_CATEGORY(Debayer)
29
30class Debayer
31{
32public:
33 virtual ~Debayer() = 0;
34
35 virtual int configure(const StreamConfiguration &inputCfg,
36 const std::vector<std::reference_wrapper<StreamConfiguration>> &outputCfgs) = 0;
37
38 virtual std::vector<PixelFormat> formats(PixelFormat inputFormat) = 0;
39
40 virtual std::tuple<unsigned int, unsigned int>
41 strideAndFrameSize(const PixelFormat &outputFormat, const Size &size) = 0;
42
43 virtual void process(FrameBuffer *input, FrameBuffer *output, DebayerParams params) = 0;
44
45 virtual SizeRange sizes(PixelFormat inputFormat, const Size &inputSize) = 0;
46
47 Signal<FrameBuffer *> inputBufferReady;
48 Signal<FrameBuffer *> outputBufferReady;
49
50private:
51 virtual Size patternSize(PixelFormat inputFormat) = 0;
52};
53
54} /* namespace libcamera */
libcamera::Debayer
Base debayering class.
Definition debayer.h:31
libcamera::Debayer::configure
virtual int configure(const StreamConfiguration &inputCfg, const std::vector< std::reference_wrapper< StreamConfiguration > > &outputCfgs)=0
Configure the debayer object according to the passed in parameters.
libcamera::Debayer::sizes
virtual SizeRange sizes(PixelFormat inputFormat, const Size &inputSize)=0
Get the supported output sizes for the given input format and size.
libcamera::Debayer::strideAndFrameSize
virtual std::tuple< unsigned int, unsigned int > strideAndFrameSize(const PixelFormat &outputFormat, const Size &size)=0
Get the stride and the frame size.
libcamera::Debayer::process
virtual void process(FrameBuffer *input, FrameBuffer *output, DebayerParams params)=0
Process the bayer data into the requested format.
libcamera::Debayer::formats
virtual std::vector< PixelFormat > formats(PixelFormat inputFormat)=0
Get the supported output formats.
libcamera::Debayer::outputBufferReady
Signal< FrameBuffer * > outputBufferReady
Signals when the output buffer is ready.
Definition debayer.h:48
libcamera::Debayer::inputBufferReady
Signal< FrameBuffer * > inputBufferReady
Signals when the input buffer is ready.
Definition debayer.h:47
libcamera::FrameBuffer
Frame buffer data and its associated dynamic metadata.
Definition framebuffer.h:49
libcamera::PixelFormat
libcamera image pixel format
Definition pixel_format.h:17
libcamera::Signal
Generic signal and slot communication mechanism.
Definition signal.h:39
libcamera::SizeRange
Describe a range of sizes.
Definition geometry.h:201
libcamera::Size
Describe a two-dimensional size.
Definition geometry.h:53
geometry.h
Data structures related to geometric objects.
log.h
Logging infrastructure.
LOG_DECLARE_CATEGORY
#define LOG_DECLARE_CATEGORY(name)
Declare a category of log messages.
Definition log.h:46
libcamera
Top-level libcamera namespace.
Definition backtrace.h:17
signal.h
Signal & slot implementation.
stream.h
Video stream for a Camera.
libcamera::DebayerParams
Struct to hold the debayer parameters.
Definition debayer_params.h:18
libcamera::StreamConfiguration
Configuration parameters for a stream.
Definition stream.h:40