Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

8
LINES

< > BotCompany Repo | #1032161 // imageFromFunction

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (52L/1K).

static BufferedImage imageFromFunction(int w, int h default w, IF2_Int f) {
  int[] pixels = new[w*h];
  int i = 0;
  for y to h:
    for x to w:
      pixels[i++] = f.get(x, y);
  ret intArrayToBufferedImage(pixels, w, h);
}

Author comment

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: 184 / 254
Version history: 3 change(s)
Referenced in: [show references]