IDSpeakAFL  v1.2.0
Controller Class Reference

#include <peak_afl/peak_afl.hpp>

Inherits enable_shared_from_this< Controller >.

Public Member Functions

 ~Controller ()
 
bool IsSkipFramesSupported () const
 Check if skip frames is supported for a controller. More...
 
void SetSkipFrames (std::uint32_t count)
 Set number of frames skipped for a controller. More...
 
std::uint32_t GetSkipFrames () const
 Get number of frames skipped for a controller. More...
 
Range< std::uint32_t > GetSkipFramesRange () const
 Get range for frames skipped for a controller. More...
 
bool IsROISupported () const
 Check if setting a region of interest is supported for a controller. More...
 
void SetROI (peak_afl_rectangle rect)
 Set the autofeature region of interest for a controller. More...
 
peak_afl_rectangle GetROI () const
 Get the autofeature region of interest for a controller. More...
 
bool IsROIPresetSupported () const
 Check if ROI preset is supported for a controller. More...
 
void SetROIPreset (peak_afl_roi_preset preset)
 Set the autofeature region of interest preset for a controller. More...
 
bool IsModeSupported () const
 Check if auto mode is supported for a controller. More...
 
void SetMode (peak_afl_controller_automode mode)
 Set the autofeature mode for a controller. More...
 
peak_afl_controller_automode GetMode () const
 Get the current autofeature mode for a controller. More...
 
peak_afl_controller_status Status () const
 Get the status for a controller. More...
 
std::uint8_t GetLastAutoAverage () const
 Get the last auto average for a controller. More...
 
std::tuple< std::uint8_t, std::uint8_t, std::uint8_t > GetLastAutoAverages () const
 Get the last auto average for a controller. More...
 
bool IsAutoTargetSupported () const
 check if auto target is supported for a controller. More...
 
void SetAutoTarget (uint32_t target)
 Set the auto target for a controller. More...
 
std::uint32_t GetAutoTarget () const
 Get the currently set auto target for a controller. More...
 
Range< std::uint32_t > GetAutoTargetRange () const
 Get the auto target range for a controller. More...
 
bool IsAutoToleranceSupported () const
 check if auto tolerance is supported for a controller. More...
 
void SetAutoTolerance (std::uint32_t tolerance)
 Set the auto tolerance for a controller. More...
 
std::uint32_t GetAutoTolerance () const
 Get the current auto tolerance for a controller. More...
 
Range< std::uint32_t > GetAutoToleranceRange () const
 Get the auto tolerance range for a controller. More...
 
bool IsAutoPercentileSupported () const
 check if auto percentile is supported for a controller. More...
 
void SetAutoPercentile (double percentile)
 Set the auto percentile for a controller. More...
 
double GetAutoPercentile () const
 Get the auto percentile for a controller. More...
 
Range< double > GetAutoPercentileRange () const
 Get the auto percentile range for a controller. More...
 
peak_afl_controllerType Type () const
 Get the controller type. More...
 
bool IsAlgorithmSupported () const
 check if setting an algorithm is supported for a controller. More...
 
void SetAlgorithm (peak_afl_controller_algorithm algorithm)
 Set the used algorithm for a controller. More...
 
peak_afl_controller_algorithm GetAlgorithm () const
 Get the used algorithm for a controller. More...
 
std::vector< peak_afl_controller_algorithm > GetAlgorithmList () const
 Get the list of supported algorithms for a controller. More...
 
bool IsSharpnessAlgorithmSupported () const
 check setting a sharpness algorithm is supported by a controller. More...
 
void SetSharpnessAlgorithm (peak_afl_controller_sharpness_algorithm algorithm)
 Set the used sharpness algorithm for a controller. More...
 
peak_afl_controller_sharpness_algorithm GetSharpnessAlgorithm () const
 Get the used sharpness algorithm for a controller. More...
 
