// forgets sub-pixels sclass TruncatedIBWIntegralImage is IBWIntegralImage { IBWIntegralImage img; int w, h; *(IBWIntegralImage *img) { w = img.getWidth(); h = img.getHeight(); } public int getWidth() { ret w; } public int getHeight() { ret h; } // get value for 1 channel // normal range [0; pixelCount*256) public double getIIValue(dbl x, dbl y) { ret img.getIIValue(ifloor(x), ifloor(y)); } }