Warning: session_start(): open(/var/lib/php/sessions/sess_u0f2bces24p5gjbrk3p3mkergh, 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
// result image is as large as the region's bounds
// with black pixels inside and white pixels outside the region
srecord noeq RegionToBWImage(IImageRegion region) {
settable Rect bounds;
BWImage image;
settable int color = 0xFF;
run {
bounds if null = region.bounds();
int x1 = bounds.x, y1 = bounds.y, w = bounds.w, h = bounds.h, i = 0;
byte[] pixels = new[w*h];
for y to h:
for x to w: {
if (region.contains(x1+x, y1+y))
pixels[i++] = (byte) color;
i++;
}
image = new BWImage(w, h, pixels);
}
BWImage get() {
if (image == null) run();
ret image;
}
}