static int ocr_findOutExactHeightOfTaskBar_v1(O... _) { int grid = optPar grid(_, 8); // power of 2 is good RGBImage screenshot = optParOr screenshot(_, () -> shootScreenRGB()); int approxH = ocr_findOutApproximateHeightOfTaskBar_v1(paramsPlus(_, +screenshot, +grid)); RGB col = ocr_findOutApproximateHeightOfTaskBar_v1_dominantColor!; int approxY = screenshot.getHeight()-approxH; int y1 = approxY-grid/2, y2 = approxY+grid/2; RGBImage clip = rgbClip(screenshot, rectFromPoints(0, y1, screenshot.getWidth(), y2)); L<RGBImage> slices = rgbImageVerticalSlices(1, clip); L<Int> dominantColors = map dominant332color(slices); //showImage(mergeImagesVertically(map rgbSingleColorCube(map rgbFrom332(dominantColors)))); int idx = indexOfLastChange(dominantColors); if (idx < 0) ret approxH; ret screenshot.getHeight()-(y1+idx); }
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: | 216 / 268 |
Referenced in: | [show references] |