403Webshell
Server IP : 202.61.199.114  /  Your IP : 216.73.217.139
Web Server : nginx/1.22.1
System : Linux de.arni-solutions.de 6.1.0-49-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.174-1 (2026-05-26) x86_64
User : web20 ( 1018)
PHP Version : 8.4.23
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /tmp/calpy/PIL/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /tmp/calpy/PIL/__pycache__/ImageStat.cpython-311.pyc
�

Υ=jw��P�ddlmZddlZddlmZddlmZGd�d��ZeZdS)�)�annotationsN)�cached_property�)�Imagec���eZdZ	ddd�Zedd
���Zedd���Zedd���Zedd���Zedd���Z	edd���Z
edd���Zedd���Zedd���Z
dS)�StatN�
image_or_list�Image.Image | list[int]�mask�Image.Image | None�return�Nonec�8�t|tj��r|�|��|_n.t|t��r||_nd}t|���t	t
t|j��dz����|_dS)a

        Calculate statistics for the given image. If a mask is included,
        only the regions covered by that mask are included in the
        statistics. You can also pass in a previously calculated histogram.

        :param image: A PIL image, or a precalculated histogram.

            .. note::

                For a PIL image, calculations rely on the
                :py:meth:`~PIL.Image.Image.histogram` method. The pixel counts are
                grouped into 256 bins, even if the image has more than 8 bits per
                channel. So ``I`` and ``F`` mode images have a maximum ``mean``,
                ``median`` and ``rms`` of 255, and cannot have an ``extrema`` maximum
                of more than 255.

        :param mask: An optional mask.
        z$first argument must be image or list�N)	�
isinstancer�	histogram�h�list�	TypeError�range�len�bands)�selfr	r�msgs    �@/tmp/claude-1015/pip-target-jmvfl800/lib/python/PIL/ImageStat.py�__init__z
Stat.__init__ s���*�m�U�[�1�1�	!�"�,�,�T�2�2�D�F�F�
�
�t�
,�
,�	!�"�D�F�F�8�C��C�.�.� ��%��D�F���s� 2�3�3�4�4��
�
�
��list[tuple[int, int]]c�n���d	d����fd�tdt�j��d��D��S)
au
        Min/max values for each band in the image.

        .. note::
            This relies on the :py:meth:`~PIL.Image.Image.histogram` method, and
            simply returns the low and high bins used. This is correct for
            images with 8 bits per channel, but fails for other modes such as
            ``I`` or ``F``. Instead, use :py:meth:`~PIL.Image.Image.getextrema` to
            return per-band extrema for the image. This is more correct and
            efficient because, for non-8-bit modes, the histogram method uses
            :py:meth:`~PIL.Image.Image.getextrema` to determine the bins used.
        r�	list[int]r
