#pragma once #include #include #include #include #include #include namespace mbgl { namespace uniforms { MBGL_DEFINE_UNIFORM_SCALAR(float, intensity); } // namespace uniforms class HeatmapProgram : public Program< HeatmapProgram, gfx::PrimitiveType::Triangle, TypeList< attributes::pos>, TypeList< uniforms::intensity, uniforms::matrix, uniforms::heatmap::extrude_scale>, TypeList<>, style::HeatmapPaintProperties> { public: using Program::Program; /* * @param {number} x vertex position * @param {number} y vertex position * @param {number} ex extrude normal * @param {number} ey extrude normal */ static LayoutVertex vertex(Point p, float ex, float ey) { return LayoutVertex { {{ static_cast((p.x * 2) + ((ex + 1) / 2)), static_cast((p.y * 2) + ((ey + 1) / 2)) }} }; } }; using HeatmapLayoutVertex = HeatmapProgram::LayoutVertex; using HeatmapAttributes = HeatmapProgram::AttributeList; class HeatmapLayerPrograms final : public LayerTypePrograms { public: HeatmapLayerPrograms(gfx::Context& context, const ProgramParameters& programParameters) : heatmap(context, programParameters), heatmapTexture(context, programParameters) {} ProgramMap heatmap; HeatmapTextureProgram heatmapTexture; }; } // namespace mbgl