47 Auto PEAK_AFL_DEPRECATED_ENUM_ATTR,
73 PEAK_AFL_BEGIN_DISABLE_DEPRECATED_WARNINGS
81 return "HillClimbing";
83 return "GlobalSearch";
87 PEAK_AFL_END_DISABLE_DEPRECATED_WARNINGS
126 PEAK_AFL_BEGIN_DISABLE_DEPRECATED_WARNINGS
128 PEAK_AFL_END_DISABLE_DEPRECATED_WARNINGS
131 if (name ==
"GoldenRatio")
135 if (name ==
"HillClimbing")
139 if (name ==
"GlobalSearch")
143 if (name ==
"FullScan")
148 throw peak::afl::error::InternalErrorException(
"Invalid focus search algorithm!",
PEAK_AFL_STATUS_ERROR);
154 PEAK_AFL_BEGIN_DISABLE_DEPRECATED_WARNINGS
168 PEAK_AFL_END_DISABLE_DEPRECATED_WARNINGS
171 throw peak::afl::error::InternalErrorException(
"Invalid focus search algorithm!",
PEAK_AFL_STATUS_ERROR);
177 PEAK_AFL_BEGIN_DISABLE_DEPRECATED_WARNINGS
191 PEAK_AFL_END_DISABLE_DEPRECATED_WARNINGS
194 throw peak::afl::error::InternalErrorException(
"Invalid focus search algorithm!",
PEAK_AFL_STATUS_ERROR);
243 : m_controller{ std::move(controller) }
268 m_controller->SetAlgorithm(detail::ToCType(value));
290 return detail::ToFocusSearchAlgorithm(m_controller->GetAlgorithm());
313 const auto cAlgorithms = m_controller->GetAlgorithmList();
315 std::vector<FocusSearchAlgorithm> algorithms;
316 algorithms.reserve(cAlgorithms.size());
318 std::transform(std::cbegin(cAlgorithms), std::cend(cAlgorithms), std::back_inserter(algorithms),
319 [](
const auto& value) {
return detail::ToFocusSearchAlgorithm(value); });
359 Set(detail::ToFocusSearchAlgorithm(archive.
GetString(
"SearchAlgorithm")));
370 std::shared_ptr<peak::afl::Controller> m_controller;
The exception thrown for passing an invalid parameter to a function.
Definition peak_afl.hpp:391
Interface for a hierarchical key-value archive system.
Definition peak_common_iarchive.hpp:59
virtual std::string GetString(const std::string &key) const =0
Retrieves a string value by key.
virtual void SetString(const std::string &key, const std::string &value)=0
Stores a UTF-8 string.
Interface for features that have a list of valid values.
Definition peak_afl_ifeature.hpp:169
SearchAlgorithm(std::shared_ptr< peak::afl::Controller > controller)
Constructs a SearchAlgorithm feature with the specified controller.
Definition peak_afl_search_algorithm.hpp:242
void Serialize(peak::common::serialization::IArchive &archive) const override
Serializes the current search algorithm to an archive.
Definition peak_afl_search_algorithm.hpp:337
FocusSearchAlgorithm Get() const override
Gets the current focus search algorithm.
Definition peak_afl_search_algorithm.hpp:288
std::vector< FocusSearchAlgorithm > GetList() const override
Gets the list of supported focus search algorithms.
Definition peak_afl_search_algorithm.hpp:311
void Deserialize(const peak::common::serialization::IArchive &archive) override
Deserializes the search algorithm from an archive.
Definition peak_afl_search_algorithm.hpp:357
void Set(const FocusSearchAlgorithm &value) override
Sets the focus search algorithm.
Definition peak_afl_search_algorithm.hpp:266
peak_afl_controller_algorithm
Focus search algorithms.
Definition peak_afl.h:695
@ PEAK_AFL_CONTROLLER_ALGORITHM_GOLDEN_RATIO_SEARCH
Golden ratio search algorithm.
Definition peak_afl.h:716
@ PEAK_AFL_CONTROLLER_ALGORITHM_HILL_CLIMBING_SEARCH
Hill climbing search algorithm.
Definition peak_afl.h:729
@ PEAK_AFL_CONTROLLER_ALGORITHM_FULL_SCAN
Full range scan algorithm.
Definition peak_afl.h:757
@ PEAK_AFL_CONTROLLER_ALGORITHM_AUTO
Automatic algorithm selection.
Definition peak_afl.h:703
@ PEAK_AFL_CONTROLLER_ALGORITHM_GLOBAL_SEARCH
Global search algorithm.
Definition peak_afl.h:743
@ PEAK_AFL_STATUS_INVALID_PARAMETER
Invalid parameter provided.
Definition peak_afl.h:419
@ PEAK_AFL_STATUS_ERROR
General error occurred.
Definition peak_afl.h:399
std::string ToString(ControllerType mode)
Converts ControllerType enumeration to string representation.
Definition peak_afl_icontroller.hpp:78
FocusSearchAlgorithm
Focus search algorithm enumeration.
Definition peak_afl_search_algorithm.hpp:39
@ Auto
Automatic algorithm selection - default algorithm.
Definition peak_afl_search_algorithm.hpp:47
@ GlobalSearch
Global search - comprehensive but slower search.
Definition peak_afl_search_algorithm.hpp:53
@ HillClimbing
Hill climbing search - good for local optimization.
Definition peak_afl_search_algorithm.hpp:51
@ GoldenRatio
Golden ratio search - efficient for unimodal focus curves.
Definition peak_afl_search_algorithm.hpp:49
@ FullScan
Full scan - scans entire focus range for maximum accuracy.
Definition peak_afl_search_algorithm.hpp:55
#define PEAK_COMMON_NO_DISCARD
Compatability macro for the nodiscard attribute.
Definition peak_common_defines.h:86
Interface definitions and implementations for individual module types used within a pipeline.
Definition peak_afl_generic_auto_brightness.hpp:39
Interfaces and implementations for defining and controlling data processing pipelines.
Definition peak_afl_generic_auto_brightness.hpp:37