diff --git a/.gitignore b/.gitignore index 78b753fc72ee4417abfb6358b87ac1255820dae9..1f5c3d21e834692aa6bae6b3935bbd88f5f6604d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -**/sol** +**/sol**.js +**/sol**.html diff --git a/features/pixels.js b/features/pixels.js new file mode 100644 index 0000000000000000000000000000000000000000..755c8f109e931bb609af8711bed380534a852851 --- /dev/null +++ b/features/pixels.js @@ -0,0 +1,19 @@ +GetPixelRGBATask=function(opt_options) { + this.x=opt_options.x; + this.y=opt_options.y; + this.output=opt_options.output; +} + +GetPixelRGBATask.prototype.process=function(imageData) { + var pos=(this.y*imageData.width+this.x)<<2; + var r=imageData.data[pos]; + var g=imageData.data[pos+1]; + var b=imageData.data[pos+2]; + var a=imageData.data[pos+3]; + + this.output.innerHTML=this.x+"x"+this.y+" : "; + this.output.innerHTML+="<font color='red'>"+r+"</font> | "; + this.output.innerHTML+="<font color='green'>"+g+"</font> | "; + this.output.innerHTML+="<font color='blue'>"+b+"</font> | "; + this.output.innerHTML+="<font color='gray'>"+a+"</font>"; +}