/* SPDX-License-Identifier: LGPL-2.1-or-later */ /* * Copyright (C) 2021, Red Hat * Copyright (C) 2022, Ideas On Board * Copyright (C) 2022, Theobroma Systems * * af_hill_climbing.cpp - AF Hill Climbing common algorithm */ #include "af_hill_climbing.h" /** * \file af_hill_climbing.h * \brief AF Hill Climbing common algorithm */ namespace libcamera { LOG_DEFINE_CATEGORY(Af) namespace ipa::common::algorithms { /** * \class AfHillClimbing * \brief The base class implementing hill climbing AF control algorithm * \tparam Module The IPA module type for this class of algorithms * * Control part of auto focus algorithm. It calculates the lens position basing * on contrast measure supplied by the higher level. This way it is independent * from the platform. * * Derived class should call processAutofocus() for each measured contrast value * and set the lens to the calculated position. */ /** * \fn AfHillClimbing::setMode() * \copydoc libcamera::ipa::common::algorithms::AfAlgorithm::setMode */ /** * \fn AfHillClimbing::setRange() * \copydoc libcamera::ipa::common::algorithms::AfAlgorithm::setRange */ /** * \fn AfHillClimbing::setSpeed() * \copydoc libcamera::ipa::common::algorithms::AfAlgorithm::setSpeed */ /** * \fn AfHillClimbing::setMetering() * \copydoc libcamera::ipa::common::algorithms::AfAlgorithm::setMetering */ /** * \fn AfHillClimbing::setWindows() * \copydoc libcamera::ipa::common::algorithms::AfAlgorithm::setWindows */ /** * \fn AfHillClimbing::setTrigger() * \copydoc libcamera::ipa::common::algorithms::AfAlgorithm::setTrigger */ /** * \fn AfHillClimbing::setPause() * \copydoc libcamera::ipa::common::algorithms::AfAlgorithm::setPause */ /** * \fn AfHillClimbing::setLensPosition() * \copydoc libcamera::ipa::common::algorithms::AfAlgorithm::setLensPosition */ /** * \fn AfHillClimbing::processAutofocus() * \brief Run the auto focus algorithm loop * \param[in] currentContrast New value of contrast measured for current frame * * This method should be called for each new contrast value that was measured, * usually in the process() method. * * \return New lens position calculated by AF algorithm */ } /* namespace ipa::common::algorithms */ } /* namespace libcamera */