summaryrefslogtreecommitdiffhomepage
path: root/tracker-pt/point-filter.hpp
blob: c3c045ddeb378225f7188c15fe7efe6ce02c5fe1 (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
#pragma once

#include "cv/numeric.hpp"
#include "compat/timer.hpp"
#include "pt-settings.hpp"
#include <optional>
#include <array>

namespace pt_point_filter_impl {

using namespace numeric_types;
using PointOrder = std::array<numeric_types::vec2, 3>;

class point_filter final
{
    PointOrder state_;
    std::optional<Timer> t;
    const pt_settings& s;

public:
    void reset();
    const PointOrder& operator()(const PointOrder& input, f deadzone_amount);

    explicit point_filter(const pt_settings& s);
    ~point_filter() = default;

    OTR_DISABLE_MOVE_COPY(point_filter);
};

} // ns pt_point_filter_impl

using point_filter = pt_point_filter_impl::point_filter;