sclass ScaledIBWIntegralImage implements IBWIntegralImage { IBWIntegralImage img; int w, h; double factorX, factorY, areaCorrection; *(int w, IBWIntegralImage img) { this(w, heightForWidth(img.getWidth(), img.getHeight(), w), img); } *(int *w, int *h, IBWIntegralImage *img) { h = heightForWidth(img.getWidth(), img.getHeight(), w); int w1 = img.getWidth(), h1 = img.getHeight(); factorX = doubleRatio(w1, w); factorY = doubleRatio(h1, h); areaCorrection = 1/(factorX*factorY); } public int getWidth() { ret w; } public int getHeight() { ret h; } // get value for 1 channel // normal range [0; pixelCount*256) // TODO: test public double getIIValue(double x, double y) { ret img.getIIValue(x*factorX, y*factorY)*areaCorrection; } }