(img, callback)
| 3045 | } |
| 3046 | |
| 3047 | function filter(img, callback) { |
| 3048 | /* Returns a new Image object with the given pixel function applied to it. |
| 3049 | * The function takes an array of RGBA-values (base 255) and returns a new array. |
| 3050 | */ |
| 3051 | var pixels = new Pixels(img); |
| 3052 | pixels.map(callback); |
| 3053 | pixels.update(); |
| 3054 | return pixels.image(); |
| 3055 | } |
| 3056 | |
| 3057 | /*##################################################################################################*/ |
| 3058 |
no test coverage detected
searching dependent graphs…