Examples of Pointer


Examples of com.cetsoft.imcache.bytebuffer.Pointer

   *
   * @see com.cetsoft.imcache.cache.Cache#put(java.lang.Object, java.lang.Object)
   */
  public void put(K key, V value) {
    writeLock(key);
    Pointer pointer = pointerMap.get(key);
    try {
      if (pointer == null) {
        pointer = bufferStore.store(serializer.serialize(value));
      } else {
        synchronized (pointer) {
View Full Code Here

Examples of com.cetsoft.imcache.cache.offheap.bytebuffer.Pointer

  @Test
  public void store(){
    int size = 100;
    byte[] expectedBytes = new byte[size];
    random.nextBytes(expectedBytes);
    Pointer pointer = buffer.store(expectedBytes);
    byte[] actualBytes = buffer.retrieve(pointer);
    assertArrayEquals(expectedBytes, actualBytes);
  }
View Full Code Here

Examples of com.googlecode.javacpp.Pointer

        imageWidth = cvReadIntByName(fs, fn, "imageWidth", imageWidth);
        imageHeight = cvReadIntByName(fs, fn, "imageHeight", imageHeight);
        getSettings().setResponseGamma(cvReadRealByName(fs, fn, "gamma", getSettings().getResponseGamma()));
//        getSettings().initAspectRatio = cvReadRealByName(fs, fn, "initAspectRatio", getSettings().initAspectRatio);
//        getSettings().flags = cvReadIntByName(fs, fn, "flags", getSettings().flags);
        Pointer p = cvReadByName(fs, fn, "cameraMatrix", a);
        cameraMatrix = p == null ? null : new CvMat(p);
        p = cvReadByName(fs, fn, "distortionCoeffs", a);
        distortionCoeffs = p == null ? null : new CvMat(p);
        p = cvReadByName(fs, fn, "extrParams", a);
        extrParams = p == null ? null : new CvMat(p);
View Full Code Here

Examples of com.googlecode.javacpp.Pointer

        CvSeq seq = node.data_seq();
        int count = seq.total();

        ProjectorDevice[] devices = new ProjectorDevice[count];
        for (int i = 0; i < count; i++) {
            Pointer p = cvGetSeqElem(seq, i);
            if (p == null) continue;
            String name = cvReadString(new CvFileNode(p), null);
            devices[i] = new ProjectorDevice(name, fs);
        }
        return devices;
View Full Code Here

Examples of com.googlecode.javacpp.Pointer

        CvSeq seq = node.data_seq();
        int count = seq.total();

        CameraDevice[] devices = new CameraDevice[count];
        for (int i = 0; i < count; i++) {
            Pointer p = cvGetSeqElem(seq, i);
            if (p == null) continue;
            String name = cvReadString(new CvFileNode(p), null);
            devices[i] = new CameraDevice(name, fs);
        }
        return devices;
View Full Code Here

Examples of com.googlecode.javacpp.Pointer

                // CvPoint* line = (CvPoint*)cvGetSeqElem(lines,i);
                // CvPoint first=line[0], second=line[1]
                // is:
                // CvPoint first=line.position(0), secon=line.position(1);

                Pointer line = cvGetSeqElem(lines, i);
                CvPoint pt1  = new CvPoint(line).position(0);
                CvPoint pt2  = new CvPoint(line).position(1);

                System.out.println("Line spotted: ");
                System.out.println("\t pt1: " + pt1);
View Full Code Here

Examples of com.jme3.scene.plugins.blender.file.Pointer

    public void loadConstraints(Structure objectStructure, BlenderContext blenderContext) throws BlenderFileException {
        LOGGER.fine("Loading constraints.");
        // reading influence ipos for the constraints
        AnimationHelper animationHelper = blenderContext.getHelper(AnimationHelper.class);
        Map<String, Map<String, Ipo>> constraintsIpos = new HashMap<String, Map<String, Ipo>>();
        Pointer pActions = (Pointer) objectStructure.getFieldValue("action");
        if (pActions.isNotNull()) {
            List<Structure> actions = pActions.fetchData();
            for (Structure action : actions) {
                Structure chanbase = (Structure) action.getFieldValue("chanbase");
                List<Structure> actionChannels = chanbase.evaluateListBase();
                for (Structure actionChannel : actionChannels) {
                    Map<String, Ipo> ipos = new HashMap<String, Ipo>();
                    Structure constChannels = (Structure) actionChannel.getFieldValue("constraintChannels");
                    List<Structure> constraintChannels = constChannels.evaluateListBase();
                    for (Structure constraintChannel : constraintChannels) {
                        Pointer pIpo = (Pointer) constraintChannel.getFieldValue("ipo");
                        if (pIpo.isNotNull()) {
                            String constraintName = constraintChannel.getFieldValue("name").toString();
                            Ipo ipo = animationHelper.fromIpoStructure(pIpo.fetchData().get(0), blenderContext);
                            ipos.put(constraintName, ipo);
                        }
                    }
                    String actionName = actionChannel.getFieldValue("name").toString();
                    constraintsIpos.put(actionName, ipos);
                }
            }
        }

        // loading constraints connected with the object's bones
        Pointer pPose = (Pointer) objectStructure.getFieldValue("pose");
        if (pPose.isNotNull()) {
            List<Structure> poseChannels = ((Structure) pPose.fetchData().get(0).getFieldValue("chanbase")).evaluateListBase();
            for (Structure poseChannel : poseChannels) {
                List<Constraint> constraintsList = new ArrayList<Constraint>();
                Long boneOMA = Long.valueOf(((Pointer) poseChannel.getFieldValue("bone")).getOldMemoryAddress());

                // the name is read directly from structure because bone might
                // not yet be loaded
                String name = blenderContext.getFileBlock(boneOMA).getStructure(blenderContext).getFieldValue("name").toString();
                List<Structure> constraints = ((Structure) poseChannel.getFieldValue("constraints")).evaluateListBase();
                for (Structure constraint : constraints) {
                    String constraintName = constraint.getFieldValue("name").toString();
                    Map<String, Ipo> ipoMap = constraintsIpos.get(name);
                    Ipo ipo = ipoMap == null ? null : ipoMap.get(constraintName);
                    if (ipo == null) {
                        float enforce = ((Number) constraint.getFieldValue("enforce")).floatValue();
                        ipo = animationHelper.fromValue(enforce);
                    }
                    constraintsList.add(new BoneConstraint(constraint, boneOMA, ipo, blenderContext));
                }
                blenderContext.addConstraints(boneOMA, constraintsList);
            }
        }

        // loading constraints connected with the object itself
        List<Structure> constraints = ((Structure) objectStructure.getFieldValue("constraints")).evaluateListBase();
        if (constraints != null && constraints.size() > 0) {
            Pointer pData = (Pointer) objectStructure.getFieldValue("data");
            String dataType = pData.isNotNull() ? pData.fetchData().get(0).getType() : null;
            List<Constraint> constraintsList = new ArrayList<Constraint>(constraints.size());

            for (Structure constraint : constraints) {
                String constraintName = constraint.getFieldValue("name").toString();
                String objectName = objectStructure.getName();
View Full Code Here

Examples of com.mdimension.jchronic.tags.Pointer

    tokens.add(new Token("years"));
    tokens.add(new Token("past"));
   
    tokens.get(0).tag(new Scalar(Integer.valueOf(3)));
    tokens.get(1).tag(new RepeaterYear());
    tokens.get(2).tag(new Pointer(Pointer.PointerType.PAST));
   
    assertTrue(handler.match(tokens, Handler.definitions()));
  }
View Full Code Here

Examples of com.sun.jna.Pointer

  }
 
  private int buffer_data(FileInputStream in, ogg_sync_state oy) throws IOException
  {
    final int BUFSIZE = 4096;
    Pointer buffer = OGG.ogg_sync_buffer(oy, new NativeLong(BUFSIZE));
    byte[] buffer2 = new byte[BUFSIZE]; // TODO: this is inefficient.
    int bytes = in.read(buffer2, 0, BUFSIZE);
    if (bytes < 0)
      return bytes; // EOF
    buffer.write(0, buffer2, 0, bytes);
    OGG.ogg_sync_wrote(oy, new NativeLong(bytes));
    return (bytes);
  }
View Full Code Here

Examples of com.sun.jna.Pointer

  }
 
  private int buffer_data(PullSourceStream in, ogg_sync_state oy) throws IOException
  {
    final int BUFSIZE = 4096;
    Pointer buffer = OGG.ogg_sync_buffer(oy, new NativeLong(BUFSIZE));
    byte[] buffer2 = new byte[BUFSIZE]; // TODO: this is inefficient.
    int bytes = in.read(buffer2, 0, BUFSIZE);
    if (bytes < 0)
      return bytes; // EOF
    buffer.write(0, buffer2, 0, bytes);
    OGG.ogg_sync_wrote(oy, new NativeLong(bytes));
    return (bytes);
  }
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.