|
libcamera v0.7.2+1-aebe4861-nvm
Supporting cameras in Linux since 2019
|
libIPA LSC algorithm algorithm More...
Classes | |
| struct | ConfigurationParams |
| Parameters for AgcAlgorithm::configure() More... | |
| struct | ProcessParams |
| Parameters for AgcAlgorithm::process() More... | |
Public Member Functions | |
| int | init (const ValueNode &tuningData, CameraSensorHelper *sensor, const ConfigurationParams &config) |
| Load tuning data and configure. | |
| int | configure (agc::Session &session, agc::ActiveState &state, const ConfigurationParams &config) |
| Initialize the session configuration and active state. | |
| void | queueRequest (const agc::Session &session, agc::ActiveState &state, agc::FrameContext &frameContext, const ControlList &controls) |
| Queue a request. | |
| void | prepare (agc::ActiveState &state, agc::FrameContext &frameContext) |
| Prepare a frame. | |
| void | process (const agc::Session &session, agc::ActiveState &state, agc::FrameContext &frameContext, std::optional< ProcessParams > &¶ms, ControlList &metadata) |
| Process frame statistics. | |
libIPA LSC algorithm algorithm
The AgcAlgorithm class can be used to implement automatic exposure/gain control in an IPA module, conforming to the prescribed Algorithm interface. Internally AgcMeanLuminance or AgcMSV is used, this class merely concerns itself with processing the sensor properties, establishing limits, managing controls, and providing the resulting metadata.
Users should compose agc::Session, agc::ActiveState, and agc::FrameContext into their platform-specific session configuration, active state, and frame contexts, respectively. Furthermore, in their implementation of the Algorithm virtual function, they should simply call the identically named member function of AgcAlgorithm.
DigitalGain, DigitalGainMode
Expand documentation
| int libcamera::ipa::AgcAlgorithm::configure | ( | agc::Session & | session, |
| agc::ActiveState & | state, | ||
| const ConfigurationParams & | config | ||
| ) |
Initialize the session configuration and active state.
| [in] | session | The agc session configuration |
| [in] | state | The agc active state |
| [in] | config | The algorithm configuration |
This function initializes session and state based on the tuning data loaded by init() and the configuration in config.
It also updates ConfigurationParams::ctrlMap with the limits of the various agc-related controls. Users are expected to propagate these controls to the camera.
| int libcamera::ipa::AgcAlgorithm::init | ( | const ValueNode & | tuningData, |
| CameraSensorHelper * | sensor, | ||
| const ConfigurationParams & | config | ||
| ) |
Load tuning data and configure.
| [in] | tuningData | The tuning data |
| [in] | sensor | The camera sensor helper |
| [in] | config | The algorithm configuration |
This function loads the tuning data and configures the algorithm as if by a call to configure(), in order to provide the available controls in ConfigurationParams::ctrlMap.
If a CameraSensorHelper is provided in sensor, an instance of AgcMeanLuminance is instantiated and the tuning data is loaded by calling AgcMeanLuminance::parseTuningData(). Otherwise an instance of AgcMSV is instantiated, and in this case the tuning data is ignored.
| void libcamera::ipa::AgcAlgorithm::prepare | ( | agc::ActiveState & | state, |
| agc::FrameContext & | frameContext | ||
| ) |
Prepare a frame.
| [in] | state | The agc active state |
| [in] | frameContext | The agc frame context |
This function prepares the parameters for the frame denoted by frameContext. After a call to this function, the values of frameContext.exposure and frameContext.gain will be finalized and may be used by the caller (see agc::prepareControls()).
| void libcamera::ipa::AgcAlgorithm::process | ( | const agc::Session & | session, |
| agc::ActiveState & | state, | ||
| agc::FrameContext & | frameContext, | ||
| std::optional< ProcessParams > && | params, | ||
| ControlList & | metadata | ||
| ) |
Process frame statistics.
| [in] | session | The agc session configuration |
| [in] | state | The agc active state |
| [in] | frameContext | The agc frame context |
| [in] | params | The algorithm parameters |
| [in] | metadata | The list of metadata |
This function processes the statistics for the completed frame denoted by frameContext, runs the AGC implementation, updates state appropriately, and also populates metadata for the completed frame.
params must be omitted if the session was configured without "autoAllowed", and it may be omitted even if auto control is enabled, for example, if the statistics could not be delivered due to some ephemeral error. This ensures that the algorithm state will not go out of sync, and that metadata is produced as expected.
Care must be taken to convert the platform specific statistics to the format expected in params. See ProcessParams for the details.
| void libcamera::ipa::AgcAlgorithm::queueRequest | ( | const agc::Session & | session, |
| agc::ActiveState & | state, | ||
| agc::FrameContext & | frameContext, | ||
| const ControlList & | controls | ||
| ) |
Queue a request.
| [in] | session | The agc session configuration |
| [in] | state | The agc active state |
| [in] | frameContext | The agc frame context |
| [in] | controls | The list of controls associated with a Request |
This functions processes the agc-related controls in controls for the frame denoted by frameContext, and updates state and frameContext accordingly.