Package ar

Examples of ar.Renderer.aggregate()


    Aggregator<Object,Integer> aggregator = new Numbers.Count<Object>();
    Selector<Point2D> selector = TouchesPixel.make(dataset);


    AffineTransform vt = Util.zoomFit(dataset.bounds(), width, height);
    Aggregates<Integer> aggregates = r.aggregate(dataset, selector, aggregator, vt, width, height);

   
    Map<String, Transfer<Integer,Integer>> allCarvers = new HashMap<String, Transfer<Integer,Integer>>() {{
        put("incremental", new SeamCarving.CarveIncremental<>(new SeamCarving.LeftValue<Integer>(), Direction.V, 0,seams));
        put("sweep", new SeamCarving.CarveSweep<>(new SeamCarving.LeftValue<Integer>(), Direction.V, 0, seams));
View Full Code Here


    System.out.println("State shapes loaded.");

    final AffineTransform viewTransform = Util.zoomFit(populationSource.bounds().createUnion(states.bounds()), viewBounds.width, viewBounds.height);

   
    final Aggregates<Integer> population = renderer.aggregate(populationSource, TouchesPixel.make(populationSource), new Numbers.Count<>(), viewTransform, viewBounds.width, viewBounds.height);
    final Aggregates<String> labels = renderer.aggregate(states, TouchesPixel.make(states), new General.Last<>(""), viewTransform, viewBounds.width, viewBounds.height);
    Aggregates<Pair<String,Integer>> pairs = CompositeWrapper.wrap(labels, population);
    System.out.println("Base aggregates created.\n");
   
   
View Full Code Here

    final AffineTransform viewTransform = Util.zoomFit(populationSource.bounds().createUnion(states.bounds()), viewBounds.width, viewBounds.height);

   
    final Aggregates<Integer> population = renderer.aggregate(populationSource, TouchesPixel.make(populationSource), new Numbers.Count<>(), viewTransform, viewBounds.width, viewBounds.height);
    final Aggregates<String> labels = renderer.aggregate(states, TouchesPixel.make(states), new General.Last<>(""), viewTransform, viewBounds.width, viewBounds.height);
    Aggregates<Pair<String,Integer>> pairs = CompositeWrapper.wrap(labels, population);
    System.out.println("Base aggregates created.\n");
   
   
    int step=100;
View Full Code Here

   
    final int width = 800;
    final int height = 800;
    AffineTransform vt = Util.zoomFit(dataset.bounds(), width, height);
    Aggregates<Integer> counts = r.aggregate(dataset, selector, aggregator, vt, width, height);
   
    //final ISOContours.Single.Specialized<Integer> contour = new ISOContours.Single.Specialized<>(5, true, counts);
    //final ISOContours.NContours.Specialized<Integer> contour = new ISOContours.NContours.Specialized<>(5, true, counts);
    //final ISOContours.SpacedContours.Specialized<Integer> contour = new ISOContours.SpacedContours.Specialized<>(0, 100, true, counts);
   
View Full Code Here

    }
   
    try {
      for (int i=0; i<iterations; i++) {
        long start = System.currentTimeMillis();
        Aggregates<Integer> aggs = render.aggregate(glyphs, s, aggregator, vt, width, height);
        long end = System.currentTimeMillis();
        long aggTime = end-start;

        start = System.currentTimeMillis();
        Transfer.Specialized<Number,Color> ts = transfer.specialize(aggs);
View Full Code Here

  @BeforeClass
  public static void load() throws Exception {
    Glyphset<Rectangle2D, Object> glyphs = GlyphsetUtils.autoLoad(new File("../data/circlepoints.csv"), .1, DynamicQuadTree.<Rectangle2D, Object>make());
    Selector<Rectangle2D> selector = TouchesPixel.make(glyphs);
    Renderer r = new ParallelRenderer();
    count = r.aggregate(glyphs, selector, new Numbers.Count<>(), Util.zoomFit(glyphs.bounds(), 10, 10), 10,10);
  }
 
  @Test
  public void startStop() throws Exception{
    ARCombiner<Integer> c = new ARCombiner<Integer>("localhost", 8739, new ar.ext.avro.Converters.ToCount(), new Numbers.Count<>());
View Full Code Here

   */
  @SuppressWarnings({ "rawtypes", "unchecked" })
  public Aggregates<?> execute(Glyphset<?,?> glyphs, Aggregator agg, List<Transfer<?,?>> transfers, AffineTransform view, int width, int height) {
    Renderer r = new ParallelRenderer();
    Selector s = TouchesPixel.make(glyphs);
    Aggregates aggs = r.aggregate(glyphs, s, agg, view, width, height);

    Transfer transfer;
    if (transfers.size() >= 2) {
      Seq t = new Seq(transfers.get(0), transfers.get(1));
      for (int i=2; i< transfers.size(); i++) {t.then(transfers.get(i));}
View Full Code Here

        0.0,
        241.4615556310524,
        238.49100176586487,
        236.13546883394775);
    Selector<Rectangle2D> s = TouchesPixel.make(glyphs);
    count = r.aggregate(glyphs, s, new Numbers.Count<Object>(), vt, 500,500);
    cocs = r.aggregate(glyphs, s, new Categories.CountCategories<Color>(Util.COLOR_SORTER), vt, 500,500);
  }
 
  @Test
  public void inOrderEqOutOrder() throws Exception {
View Full Code Here

        241.4615556310524,
        238.49100176586487,
        236.13546883394775);
    Selector<Rectangle2D> s = TouchesPixel.make(glyphs);
    count = r.aggregate(glyphs, s, new Numbers.Count<Object>(), vt, 500,500);
    cocs = r.aggregate(glyphs, s, new Categories.CountCategories<Color>(Util.COLOR_SORTER), vt, 500,500);
  }
 
  @Test
  public void inOrderEqOutOrder() throws Exception {
    Aggregates<Integer> ref = new RefFlatAggregates<Integer>(2,2,-1);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.