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

8
LINES

< > BotCompany Repo | #1034807 // uniqueBrightnessesInBWImage

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

Libraryless. Click here for Pure Java version (5342L/30K).

1  
static int[] uniqueBrightnessesInBWImage(IBWImage img) {
2  
  if (img == null) null;
3  
  new BitSet bs;
4  
  int w = img.getWidth(), h = img.getHeight();
5  
  for y to h: for x to w:
6  
    bs.set(img.getInt(x, y));
7  
  ret bitSetToIntArray(bs);
8  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1034807
Snippet name: uniqueBrightnessesInBWImage
Eternal ID of this version: #1034807/3
Text MD5: 0e9f6dcdcdf4283f23a13b5fbaeeb8cf
Transpilation MD5: 64ba604d26384d0a7dcfad9317bb0894
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-03-10 21:01:25
Source code size: 238 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 131 / 183
Version history: 2 change(s)
Referenced in: [show references]