RRTrueDepthCaptureView

Objective-C


@interface RRTrueDepthCaptureView : UIView <ARSessionDelegate>

Swift

class RRTrueDepthCaptureView : UIView, ARSessionDelegate

This view provides functionality to capture color and depth information of human faces. The captured data can be used to create photorealistic avatars.

  • The delegate that should receive capturing related callbacks.

    Declaration

    Objective-C

    @property (nonatomic, weak) id<RRTrueDepthCaptureViewDelegate> _Nullable delegate;

    Swift

    weak var delegate: RRTrueDepthCaptureViewDelegate? { get set }
  • This property holds the current capturing instruction to guide the user. It should not be necessary to poll this property. The RRTrueDepthCaptureViewDelegate provides [RRTrueDepthCaptureViewDelegate trueDepthCaptureView:updatedCaptureInstruction:] to get informed about changes of this property.

    Declaration

    Objective-C

    @property (nonatomic, readonly) RRTrueDepthCaptureViewCaptureInstruction currentCaptureInstruction;

    Swift

    var currentCaptureInstruction: RRTrueDepthCaptureViewCaptureInstruction { get }
  • This property holds the current capturing warning to guide the user. It should not be necessary to poll this property. The RRTrueDepthCaptureViewDelegate provides [RRTrueDepthCaptureViewDelegate trueDepthCaptureView:captureWarning:] to get informed about changes of this property.

    Declaration

    Objective-C

    @property (nonatomic, readonly) RRTrueDepthCaptureViewCaptureWarning currentCaptureWarning;

    Swift

    var currentCaptureWarning: RRTrueDepthCaptureViewCaptureWarning { get }
  • This property defines which head capturing mode should be performed. Available options are defined in RRTrueDepthCaptureViewMode.

    Declaration

    Objective-C

    @property (nonatomic) RRTrueDepthCaptureViewMode capturingMode;

    Swift

    var capturingMode: RRTrueDepthCaptureViewMode { get set }
  • This property is set to YES as long as the capturing process is active.

    Declaration

    Objective-C

    @property (readonly) BOOL isCapturing;

    Swift

    var isCapturing: Bool { get }
  • This property defines if the capturing should be finished before reaching the maximum number of frames if a decent coverage is achieved. This property is just used for circular capturing mode.

    Declaration

    Objective-C

    @property (nonatomic) BOOL finishOnDecentCoverage;

    Swift

    var finishOnDecentCoverage: Bool { get set }
  • The total number of captured frames.

    Declaration

    Objective-C

    @property (readonly) NSUInteger capturedFramesCount;

    Swift

    var capturedFramesCount: UInt { get }
  • This method retrieves a captured frame object for a given frame ID

    Declaration

    Objective-C

    - (RRTrueDepthKeyframe *_Nullable)getCapturedKeyframeForFrameID:
        (NSUInteger)frameID;

    Swift

    func getCapturedKeyframe(forFrameID frameID: UInt) -> RRTrueDepthKeyframe?

    Parameters

    frameID

    The frame ID. First frame is frameID=0

    Return Value

    The keyframe for the given ID or nil if not yet captured or the frameID is not vald.

  • This method starts the capturing process. The view stores the captured frames in a temporary directory to save cpu memory.

    Declaration

    Objective-C

    - (void)startCapturingWithStorageDirectory:(NSURL *_Nonnull)storageDirectory;

    Swift

    func startCapturing(withStorageDirectory storageDirectory: URL)

    Parameters

    storageDirectory

    A directory where the view should write the captured frames to. After reading all the frames from the view it is safe to delete the contents of this directory again.

  • This method stops the capturing if a capturing is currently active

    Declaration

    Objective-C

    - (void)stopCapturing;

    Swift

    func stopCapturing()