srecord noeq G22VisualizeMeshes(WidthAndHeight originalImage, L meshes) { // anchorAlpha overrides alpha in anchorColor settable Color anchorColor = Color.red; settable double anchorAlpha = 0.5; settable int anchorSize = 5; // can also include alpha settable Color curveColor = Color.blue; BufferedImage get() { var markedImage = whiteImage(imageSize(originalImage)); drawOn(createGraphics(markedImage)); ret markedImage; } void drawOn(Graphics2D g) { for (mesh : meshes) for (curve : mesh.curves()) drawPixels(g, curve.path().pointIterator(), curveColor); for (mesh : meshes) markPointsInImageWithAlpha(g, mesh.anchorPts(), anchorColor, anchorAlpha, anchorSize); } }