platypush/plugins/camera/__init__.py
def encode_frame(frame, encoding: str = 'jpeg') -> bytes:
        """
        Encode a frame to a target type. The default implementation assumes that frame is a ``PIL.Image`` object.

        :param frame: Image frame (default: a ``PIL.Image`` object).
        :param encoding: Image encoding (e.g. ``jpeg``).
        """
        if not encoding:
            return frame

        with io.BytesIO() as buf:
            frame.save(buf, format=encoding)
            return buf.getvalue()

        Encode a frame to a target type. The default implementation assumes that frame is a ``PIL.Image`` object.

        :param frame: Image frame (default: a ``PIL.Image`` object).
        :param encoding: Image encoding (e.g. ``jpeg``).
        
Encode a frame to a target type. The default implementation assumes that frame is a ``PIL.Image`` object.
Encode a frame to a target type . The default implementation assumes that frame is a ` ` PIL . Image ` ` object .
def encode_frame(frame, encoding: str = 'jpeg') -> bytes:
        if not encoding:
            return frame
        with io.BytesIO() as buf:
            frame.save(buf, format=encoding)
            return buf.getvalue()
def encode_frame ( frame , encoding : str = 'jpeg' ) -> bytes : if not encoding : return frame with io . BytesIO ( ) as buf : frame . save ( buf , format = encoding ) return buf . getvalue ( )
Encode a frame to a target type.
Encode a frame to a target type .
"""
        Encode a frame to a target type. The default implementation assumes that frame is a ``PIL.Image`` object.

        :param frame: Image frame (default: a ``PIL.Image`` object).
        :param encoding: Image encoding (e.g. ``jpeg``).
        """
frame
Image frame (default: a ``PIL.Image`` object).
Image frame ( default : a ` ` PIL . Image ` ` object ) .
encoding
str
Image encoding .
Image encoding .