Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

16
LINES

< > BotCompany Repo | #1023033 // ocr_findOutApproximateHeightOfTaskBar_v1

JavaX fragment (include)

static new ThreadLocal<RGB> ocr_findOutApproximateHeightOfTaskBar_v1_dominantColor;

static int ocr_findOutApproximateHeightOfTaskBar_v1(O... _) {
  int grid = optPar grid(_, 10);
  RGBImage screenshot = optParOr screenshot(_, () -> shootScreenRGB());
  L<RGBImage> slices = rgbImageVerticalSlices(grid, shootScreenRGB());
  L<Int> dominantColors = map dominant332color(slices);
  //showImage(mergeImagesVertically(map rgbSingleColorCube(map rgbFrom332(dominantColors))));
  int idx = indexOfLastChange(dominantColors);
  if (idx < 0) ret 0;
  ocr_findOutApproximateHeightOfTaskBar_v1_dominantColor.set(rgbFrom332(last(dominantColors)));
  int h = 0;
  for (; idx < l(slices); idx++)
    h += slices.get(idx).getHeight();
  ret h;
}

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: 253 / 325
Version history: 2 change(s)
Referenced in: [show references]