1from dataclasses
import dataclass
3from typing
import Type, Any
5from ids_peak_common.datatypes.geometry.rectangle
import Rectangle
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 Device exposure time the image was captured with.
89 Specified in microseconds (µs).
95 Timestamp of the system since unix epoch in nanoseconds.
97 Provides the system timestamp corresponding to the device timestamp,
98 expressed as nanoseconds since the Unix epoch (00:00:00 UTC on January 1, 1970).
99 This allows data to be associated with a system time, for example
100 for logging or correlating with other system events.
102 The system timestamp is not intended for high-precision timing due to
103 device-side timestamping and host processing delays. For applications
104 requiring high timing accuracy, use the DeviceTimestamp directly.
107 DEVICE_EXPOSURE_TIME_SEQUENCE =
_MetadataKeyInfo(
"DeviceExposureTimeSequence", list[float])
110 Device exposure time sequence the image was captured with.
112 This feature applies exclusively to HDR pixel formats
113 where multiple exposures are acquired within a single image frame.
114 During unpacking, the individual exposures are separated into distinct images,
115 and the corresponding exposure time for each image is written to DEVICE_EXPOSURE_TIME
117 Specified in microseconds (µs).
119 @since ids_peak_common 1.3
125 Device gain the image was captured with.
131 Device gain sequence the image was captured with.
133 This feature applies exclusively to HDR pixel formats
134 where multiple gains are used for acquisition within a single image frame.
135 During unpacking, the individual gains are separated into distinct images,
136 and the corresponding gain for each image is written to DEVICE_GAIN
142 @brief Return the string_value for this metadata key."""
143 return self.value.string_value
148 @brief Return the expected Python type for this metadata key."""
149 return self.value.type
154 Return a human-readable string of the MetadataKey object.
156 return f
"{self.string_value} ({self.type.__name__})"
161 Return an unambiguous string of the MetadataKey object.
163 return (f
"{self.__class__.__name__}.{self.name}"
164 f
"(string_value={self.value.string_value!r}, "
165 f
"type={self.value.type!r})")