std::vector< peak_afl_controller_sharpness_algorithm > GetSharpnessAlgorithmList () const
 Get the list of supported sharpness algorithms for a controller. More...
 
void RegisterFinishedCallback (const callback::FinishedCallback &callback)
 Set finished callback for a controller.
 
void UnRegisterFinishedCallback ()
 Reset the finished callback for a controller.
 
void RegisterComponentCallback (peak_afl_controller_brightness_component component, const callback::FinishedCallback &callback)
 Set component callback for a controller.
 
void UnRegisterComponentCallback (peak_afl_controller_brightness_component component)
 Reset the component callback for a controller.
 
void RegisterDataProcessingCallback (const callback::DataProcessingCallback &callback)
 Set the data callback for a controller.
 
void UnRegisterDataProcessingCallback ()
 Reset the finished callback for a controller.
 
bool IsWeightedROISupported () const
 Check if weighted region of interest is supported for a controller. More...
 
void SetWeightedROIs (const std::vector< peak_afl_weighted_rectangle > &list)
 Set the autofeature weighted region of interest for a controller. More...
 
void SetWeightedROI (const peak_afl_weighted_rectangle &rect)
 Set single autofeature weighted region of interest for a controller. More...
 
peak_afl_size GetWeightedROIMinSize () const
 Get the autofeature minimum size of weighted region of interest for a controller. More...
 
std::vector< peak_afl_weighted_rectangle > GetWeightedROIs () const
 Get the autofeature weighted region of interest for a controller. More...
 
bool IsLimitSupported () const
 Check if limit is supported for a controller. More...
 
void SetLimit (peak_afl_controller_limit limit)
 Set the autofeature limit for a controller. More...
 
peak_afl_controller_limit GetLimit () const
 Get the autofeature limit for a controller. More...
 
peak_afl_controller_limit GetDefaultLimit () const
 Get the autofeature default limit. More...
 
bool IsHysteresisSupported () const
 Check if hysteresis is supported for a controller. More...
 
void SetHysteresis (std::uint8_t hysteresis)
 Set the autofeature hysteresis for a controller. More...
 
std::uint8_t GetHysteresis () const
 Get the autofeature hysteresis for a controller. More...
 
std::uint8_t GetDefaultHysteresis () const
 Get the autofeature hysteresis default. More...
 
Range< std::uint8_t > GetHysteresisRange () const
 Get autofeature hysteresis range for a controller. More...
 
bool IsBrightnessComponentModeSupported () const
 Check if auto mode is supported for a brightness controller component. More...
 
void BrightnessComponentSetMode (peak_afl_controller_brightness_component component, peak_afl_controller_automode mode)
 Set the autofeature mode for a brightness controller component. More...
 
peak_afl_controller_automode BrightnessComponentGetMode (peak_afl_controller_brightness_component component) const
 Get the current autofeature mode for a brightness controller component. More...
 
peak_afl_controller_status BrightnessComponentStatus (peak_afl_controller_brightness_component component) const
 Get the status for a brightness controller component. More...
 

Static Public Member Functions

static std::shared_ptr< Controller > Create (peak_afl_controllerType type)
 Create a new controller. More...
 

Detailed Description

The Controller class

Constructor & Destructor Documentation

◆ ~Controller()

~Controller ( )
inline

Destructor for the controller

Member Function Documentation

◆ BrightnessComponentGetMode()

peak_afl_controller_automode BrightnessComponentGetMode ( peak_afl_controller_brightness_component  component) const
inline

Get the current autofeature mode for a brightness controller component.

Parameters
[in]componentautofeature brightness component
Returns
autofeature mode
Exceptions
peak::afl::error::Exceptionif function fails

◆ BrightnessComponentSetMode()

void BrightnessComponentSetMode ( peak_afl_controller_brightness_component  component,
peak_afl_controller_automode  mode 
)
inline

Set the autofeature mode for a brightness controller component.

Will set the controller mode to mode. See peak_afl_controller_automode for a list of valid values.

