Libraryless. Click here for Pure Java version (8153L/46K).
1 | sbool bwImagesIdentical(BWImage img1, BWImage img2) { |
2 | if (img1 == img2) true; |
3 | if (img1 == null) ret img2 == null; |
4 | if (img2 == null) false; |
5 | |
6 | int w = img1.getWidth(), h = img1.getHeight(); |
7 | if (w != img2.getWidth() || h != img2.getHeight()) false; |
8 | |
9 | byte[] pixels1 = img1.pixels, pixels2 = img2.pixels; |
10 | ret Arrays.equals(pixels1, pixels2); |
11 | } |
Began life as a copy of #1015234
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1034813 |
Snippet name: | bwImagesIdentical |
Eternal ID of this version: | #1034813/1 |
Text MD5: | 8019f39a2fabd6bcaf10c29412ccbb5d |
Transpilation MD5: | b1a2fdacff6325246b01b7fb9cad52e8 |
Author: | stefan |
Category: | javax / imaging |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-03-10 22:25:30 |
Source code size: | 365 bytes / 11 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 171 / 231 |
Referenced in: | [show references] |