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; } } }