CameraFrameNumber


value public final class CameraFrameNumber


A strongly typed identifier for a camera frame.

A frame number is a unique, monotonically increasing identifier assigned to each frame produced by a camera device. Wrapping this in a value class prevents type confusion with other Long identifiers (such as timestamps, request IDs, or camera IDs) and enforces type safety at compile time.

As a JvmInline value class, it has zero runtime overhead when compiled, as the compiler replaces instances of this class with the underlying Long value where possible.

Example

val frameNumber = CameraFrameNumber(42L)
println(frameNumber.value) // Prints: 42
println(frameNumber) // Prints: Frame-42
Throws
IllegalArgumentException

If value is negative.

See also
frameNumber

Summary

Public constructors

CameraFrameNumber(long value)

Public methods

final long

The non-negative Long representing the frame identifier.

@NonNull String

Returns a string representation of the frame number in the format "Frame-{value}".

Public constructors

CameraFrameNumber

Added in 1.7.0-alpha03
public CameraFrameNumber(long value)

Public methods

getValue

Added in 1.7.0-alpha03
public final long getValue()

The non-negative Long representing the frame identifier.

toString

public @NonNull String toString()

Returns a string representation of the frame number in the format "Frame-{value}".