Files
MapLibreParticleLab/src/mbgl/style/fadedfunction_properties.hpp
Ansis Brammanis d532824aec implement functions for patterns
It introduces a new function type, FadedStopsFunction, that transitions
between the stops values instead of interpolating between them.
2015-02-02 14:46:48 -08:00

25 lines
672 B
C++

#ifndef MBGL_STYLE_FADEDFUNCTION_PROPERTIES
#define MBGL_STYLE_FADEDFUNCTION_PROPERTIES
#include <mbgl/style/zoom_history.hpp>
#include <vector>
namespace mbgl {
template <typename T>
struct FadedStopsFunction {
inline FadedStopsFunction(const std::vector<std::pair<float, T>> &values_, timestamp duration_) : values(values_), duration(duration_) {}
inline FadedStopsFunction(T &value) : values({{ 0, value }}), duration(0.0f) {}
inline FadedStopsFunction() : values(), duration(0.0f) {}
T evaluate(float z, const ZoomHistory &zoomHistory) const;
private:
const std::vector<std::pair<float, T>> values;
const timestamp duration;
};
}
#endif