IDS peak AFL v2.0.2
Loading...
Searching...
No Matches

Event notification callbacks for automatic control operations. More...

Data Structures

struct  peak_afl_process_data
 Generic process data structure. More...
struct  peak_afl_process_data_brightness
 Brightness controller process data. More...
struct  peak_afl_process_data_whitebalance
 White balance controller process data. More...
struct  peak_afl_process_data_focus
 Focus controller process data. More...

Typedefs

typedef void(PEAK_AFL_CALLCONV * PEAK_AFL_CALLBACK_FINISHED_FUNC) (void *context)
 Callback function type definition for PEAK_AFL_CONTROLLER_CALLBACK_FINISHED.
typedef void(PEAK_AFL_CALLCONV * PEAK_AFL_CALLBACK_PROCESSING_FUNC) (peak_afl_process_data *data, void *context)
 Callback function type definition for PEAK_AFL_CONTROLLER_CALLBACK_PROCESSING.

Enumerations

enum  peak_afl_callback_type { PEAK_AFL_CONTROLLER_CALLBACK_FINISHED , PEAK_AFL_CONTROLLER_CALLBACK_PROCESSING_DATA , PEAK_AFL_CONTROLLER_CALLBACK_PROCESSING }
 Controller callback types. More...

Functions

PEAK_AFL_API_STATUS peak_afl_AutoController_Callback_Set (peak_afl_controller_handle controller, peak_afl_callback_type type, void *funcPtr, void *context)
 Set a callback for a controller.

Detailed Description

Event notification callbacks for automatic control operations.

It is possible to be informed for specific events via callbacks. Callbacks provide real-time feedback about controller operations and enable responsive application behavior.

Available Callback Types

Finished Callback

Finished will be called when the controller has completed its operation and reached the target value.

When called:

  • Controller completes adjustment in Once mode
  • Target value is reached within tolerance
  • Operation is cancelled or encounters an error

Processing Callback

Processing will be called during image processing to provide real-time feedback.

When called:

  • Each time an image is processed
  • Provides intermediate calculation results
  • Available in all controller modes

Callback Threading Considerations

Important Threading Notes:

  • Callbacks may be invoked from worker threads
  • Avoid blocking operations in callbacks
  • Keep callback execution time minimal
Note
The Finished callback will only be called when the controller runs in Once mode.

Typedef Documentation

◆ PEAK_AFL_CALLBACK_FINISHED_FUNC

typedef void(PEAK_AFL_CALLCONV * PEAK_AFL_CALLBACK_FINISHED_FUNC) (void *context)

Callback function type definition for PEAK_AFL_CONTROLLER_CALLBACK_FINISHED.

Parameters
contextUser context data
Since
1.0

◆ PEAK_AFL_CALLBACK_PROCESSING_FUNC

typedef void(PEAK_AFL_CALLCONV * PEAK_AFL_CALLBACK_PROCESSING_FUNC) (peak_afl_process_data *data, void *context)

Callback function type definition for PEAK_AFL_CONTROLLER_CALLBACK_PROCESSING.

Parameters
dataProcessing data
contextUser context data
Since
1.7

Enumeration Type Documentation

◆ peak_afl_callback_type

Controller callback types.

Defines the types of callbacks that can be registered with controllers to receive notifications about processing events and completion status.

See also
peak_afl_AutoController_Callback_Set()
PEAK_AFL_CALLBACK_FINISHED_FUNC
PEAK_AFL_CALLBACK_PROCESSING_FUNC
Enumerator
PEAK_AFL_CONTROLLER_CALLBACK_FINISHED 

Controller operation finished callback.

Called when the controller completes an operation and reaches its target or finishes processing. Particularly useful in ONCE mode to detect when the controller has finished its adjustment.

See also
PEAK_AFL_CALLBACK_FINISHED_FUNC
PEAK_AFL_CONTROLLER_CALLBACK_PROCESSING_DATA 

Legacy processing data callback.

Deprecated
Use PEAK_AFL_CONTROLLER_CALLBACK_PROCESSING instead

Legacy callback type for processing data. Provides limited information compared to the newer processing callback.

Note
only available for Auto focus
See also
PEAK_AFL_CALLBACK_PROCESSING_DATA_FUNC
PEAK_AFL_CONTROLLER_CALLBACK_PROCESSING 

Enhanced processing callback.

Called during image processing to provide real-time access to processing data and intermediate results. Provides comprehensive information about the current processing state.

See also
PEAK_AFL_CALLBACK_PROCESSING_FUNC

Function Documentation

◆ peak_afl_AutoController_Callback_Set()

PEAK_AFL_API_STATUS peak_afl_AutoController_Callback_Set ( peak_afl_controller_handle controller,
peak_afl_callback_type type,
void * funcPtr,
void * context )

Set a callback for a controller.

Registers a callback function that will be invoked when specific events occur during controller operation. This allows for real-time notification of controller state changes or processing events.

Set funcPtr to NULL to disable the callback. Set funcPtr to !NULL to enable the callback.

The callback set by funcPtr will be called with context as its last parameter. The context parameter allows passing user-defined data to the callback function.

For a list of valid types see peak_afl_callback_type.

Parameters
[in]controllercontroller handle
[in]typecallback type
[in]funcPtrfunction pointer
[in]contextpointer
Returns
PEAK_AFL_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_AFL_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_AFL_STATUS_INVALID_PARAMETER The argument is invalid.
PEAK_AFL_STATUS_NOT_SUPPORTED The function is not supported.
PEAK_AFL_STATUS_ERROR An unexpected internal error occurred.
Since
1.0