/** * @since Available in iOS 4.0 and later. */ public CVPixelBufferAttributes setPixelFormatType(CVPixelFormatType type) { set(CVPixelBufferAttribute.PixelFormatType, CFNumber.valueOf(type.value())); return this; } /**
/** * @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; } /**
public static /*<name>*/CVPixelFormatType/*</name>*/ valueOf(long n) { for (/*<name>*/CVPixelFormatType/*</name>*/ v : values()) { if (v.n == n) { return v; } } throw new IllegalArgumentException("No constant with value " + n + " found in " + /*<name>*/CVPixelFormatType/*</name>*/.class.getName()); } }
/** * @since Available in iOS 4.0 and later. */ public CVPixelBufferAttributes setPixelFormatTypes(List<CVPixelFormatType> types) { CFArray array = CFMutableArray.create(); for (CVPixelFormatType i : types) { array.add(CFNumber.valueOf(i.value())); } set(CVPixelBufferAttribute.PixelFormatType, array); return this; }
@SuppressWarnings("unchecked") @MarshalsPointer public static List<CVPixelFormatType> toObject(Class<? extends NSObject> cls, long handle, long flags) { NSArray<NSNumber> o = (NSArray<NSNumber>) NSObject.Marshaler.toObject(cls, handle, flags); if (o == null) { return null; } List<CVPixelFormatType> list = new ArrayList<>(); for (NSNumber n : o) { list.add(CVPixelFormatType.valueOf(n.longValue())); } return list; } @MarshalsPointer
public static /*<name>*/CVPixelFormatType/*</name>*/ valueOf(long n) { for (/*<name>*/CVPixelFormatType/*</name>*/ v : values()) { if (v.n == n) { return v; } } throw new IllegalArgumentException("No constant with value " + n + " found in " + /*<name>*/CVPixelFormatType/*</name>*/.class.getName()); } }
@MarshalsPointer public static long toNative(List<CVPixelFormatType> l, long flags) { if (l == null) { return 0L; } NSMutableArray<NSNumber> array = new NSMutableArray<>(); for (CVPixelFormatType i : l) { array.add(NSNumber.valueOf(i.value())); } return NSObject.Marshaler.toNative(array, flags); } }
/** * @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; } /**
public static /*<name>*/CVPixelFormatType/*</name>*/ valueOf(long n) { for (/*<name>*/CVPixelFormatType/*</name>*/ v : values()) { if (v.n == n) { return v; } } throw new IllegalArgumentException("No constant with value " + n + " found in " + /*<name>*/CVPixelFormatType/*</name>*/.class.getName()); } }
/** * @since Available in iOS 4.0 and later. */ public CVPixelBufferAttributes setPixelFormatType(CVPixelFormatType type) { set(CVPixelBufferAttribute.PixelFormatType, CFNumber.valueOf(type.value())); return this; } /**
/** * @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 CVPixelBufferAttributes setPixelFormatType(CVPixelFormatType type) { set(CVPixelBufferAttribute.PixelFormatType, CFNumber.valueOf(type.value())); return this; } /**
@SuppressWarnings("unchecked") @MarshalsPointer public static List<CVPixelFormatType> toObject(Class<? extends NSObject> cls, long handle, long flags) { NSArray<NSNumber> o = (NSArray<NSNumber>) NSObject.Marshaler.toObject(cls, handle, flags); if (o == null) { return null; } List<CVPixelFormatType> list = new ArrayList<>(); for (NSNumber n : o) { list.add(CVPixelFormatType.valueOf(n.longValue())); } return list; } @MarshalsPointer
/** * @since Available in iOS 4.0 and later. */ public CVPixelBufferAttributes setPixelFormatTypes(List<CVPixelFormatType> types) { CFArray array = CFMutableArray.create(); for (CVPixelFormatType i : types) { array.add(CFNumber.valueOf(i.value())); } set(CVPixelBufferAttribute.PixelFormatType, array); return this; }
@SuppressWarnings("unchecked") @MarshalsPointer public static List<CVPixelFormatType> toObject(Class<? extends NSObject> cls, long handle, long flags) { NSArray<NSNumber> o = (NSArray<NSNumber>) NSObject.Marshaler.toObject(cls, handle, flags); if (o == null) { return null; } List<CVPixelFormatType> list = new ArrayList<>(); for (NSNumber n : o) { list.add(CVPixelFormatType.valueOf(n.longValue())); } return list; } @MarshalsPointer
/** * @since Available in iOS 4.0 and later. */ public CVPixelBufferAttributes setPixelFormatTypes(List<CVPixelFormatType> types) { CFArray array = CFMutableArray.create(); for (CVPixelFormatType i : types) { array.add(CFNumber.valueOf(i.value())); } set(CVPixelBufferAttribute.PixelFormatType, array); return this; }
@MarshalsPointer public static long toNative(List<CVPixelFormatType> l, long flags) { if (l == null) { return 0L; } NSMutableArray<NSNumber> array = new NSMutableArray<>(); for (CVPixelFormatType i : l) { array.add(NSNumber.valueOf(i.value())); } return NSObject.Marshaler.toNative(array, flags); } }
@MarshalsPointer public static long toNative(List<CVPixelFormatType> l, long flags) { if (l == null) { return 0L; } NSMutableArray<NSNumber> array = new NSMutableArray<>(); for (CVPixelFormatType i : l) { array.add(NSNumber.valueOf(i.value())); } return NSObject.Marshaler.toNative(array, flags); } }