16#define GL_GLEXT_PROTOTYPES
17#define EGL_EGLEXT_PROTOTYPES
21#include "libcamera/internal/egl.h"
24#include "libcamera/internal/software_isp/benchmark.h"
25#include "libcamera/internal/software_isp/swstats_cpu.h"
28#include <EGL/eglext.h>
29#include <GLES3/gl32.h>
35#define DEBAYER_EGL_MIN_SIMPLE_RGB_GAIN_TEXTURE_UNITS 4
36#define DEBAYER_OPENGL_COORDS 4
47 const std::vector<std::reference_wrapper<const StreamConfiguration>> &outputCfgs,
48 bool ccmEnabled)
override;
64 static int getInputConfig(
PixelFormat inputFormat, DebayerInputConfig &config);
65 static int getOutputConfig(
PixelFormat outputFormat, DebayerOutputConfig &config);
67 int getShaderVariableLocations();
72 GLuint vertexShaderId_ = 0;
73 GLuint fragmentShaderId_ = 0;
74 GLuint programId_ = 0;
77 std::unique_ptr<eGLImage> eglImageBayerIn_;
78 std::unique_ptr<eGLImage> eglImageBayerOut_;
83 GLint attributeVertex_;
84 GLint attributeTexture_;
85 GLint textureUniformStep_;
86 GLint textureUniformSize_;
87 GLint textureUniformStrideFactor_;
88 GLint textureUniformBayerFirstRed_;
89 GLint textureUniformProjMatrix_;
91 GLint textureUniformBayerDataIn_;
94 GLint ccmUniformDataIn_;
97 GLint blackLevelUniformDataIn_;
100 GLint gammaUniformDataIn_;
103 GLint contrastExpUniformDataIn_;
106 std::unique_ptr<SwStatsCpu> stats_;
111 unsigned int bytesPerPixel_;
112 uint32_t shaderStridePixels_;
Provide access and manage all cameras in the system.
Definition camera_manager.h:25
int start() override
Execute a start signal in the debayer object from workerthread context.
Definition debayer_egl.cpp:569
std::tuple< unsigned int, unsigned int > strideAndFrameSize(const PixelFormat &outputFormat, const Size &size) override
Get the stride and the frame size.
Definition debayer_egl.cpp:362
int configure(const StreamConfiguration &inputCfg, const std::vector< std::reference_wrapper< const StreamConfiguration > > &outputCfgs, bool ccmEnabled) override
Configure the debayer object according to the passed in parameters.
Definition debayer_egl.cpp:278
const SharedFD & getStatsFD() override
Get the file descriptor for the statistics.
Definition debayer_egl.h:59
void stop() override
Stop the debayering process and perform cleanup.
Definition debayer_egl.cpp:592
Size patternSize(PixelFormat inputFormat) override
Get the width and height at which the bayer pattern repeats.
Definition debayer_egl.cpp:341
DebayerEGL(std::unique_ptr< SwStatsCpu > stats, const CameraManager &cm)
Construct a DebayerEGL object.
Definition debayer_egl.cpp:36
std::vector< PixelFormat > formats(PixelFormat input) override
Get the supported output formats.
Definition debayer_egl.cpp:351
SizeRange sizes(PixelFormat inputFormat, const Size &inputSize) override
Get the supported output sizes for the given input format and size.
Definition debayer_egl.cpp:601
void process(uint32_t frame, FrameBuffer *input, FrameBuffer *output, const DebayerParams ¶ms) override
Process the bayer data into the requested format.
Definition debayer_egl.cpp:525
Debayer(const CameraManager &cm)
Construct a Debayer object.
Definition debayer.cpp:59
Frame buffer data and its associated dynamic metadata.
Definition framebuffer.h:50
Map a FrameBuffer using the MappedBuffer interface.
Definition mapped_framebuffer.h:47
Describe a rectangle's position and dimensions.
Definition geometry.h:247
RAII-style wrapper for file descriptors.
Definition shared_fd.h:17
Describe a range of sizes.
Definition geometry.h:205
Describe a two-dimensional size.
Definition geometry.h:51
Helper class for managing OpenGL ES operations.
Definition egl.h:97
Internal frame buffer handling support.
Frame buffer memory mapping support.
Top-level libcamera namespace.
Definition backtrace.h:17
Base object to support automatic signal disconnection.
Struct to hold the debayer parameters.
Definition debayer_params.h:20
Configuration parameters for a stream.
Definition stream.h:40