Tabnine Logo
PApplet.millis
Code IndexAdd Tabnine to your IDE (free)

How to use
millis
method
in
processing.core.PApplet

Best Java code snippets using processing.core.PApplet.millis (Showing top 18 results out of 315)

origin: mirador/mirador

public long millis() {
 return intf.app.millis();
}

origin: poqudrof/PapARt

public void forceUpdate(Camera camera, int time) {
  int id = getId(camera);
  nextTimeEvent.set(id, applet.millis() + time);
  updateStatus.set(id, FORCE_UPDATE);
}
origin: poqudrof/PapARt

public void blockUpdate(Camera camera, int time) {
  int id = getId(camera);
  nextTimeEvent.set(id, applet.millis() + time);
  updateStatus.set(id, BLOCK_UPDATE);
}
origin: poqudrof/PapARt

public synchronized void updateLocation(Camera camera, IplImage img, Object globalTracking) {
  int id = getId(camera);
  if (id == -1) {
    throw new RuntimeException("The board " + this.fileName + " is"
        + " not registered with the camera you asked");
  }
  int currentTime = applet.millis();
  int endTime = nextTimeEvent.get(id);
  int mode = updateStatus.get(id);
  // If the update is still blocked
  if (mode == BLOCK_UPDATE && currentTime < endTime) {
    return;
  }
  updatePositionImpl(id, currentTime, endTime, mode, camera, img, globalTracking);
}
origin: cansik/processing-postfx

@Override
public void prepare(Supervisor supervisor) {
  shader.set("time", sketch.millis() / 1000f);
  shader.set("amount", amount);
  shader.set("speed", speed);
}
origin: mirador/mirador

public void draw(float x, float y) {
 String visible = text.substring(pos0, text.length());
 parent.text(visible, x, y);
 
 if (focused) {
  // Draw blinking cursor.
  int t = parent.intf.app.millis();
  if (500 < t - lastCursorChange) {
   if (cursorStatus == CURSOR_VISIBLE) {
    cursorStatus = CURSOR_HIDDEN;
   } else {
    cursorStatus = CURSOR_VISIBLE;
   }
   lastCursorChange = t;
  }
  
  if (cursorStatus == CURSOR_VISIBLE) {
   int curPos = pos - pos0;
   String substr = visible.substring(0, curPos);
   float len = parent.textWidth(substr);    
   parent.line(x + len, y, x + len, y - parent.fontSize());
  }        
 }     
}

origin: mirador/mirador

public void setFocused(boolean focus) {
 if (focus != focused) {
  boolean focused0 = focused;
  focused = focus;
  if (focused) {
   cursorStatus = CURSOR_VISIBLE;
   lastCursorChange = parent.intf.app.millis();
   if (!focused0 && clearInitial && getImpl(false).equals(text0)) {
    set("");
   }
  } else if (resetInitial) {
   String last = getImpl(false);
   if (last.equals("")) {
    set(text0);
    modified = false;
   }
  }
 }
}

origin: poqudrof/PapARt

lastPos.set(id, currentPos);
updateStatus.set(id, FORCE_UPDATE);
nextTimeEvent.set(id, applet.millis() + MarkerBoard.updateTime);
origin: poqudrof/PapARt

nextTimeEvent.set(id, applet.millis() + MarkerBoard.updateTime);
origin: poqudrof/PapARt

private TrackedDepthPoint createTouchPointFrom(TuioObject tObj) {
  TrackedDepthPoint tp = new TrackedDepthPoint();
  tp.setCreationTime(parent.millis());
  tp.forceID(tObj.getSymbolID());
  return tp;
}
origin: poqudrof/PapARt

protected void findAndTrack2D() {
  assert (touch2DPrecision != 0);
  ArrayList<TrackedDepthPoint> newList = simpleDetection.compute(
      depthAnalysis.getDepthData());
  TouchPointTracker.trackPoints(simpleDetection.getTouchPoints(), newList,
      parent.millis());
}
origin: poqudrof/PapARt

protected void findAndTrack3D() {
  assert (touch3DPrecision != 0);
  ArrayList<TrackedDepthPoint> newList = armDetection.compute(
      depthAnalysis.getDepthData());
  TouchPointTracker.trackPoints(armDetection.getTouchPoints(),
      newList,
      parent.millis());
}
origin: poqudrof/PapARt

private TrackedDepthPoint createTouchPointFrom(TuioCursor tcur) {
  TrackedDepthPoint tp = new TrackedDepthPoint();
  tp.setCreationTime(parent.millis());
  tp.forceID(tcur.getCursorID());
  return tp;
}
origin: poqudrof/PapARt

