Libraryless. Click here for Pure Java version (52L/1K).
1 | static BufferedImage imageFromFunction(int w, int h default w, IF2_Int f) {
|
2 | int[] pixels = new[w*h]; |
3 | int i = 0; |
4 | for y to h: |
5 | for x to w: |
6 | pixels[i++] = f.get(x, y); |
7 | ret intArrayToBufferedImage(pixels, w, h); |
8 | } |
Began life as a copy of #1032071
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx
No comments. add comment
| Snippet ID: | #1032161 |
| Snippet name: | imageFromFunction |
| Eternal ID of this version: | #1032161/4 |
| Text MD5: | 4eda073cde33b67133979b94f81feefd |
| Transpilation MD5: | 29d3baa6dec4aa8bcd450e2565da743b |
| Author: | stefan |
| Category: | javax / imaging |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2021-08-16 22:17:09 |
| Source code size: | 232 bytes / 8 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 452 / 583 |
| Version history: | 3 change(s) |
| Referenced in: | [show references] |