IDS peak AFL v2.0.2
Loading...
Searching...
No Matches
SearchAlgorithm Class Reference

Search algorithm feature implementation for auto focus controllers. More...

#include <peak_afl/pipeline/modules/controllers/features/peak_afl_search_algorithm.hpp>

Inheritance diagram for SearchAlgorithm:
IListFeature< FocusSearchAlgorithm > IFeature< FocusSearchAlgorithm > ISerializable

Public Member Functions

 SearchAlgorithm (std::shared_ptr< peak::afl::Controller > controller)
 Constructs a SearchAlgorithm feature with the specified controller.
void Set (const FocusSearchAlgorithm &value) override
 Sets the focus search algorithm.
FocusSearchAlgorithm Get () const override
 Gets the current focus search algorithm.
std::vector< FocusSearchAlgorithm > GetList () const override
 Gets the list of supported focus search algorithms.
void Serialize (peak::common::serialization::IArchive &archive) const override
 Serializes the current search algorithm to an archive.
void Deserialize (const peak::common::serialization::IArchive &archive) override
 Deserializes the search algorithm from an archive.
Public Member Functions inherited from IFeature< FocusSearchAlgorithm >
virtual ~IFeature ()=default
 Virtual destructor for proper cleanup of derived classes.

Detailed Description

Search algorithm feature implementation for auto focus controllers.

The SearchAlgorithm class provides a feature interface for managing the focus search algorithm used by auto focus controllers. This feature controls which algorithm the automatic focus system uses to find the optimal focus position.

Different algorithms provide different trade-offs:

  • Auto: Lets the controller automatically select the default algorithm
  • GoldenRatio: Efficient binary search, good for smooth focus curves
  • HillClimbing: Fast local search, good when starting near optimal focus
  • GlobalSearch: Comprehensive search, more robust but slower
  • FullScan: Scans entire range, most accurate but slowest

This class inherits from IListFeature<FocusSearchAlgorithm> and provides both current algorithm management and a list of supported algorithms.

Note
Algorithm availability may vary based on the underlying controller implementation and lens characteristics.
See also
IListFeature
FocusSearchAlgorithm
peak::afl::Controller::SetAlgorithm()
peak::afl::Controller::GetAlgorithm()
peak::afl::Controller::GetAlgorithmList()
Since
1.8

Constructor & Destructor Documentation

◆ SearchAlgorithm()

SearchAlgorithm ( std::shared_ptr< peak::afl::Controller > controller)
inlineexplicit

Constructs a SearchAlgorithm feature with the specified controller.

Parameters
[in]controllerShared pointer to the auto focus controller that will be used to manage the search algorithm parameter. The controller must support search algorithm operations.
Precondition
controller must not be null
controller must support search algorithm functionality
Since
1.8

Member Function Documentation

◆ Deserialize()

void Deserialize ( const peak::common::serialization::IArchive & archive)
inlineoverridevirtual

Deserializes the search algorithm from an archive.

Loads the focus search algorithm from the provided archive and applies it to the controller. The algorithm is expected to be stored with the key "SearchAlgorithm".

Parameters
[in]archiveThe archive to read the search algorithm from
Exceptions
Maythrow serialization exceptions if the archive operation fails
Maythrow controller exceptions if the deserialized algorithm is invalid
See also
Serialize()
Since
1.8

Implements ISerializable.

◆ Get()

FocusSearchAlgorithm Get ( ) const
inlineoverridevirtual

Gets the current focus search algorithm.

Retrieves the currently configured algorithm that the automatic focus system is using to find the optimal focus position.

Returns
The current focus search algorithm
Exceptions
Maythrow exceptions based on the underlying controller implementation if the controller is in an invalid state.
See also
Set()
GetList()
FocusSearchAlgorithm
Since
1.8

Implements IFeature< FocusSearchAlgorithm >.

◆ GetList()

std::vector< FocusSearchAlgorithm > GetList ( ) const
inlineoverridevirtual

Gets the list of supported focus search algorithms.

Retrieves a list of all focus search algorithms that are supported by the current controller. This can be used to populate user interface controls or to validate algorithm selections.

Returns
A vector containing all supported focus search algorithms
Exceptions
Maythrow exceptions based on the underlying controller implementation if the controller is in an invalid state.
See also
Set()
Get()
FocusSearchAlgorithm
Since
1.8

Implements IListFeature< FocusSearchAlgorithm >.

◆ Serialize()

void Serialize ( peak::common::serialization::IArchive & archive) const
inlineoverridevirtual

Serializes the current search algorithm to an archive.

Stores the current focus search algorithm in the provided archive for configuration persistence. The algorithm is stored with the key "SearchAlgorithm".

Parameters
[in,out]archiveThe archive to write the search algorithm to
Exceptions
Maythrow serialization exceptions if the archive operation fails
See also
Deserialize()
Since
1.8

Implements ISerializable.

◆ Set()

void Set ( const FocusSearchAlgorithm & value)
inlineoverridevirtual

Sets the focus search algorithm.

Sets the algorithm that the automatic focus system will use to find the optimal focus position. Different algorithms provide different trade-offs between speed, accuracy, and robustness.

Parameters
[in]valueThe focus search algorithm to set. Must be one of the algorithms supported by the controller (see GetList()).
Exceptions
Maythrow exceptions based on the underlying controller implementation if the algorithm is not supported or if the controller is in an invalid state.
See also
Get()
GetList()
FocusSearchAlgorithm
Since
1.8

Implements IFeature< FocusSearchAlgorithm >.


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