summaryrefslogtreecommitdiff
path: root/src/mbgl/renderer/paint_property_statistics.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/renderer/paint_property_statistics.hpp')
-rw-r--r--src/mbgl/renderer/paint_property_statistics.hpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/mbgl/renderer/paint_property_statistics.hpp b/src/mbgl/renderer/paint_property_statistics.hpp
new file mode 100644
index 0000000000..59a8545911
--- /dev/null
+++ b/src/mbgl/renderer/paint_property_statistics.hpp
@@ -0,0 +1,29 @@
+#pragma once
+
+#include <mbgl/util/optional.hpp>
+
+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