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

10
LINES

< > BotCompany Repo | #1035765 // compareBWImagesByScanlineOrdering

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

Libraryless. Click here for Pure Java version (10745L/62K).

static int compareBWImagesByScanlineOrdering(BWImage a, BWImage b) {
  assertSameSize(a, b);
  int w = a.getWidth(), h = a.getHeight();
  for y to h:
    for x to w: {
      int pix1 = a.getInt(x, y), pix2 = b.getInt(x, y);
      if (pix1 != pix2) ret pix1-pix2;
    }
  ret 0;
}

download  show line numbers  debug dex  old transpilations   

Travelled to 2 computer(s): elmgxqgtpvxh, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1035765
Snippet name: compareBWImagesByScanlineOrdering
Eternal ID of this version: #1035765/1
Text MD5: 4417b959f66f502a32a13ada87579083
Transpilation MD5: 6d493750a1abcdbe392fd5d49727ae70
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-07-21 17:06:44
Source code size: 288 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 123 / 165
Referenced in: [show references]