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

9
LINES

< > BotCompany Repo | #1035304 // invertImageInPlace

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

Libraryless. Click here for Pure Java version (10563L/60K).

1  
static BWImage invertImageInPlace(BWImage bw) {
2  
  if (bw != null) {
3  
    byte[] pixels = bw.pixels;
4  
    int n = pixels.length;
5  
    for i to n:
6  
      pixels[i] = (byte) ~pixels[i];
7  
  }
8  
  ret bw;
9  
}

Author comment

Began life as a copy of #1024996

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1035304
Snippet name: invertImageInPlace
Eternal ID of this version: #1035304/5
Text MD5: 7d8c4040e3567c1701804bbfd8e48df1
Transpilation MD5: f1e16f569586e47e746dbae23bbc4c34
Author: stefan
Category: javax / imaging
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-04-29 04:31:01
Source code size: 202 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 150 / 229
Version history: 4 change(s)
Referenced in: [show references]