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

35
LINES

< > BotCompany Repo | #1033764 // IIBWVirtualClip

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (12590L/73K).

sclass IIBWVirtualClip extends Meta implements IBWIntegralImage {
  IBWIntegralImage fullImage;
  int x1, y1, w, h;
  
  *() {}
  *(IBWIntegralImage fullImage, Rect r) {
    this(fullImage, r.x, r.y, r.w, r.h);
  }
  *(IBWIntegralImage *fullImage, int *x1, int *y1, int *w, int *h) {
    optimize();
  }
  
  public int getWidth() { ret w; }
  public int getHeight() { ret h; }

  public int getIIValue(int x, int y) {
    ret fullImage.getIIValue(x+x1, y+y1);
  }
  
  public double getIIValue(double x, double y) {
    ret fullImage.getIIValue(x+x1, y+y1);
  }
  
  public BufferedImage getBufferedImage() {
    ret clipBufferedImage(fullImage.getBufferedImage(), x1, y1, w, h);
  }
  
  void optimize {
    if (fullImage cast IIBWVirtualClip) {
      x1 += fullImage.x1;
      y1 += fullImage.y1;
      fullImage = fullImage.fullImage;
    }
  }
}

Author comment

Began life as a copy of #1031960

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, ekrmjmnbrukm, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1033764
Snippet name: IIBWVirtualClip
Eternal ID of this version: #1033764/5
Text MD5: f19c53c501c03de407638c329ef63db8
Transpilation MD5: 36f5f1b5c4e16c72cd462548bf02776d
Author: stefan
Category: javax / image recognition
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-01-02 20:14:18
Source code size: 884 bytes / 35 lines
Pitched / IR pitched: No / No
Views / Downloads: 134 / 235
Version history: 4 change(s)
Referenced in: [show references]