libcamera: libcamera::DebayerEGL Class Reference

libcamera v0.7.1 Supporting cameras in Linux since 2019

Loading...
Searching...
No Matches
libcamera::DebayerEGL Class Reference

Class for debayering using an EGL Shader. More...

Inheritance diagram for libcamera::DebayerEGL:
[legend]
Collaboration diagram for libcamera::DebayerEGL:
[legend]

## Public Member Functions
| DebayerEGL (std::unique_ptr< SwStatsCpu > stats, const CameraManager &cm)
| Construct a DebayerEGL object.
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.
Size | patternSize (PixelFormat inputFormat) override
| Get the width and height at which the bayer pattern repeats.
std::vector< PixelFormat > | formats (PixelFormat input) override
| Get the supported output formats.
std::tuple< unsigned int, unsigned int > | strideAndFrameSize (const PixelFormat &outputFormat, const Size &size) override
| Get the stride and the frame size.
void | process (uint32_t frame, FrameBuffer *input, FrameBuffer *output, const DebayerParams &params) override
| Process the bayer data into the requested format.
int | start () override
| Execute a start signal in the debayer object from workerthread context.
void | stop () override
| Stop the debayering process and perform cleanup.
const SharedFD & | getStatsFD () override
| Get the file descriptor for the statistics.
SizeRange | sizes (PixelFormat inputFormat, const Size &inputSize) override
| Get the supported output sizes for the given input format and size.
Public Member Functions inherited from libcamera::Debayer
| Debayer (const CameraManager &cm)
| Construct a Debayer object.
unsigned int | frameSize ()
| Get the output frame size.
Public Member Functions inherited from libcamera::Object
| Object (Object *parent=nullptr)
| Construct an Object instance.
virtual | ~Object ()
| Destroy an Object instance.
void | deleteLater ()
| Schedule deletion of the instance in the thread it belongs to.
void | postMessage (std::unique_ptr< Message > msg)
| Post a message to the object's thread.
template<typename T, typename R, typename... FuncArgs, typename... Args, std::enable_if_t< std::is_base_of< Object, T >::value > * = nullptr>
R | invokeMethod (R(T::*func)(FuncArgs...), ConnectionType type, Args &&... args)
| Invoke a method asynchronously on an Object instance.
Thread * | thread () const
| Retrieve the thread the object is bound to.
void | moveToThread (Thread *thread)
| Move the object and all its children to a different thread.
Object * | parent () const
| Retrieve the object's parent.

## Additional Inherited Members
Public Attributes inherited from libcamera::Debayer
Signal< FrameBuffer * > | inputBufferReady
| Signals when the input buffer is ready.
Signal< FrameBuffer * > | outputBufferReady
| Signals when the output buffer is ready.
DebayerInputConfig | inputConfig_
| Input configuration parameters for the current debayer operation.
DebayerOutputConfig | outputConfig_
| Output configuration data for the debayered frame.
Size | outputSize_
| Output size object.
PixelFormat | inputPixelFormat_
| The incoming pixel format.
PixelFormat | outputPixelFormat_
| The output pixel format.
bool | swapRedBlueGains_
| Flag indicating whether red and blue channel gains should be swapped.
Benchmark | bench_
| Benchmarking utility instance for performance measurements.
Protected Member Functions inherited from libcamera::Debayer
void | dmaSyncBegin (std::vector< DmaSyncer > &dmaSyncers, FrameBuffer *input, FrameBuffer *output)
| Common CPU/GPU Dma Sync Buffer begin.
Protected Member Functions inherited from libcamera::Object
virtual void | message (Message *msg)
| Message handler for the object.
bool | assertThreadBound (const char *message)
| Check if the caller complies with thread-bound constraints.
Static Protected Member Functions inherited from libcamera::Debayer
static bool | isStandardBayerOrder (BayerFormat::Order order)
| Common method to validate standard 2x2 Bayer pattern of 2 Green, 1 Blue, 1 Red pixels.

## Detailed Description

Class for debayering using an EGL Shader.

Implements an EGL shader based debayering solution.

## Constructor & Destructor Documentation

## ◆ DebayerEGL()

libcamera::DebayerEGL::DebayerEGL | ( | std::unique_ptr< SwStatsCpu > | stats,
|  | const CameraManager & | cm )

Construct a DebayerEGL object.

