Android heat map,GitHub - wujushan/android-opengl-heatmap: A high performance WebGL/JS heatmap displ...

Android OpenGL (ES 2.0) Heatmap

Android OpenGL ES 2.0 implementation of webgl-heatmap.js by Florian Bösch.

Documentation

Screenshots

db0a92e795d9954f5dd1be492268318d.png

(Note: Colorization does not work yet.)

Notes

Tracer for OpenGL ES configuration

Application package: pyalot.heatmap.opengl

Activity to launch: org.example.heatmap.OpenGLES20Activity

Progress

Java Code equivalent to JS code

Framebuffer

GLHeatmap (didn't set depth and antialias, glBlendFunc right?; quad_l as FloatBuffer?)

Heights (Update glVertexAttribPointer)

Main

Node

Shader

Texture

GL code works

getColor function works

WebGL Heatmap

webgl-heatmap.js is a JavaScript library for high performance heatmap display.

Demo

Live Demo at codeflow.org

How to use it

Instantiate a new heatmap, errors can be one of:

Webgl is not supported

No floating point texture support

Floating point render target not supported

Shader Compile Error: ...

Shader Link Error: ...

try{

var heatmap = createWebGLHeatmap({canvas: yourCanvas});

}

catch(error){

// handle the error

}

creation arguments

canvas: the canvas you wish to draw on

width: explicit width

height: explicit height

intensityToAlpha: defaults to true

gradientTexture: texture used instead of color calculation, can be path or an image

Add a data point.

x and y relative to the canvas in pixels

size in pixels (radius)

intensity between 0 and 1

heatmap.addPoint(x, y, size, intensity);

Add a list of data points.

x and y relative to the canvas in pixels

size in pixels (radius)

intensity between 0 and 1

heatmap.addPoints([{x:x, y:y, size:size, intensity:intensity}]);

Draw queued data points:

heatmap.update()

Display the heatmap

heatmap.display()

Multiply all values in the heatmap by a number (useful for decay)

heatmap.multiply(0.995)

Clamp all values in the heatmap to between two values:

heatmap.clamp(0.0, 1.0)

Blur all values a little:

heatmap.blur()

License

WebGL Heatmap is licensed under any of the following licenses at your choosing:

MIT: see mit-license

GPL: see gplv*-license

BSD: see bsd-license

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值