Package apple.iosurface
Class IOSurface
- java.lang.Object
-
- org.moe.natj.general.NativeObject
-
- org.moe.natj.objc.ObjCObject
-
- apple.NSObject
-
- apple.iosurface.IOSurface
-
- All Implemented Interfaces:
NSCoding,NSSecureCoding,NSObject
public class IOSurface extends NSObject implements NSSecureCoding
Note: IOSurface objects are "toll free bridged" to IOSurfaceRef objects
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class apple.NSObject
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedIOSurface(org.moe.natj.general.Pointer peer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean_supportsSecureCoding()This property must return YES on all classes that allow secure coding.static booleanaccessInstanceVariablesDirectly()NSDictionary<java.lang.String,?>allAttachments()static IOSurfacealloc()longallocationSize()The total allocation size of the IOSurfacestatic java.lang.ObjectallocWithZone(org.moe.natj.general.ptr.VoidPtr zone)booleanallowsPixelSizeCasting()This property returns YES if it is legal to choose an OpenGL or Metal pixel format with a bytes per pixel value that is different than the bytesPerElement value(s) of this IOSurface.java.lang.ObjectattachmentForKey(java.lang.String key)static booleanautomaticallyNotifiesObserversForKey(java.lang.String key)org.moe.natj.general.ptr.VoidPtrbaseAddress()org.moe.natj.general.ptr.VoidPtrbaseAddressOfPlaneAtIndex(long planeIndex)longbytesPerElement()longbytesPerElementOfPlaneAtIndex(long planeIndex)longbytesPerRow()Note: These properties may not return well-defined values for planar surfaceslongbytesPerRowOfPlaneAtIndex(long planeIndex)static voidcancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)static voidcancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget, org.moe.natj.objc.SEL aSelector, java.lang.Object anArgument)static NSArray<java.lang.String>classFallbacksForKeyedArchiver()static org.moe.natj.objc.ClassclassForKeyedUnarchiver()static java.lang.StringdebugDescription_static()voiddecrementUseCount()static java.lang.Stringdescription_static()longelementHeight()longelementHeightOfPlaneAtIndex(long planeIndex)longelementWidth()longelementWidthOfPlaneAtIndex(long planeIndex)voidencodeWithCoder(NSCoder coder)static longhash_static()longheight()longheightOfPlaneAtIndex(long planeIndex)voidincrementUseCount()IOSurfaceinit()IOSurfaceinitWithCoder(NSCoder coder)NS_DESIGNATED_INITIALIZERIOSurfaceinitWithProperties(NSDictionary<java.lang.String,?> properties)Create a new IOSurfacestatic NSObject.Function_instanceMethodForSelector_retinstanceMethodForSelector(org.moe.natj.objc.SEL aSelector)static NSMethodSignatureinstanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)static booleaninstancesRespondToSelector(org.moe.natj.objc.SEL aSelector)booleanisInUse()There are cases where it is useful to know whether or not an IOSurface buffer is considered to be "in use" by other users of the same IOSurface.static booleanisSubclassOfClass(org.moe.natj.objc.Class aClass)static NSSet<java.lang.String>keyPathsForValuesAffectingValueForKey(java.lang.String key)intlocalUseCount()The localUseCount property returns the local per-process usage count for an IOSurface.intlockWithOptionsSeed(int options, org.moe.natj.general.ptr.IntPtr seed)"Lock" or "Unlock" a IOSurface for reading or writing.static java.lang.Objectnew_objc()intpixelFormat()longplaneCount()Return the number of planes in this buffer.voidremoveAllAttachments()voidremoveAttachmentForKey(java.lang.String key)static booleanresolveClassMethod(org.moe.natj.objc.SEL sel)static booleanresolveInstanceMethod(org.moe.natj.objc.SEL sel)intseed()This will return the current seed value of the buffer and is a cheap property to read to see if the contents of the buffer have changed since the last lock/unlock.voidsetAllAttachments(NSDictionary<java.lang.String,?> dict)voidsetAttachmentForKey(java.lang.Object anObject, java.lang.String key)These calls let you attach property list types to a IOSurface buffer.intsetPurgeableOldState(int newState, org.moe.natj.general.ptr.IntPtr oldState)See comments in IOSurfaceAPI.hstatic voidsetVersion_static(long aVersion)static org.moe.natj.objc.Classsuperclass_static()static booleansupportsSecureCoding()intunlockWithOptionsSeed(int options, org.moe.natj.general.ptr.IntPtr seed)static longversion_static()longwidth()Basic surface layout informationlongwidthOfPlaneAtIndex(long planeIndex)These properties return information about a particular plane of a IOSurface.-
Methods inherited from class apple.NSObject
accessibilityActivate, accessibilityActivationPoint, accessibilityAssistiveTechnologyFocusedIdentifiers, accessibilityAttributedHint, accessibilityAttributedLabel, accessibilityAttributedUserInputLabels, accessibilityAttributedValue, accessibilityContainerType, accessibilityCustomActions, accessibilityCustomRotors, accessibilityDecrement, accessibilityDragSourceDescriptors, accessibilityDropPointDescriptors, accessibilityElementAtIndex, accessibilityElementCount, accessibilityElementDidBecomeFocused, accessibilityElementDidLoseFocus, accessibilityElementIsFocused, accessibilityElements, accessibilityElementsHidden, accessibilityFrame, accessibilityHint, accessibilityIncrement, accessibilityLabel, accessibilityLanguage, accessibilityNavigationStyle, accessibilityPath, accessibilityPerformEscape, accessibilityPerformMagicTap, accessibilityRespondsToUserInteraction, accessibilityScroll, accessibilityTextualContext, accessibilityTraits, accessibilityUserInputLabels, accessibilityValue, accessibilityViewIsModal, addObserverForKeyPathOptionsContext, attemptRecoveryFromErrorOptionIndex, attemptRecoveryFromErrorOptionIndexDelegateDidRecoverSelectorContextInfo, autoContentAccessingProxy, awakeAfterUsingCoder, awakeFromNib, class_objc, classForCoder, classForKeyedArchiver, copy, dealloc, debugDescription, description, dictionaryWithValuesForKeys, didChangeValueForKey, didChangeValueForKeyWithSetMutationUsingObjects, didChangeValuesAtIndexesForKey, doesNotRecognizeSelector, fileManagerShouldProceedAfterError, fileManagerWillProcessPath, finalize_objc, forwardingTargetForSelector, forwardInvocation, hash, indexOfAccessibilityElement, isAccessibilityElement, isEqual, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableArrayValueForKey, mutableArrayValueForKeyPath, mutableCopy, mutableOrderedSetValueForKey, mutableOrderedSetValueForKeyPath, mutableSetValueForKey, mutableSetValueForKeyPath, observationInfo, observeValueForKeyPathOfObjectChangeContext, performSelector, performSelectorInBackgroundWithObject, performSelectorOnMainThreadWithObjectWaitUntilDone, performSelectorOnMainThreadWithObjectWaitUntilDoneModes, performSelectorOnThreadWithObjectWaitUntilDone, performSelectorOnThreadWithObjectWaitUntilDoneModes, performSelectorWithObject, performSelectorWithObjectAfterDelay, performSelectorWithObjectAfterDelayInModes, performSelectorWithObjectWithObject, prepareForInterfaceBuilder, provideImageDataBytesPerRowOrigin_Size_UserInfo, removeObserverForKeyPath, removeObserverForKeyPathContext, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, self, setAccessibilityActivationPoint, setAccessibilityAttributedHint, setAccessibilityAttributedLabel, setAccessibilityAttributedUserInputLabels, setAccessibilityAttributedValue, setAccessibilityContainerType, setAccessibilityCustomActions, setAccessibilityCustomRotors, setAccessibilityDragSourceDescriptors, setAccessibilityDropPointDescriptors, setAccessibilityElements, setAccessibilityElementsHidden, setAccessibilityFrame, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLanguage, setAccessibilityNavigationStyle, setAccessibilityPath, setAccessibilityRespondsToUserInteraction, setAccessibilityTextualContext, setAccessibilityTraits, setAccessibilityUserInputLabels, setAccessibilityValue, setAccessibilityViewIsModal, setIsAccessibilityElement, setNilValueForKey, setObservationInfo, setShouldGroupAccessibilityChildren, setValueForKey, setValueForKeyPath, setValueForUndefinedKey, setValuesForKeysWithDictionary, shouldGroupAccessibilityChildren, superclass, validateValueForKeyError, validateValueForKeyPathError, valueForKey, valueForKeyPath, valueForUndefinedKey, willChangeValueForKey, willChangeValueForKeyWithSetMutationUsingObjects, willChangeValuesAtIndexesForKey
-
-
-
-
Method Detail
-
accessInstanceVariablesDirectly
public static boolean accessInstanceVariablesDirectly()
-
allAttachments
public NSDictionary<java.lang.String,?> allAttachments()
-
alloc
public static IOSurface alloc()
-
allocWithZone
public static java.lang.Object allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
-
allocationSize
public long allocationSize()
The total allocation size of the IOSurface
-
allowsPixelSizeCasting
public boolean allowsPixelSizeCasting()
This property returns YES if it is legal to choose an OpenGL or Metal pixel format with a bytes per pixel value that is different than the bytesPerElement value(s) of this IOSurface. Returns NO if the bytes per pixel value must be an exact match.
-
attachmentForKey
public java.lang.Object attachmentForKey(java.lang.String key)
-
automaticallyNotifiesObserversForKey
public static boolean automaticallyNotifiesObserversForKey(java.lang.String key)
-
baseAddress
public org.moe.natj.general.ptr.VoidPtr baseAddress()
-
baseAddressOfPlaneAtIndex
public org.moe.natj.general.ptr.VoidPtr baseAddressOfPlaneAtIndex(long planeIndex)
-
bytesPerElement
public long bytesPerElement()
-
bytesPerElementOfPlaneAtIndex
public long bytesPerElementOfPlaneAtIndex(long planeIndex)
-
bytesPerRow
public long bytesPerRow()
Note: These properties may not return well-defined values for planar surfaces
-
bytesPerRowOfPlaneAtIndex
public long bytesPerRowOfPlaneAtIndex(long planeIndex)
-
cancelPreviousPerformRequestsWithTarget
public static void cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)
-
cancelPreviousPerformRequestsWithTargetSelectorObject
public static void cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget, org.moe.natj.objc.SEL aSelector, java.lang.Object anArgument)
-
classFallbacksForKeyedArchiver
public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
-
classForKeyedUnarchiver
public static org.moe.natj.objc.Class classForKeyedUnarchiver()
-
debugDescription_static
public static java.lang.String debugDescription_static()
-
decrementUseCount
public void decrementUseCount()
-
description_static
public static java.lang.String description_static()
-
elementHeight
public long elementHeight()
-
elementHeightOfPlaneAtIndex
public long elementHeightOfPlaneAtIndex(long planeIndex)
-
elementWidth
public long elementWidth()
-
elementWidthOfPlaneAtIndex
public long elementWidthOfPlaneAtIndex(long planeIndex)
-
encodeWithCoder
public void encodeWithCoder(NSCoder coder)
- Specified by:
encodeWithCoderin interfaceNSCoding
-
hash_static
public static long hash_static()
-
height
public long height()
-
heightOfPlaneAtIndex
public long heightOfPlaneAtIndex(long planeIndex)
-
incrementUseCount
public void incrementUseCount()
-
initWithCoder
public IOSurface initWithCoder(NSCoder coder)
Description copied from interface:NSCodingNS_DESIGNATED_INITIALIZER- Specified by:
initWithCoderin interfaceNSCoding
-
initWithProperties
public IOSurface initWithProperties(NSDictionary<java.lang.String,?> properties)
Create a new IOSurface
-
instanceMethodForSelector
public static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
-
instanceMethodSignatureForSelector
public static NSMethodSignature instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)
-
instancesRespondToSelector
public static boolean instancesRespondToSelector(org.moe.natj.objc.SEL aSelector)
-
isInUse
public boolean isInUse()
There are cases where it is useful to know whether or not an IOSurface buffer is considered to be "in use" by other users of the same IOSurface. In particular, CoreVideo and other APIs make use of the IOSurface use count facility to know when it is safe to recycle an IOSurface backed CVPixelBuffer object. This is particularly important when IOSurface objects are being shared across process boundaries and the normal mechanisms one might use would not be viable. The IOSurface use count is similar in concept to any other reference counting scheme. When the global use count of an IOSurface goes to zero, it is no longer considered "in use". When it is anything other than zero, then the IOSurface is still "in use" by someone and therefore anyone attempting to maintain a pool of IOSurfaces to be recycled should not reclaim that IOSurface. Note that IOSurface maintains both a per-process and an internal system wide usage count. In the current implementation, when the per-process usage count goes from zero to one, the system wide usage count is incremented by one. When the per-process usage count drops back to zero (either via explicit decrement calls or the process terminates), the global usage count is decremented by one.
-
isSubclassOfClass
public static boolean isSubclassOfClass(org.moe.natj.objc.Class aClass)
-
keyPathsForValuesAffectingValueForKey
public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey(java.lang.String key)
-
localUseCount
public int localUseCount()
The localUseCount property returns the local per-process usage count for an IOSurface. This call is only provided for logging/debugging purposes and should never be used to determine whether an IOSurface is considered to be "in use". The isInUse property is the only call that should be used for that purpose.
-
lockWithOptionsSeed
public int lockWithOptionsSeed(int options, org.moe.natj.general.ptr.IntPtr seed)"Lock" or "Unlock" a IOSurface for reading or writing. The term "lock" is used loosely in this context, and is simply used along with the "unlock" information to put a bound on CPU access to the raw IOSurface data. If the seed parameter is non-NULL, IOSurfaceLock() will store the buffer's internal modification seed value at the time you made the lock call. You can compare this value to a value returned previously to determine of the contents of the buffer has been changed since the last lock. In the case of IOSurfaceUnlock(), the seed value returned will be the internal seed value at the time of the unlock. If you locked the buffer for writing, this value will be incremented as the unlock is performed and the new value will be returned. See the IOSurfacePropertyKeyLock enums for more information. Note: Locking and unlocking a IOSurface is not a particularly cheap operation, so care should be taken to avoid the calls whenever possible. The seed values are particularly useful for keeping a cache of the buffer contents.
-
new_objc
public static java.lang.Object new_objc()
-
pixelFormat
public int pixelFormat()
-
planeCount
public long planeCount()
Return the number of planes in this buffer. Will be 0 if the surface is non-planar
-
removeAllAttachments
public void removeAllAttachments()
-
removeAttachmentForKey
public void removeAttachmentForKey(java.lang.String key)
-
resolveClassMethod
public static boolean resolveClassMethod(org.moe.natj.objc.SEL sel)
-
resolveInstanceMethod
public static boolean resolveInstanceMethod(org.moe.natj.objc.SEL sel)
-
seed
public int seed()
This will return the current seed value of the buffer and is a cheap property to read to see if the contents of the buffer have changed since the last lock/unlock.
-
setAllAttachments
public void setAllAttachments(NSDictionary<java.lang.String,?> dict)
-
setAttachmentForKey
public void setAttachmentForKey(java.lang.Object anObject, java.lang.String key)These calls let you attach property list types to a IOSurface buffer. These calls are expensive (they essentially must serialize the data into the kernel) and thus should be avoided whenever possible. Note: These functions can not be used to change the underlying surface properties.
-
setPurgeableOldState
public int setPurgeableOldState(int newState, org.moe.natj.general.ptr.IntPtr oldState)See comments in IOSurfaceAPI.h
-
setVersion_static
public static void setVersion_static(long aVersion)
-
superclass_static
public static org.moe.natj.objc.Class superclass_static()
-
supportsSecureCoding
public static boolean supportsSecureCoding()
-
_supportsSecureCoding
public boolean _supportsSecureCoding()
Description copied from interface:NSSecureCodingThis property must return YES on all classes that allow secure coding. Subclasses of classes that adopt NSSecureCoding and override initWithCoder: must also override this method and return YES. The Secure Coding Guide should be consulted when writing methods that decode data.- Specified by:
_supportsSecureCodingin interfaceNSSecureCoding
-
unlockWithOptionsSeed
public int unlockWithOptionsSeed(int options, org.moe.natj.general.ptr.IntPtr seed)
-
version_static
public static long version_static()
-
width
public long width()
Basic surface layout information
-
widthOfPlaneAtIndex
public long widthOfPlaneAtIndex(long planeIndex)
These properties return information about a particular plane of a IOSurface. They will raise if called on non-planar surfaces or if the index value is not less than the number of planes.
-
-