Parameters
[in]componentautofeature brightness component
[in]modeautofeature mode
Exceptions
peak::afl::error::Exceptionif function fails

◆ BrightnessComponentStatus()

peak_afl_controller_status BrightnessComponentStatus ( peak_afl_controller_brightness_component  component) const
inline

Get the status for a brightness controller component.

See peak_afl_controller_status for a list of values.

Parameters
[in]componentautofeature brightness component
Returns
controller status
Exceptions
peak::afl::error::Exceptionif function fails

◆ Create()

std::shared_ptr< Controller > Create ( peak_afl_controllerType  type)
inlinestatic

Create a new controller.

Parameters
[in]typecontroller type
Returns
the shared ptr to the created controller
Exceptions
peak::afl::error::Exceptionif function fails

◆ GetAlgorithm()

peak_afl_controller_algorithm GetAlgorithm ( ) const
inline

Get the used algorithm for a controller.

Returns
auto controller algorithm

◆ GetAlgorithmList()

std::vector< peak_afl_controller_algorithm > GetAlgorithmList ( ) const
inline

Get the list of supported algorithms for a controller.

To set a value, see SetAlgorithm.

Returns
vector of supported algorithms
Exceptions
peak::afl::error::Exceptionif function fails

◆ GetAutoPercentile()

double GetAutoPercentile ( ) const
inline

Get the auto percentile for a controller.

Returns
auto percentile value
Exceptions
peak::afl::error::Exceptionif function fails

◆ GetAutoPercentileRange()

Range< double > GetAutoPercentileRange ( ) const
inline

Get the auto percentile range for a controller.

Call this function to get the range of valid values which can be set by a call to SetAutoPercentile.

Returns
peak::afl::Range with valid values
Exceptions
peak::afl::error::Exceptionif function fails

◆ GetAutoTarget()

std::uint32_t GetAutoTarget ( ) const
inline

Get the currently set auto target for a controller.

Returns
auto target value
Exceptions
peak::afl::error::Exceptionif function fails

◆ GetAutoTargetRange()

Range< std::uint32_t > GetAutoTargetRange ( ) const
inline

Get the auto target range for a controller.

Call this function to get the range of valid values which can be set by a call to SetAutoTarget.

Returns
peak::afl::Range with valid values
Exceptions
peak::afl::error::Exceptionif function fails

◆ GetAutoTolerance()

uint32_t GetAutoTolerance ( ) const
inline

Get the current auto tolerance for a controller.

Returns
auto tolerance value
Exceptions
peak::afl::error::Exceptionif function fails

◆ GetAutoToleranceRange()

Range< uint32_t > GetAutoToleranceRange ( ) const
inline

Get the auto tolerance range for a controller.

Call this function to get the range of valid values which can be set by a call to SetAutoTolerance.

Returns
peak::afl::Range with valid values
Exceptions
peak::afl::error::Exceptionif function fails

◆ GetDefaultHysteresis()

std::uint8_t GetDefaultHysteresis ( ) const
inline

Get the autofeature hysteresis default.

Returns
the default hysteresis
Exceptions
peak::afl::error::Exceptionif function fails

◆ GetDefaultLimit()

peak_afl_controller_limit GetDefaultLimit ( ) const
inline

Get the autofeature default limit.

Returns
the default limit set
Exceptions
peak::afl::error::Exceptionif function fails

◆ GetHysteresis()

std::uint8_t GetHysteresis ( ) const
inline

Get the autofeature hysteresis for a controller.

Returns
the hysteresis set
Exceptions
peak::afl::error::Exceptionif function fails

◆ GetHysteresisRange()

Range< std::uint8_t > GetHysteresisRange ( ) const
inline

Get autofeature hysteresis range for a controller.

Returns
the peak::afl::Range of the hysteresis
Exceptions
peak::afl::error::Exceptionif function fails

◆ GetLastAutoAverage()

std::uint8_t GetLastAutoAverage ( ) const
inline

