libcamera  v0.2.0+150-2031e2f2
Supporting cameras in Linux since 2019
Public Member Functions | Public Attributes | List of all members
libcamera::SwStatsCpu Class Reference

Class for gathering statistics on the CPU. More...

Collaboration diagram for libcamera::SwStatsCpu:
Collaboration graph
[legend]

Public Member Functions

bool isValid () const
 Gets whether the statistics object is valid. More...
 
const SharedFDgetStatsFD ()
 Get the file descriptor for the statistics. More...
 
const SizepatternSize ()
 Get the pattern size. More...
 
int configure (const StreamConfiguration &inputCfg)
 Configure the statistics object for the passed in input format. More...
 
void setWindow (const Rectangle &window)
 Specify window coordinates over which to gather statistics. More...
 
void startFrame ()
 Reset state to start statistics gathering for a new frame. More...
 
void finishFrame ()
 Finish statistics calculation for the current frame. More...
 
void processLine0 (unsigned int y, const uint8_t *src[])
 Process line 0. More...
 
void processLine2 (unsigned int y, const uint8_t *src[])
 Process line 2 and 3. More...
 

Public Attributes

Signal statsReady
 Signals that the statistics are ready.
 

Detailed Description

Class for gathering statistics on the CPU.

CPU based software ISP statistics implementation.

This class offers a configure function + functions to gather statistics on a line by line basis. This allows CPU based software debayering to interleave debayering and statistics gathering on a line by line basis while the input data is still hot in the cache.

It is also possible to specify a window over which to gather statistics instead of processing the whole frame.

Member Function Documentation

◆ configure()

int libcamera::SwStatsCpu::configure ( const StreamConfiguration inputCfg)

Configure the statistics object for the passed in input format.

Parameters
[in]inputCfgThe input format
Returns
0 on success, a negative errno value on failure

◆ finishFrame()

void libcamera::SwStatsCpu::finishFrame ( void  )

Finish statistics calculation for the current frame.

This may only be called after a successful setWindow() call.

◆ getStatsFD()

const SharedFD & libcamera::SwStatsCpu::getStatsFD ( )
inline

Get the file descriptor for the statistics.

Returns
The file descriptor

◆ isValid()

bool libcamera::SwStatsCpu::isValid ( ) const
inline

Gets whether the statistics object is valid.

Returns
True if it's valid, false otherwise

◆ patternSize()

const Size & libcamera::SwStatsCpu::patternSize ( )
inline

Get the pattern size.

For some input-formats, e.g. Bayer data, processing is done multiple lines and/or columns at a time. Get width and height at which the (bayer) pattern repeats. Window values are rounded down to a multiple of this and the height also indicates if processLine2() should be called or not. This may only be called after a successful configure() call.

Returns
The pattern size

◆ processLine0()

void libcamera::SwStatsCpu::processLine0 ( unsigned int  y,
const uint8_t *  src[] 
)
inline

Process line 0.

Parameters
[in]yThe y coordinate.
[in]srcThe input data.

This function processes line 0 for input formats with patternSize height == 1. It'll process line 0 and 1 for input formats with patternSize height >= 2. This function may only be called after a successful setWindow() call.

◆ processLine2()

void libcamera::SwStatsCpu::processLine2 ( unsigned int  y,
const uint8_t *  src[] 
)
inline

Process line 2 and 3.

Parameters
[in]yThe y coordinate.
[in]srcThe input data.

This function processes line 2 and 3 for input formats with patternSize height == 4. This function may only be called after a successful setWindow() call.

◆ setWindow()

void libcamera::SwStatsCpu::setWindow ( const Rectangle window)

Specify window coordinates over which to gather statistics.

Parameters
[in]windowThe window object.

◆ startFrame()

void libcamera::SwStatsCpu::startFrame ( void  )

Reset state to start statistics gathering for a new frame.

This may only be called after a successful setWindow() call.


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