streaming.frames#
zen_api_utils.streaming.frames
#
Decode and validate ZEN pixel-stream payloads.
Functions:
-
decode_frame–Decode a row-major grayscale payload with a caller-supplied dtype.
-
decode_pixel_payload–Decode a ZEN payload using its protocol pixel type metadata.
-
runtime_grayscale_dtype–Return and validate the dtype reported by a streamed grayscale frame.
decode_frame
#
decode_frame(raw_data: bytes, dtype: dtype, width: int, height: int) -> np.ndarray
Decode a row-major grayscale payload with a caller-supplied dtype.
decode_pixel_payload
#
decode_pixel_payload(raw_data: bytes, width: int, height: int, pixel_type: PixelType) -> np.ndarray
Decode a ZEN payload using its protocol pixel type metadata.
runtime_grayscale_dtype
#
runtime_grayscale_dtype(pixel_type: PixelType, payload_size: int, width: int, height: int) -> np.dtype
Return and validate the dtype reported by a streamed grayscale frame.