adds contour degradation

This commit is contained in:
Francisco Dans 2015-04-27 12:52:26 +02:00
parent 884144a442
commit 62b9de79aa

View File

@ -83,7 +83,7 @@ BallRenderer.prototype = {
},
addPoint: function(x, y, alpha){
var indexPos = (y*(this.radius*2+1)+x)*4;
this.cachedBall[indexPos + 3] = this.cachedBall[indexPos + 3] + alpha;
this.cachedBall[indexPos + 3] += alpha;
},
map_range: function(value, low1, high1, low2, high2) {
return low2 + (high2 - low2) * (value - low1) / (high1 - low1);
@ -122,7 +122,12 @@ BallRenderer.prototype = {
},
invalidate: function(full){
if(full)this.pointLayer = new Uint8ClampedArray(this.size * 4);
var reductionFactor = 10;
if(full){
for (var i = 0; i< this.pointLayer.length; i+=4){
this.pointLayer[i + 3] -= reductionFactor;
}
}
if(this.contourLayer){
this.contourLayer = new Uint8ClampedArray(this.size * 4);
if(this.isoplethLayer){