Class AVDepthData

  • All Implemented Interfaces:
    NSObject

    public class AVDepthData
    extends NSObject
    AVDepthData An object wrapping a map of disparity or depth pixel data, plus metadata. "Depth Data" is a generic term for a map of pixel data containing depth-related information. AVDepthData wraps a disparity or depth map and provides conversion methods, focus information, and camera calibration data to aid in using the map for rendering or computer vision tasks. CoreVideo supports the following four depth data pixel formats: kCVPixelFormatType_DisparityFloat16 = 'hdis' kCVPixelFormatType_DisparityFloat32 = 'fdis' kCVPixelFormatType_DepthFloat16 = 'hdep' kCVPixelFormatType_DepthFloat32 = 'fdep' The disparity formats describe normalized shift values when comparing two images. Units are 1/meters: ( pixelShift / (pixelFocalLength * baselineInMeters) ). The depth formats describe the distance to an object in meters. Disparity / depth maps are generated from camera images containing non-rectilinear data. Camera lenses have small imperfections that cause small distortions in their resultant images compared to a pinhole camera. AVDepthData maps contain non-rectilinear (non-distortion-corrected) data as well. Their values are warped to match the lens distortion characteristics present in their accompanying YUV image. Therefore an AVDepthData map can be used as a proxy for depth when rendering effects to its accompanying image, but not to correlate points in 3D space. In order to use AVDepthData for computer vision tasks, you should use its accompanying camera calibration data to rectify the depth data (see AVCameraCalibrationData). When capturing depth data from a camera using AVCaptureDepthDataOutput, AVDepthData objects are delivered to your AVCaptureDepthDataOutputDelegate in a streaming fashion. When capturing depth data along with photos using AVCapturePhotoOutput, depth data is delivered to your AVCapturePhotoCaptureDelegate as a property of an AVCapturePhoto (see -[AVCapturePhotoCaptureDelegate captureOutput:didFinishProcessingPhoto:error:]). When working with image files containing depth information, AVDepthData may be instantiated using information obtained from ImageIO. When editing images containing depth information, derivative AVDepthData objects may be instantiated reflecting the edits that have been performed.
    • Constructor Detail

      • AVDepthData

        protected AVDepthData​(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)
      • availableDepthDataTypes

        public NSArray<? extends NSNumber> availableDepthDataTypes()
        [@property] availableDepthDataTypes Specifies which depth data pixel formats may be used with depthDataByConvertingToDepthDataType:. This property presents the available pixel format types as an array of NSNumbers, each wrapping an OSType (CV pixel format type).
      • cameraCalibrationData

        public AVCameraCalibrationData cameraCalibrationData()
        [@property] cameraCalibrationData The calibration data of the camera with which AVDepthData map's values are aligned. See AVCameraCalibrationData for more information. This property may return nil if no camera calibration data is available for the depth data.
      • 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()
      • depthDataAccuracy

        public long depthDataAccuracy()
        [@property] depthDataAccuracy Specifies the accuracy of the units in the depth data map's values. See AVDepthDataAccuracy documentation for more information.
      • depthDataByApplyingExifOrientation

        public java.lang.Object depthDataByApplyingExifOrientation​(int exifOrientation)
        depthDataByApplyingExifOrientation: Returns a derivative AVDepthData instance in which the specified Exif orientation has been applied. When applying simple 90 degree rotation or mirroring edits to media containing depth data, you may use this initializer to create a derivative copy of the depth in which the specified orientation is applied to both the underlying pixel map data and the camera calibration data. This method throws an NSInvalidArgumentException if you pass an unrecognized exifOrientation.
        Parameters:
        exifOrientation - One of the 8 standard Exif orientation tags expressing how the depth data should be rotated / mirrored.
        Returns:
        An AVDepthData instance.
      • depthDataByConvertingToDepthDataType

        public java.lang.Object depthDataByConvertingToDepthDataType​(int depthDataType)
        depthDataByConvertingToDepthDataType: Returns a converted, derivative AVDepthData instance in the specified depthDataType. This method throws an NSInvalidArgumentException if you pass an unrecognized depthDataType. See
        Parameters:
        depthDataType - The OSType of depthData object to which you'd like to convert. Must be present in availableDepthDataTypes.
        Returns:
        An AVDepthData instance.
      • depthDataByReplacingDepthDataMapWithPixelBufferError

        public java.lang.Object depthDataByReplacingDepthDataMapWithPixelBufferError​(CVBufferRef pixelBuffer,
                                                                                     org.moe.natj.general.ptr.Ptr<NSError> outError)
        depthDataByReplacingDepthDataMapWithPixelBuffer:error: Returns an AVDepthData instance wrapping the replacement depth data map pixel buffer. When applying complex edits to media containing depth data, you may create a derivative map with arbitrary transforms applied to it, then use this initializer to create a new AVDepthData. Note that this new depth data object has no camera calibration data, so its cameraCalibrationData property always returns nil.
        Parameters:
        pixelBuffer - A pixel buffer containing depth data information in one of the 4 supported disparity / depth pixel formats.
        outError - On return, if the depth data cannot be created, points to an NSError describing the problem.
        Returns:
        An AVDepthData instance, or nil if the pixel buffer is malformed.
      • depthDataFromDictionaryRepresentationError

        public static AVDepthData depthDataFromDictionaryRepresentationError​(NSDictionary<?,​?> imageSourceAuxDataInfoDictionary,
                                                                             org.moe.natj.general.ptr.Ptr<NSError> outError)
        depthDataFromDictionaryRepresentation:error: Returns an AVDepthData instance from depth information in an image file. When using ImageIO framework's CGImageSource API to read from a HEIF or JPEG file containing depth data, AVDepthData can be instantiated using the result of CGImageSourceCopyAuxiliaryDataInfoAtIndex, which returns a CFDictionary of primitive map information.
        Parameters:
        imageSourceAuxDataInfoDictionary - A dictionary of primitive depth-related information obtained from CGImageSourceCopyAuxiliaryDataInfoAtIndex.
        outError - On return, if the depth data cannot be created, points to an NSError describing the problem.
        Returns:
        An AVDepthData instance, or nil if the auxiliary data info dictionary was malformed.
      • depthDataMap

        public CVBufferRef depthDataMap()
        [@property] depthDataMap Provides access to the depth data object's internal map. The depth data map's pixel format can be queried using the depthDataType property.
      • depthDataQuality

        public long depthDataQuality()
        [@property] depthDataQuality Specifies the overall quality of the depth data map's values. See AVDepthDataQuality documentation for more information.
      • depthDataType

        public int depthDataType()
        [@property] depthDataType Specifies the pixel format type of this depth data object's internal map. One of kCVPixelFormatType_DisparityFloat16, kCVPixelFormatType_DisparityFloat32, kCVPixelFormatType_DepthFloat16, or kCVPixelFormatType_DepthFloat32.
      • description_static

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

        public NSDictionary<?,​?> dictionaryRepresentationForAuxiliaryDataType​(org.moe.natj.general.ptr.Ptr<NSString> outAuxDataType)
        dictionaryRepresentationForAuxiliaryDataType: Returns a dictionary of primitive map information to be used when writing an image file with depth data. When using ImageIO framework's CGImageDestination API to write depth data to a HEIF or JPEG file, you may use this method to generate a dictionary of primitive map information consumed by CGImageDestinationAddAuxiliaryDataInfo.
        Parameters:
        outAuxDataType - On output, either kCGImageAuxiliaryDataTypeDisparity or kCGImageAuxiliaryDataTypeDepth, depending on the depth data's file.
        Returns:
        A dictionary of CGImageDestination compatible depth information, or nil if the auxDataType is unsupported.
      • hash_static

        public static long hash_static()
      • instanceMethodSignatureForSelector

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

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

        public boolean isDepthDataFiltered()
        [@property] depthDataFiltered Specifies whether the depth data pixel buffer map contains filtered (hole-filled) data. By setting either AVCaptureDepthDataOutput's filteringEnabled property or AVCapturePhotoSettings' depthDataFiltered property to YES, the resulting depth data are filtered to remove invalid pixel values that may be present due to a variety of factors including low light and lens occlusion. If you've requested depth data filtering, all depth data holes are filled. Note that filtering the depth data makes it more usable for applying effects, but alters the data such that it may no longer be suitable for computer vision tasks. Unfiltered depth maps present missing data as NaN.
      • 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()
      • resolveClassMethod

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

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

        public static void setVersion_static​(long aVersion)
      • superclass_static

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

        public static long version_static()