Parameters

  [in] | stats | Statistics processing object
  [in] | cm | The camera manager

## Member Function Documentation

## ◆ configure()

int libcamera::DebayerEGL::configure | ( | const StreamConfiguration & | inputCfg,
|  | const std::vector< std::reference_wrapper< const StreamConfiguration > > & | outputCfgs,
|  | bool | ccmEnabled )
| overridevirtual

Configure the debayer object according to the passed in parameters.

Parameters

  [in] | inputCfg | The input configuration
  [in] | outputCfgs | The output configurations
  [in] | ccmEnabled | Whether a color correction matrix is applied

Returns
  0 on success, a negative errno on failure

Implements libcamera::Debayer.

## ◆ formats()

std::vector< PixelFormat > libcamera::DebayerEGL::formats | ( | PixelFormat | inputFormat | ) |
| overridevirtual

Get the supported output formats.

Parameters

  [in] | inputFormat | The input format

Returns
  All supported output formats or an empty vector if there are none

Implements libcamera::Debayer.

## ◆ getStatsFD()

const SharedFD & libcamera::DebayerEGL::getStatsFD | ( |  | ) |
| inlineoverridevirtual

Get the file descriptor for the statistics.

This file descriptor provides access to the output statistics buffer associated with the current debayering process.

Returns
  The file descriptor pointing to the statistics data

Implements libcamera::Debayer.

## ◆ patternSize()

Size libcamera::DebayerEGL::patternSize | ( | PixelFormat | inputFormat | ) |
| overridevirtual

Get the width and height at which the bayer pattern repeats.

Parameters

  [in] | inputFormat | The input format

Valid sizes are: 2x2, 4x2 or 4x4.

Returns
  Pattern size or an empty size for unsupported inputFormats

Implements libcamera::Debayer.

## ◆ process()

void libcamera::DebayerEGL::process | ( | uint32_t | frame,
|  | FrameBuffer * | input,
|  | FrameBuffer * | output,
|  | const DebayerParams & | params )
| overridevirtual

Process the bayer data into the requested format.

Parameters

  [in] | frame | The frame number
  [in] | input | The input buffer
  [in] | output | The output buffer
  [in] | params | The parameters to be used in debayering

Note
  DebayerParams is passed by value deliberately so that a copy is passed when this is run in another thread by invokeMethod().

Implements libcamera::Debayer.

## ◆ sizes()

SizeRange libcamera::DebayerEGL::sizes | ( | PixelFormat | inputFormat,
|  | const Size & | inputSize )
| overridevirtual

Get the supported output sizes for the given input format and size.

Parameters

  [in] | inputFormat | The input format
  [in] | inputSize | The input size

Returns
  The valid size ranges or an empty range if there are none

Implements libcamera::Debayer.

## ◆ start()

int libcamera::DebayerEGL::start | ( |  | ) |
| overridevirtual

Execute a start signal in the debayer object from workerthread context.

The start() method is invoked so that a Debayer object can initialise internal variables or data. It is called from the software_isp::start method.

This method is particularly useful with DebayerEGL as it allows for the initialisation of the EGL stack after configure in a thread-safe manner.

Reimplemented from libcamera::Debayer.

## ◆ stop()

void libcamera::DebayerEGL::stop | ( |  | ) |
| overridevirtual

Stop the debayering process and perform cleanup.

The stop() method is invoked as the logically corollary of start(). Debayer::stop() will be called by software_isp::stop() allowing for any cleanup which should happend with stop().

The stop method similar to start() is useful for DebayerEGL as it allows for cleanup of EGL context and/or data that happens in DebayerEGL::start.

Reimplemented from libcamera::Debayer.

## ◆ strideAndFrameSize()

std::tuple< unsigned int, unsigned int > libcamera::DebayerEGL::strideAndFrameSize | ( | const PixelFormat & | outputFormat,
|  | const Size & | size )
| overridevirtual

Get the stride and the frame size.

Parameters

  [in] | outputFormat | The output format
  [in] | size | The output size

Returns
  A tuple of the stride and the frame size, or a tuple with 0,0 if there is no valid output config

Implements libcamera::Debayer.

The documentation for this class was generated from the following files:

- src/libcamera/software_isp/debayer_egl.h
- src/libcamera/software_isp/debayer_egl.cpp