/** * @since Available in iOS 4.0 and later. */ public CFAllocator getMemoryAllocator() { if (has(CVPixelBufferAttribute.MemoryAllocator)) { CFAllocator val = get(CVPixelBufferAttribute.MemoryAllocator, CFAllocator.class); return val; } return null; } /**
/** * @since Available in iOS 4.0 and later. */ public NSDictionary getIOSurfaceProperties() { if (has(CVPixelBufferAttribute.IOSurfaceProperties)) { NSDictionary val = get(CVPixelBufferAttribute.IOSurfaceProperties, NSDictionary.class); return val; } return null; } /**
/** * @since Available in iOS 4.0 and later. */ public boolean isCompatibleWithOpenGL() { if (has(CVPixelBufferAttribute.OpenGLCompatibility)) { CFBoolean val = get(CVPixelBufferAttribute.OpenGLCompatibility, CFBoolean.class); return val.booleanValue(); } return false; } /**
/** * @since Available in iOS 4.0 and later. */ public long getExtendedPixelsLeft() { if (has(CVPixelBufferAttribute.ExtendedPixelsLeft)) { CFNumber val = get(CVPixelBufferAttribute.ExtendedPixelsLeft, CFNumber.class); return val.longValue(); } return 0; } /**
/** * @since Available in iOS 4.0 and later. */ public boolean isCompatibleWithCGImage() { if (has(CVPixelBufferAttribute.CGImageCompatibility)) { CFBoolean val = get(CVPixelBufferAttribute.CGImageCompatibility, CFBoolean.class); return val.booleanValue(); } return false; } /**
/** * @since Available in iOS 4.0 and later. */ public long getPlaneAlignment() { if (has(CVPixelBufferAttribute.PlaneAlignment)) { CFNumber val = get(CVPixelBufferAttribute.PlaneAlignment, CFNumber.class); return val.longValue(); } return 0; } /**
/** * @since Available in iOS 4.0 and later. */ public long getHeight() { if (has(CVPixelBufferAttribute.Height)) { CFNumber val = get(CVPixelBufferAttribute.Height, CFNumber.class); return val.longValue(); } return 0; } /**
/** * @since Available in iOS 8.0 and later. */ public boolean isCompatibleWithMetal() { if (has(CVPixelBufferAttribute.MetalCompatibility)) { CFBoolean val = get(CVPixelBufferAttribute.MetalCompatibility, CFBoolean.class); return val.booleanValue(); } return false; } /**
/** * @since Available in iOS 4.0 and later. */ public long getWidth() { if (has(CVPixelBufferAttribute.Width)) { CFNumber val = get(CVPixelBufferAttribute.Width, CFNumber.class); return val.longValue(); } return 0; } /**
/** * @since Available in iOS 4.0 and later. */ public long getExtendedPixelsTop() { if (has(CVPixelBufferAttribute.ExtendedPixelsTop)) { CFNumber val = get(CVPixelBufferAttribute.ExtendedPixelsTop, CFNumber.class); return val.longValue(); } return 0; } /**
/** * @since Available in iOS 4.0 and later. */ public long getExtendedPixelsRight() { if (has(CVPixelBufferAttribute.ExtendedPixelsRight)) { CFNumber val = get(CVPixelBufferAttribute.ExtendedPixelsRight, CFNumber.class); return val.longValue(); } return 0; } /**
/** * @since Available in iOS 4.0 and later. */ public long getExtendedPixelsBottom() { if (has(CVPixelBufferAttribute.ExtendedPixelsBottom)) { CFNumber val = get(CVPixelBufferAttribute.ExtendedPixelsBottom, CFNumber.class); return val.longValue(); } return 0; } /**
/** * @since Available in iOS 6.0 and later. */ public boolean isCompatibleWithOpenGLES() { if (has(CVPixelBufferAttribute.OpenGLESCompatibility)) { CFBoolean val = get(CVPixelBufferAttribute.OpenGLESCompatibility, CFBoolean.class); return val.booleanValue(); } return false; } /**
public <T extends NativeObject> T get(CVPixelBufferAttribute key, Class<T> type) { if (has(key)) { return data.get(key.value(), type); } return null; } public CVPixelBufferAttributes set(CVPixelBufferAttribute key, NativeObject value) {
/** * @since Available in iOS 4.0 and later. */ public long getBytesPerRowAlignment() { if (has(CVPixelBufferAttribute.BytesPerRowAlignment)) { CFNumber val = get(CVPixelBufferAttribute.BytesPerRowAlignment, CFNumber.class); return val.longValue(); } return 0; } /**
/** * @since Available in iOS 4.0 and later. */ public boolean isCompatibleWithCGBitmapContext() { if (has(CVPixelBufferAttribute.CGBitmapContextCompatibility)) { CFBoolean val = get(CVPixelBufferAttribute.CGBitmapContextCompatibility, CFBoolean.class); return val.booleanValue(); } return false; } /**
/** * @since Available in iOS 4.0 and later. */ public List<CVPixelFormatType> getPixelFormatTypes() { if (has(CVPixelBufferAttribute.PixelFormatType)) { CFType val = get(CVPixelBufferAttribute.PixelFormatType, CFType.class); List<CVPixelFormatType> list = new ArrayList<>(); if (val.getClass() == CFNumber.class || CFNumber.class.isAssignableFrom(val.getClass())) { CFNumber num = (CFNumber)val; list.add(CVPixelFormatType.valueOf(num.longValue())); return list; } else if (val.getClass() == CFArray.class || CFArray.class.isAssignableFrom(val.getClass())) { CFArray arr = (CFArray)val; for (int i = 0; i < arr.size(); i++) { list.add(CVPixelFormatType.valueOf(arr.get(i, CFNumber.class).longValue())); } return list; } } return null; } /**
/** * @since Available in iOS 4.0 and later. */ public long getExtendedPixelsRight() { if (has(CVPixelBufferAttribute.ExtendedPixelsRight)) { CFNumber val = get(CVPixelBufferAttribute.ExtendedPixelsRight, CFNumber.class); return val.longValue(); } return 0; } /**
/** * @since Available in iOS 4.0 and later. */ public boolean isCompatibleWithCGBitmapContext() { if (has(CVPixelBufferAttribute.CGBitmapContextCompatibility)) { CFBoolean val = get(CVPixelBufferAttribute.CGBitmapContextCompatibility, CFBoolean.class); return val.booleanValue(); } return false; } /**
/** * @since Available in iOS 4.0 and later. */ public long getBytesPerRowAlignment() { if (has(CVPixelBufferAttribute.BytesPerRowAlignment)) { CFNumber val = get(CVPixelBufferAttribute.BytesPerRowAlignment, CFNumber.class); return val.longValue(); } return 0; } /**