blob: 1b7b8b27336b81b226a5ec304e69e982c06a7429 (
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
33
34
35
36
37
38
39
40
41
|
#pragma once
#include <mbgl/text/glyph.hpp>
#include <mbgl/sprite/sprite_atlas.hpp>
#include <mbgl/sprite/sprite_image.hpp>
#include <mbgl/util/optional.hpp>
namespace mbgl {
class SpriteAtlasElement;
class SymbolFeature;
class PositionedIcon {
public:
PositionedIcon() = default;
PositionedIcon(const SpriteAtlasElement& image_,
float top_,
float bottom_,
float left_,
float right_,
float angle_)
: image(image_),
top(top_),
bottom(bottom_),
left(left_),
right(right_),
angle(angle_) {}
optional<SpriteAtlasElement> image;
float top = 0;
float bottom = 0;
float left = 0;
float right = 0;
float angle = 0;
explicit operator bool() const { return image && (*image).pos.hasArea(); }
};
PositionedIcon shapeIcon(const SpriteAtlasElement&, const std::array<float, 2>& iconOffset, const float iconRotation);
} // namespace mbgl
|