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

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

namespace mbgl {

namespace uniforms {
MBGL_DEFINE_UNIFORM_SCALAR(uint32_t, u_color_ramp);
} // namespace uniforms

class HeatmapTextureProgram : public Program<
    shaders::heatmap_texture,
    gfx::Triangle,
    TypeList<attributes::a_pos>,
    TypeList<
        uniforms::u_matrix,
        uniforms::u_world,
        uniforms::u_image,
        uniforms::u_color_ramp,
        uniforms::u_opacity>,
    TypeList<>,
    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::Attributes;

} // namespace mbgl