Package java.nio

Examples of java.nio.ShortBuffer.rewind()


    ByteBuffer buf = ByteBuffer.wrap(rawSamples);
    ShortBuffer shortBuf = buf.asShortBuffer();

    while (!terminated) {  // Note: sourceDataLine.write seems to clear the interrupted flag, and so Thread.interrupted() doesn't work here.
      PdBase.process(ticks, dummy, samples);
      shortBuf.rewind();
      shortBuf.put(samples);
      sourceDataLine.write(rawSamples, 0, rawSamples.length);
    }

    // Shutdown.
View Full Code Here


            SceneMetaData sceneMD = userGen.getUserPixels(0);

            ShortBuffer scene = sceneMD.getData().createShortBuffer();
            ShortBuffer depth = depthMD.getData().createShortBuffer();
            calcHist(depth);
            depth.rewind();
           
            while(depth.remaining() > 0)
            {
                int pos = depth.position();
                short pixel = depth.get();
View Full Code Here

            context.waitAnyUpdateAll();
           
            ShortBuffer depth = depthMD.getData().createShortBuffer();
            calcHist(depth);
            depth.rewind();
           
            while(depth.remaining() > 0)
            {
                int pos = depth.position();
                short pixel = depth.get();
View Full Code Here

        // reset
        for (int i = 0; i < histogram.length; ++i)
            histogram[i] = 0;
       
        ShortBuffer depth = depthMD.getData().createShortBuffer();
        depth.rewind();

        int points = 0;
        while(depth.remaining() > 0)
        {
            short depthVal = depth.get();
View Full Code Here

            context.waitAnyUpdateAll();
           
            calcHist(depthMD);
            ShortBuffer depth = depthMD.getData().createShortBuffer();
            depth.rewind();
           
            while(depth.remaining() > 0)
            {
                int pos = depth.position();
                short pixel = depth.get();
View Full Code Here

  private float[] calcHist() {

    float histogram[] = new float[xRes * yRes];
    for (int i = 0; i < histogram.length; ++i) histogram[i] = 0;
    ShortBuffer depth = depthMD.getData().createShortBuffer();
    depth.rewind();

    int points = 0;
    while (depth.remaining() > 0) {
      short depthVal = depth.get();
      if (depthVal != 0) {
View Full Code Here

    try {

      context.waitAnyUpdateAll();
      float[] histogram = calcHist();
      ShortBuffer depth = depthMD.getData().createShortBuffer();
      depth.rewind();

      while (depth.remaining() > 0) {
        int pos = depth.position();
        short pixel = depth.get();
        imgbytes[pos] = (byte) histogram[pixel];
View Full Code Here

        // Load the indices data into the NIO buffer
        final ShortBuffer indices =
                ByteBuffer.allocateDirect(_indicesSize).asShortBuffer();
        indices.put(INDICES);
        indices.rewind();

        _buffers = new int[2];

        // Generate 2 buffer object names
        gl.glGenBuffers(2, _buffers, 0);
View Full Code Here

        vertices.rewind();
        final ShortBuffer indices =
                ByteBuffer.allocateDirect(_indicesSize).asShortBuffer();
        indices.put(_indices);
        indices.rewind();

        _buffers = new int[2];

        final GL11 gl = (GL11) g;
        gl.glGenBuffers(2, _buffers, 0);
View Full Code Here

        // Load the indices data into the NIO buffer
        final ShortBuffer indices =
                ByteBuffer.allocateDirect(_indicesSize).asShortBuffer();
        indices.put(INDICES);
        indices.rewind();

        _buffers = new int[2];

        // Generate 2 buffer object names
        gl.glGenBuffers(2, _buffers, 0);
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.