IDS peak AFL v2.1.0
Loading...
Searching...
No Matches
Manager Class Reference

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.

Detailed Description

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.

Purpose

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.

Controller Management

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:

  • add or remove individual controllers,
  • enumerate existing controllers,
  • query support for specific controller types,
  • create and immediately register new controllers via CreateController(),
  • destroy one or all controllers.

Image Processing

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.

Shared Configuration

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.

Lifetime and Ownership

A Manager instance owns all controllers registered with it. Destroying a controller via Manager APIs invalidates the associated Controller object.

Exceptions

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.

Constructor & Destructor Documentation

◆ Manager()

Manager ( const std::shared_ptr< peak::core::NodeMap > & node_map)
inlineexplicit

Create an automanager instance.

Creates an automanager instance.

Parameters
[in]node_mapthe shared pointer to the device nodemap
Exceptions
peak::afl::error::Exceptionif an error occurs. Check code() and what() for an explanation of the error
Since
1.1

Member Function Documentation

◆ AddController()

void AddController ( const std::shared_ptr< Controller > & controller)
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.

Parameters
[in]controllershared_ptr to a controller
Exceptions
peak::afl::error::Exceptionif an error occurs. Check code() and what() for an explanation of the error
Since
1.1

◆ ControllerCount()

size_t ControllerCount ( ) const
inline

Get the list count of the controller associated with the manager.

Returns
number of controllers in list
Since
1.1

◆ ControllerList()

std::vector< std::shared_ptr< Controller > > ControllerList ( ) const
inline

Get the list of the controller associated with the manager.

Returns
controller list
Since
1.1

◆ CreateController()

std::shared_ptr< Controller > CreateController ( peak_afl_controllerType type)
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.

Parameters
[in]typecontroller type, see peak_afl_controllerType
Returns
the shared ptr to the created controller
Exceptions
peak::afl::error::Exceptionif deinitialization fails
Since
1.1

◆ DestroyAllController()

void DestroyAllController ( )
inline

Destroy all controllers for a manager.

After this operation all controllers associated with the given manager will be invalid.

Exceptions
peak::afl::error::Exceptionif function fails
Since
1.1

◆ DestroyController()

void DestroyController ( const std::shared_ptr< Controller > & controller)
inline

Destroy a controller.

After this operation the controller will be invalid.

Parameters
[in]controllershared ptr to a controller
Exceptions
peak::afl::error::Exceptionif function fails

◆ GetController()

std::shared_ptr< Controller > GetController ( peak_afl_controllerType type) const
inline

Get the controller for a type.

Parameters
[in]typecontroller type.
Returns
controller
Exceptions
peak::afl::error::Exceptionif no controller is found
Since
1.1

◆ IsControllerSupported()

bool IsControllerSupported ( peak_afl_controllerType type) const
inline

Get if the given controller type is supported.

Parameters
[in]typecontroller type.
Returns
True if controller is supported
Since
1.11

◆ Process()

void Process ( const peak::ipl::Image & image) const
inline

Process an image.

Processes an image.

Parameters
[in]imagean peak::ipl::Image image
Exceptions
peak::afl::error::Exceptionif an error occurs. Check code() and what() for an explanation of the error
Since
1.1

◆ RemoveController()

void RemoveController ( const std::shared_ptr< Controller > & controller)
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.

Parameters
[in]controllershared_ptr to a controller
Exceptions
peak::afl::error::Exceptionif an error occurs. Check code() and what() for an explanation of the error
Since
1.1

◆ SetCCM()

void SetCCM ( std::array< float, 9 > ccm)
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.

Parameters
[in]ccmstd::array of 9 float values representing the 3x3 CCM in row-major order
Exceptions
peak::afl::error::Exceptionif function fails
Since
1.8

◆ SetGainIPL()

void SetGainIPL ( const peak::ipl::Gain & gain)
inline

Sets the ipl gain.

Parameters
[in]gainan peak::ipl::Gain gain
Exceptions
peak::afl::error::Exceptionif function fails
Since
1.2

◆ Status()

bool Status ( ) const
inline

Get the status of a manager.

The returned value will contain whether the manager currently processes an image (true) or is idle (false).

Returns
manager status
Exceptions
peak::afl::error::Exceptionif function fails
Since
1.1

The documentation for this class was generated from the following file: