Libraryless. Click here for Pure Java version (10933L/63K).
1 | static L<Pt> pixelsByBrightness(IBWImage image) { |
2 | float[] data = image.toFloatArray(); |
3 | int n = l(data); |
4 | int[] indices = new[n]; |
5 | for i to n: indices[i] = i; |
6 | timSortIntArrayWithComparator(indices, (i, j) -> cmp(data[i], data[j])); |
7 | int w = image.w(); |
8 | ret listFromFunction(n, i -> ptFromPixelIndex(indices[i], w)); |
9 | } |
Began life as a copy of #1035872
download show line numbers debug dex old transpilations
Travelled to 2 computer(s): mqqgnosmbjvj, wnsclhtenguj
No comments. add comment
Snippet ID: | #1035873 |
Snippet name: | pixelsByBrightness |
Eternal ID of this version: | #1035873/1 |
Text MD5: | a330550d45e95796ef53e2681ea77794 |
Transpilation MD5: | f8e614f974cd63285911d63283eae172 |
Author: | stefan |
Category: | javax / imaging |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-08-05 19:21:20 |
Source code size: | 334 bytes / 9 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 154 / 185 |
Referenced in: | [show references] |