Package java.nio

Examples of java.nio.FloatBuffer.capacity()


        buf.limit(buf.capacity()).position(0);
        readonly.limit(readonly.capacity()).position(1);
        assertFalse(buf.equals(readonly));

        buf.limit(buf.capacity() - 1).position(0);
        duplicate.limit(duplicate.capacity()).position(0);
        assertFalse(buf.equals(duplicate));
    }

    /*
     * Class under test for float get()
View Full Code Here


        assertEquals(buf.isReadOnly(), slice.isReadOnly());
        assertEquals(buf.isDirect(), slice.isDirect());
        assertEquals(buf.order(), slice.order());
        assertEquals(slice.position(), 0);
        assertEquals(slice.limit(), buf.remaining());
        assertEquals(slice.capacity(), buf.remaining());
        try {
            slice.reset();
            fail("Should throw Exception"); //$NON-NLS-1$
        } catch (InvalidMarkException e) {
            // expected
View Full Code Here

        }

        // slice share the same content with buf
        if (!slice.isReadOnly()) {
            loadTestData1(slice);
            assertContentLikeTestData1(buf, 1, 0, slice.capacity());
            buf.put(2, 500);
            assertEquals(slice.get(1), 500, 0.0);
        }
    }
View Full Code Here

        }

        FloatBuffer buf = FloatBuffer.wrap(array, 2, 16);
        assertEquals(buf.position(), 2);
        assertEquals(buf.limit(), 18);
        assertEquals(buf.capacity(), 20);
    }
}
View Full Code Here

           
            // creade a command queue with benchmarking flag set
            CLCommandQueue queue = context.getDevices()[0].createCommandQueue(Mode.PROFILING_MODE);
           
            int localWorkSize = queue.getDevice().getMaxWorkGroupSize(); // Local work size dimensions
            int globalWorkSize = roundUp(localWorkSize, fb.capacity())// rounded up to the nearest multiple of the localWorkSize
           
            // create kernel and set function parameters
            CLKernel kernel = program.createCLKernel("gamma");
           
            // original lenna
View Full Code Here

            if (dcColors != null) {
                dcColors.clear();
            }
            final FloatBuffer mmColors = _morphMesh.getMeshData().getColorBuffer();
            mmColors.clear();
            if (dcColors == null || dcColors.capacity() != mmColors.capacity()) {
                dcColors = BufferUtils.createFloatBuffer(mmColors.capacity());
                dcColors.clear();
                dataCopy.getMeshData().setColorBuffer(dcColors);
            }
View Full Code Here

                dcColors.clear();
            }
            final FloatBuffer mmColors = _morphMesh.getMeshData().getColorBuffer();
            mmColors.clear();
            if (dcColors == null || dcColors.capacity() != mmColors.capacity()) {
                dcColors = BufferUtils.createFloatBuffer(mmColors.capacity());
                dcColors.clear();
                dataCopy.getMeshData().setColorBuffer(dcColors);
            }

            dcColors.put(mmColors);
View Full Code Here

            if (dcVerts != null) {
                dcVerts.clear();
            }
            final FloatBuffer mmVerts = _morphMesh.getMeshData().getVertexBuffer();
            mmVerts.clear();
            if (dcVerts == null || dcVerts.capacity() != mmVerts.capacity()) {
                dcVerts = BufferUtils.createFloatBuffer(mmVerts.capacity());
                dcVerts.clear();
                dataCopy.getMeshData().setVertexBuffer(dcVerts);
            }
View Full Code Here

                dcVerts.clear();
            }
            final FloatBuffer mmVerts = _morphMesh.getMeshData().getVertexBuffer();
            mmVerts.clear();
            if (dcVerts == null || dcVerts.capacity() != mmVerts.capacity()) {
                dcVerts = BufferUtils.createFloatBuffer(mmVerts.capacity());
                dcVerts.clear();
                dataCopy.getMeshData().setVertexBuffer(dcVerts);
            }

            dcVerts.put(mmVerts);
View Full Code Here

            if (dcNorms != null) {
                dcNorms.clear();
            }
            final FloatBuffer mmNorms = _morphMesh.getMeshData().getNormalBuffer();
            mmNorms.clear();
            if (dcNorms == null || dcNorms.capacity() != mmNorms.capacity()) {
                dcNorms = BufferUtils.createFloatBuffer(mmNorms.capacity());
                dcNorms.clear();
                dataCopy.getMeshData().setNormalBuffer(dcNorms);
            }
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.