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

10
LINES

< > BotCompany Repo | #1020186 // pixelColorsWithNonZeroSaturation

JavaX fragment (include)

static L<Int> pixelColorsWithNonZeroSaturation(BufferedImage img) {
  if (img == null) null;
  int w = img.getWidth(), h = img.getHeight();
  new L<Int> out;
  int rgb;
  for y to h: for x to w:
    if (saturationFromRGB(rgb = img.getRGB(x, y)) != 0)
      out.add(rgb);
  ret out;
}

Author comment

Began life as a copy of #1020185

download  show line numbers  debug dex  old transpilations   

Travelled to 8 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1020186
Snippet name: pixelColorsWithNonZeroSaturation
Eternal ID of this version: #1020186/3
Text MD5: 40fe194fe806fa76e932e007edf07cb9
Author: stefan
Category: javax / imaging
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-12-09 21:16:48
Source code size: 292 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 335 / 359
Version history: 2 change(s)
Referenced in: [show references]