Skip to content

zhenghuadai/lenaGPU

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

lenaGPU

GPU implentation of lena.js

Demo

http://zhenghuadai.github.io/lenaGPU.html image

Tutorials

<script src='http://blog.biosuefi.com/js/gpu-browser.js'></script>
<script src='http://blog.biosuefi.com/js/lena-gpu.js'></script>
var lenaGPU = new LenaGPU({width: 512, height: 512});
let img     = $('#image000')[0];  // source image
let canvas  = $('#canvasGPU')[0]; // destination canvas
lenaGPU.gaussian(img, canvas);    // input: img;  output: canvas
var lenaGPU = new LenaGPU({width: 512, height: 512});
let canvasSRC = $('#CanvasCPU')[0];  // source canvas 
let canvasDst  = $('#canvasGPU')[0]; // destination canvas
lenaGPU.gaussian(canvasSRC, canvasDst);    // input: canvasSRC;  output: canvasDst 

LenaGPU.proto:

bigGaussian      : ƒ (image, dstCanvas)
blue             : ƒ (image, dstCanvas)
flip             : ƒ (image, dstCanvas)
gaussian         : ƒ (image, dstCanvas)
grayscale        : ƒ (image, dstCanvas)
green            : ƒ (image, dstCanvas)
highpass         : ƒ (image, dstCanvas)
invert           : ƒ (image, dstCanvas)
laplacian        : ƒ (image, dstCanvas)
lowpass3         : ƒ (image, dstCanvas)
lowpass5         : ƒ (image, dstCanvas)
mirror           : ƒ (image, dstCanvas)
prewittHorizontal: ƒ (image, dstCanvas)
prewittVertical  : ƒ (image, dstCanvas)
red              : ƒ (image, dstCanvas)
roberts          : ƒ (image, dstCanvas)
sepia            : ƒ (image, dstCanvas)
sharpen          : ƒ (image, dstCanvas)
sobelHorizontal  : ƒ (image, dstCanvas)
sobelVertical    : ƒ (image, dstCanvas)
dct              : ƒ (image)            // return a texture
idct             : ƒ (dct_texture)      // dct_texture is the texture returned by dct
convolution      : ƒ convolution(image, weights, dstCanvas)
filterImage      : ƒ filterImage(image, filtername, dstCanvas)
canny            : ƒ canny(image, dstCanvas, ...rest)

// The input image can be:
// HTMLImage
// HTMLCanvas
// Array2D(4)
// GLTextureArray4Float2D

License

Code is under MIT license

Releases

No releases published

Packages

No packages published