summaryrefslogtreecommitdiff
path: root/src/mbgl/programs/heatmap_texture_program.hpp
blob: 6762f8c7f4e517ab7b3df6b52fea5c05b2dcae28 (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
#pragma once

#include <mbgl/programs/program.hpp>
#include <mbgl/programs/attributes.hpp>
#include <mbgl/programs/uniforms.hpp>
#include <mbgl/programs/textures.hpp>
#include <mbgl/style/properties.hpp>
#include <mbgl/util/geometry.hpp>

namespace mbgl {

class HeatmapTextureProgram : public Program<
    HeatmapTextureProgram,
    gfx::PrimitiveType::Triangle,
    TypeList<attributes::pos>,
    TypeList<
        uniforms::matrix,
        uniforms::world,
        uniforms::opacity>,
    TypeList<
        textures::image,
        textures::color_ramp>,
    style::Properties<>> {
public:
    using Program::Program;

    static LayoutVertex layoutVertex(Point<int16_t> p) {
        return LayoutVertex{
            {{
                p.x,
                p.y
            }}
        };
    }
};

using HeatmapTextureLayoutVertex = HeatmapTextureProgram::LayoutVertex;
using HeatmapTextureAttributes = HeatmapTextureProgram::AttributeList;

} // namespace mbgl