D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
lib
/
python3.9
/
site-packages
/
qrcode
/
image
/
__pycache__
/
Filename :
base.cpython-39.pyc
back
Copy
a ��;\W � @ s G d d� de �ZdS )c @ sT e Zd ZdZdZdZdd� Zdd� Zddd�Zd d � Z dd� Z d d� Zddd�ZdS )� BaseImagez) Base QRCode image output class. Nc O s@ || _ || _|| _| j| j d | j | _| jf i |��| _d S )N� )�border�width�box_sizeZ pixel_size� new_image�_img)�selfr r r �args�kwargs� r �5/usr/lib/python3.9/site-packages/qrcode/image/base.py�__init__ s zBaseImage.__init__c C s t d��dS )z9 Draw a single rectangle of the QR code. �BaseImage.drawrectN��NotImplementedError)r �row�colr r r �drawrect s r c C s t d��dS )z& Save the image file. �BaseImage.saveNr )r �stream�kindr r r �save s r c C sD || j | j }|| j | j }||f|| j d || j d fgS )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 zBaseImage.pixel_boxc K s dS )zT Build the image class. Subclasses should return the class created. Nr �r r r r r r $ s zBaseImage.new_imagec K s | j S )z@ Return the image class for further processing. )r r r r r � get_image* s zBaseImage.get_imagec C sX |du r| j }| j p|| jv }|r:||�}|s:|| jv }|sTtdt| �j|f ��|S )z% Get the image type. NzCannot set %s type to %s)r � allowed_kinds� ValueError�type�__name__)r r Z transform�allowedr r r � check_kind0 s �zBaseImage.check_kind)N)N) r! � __module__�__qualname__�__doc__r r r r r r r r r# r r r r r s r N)�objectr r r r r �<module> �