|
libcamera v0.7.2+rpt20261009
Supporting cameras in Linux since 2019
|
Base class for GammaAlgorithm to implement non-templated functions. More...

Public Member Functions | |
| GammaAlgorithmBase (unsigned int nLutNodes) | |
| Construct an instance of the class. | |
| int | init (ControlInfoMap::Map &controls, const ValueNode &tuningData, std::span< unsigned int > segments={}) |
| Initialise the algorithm with the given tuning data. | |
| void | configure (gamma::ActiveState &state) |
| Configure the gamma correction algorithm. | |
| void | queueRequest (gamma::ActiveState &state, const uint32_t frame, gamma::FrameContext &context, const ControlList &controls) |
| Queue a request to the gamma correction algorithm. | |
| void | process (gamma::FrameContext &context, ControlList &metadata) |
| Populate metadata with the gamma correction values for a frame. | |
Base class for GammaAlgorithm to implement non-templated functions.
This base class for GammeaAlgorithm allows us to implement non templated functions. IPA specific implementations shall derive from GammaAlgorithm and not this class.
|
inline |
Construct an instance of the class.
| [in] | nLutNodes | Set the number of function knee-points expected by the IPA algorithm |
| void libcamera::ipa::GammaAlgorithmBase::configure | ( | gamma::ActiveState & | state | ) |
Configure the gamma correction algorithm.
| [out] | state | The gamma correction algorithm's active state |
Reset to the default gamma correction value.
IPA modules are expected to call this function as part of their implementation of Algorithm::configure()
| int libcamera::ipa::GammaAlgorithmBase::init | ( | ControlInfoMap::Map & | controls, |
| const ValueNode & | tuningData, | ||
| std::span< unsigned int > | segments = {} |
||
| ) |
Initialise the algorithm with the given tuning data.
| [out] | controls | The ControlList into which this algorithm's supported controls will be emplaced. |
| [in] | tuningData | The tuning data to use with the algorithm |
| [in] | segments | A vector of segment spacings to define a custom X coordinate system for the curve |
Parse tuningData and segments to initialize the gamma correction curve. The tuning data may contain a default gamma value to use; otherwise the value of kDefaultGamma will be taken as the default. The piecewise linear function will be applied on a number of knots whose position is described by the optional segments argument, which describes each segment's relative length.
For example, if the gamma correction has to be applied on 16 equally spaced sampling points, a segments array like:
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
would result in evenly spaced knee-points along the X-axis.
Hardware may expect the knee-points to be spaced more densely towards the start of the curve and more sparsely towards the end, in which case an alternative array might be:
[1, 1, 1, 1, 2, 2, 2, 2, 4, 4, 4, 8, 8, 8, 8, 8]
As the values in segments represent the distance between two knee-points relative to the total distance between the first and last point, the length of segments should be equal to the number of knee-points minus one. ; If an IPA implementation doesnt't provide segments, the GammaAlgorithm class consturcts an evenly-spaced default.
IPA modules are expected to call this function as part of their implementation of Algorithm::init()
| void libcamera::ipa::GammaAlgorithmBase::process | ( | gamma::FrameContext & | context, |
| ControlList & | metadata | ||
| ) |
Populate metadata with the gamma correction values for a frame.
| [in] | context | The frame context |
| [out] | metadata | The ControlList of metadata for a frame |
Report the gamma value used to calculate the correction curve that was applied to a frame.
| void libcamera::ipa::GammaAlgorithmBase::queueRequest | ( | gamma::ActiveState & | state, |
| const uint32_t | frame, | ||
| gamma::FrameContext & | context, | ||
| const ControlList & | controls | ||
| ) |
Queue a request to the gamma correction algorithm.
| [in] | state | The algorithm's active state |
| [in] | frame | The current frame number |
| [in] | context | The algorithm's frame context |
| [in] | controls | The ControlList that was queued with the request |
Queue a new request to the gamma correction algorithm and handle any relevant controls that were queued. The only control currently handled is:
If a control with that ID is queued the value is stored in state and context.
IPA modules are expected to call this function as part of their implementation of Algorithm::queueRequest()