:py:mod:`viam.media.viam_rgba_plugin` ===================================== .. py:module:: viam.media.viam_rgba_plugin Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: viam.media.viam_rgba_plugin.RGBAEncoder viam.media.viam_rgba_plugin.RGBAImage viam.media.viam_rgba_plugin.RGBADecoder Attributes ~~~~~~~~~~ .. autoapisummary:: viam.media.viam_rgba_plugin.RGBA_MAGIC_NUMBER viam.media.viam_rgba_plugin.RGBA_FORMAT_LABEL viam.media.viam_rgba_plugin.RGBA_HEADER_LENGTH .. py:data:: RGBA_MAGIC_NUMBER .. py:data:: RGBA_FORMAT_LABEL :value: 'VIAM_RGBA' .. py:data:: RGBA_HEADER_LENGTH :value: 12 .. py:class:: RGBAEncoder(mode, *args) Bases: :py:obj:`PIL.ImageFile.PyEncoder` Python implementation of a format encoder. Override this class and add the decoding logic in the :meth:`encode` method. See :ref:`Writing Your Own File Codec in Python` .. py:attribute:: ENCODER_NAME .. py:method:: encode(bufsize) Override to perform the encoding process. :param bufsize: Buffer size. :returns: A tuple of ``(bytes encoded, errcode, bytes)``. If finished with encoding return 1 for the error code. Err codes are from :data:`.ImageFile.ERRORS`. .. py:class:: RGBAImage(fp=None, filename=None) Bases: :py:obj:`PIL.ImageFile.ImageFile` Base class for image file format handlers. .. py:attribute:: format :type: ClassVar[str] .. py:attribute:: format_description :value: "Viam's Raw RGBA Format" .. py:method:: close() -> None Closes the file pointer, if possible. This operation will destroy the image core and release its memory. The image data will be unusable afterward. This function is required to close images that have multiple frames or have not had their file read and closed by the :py:meth:`~PIL.Image.Image.load` method. See :ref:`file-handling` for more information. .. py:class:: RGBADecoder(mode, *args) Bases: :py:obj:`PIL.ImageFile.PyDecoder` Python implementation of a format decoder. Override this class and add the decoding logic in the :meth:`decode` method. See :ref:`Writing Your Own File Codec in Python` .. py:method:: decode(buffer) -> Tuple[int, int] Override to perform the decoding process. :param buffer: A bytes object with the data to be decoded. :returns: A tuple of ``(bytes consumed, errcode)``. If finished with decoding return -1 for the bytes consumed. Err codes are from :data:`.ImageFile.ERRORS`.