
    }f                       d dl mZ ddlmZmZ ddlmZ ddlmZ  G d d          Z	 G d d	ej                  Z
 ej        e
j        e
            ej        e
j        d
dg            ej        e
j        d           dS )    )annotations   )Image	ImageFile)i8)SupportsReadc                  6    e Zd ZddZddZdd	Zdd
ZddZdS )	BitStreamfpSupportsRead[bytes]returnNonec                0    || _         d| _        d| _        d S )Nr   )r   bits	bitbuffer)selfr   s     L/var/www/rtfcompare/venv/lib/python3.11/site-packages/PIL/MpegImagePlugin.py__init__zBitStream.__init__   s    	    intc                P    t          | j                            d                    S )Nr   )r   r   read)r   s    r   nextzBitStream.next   s    $',,q//"""r   r   c                    | j         |k     rO|                                 }|dk     rd| _         -| j        dz  |z   | _        | xj         dz  c_         | j         |k     O| j        | j         |z
  z	  d|z  dz
  z  S )Nr      r   )r   r   r   )r   r   cs      r   peekzBitStream.peek"   s    i$		A1uu	"n1Q6DNIINII i$ ~$)d"23qDyAoEEr   c                    | j         |k     rR| j        dz  t          | j                            d                    z   | _        | xj         dz  c_         | j         |k     R| j         |z
  | _         d S )Nr   r   )r   r   r   r   r   )r   r   s     r   skipzBitStream.skip,   sh    i$"n1RQ5H5HHDNIINII i$ I$			r   c                N    |                      |          }| j        |z
  | _        |S )N)r   r   )r   r   vs      r   r   zBitStream.read2   s$    IIdOOI$	r   N)r   r   r   r   )r   r   )r   r   r   r   )r   r   r   r   )__name__
__module____qualname__r   r   r   r   r    r   r   r
   r
      s|           
# # # #F F F F% % % %     r   r
   c                      e Zd ZdZdZddZdS )MpegImageFileMPEGr   r   c                    | j         J t          | j                   }|                    d          dk    rd}t          |          d| _        |                    d          |                    d          f| _        d S )N    i  znot an MPEG fileRGB   )r   r
   r   SyntaxError_mode_size)r   smsgs      r   _openzMpegImageFile._openA   sr    w"""dg66"::$Cc"""
VVBZZ+


r   N)r   r   )r"   r#   r$   formatformat_descriptionr2   r%   r   r   r'   r'   =   s3        F	, 	, 	, 	, 	, 	,r   r'   z.mpgz.mpegz
video/mpegN)
__future__r    r   r   _binaryr   _typingr   r
   r'   register_openr3   register_extensionsregister_mimer%   r   r   <module>r<      s    # " " " " "               ! ! ! ! ! !       H, , , , ,I' , , ,&  M(- 8 8 8  -.0A B B B  M(, 7 7 7 7 7r   