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

11
LINES

< > BotCompany Repo | #1015520 // containsColor

JavaX fragment (include)

static bool containsColor(BufferedImage img, int color) {
  if (img == null) false;
  color |= 0xFF000000; // alpha
  int w = img.getWidth(), h = img.getHeight();
  for (int x = 0; x < w; x++)
    for (int y = 0; y < h; y++) {
      int rgba = img.getRGB(x, y);
      if (rgba == color) true;
    }
  false;
}

Author comment

Began life as a copy of #1004506

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1015520
Snippet name: containsColor
Eternal ID of this version: #1015520/2
Text MD5: 6ba057dae97df38f5acff0605847a845
Author: stefan
Category: javax / imaging
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-05-15 12:49:50
Source code size: 319 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 315 / 335
Version history: 1 change(s)
Referenced in: [show references]