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

7
LINES

< > BotCompany Repo | #1032071 // rgbImageFromFunction

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

Libraryless. Click here for Pure Java version (3939L/22K).

static RGBImage rgbImageFromFunction(int w, int h default w, IF2<Int, Int, RGB> f) {
  RGBImage img = new(w, h);
  for y to h:
    for x to w:
      img.setPixel(x, y, f.get(x, y));
  ret img;
}

Author comment

Began life as a copy of #1026933

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx

No comments. add comment

Snippet ID: #1032071
Snippet name: rgbImageFromFunction
Eternal ID of this version: #1032071/1
Text MD5: 73bef1dbfc228ff04ed55f75763c8c7d
Transpilation MD5: 23e703c22ceae30c78a29f7872d520d2
Author: stefan
Category: javax / imaging
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-08-11 11:40:16
Source code size: 200 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 69 / 98
Referenced in: [show references]