a
    {bH	                     @   s   d Z G dd dZdS )a  
Camera
======

The :class:`Camera` is to capture pictures and make videos.

.. note::
        - On Android the `CAMERA` , `WRITE_EXTERNAL_STORAGE`,
          `READ_EXTERNAL_STORAGE` permissions are needed.

Simple Examples
---------------

Setup callback function.

    >>> from os.path import exists, join
    >>> from plyer import camera
    >>> def camera_callback(filepath):
    >>>     if(exists(filepath)):
    >>>         print "saved"
    >>>     else:
    >>>         print "unable to save."
    >>> filepath = 'path/to/your/file'
    >>> # e.g: filepath = join(App.get_running_app().user_data_dir, file_name)

To take picture::

    >>> file_name = "test.jpg"
    >>> camera.take_picture(filename=file_name,
    >>>                     on_complete=camera_callback)

Ta take a video::

    >>> file_name = "test.mp4"
    >>> camera.take_video(filename=file_name,
    >>>                   on_complete=camera_callback)

Supported Platforms
-------------------
Android, iOS

c                   @   s0   e Zd ZdZdd Zdd Zdd Zdd	 Zd
S )Cameraz
    Camera facade.
    c                 C   s   | j ||d dS )a  Ask the OS to capture a picture, and store it at filename.

        When the capture is done, on_complete will be called with the filename
        as an argument. If the callback returns True, the filename will be
        unlinked.

        :param filename: Name of the image file
        :param on_complete: Callback that will be called when the operation is
            done

        :type filename: str
        :type on_complete: callable
        filenameon_completeN)_take_pictureselfr   r    r   d/Users/vegardjervell/Documents/master/model/venv/lib/python3.9/site-packages/plyer/facades/camera.pytake_picture2   s    zCamera.take_picturec                 C   s   | j ||d dS )a  Ask the OS to capture a video, and store it at filename.

        When the capture is done, on_complete will be called with the filename
        as an argument. If the callback returns True, the filename will be
        unlinked.

        :param filename: Name of the video file
        :param on_complete: Callback that will be called when the operation is
            done

        :type filename: str
        :type on_complete: callable
        r   N)_take_videor   r   r   r	   
take_videoB   s    zCamera.take_videoc                 K   s
   t  d S NNotImplementedErrorr   kwargsr   r   r	   r   T   s    zCamera._take_picturec                 K   s
   t  d S r   r   r   r   r   r	   r   W   s    zCamera._take_videoN)__name__
__module____qualname____doc__r
   r   r   r   r   r   r   r	   r   -   s
   r   N)r   r   r   r   r   r	   <module>   s   ,