| Server IP : 127.0.0.1 / Your IP : 216.73.216.109 Web Server : Apache/2.4.54 (Win64) OpenSSL/1.1.1q PHP/8.1.10 System : Windows NT DESKTOP-E5T4RUN 10.0 build 19045 (Windows 10) AMD64 User : SERVERWEB ( 0) PHP Version : 8.1.10 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/cygwin64/lib/python3.9/site-packages/PIL/__pycache__/ |
Upload File : |
a
h�a� � @ s d dl Z d dlZd dlZd dlZd dlZd dlmZ d dlmZ g Z d&dd�Z
d'dd�ZG d d
� d
�ZG dd� de�Z
ejd
kr�e
e
� G dd� de�Zejdkr�e
e� G dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�Zejdv�rVe�d��re
e� e�d��r.e
e� e�d��rBe
e� e�d��rVe
e� G d d!� d!e�Zzd d"lmZ W n e�y� Y n
0 e
e� ed#k�reej�d$k �r�ed%� e�� e� ejd ��.Z!eee!gejd$d� �R � � W d � n1 �s0 Y dS )(� N��quote)�Image� c C sL zt | t�r| � } W n ty& Y n0 |dkr<t�| � nt�d| � dS )a
The :py:func:`register` function is used to register additional viewers.
:param viewer: The viewer to be registered.
:param order:
Zero or a negative integer to prepend this viewer to the list,
a positive integer to append it.
r N)�
issubclass�Viewer� TypeError�_viewers�append�insert)�viewer�order� r �1/usr/lib/python3.9/site-packages/PIL/ImageShow.py�register s
r c K s* t D ] }|j| fd|i|��r dS qdS )a
Display a given image.
:param image: An image object.
:param title: Optional title. Not all viewers can display the title.
:param \**options: Additional viewer options.
:returns: ``True`` if a suitable viewer was found, ``False`` otherwise.
�titler r )r �show)�imager �optionsr r r r r . s r c @ sH e Zd ZdZdd� ZdZi Zdd� Zdd� Zd d
� Z dd� Z
d
d� ZdS )r zBase class for viewers.c K sP |j dv s>| jdkr|j dv s>t�|j �}|j |kr>|�|�}| j|fi |��S )z�
The main function for displaying an image.
Converts the given image to the target format and displays it.
)�1ZRGBA�PNG)zI;16ZLA)�mode�formatr ZgetmodebaseZconvert�
show_image)�selfr r �baser r r r B s ���
zViewer.showNc C s | j S )z3Return format name, or ``None`` to save as PGM/PPM.)r �r r r r r �
get_formatY s zViewer.get_formatc K s t �dS )zj
Returns the command used to display the file.
Not implemented in the base class.
N)�NotImplementedError�r �filer r r r �get_command] s zViewer.get_commandc C s |j f d| �|�i| j��S )z+Save to temporary file and return filename.r )Z_dumpr r r r r r �
save_imaged s zViewer.save_imagec K s | j | �|�fi |��S )zDisplay the given image.)� show_filer"