sclass IIVerticalSplit extends Meta implements IIntegralImage { // y coordinate of split point int splitPoint; // a and b must have same width // [0; splitPoint) RegisteredReference a = new(this); // [splitPoint; height) RegisteredReference b = new(this); *() {} *(IIntegralImage contents) { this.contents.set(contents); } public getWidth() { ret a->getWidth(); } public simplyCached int getHeight() { ret a->getHeight()+b->getHeight(); } public double getIntegralValue(int x, int y, int channel) { if (y < splitPoint) ret a->getIntegralValue(x, y, channel); else ret b->getIntegralValue(x, y-splitPoint, channel); } public double getIntegralValue(int x, int y) { if (y < splitPoint) ret a->getIntegralValue(x, y); else ret b->getIntegralValue(x, y-splitPoint); } public BufferedImage getBufferedImage() { BufferedImage img = newBufferedImage(getWidth(), getHeight()); var g = graphics(img); a->drawAt(g, 0, 0); b->drawAt(g, 0, splitPoint); ret img; } }