reorganize properties
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include <llmr/map/tile_data.hpp>
|
||||
#include <llmr/util/noncopyable.hpp>
|
||||
#include <llmr/util/time.hpp>
|
||||
#include <llmr/style/types.hpp>
|
||||
|
||||
#include <list>
|
||||
#include <forward_list>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include <llmr/util/mat4.hpp>
|
||||
#include <llmr/util/noncopyable.hpp>
|
||||
#include <llmr/renderer/frame_history.hpp>
|
||||
#include <llmr/style/properties.hpp>
|
||||
#include <llmr/style/types.hpp>
|
||||
|
||||
#include <llmr/shader/plain_shader.hpp>
|
||||
#include <llmr/shader/outline_shader.hpp>
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
#include <map>
|
||||
#include <unordered_map>
|
||||
#include <set>
|
||||
|
||||
namespace llmr {
|
||||
|
||||
@@ -40,6 +41,9 @@ class IconBucket;
|
||||
class TextBucket;
|
||||
class RasterBucket;
|
||||
|
||||
struct FillProperties;
|
||||
struct CompositeProperties;
|
||||
|
||||
class LayerDescription;
|
||||
class RasterTileData;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include <llmr/util/noncopyable.hpp>
|
||||
#include <llmr/platform/gl.hpp>
|
||||
#include <llmr/style/properties.hpp>
|
||||
#include <llmr/style/rasterize_properties.hpp>
|
||||
|
||||
namespace llmr {
|
||||
|
||||
|
||||
121
include/llmr/style/class_properties.hpp
Normal file
121
include/llmr/style/class_properties.hpp
Normal file
@@ -0,0 +1,121 @@
|
||||
#ifndef LLMR_STYLE_CLASS_PROPERTIES
|
||||
#define LLMR_STYLE_CLASS_PROPERTIES
|
||||
|
||||
#include <llmr/util/variant.hpp>
|
||||
#include <llmr/style/function_properties.hpp>
|
||||
#include <llmr/style/types.hpp>
|
||||
|
||||
|
||||
#include <map>
|
||||
|
||||
namespace llmr {
|
||||
|
||||
enum class ClassPropertyKey {
|
||||
FillEnabled,
|
||||
FillAntialias,
|
||||
FillOpacity,
|
||||
FillColor,
|
||||
FillOutlineColor,
|
||||
FillTranslate, // for transitions only
|
||||
FillTranslateX,
|
||||
FillTranslateY,
|
||||
FillTranslateAnchor,
|
||||
FillImage,
|
||||
|
||||
LineEnabled,
|
||||
LineOpacity,
|
||||
LineColor,
|
||||
LineTranslate, // for transitions only
|
||||
LineTranslateX,
|
||||
LineTranslateY,
|
||||
LineTranslateAnchor,
|
||||
LineWidth,
|
||||
LineOffset,
|
||||
LineBlur,
|
||||
LineDashArray, // for transitions only
|
||||
LineDashLand,
|
||||
LineDashGap,
|
||||
LineImage,
|
||||
|
||||
IconEnabled,
|
||||
IconOpacity,
|
||||
IconRotate,
|
||||
IconRotateAnchor,
|
||||
|
||||
TextEnabled,
|
||||
TextOpacity,
|
||||
TextSize,
|
||||
TextColor,
|
||||
TextHaloColor,
|
||||
TextHaloWidth,
|
||||
TextHaloBlur,
|
||||
|
||||
CompositeEnabled,
|
||||
CompositeOpacity,
|
||||
|
||||
RasterSpin,
|
||||
RasterBrightnessLow,
|
||||
RasterBrightnessHigh,
|
||||
RasterSaturation,
|
||||
RasterContrast,
|
||||
RasterFade,
|
||||
|
||||
BackgroundColor
|
||||
};
|
||||
|
||||
typedef util::variant<
|
||||
FunctionProperty,
|
||||
TranslateAnchorType,
|
||||
RotateAnchorType,
|
||||
Color,
|
||||
std::string,
|
||||
bool
|
||||
> ClassPropertyValue;
|
||||
|
||||
|
||||
struct ClassPropertyTransition {
|
||||
uint16_t duration = 0;
|
||||
uint16_t delay = 0;
|
||||
};
|
||||
|
||||
class ClassProperties {
|
||||
public:
|
||||
inline ClassProperties() {}
|
||||
inline ClassProperties(ClassProperties &&properties)
|
||||
: properties(std::move(properties.properties)) {}
|
||||
|
||||
template <typename T>
|
||||
inline const T *get(ClassPropertyKey key) const {
|
||||
const auto it = properties.find(key);
|
||||
if (it != properties.end() && it->second.is<T>()) {
|
||||
return ::std::addressof(it->second.get<T>());
|
||||
} else {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
inline const ClassPropertyTransition *getTransition(ClassPropertyKey key) const {
|
||||
const auto it = transitions.find(key);
|
||||
if (it != transitions.end()) {
|
||||
return ::std::addressof(it->second);
|
||||
} else {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
template <typename ...Args>
|
||||
inline void set(Args&& ...args) {
|
||||
properties.emplace(::std::forward<Args>(args)...);
|
||||
}
|
||||
template <typename ...Args>
|
||||
inline void setTransition(Args&& ...args) {
|
||||
transitions.emplace(::std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
public:
|
||||
std::map<ClassPropertyKey, ClassPropertyValue> properties;
|
||||
std::map<ClassPropertyKey, ClassPropertyTransition> transitions;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
45
include/llmr/style/function_properties.hpp
Normal file
45
include/llmr/style/function_properties.hpp
Normal file
@@ -0,0 +1,45 @@
|
||||
#ifndef LLMR_STYLE_FUNCTION_PROPERTIES
|
||||
#define LLMR_STYLE_FUNCTION_PROPERTIES
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace llmr {
|
||||
|
||||
namespace functions {
|
||||
|
||||
float null(float z, const std::vector<float>&);
|
||||
float constant(float z, const std::vector<float>& values);
|
||||
float min(float z, const std::vector<float>& values);
|
||||
float max(float z, const std::vector<float>& values);
|
||||
float stops(float z, const std::vector<float>& values);
|
||||
float linear(float z, const std::vector<float>& values);
|
||||
float exponential(float z, const std::vector<float>& values);
|
||||
|
||||
}
|
||||
|
||||
struct FunctionProperty {
|
||||
typedef float (*fn)(float z, const std::vector<float>& values);
|
||||
|
||||
fn function;
|
||||
std::vector<float> values;
|
||||
|
||||
inline FunctionProperty() : function(&functions::null) {}
|
||||
|
||||
inline FunctionProperty(const FunctionProperty &property)
|
||||
: function(property.function), values(property.values) {}
|
||||
inline FunctionProperty(FunctionProperty &&property)
|
||||
: function(property.function), values(std::move(property.values)) {}
|
||||
|
||||
|
||||
inline void operator=(const FunctionProperty &rhs) {
|
||||
function = rhs.function;
|
||||
values = rhs.values;
|
||||
}
|
||||
|
||||
inline FunctionProperty(float value) : function(&functions::constant), values(1, value) {}
|
||||
template <typename T> inline T evaluate(float z) const { return function(z, values); }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,290 +0,0 @@
|
||||
#ifndef LLMR_STYLE_PROPERTIES
|
||||
#define LLMR_STYLE_PROPERTIES
|
||||
|
||||
#include <array>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <limits>
|
||||
#include <set>
|
||||
#include <map>
|
||||
#include <type_traits>
|
||||
#include <memory>
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
#include <llmr/util/variant.hpp>
|
||||
|
||||
#include <llmr/style/types.hpp>
|
||||
|
||||
namespace llmr {
|
||||
|
||||
// Stores a premultiplied color, with all four channels ranging from 0..1
|
||||
typedef std::array<float, 4> Color;
|
||||
|
||||
struct ClassPropertyTransition {
|
||||
uint16_t duration = 0;
|
||||
uint16_t delay = 0;
|
||||
};
|
||||
|
||||
enum class Property {
|
||||
Null = 1,
|
||||
Constant = 2,
|
||||
Stops = 3,
|
||||
Linear = 4
|
||||
};
|
||||
namespace functions {
|
||||
|
||||
float null(float z, const std::vector<float>&);
|
||||
float constant(float z, const std::vector<float>& values);
|
||||
float min(float z, const std::vector<float>& values);
|
||||
float max(float z, const std::vector<float>& values);
|
||||
float stops(float z, const std::vector<float>& values);
|
||||
float linear(float z, const std::vector<float>& values);
|
||||
float exponential(float z, const std::vector<float>& values);
|
||||
|
||||
}
|
||||
|
||||
struct FunctionProperty {
|
||||
typedef float (*fn)(float z, const std::vector<float>& values);
|
||||
|
||||
fn function;
|
||||
std::vector<float> values;
|
||||
|
||||
inline FunctionProperty() : function(&functions::null) {}
|
||||
|
||||
inline FunctionProperty(const FunctionProperty &property)
|
||||
: function(property.function), values(property.values) {}
|
||||
inline FunctionProperty(FunctionProperty &&property)
|
||||
: function(property.function), values(std::move(property.values)) {}
|
||||
|
||||
|
||||
inline void operator=(const FunctionProperty &rhs) {
|
||||
function = rhs.function;
|
||||
values = rhs.values;
|
||||
}
|
||||
|
||||
inline FunctionProperty(float value) : function(&functions::constant), values(1, value) {}
|
||||
template <typename T> inline T evaluate(float z) const { return function(z, values); }
|
||||
};
|
||||
|
||||
enum class ClassPropertyKey {
|
||||
FillEnabled,
|
||||
FillAntialias,
|
||||
FillOpacity,
|
||||
FillColor,
|
||||
FillOutlineColor,
|
||||
FillTranslate, // for transitions only
|
||||
FillTranslateX,
|
||||
FillTranslateY,
|
||||
FillTranslateAnchor,
|
||||
FillImage,
|
||||
|
||||
LineEnabled,
|
||||
LineOpacity,
|
||||
LineColor,
|
||||
LineTranslate, // for transitions only
|
||||
LineTranslateX,
|
||||
LineTranslateY,
|
||||
LineTranslateAnchor,
|
||||
LineWidth,
|
||||
LineOffset,
|
||||
LineBlur,
|
||||
LineDashArray, // for transitions only
|
||||
LineDashLand,
|
||||
LineDashGap,
|
||||
LineImage,
|
||||
|
||||
IconEnabled,
|
||||
IconOpacity,
|
||||
IconRotate,
|
||||
IconRotateAnchor,
|
||||
|
||||
TextEnabled,
|
||||
TextOpacity,
|
||||
TextSize,
|
||||
TextColor,
|
||||
TextHaloColor,
|
||||
TextHaloWidth,
|
||||
TextHaloBlur,
|
||||
|
||||
CompositeEnabled,
|
||||
CompositeOpacity,
|
||||
|
||||
RasterSpin,
|
||||
RasterBrightnessLow,
|
||||
RasterBrightnessHigh,
|
||||
RasterSaturation,
|
||||
RasterContrast,
|
||||
RasterFade,
|
||||
|
||||
BackgroundColor
|
||||
};
|
||||
|
||||
typedef util::variant<
|
||||
FunctionProperty,
|
||||
TranslateAnchorType,
|
||||
RotateAnchorType,
|
||||
Color,
|
||||
std::string,
|
||||
bool
|
||||
> ClassPropertyValue;
|
||||
|
||||
class ClassProperties {
|
||||
public:
|
||||
inline ClassProperties() {}
|
||||
inline ClassProperties(ClassProperties &&properties)
|
||||
: properties(std::move(properties.properties)) {}
|
||||
|
||||
template <typename T>
|
||||
inline const T *get(ClassPropertyKey key) const {
|
||||
const auto it = properties.find(key);
|
||||
if (it != properties.end() && it->second.is<T>()) {
|
||||
return ::std::addressof(it->second.get<T>());
|
||||
} else {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
inline const ClassPropertyTransition *getTransition(ClassPropertyKey key) const {
|
||||
const auto it = transitions.find(key);
|
||||
if (it != transitions.end()) {
|
||||
return ::std::addressof(it->second);
|
||||
} else {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
template <typename ...Args>
|
||||
inline void set(Args&& ...args) {
|
||||
properties.emplace(::std::forward<Args>(args)...);
|
||||
}
|
||||
template <typename ...Args>
|
||||
inline void setTransition(Args&& ...args) {
|
||||
transitions.emplace(::std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
public:
|
||||
std::map<ClassPropertyKey, ClassPropertyValue> properties;
|
||||
std::map<ClassPropertyKey, ClassPropertyTransition> transitions;
|
||||
};
|
||||
|
||||
struct PrerenderProperties {
|
||||
float buffer = 1.0f / 32.0f;
|
||||
uint16_t size = 256;
|
||||
uint16_t blur = 0;
|
||||
};
|
||||
|
||||
struct FillProperties {
|
||||
FillProperties() {}
|
||||
bool enabled = true;
|
||||
bool antialias = true;
|
||||
float opacity = 1.0f;
|
||||
Color fill_color = {{ 0, 0, 0, 1 }};
|
||||
Color stroke_color = {{ 0, 0, 0, -1 }};
|
||||
std::array<float, 2> translate = {{ 0, 0 }};
|
||||
TranslateAnchorType translateAnchor = TranslateAnchorType::Default;
|
||||
std::string image;
|
||||
|
||||
inline bool isVisible() const {
|
||||
return enabled && opacity > 0 && (fill_color[3] > 0 || stroke_color[3] > 0);
|
||||
}
|
||||
};
|
||||
|
||||
struct LineProperties {
|
||||
inline LineProperties() {}
|
||||
bool enabled = true;
|
||||
float opacity = 1.0f;
|
||||
Color color = {{ 0, 0, 0, 1 }};
|
||||
std::array<float, 2> translate = {{ 0, 0 }};
|
||||
TranslateAnchorType translateAnchor = TranslateAnchorType::Default;
|
||||
float width = 0;
|
||||
float offset = 0;
|
||||
float blur = 0;
|
||||
std::array<float, 2> dash_array = {{ 1, -1 }};
|
||||
std::string image;
|
||||
|
||||
inline bool isVisible() const {
|
||||
return enabled && opacity > 0 && color[3] > 0 && width > 0;
|
||||
}
|
||||
};
|
||||
|
||||
struct IconProperties {
|
||||
inline IconProperties() {}
|
||||
bool enabled = true;
|
||||
float opacity = 1.0f;
|
||||
float rotate = 0.0f;
|
||||
RotateAnchorType rotate_anchor = RotateAnchorType::Default;
|
||||
|
||||
inline bool isVisible() const {
|
||||
return enabled && opacity > 0;
|
||||
}
|
||||
};
|
||||
|
||||
struct TextProperties {
|
||||
inline TextProperties() {}
|
||||
bool enabled = true;
|
||||
float opacity = 1.0f;
|
||||
float size = 12.0f;
|
||||
Color color = {{ 0, 0, 0, 1 }};
|
||||
Color halo_color = {{ 1, 1, 1, 0.75 }};
|
||||
float halo_width = 0.25f;
|
||||
float halo_blur = 1.0f;
|
||||
|
||||
inline bool isVisible() const {
|
||||
return enabled && opacity > 0 && (color[3] > 0 || halo_color[3] > 0) && size > 0;
|
||||
}
|
||||
};
|
||||
|
||||
struct CompositeProperties {
|
||||
inline CompositeProperties() {}
|
||||
bool enabled = true;
|
||||
float opacity = 1.0f;
|
||||
|
||||
inline bool isVisible() const {
|
||||
return enabled && opacity > 0;
|
||||
}
|
||||
};
|
||||
|
||||
struct RasterProperties {
|
||||
inline RasterProperties() {}
|
||||
bool enabled = true;
|
||||
float opacity = 1.0f;
|
||||
float spin = 0.0f;
|
||||
std::array<float, 2> brightness = {{ 0, 1 }};
|
||||
float saturation = 0.0f;
|
||||
float contrast = 0.0f;
|
||||
float fade = 0.0f;
|
||||
|
||||
inline bool isVisible() const {
|
||||
return enabled && opacity > 0;
|
||||
}
|
||||
};
|
||||
|
||||
struct BackgroundProperties {
|
||||
inline BackgroundProperties() {}
|
||||
Color color = {{ 1, 1, 1, 1 }};
|
||||
};
|
||||
|
||||
typedef util::variant<
|
||||
FillProperties,
|
||||
LineProperties,
|
||||
IconProperties,
|
||||
TextProperties,
|
||||
CompositeProperties,
|
||||
RasterProperties,
|
||||
BackgroundProperties,
|
||||
std::false_type
|
||||
> StyleProperties;
|
||||
|
||||
template <typename T>
|
||||
const T &defaultStyleProperties();
|
||||
|
||||
class RasterizeProperties {
|
||||
public:
|
||||
boost::optional<FunctionProperty> enabled;
|
||||
boost::optional<FunctionProperty> buffer;
|
||||
boost::optional<FunctionProperty> size;
|
||||
boost::optional<FunctionProperty> blur;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
26
include/llmr/style/rasterize_properties.hpp
Normal file
26
include/llmr/style/rasterize_properties.hpp
Normal file
@@ -0,0 +1,26 @@
|
||||
#ifndef LLMR_STYLE_RASTERIZE_PROPERTIES
|
||||
#define LLMR_STYLE_RASTERIZE_PROPERTIES
|
||||
|
||||
#include <llmr/style/function_properties.hpp>
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
|
||||
namespace llmr {
|
||||
|
||||
struct PrerenderProperties {
|
||||
float buffer = 1.0f / 32.0f;
|
||||
uint16_t size = 256;
|
||||
uint16_t blur = 0;
|
||||
};
|
||||
|
||||
class RasterizeProperties {
|
||||
public:
|
||||
boost::optional<FunctionProperty> enabled;
|
||||
boost::optional<FunctionProperty> buffer;
|
||||
boost::optional<FunctionProperty> size;
|
||||
boost::optional<FunctionProperty> blur;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -9,6 +9,9 @@
|
||||
#include <llmr/util/transition.hpp>
|
||||
#include <llmr/util/uv.hpp>
|
||||
#include <llmr/style/class_dictionary.hpp>
|
||||
#include <llmr/style/class_properties.hpp>
|
||||
#include <llmr/style/style_properties.hpp>
|
||||
#include <llmr/style/rasterize_properties.hpp>
|
||||
|
||||
#include <map>
|
||||
#include <unordered_map>
|
||||
|
||||
122
include/llmr/style/style_properties.hpp
Normal file
122
include/llmr/style/style_properties.hpp
Normal file
@@ -0,0 +1,122 @@
|
||||
#ifndef LLMR_STYLE_STYLE_PROPERTIES
|
||||
#define LLMR_STYLE_STYLE_PROPERTIES
|
||||
|
||||
#include <llmr/util/variant.hpp>
|
||||
#include <llmr/style/types.hpp>
|
||||
#include <llmr/style/function_properties.hpp>
|
||||
|
||||
#include <array>
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
#include <memory>
|
||||
|
||||
namespace llmr {
|
||||
|
||||
struct FillProperties {
|
||||
FillProperties() {}
|
||||
bool enabled = true;
|
||||
bool antialias = true;
|
||||
float opacity = 1.0f;
|
||||
Color fill_color = {{ 0, 0, 0, 1 }};
|
||||
Color stroke_color = {{ 0, 0, 0, -1 }};
|
||||
std::array<float, 2> translate = {{ 0, 0 }};
|
||||
TranslateAnchorType translateAnchor = TranslateAnchorType::Default;
|
||||
std::string image;
|
||||
|
||||
inline bool isVisible() const {
|
||||
return enabled && opacity > 0 && (fill_color[3] > 0 || stroke_color[3] > 0);
|
||||
}
|
||||
};
|
||||
|
||||
struct LineProperties {
|
||||
inline LineProperties() {}
|
||||
bool enabled = true;
|
||||
float opacity = 1.0f;
|
||||
Color color = {{ 0, 0, 0, 1 }};
|
||||
std::array<float, 2> translate = {{ 0, 0 }};
|
||||
TranslateAnchorType translateAnchor = TranslateAnchorType::Default;
|
||||
float width = 0;
|
||||
float offset = 0;
|
||||
float blur = 0;
|
||||
std::array<float, 2> dash_array = {{ 1, -1 }};
|
||||
std::string image;
|
||||
|
||||
inline bool isVisible() const {
|
||||
return enabled && opacity > 0 && color[3] > 0 && width > 0;
|
||||
}
|
||||
};
|
||||
|
||||
struct IconProperties {
|
||||
inline IconProperties() {}
|
||||
bool enabled = true;
|
||||
float opacity = 1.0f;
|
||||
float rotate = 0.0f;
|
||||
RotateAnchorType rotate_anchor = RotateAnchorType::Default;
|
||||
|
||||
inline bool isVisible() const {
|
||||
return enabled && opacity > 0;
|
||||
}
|
||||
};
|
||||
|
||||
struct TextProperties {
|
||||
inline TextProperties() {}
|
||||
bool enabled = true;
|
||||
float opacity = 1.0f;
|
||||
float size = 12.0f;
|
||||
Color color = {{ 0, 0, 0, 1 }};
|
||||
Color halo_color = {{ 1, 1, 1, 0.75 }};
|
||||
float halo_width = 0.25f;
|
||||
float halo_blur = 1.0f;
|
||||
|
||||
inline bool isVisible() const {
|
||||
return enabled && opacity > 0 && (color[3] > 0 || halo_color[3] > 0) && size > 0;
|
||||
}
|
||||
};
|
||||
|
||||
struct CompositeProperties {
|
||||
inline CompositeProperties() {}
|
||||
bool enabled = true;
|
||||
float opacity = 1.0f;
|
||||
|
||||
inline bool isVisible() const {
|
||||
return enabled && opacity > 0;
|
||||
}
|
||||
};
|
||||
|
||||
struct RasterProperties {
|
||||
inline RasterProperties() {}
|
||||
bool enabled = true;
|
||||
float opacity = 1.0f;
|
||||
float spin = 0.0f;
|
||||
std::array<float, 2> brightness = {{ 0, 1 }};
|
||||
float saturation = 0.0f;
|
||||
float contrast = 0.0f;
|
||||
float fade = 0.0f;
|
||||
|
||||
inline bool isVisible() const {
|
||||
return enabled && opacity > 0;
|
||||
}
|
||||
};
|
||||
|
||||
struct BackgroundProperties {
|
||||
inline BackgroundProperties() {}
|
||||
Color color = {{ 1, 1, 1, 1 }};
|
||||
};
|
||||
|
||||
typedef util::variant<
|
||||
FillProperties,
|
||||
LineProperties,
|
||||
IconProperties,
|
||||
TextProperties,
|
||||
CompositeProperties,
|
||||
RasterProperties,
|
||||
BackgroundProperties,
|
||||
std::false_type
|
||||
> StyleProperties;
|
||||
|
||||
template <typename T>
|
||||
const T &defaultStyleProperties();
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -2,9 +2,13 @@
|
||||
#define LLMR_STYLE_TYPES
|
||||
|
||||
#include <string>
|
||||
#include <array>
|
||||
|
||||
namespace llmr {
|
||||
|
||||
// Stores a premultiplied color, with all four channels ranging from 0..1
|
||||
typedef std::array<float, 4> Color;
|
||||
|
||||
enum class BucketType : uint8_t {
|
||||
None,
|
||||
Fill,
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include <llmr/util/noncopyable.hpp>
|
||||
#include <llmr/util/time.hpp>
|
||||
#include <llmr/style/properties.hpp>
|
||||
#include <llmr/style/types.hpp>
|
||||
|
||||
namespace llmr {
|
||||
namespace util {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include <llmr/renderer/painter.hpp>
|
||||
#include <llmr/style/style_properties.hpp>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
#include <llmr/style/properties.hpp>
|
||||
#include <llmr/util/constants.hpp>
|
||||
#include <llmr/style/function_properties.hpp>
|
||||
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
namespace llmr {
|
||||
@@ -86,12 +83,4 @@ float functions::exponential(float z, const std::vector<float>& values) {
|
||||
return std::fmin(std::fmax(min, val + std::pow(1.75, (z - z_base)) * slope), max);
|
||||
}
|
||||
|
||||
template<> const FillProperties &defaultStyleProperties() { static const FillProperties p; return p; }
|
||||
template<> const LineProperties &defaultStyleProperties() { static const LineProperties p; return p; }
|
||||
template<> const IconProperties &defaultStyleProperties() { static const IconProperties p; return p; }
|
||||
template<> const TextProperties &defaultStyleProperties() { static const TextProperties p; return p; }
|
||||
template<> const CompositeProperties &defaultStyleProperties() { static const CompositeProperties p; return p; }
|
||||
template<> const RasterProperties &defaultStyleProperties() { static const RasterProperties p; return p; }
|
||||
template<> const BackgroundProperties &defaultStyleProperties() { static const BackgroundProperties p; return p; }
|
||||
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
#include <llmr/style/style.hpp>
|
||||
#include <llmr/style/style_parser.hpp>
|
||||
#include <llmr/util/constants.hpp>
|
||||
#include <llmr/style/properties.hpp>
|
||||
#include <csscolorparser/csscolorparser.hpp>
|
||||
|
||||
#include <rapidjson/document.h>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#include <llmr/style/style_parser.hpp>
|
||||
#include <llmr/style/properties.hpp>
|
||||
#include <llmr/util/constants.hpp>
|
||||
#include <llmr/util/std.hpp>
|
||||
#include <csscolorparser/csscolorparser.hpp>
|
||||
|
||||
13
src/style/style_properties.cpp
Normal file
13
src/style/style_properties.cpp
Normal file
@@ -0,0 +1,13 @@
|
||||
#include <llmr/style/style_properties.hpp>
|
||||
|
||||
namespace llmr {
|
||||
|
||||
template<> const FillProperties &defaultStyleProperties() { static const FillProperties p; return p; }
|
||||
template<> const LineProperties &defaultStyleProperties() { static const LineProperties p; return p; }
|
||||
template<> const IconProperties &defaultStyleProperties() { static const IconProperties p; return p; }
|
||||
template<> const TextProperties &defaultStyleProperties() { static const TextProperties p; return p; }
|
||||
template<> const CompositeProperties &defaultStyleProperties() { static const CompositeProperties p; return p; }
|
||||
template<> const RasterProperties &defaultStyleProperties() { static const RasterProperties p; return p; }
|
||||
template<> const BackgroundProperties &defaultStyleProperties() { static const BackgroundProperties p; return p; }
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user