Get the last auto average for a controller.

Used by Controllers processing a mono image.

Returns
autofeature average
Exceptions
peak::afl::error::Exceptionif function fails

◆ GetLastAutoAverages()

std::tuple< std::uint8_t, std::uint8_t, std::uint8_t > GetLastAutoAverages ( ) const
inline

Get the last auto average for a controller.

Used by Controllers processing a color image.

Returns
std::tuple<red, green, blue> in that order
Exceptions
peak::afl::error::Exceptionif function fails

◆ GetLimit()

peak_afl_controller_limit GetLimit ( ) const
inline

Get the autofeature limit for a controller.

Returns
the limit set
Exceptions
peak::afl::error::Exceptionif function fails

◆ GetMode()

peak_afl_controller_automode GetMode ( ) const
inline

Get the current autofeature mode for a controller.

Returns
autofeature mode
Exceptions
peak::afl::error::Exceptionif function fails

◆ GetROI()

peak_afl_rectangle GetROI ( ) const
inline

Get the autofeature region of interest for a controller.

Get the region of interest for a controller. The processed image will be cropped to the region of interest set.

Returns
region of interest
Exceptions
peak::afl::error::Exceptionif function fails

◆ GetSharpnessAlgorithm()

peak_afl_controller_sharpness_algorithm GetSharpnessAlgorithm ( ) const
inline

Get the used sharpness algorithm for a controller.

Returns
auto controller sharpness algorithm
Exceptions
peak::afl::error::Exceptionif function fails

◆ GetSharpnessAlgorithmList()

std::vector< peak_afl_controller_sharpness_algorithm > GetSharpnessAlgorithmList ( ) const
inline

Get the list of supported sharpness algorithms for a controller.

To set a value, see SetSharpnessAlgorithm.

Returns
vector of supported algorithms
Exceptions
peak::afl::error::Exceptionif function fails

◆ GetSkipFrames()

std::uint32_t GetSkipFrames ( ) const
inline

Get number of frames skipped for a controller.

Gets the skipped frames for the controller. Only every N-th image will be processed.

Returns
number of frames skipped
Exceptions
peak::afl::error::Exceptionif function fails

◆ GetSkipFramesRange()

Range< std::uint32_t > GetSkipFramesRange ( ) const
inline

Get range for frames skipped for a controller.

Returns
valid peak::afl::Range for frames skipped
Exceptions
peak::afl::error::Exceptionif function fails

◆ GetWeightedROIMinSize()

peak_afl_size GetWeightedROIMinSize ( ) const
inline

Get the autofeature minimum size of weighted region of interest for a controller.

Returns
the minimum size
Exceptions
peak::afl::error::Exceptionif function fails

◆ GetWeightedROIs()

std::vector< peak_afl_weighted_rectangle > GetWeightedROIs ( ) const
inline

Get the autofeature weighted region of interest for a controller.

Returns
vector with set peak_afl_weighted_rectangle
Exceptions
peak::afl::error::Exceptionif function fails

◆ IsAlgorithmSupported()

bool IsAlgorithmSupported ( ) const
inline

check if setting an algorithm is supported for a controller.

True if algorithm is supported, otherwise it is unsupported.

Call GetAlgorithmList to get a list of supported algorithms.

Returns
boolean if controller supports setting an algorithm
Exceptions
peak::afl::error::Exceptionif function fails

◆ IsAutoPercentileSupported()

bool IsAutoPercentileSupported ( ) const
inline

check if auto percentile is supported for a controller.

True if auto percentile is supported, otherwise it is unsupported.

Returns
boolean if controller supports auto percentile
Exceptions
peak::afl::error::Exceptionif function fails

◆ IsAutoTargetSupported()

bool IsAutoTargetSupported ( ) const
inline

check if auto target is supported for a controller.

True if auto target is supported, otherwise it is unsupported.

Returns
boolean if controller supports auto target
Exceptions
peak::afl::error::Exceptionif function fails

