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

10
LINES

< > BotCompany Repo | #1034892 // rawRGBDiff - between 0 and 255*3

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

Libraryless. Click here for Pure Java version (37L/1K).

// 0xRRGGBB
static int rawRGBDiff(int a, int b) {
  int r1 = (a >> 16) & 0xFF;
  int g1 = (a >> 8) & 0xFF;
  int b1 = a & 0xFF;
  int r2 = (b >> 16) & 0xFF;
  int g2 = (b >> 8) & 0xFF;
  int b2 = b & 0xFF;
  ret Math.abs(r1-r2) + Math.abs(g1-g2) + Math.abs(b1-b2);
}

Author comment

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: 130 / 191
Referenced in: [show references]