1 | static int ocr_findOutExactHeightOfTaskBar_v1(O... _) { |
2 | int grid = optPar grid(_, 8); // power of 2 is good |
3 | RGBImage screenshot = optParOr screenshot(_, () -> shootScreenRGB()); |
4 | int approxH = ocr_findOutApproximateHeightOfTaskBar_v1(paramsPlus(_, +screenshot, +grid)); |
5 | RGB col = ocr_findOutApproximateHeightOfTaskBar_v1_dominantColor!; |
6 | int approxY = screenshot.getHeight()-approxH; |
7 | int y1 = approxY-grid/2, y2 = approxY+grid/2; |
8 | RGBImage clip = rgbClip(screenshot, rectFromPoints(0, y1, screenshot.getWidth(), y2)); |
9 | L<RGBImage> slices = rgbImageVerticalSlices(1, clip); |
10 | L<Int> dominantColors = map dominant332color(slices); |
11 | //showImage(mergeImagesVertically(map rgbSingleColorCube(map rgbFrom332(dominantColors)))); |
12 | int idx = indexOfLastChange(dominantColors); |
13 | if (idx < 0) ret approxH; |
14 | ret screenshot.getHeight()-(y1+idx); |
15 | } |
Began life as a copy of #1023033
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: | #1023035 |
Snippet name: | ocr_findOutExactHeightOfTaskBar_v1 |
Eternal ID of this version: | #1023035/1 |
Text MD5: | 33e1755a78675f264c7e016c70350d51 |
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:46:32 |
Source code size: | 864 bytes / 15 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 218 / 271 |
Referenced in: | [show references] |