libcamera: libcamera::DebayerCpu Class Reference

libcamera v0.5.1 Supporting cameras in Linux since 2019

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

Class for debayering on the CPU. More...

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

## Public Member Functions
| DebayerCpu (std::unique_ptr< SwStatsCpu > stats)
| Constructs a DebayerCpu object.
int | configure (const StreamConfiguration &inputCfg, const std::vector< std::reference_wrapper< StreamConfiguration > > &outputCfgs, bool ccmEnabled)
| Configure the debayer object according to the passed in parameters.
Size | patternSize (PixelFormat inputFormat)
| Get the width and height at which the bayer pattern repeats.
std::vector< PixelFormat > | formats (PixelFormat input)
| Get the supported output formats.
std::tuple< unsigned int, unsigned int > | strideAndFrameSize (const PixelFormat &outputFormat, const Size &size)
| Get the stride and the frame size.
void | process (uint32_t frame, FrameBuffer *input, FrameBuffer *output, DebayerParams params)
| Process the bayer data into the requested format.
SizeRange | sizes (PixelFormat inputFormat, const Size &inputSize)
| Get the supported output sizes for the given input format and size.
const SharedFD & | getStatsFD ()
| Get the file descriptor for the statistics.
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.
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.

## Detailed Description

Class for debayering on the CPU.

Implementation for CPU based debayering

## Constructor & Destructor Documentation

## ◆ DebayerCpu()

libcamera::DebayerCpu::DebayerCpu | ( | std::unique_ptr< SwStatsCpu > | stats | ) |

Constructs a DebayerCpu object.

Parameters

  [in] | stats | Pointer to the stats object to use

## Member Function Documentation

## ◆ configure()

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

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::DebayerCpu::formats | ( | PixelFormat | inputFormat | ) |
| virtual

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.

## ◆ frameSize()

unsigned int libcamera::DebayerCpu::frameSize | ( |  | ) |
| inline

Get the output frame size.

Returns
  The output frame size

## ◆ getStatsFD()

const SharedFD & libcamera::DebayerCpu::getStatsFD | ( |  | ) |
| inline

Get the file descriptor for the statistics.

Returns
  the file descriptor pointing to the statistics

## ◆ patternSize()

Size libcamera::DebayerCpu::patternSize | ( | PixelFormat | inputFormat | ) |
| virtual

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::DebayerCpu::process | ( | uint32_t | frame,
|  | FrameBuffer * | input,
|  | FrameBuffer * | output,
|  | DebayerParams | params )
| virtual

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::DebayerCpu::sizes | ( | PixelFormat | inputFormat,
|  | const Size & | inputSize )
| virtual

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.

## ◆ strideAndFrameSize()

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

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_cpu.h
- src/libcamera/software_isp/debayer_cpu.cpp