◆ IsAutoToleranceSupported()

bool IsAutoToleranceSupported ( ) const
inline

check if auto tolerance is supported for a controller.

True if auto tolerance is supported, otherwise it is unsupported.

Returns
boolean if controller supports auto tolerance
Exceptions
peak::afl::error::Exceptionif function fails

◆ IsBrightnessComponentModeSupported()

bool IsBrightnessComponentModeSupported ( ) const
inline

Check if auto mode is supported for a brightness controller component.

true if auto mode is supported, otherwise it is unsupported.

Returns
boolean if controller supports auto mode
Exceptions
peak::afl::error::Exceptionif function fails

◆ IsHysteresisSupported()

bool IsHysteresisSupported ( ) const
inline

Check if hysteresis is supported for a controller.

True if hysteresis is supported, otherwise it is unsupported.

Returns
boolean if controller supports hysteresis
Exceptions
peak::afl::error::Exceptionif function fails

◆ IsLimitSupported()

bool IsLimitSupported ( ) const
inline

Check if limit is supported for a controller.

True if limit is supported, otherwise it is unsupported.

Returns
boolean if controller supports limit
Exceptions
peak::afl::error::Exceptionif function fails

◆ IsModeSupported()

bool IsModeSupported ( ) const
inline

Check if auto mode is supported for a controller.

true if auto mode is supported, otherwise it is unsupported.

Returns
boolean if controller supports auto mode
Exceptions
peak::afl::error::Exceptionif function fails

◆ IsROIPresetSupported()

bool IsROIPresetSupported ( ) const
inline

Check if ROI preset is supported for a controller.

true if ROI preset is supported, otherwise it is unsupported.

Returns
boolean if controller supports ROI preset
Exceptions
peak::afl::error::Exceptionif function fails

◆ IsROISupported()

bool IsROISupported ( ) const
inline

Check if setting a region of interest is supported for a controller.

If true region of interest is supported, otherwise it is unsupported.

Returns
boolean if controller supports setting a region of interest
Exceptions
peak::afl::error::Exceptionif function fails

◆ IsSharpnessAlgorithmSupported()

bool IsSharpnessAlgorithmSupported ( ) const
inline

check setting a sharpness algorithm is supported by a controller.

True if sharpness algorithm is supported, otherwise it is unsupported.

Call GetSharpnessAlgorithmList to get a list of supported sharpness algorithms.

Returns
boolean if controller supports setting a sharpness algorithm
Exceptions
peak::afl::error::Exceptionif function fails

◆ IsSkipFramesSupported()

bool IsSkipFramesSupported ( ) const
inline

Check if skip frames is supported for a controller.

Returns
boolean if controller supports skipping frames
Exceptions
peak::afl::error::Exceptionif function fails

◆ IsWeightedROISupported()

bool IsWeightedROISupported ( ) const
inline

Check if weighted region of interest is supported for a controller.

True if weighted region of interest is supported, otherwise it is unsupported.

Returns
boolean if controller supports weighted roi
Exceptions
peak::afl::error::Exceptionif function fails

◆ SetAlgorithm()

void SetAlgorithm ( peak_afl_controller_algorithm  algorithm)
inline

Set the used algorithm for a controller.

To get a list of supported algorithms see peak_afl_AutoController_Algorithm_GetList.

Parameters
[in]algorithmauto controller algorithm
Exceptions
peak::afl::error::Exceptionif function fails

◆ SetAutoPercentile()

void SetAutoPercentile ( double  percentile)
inline

Set the auto percentile for a controller.

This is the used percentile value for a controller. To get the valid range, call peak_afl_AutoController_AutoPercentile_GetRange.

Parameters
[in]percentileauto percentile value
Exceptions
peak::afl::error::Exceptionif function fails

◆ SetAutoTarget()

void SetAutoTarget ( uint32_t  target)
inline

Set the auto target for a controller.

