CameraFrameNumber


value 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

Public functions

open String

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

Public properties

Long

The non-negative Long representing the frame identifier.

Public constructors

CameraFrameNumber

Added in 1.7.0-alpha03
CameraFrameNumber(value: Long)

Public functions

toString

open fun toString(): String

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

Public properties

value

Added in 1.7.0-alpha03
val valueLong

The non-negative Long representing the frame identifier.