1from dataclasses
import dataclass
3from typing
import Type, Any
17 Enumerates all compile-time known metadata keys.
19 Each enum value carries both:
20 - A string identifier (used internally in Metadata).
21 - The expected Python type of its value.
23 This makes it easy to use type-safe keys without an extra trait class.
27 key = MetadataKey.DEVICE_TIMESTAMP
28 print(key.string_value) # outputs: device_timestamp
29 print(key.type) # outputs: <class 'int'>
31 @ingroup ids_peak_common_python_types
37 Device-provided image acquisition timestamp in nanoseconds.
39 The timestamp is expressed in nanoseconds and is relative to an
40 unspecified reference point (t = 0). It does not represent an
41 absolute wall-clock time, but instead the elapsed time since
42 that reference. The difference between timestamps of consecutive
43 images indicates the time interval between their recordings.
49 A sequentially incremented identifier for the frame.
51 The frame ID is a sequentially incremented value that increases by one
52 from one frame to the next. It serves as a means to detect missing or
53 out-of-order frames in a stream. Once the maximum value supported by
54 the underlying technology is reached, the frame ID wraps back to zero.
55 The exact wrap-around point is not fixed and depends on the implementation.
61 Horizontal pixel binning factor.
63 Indicates how many adjacent pixels are combined horizontally.
69 Vertical pixel binning factor.
71 Indicates how many adjacent pixels are combined vertically.
77 Region of interest applied to the image.
79 Defines the rectangular area of the image that remains after
80 processing steps such as cropping or scaling were applied.
81 Coordinates and dimensions are expressed in pixels.
87 @brief Return the string_value for this metadata key."""
88 return self.value.string_value
91 def type(self) -> Type[Any]:
93 @brief Return the expected Python type for this metadata key."""
94 return self.value.type
99 Return a human-readable string of the MetadataKey object.
101 return f
"{self.string_value} ({self.type.__name__})"
106 Return an unambiguous string of the MetadataKey object.
108 return (f
"{self.__class__.__name__}.{self.name}"
109 f
"(string_value={self.value.string_value!r}, "
110 f
"type={self.value.type!r})")