![]() |
IDS peak AFL v2.0.1
|
Central coordination object for automatic camera feature control. More...
#include <peak_afl/peak_afl.hpp>
Public Member Functions | |
| Manager (const std::shared_ptr< peak::core::NodeMap > &node_map) | |
| Create an automanager instance. | |
| ~Manager () | |
| Destructor of an automanager instance. | |
| void | AddController (const std::shared_ptr< Controller > &controller) |
| Add a controller to an automanager. | |
| void | RemoveController (const std::shared_ptr< Controller > &controller) |
| Remove a controller from an automanager. | |
| void | Process (const peak::ipl::Image &image) const |
| Process an image. | |
| std::shared_ptr< Controller > | CreateController (peak_afl_controllerType type) |
| Create a controller and append it to Manager. | |
| void | DestroyAllController () |
| Destroy all controllers for a manager. | |
| void | DestroyController (const std::shared_ptr< Controller > &controller) |
| Destroy a controller. | |
| void | SetGainIPL (const peak::ipl::Gain &gain) |
| Sets the ipl gain. | |
| void | SetCCM (std::array< float, 9 > ccm) |
| Set the Color Correction Matrix (CCM) | |
| bool | Status () const |
| Get the status of a manager. | |
| std::vector< std::shared_ptr< Controller > > | ControllerList () const |
| Get the list of the controller associated with the manager. | |
| size_t | ControllerCount () const |
| Get the list count of the controller associated with the manager. | |
| std::shared_ptr< Controller > | GetController (peak_afl_controllerType type) const |
| Get the controller for a type. | |
| bool | IsControllerSupported (peak_afl_controllerType type) const |
| Get if the given controller type is supported. | |
Central coordination object for automatic camera feature control.
The Manager class links the device’s NodeMap with one or more automatic feature controllers and orchestrates their operation during image processing. It is responsible for creating, owning, and managing controllers of various types (see peak_afl_controllerType), forwarding image data to them, and maintaining shared configuration resources such as gain and color correction matrices.
A Manager forms the root object of the auto-feature subsystem. It manages the lifecycle of controllers, ensures that each controller type is only instantiated once, and provides the infrastructure required by controllers to execute their algorithms. Image frames passed to Process() are distributed to all active controllers so they can update their internal state accordingly.
Controllers must be added to the Manager before they can be used. Each controller type can appear only once, and a controller may belong to only one Manager at a time. The Manager provides functions to:
The Process() function forwards image data to the auto-feature system, allowing all attached controllers to evaluate the frame and apply their algorithmic updates. The current processing state can be queried via Status(). The manager’s status should always be checked before calling Process(), as invoking it while a previous frame is still being processed may result in a BusyException.
The Manager also maintains selected shared parameters, such as IPL gain and the 3×3 Color Correction Matrix (CCM). These settings are applied as part of the internal auto-feature processing pipeline and may affect the behavior or results of individual controllers.
A Manager instance owns all controllers registered with it. Destroying a controller via Manager APIs invalidates the associated Controller object.
Most operations may throw peak::afl::error::Exception if the underlying API call fails. Callers should handle errors accordingly and refer to code() and what() for diagnostic details.
|
inlineexplicit |
Create an automanager instance.
Creates an automanager instance.
| [in] | node_map | the shared pointer to the device nodemap |
| peak::afl::error::Exception | if an error occurs. Check code() and what() for an explanation of the error |
|
inline |
Add a controller to an automanager.
An autocontroller instance can only be added to one autofeature manager at the same time. The same type can only be added one time.
| [in] | controller | shared_ptr to a controller |
| peak::afl::error::Exception | if an error occurs. Check code() and what() for an explanation of the error |
|
inline |
Get the list count of the controller associated with the manager.
|
inline |
Get the list of the controller associated with the manager.
|
inline |
Create a controller and append it to Manager.
Convenience function to create an autofeature controller and add it to the manager. The same type can only be added one time.
| [in] | type | controller type, see peak_afl_controllerType |
| peak::afl::error::Exception | if deinitialization fails |
|
inline |
Destroy all controllers for a manager.
After this operation all controllers associated with the given manager will be invalid.
| peak::afl::error::Exception | if function fails |
|
inline |
Destroy a controller.
After this operation the controller will be invalid.
| [in] | controller | shared ptr to a controller |
| peak::afl::error::Exception | if function fails |
|
inline |
Get the controller for a type.
| [in] | type | controller type. |
| peak::afl::error::Exception | if no controller is found |
|
inline |
Get if the given controller type is supported.
| [in] | type | controller type. |
|
inline |
Process an image.
Processes an image.
| [in] | image | an peak::ipl::Image image |
| peak::afl::error::Exception | if an error occurs. Check code() and what() for an explanation of the error |
|
inline |
Remove a controller from an automanager.
Remove a controller from a manager. For a function which destroys the object in one call, see peak_afl_AutoFeatureManager_DestroyController.
| [in] | controller | shared_ptr to a controller |
| peak::afl::error::Exception | if an error occurs. Check code() and what() for an explanation of the error |
|
inline |
Set the Color Correction Matrix (CCM)
Sets a 3x3 color correction matrix for the auto feature manager. The CCM is used to correct color values during image processing. The matrix should be provided as a std::array of 9 float values in row-major order: [R->R, R->G, R->B, G->R, G->G, G->B, B->R, B->G, B->B]. The CCM is currently used exclusively by the Auto White Balance (AWB) controller. Internally, the inverse of the configured CCM is computed and used by the AWB regulation algorithm.
If no CCM is configured, an identity matrix is used as default.
The matrix must be invertible. If the inverse matrix cannot be computed, processing the image fails and an error is returned within the processing callback.
| [in] | ccm | std::array of 9 float values representing the 3x3 CCM in row-major order |
| peak::afl::error::Exception | if function fails |
|
inline |
Sets the ipl gain.
| [in] | gain | an peak::ipl::Gain gain |
| peak::afl::error::Exception | if function fails |
|
inline |
Get the status of a manager.
The returned value will contain whether the manager currently processes an image (true) or is idle (false).
| peak::afl::error::Exception | if function fails |