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

57
LINES

< > BotCompany Repo | #1005686 // PIF [Persistent Image Finder] Classes v2

JavaX fragment (include)

concept Screenshot {
  S pngPath; // optional, relative (program ID + "/" + file name)
  Rect r; // optional, rectangle that was shot
  
  *() {} // for persistance
  *(BufferedImage img) {
    savePNG(pngFile(), img);
  }

  File pngFile() {
    if (pngPath != null)
      ret prepareFile(new File(javaxDataDir(), pngPath));
    ret prepareProgramFile(_programID(), "screenshot" + id + ".png");
  }
  
  BufferedImage loadImage() {
    ret loadImage2(pngFile());
  }
  
  bool hasImage() {
    ret pngFile().exists();
  }
}

Screenshot > TransientScreenshot {
  transient BufferedImage img;
  
  *() {} // for persistance
  *(BufferedImage *img) {}
  
  bool hasImage() { ret img != null; }
  BufferedImage loadImage() { ret img; }
  
  void disposeImage() { img = null; }
}

Clip > MarkedClip {
  new Ref<Screenshot> screenshot;
  Rect positionInScreenshot;
}

concept Clip {
  long originalID; // ID in #1005389
  BWImage img;
  S description;
}

concept Found {
  new Ref<Screenshot> screenshot;
  new Ref<Clip> clip;
  FoundImg fi; // contains Rect r
}

concept FullySearched {
  new Ref<Screenshot> screenshot;
  new Ref<Clip> clip;
}

Author comment

Began life as a copy of #1005530

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1005686
Snippet name: PIF [Persistent Image Finder] Classes v2
Eternal ID of this version: #1005686/1
Text MD5: ad93f956785467be5b83f03d3ae1c84a
Author: stefan
Category: javax / ocr
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-12-03 22:41:09
Source code size: 1196 bytes / 57 lines
Pitched / IR pitched: No / No
Views / Downloads: 477 / 1956
Referenced in: #1005685 - Test ImageFinder on Start Button [dev.]
#1005698 - continuousFind
#1005714 - SingleObjectFinder [with GUI]
#1005715 - Find JavaX console's "kill" button
#1005721 - Find JavaX console's "duplicate" button
#1005722 - Correlate clips from two programs [WORKS]
#1005723 - class CorrelateClips
#1005724 - Test CorrelateClips
#1005747 - Find Start Button [backup]
#1005750 - Find Start Button [execution, dev., v2]