summaryrefslogtreecommitdiff
path: root/src/ipa/libipa/algorithms/af_hill_climbing.cpp
blob: f666c6c24d6227d4a65165add602bd56cae34661 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/* 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 */