libcamera v0.5.1 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
24 namespace libcamera {
25
26 class FrameBuffer;
27
28 LOG_DECLARE_CATEGORY(Debayer)
29
30class Debayer
31{
32 public:
33 virtual ~Debayer() = 0;
34
35 virtual int configure(const StreamConfiguration &inputCfg,
36 const std::vector<std::reference_wrapper<StreamConfiguration>> &outputCfgs,
37 bool ccmEnabled) = 0;
38
39 virtual std::vector<PixelFormat> formats(PixelFormat inputFormat) = 0;
40
41 virtual std::tuple<unsigned int, unsigned int>
42 strideAndFrameSize(const PixelFormat &outputFormat, const Size &size) = 0;
43
44 virtual void process(uint32_t frame, FrameBuffer *input, FrameBuffer *output, DebayerParams params) = 0;
45
46 virtual SizeRange sizes(PixelFormat inputFormat, const Size &inputSize) = 0;
47
48 Signal<FrameBuffer *> inputBufferReady;
49 Signal<FrameBuffer *> outputBufferReady;
50
51 private:
52 virtual Size patternSize(PixelFormat inputFormat) = 0;
53};
54
55} /* 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, bool ccmEnabled)=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(uint32_t frame, 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:49
libcamera::Debayer::inputBufferReady
Signal< FrameBuffer * > inputBufferReady
Signals when the input buffer is ready.
Definition debayer.h:48
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:199
libcamera::Size
Describe a two-dimensional size.
Definition geometry.h:51
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:51
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