(mode, done)
| 3 | |
| 4 | describe('image'); |
| 5 | function imageArgumentTest(mode, done) { |
| 6 | const gpu = new GPU({ mode }); |
| 7 | const image = document.createElement('img'); |
| 8 | image.src = 'jellyfish-1.jpeg'; |
| 9 | image.onload = function() { |
| 10 | const imageKernel = gpu.createKernel(function(image) { |
| 11 | const pixel = image[this.thread.y][this.thread.x]; |
| 12 | this.color(pixel[0], pixel[1], pixel[2], pixel[3]); |
| 13 | }, { |
| 14 | graphical: true, |
| 15 | output : [image.width, image.height] |
| 16 | }); |
| 17 | imageKernel(image); |
| 18 | assert.equal(true, true, 'does not throw'); |
| 19 | gpu.destroy(); |
| 20 | done(); |
| 21 | }; |
| 22 | } |
| 23 | |
| 24 | (typeof Image !== 'undefined' ? test : skip)('image argument auto', t => { |
| 25 | imageArgumentTest(null, t.async()); |
no test coverage detected
searching dependent graphs…