Set an auto target. Call peak_afl_AutoController_AutoTarget_GetRange to get the valid range. End value which will be targeted by the controller.

Parameters
[in]targetauto target value
Exceptions
peak::afl::error::Exceptionif function fails

◆ SetAutoTolerance()

void SetAutoTolerance ( std::uint32_t  tolerance)
inline

Set the auto tolerance for a controller.

Sets the +/- tolerance for the auto target value.

Parameters
[in]toleranceauto target value
Exceptions
peak::afl::error::Exceptionif function fails

◆ SetHysteresis()

void SetHysteresis ( std::uint8_t  hysteresis)
inline

Set the autofeature hysteresis for a controller.

Set the hysteresis for the algorithm set by SetAlgorithm

Parameters
[in]hysteresisthe hysteresis to set
Exceptions
peak::afl::error::Exceptionif function fails

◆ SetLimit()

void SetLimit ( peak_afl_controller_limit  limit)
inline

Set the autofeature limit for a controller.

Sets the minimum and maximum limit for the algorithm set by peak_afl_AutoController_Algorithm_Set

Parameters
[in]limitthe limit to set
Exceptions
peak::afl::error::Exceptionif function fails

◆ SetMode()

void SetMode ( peak_afl_controller_automode  mode)
inline

Set the autofeature mode for a controller.

Will set the controller mode to mode. See peak_afl_controller_automode for a list of valid values.

Parameters
[in]modeautofeature mode
Exceptions
peak::afl::error::Exceptionif function fails

◆ SetROI()

void SetROI ( peak_afl_rectangle  rect)
inline

Set the autofeature region of interest for a controller.

Set the region of interest for a controller. The processed image will be cropped to the region of interest set.

Parameters
[in]rectregion of interest
Exceptions
peak::afl::error::Exceptionif function fails

◆ SetROIPreset()

void SetROIPreset ( peak_afl_roi_preset  preset)
inline

Set the autofeature region of interest preset for a controller.

Will set the supplied preset as region of interest. See also SetROI.

Parameters
[in]presetregion of interest preset
Exceptions
peak::afl::error::Exceptionif function fails

◆ SetSharpnessAlgorithm()

void SetSharpnessAlgorithm ( peak_afl_controller_sharpness_algorithm  algorithm)
inline

Set the used sharpness algorithm for a controller.

To get a list of supported algorithms see peak_afl_AutoController_SharpnessAlgorithm_GetList.

Parameters
[in]algorithmauto controller sharpness algorithm
Exceptions
peak::afl::error::Exceptionif function fails

◆ SetSkipFrames()

void SetSkipFrames ( std::uint32_t  count)
inline

Set number of frames skipped for a controller.

Sets the skipped frames for the controller. Only every N-th image will be processed.

Parameters
[in]countnumber of frames skipped
Exceptions
peak::afl::error::Exceptionif function fails

◆ SetWeightedROI()

void SetWeightedROI ( const peak_afl_weighted_rectangle &  rect)
inline

Set single autofeature weighted region of interest for a controller.

Already set weighted regions of interest will be overwritten

Parameters
[in]rectweighted region of interest
Exceptions
peak::afl::error::Exceptionif function fails

◆ SetWeightedROIs()

void SetWeightedROIs ( const std::vector< peak_afl_weighted_rectangle > &  list)
inline

Set the autofeature weighted region of interest for a controller.

Already set weighted regions of interest will be overwritten

Parameters
[in]listvector of weighted region of interest
Exceptions
peak::afl::error::Exceptionif function fails

◆ Status()

peak_afl_controller_status Status ( ) const
inline

Get the status for a controller.

See peak_afl_controller_status for a list of values.

Returns
controller status
Exceptions
peak::afl::error::Exceptionif function fails

◆ Type()

peak_afl_controllerType Type ( ) const
inline

Get the controller type.

See peak_afl_controllerType for a list of values.

Returns
auto controller type
Exceptions
peak::afl::error::Exceptionif function fails

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