Package apple.vision

Class VNRequest

  • All Implemented Interfaces:
    NSCopying, NSObject
    Direct Known Subclasses:
    VNImageBasedRequest

    public class VNRequest
    extends NSObject
    implements NSCopying
    VNRequest VNRequest objects describe the operation to be performed as well as act as the recipient of the operation's resultant observations. VNRequest objects are instantiated in a pre-configured nominal state. Prior to sending a VNRequest to a request handler to perform a desired operation, the default configuration can be changed by modifying the values of VNRequest properties. The VNRequest class itself acts as a base class and is not meant to be directly instantiated.
    • Constructor Detail

      • VNRequest

        protected VNRequest​(org.moe.natj.general.Pointer peer)
    • Method Detail

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • allocWithZone

        public static java.lang.Object allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(java.lang.String key)
      • 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()
      • completionHandler

        public VNRequest.Block_completionHandler_ret completionHandler()
        [@property] completionHandler The completion handler block that will be invoked after the request has completed processing.
      • copyWithZone

        public java.lang.Object copyWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
        Specified by:
        copyWithZone in interface NSCopying
      • debugDescription_static

        public static java.lang.String debugDescription_static()
      • description_static

        public static java.lang.String description_static()
      • hash_static

        public static long hash_static()
      • init

        public VNRequest init()
        Creates a new VNRequest with no completion handler.
        Overrides:
        init in class NSObject
      • initWithCompletionHandler

        public VNRequest initWithCompletionHandler​(VNRequest.Block_initWithCompletionHandler completionHandler)
        Creates a new VNRequest with an optional completion handler.
        Parameters:
        completionHandler - The block to be invoked after the request has completed its processing. The completion handler gets executed on the same dispatch queue as the request being executed.
      • instanceMethodSignatureForSelector

        public static NSMethodSignature instanceMethodSignatureForSelector​(org.moe.natj.objc.SEL aSelector)
      • instancesRespondToSelector

        public static boolean instancesRespondToSelector​(org.moe.natj.objc.SEL aSelector)
      • isSubclassOfClass

        public static boolean isSubclassOfClass​(org.moe.natj.objc.Class aClass)
      • keyPathsForValuesAffectingValueForKey

        public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(java.lang.String key)
      • new_objc

        public static java.lang.Object new_objc()
      • preferBackgroundProcessing

        public boolean preferBackgroundProcessing()
        A hint used to minimize the resource burden of the request. Memory footprint, processing footprint and/or CPU/GPU contention will be reduced (depending on the request), at the potential cost of longer execution time. This can help, for example, with ensuring UI updates and rendering are not getting blocked by Vision processing.
      • resolveClassMethod

        public static boolean resolveClassMethod​(org.moe.natj.objc.SEL sel)
      • resolveInstanceMethod

        public static boolean resolveInstanceMethod​(org.moe.natj.objc.SEL sel)
      • results

        public NSArray<?> results()
        [@property] results The collection of VNObservations generated by the processing of the request. The only valid time to access this property is after the request has been processed by a request handler. If the request failed, this property will be nil; otherwise, it will be an array of zero or more VNObservation subclasses specific to the VNRequest subclass.
      • setPreferBackgroundProcessing

        public void setPreferBackgroundProcessing​(boolean value)
        A hint used to minimize the resource burden of the request. Memory footprint, processing footprint and/or CPU/GPU contention will be reduced (depending on the request), at the potential cost of longer execution time. This can help, for example, with ensuring UI updates and rendering are not getting blocked by Vision processing.
      • setUsesCPUOnly

        public void setUsesCPUOnly​(boolean value)
        This property, if set to YES, signifies that the request should be performed exclusively on the CPU and not on the GPU. The default value is NO, which signifies that the request is free to leverage the GPU to accelerate any work the request may require.
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • superclass_static

        public static org.moe.natj.objc.Class superclass_static()
      • usesCPUOnly

        public boolean usesCPUOnly()
        This property, if set to YES, signifies that the request should be performed exclusively on the CPU and not on the GPU. The default value is NO, which signifies that the request is free to leverage the GPU to accelerate any work the request may require.
      • version_static

        public static long version_static()
      • cancel

        public void cancel()
        Tries to abort the request as soon as possible. Results will be nil. The completionHandler (if present) will be called with an error of VNErrorRequestCancelled.
      • currentRevision

        public static long currentRevision()
        Provides the current revison supported by the request.
      • defaultRevision

        public static long defaultRevision()
        Provides the revision of the request that was latest for the particular SDK that was linked with the client application.
      • revision

        public long revision()
        The specific algorithm or implementation revision that is to be used to perform the request.
      • setRevision

        public void setRevision​(long value)
        The specific algorithm or implementation revision that is to be used to perform the request.
      • supportedRevisions

        public static NSIndexSet supportedRevisions()
        Provides the collection of currently-supported algorithm or implementation versions for the class of request. This method allows clients to introspect at runtime what capabilities are available for each class of VNRequest in the Vision framework.