Skip to main content
API Reference NSDK NSDKCamera

viewportRect

Returns the viewport rect to use when rendering into the given drawable size....

Declaration

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

Summary

Returns the viewport rect to use when rendering into the given drawable size.
- Live: returns the full drawable (origin zero, size = drawableSize).
- Playback: returns an aspect-fill rect so the camera image aligns with the rendered content; pass displayOrientation (current device orientation) so the viewport fits correctly in portrait and landscape.