Warning: session_start(): open(/var/lib/php/sessions/sess_2m613ghk4c0osqml6dvj4idr03, 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 ImageSurface showImageWithSelections(MakesBufferedImage img, final L rects) {
ret showImageWithSelections(img.getBufferedImage(), rects);
}
static ImageSurface showImageWithSelections(S title, BufferedImage img, L rects) {
ret frameTitle(title, showImageWithSelections(img, rects));
}
static ImageSurface showImageWithSelections(BufferedImage img, final L rects) {
ret showImageWithSelections(img, null, rects);
}
// for callers to use
static Var showImageWithSelections_highlighted;
static ImageSurface showImageWithSelections(BufferedImage img, ImageSurface _is, final L _rects) {
final ImageSurface is = showImage(img, _is);
final L rects = sortRectsBySize(_rects);
final new Var highlighted;
showImageWithSelections_highlighted = highlighted;
is.overlay = voidfunc(Graphics2D g) {
for (Rect r : rects)
is.drawSelectionRect(g, r.getRectangle(), Color.blue, Color.white);
if (highlighted.has())
fillRect(g, scaleRect(highlighted!, is.getZoomX(), is.getZoomY()), new Color(0, 0, 0, 0x30)); // semi-transparent black
};
imageSurfaceOnMouseMove(is, voidfunc(Pt p) {
repaintIf(is, setVarIfNeq(highlighted, smallestRectContaining(rects, p)));
});
is.repaint();
ret is;
}