o
    |XWa                     @   s   d dl Z G dd dZdS )    Nc                   @   s~   e Zd ZdZdZdZdZdZdd Ze	j
dd Zdd	 Zd
d Ze	j
dddZdd Ze	j
dd Zdd ZdddZdS )	BaseImagez)
    Base QRCode image output class.
    NFc                 O   s@   || _ || _|| _| j| j d  | j | _| jdi || _d S )N    )borderwidthbox_size
pixel_size	new_image_img)selfr   r   r   argskwargsr   r   G/var/www/chikooza/env/lib/python3.10/site-packages/qrcode/image/base.py__init__   s
   zBaseImage.__init__c                 C      dS )z9
        Draw a single rectangle of the QR code.
        Nr   )r   rowcolr   r   r   drawrect       zBaseImage.drawrectc                 C      t d)zV
        Draw a single rectangle of the QR code given the surrounding context
        BaseImage.drawrect_contextNotImplementedError)r   r   r   activecontextr   r   r   drawrect_context      r   c                 C   r   )z4
        Processes QR code after completion
        zBaseImage.drawimager   )r   r   r   r   process   r   zBaseImage.processc                 C   r   )z&
        Save the image file.
        Nr   )r   streamkindr   r   r   save%   r   zBaseImage.savec                 C   sD   || j  | j }|| j  | j }||f|| j d || j d fg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yr   r   r   	pixel_box+   s   $zBaseImage.pixel_boxc                 K   r   )zT
        Build the image class. Subclasses should return the class created.
        Nr   r   r   r   r   r   r	   4   r   zBaseImage.new_imagec                 K   s   | j S )z@
        Return the image class for further processing.
        )r
   r%   r   r   r   	get_image:   s   zBaseImage.get_imagec                 C   s\   |du r| j }| j p|| jv }|r||}|s|| jv }|s,tdt| j d| |S )z%
        Get the image type.
        NzCannot set z	 type to )r   allowed_kinds
ValueErrortype__name__)r   r   	transformallowedr   r   r   
check_kind@   s   
zBaseImage.check_kind)N)r*   
__module____qualname____doc__r   r'   needs_contextneeds_processingr   abcabstractmethodr   r   r   r    r$   r	   r&   r-   r   r   r   r   r      s$    
	
r   )r3   r   r   r   r   r   <module>   s    