summaryrefslogtreecommitdiff
path: root/src/mbgl/renderer/paint_property_statistics.hpp
blob: 017aa5ac3bf3256a5d5c9e3e373d645f765ca866 (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
#pragma once

#include <mbgl/util/optional.hpp>

#include <algorithm>

namespace mbgl {

template <class T>
class PaintPropertyStatistics {
public:
    optional<T> max() const { return {}; }
    void add(const T&) {}
};

template <>
class PaintPropertyStatistics<float> {
public:
    optional<float> max() const {
        return _max;
    }

    void add(float value) {
        _max = _max ? std::max(*_max, value) : value;
    }

private:
    optional<float> _max;
};

} // namespace mbgl