Skip to main content
API Reference NSDK PlaybackCamera

viewportRect

Viewport rect that covers the drawable via aspect-fill, matching how NSDKView renders the camera background....

Declaration

func viewportRect(fittingIn drawableSize: CGSize, displayOrientation: UIInterfaceOrientation? = nil) -> CGRect

Summary

Viewport rect that covers the drawable via aspect-fill, matching how NSDKView renders the camera background.
ARKit sensor images are always in landscape orientation.
- Parameters:
- drawableSize: The drawable size (e.g. MTKView drawable size).
- displayOrientation: The current device interface orientation. When provided, the content aspect is computed for that orientation so the viewport fits the drawable when the device is in portrait or landscape. When nil, uses the frame's recorded orientation (backward compatibility).