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: typing_extensions.ClassVar[typing_extensions.Self] .. py:attribute:: VIAM_RAW_DEPTH :type: typing_extensions.ClassVar[typing_extensions.Self] .. py:attribute:: JPEG :type: typing_extensions.ClassVar[typing_extensions.Self] .. py:attribute:: PNG :type: typing_extensions.ClassVar[typing_extensions.Self] .. py:attribute:: PCD :type: typing_extensions.ClassVar[typing_extensions.Self] .. py:property:: name :type: str .. py:property:: value :type: str .. py:method:: CUSTOM(mime_type: str) -> typing_extensions.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) -> typing_extensions.Self :classmethod: Return the mimetype from a string. :param value: The mimetype as a string :type value: str :returns: The mimetype :rtype: Self .. py:method:: from_proto(format: viam.proto.component.camera.Format.ValueType) -> typing_extensions.Self :classmethod: Returns the mimetype from a proto enum. :param format: The mimetype in a proto enum. :type format: Format.ValueType :returns: The mimetype. :rtype: Self .. py:property:: proto :type: viam.proto.component.camera.Format.ValueType Returns the mimetype in a proto enum. :returns: The mimetype in a proto enum. :rtype: Format.ValueType .. py:method:: to_proto() -> viam.proto.component.camera.Format.ValueType DEPRECATED: Use `CameraMimeType.proto` .. 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