summaryrefslogtreecommitdiff
path: root/src/mbgl/text/shaping.hpp
blob: 30375179b6b6f032571cd1d0da161c3bb287b886 (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/text/glyph.hpp>
#include <mbgl/sprite/sprite_atlas.hpp>
#include <mbgl/sprite/sprite_image.hpp>
#include <mbgl/style/layers/symbol_layer_properties.hpp>
#include <mbgl/util/optional.hpp>

namespace mbgl {

class SpriteAtlasElement;

class PositionedIcon {
    public:
        explicit PositionedIcon() {}
        explicit PositionedIcon(const SpriteAtlasElement& _image,
                float _top, float _bottom, float _left, float _right) :
            image(_image), top(_top), bottom(_bottom), left(_left), right(_right) {}

        optional<SpriteAtlasElement> image;
        float top = 0;
        float bottom = 0;
        float left = 0;
        float right = 0;

        explicit operator bool() const { return image && (*image).pos.hasArea(); }
};

PositionedIcon shapeIcon(const SpriteAtlasElement& image, const style::SymbolLayoutProperties::Evaluated&);

} // namespace mbgl