Examples of asFloatBuffer()


Examples of java.nio.ByteBuffer.asFloatBuffer()

                result = array;
                break;
            }
            case VariableInfo.FLOAT: {
                final float[] array = new float[length];
                buffer.asFloatBuffer().get(array);
                result = array;
                break;
            }
            case VariableInfo.DOUBLE: {
                final double[] array = new double[length];
View Full Code Here

Examples of java.nio.ByteBuffer.asFloatBuffer()

          ByteArrayInputStream bis = new ByteArrayInputStream(buf.array());
          return bis;
        } else if (type.getName().equals(CAS.TYPE_NAME_FLOAT_ARRAY)) {
          arrayStart = getArrayStartAddress(fs.getAddress());
          buf = ByteBuffer.allocate(arraySize * 4);
          FloatBuffer floatbuf = buf.asFloatBuffer();
          float[] floatArray = new float[arraySize];
          for (int i = arrayStart; i < arrayStart + arraySize; i++) {
            floatArray[i - arrayStart] = Float.intBitsToFloat(this.getHeap().heap[i]);
          }
          floatbuf.put(floatArray);
View Full Code Here

Examples of java.nio.ByteBuffer.asFloatBuffer()

          ByteArrayInputStream bis = new ByteArrayInputStream(buf.array());
          return bis;
        } else if (type.getName().equals(CAS.TYPE_NAME_FLOAT_ARRAY)) {
          arrayStart = getArrayStartAddress(fs.getAddress());
          buf = ByteBuffer.allocate(arraySize * 4);
          FloatBuffer floatbuf = buf.asFloatBuffer();
          float[] floatArray = new float[arraySize];
          for (int i = arrayStart; i < arrayStart + arraySize; i++) {
            floatArray[i - arrayStart] = Float.intBitsToFloat(this.getHeap().heap[i]);
          }
          floatbuf.put(floatArray);
View Full Code Here

Examples of java.nio.ByteBuffer.asFloatBuffer()

          ByteArrayInputStream bis = new ByteArrayInputStream(buf.array());
          return bis;
        } else if (type.getName().equals(CAS.TYPE_NAME_FLOAT_ARRAY)) {
          arrayStart = getArrayStartAddress(fs.getAddress());
          buf = ByteBuffer.allocate(arraySize * 4);
          FloatBuffer floatbuf = buf.asFloatBuffer();
          float[] floatArray = new float[arraySize];
          for (int i = arrayStart; i < arrayStart + arraySize; i++) {
            floatArray[i - arrayStart] = Float.intBitsToFloat(this.getHeap().heap[i]);
          }
          floatbuf.put(floatArray);
View Full Code Here

Examples of java.nio.ByteBuffer.asFloatBuffer()

          ByteArrayInputStream bis = new ByteArrayInputStream(buf.array());
          return bis;
        } else if (type.getName().equals(CAS.TYPE_NAME_FLOAT_ARRAY)) {
          arrayStart = getArrayStartAddress(fs.getAddress());
          buf = ByteBuffer.allocate(arraySize * 4);
          FloatBuffer floatbuf = buf.asFloatBuffer();
          float[] floatArray = new float[arraySize];
          for (int i = arrayStart; i < arrayStart + arraySize; i++) {
            floatArray[i - arrayStart] = Float.intBitsToFloat(this.getHeap().heap[i]);
          }
          floatbuf.put(floatArray);
View Full Code Here

Examples of java.nio.ByteBuffer.asFloatBuffer()

            }
            ARBVertexBufferObject.glBindBufferARB(target, i.name);
            ByteBuffer bMap = ARBVertexBufferObject.glMapBufferARB(target, ARBVertexBufferObject.GL_WRITE_ONLY_ARB, i.data.limit() * BufferIO.Data.FLOAT.byteSize, null);
            Util.checkGLError();
            if (bMap != null) {
                ((FloatBuffer) bMap.asFloatBuffer().position(targetOffset)).put((FloatBuffer) vertices.rewind()).flip();
            }
            ARBVertexBufferObject.glUnmapBufferARB(target);
            ARBVertexBufferObject.glBindBufferARB(target, 0);
            Util.checkGLError();
        }
View Full Code Here

Examples of java.nio.ByteBuffer.asFloatBuffer()

            }
            VBObindArray(target, itemIndex);
            ByteBuffer bMap = ARBVertexBufferObject.glMapBufferARB(target, ARBVertexBufferObject.GL_READ_WRITE_ARB, item.data.limit() * BufferIO.Data.FLOAT.byteSize, null);
            Util.checkGLError();
            if (bMap != null) {
                return (FloatBuffer) bMap.asFloatBuffer().rewind();
            }
        }
        return (FloatBuffer) item.data.rewind();
    }

View Full Code Here

Examples of java.nio.ByteBuffer.asFloatBuffer()

    private void _PBOload(int target, Item pbo, int usage, FloatBuffer fb) {
        pbo.usage = usage;
        ARBPixelBufferObject.glBufferDataARB(target, fb.limit() * BufferIO.Data.FLOAT.byteSize, usage);
        ByteBuffer bb = ARBPixelBufferObject.glMapBufferARB(target, ARBPixelBufferObject.GL_WRITE_ONLY_ARB, null);
        if (bb != null) {
            bb.asFloatBuffer().put(fb).flip();
        }
        ARBPixelBufferObject.glUnmapBufferARB(target);
        Util.checkGLError();
    }

View Full Code Here

Examples of java.nio.ByteBuffer.asFloatBuffer()

            if (DebugMap._getInstance().isDebugLevelEnabled(Sprite.DBUG_RENDER_LOW)) {
                System.out.println("pbo buffer size " + bb.limit() / BufferIO.Data._findType(zeros).byteSize);
                System.out.println("map final pos " + ((packedClearedArea.ROI.y - pboROI.y + (packedClearedArea.ROI.height - 1)) * pboROI.width + (packedClearedArea.ROI.x - pboROI.x) * packedClearedArea.ROI.height));

            }
            FloatBuffer fb = bb.asFloatBuffer();
            for (int j = 0; j < packedClearedArea.ROI.height; j++) {
                /** line by line
                 * (yb + j) * width + xb
                 */
                fb.position((packedClearedArea.ROI.y - pboROI.y + j) * pboROI.width + packedClearedArea.ROI.x - pboROI.x);
View Full Code Here

Examples of java.nio.ByteBuffer.asFloatBuffer()

 
  public void renderFloatArray(Token token){
       float[] data = (float[]) token.getObject();

          ByteBuffer byteBuffer = ByteBuffer.allocate(data.length * 4);       
          FloatBuffer dBuffer = byteBuffer.asFloatBuffer();
          dBuffer.put(data);

          byte[] array = byteBuffer.array();
      String str = Base64.encodeBytes(array);
      props.put(token.getId()+".base64", str);
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.