libcamera  v0.3.1+12-19bbca3c
Supporting cameras in Linux since 2019
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 
30 class 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) = 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 
49 
50 private:
51  virtual Size patternSize(PixelFormat inputFormat) = 0;
52 };
53 
54 } /* namespace libcamera */
Struct to hold the debayer parameters.
Definition: debayer_params.h:18
libcamera image pixel format
Definition: pixel_format.h:17
Top-level libcamera namespace.
Definition: backtrace.h:17
Frame buffer data and its associated dynamic metadata.
Definition: framebuffer.h:49
Describe a two-dimensional size.
Definition: geometry.h:52
Video stream for a Camera.
#define LOG_DECLARE_CATEGORY(name)
Declare a category of log messages.
Signal & slot implementation.
Signal< FrameBuffer * > inputBufferReady
Signals when the input buffer is ready.
Definition: debayer.h:47
Generic signal and slot communication mechanism.
Definition: object.h:20
Describe a range of sizes.
Definition: geometry.h:200
Signal< FrameBuffer * > outputBufferReady
Signals when the output buffer is ready.
Definition: debayer.h:48
Data structures related to geometric objects.
Logging infrastructure.
Base debayering class.
Definition: debayer.h:30
Configuration parameters for a stream.
Definition: stream.h:41