1 | static new ThreadLocal<RGB> ocr_findOutApproximateHeightOfTaskBar_v1_dominantColor; |
2 | |
3 | static int ocr_findOutApproximateHeightOfTaskBar_v1(O... _) {
|
4 | int grid = optPar grid(_, 10); |
5 | RGBImage screenshot = optParOr screenshot(_, () -> shootScreenRGB()); |
6 | L<RGBImage> slices = rgbImageVerticalSlices(grid, shootScreenRGB()); |
7 | L<Int> dominantColors = map dominant332color(slices); |
8 | //showImage(mergeImagesVertically(map rgbSingleColorCube(map rgbFrom332(dominantColors)))); |
9 | int idx = indexOfLastChange(dominantColors); |
10 | if (idx < 0) ret 0; |
11 | ocr_findOutApproximateHeightOfTaskBar_v1_dominantColor.set(rgbFrom332(last(dominantColors))); |
12 | int h = 0; |
13 | for (; idx < l(slices); idx++) |
14 | h += slices.get(idx).getHeight(); |
15 | ret h; |
16 | } |
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1023033 |
| Snippet name: | ocr_findOutApproximateHeightOfTaskBar_v1 |
| Eternal ID of this version: | #1023033/3 |
| Text MD5: | e229e559d95b25e83ee3d230fc1192a0 |
| Author: | stefan |
| Category: | javax / screen ocr |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2019-04-23 13:44:03 |
| Source code size: | 747 bytes / 16 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 620 / 694 |
| Version history: | 2 change(s) |
| Referenced in: | [show references] |