Package ar

Examples of ar.Transfer


  }
 
  public static final class DataEdgeBoost extends OptionTransfer<DataEdgeBoost.Controls> {
    @Override public Transfer<Number, Color> transfer(Controls p, Transfer subsequent) {
      Transfer t = new Seq(
          new Advise.DataEdgeBoost(p.radius()),
          new Numbers.Interpolate<>(p.lowColor(), p.highColor(), p.highColor()));
      if (subsequent == null) {
        return t;
View Full Code Here


 
 

  public static final class SubPixel extends OptionTransfer<SubPixel.Controls> {
    @Override public Transfer<Number, Color> transfer(Controls p, Transfer subsequent) {
      Transfer t = new Seq(
          new Advise.NeighborhoodDistribution(p.radius()),
          new Numbers.Interpolate<>(p.lowColor(), p.highColor(), Util.CLEAR));
      if (subsequent == null) {
        return t;
View Full Code Here

//  }
 
  public static final class Present2 extends OptionTransfer<ControlPanel> {
    @Override
    public Transfer<Integer,Integer> transfer(ControlPanel p, Transfer subsequent) {
      Transfer t = new General.Present<Integer, Integer>(0,1);
      return extend(t, subsequent)

    }
View Full Code Here

  }
 
  public static final class Present extends OptionTransfer<ControlPanel> {
    @Override
    public Transfer<Integer,Color> transfer(ControlPanel p, Transfer subsequent) {
      Transfer t = new General.Present<Integer, Color>(Color.red, Color.white);
      return extend(t, subsequent);
    }
View Full Code Here

    @Override public ControlPanel control(HasViewTransform transformProvider) {return new ControlPanel();}
  }
 
  public static final class Gradient extends OptionTransfer<ControlPanel> {
    @Override public Transfer<Object, Color> transfer(ControlPanel p, Transfer subsequent) {
      Transfer t = new Debug.Gradient();
      return extend(t, subsequent)
    }
View Full Code Here

    }

   
    Aggregator aggregator = source.defaultAggregator.aggregator();
    Glyphset glyphs = source.glyphset;
    Transfer transfer = OptionTransfer.toTransfer(source.defaultTransfers, null);
 
   
    Renderer render;
    if (rend.startsWith("PARALLEL")) {
      render = new ParallelRenderer();
    } else if (rend.startsWith("SERIAL")) {
      render = new SerialRenderer();
    } else {
      throw new IllegalArgumentException("Renderer type not known: " + rend);
    }
   
    AffineTransform vt = Util.zoomFit(glyphs.bounds(), width, height);
    Selector s = TouchesPixel.make(glyphs);
    long taskCount = cores * tasksPerThread;
   
    if (header) {
      System.out.println("source, elapse/avg agg, elapse/avg trans, iter num, width, height, renderer, cores, tasks (max)");
    }
   
    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);
        Aggregates<Color> colors = render.transfer(aggs, ts);
        end = System.currentTimeMillis();
        long transTime = end-start;

        aggs.get(0, 0);
View Full Code Here

    GlyphsetRDD<G, I> glyphs = new GlyphsetRDD<>(base.map(glypher), true, partition);
    AffineTransform view = Util.zoomFit(glyphs.bounds(), width, height);
     Selector selector = TouchesPixel.make(glyphs.exemplar().shape().getClass());

    Aggregator<I, A> aggregator = (Aggregator<I, A>) dataset.defaultAggregator.aggregator();
    Transfer transfer = OptionTransfer.toTransfer(((OptionDataset) dataset).defaultTransfers, null);
   
     RDDRender render = new RDDRender();

     Aggregates<A> aggs = render.aggregate(glyphs, selector, aggregator, view, width, height);
    
View Full Code Here

  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));}
      transfer = t;
    } else {
      transfer = transfers.get(0);
    }
   
    Transfer.Specialized ts = transfer.specialize(aggs);
    Aggregates<?> rslt = r.transfer(aggs, ts);
    return rslt;
  }
View Full Code Here

 
  public static final class Percent extends OptionTransfer<Percent.Controls> {
    @Override
    public Transfer<CategoricalCounts<Color>,Color> transfer(Controls p, Transfer subsequent) {
      int percent = (int) p.spinner.getValue();
      Transfer t = new Categories.KeyPercent<Color>(
          percent/100d,
          Color.blue,
          Color.white,
          p.aboveColor.color(),
          p.belowColor.color());
View Full Code Here

    static final SeamCarving.Delta<Integer> delta = new SeamCarving.DeltaInteger()//TODO: Generalize to auto-detect type...on specialization perhaps?  Similar to FlexSpread..

    @Override
    public Transfer<?, ?> transfer(Controls params, Transfer subsequent) {
     
      Transfer vt=null, ht=null;
      if (params.columns() >0) {vt = params.colCarver();}

      if (params.rows() >0) {ht = params.rowCarver();}
     
      //TODO: There are probably smarter things to do than just horizontal followed by vertical...
      if (vt == null && ht == null) {return subsequent;}
      if (vt == null && ht != null) {return extend(ht,subsequent);}
      if (vt != null && ht == null) {return extend(vt,subsequent);}
      Transfer t = extend(vt, subsequent);
      t = extend(ht, t);
      return t;
    }
View Full Code Here

TOP

Related Classes of ar.Transfer

Copyright © 2018 www.massapicom. 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.