/** * Copies {@code count} ints from the memory pointed to by this * {@link IntPtr} to {@code dst} starting at offset {@code offset}. * * @param dst the destination. * @param offset the offset within the destination array to start copying to. * @param count the number of elements to copy. */ public void get(int[] dst, int offset, int count) { asIntBuffer(count).get(dst, offset, count); }
public static GLKVector3 project(GLKVector3 object, GLKMatrix4 model, GLKMatrix4 projection, int[] viewport) { IntPtr ptr = new IntPtr(); ptr.set(viewport); return project(object, model, projection, ptr); } public static GLKVector3 unproject(GLKVector3 window, GLKMatrix4 model, GLKMatrix4 projection, int[] viewport, BooleanPtr success) {
/** * Copies {@code n} ints from the memory pointed to by this {@link IntPtr} * to a new {@code int[]} instance. * * @param n the number of ints to copy. * @return the {@code int[]}. */ public int[] toIntArray(int n) { int[] result = new int[n]; get(result); return result; }
/** * Copies {@code src.length} ints from {@code src} to the memory pointed to by * this {@link IntPtr}. * * @param src the source. */ public void set(int[] src) { set(src, 0, src.length); }
/** * Returns a {@link IntBuffer} which reads and writes to the same memory * location pointed to by this {@link IntPtr}. * * @param n the maximum number of ints the {@link IntBuffer} can * read/write. This will be the {@link IntBuffer}'s * <code>capacity</code>. * @return the {@link IntBuffer}. */ public IntBuffer asIntBuffer(int n) { return as(BytePtr.class).asByteBuffer(n << 2).order(ByteOrder.nativeOrder()).asIntBuffer(); }
public int[] getOutputDataAsIntArray() { IntPtr ptr = getOutputDataPointer().as(IntPtr.class); return ptr.toIntArray(getOutputDataSize()); } public long[] getOutputDataAsLongArray() {
public int getPropertyAsInt(ExtAudioFileProperty id) throws OSStatusException { IntPtr ptr = getProperty(id, IntPtr.class); return ptr.get(); } public long getPropertyAsLong(ExtAudioFileProperty id) throws OSStatusException {
@Bridge(symbol="GLKMathUnproject", optional=true) private static native @ByVal GLKVector3 unproject(@ByVal GLKVector3 window, @ByVal GLKMatrix4 model, @ByVal GLKMatrix4 projection, IntPtr viewport, BooleanPtr success); /*</methods>*/
/** * Creates a new {@link IntPtr} and initializes it with the specified value. * * @param value the value. */ public IntPtr(int value) { set(value); }
/** * Returns a {@link IntBuffer} which reads and writes to the same memory * location pointed to by this {@link IntPtr}. * * @param n the maximum number of ints the {@link IntBuffer} can * read/write. This will be the {@link IntBuffer}'s * <code>capacity</code>. * @return the {@link IntBuffer}. */ public IntBuffer asIntBuffer(int n) { return as(BytePtr.class).asByteBuffer(n << 2).order(ByteOrder.nativeOrder()).asIntBuffer(); }
/** * @since Available in iOS 2.0 and later. */ public NSData getData() { IntPtr ptr = new IntPtr(); return getData(ptr); } /**
public int[] getOutputDataAsIntArray() { IntPtr ptr = getOutputDataPointer().as(IntPtr.class); return ptr.toIntArray(getOutputDataSize()); } public long[] getOutputDataAsLongArray() {
/** * Copies {@code count} ints from {@code src} starting at offset {@code offset} * to the memory pointed to by this {@link IntPtr}. * * @param src the source. * @param offset the offset within the source array to start copying from. * @param count the number of elements to copy. */ public void set(int[] src, int offset, int count) { asIntBuffer(count).put(src, offset, count); } }
public int getPropertyAsInt(AUPropertyType type, AUScope scope) throws OSStatusException { IntPtr ptr = getProperty(type, IntPtr.class, scope); return ptr.get(); } public long getPropertyAsLong(AUPropertyType type, AUScope scope) throws OSStatusException {
public static GLKVector3 project(GLKVector3 object, GLKMatrix4 model, GLKMatrix4 projection, int[] viewport) { IntPtr ptr = new IntPtr(); ptr.set(viewport); return project(object, model, projection, ptr); } public static GLKVector3 unproject(GLKVector3 window, GLKMatrix4 model, GLKMatrix4 projection, int[] viewport, BooleanPtr success) {