Warning: session_start(): open(/var/lib/php/sessions/sess_o8l6f3cbqv62lpkbgoahde5077, 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
sclass IntegralImage {
int w, h;
int[] data; // 3 ints per pixel
*(RGBImage img) {
w = img.w();
h = img.h();
data = new int[w*h*3];
int i = 0;
for y to h: {
int sumR = 0, sumG = 0, sumB = 0;
for x to w: {
int rgb = img.getInt(x, y);
sumR += (rgb >> 16) & 0xFF;
sumG += (rgb >> 8) & 0xFF;
sumB += rgb & 0xFF;
data[i] = y > 0 ? sumR + data[i-w*3] : sumR;
data[i+1] = y > 0 ? sumG + data[i-w*3+1] : sumG;
data[i+2] = y > 0 ? sumB + data[i-w*3+1] : sumB;
i += 3;
}
}
}
int get(int x, int y, int channel) {
ret data[(y*w+x)*3+channel];
}
}