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

13
LINES

< > BotCompany Repo | #1019584 // rectOfDifferentPixels

JavaX fragment (include)

1  
static Rect rectOfDifferentPixels(RGBImage img1, RGBImage img2) {
2  
  rgbImageAssertSameSize(img1, img2);
3  
  Rect r = null;
4  
  int w = img1.getWidth(), h = img1.getHeight();
5  
  for y to h: for x to w: {
6  
    if (img1.getInt(x, y) != img2.getInt(x, y))
7  
      if (r == null)
8  
        r = singlePointRect(x, y);
9  
      else
10  
        extendRectToIncludePoint_modifyOriginal(r, x, y);
11  
  }
12  
  ret r;
13  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 12 computer(s): bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1019584
Snippet name: rectOfDifferentPixels
Eternal ID of this version: #1019584/2
Text MD5: 477ff6f7e94ae1a7657fa4f0a568bdf4
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-11-12 23:31:55
Source code size: 397 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 219 / 276
Version history: 1 change(s)
Referenced in: [show references]