viam.media.video ================ .. py:module:: viam.media.video Classes ------- .. autoapisummary:: viam.media.video.CameraMimeType viam.media.video.ViamImage viam.media.video.NamedImage Module Contents --------------- .. py:class:: CameraMimeType Bases: :py:obj:`str` The compatible mime-types for cameras and vision services. You can use the `CameraMimeType.CUSTOM(...)` method to use an unlisted mime-type. .. py:attribute:: VIAM_RGBA :type: ClassVar[Self] .. py:attribute:: VIAM_RAW_DEPTH :type: ClassVar[Self] .. py:attribute:: JPEG :type: ClassVar[Self] .. py:attribute:: PNG :type: ClassVar[Self] .. py:attribute:: PCD :type: ClassVar[Self] .. py:property:: name :type: str .. py:property:: value :type: str .. py:method:: CUSTOM(mime_type: str) -> Self :classmethod: Create a custom mime type. :param mime_type: The mimetype as a string :type mime_type: str .. py:method:: from_string(value: str) -> Self :classmethod: Return the mimetype from a string. :param value: The mimetype as a string :type value: str :returns: The mimetype :rtype: Self .. py:class:: ViamImage(data: bytes, mime_type: CameraMimeType) A native implementation of an image. Provides the raw data and the mime type. .. py:property:: data :type: bytes The raw bytes of the image .. py:property:: mime_type :type: CameraMimeType The mime type of the image .. py:property:: width :type: Optional[int] The width of the image .. py:property:: height :type: Optional[int] The height of the image .. py:method:: bytes_to_depth_array() -> List[List[int]] Decode the data of an image that has the custom depth MIME type ``image/vnd.viam.dep`` into a standard representation. :raises NotSupportedError: Raised if the image is not of MIME type `image/vnd.viam.dep`. :returns: The standard representation of the image. :rtype: List[List[int]] .. py:class:: NamedImage(name: str, data: bytes, mime_type: CameraMimeType) Bases: :py:obj:`ViamImage` An implementation of ViamImage that contains a name attribute. .. py:attribute:: name :type: str The name of the image