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 |
| See also | |
|---|---|
frameNumber |
Summary
Public constructors |
|---|
CameraFrameNumber(value: Long) |
Public functions |
|
|---|---|
open String |
toString()Returns a string representation of the frame number in the format "Frame-{value}". |
Public constructors
Public functions
Public properties
value
val value: Long
The non-negative Long representing the frame identifier.