libcamera v0.3.2 Supporting cameras in Linux since 2019

Loading...
Searching...
No Matches
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:
[legend]

## Public Member Functions
bool | isValid () const
| Gets whether the statistics object is valid.
const SharedFD & | getStatsFD ()
| Get the file descriptor for the statistics.
const Size & | patternSize ()
| Get the pattern size.
int | configure (const StreamConfiguration &inputCfg)
| Configure the statistics object for the passed in input format.
void | setWindow (const Rectangle &window)
| Specify window coordinates over which to gather statistics.
void | startFrame ()
| Reset state to start statistics gathering for a new frame.
void | finishFrame ()
| Finish statistics calculation for the current 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.

## 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] | inputCfg | The 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] | y | The y coordinate.
  [in] | src | The 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] | y | The y coordinate.
  [in] | src | The 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] | window | The 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:

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