[core, ios, macos, android, node] Heatmap layer (#11046)
Co-Authored-By: Konstantin Käfer <mail@kkaefer.com> Co-Authored-By: Anand Thakker <anandthakker@users.noreply.github.com> Co-Authored-By: Minh Nguyễn <1ec5@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
1fdec7a5c1
commit
82de856c94
43
src/mbgl/programs/heatmap_texture_program.hpp
Normal file
43
src/mbgl/programs/heatmap_texture_program.hpp
Normal file
@@ -0,0 +1,43 @@
|
||||
#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(gl::TextureUnit, u_color_ramp);
|
||||
} // namespace uniforms
|
||||
|
||||
class HeatmapTextureProgram : public Program<
|
||||
shaders::heatmap_texture,
|
||||
gl::Triangle,
|
||||
gl::Attributes<attributes::a_pos>,
|
||||
gl::Uniforms<
|
||||
uniforms::u_matrix,
|
||||
uniforms::u_world,
|
||||
uniforms::u_image,
|
||||
uniforms::u_color_ramp,
|
||||
uniforms::u_opacity>,
|
||||
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
|
||||
Reference in New Issue
Block a user