Package ca.eandb.jmist.framework.path

Examples of ca.eandb.jmist.framework.path.Path


      }
    }

    if (newLightTail == null || newEyeTail == null
        || PathUtil.visibility(newLightTail, newEyeTail)) {
      return new Path(newLightTail, newEyeTail);
    }

    return null;

  }
View Full Code Here


  private double[] getAllUnweightedContributions(Path x) {
    int k = x.getLength();
    double[] c = new double[k + 2];

    for (int s = -1, t = k; s <= k; s++, t--) {
      Path y = x.slice(s, t);
      if (y != null) {
        Color color = importance.evaluate(y.getLightTail(), y.getEyeTail());
        c[s + 1] = color != null ? color.luminance() : 0.0; // FIXME use a ColorMeasure
      }
    }

    return c;
View Full Code Here

      Light light      = scene.getLight();
      PathNode lightTail  = strategy.traceLightPath(
                    light, pi, seq);
      seq.mark();

      return new Path(lightTail, eyeTail);
    }
View Full Code Here

      seq.mark();

      PathNode lightTail  = path.getLightTail();
      seq.mark();

      return new Path(lightTail, eyeTail);
    }
View Full Code Here

      Light light      = scene.getLight();
      PathNode lightTail  = strategy.traceLightPath(
                    light, pi, seq);
      seq.mark();

      return new Path(lightTail, eyeTail);
    }
View Full Code Here

      int    mutations      = (Integer) task;
      int    numPixels      = width * height;
      double  mutationsPerPixel  = (double) mutations / (double) numPixels;
      double  lightImageWeight  = 1.0 / mutationsPerPixel;
      Path  x          = null;
      double  fy;
      double  fx = 0.0;
      List<Contribution> cx    = new ArrayList<Contribution>();
      List<Contribution> cy    = new ArrayList<Contribution>();
      boolean accept;

      initialize();
      raster.get().clear();

      mutations += initialMutations;
      for (int i = 0; i < mutations; i++) {
        if (!monitor.notifyProgress(i, mutations))
          return null;

        cy.clear();

        Path y = (x != null) ? mutate(x) : generateNewPath();

        Color score      = join(y.getLightTail(), y.getEyeTail(),
                      lightImageWeight, cy);
        if (score != null) {
          Point2 p = y.getPointOnImagePlane();
          cy.add(new Contribution(p, score));
        }

        fy = evaluate(cy);

View Full Code Here

      lightTail = lightTail.getParent();
    }
    if (eyeTail != null && eyeTail.getDepth() > 0 && eyeTail.isAtInfinity()) {
      eyeTail = eyeTail.getParent();
    }
    return new Path(lightTail, eyeTail);
  }
View Full Code Here

    return new Path(lightTail, eyeTail);
  }


  private final Path generatePath(PathSeed seed) {
    Path path = generatePath(seed.randomSeed);
    return path.slice(seed.lightPathLength, seed.eyePathLength);
  }
View Full Code Here

  private final void testGeneratePath() {
    java.util.Random rnd = new java.util.Random();

    for (int i = 0; i < 1000; i++) {
      long seed = rnd.nextLong();
      Path x = generatePath(seed);
      for (int j = 0; j < 100; j++) {
        Path y = generatePath(seed);
        if (x.getLength() != y.getLength() || x.getEyePathLength() != y.getEyePathLength()) {
          System.out.println("FAIL");
          return;
        }
      }
    }
View Full Code Here

            return null;
          }
          nextCallback = callbackInterval;
        }

        Path path = generatePath(randomSeed++);

        /* store information about the path so we don't have to
         * regenerate it during the resampling phase.
         */
        if (path.getLightPathLength() > Short.MAX_VALUE) {
          throw new UnexpectedException("Light subpath too long.");
        }
        if (path.getEyePathLength() > Short.MAX_VALUE) {
          throw new UnexpectedException("Eye subpath too long.");
        }
        lightPathLength[i] = (short) path.getLightPathLength();
        eyePathLength[i] = (short) path.getEyePathLength();

        join(path.getLightTail(), path.getEyeTail(), weight);
      }

      monitor.notifyStatusChanged("Resampling MLT seeds");

      double totalWeight = MathUtil.sum(weight);
View Full Code Here

TOP

Related Classes of ca.eandb.jmist.framework.path.Path

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.