summaryrefslogtreecommitdiff
path: root/src/mbgl/text/quads.hpp
blob: 814452a72f8b5b2e747f50cecb2944fc0b0a603e (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
42
43
44
45
46
47
48
#ifndef MBGL_TEXT_QUADS
#define MBGL_TEXT_QUADS

#include <mbgl/text/glyph.hpp>
#include <mbgl/util/vec.hpp>

#include <vector>

namespace mbgl {

    struct SymbolQuad {
        explicit SymbolQuad(const vec2<float> &tl_, const vec2<float> &tr_,
                const vec2<float> &bl_, const vec2<float> &br_,
                const Rect<uint16_t> &tex_, float angle_, const vec2<float> &anchorPoint_,
                float minScale_, float maxScale_)
            : tl(tl_),
            tr(tr_),
            bl(bl_),
            br(br_),
            tex(tex_),
            angle(angle_),
            anchorPoint(anchorPoint_),
            minScale(minScale_),
            maxScale(maxScale_) {}

        vec2<float> tl, tr, bl, br;
        Rect<uint16_t> tex;
        float angle;
        vec2<float> anchorPoint;
        float minScale, maxScale;
    };

    typedef std::vector<SymbolQuad> SymbolQuads;

    struct Anchor;
    class SymbolLayoutProperties;
    class PositionedIcon;

    SymbolQuads getIconQuads(Anchor& anchor, const PositionedIcon& shapedIcon,
            const std::vector<Coordinate>& line, const SymbolLayoutProperties& layout,
            const bool alongLine);
    
    SymbolQuads getGlyphQuads(Anchor& anchor, const Shaping& shapedText,
            const float boxScale, const std::vector<Coordinate>& line, const SymbolLayoutProperties& layout,
            const bool alongLine, const GlyphPositions& face);
}

#endif