Warning: session_start(): open(/var/lib/php/sessions/sess_5t7n2lometjmnuath236fjl4aa, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
static BufferedImage scaledBufferedImageFromBWIntegralImage(int w, BWIntegralImage img) {
ret scaledBufferedImageFromBWIntegralImage(img, w);
}
static BufferedImage scaledBufferedImageFromBWIntegralImage(BWIntegralImage img, int w, int h default heightForWidth(img.w, img.h, w)) {
int w1 = img.w, h1 = img.h;
int[] pixels = new[w*h];
for y to h:
for x to w: {
// TODO: optimize
int x1 = x*w1/w, x2 = max(x1+1, (x+1)*w1/w);
int y1 = y*h1/h, y2 = max(y1+1, (y+1)*h1/h);
int area = (x2-x1)*(y2-y1);
int pixel = bwIntegralImage_sumRect(img, x1, y1, x2, y2)/area;
pixels[i++] = brightnessToRGBA(pixel);
}
ret bufferedImage(w, h, pixels);
}