libcamera v0.2.0+3-70b69666-nvm
Supporting cameras in Linux since 2019
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Types | Protected Attributes | List of all members
libcamera::SwStats Class Referenceabstract

Base class for the software ISP statistics. More...

#include <swstats.h>

Inheritance diagram for libcamera::SwStats:
Inheritance graph
[legend]
Collaboration diagram for libcamera::SwStats:
Collaboration graph
[legend]

Public Member Functions

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

Public Attributes

Signal< int > statsReady
 Signals that the statistics are ready.
 

Protected Types

typedef void(SwStats::* statsProcessFn) (const uint8_t *src[])
 Called when there is data to get statistics from.
 
typedef void(SwStats::* statsVoidFn) ()
 Called when the statistics gathering is done or when a new frame starts.
 

Protected Attributes

statsProcessFn stats0_
 The function called when a line is ready for statistics processing.
 
statsProcessFn stats2_
 The function called when a line is ready for statistics processing.
 
unsigned int bpp_
 The memory used per pixel in bits.
 
unsigned int y_skip_mask_
 Skip lines where this bitmask is set in y.
 
Rectangle window_
 Statistics window, set by setWindow(), used ever line.
 
statsVoidFn startFrame_
 The function called at the start of a frame.
 
statsVoidFn finishFrame_
 The function called at the end of a frame.
 
Size patternSize_
 The size of the bayer pattern.
 
unsigned int x_shift_
 The offset of x, applied to window_.x for bayer variants.
 

Detailed Description

Base class for the software ISP statistics.

Base class for the software ISP statistics.

Member Typedef Documentation

◆ statsProcessFn

typedef void(SwStats::* libcamera::SwStats::statsProcessFn) (const uint8_t *src[])
protected

Called when there is data to get statistics from.

Parameters
[in]srcThe input data

Member Function Documentation

◆ configure()

virtual int libcamera::SwStats::configure ( const StreamConfiguration inputCfg)
pure virtual

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.

Implemented in libcamera::SwStatsCpu.

◆ finishFrame()

void libcamera::SwStats::finishFrame ( )
inline

Finish statistics calculation for the current frame.

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

◆ getStatsFD()

virtual const SharedFD & libcamera::SwStats::getStatsFD ( )
pure virtual

Get the file descriptor for the statistics.

Returns
the file descriptor

Implemented in libcamera::SwStatsCpu.

◆ isValid()

virtual bool libcamera::SwStats::isValid ( ) const
pure virtual

Gets wether the statistics object is valid.

Returns
true if it's valid, false otherwise.

Implemented in libcamera::SwStatsCpu.

◆ patternSize()

const Size & libcamera::SwStats::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::SwStats::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::SwStats::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::SwStats::setWindow ( Rectangle  window)
inline

Specify window coordinates over which to gather statistics.

Parameters
[in]windowThe window object.

◆ startFrame()

void libcamera::SwStats::startFrame ( )
inline

Reset state to start statistics gathering for a new frame.

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

Member Data Documentation

◆ patternSize_

Size libcamera::SwStats::patternSize_
protected

The size of the bayer pattern.

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

◆ stats0_

statsProcessFn libcamera::SwStats::stats0_
protected

The function called when a line is ready for statistics processing.

Used for line 0 and 1, repeating if there isn't a 3rd and a 4th line in the bayer order.

◆ stats2_

statsProcessFn libcamera::SwStats::stats2_
protected

The function called when a line is ready for statistics processing.

Used for line 3 and 4, only needed if the bayer order has 4 different lines.

◆ statsReady

Signal<int> libcamera::SwStats::statsReady

Signals that the statistics are ready.

The int parameter isn't actually used.

◆ x_shift_

unsigned int libcamera::SwStats::x_shift_
protected

The offset of x, applied to window_.x for bayer variants.

This can either be 0 or 1.


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