Libraryless. Click here for Pure Java version (5239L/34K).
static L<Pt> listOfBrightestPixels(BWImage img) { int w = img.getWidth(), h = img.getHeight(); new LPair<Pt, Int> l; for y to h: for x to w: l.add(pair(pt(x, y), img.getInt(x, y)); ret pairsA(sortBySecondOfPairsDesc_inPlace(l)); } static L<Pt> listOfBrightestPixels(int n, BWImage img) { ret takeFirst(n, listOfBrightestPixels(img)); }
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
| Snippet ID: | #1027299 |
| Snippet name: | listOfBrightestPixels |
| Eternal ID of this version: | #1027299/2 |
| Text MD5: | 6b7c29700b8c2f5c21bdec2da42a3422 |
| Transpilation MD5: | fbe4b080faf764abc71ef1268024df2c |
| Author: | stefan |
| Category: | javax / maths |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2020-03-01 01:27:35 |
| Source code size: | 367 bytes / 12 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 405 / 573 |
| Version history: | 1 change(s) |
| Referenced in: | #1006654 - Standard functions list 2 (LIVE, continuation of #761) #1027301 - brightestPixel - coordinates of brightest pixel |