Difference between revisions of "User:Lerc/Blur"

From CodeStuff
Jump to: navigation, search
Line 20: Line 20:
 
     }
 
     }
 
   }
 
   }
 +
}
 +
 +
function mix(source,dest) {
 +
  var i=0,j=0;
 +
  for (var ty=0;ty<bufferHeight;ty++) {
 +
    for (var tx=0;tx<bufferWidth;tx++) {
 +
      dest[i++]=source[j++];
 +
      dest[i++]=source[j++];
 +
      dest[i++]=source[j++];
 +
      dest[i++]=255;
 +
      j++;
 +
    }
 +
  }
 +
 
}
 
}
  
Line 25: Line 39:
 
drawImageData(0,0,bufferWidth,bufferHeight,a);
 
drawImageData(0,0,bufferWidth,bufferHeight,a);
 
print("wibble");
 
print("wibble");
 +
mix(a,b);
 +
drawImageData(0,0,bufferWidth,bufferHeight,b);
 +
 +
  
 
</edcode>
 
</edcode>

Revision as of 01:54, 11 February 2012