/**
 * Update the current Image, from the specific grabber, lens distorsions are
 * handled here.
 *
 * @param img
 */
protected void updateCurrentImage(IplImage img) {
  
  this.timeStamp = parent.millis();
  
  if (undistort) {
    if (pdp == null || !pdp.handleDistorsions()) {
      System.err.println("I cannot distort the image for processing. The "
          + "calibration did not contain information. ");
      return;
    }
    if (copyUndist == null) {
      copyUndist = img.clone();
    }
    // Workaround for crash when the java program is closing
    // to avoid native code to continue to run...
    if (isClosing()) {
      return;
    }
    pdp.getDevice().undistort(img, copyUndist);
    currentImage = copyUndist;
  } else {
    currentImage = img;
  }
}
origin: poqudrof/PapARt

lastPos.set(id, currentPos);
updateStatus.set(id, FORCE_UPDATE);
nextTimeEvent.set(id, applet.millis() + MarkerBoard.updateTime);
origin: poqudrof/PapARt

public static void sin(PApplet parent, PGraphics g, int amt, float freq, int xDiff, float size) {
  float v = (PApplet.sin((float) (parent.millis()) / 1000f * PConstants.TWO_PI * freq) + 1f) / 2f;
  g.noStroke();
  g.ellipseMode(CENTER);
  g.fill(v * amt);
  g.ellipse(-xDiff, 0, size, size);
  g.ellipse(0, 0, size, size);
  g.ellipse(xDiff, 0, size, size);
}
origin: poqudrof/PapARt

/**
 * Simple visualization
 *
 * @param depth
 * @param color
 * @param skip
 * @return
 */
public PImage update(IplImage depth, IplImage color, int skip) {
  updateRawDepth(depth);
  if (color != null) {
    updateRawColor(color);
  }
  depthData.clear();
  depthData.timeStamp = papplet.millis();
  validPointsPImage.loadPixels();
  // set a default color. 
  Arrays.fill(validPointsPImage.pixels, papplet.color(0, 0, 0));
  // TODO: get the color with Kinect2... 
  if (this.colorCamera.getPixelFormat() == Camera.PixelFormat.RGB) {
    computeDepthAndDo(skip, new SetImageDataRGB());
  }
  if (this.colorCamera.getPixelFormat() == Camera.PixelFormat.BGR) {
    computeDepthAndDo(skip, new SetImageData());
  }
  validPointsPImage.updatePixels();
  return validPointsPImage;
}
origin: poqudrof/PapARt

  public void computeDepthAndNormals(opencv_core.IplImage depth, opencv_core.IplImage color, int skip2D) {
    updateRawDepth(depth);
    // optimisation no Color. 
    if (color != null) {
      updateRawColor(color);
    }
    depthData.clear();
    depthData.timeStamp = papplet.millis();

    depthData.connexity.setPrecision(skip2D);

    computeDepthAndDo(skip2D, new ComputeNormal());

    if (this.colorCamera.getPixelFormat() == Camera.PixelFormat.GRAY) {
      doForEachPoint(skip2D, new SetImageDataGRAY());
    }
    if (this.colorCamera.getPixelFormat() == Camera.PixelFormat.RGB) {
      doForEachPoint(skip2D, new SetImageDataRGB());
    }
    if (this.colorCamera.getPixelFormat() == Camera.PixelFormat.BGR) {
      doForEachPoint(skip2D, new SetImageData());
    }
//        doForEachPoint(skip2D, new ComputeNormal());
  }

processing.corePAppletmillis

Javadoc

Get the number of milliseconds since the applet started.

This is a function, rather than a variable, because it may change multiple times per frame.

Popular methods of PApplet

  • constrain
  • createGraphics
    Create an offscreen graphics surface for drawing, in this case for a renderer that writes to a file
  • loadStrings
    ( begin auto-generated from loadStrings.xml ) Reads the contents of a file or url and creates a Stri
  • saveStrings
    ( begin auto-generated from saveStrings.xml ) Writes an array of strings to a file, one line per str
  • abs
  • createImage
    ( begin auto-generated from createImage.xml ) Creates a new PImage (the datatype for storing images)
  • createShape
  • createWriter
    ( begin auto-generated from createWriter.xml ) Creates a new file in the sketch folder, and a PrintW
  • loadImage
  • main
    main() method for running this class from the command line. Usage: PApplet [options] [s
  • max
  • parseInt
  • max,
  • parseInt,
  • random,
  • round,
  • split,
  • sqrt,
  • unhex,
  • arrayCopy,
  • ceil,
  • checkExtension

Popular in Java

  • Making http requests using okhttp
  • setContentView (Activity)
  • getSharedPreferences (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now