(callback, width, height)
| 3036 | }); |
| 3037 | |
| 3038 | function render(callback, width, height) { |
| 3039 | /* Returns an Image object from a function containing drawing commands (i.e. a procedural image). |
| 3040 | * This is useful when, for example, you need to render filters on paths. |
| 3041 | */ |
| 3042 | var buffer = new OffscreenBuffer(width, height); |
| 3043 | buffer.draw = callback; |
| 3044 | return buffer.render(); |
| 3045 | } |
| 3046 | |
| 3047 | function filter(img, callback) { |
| 3048 | /* Returns a new Image object with the given pixel function applied to it. |
no test coverage detected
searching dependent graphs…