Package java.nio

Examples of java.nio.FloatBuffer.capacity()


        FloatBuffer imgPts2 = points2[1].getFloatBuffer();
        IntBuffer imgCount2 = points2[2].getIntBuffer();
        assert(imgCount1.capacity() == imgCount2.capacity());

        CvMat objectPointsMat = CvMat.create(1, Math.min(objPts1.capacity(), objPts2.capacity()), CV_32F, 3);
        CvMat imagePoints1Mat = CvMat.create(1, Math.min(imgPts1.capacity(), imgPts2.capacity()), CV_32F, 2);
        CvMat imagePoints2Mat = CvMat.create(1, Math.min(imgPts1.capacity(), imgPts2.capacity()), CV_32F, 2);
        CvMat pointCountsMat  = CvMat.create(1, imgCount1.capacity(), CV_32S, 1);
        FloatBuffer objectPoints = objectPointsMat.getFloatBuffer();
        FloatBuffer imagePoints1 = imagePoints1Mat.getFloatBuffer();
        FloatBuffer imagePoints2 = imagePoints2Mat.getFloatBuffer();
View Full Code Here


        IntBuffer imgCount2 = points2[2].getIntBuffer();
        assert(imgCount1.capacity() == imgCount2.capacity());

        CvMat objectPointsMat = CvMat.create(1, Math.min(objPts1.capacity(), objPts2.capacity()), CV_32F, 3);
        CvMat imagePoints1Mat = CvMat.create(1, Math.min(imgPts1.capacity(), imgPts2.capacity()), CV_32F, 2);
        CvMat imagePoints2Mat = CvMat.create(1, Math.min(imgPts1.capacity(), imgPts2.capacity()), CV_32F, 2);
        CvMat pointCountsMat  = CvMat.create(1, imgCount1.capacity(), CV_32S, 1);
        FloatBuffer objectPoints = objectPointsMat.getFloatBuffer();
        FloatBuffer imagePoints1 = imagePoints1Mat.getFloatBuffer();
        FloatBuffer imagePoints2 = imagePoints2Mat.getFloatBuffer();
        IntBuffer   pointCounts  = pointCountsMat .getIntBuffer();
View Full Code Here

        // cvDiv(image1, image3, image1, 1);
        // cvDiv() doesn't support division by zero...
        FloatBuffer fb1 = float1.getFloatBuffer();
        FloatBuffer fb2 = float2.getFloatBuffer();
        ByteBuffer  rmb = roiMask.getByteBuffer();
        assert(fb1.capacity() == fb2.capacity()/3);
        assert(fb1.capacity() == rmb.capacity()/3);
        int[] nPixels = new int[channels];
        for (int i = 0, j = 0; j < fb1.capacity(); i++, j+=channels) {
            for (int z = 0; z < channels; z++) {
                float ra = fb1.get(j+z);
View Full Code Here

      PrintWriter p = new PrintWriter(file);
      p.printf(Locale.ENGLISH,"#verts\n");
      //verts
      FloatBuffer bu = mesh.getFloatBuffer(Type.Position);
      bu.rewind();
      for(int i=0; i<bu.capacity(); i+=3) {
        p.printf(Locale.ENGLISH,"v %.4f %.4f %.4f\n", bu.get(), bu.get(), bu.get());
      }
      // tex
      bu = mesh.getFloatBuffer(Type.TexCoord);
      if(bu != null) {
View Full Code Here

      }
      // tex
      bu = mesh.getFloatBuffer(Type.TexCoord);
      if(bu != null) {
        bu.rewind();
        for(int i=0; i<bu.capacity(); i+=3) {
          p.printf(Locale.ENGLISH,"vt %.4f %.4f %.4f\n", bu.get(), bu.get(), bu.get());
        }
      }
      // norm
      bu = mesh.getFloatBuffer(Type.Normal);
View Full Code Here

      }
      // norm
      bu = mesh.getFloatBuffer(Type.Normal);
      if(bu != null) {
        bu.rewind();
        for(int i=0; i<bu.capacity(); i+=3) {
          p.printf(Locale.ENGLISH,"vn %.4f %.4f %.4f\n", bu.get(), bu.get(), bu.get());
        }
      }
      //indices
      IndexBuffer ib = mesh.getIndexBuffer();
View Full Code Here

      PrintWriter p = new PrintWriter(file);
      p.printf(Locale.ENGLISH,"#verts\n");
      //verts
      FloatBuffer bu = mesh.getFloatBuffer(Type.Position);
      bu.rewind();
      for(int i=0; i<bu.capacity(); i+=3) {
        p.printf(Locale.ENGLISH,"v %.4f %.4f %.4f\n", bu.get(), bu.get(), bu.get());
      }
      // tex
      bu = mesh.getFloatBuffer(Type.TexCoord);
      if(bu != null) {
View Full Code Here

      }
      // tex
      bu = mesh.getFloatBuffer(Type.TexCoord);
      if(bu != null) {
        bu.rewind();
        for(int i=0; i<bu.capacity(); i+=3) {
          p.printf(Locale.ENGLISH,"vt %.4f %.4f %.4f\n", bu.get(), bu.get(), bu.get());
        }
      }
      // norm
      bu = mesh.getFloatBuffer(Type.Normal);
View Full Code Here

      }
      // norm
      bu = mesh.getFloatBuffer(Type.Normal);
      if(bu != null) {
        bu.rewind();
        for(int i=0; i<bu.capacity(); i+=3) {
          p.printf(Locale.ENGLISH,"vn %.4f %.4f %.4f\n", bu.get(), bu.get(), bu.get());
        }
      }
      //indices
      IndexBuffer ib = mesh.getIndexBuffer();
View Full Code Here

      PrintWriter p = new PrintWriter(file);
      p.printf(Locale.ENGLISH,"#verts\n");
      //verts
      FloatBuffer bu = mesh.getFloatBuffer(Type.Position);
      bu.rewind();
      for(int i=0; i<bu.capacity(); i+=3) {
        p.printf(Locale.ENGLISH,"v %.4f %.4f %.4f\n", bu.get(), bu.get(), bu.get());
      }
      // tex
      bu = mesh.getFloatBuffer(Type.TexCoord);
      if(bu != null) {
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.