Warning: session_start(): open(/var/lib/php/sessions/sess_vrfvvjs5ln8os633t2eqel9fu8, 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 int bwContrastQuadtree_minOfArea(BWContrastQuadTree qt, int originalSize, Rect rect) {
ret bwContrastQuadtree_minOfArea(qt, Rect(0, 0, originalSize, originalSize), rect);
}
static int bwContrastQuadtree_minOfArea(BWContrastQuadTree qt, Rect block, Rect rect) {
Rect r2 = intersectRects(rect, block);
if (r2.empty()) ret 255; // simple case 1: no intersection
//print(rect + " => " + r2);
// simple case 2: whole block
if (eq(r2, block)) ret ubyteToInt(qt.min);
// simple case 3: block is one color
if (!(qt instanceof BWContrastQuadTree.Composite))
ret ubyteToInt(qt.min);
// complex case: process subregions
BWContrastQuadTree.Composite qt2 = cast qt;
int w = block.w, r = w/2;
ret intMin(
bwContrastQuadtree_minOfArea(qt2.a, Rect(block.x, block.y, r, r), r2),
bwContrastQuadtree_minOfArea(qt2.b, Rect(block.x+r, block.y, r, r), r2),
bwContrastQuadtree_minOfArea(qt2.c, Rect(block.x, block.y+r, r, r), r2),
bwContrastQuadtree_minOfArea(qt2.d, Rect(block.x+r, block.y+r, r, r), r2));
}