SpatialExternalSurface

Functions summary

Unit
@Composable
@SubspaceComposable
SpatialExternalSurface(
    stereoMode: StereoMode,
    modifier: SubspaceModifier,
    featheringEffect: SpatialFeatheringEffect?,
    surfaceProtection: SurfaceProtection,
    dragPolicy: DragPolicy?,
    resizePolicy: ResizePolicy?,
    interactionPolicy: InteractionPolicy?,
    superSamplingPattern: SuperSamplingPattern,
    content: @Composable @SubspaceComposable SpatialExternalSurfaceScope.() -> Unit
)

A Composable that creates and owns an Android Surface into which the application can render stereo image content.

Functions

SpatialExternalSurface

@Composable
@SubspaceComposable
fun SpatialExternalSurface(
    stereoMode: StereoMode,
    modifier: SubspaceModifier = SubspaceModifier,
    featheringEffect: SpatialFeatheringEffect? = null,
    surfaceProtection: SurfaceProtection = SurfaceProtection.None,
    dragPolicy: DragPolicy? = null,
    resizePolicy: ResizePolicy? = null,
    interactionPolicy: InteractionPolicy? = null,
    superSamplingPattern: SuperSamplingPattern = SuperSamplingPattern.Pentagon,
    content: @Composable @SubspaceComposable SpatialExternalSurfaceScope.() -> Unit
): Unit

A Composable that creates and owns an Android Surface into which the application can render stereo image content. This can be thought of as the spatial equivalent of AndroidExternalSurface. This Surface is texture mapped to the canvas, and if a stereoscopic StereoMode is specified, then the User will see left and right eye content mapped to the appropriate display. Width and height will default to 400 pixels if it is not specified using size modifiers.

It is not currently possible to synchronize StereoMode changes with application rendering or video decoding. This composable currently cannot render in front of other panels, so dragPolicy usage is not recommended if there are other panels in the layout, aside from the content block of this Composable.

Playing certain content will require the proper SurfaceProtection. This is mainly used to protect DRM video content.

Parameters
stereoMode: StereoMode

The StereoMode which describes how parts of the surface are displayed to the user's eyes. This will affect how the content is interpreted and displayed on the surface.

modifier: SubspaceModifier = SubspaceModifier

SubspaceModifiers to apply to the SpatialSurfacePanel.

featheringEffect: SpatialFeatheringEffect? = null

A SpatialFeatheringEffect to apply to to canvas of the surface exposed from SpatialExternalSurfaceScope.onSurfaceCreated.

surfaceProtection: SurfaceProtection = SurfaceProtection.None

Sets the Surface's content protection. Use this to redact content in screen recordings. Setting this to SurfaceProtection.Protected is required if decoding DRM media content.

dragPolicy: DragPolicy? = null

An optional DragPolicy that defines the motion behavior of the SpatialPanel. This can be either a MovePolicy for free movement or an AnchorPolicy for anchoring to real-world surfaces. If a policy is provided, draggable UI controls will be shown, allowing the user to manipulate the panel in 3D space. If null, no motion behavior is applied.

resizePolicy: ResizePolicy? = null

An optional ResizePolicy configuration object that resizing behavior of this SpatialPanel. The draggable UI controls will be shown that allow the user to resize the element in 3D space. If null, there is no resize behavior applied to the element.

interactionPolicy: InteractionPolicy? = null

An optional InteractionPolicy that can be set to detect input events.

superSamplingPattern: SuperSamplingPattern = SuperSamplingPattern.Pentagon

The pattern to use to super sample this surface, or SuperSamplingPattern.None to disable super sampling.

content: @Composable @SubspaceComposable SpatialExternalSurfaceScope.() -> Unit

Content block where the surface can be accessed using SpatialExternalSurfaceScope.onSurfaceCreated. Composable content will be rendered over the Surface canvas. If using StereoMode.SideBySide or StereoMode.TopBottom, it is recommended to offset Composable content far enough to avoid depth perception issues.