
    0-Ph}                         d Z ddlZddlmZ ddlmZ  G d de          Z edd	d
d          Z ej	        e           dS )zE Example plugin. You can use this as a template for your own plugin.
    N   )formats)Formatc                   j    e Zd ZdZd Zd Z G d dej                  Z G d dej                  ZdS )	DummyFormata  The dummy format is an example format that does nothing.
    It will never indicate that it can read or write a file. When
    explicitly asked to read, it will simply read the bytes. When
    explicitly asked to write, it will raise an error.

    This documentation is shown when the user does ``help('thisformat')``.

    Parameters for reading
    ----------------------
    Specify arguments in numpy doc style here.

    Parameters for saving
    ---------------------
    Specify arguments in numpy doc style here.

    c                 &    |j         | j        v rdS d S NT	extension
extensionsselfrequests     W/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/imageio/plugins/example.py	_can_readzDummyFormat._can_read   s!    , //4 0/    c                 &    |j         | j        v rdS d S r	   r
   r   s     r   
_can_writezDummyFormat._can_write8   s!     //4 0/r   c                   .    e Zd Zd	dZd Zd Zd Zd ZdS )
DummyFormat.ReaderF   c                 ^    | j                                         | _        || _        d | _        d S N)r   get_file_fp_length_data)r   some_optionlengths      r   _openzDummyFormat.Reader._openG   s+     |,,..DH!DLDJJJr   c                     d S r    r   s    r   _closezDummyFormat.Reader._closeS   	     Dr   c                     | j         S r   )r   r#   s    r   _get_lengthzDummyFormat.Reader._get_lengthX   s
    <r   c                     || j         k    rt          d|| j         fz            | j        | j                                        | _        t          j        | j        d          }t          |          df|_        |i fS )NzImage index %i > %iuint8r   )	r   
IndexErrorr   r   readnp
frombufferlenshape)r   indexims      r   	_get_datazDummyFormat.Reader._get_data\   sp    $$ !6%9N!NOOOz!!X]]__
tz733B2wwzBHr6Mr   c                     i S r   r"   )r   r0   s     r   _get_meta_dataz!DummyFormat.Reader._get_meta_datai   s	     Ir   N)Fr   )__name__
__module____qualname__r    r$   r'   r2   r4   r"   r   r   Readerr   F   sd        
	 
	 
	 
		 	 	
	  	  	 	 	 		 	 	 	 	r   r8   c                   (    e Zd ZddZd Zd Zd ZdS )DummyFormat.Writerr   c                 B    | j                                         | _        d S r   )r   r   r   )r   flagss     r   r    zDummyFormat.Writer._openq   s     |,,..DHHHr   c                     d S r   r"   r#   s    r   r$   zDummyFormat.Writer._close{   r%   r   c                      t          d          )Nz)The dummy format cannot write image data.RuntimeError)r   r1   metas      r   _append_datazDummyFormat.Writer._append_data   s    JKKKr   c                      t          d          )Nz(The dummy format cannot write meta data.r?   )r   rA   s     r   set_meta_dataz DummyFormat.Writer.set_meta_data   s     IJJJr   N)r   )r5   r6   r7   r    r$   rB   rD   r"   r   r   Writerr:   p   s]        	/ 	/ 	/ 	/	 	 	
	L 	L 	L	K 	K 	K 	K 	Kr   rE   N)	r5   r6   r7   __doc__r   r   r   r8   rE   r"   r   r   r   r      s         "  2
 
 
& & & & & & & &TK K K K K K K K K Kr   r   dummyz$An example format that does nothing.z.foobar .nonexistentextiI)
rF   numpyr,    r   corer   r   format
add_formatr"   r   r   <module>rN      s                    zK zK zK zK zK& zK zK zK| 
*	
 
  6     r   