Ë
    D<Tfx  ã                   ó¢   — d dl Z d dlmZmZmZmZmZmZmZ d dl	m
Z
 erd dlmZmZ eeeee
   eeef   f   f   Z G d„ d«      Z G d„ de«      Zy)	é    N)ÚTYPE_CHECKINGÚAnyÚDictÚOptionalÚTupleÚTypeÚUnion)ÚQRModuleDrawer)ÚActiveWithNeighborsÚQRCodec                   ó
  — e Zd ZU dZdZee   ed<   dZee	e      ed<   dZ
dZdZd„ Zej                  d„ «       Zd	ed
eddfd„Zd„ Zej                  dd„«       Zd„ Zej                  defd„«       Zd„ Zd„ Zdd„Zd	ed
efd„Zy)Ú	BaseImagez)
    Base QRCode image output class.
    NÚkindÚallowed_kindsFTc                 ó  — || _         || _        || _        | j                  | j                   dz  z   | j                  z  | _        |j	                  d«      | _         | j                  di |¤Ž| _        | j                  «        y )Né   Úqrcode_modules© )	ÚborderÚwidthÚbox_sizeÚ
pixel_sizeÚpopÚmodulesÚ	new_imageÚ_imgÚinit_new_image)Úselfr   r   r   ÚargsÚkwargss         úPC:\Users\user\Documents\project_loop\venv\Lib\site-packages\qrcode/image/base.pyÚ__init__zBaseImage.__init__   sj   € ØˆŒØˆŒ
Ø ˆŒØŸ:™:¨¯©°a©Ñ7¸4¿=¹=ÑHˆŒØ—z‘zÐ"2Ó3ˆŒØ"�D—N‘NÑ, VÑ,ˆŒ	Ø×ÑÕó    c                  ó   — y)z9
        Draw a single rectangle of the QR code.
        Nr   ©r   ÚrowÚcols      r!   ÚdrawrectzBaseImage.drawrect!   ó   � r#   r&   r'   Úqrr   c                 ó   — t        d«      ‚)zV
        Draw a single rectangle of the QR code given the surrounding context
        zBaseImage.drawrect_context©ÚNotImplementedError)r   r&   r'   r*   s       r!   Údrawrect_contextzBaseImage.drawrect_context'   s   € ô "Ð">Ó?Ð?r#   c                 ó   — t        d«      ‚)z4
        Processes QR code after completion
        zBaseImage.drawimager,   ©r   s    r!   ÚprocesszBaseImage.process-   s   € ô "Ð"7Ó8Ð8r#   c                  ó   — y)z&
        Save the image file.
        Nr   )r   Ústreamr   s      r!   ÚsavezBaseImage.save3   r)   r#   c                 óÂ   — || j                   z   | j                  z  }|| j                   z   | j                  z  }||f|| j                  z   dz
  || j                  z   dz
  ffS )z‡
        A helper method for pixel-based image generators that specifies the
        four pixel coordinates for a single rect.
        é   )r   r   )r   r&   r'   ÚxÚys        r!   Ú	pixel_boxzBaseImage.pixel_box9   sg   € ð
 �4—;‘;Ñ $§-¡-Ñ/ˆØ�4—;‘;Ñ $§-¡-Ñ/ˆà�ˆFØ�—‘Ñ Ñ" A¨¯©Ñ$5¸Ñ$9Ð:ð
ð 	
r#   Úreturnc                  ó   — y)zT
        Build the image class. Subclasses should return the class created.
        Nr   ©r   r    s     r!   r   zBaseImage.new_imageE   r)   r#   c                  ó   — y ©Nr   r0   s    r!   r   zBaseImage.init_new_imageK   s   € Ør#   c                 ó   — | j                   S )z@
        Return the image class for further processing.
        )r   r<   s     r!   Ú	get_imagezBaseImage.get_imageN   s   € ð �y‰yÐr#   c                 óÜ   — |€| j                   }| j                   xs || j                  v }|r ||«      }|s|| j                  v }|s$t        dt        | «      j                  › d|› �«      ‚|S )z%
        Get the image type.
        zCannot set z	 type to )r   r   Ú
