| Server IP : 3.111.61.48 / Your IP : 216.73.216.67 Web Server : Apache System : Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64 User : ubuntu ( 1000) PHP Version : 8.2.31 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib/python3/dist-packages/PIL/__pycache__/ |
Upload File : |
o
Z#�a= � @ s. d dl Z d dlZd dlZG dd� d�ZeZdS )� Nc @ sf e Zd Zddd�Zdd� Zdd� Zdd � Zd
d� Zdd
� Zdd� Z dd� Z
dd� Zdd� Zdd� Z
dS )�StatNc C sj z|r
|� |�| _n|� � | _W n ty || _Y nw t| jt�s'td��ttt| j�d ��| _d S )Nz$first argument must be image or list� ) � histogram�h�AttributeError�
isinstance�list� TypeError�range�len�bands)�self�
image_or_list�mask� r �//usr/lib/python3/dist-packages/PIL/ImageStat.py�__init__ s
�
�z
Stat.__init__c C s8 |dd� dkrt |��t| d| �� }t| ||� |S )zCalculate missing attributeN� �_get)r �getattr�setattr)r
�id�vr r r �__getattr__* s
zStat.__getattr__c C s@ dd� }g }t dt| j�d�D ]}|�|| j|d� �� q|S )z-Get min/max values for each band in the imagec S s: d}d}t d�D ]}| | rt||�}t||�}q||fS )N� r r )r
�min�max)r �n�x�ir r r �minmax6 s
�z Stat._getextrema.<locals>.minmaxr r N�r
r r �append)r
r r r r r r �_getextrema3 s
zStat._getextremac
C sB g }t dt| j�d�D ]}|�t�tj| j||d � �� q|S )z(Get total number of pixels in each layerr r )r
r r r"