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

28
LINES

< > BotCompany Repo | #1006082 // Find Chess Board 2 [v2, show whole board of test case]

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (4092L/28K/96K).

!752

static RGBImage board;
static int boardW, boardH;

p {
  BufferedImage screen = loadBufferedImage("#1006074");
  Rect boardRect = pointRect(194, 179, 501, 485);
  board = new RGBImage(screen).clip(boardRect);
  boardW = board.w();
  boardH = board.h();
  //showImage(board);
  //showImage(square(0, 0));
  //showImage(square(7, 7));
  new L<RGBImage> imgs;
  for y to 8: {
    new L<Rect> l;
    for x to 8: l.add(square(x, y));
    imgs.add(mergeImagePartsHorizontally(board, l));
  }
  showImage(mergeImagesVertically(imgs));
}

static Rect square(int x, int y) {
  ret pointsRect(
    boardW*x/8, boardH*y/8,
    boardW*(x+1)/8, boardH*(y+1)/8);
}

Author comment

Began life as a copy of #1006076

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, sawdedvomwva, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1006082
Snippet name: Find Chess Board 2 [v2, show whole board of test case]
Eternal ID of this version: #1006082/1
Text MD5: 475f763b3e80fbb897aac59ff0f7a015
Transpilation MD5: 2066644ddfac9022e874cd2c6a26873f
Author: stefan
Category: javax / ocr
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-12-17 14:05:18
Source code size: 683 bytes / 28 lines
Pitched / IR pitched: No / No
Views / Downloads: 594 / 715
Referenced in: [show references]