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

7
LINES

< > BotCompany Repo | #1035293 // rgbDistanceSquaredInt

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

Transpiled version (95L) is out of date.

// 0xRRGGBB - result is between 0 and 255*255*3
static int rgbDistanceSquaredInt(int a, int b) {
  ret
    sqrUbyte(absDiff(rgbRed(a), rgbRed(b))) +
    sqrUbyte(absDiff(rgbGreen(a), rgbGreen(b))) +
    sqrUbyte(absDiff(rgbBlue(a), rgbBlue(b)));
}

Author comment

Began life as a copy of #1006582

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, ekrmjmnbrukm, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1035293
Snippet name: rgbDistanceSquaredInt
Eternal ID of this version: #1035293/4
Text MD5: f67c0338760c3d8431b251287dbc568e
Author: stefan
Category: javax / imaging
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-04-29 03:10:29
Source code size: 253 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 77 / 117
Version history: 3 change(s)
Referenced in: [show references]