Libraryless. Click here for Pure Java version (37L/1K).
1 | // 0xRRGGBB |
2 | static int rawRGBDiff(int a, int b) { |
3 | int r1 = (a >> 16) & 0xFF; |
4 | int g1 = (a >> 8) & 0xFF; |
5 | int b1 = a & 0xFF; |
6 | int r2 = (b >> 16) & 0xFF; |
7 | int g2 = (b >> 8) & 0xFF; |
8 | int b2 = b & 0xFF; |
9 | ret Math.abs(r1-r2) + Math.abs(g1-g2) + Math.abs(b1-b2); |
10 | } |
Began life as a copy of #1006582
download show line numbers debug dex old transpilations
Travelled to 4 computer(s): bhatertpkbcr, iveijnkanddl, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1034892 |
Snippet name: | rawRGBDiff - between 0 and 255*3 |
Eternal ID of this version: | #1034892/1 |
Text MD5: | f8352d3f10fba28947a045860ccc2801 |
Transpilation MD5: | 5861fd4d4afed024af38fe170a5074b4 |
Author: | stefan |
Category: | javax / imaging |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-03-13 02:07:26 |
Source code size: | 275 bytes / 10 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 131 / 193 |
Referenced in: | [show references] |