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

9
LINES

< > BotCompany Repo | #1036066 // transformBufferedImageWithSimplePixelOp

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

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

1  
static BufferedImage transformBufferedImageWithSimplePixelOp(IF1_IntToInt f, BufferedImage img) {
2  
  if (img == null) null;
3  
  int w = img.getWidth(), h = img.getHeight();
4  
  int[] pixels = pixelsFromBufferedImage(img);
5  
  int[] newPixels = new[pixels.length];
6  
  for (int i = 0; i < pixels.length; i++)
7  
    newPixels[i] = f.get(pixels[i]);
8  
  ret bufferedImageFromPixels(newPixels, w, h);
9  
}

Author comment

Began life as a copy of #1024727

download  show line numbers  debug dex  old transpilations   

Travelled to 2 computer(s): elmgxqgtpvxh, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1036066
Snippet name: transformBufferedImageWithSimplePixelOp
Eternal ID of this version: #1036066/5
Text MD5: f049767ad1f4090076f8dc8fa3813f5a
Transpilation MD5: 3f6a55b3db51f55e9bc217453871b6c1
Author: stefan
Category: javax / imaging
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-09-05 02:30:00
Source code size: 393 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 147 / 218
Version history: 4 change(s)
Referenced in: [show references]