ValueErrorÚtypeÚ__name__)r   r   Ú	transformÚalloweds       r!   Ú
check_kindzBaseImage.check_kindT   sz   € ð ˆ<Ø—9‘9ˆDØ×(Ñ(Ð(ÒF¨D°D×4FÑ4FÐ,FˆÙÙ˜T“?ˆDÙØ $×"4Ñ"4Ð4�ÙÜ˜{¬4°«:×+>Ñ+>Ð*?¸yÈÈÐOÓPÐPØˆr#   c                 ó†   — |dk  xr |dk  xs4 |dk  xr | j                   |z
  dk  xs | j                   |z
  dk  xr |dk  S )zB
        Find whether the referenced module is in an eye.
        é   é   )r   r%   s      r!   Úis_eyezBaseImage.is_eyec   sW   € ð
 �1‰WÒ ˜˜q™ò 2Ø�a‘Ò0˜DŸJ™J¨Ñ,¨qÑ0ò2à—
‘
˜SÑ  1Ñ$Ò0¨¨q©ð	
r#   r>   )rD   Ú
__module__Ú__qualname__Ú__doc__r   r   ÚstrÚ__annotations__r   r   Úneeds_contextÚneeds_processingÚneeds_drawrectr"   ÚabcÚabstractmethodr(   Úintr.   r1   r4   r9   r   r   r   r@   rG   rK   r   r#   r!   r   r      sÞ   … ñð €Dˆ(�3‰-ÓØ*.€M�8˜E #™JÑ'Ó.Ø€MØÐØ€Nòð 	×Ññó ðð
@ Cð @¨cð @°xó @ò9ð 	×Ñòó ðò


ð 	×Ñð Sò ó ðò
òóð
˜#ð 
 Cô 
r#   r   c                   óØ   ‡ — e Zd ZU ee   ed<   i Zeed<   defd„Zdefd„Z	dZ
ded<   ded	<   d
d
dœdeeed
f   d	eeed
f   fˆ fd„Zdeeed
f   dee   fd„Zˆ fd„Zdededdfd„Zˆ xZS )ÚBaseImageWithDrawerÚdefault_drawer_classÚdrawer_aliasesr:   c                 ó"   — | j                  «       S r>   ©rY   r0   s    r!   Úget_default_module_drawerz-BaseImageWithDrawer.get_default_module_drawerr   ó   € Ø×(Ñ(Ó*Ð*r#   c                 ó"   — | j                  «       S r>   r\   r0   s    r!   Úget_default_eye_drawerz*BaseImageWithDrawer.get_default_eye_draweru   r^   r#   Tr
   Úmodule_drawerÚ
eye_drawerN)ra   rb   c                óÄ   •— | j                  |«      xs | j                  «       | _        | j                  |«      xs | j                  «       | _        t        ‰| �  |i |¤Ž y r>   )Ú
get_drawerr]   ra   r`   rb   Úsuperr"   )r   ra   rb   r   r    Ú	__class__s        €r!   r"   zBaseImageWithDrawer.__init__}   sY   ø€ ð �O‰O˜MÓ*ÒN¨d×.LÑ.LÓ.Nð 	Ôð Ÿ/™/¨*Ó5ÒV¸×9TÑ9TÓ9VˆŒÜ‰Ñ˜$Ð) &Ó)r#   Údrawerc                 óZ   — t        |t        «      s|S | j                  |   \  }} |di |¤ŽS )Nr   )Ú
isinstancerO   rZ   )r   rg   Ú
drawer_clsr    s       r!   rd   zBaseImageWithDrawer.get_drawer�   s6   € ô ˜&¤#Ô&ØˆMØ!×0Ñ0°Ñ8Ñˆ
�FÙÑ#˜FÑ#Ð#r#   c                 ó�   •— | j                   j                  | ¬«       | j                  j                  | ¬«       t        ‰| �  «       S )N)Úimg)ra   Ú
initializerb   re   r   )r   rf   s    €r!   r   z"BaseImageWithDrawer.init_new_image•   s=   ø€ Ø×Ñ×%Ñ%¨$Ð%Ô/Ø�‰×"Ñ" tÐ"Ô,ä‰wÑ%Ó'Ð'r#   r&   r'   r*   r   c                 ó  — | j                  ||«      }| j                  ||«      r| j                  n| j                  }|j                  r|j                  ||«      nt        |j                  |   |   «      }|j                  ||«       y r>   )	r9   rK   rb   ra   Úneeds_neighborsÚactive_with_neighborsÚboolr   r(   )r   r&   r'   r*   Úboxrg   Ú	is_actives          r!   r.   z$BaseImageWithDrawer.drawrect_context›   sw   € Ø�n‰n˜S #Ó&ˆØ$(§K¡K°°SÔ$9�—’¸t×?QÑ?Qˆð ×%Ò%ð ×$Ñ$ S¨#Ô.ä�b—j‘j ‘o cÑ*Ó+ð 	ð 	�‰˜˜YÕ'r#   )rD   rL   rM   r   r
   rP   rZ   ÚDrawerAliasesr]   r`   rQ   r	   rO   r"   r   rd   r   rV   r.   Ú__classcell__)rf   s   @r!   rX   rX   n   sÁ   ø… Ø˜~Ñ.Ó.Ø$&€N�MÓ&ð+¨>ó +ð+¨ó +ð €Mà#Ó#Ø Ó ð
 ;?Ø7;ò	*ð ˜^¨S°$Ð6Ñ7ð*ð ˜.¨#¨tÐ3Ñ4õ	*ð $Ø˜N¨C°Ð5Ñ6ð$à	�.Ñ	!ó$ô(ð	( Cð 	(¨cð 	(°x÷ 	(r#   rX   )rT   Útypingr   r   r   r   r   r   r	   Ú&qrcode.image.styles.moduledrawers.baser
   Úqrcode.mainr   r   rO   rt   r   rX   r   r#   r!   ú<module>ry      s[   ðÛ 
ß I× IÑ Iå Aáß7ð �S˜%  ^Ñ 4°d¸3À¸8±nÐ DÑEÐEÑF€÷^
ñ ^
ôB6(˜)õ 6(r#   