Package com.sun.jna.ptr

Examples of com.sun.jna.ptr.FloatByReference


        LongByReference lref = new LongByReference();
        lib.incrementInt64ByReference(lref);
        assertEquals("Long argument not modified", 1, lref.getValue());
    }
    public void testFloatByReference() {
        FloatByReference fref = new FloatByReference(1f);
        lib.complementFloatByReference(fref);
        assertEquals("Float argument not modified", -1f, fref.getValue(), 0.0);
    }
View Full Code Here


    }
    protected RangeWidget(String label) {
      super(Type.Range, label);
    }
    public float getValue() {
      FloatByReference ptrValue = new FloatByReference();
      check(Gphoto2Library.INSTANCE.gp_widget_get_value(getNativePointer(), ptrValue));
      return ptrValue.getValue();
    }
View Full Code Here

      FloatByReference ptrValue = new FloatByReference();
      check(Gphoto2Library.INSTANCE.gp_widget_get_value(getNativePointer(), ptrValue));
      return ptrValue.getValue();
    }
    public void setValue(float value) {
      FloatByReference ptrValue = new FloatByReference(value);
      check(Gphoto2Library.INSTANCE.gp_widget_set_value(getNativePointer(), ptrValue));
    }
View Full Code Here

   
    /**
     * @return [min, max, increment]
     */
    public float[] getRange() {
      FloatByReference min = new FloatByReference();
      FloatByReference max = new FloatByReference();
      FloatByReference inc = new FloatByReference();
      check(Gphoto2Library.INSTANCE.gp_widget_get_range(getNativePointer(), min, max, inc));
      return new float[] {min.getValue(), max.getValue(), inc.getValue()};
    }
View Full Code Here

                        val = new Float(Float.parseFloat((String)val)).floatValue();
                    } else {
                        throw new RuntimeException("Attempt to pass ineligible value to long: "+val);
                    }
                }
                return new FloatByReference((Float)val);
               
            case 'd':
                if ( !double.class.isInstance(val) ){
                    if ( Number.class.isInstance(val) ){
                        val = ((Number)val).doubleValue();
View Full Code Here

        LongByReference lref = new LongByReference();
        lib.incrementInt64ByReference(lref);
        assertEquals("Long argument not modified", 1, lref.getValue());
    }
    public void testFloatByReference() {
        FloatByReference fref = new FloatByReference(1f);
        lib.complementFloatByReference(fref);
        assertEquals("Float argument not modified", -1f, fref.getValue(), 0.0);
    }
View Full Code Here

                        val = new Float(Float.parseFloat((String)val)).floatValue();
                    } else {
                        throw new RuntimeException("Attempt to pass ineligible value to long: "+val);
                    }
                }
                return new FloatByReference((Float)val);
               
            case 'd':
                if ( !double.class.isInstance(val) ){
                    if ( Number.class.isInstance(val) ){
                        val = ((Number)val).doubleValue();
View Full Code Here

TOP

Related Classes of com.sun.jna.ptr.FloatByReference

Copyright © 2018 www.massapicom. 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.