Search in sources :

Example 6 with ImageFeatures

use of org.twak.tweed.gen.FeatureCache.ImageFeatures in project chordatlas by twak.

the class MiniStandalone2d method renderAll.

private void renderAll(MegaFeatures mf, String out) {
    System.out.println("processing " + mf + " into " + out);
    int c = 0;
    for (ImageFeatures i : mf.features) for (MiniFacade m : i.miniFacades) {
        if (m.width < 3 || m.height < 3)
            continue;
        BufferedImage bi = m.render(40, Feature.DOOR, Feature.WINDOW);
        BufferedImage bi2 = m.render(40);
        File outF = new File(out).getParentFile();
        outF.mkdirs();
        try {
            ImageIO.write(bi, "jpg", new File(out + "_" + c + "_im.jpg"));
            ImageIO.write(bi2, "jpg", new File(out + "_" + c + "_ft.jpg"));
        } catch (IOException e) {
            e.printStackTrace();
        }
        c++;
    }
}
Also used : ImageFeatures(org.twak.tweed.gen.FeatureCache.ImageFeatures) IOException(java.io.IOException) File(java.io.File) BufferedImage(java.awt.image.BufferedImage)

Aggregations

ImageFeatures (org.twak.tweed.gen.FeatureCache.ImageFeatures)6 MegaFeatures (org.twak.tweed.gen.FeatureCache.MegaFeatures)5 File (java.io.File)4 ArrayList (java.util.ArrayList)3 Point2d (javax.vecmath.Point2d)3 Vector2d (javax.vecmath.Vector2d)3 DRectangle (org.twak.utils.geom.DRectangle)3 Collections (java.util.Collections)2 Comparator (java.util.Comparator)2 HashMap (java.util.HashMap)2 HashSet (java.util.HashSet)2 Iterator (java.util.Iterator)2 LinkedHashSet (java.util.LinkedHashSet)2 List (java.util.List)2 Map (java.util.Map)2 OptionalDouble (java.util.OptionalDouble)2 Set (java.util.Set)2 TreeSet (java.util.TreeSet)2 Collectors (java.util.stream.Collectors)2 Cache2 (org.twak.utils.Cache2)2