SpatialAnnotationTrackingOptions.Builder


public final class SpatialAnnotationTrackingOptions.Builder


Builder for SpatialAnnotationTrackingOptions.

Summary

Public constructors

Builder(
    @NonNull ByteBuffer imageBuffer,
    @NonNull IntSize2d imageSize,
    long timestampNanos
)

Public methods

final @NonNull SpatialAnnotationTrackingOptions

Builds a new SpatialAnnotationTrackingOptions instance.

final @NonNull SpatialAnnotationTrackingOptions.Builder

Sets the physical alignment behavior of the resulting 3D quad.

final @NonNull SpatialAnnotationTrackingOptions.Builder

Sets the pixel format encoding.

final @NonNull SpatialAnnotationTrackingOptions.Builder

Sets the raw image byte buffer from the camera frame.

final @NonNull SpatialAnnotationTrackingOptions.Builder

Sets the 2D pixel dimensions of the image buffer.

final @NonNull SpatialAnnotationTrackingOptions.Builder

Sets the bounding quadrilaterals mapped to their unique tracking IDs.

final @NonNull SpatialAnnotationTrackingOptions.Builder
setRowStride(int rowStride)

Sets the row stride (bytes per row) of the image buffer.

final @NonNull SpatialAnnotationTrackingOptions.Builder
setTimestampNanos(long timestampNanos)

Sets the system timestamp in nanoseconds correlating to the camera frame, using the System.nanoTime clock base.

Public constructors

Builder

Added in 1.1.0-alpha01
public Builder(
    @NonNull ByteBuffer imageBuffer,
    @NonNull IntSize2d imageSize,
    long timestampNanos
)
Parameters
@NonNull ByteBuffer imageBuffer

the raw image byte buffer from the camera frame

@NonNull IntSize2d imageSize

the 2D pixel dimensions of the image buffer

long timestampNanos

the system timestamp in nanoseconds correlating to the camera frame, using the System.nanoTime clock base

Public methods

build

Added in 1.1.0-alpha01
public final @NonNull SpatialAnnotationTrackingOptions build()

Builds a new SpatialAnnotationTrackingOptions instance.

Throws
IllegalStateException

if required fields were not explicitly set

setAlignment

Added in 1.1.0-alpha01
public final @NonNull SpatialAnnotationTrackingOptions.Builder setAlignment(@NonNull SpatialAnnotationQuadAlignment alignment)

Sets the physical alignment behavior of the resulting 3D quad. Defaults to SCREEN.

setFormat

Added in 1.1.0-alpha01
public final @NonNull SpatialAnnotationTrackingOptions.Builder setFormat(@NonNull SpatialAnnotationImageFormat format)

Sets the pixel format encoding. Defaults to RGBA.

setImageBuffer

Added in 1.1.0-alpha01
public final @NonNull SpatialAnnotationTrackingOptions.Builder setImageBuffer(@NonNull ByteBuffer imageBuffer)

Sets the raw image byte buffer from the camera frame.

setImageSize

Added in 1.1.0-alpha01
public final @NonNull SpatialAnnotationTrackingOptions.Builder setImageSize(@NonNull IntSize2d imageSize)

Sets the 2D pixel dimensions of the image buffer.

setQuads

Added in 1.1.0-alpha01
public final @NonNull SpatialAnnotationTrackingOptions.Builder setQuads(@NonNull Map<@NonNull SpatialAnnotationId, @NonNull Quad> quads)

Sets the bounding quadrilaterals mapped to their unique tracking IDs.

setRowStride

Added in 1.1.0-alpha01
public final @NonNull SpatialAnnotationTrackingOptions.Builder setRowStride(int rowStride)

Sets the row stride (bytes per row) of the image buffer.

setTimestampNanos

Added in 1.1.0-alpha01
public final @NonNull SpatialAnnotationTrackingOptions.Builder setTimestampNanos(long timestampNanos)

Sets the system timestamp in nanoseconds correlating to the camera frame, using the System.nanoTime clock base.