|
libcamera v0.7.2+rpt20260817
Supporting cameras in Linux since 2019
|
The libipa CCM algorithm. More...


Public Member Functions | |
| int | init (const ValueNode &tuningData, ControlInfoMap::Map &controls) |
Public Member Functions inherited from libcamera::ipa::CcmAlgorithmBase | |
| int | init (const ValueNode &tuningData) |
| Initialize the algorithm with the given tuning data. | |
| int | configure (ccm::ActiveState &state, unsigned int temperatureK) |
| Configure the CCM algorithm. | |
| void | queueRequest (ccm::ActiveState &state, ccm::FrameContext &context, const ControlList &controls) |
| Queue a Request to the CCM algorithm. | |
| void | prepare (ccm::ActiveState &state, ccm::FrameContext &context, unsigned int frame, unsigned int temperatureK) |
| Calculate the matrix coefficients for a colour temperature. | |
| void | process (ccm::FrameContext &context, ControlList &metadata) |
| Populate metadata with the latest correction matrix coefficients. | |
The libipa CCM algorithm.
| Q | The fixedpoint register representation of the colour correction coefficients |
Implement the CCM algorithm for libipa.
The CcmAlgorithm class implements an interface similar in spirit to the one of the Algorithm class. IPA modules are expected to store an instance of CcmAlgorithm as class member, template it with the CCM coefficients register representation and call its functions in their implementations of the Algorithm interface.
The CcmAlgorithm class provides an init() function where tuning data is parsed and the per-colour temperature correction matrices are loaded from the tuning file.
CcmAlgorithm supports both automatic and manual colour correction operations, but doesn't offer a way to select one of them. Enabling or disabling automatic CCM operations usually goes through the Awb algorithm enable/disable as the two algorithms should work with the same mode.
When the IPA module runs in manual mode a custom colour correction matrix or a custom colour temperature can be supplied to the CCM algorithm at queueRequest() time. If the Request contains a color correction matrix (controls::ColourCorrectionMatrix) then the matrix coefficients gets saved in the FrameContext and the IPA module can immediately use them and doesn't need to call prepare(). If a custom colour temperature is provided (controls::ColourTemperature) then the matrices loaded from configuration are interpolated with it and the result is saved in the FrameContext. In this case as well IPA modules can use the result immediately and should avoid calling prepare().
When the IPA module runs in automatic mode instead, it estimates the scene colour temperature. The estimated colour temperature shall be passed to prepare(), where it is used to interpolate the matrices loaded from the tuning file. The resulting coefficients are stored in the FrameContext for the IPA algorithm to use them to program their CCM engine registers.
|
inline |
| [in] | controls | The info map of the IPA controls |
Initialize the algorithm with the given tuning data.
| [in] | tuningData | The tuning data to use for the algorithm |
Parse tuningData to initialize the CCM algorithm and register controls. IPA modules are expected to call this function as part of their implementation of Algorithm::init().