�tuple[int, int]c��d\}}td��D]}||r|}n�tddd��D]}||r|}n�||fS)N)�rrr#���)r)r�res_min�res_max�is    r�minmaxzStat.extrema.<locals>.minmaxMs���%��G�W��3�Z�Z�
�
���Q�<���G��E���3��B�'�'�
�
���Q�<���G��E���G�#�#rc�@��g|]}��j|d�����S�N)r)�.0r'r(rs  ��r�
<listcomp>z Stat.extrema.<locals>.<listcomp>Ys-���G�G�G�q���t�v�a�b�b�z�"�"�G�G�Grrr)rr r
r!�rrr)rr(s`@r�extremazStat.extrema>sL����
	$�
	$�
	$�
	$�H�G�G�G�G�E�!�S���[�[�#�,F�,F�G�G�G�Grr c�b���fd�tdt�j��d��D��S)z2Total number of pixels for each band in the image.c�N��g|]!}t�j||dz�����"S)r)�sumr�r+r'rs  �rr,zStat.count.<locals>.<listcomp>^s0���M�M�M�Q��D�F�1�q�3�w�;�'�(�(�M�M�Mrrrr-�rs`r�countz
Stat.count[s4���N�M�M�M�%��3�t�v�;�;��2L�2L�M�M�M�Mr�list[float]c���g}tdt|j��d��D]A}d}td��D]}|||j||zzz
}�|�|���B|S)z-Sum of all pixels for each band in the image.rr�)rrr�append)r�vr'�	layer_sum�js     rr1zStat.sum`s{��
���q�#�d�f�+�+�s�+�+�	 �	 �A��I��3�Z�Z�
/�
/���Q����A���.�.�	�	�
�H�H�Y������rc	���g}tdt|j��d��D]Q}d}td��D](}||dzt|j||z��zz
}�)|�|���R|S)z5Squared sum of all pixels for each band in the image.rrr7�)rrr�floatr8)rr9r'�sum2r;s     rr?z	Stat.sum2ls���
���q�#�d�f�+�+�s�+�+�	�	�A��D��3�Z�Z�
6�
6����A���t�v�a�!�e�}�!5�!5�5�5���
�H�H�T�N�N�N�N��rc�*���fd��jD��S)zAAverage (arithmetic mean) pixel level for each band in the image.c�d��g|],}�j|r�j|�j|znd��-S�r)r4r1r2s  �rr,zStat.mean.<locals>.<listcomp>{s:���X�X�X��t�z�!�}�C�����d�j��m�+�+�!�X�X�Xr�rr3s`r�meanz	Stat.meanxs"���Y�X�X�X�T�Z�X�X�X�Xrc���g}|jD][}d}|j|dz}|dz}td��D]}||j||zz}||krn�|�|���\|S)z.Median pixel level for each band in the image.rr=r)rr4rrr8)rr9r'�s�half�br;s       r�medianzStat.median}s���
����	�	�A��A��:�a�=�A�%�D��C��A��3�Z�Z�
�
�����q�1�u�
�%���t�8�8��E��
�H�H�Q�K�K�K�K��rc�*���fd��jD��S)z2RMS (root-mean-square) for each band in the image.c���g|]>}�j|r-tj�j|�j|z��nd��?SrB)r4�math�sqrtr?r2s  �rr,zStat.rms.<locals>.<listcomp>�sT���
�
�
��8<�z�!�}�K�D�I�d�i��l�T�Z��]�2�3�3�3�!�
�
�
rrCr3s`r�rmszStat.rms�s0���
�
�
�
��Z�
�
�
�	
rc�*���fd��jD��S)z$Variance for each band in the image.c���g|]K}�j|r:�j|�j|dz�j|zz
�j|znd��LS)g@r)r4r?r1r2s  �rr,zStat.var.<locals>.<listcomp>�sk���
�
�
���:�a�=����1����!���!3�t�z�!�}� D�D��
�ST�
�U�U��	
�
�
rrCr3s`r�varzStat.var�s2���
�
�
�
��Z�

�
�
�	
rc�*���fd��jD��S)z.Standard deviation for each band in the image.c�N��g|]!}tj�j|����"S�)rLrMrQr2s  �rr,zStat.stddev.<locals>.<listcomp>�s)���;�;�;�1��	�$�(�1�+�&�&�;�;�;rrCr3s`r�stddevzStat.stddev�s!���<�;�;�;��
�;�;�;�;rr*)r	r
rrr
r)r
r)r
r )r
r5)�__name__�
__module__�__qualname__rrr.r4r1r?rDrIrNrQrUrTrrrrs\������QU�5�5�5�5�5�<�H�H�H��_�H�8�N�N�N��_�N��	�	�	��_�	��	�	�	��_�	��Y�Y�Y��_�Y��
�
�
��_�
��
�
�
��_�
��	
�	
�	
��_�	
��<�<�<��_�<�<�<rr)	�
__future__rrL�	functoolsr�rr�GlobalrTrr�<module>r]s���.#�"�"�"�"�"�����%�%�%�%�%�%�������E<�E<�E<�E<�E<�E<�E<�E<�P
���r

Youez - 2016 - github.com/yon3zu
LinuXploit