
    0-Ph                         d Z ddlZddlZddlZddlmZ  ej        dd          Ze= ej        de	            ej
         ej        dd                              d            d	 ZdS )
a  
Here you can find documentation on how to write your own plugin to allow
ImageIO to access a new backend. Plugins are quite object oriented, and
the relevant classes and their interaction are documented here:

.. currentmodule:: imageio

.. autosummary::
    :toctree: ../_autosummary
    :template: better_class.rst

    imageio.core.Format
    imageio.core.Request

.. note::
    You can always check existing plugins if you want to see examples.

What methods to implement
-------------------------

To implement a new plugin, create a new class that inherits from
:class:`imageio.core.Format`. and implement the following functions:

.. autosummary::
    :toctree: ../_autosummary

    imageio.core.Format.__init__
    imageio.core.Format._can_read
    imageio.core.Format._can_write

Further, each format contains up to two nested classes; one for reading and
one for writing. To support reading and/or writing, the respective classes
need to be defined.

For reading, create a nested class that inherits from
``imageio.core.Format.Reader`` and that implements the following functions:

    * Implement ``_open(**kwargs)`` to initialize the reader. Deal with the
        user-provided keyword arguments here.
    * Implement ``_close()`` to clean up.
    * Implement ``_get_length()`` to provide a suitable length based on what
        the user expects. Can be ``inf`` for streaming data.
    * Implement ``_get_data(index)`` to return an array and a meta-data dict.
    * Implement ``_get_meta_data(index)`` to return a meta-data dict. If index
        is None, it should return the 'global' meta-data.

For writing, create a nested class that inherits from
``imageio.core.Format.Writer`` and implement the following functions:

    * Implement ``_open(**kwargs)`` to initialize the writer. Deal with the
        user-provided keyword arguments here.
    * Implement ``_close()`` to clean up.
    * Implement ``_append_data(im, meta)`` to add data (and meta-data).
    * Implement ``_set_meta_data(meta)`` to set the global meta-data.

    N   )formatsIMAGEIO_FORMAT_ORDERzSetting plugin priority through an environment variable is deprecated and will be removed in ImageIO v3. There is no replacement planned for this feature. If you have an active use-case for it, please reach out to us on GitHub. ,c                     	 t          j        d|            S # t          $ r t          dt           d|  d          dw xY w)a!  Lazy-Import Plugins

    This function dynamically loads plugins into the imageio.plugin
    namespace upon first access. For example, the following snippet will
    delay importing freeimage until the second line:

    >>> import imageio
    >>> imageio.plugins.freeimage.download()

    zimageio.plugins.zmodule 'z' has no attribute ''N)	importlibimport_moduleImportErrorAttributeError__name__)names    X/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/imageio/plugins/__init__.py__getattr__r   X   sf    Y&'@$'@'@AAA Y Y YMMMdMMMNNTXXYs	    'A )__doc__r
   oswarningsr   r   getenvenv_plugin_orderwarnDeprecationWarningsortsplitr        r   <module>r      s   7 7r     				        293T:: HM	E 	   GL)")2B77==cBBCC
Y Y Y Y Yr   