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

8
LINES

< > BotCompany Repo | #1024727 // transformBufferedImageToBWImage

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

Libraryless. Click here for Pure Java version (2682L/16K).

static BWImage transformBufferedImageToBWImage(IF1<Int, Float> f, BufferedImage img) {
  if (img == null) null;
  int w = img.getWidth(), h = img.getHeight();
  BWImage img2 = new(w, h);
  for y to h: for x to w:
    img2.setPixel(x, y, f.get(img.getRGB(x, y)));
  ret img2;
}

Author comment

Began life as a copy of #1020184

download  show line numbers  debug dex  old transpilations   

Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1024727
Snippet name: transformBufferedImageToBWImage
Eternal ID of this version: #1024727/5
Text MD5: 3e3ec3e30218c8f987ab09c592f625c3
Transpilation MD5: 5142d53d1ffe1c04274e2fa6bce0cd57
Author: stefan
Category: javax / imaging
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-08-24 14:53:21
Source code size: 283 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 200 / 277
Version history: 4 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1036066 - transformBufferedImageWithSimplePixelOp