Package ca.eandb.jmist.framework

Examples of ca.eandb.jmist.framework.Raster


   * @see ca.eandb.jmist.framework.ParallelizableJob#submitTaskResults(java.lang.Object, java.lang.Object, ca.eandb.util.progress.ProgressMonitor)
   */
  public void submitTaskResults(Object task, Object results, ProgressMonitor monitor) {

    Cell  cell  = (Cell) task;
    Raster  pixels  = (Raster) results;

    /* Write the submitted results to the raster. */
    display.setPixels(cell.x, cell.y, pixels);

    /* Update the progress monitor. */
 
View Full Code Here


      Color  pixel;
      Box2  bounds;
      double  x0, y0, x1, y1;
      double  w          = width;
      double  h          = height;
      Raster  raster        = colorModel.createRaster(cell.width, cell.height);

      for (int n = 0, y = cell.y; y < cell.y + cell.height; y++) {

        if (!monitor.notifyProgress(n, numPixels))
          return null;

        y0      = (double) y / h;
        y1      = (double) (y + 1) / h;

        for (int x = cell.x; x < cell.x + cell.width; x++, n++) {

          x0    = (double) x / w;
          x1    = (double) (x + 1) / w;

          bounds  = new Box2(x0, y0, x1, y1);

          pixel = pixelShader.shadePixel(bounds);
          raster.addPixel(x - cell.x, y - cell.y, pixel);

        }

      }
View Full Code Here

   */
  public synchronized void submitTaskResults(Object task, Object results,
      ProgressMonitor monitor) throws Exception {

    int taskMutations = (Integer) task;
    Raster taskRaster = (Raster) results;

    monitor.notifyStatusChanged("Accumulating partial results...");

    mutationsSubmitted += taskMutations;
    if (displayPartialResults) {
      double alpha = (double) taskMutations / (double) mutationsSubmitted;
      for (int y = 0; y < height; y++) {
        for (int x = 0; x < width; x++) {
          raster.setPixel(x, y, raster.getPixel(x, y).times(
              1.0 - alpha).plus(
              taskRaster.getPixel(x, y).times(alpha)));
        }
      }
      display.setPixels(0, 0, raster);
    } else {
      for (int y = 0; y < height; y++) {
        for (int x = 0; x < width; x++) {
          raster.setPixel(x, y, raster.getPixel(x, y).plus(taskRaster.getPixel(x, y)));
        }
      }
    }

    monitor.notifyProgress(++tasksSubmitted, tasks);
View Full Code Here

   */
  public synchronized void submitTaskResults(Object task, Object results,
      ProgressMonitor monitor) throws Exception {

    int taskPasses = (Integer) task;
    Raster taskRaster = (Raster) results;

    monitor.notifyStatusChanged("Accumulating partial results...");

    passesSubmitted += taskPasses;
    if (displayPartialResults) {
      double alpha = (double) taskPasses / (double) passesSubmitted;
      for (int y = 0; y < height; y++) {
        for (int x = 0; x < width; x++) {
          raster.setPixel(x, y, raster.getPixel(x, y).times(
              1.0 - alpha).plus(
              taskRaster.getPixel(x, y).times(alpha)));
        }
      }
      display.setPixels(0, 0, raster);
    } else {
      for (int y = 0; y < height; y++) {
        for (int x = 0; x < width; x++) {
          raster.setPixel(x, y, raster.getPixel(x, y).plus(taskRaster.getPixel(x, y)));
        }
      }
    }

    writeContribList();
View Full Code Here

TOP

Related Classes of ca.eandb.jmist.framework.Raster

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.