+
    JV-jw  ã                  óJ   € ^ RI Ht ^ RIt^ RIHt ^RIHt  ! R R4      t]tR# )é    )ÚannotationsN)Úcached_property)ÚImagec                  óì   € ] tR t^tRR R llt]R R l4       t]R R l4       t]R R	 l4       t]R
 R l4       t	]R R l4       t
]R R l4       t]R R l4       t]R R l4       t]R R l4       tRtR# )ÚStatNc               ó$   € V ^8„  d   QhRRRRRR/# )é   Úimage_or_listzImage.Image | list[int]ÚmaskzImage.Image | NoneÚreturnÚNone© )Úformats   "Ú^/Volumes/fast/ai/experiments/ui-tars-smoke/.venv/lib/python3.14/site-packages/PIL/ImageStat.pyÚ__annotate__ÚStat.__annotate__    s$   € ÷ 5ñ 5Ø4ð5Ø<Nð5à	ñ5ó    c                ó.  € \        V\        P                  4      '       d   VP                  V4      V n        M*\        V\        4      '       d   Wn        MRp\        V4      h\	        \        \        V P                  4      R,          4      4      V n        R# )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   &&& r   Ú__init__ÚStat.__init__    sf   € ô* �m¤U§[¡[×1Ò1Ø"×,Ñ,¨TÓ2ˆD�FÜ˜¤t×,Ò,Ø"�Fà8ˆCÜ˜C“.Ð Üœ%¤ D§F¡F£¨sÕ 2Ó3Ó4ˆŽ
r   c               ó   € V ^8„  d   QhRR/# )r	   r   zlist[tuple[int, int]]r   )r   s   "r   r   r   ?   s   € ÷ Hñ HÐ.ñ Hr   c                óœ   € R R lp\        ^ \        V P                  4      R4       Uu. uF  q!! V P                  VR 4      NK  	  up# u upi )a%  
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.
c               ó    € V ^8„  d   QhRRRR/# )r	   r   ú	list[int]r   ztuple[int, int]r   )r   s   "r   r   Ú"Stat.extrema.<locals>.__annotate__M   s   € ÷ 
	$ñ 
	$˜ið 
	$¨Oñ 
	$r   c                ó¦   € ^ÿ^ r!\        R4       F  pW,          '       g   K  Tp M	  \        ^ÿRR4       F  pW,          '       g   K  Tp W3# 	  W3# )éÿ   r   éÿÿÿÿ)r   )r   Úres_minÚres_maxÚis   &   r   ÚminmaxÚStat.extrema.<locals>.minmaxM   s^   € Ø" A�WÜ˜3–Z�Ø—<–<Ø�GÙñ  ô ˜3  BÖ'�Ø—<–<Ø�GØØÐ#Ð#ñ	 (ð Ð#Ð#r   r   N)r   r   r   )r   r-   r,   s   &  r   ÚextremaÚStat.extrema>   sC   € õ
	$ô -2°!´S¸¿¹³[À#Ô,FÓGÑ,F q��t—v‘v˜a˜b�zÖ"Ñ,FÑGÐGùÒGs   ©A	c               ó   € V ^8„  d   QhRR/# ©r	   r   r%   r   )r   s   "r   r   r   \   s   € ÷ Nñ N�yñ Nr   c           	     ó¤   € \        ^ \        V P                  4      R4       Uu. uF!  p\        V P                  WR,            4      NK#  	  up# u upi )z2Total number of pixels for each band in the image.r   )r   r   r   Úsum©r   r,   s   & r   ÚcountÚ
Stat.count[   sA   € ô 38¸¼3¸t¿v¹v»;ÈÔ2LÓMÑ2L¨Q”�D—F‘F˜1 3�wÐ'Ö(Ñ2LÑMÐMùÒMs   £'Ac               ó   € V ^8„  d   QhRR/# ©r	   r   zlist[float]r   )r   s   "r   r   r   a   s   € ÷ 	ñ 	�[ñ 	r   c                óî   € . p\        ^ \        V P                  4      R4       FN  pRp\        R4       F)  pW4V P                  W$,           ,          ,          ,          pK+  	  VP                  V4       KP  	  V# )z-Sum of all pixels for each band in the image.r   ç        )r   r   r   Úappend)r   Úvr,   Ú	layer_sumÚjs   &    r   r4   ÚStat.sum`   sa   € ð ˆÜ�qœ#˜dŸf™f›+ sÖ+ˆAØˆIÜ˜3–Z�Ø §¡¨­¥Õ.Õ.’	ñ  à�H‰H�YÖñ	 ,ð
 ˆr   c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   r   m   s   € ÷ 	ñ 	�kñ 	r   c           	     ó  € . p\        ^ \        V P                  4      R4       F^  pRp\        R4       F9  pW4^,          \        V P                  W$,           ,          4      ,          ,          pK;  	  VP	                  V4       K`  	  V# )z5Squared sum of all pixels for each band in the image.r   r;   )r   r   r   Úfloatr<   )r   r=   r,   Úsum2r?   s   &    r   rD   Ú	Stat.sum2l   si   € ð ˆÜ�qœ#˜dŸf™f›+ sÖ+ˆAØˆDÜ˜3–Z�Ø˜A�¤ t§v¡v¨a­e¥}Ó!5Õ5Õ5’ñ  à�H‰H�TŽNñ	 ,ð
 ˆr   c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   r   y   s   € ÷ Yñ Y�kñ Yr   c                óÊ   € V P                    Uu. uFH  qP                  V,          '       d,   V P                  V,          V P                  V,          ,          M^ NKJ  	  up# u upi )zAAverage (arithmetic mean) pixel level for each band in the image.)r   r6   r4   r5   s   & r   ÚmeanÚ	Stat.meanx   sF   € ð NRÏZÊZÓXÉZÈ¯z©z¸!¯}¬}�—‘˜•˜dŸj™j¨�mÖ+À!ÒCÉZÑXÐXùÒXs   �AA c               ó   € V ^8„  d   QhRR/# r2   r   )r   s   "r   r   r   ~   s   € ÷ ñ ˜	ñ r   c                ó  € . pV P                    Fr  p^ pV P                  V,          ^,          pVR,          p\        R4       F*  pW0P                  WV,           ,          ,           pW48”  g   K*   M	  VP	                  X4       Kt  	  V# )z.Median pixel level for each band in the image.r   )r   r6   r   r   r<   )r   r=   r,   ÚsÚhalfÚbr?   s   &      r   ÚmedianÚStat.median}   ss   € ð ˆØ—”ˆAØˆAØ—:‘:˜a•= AÕ%ˆDØ�C•ˆAÜ˜3–Z�ØŸ™˜q�u�Õ%�Ø–8Ùñ  ð �H‰H�QŽKñ ð ˆr   c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   r   Ž   s   € ÷ 
ñ 
�[ñ 
r   c                óô   € V P                    Uu. uF]  pV P                  V,          '       d@   \        P                  ! V P                  V,          V P                  V,          ,          4      M^ NK_  	  up# u upi )z2RMS (root-mean-square) for each band in the image.)r   r6   ÚmathÚsqrtrD   r5   s   & r   ÚrmsÚStat.rms�   s\   € ð
 —Z’Zó
á�ð 8<·z±zÀ!·}´}ŒD�IŠI�d—i‘i •l T§Z¡Z°¥]Õ2Ô3È!ÒKÙñ
ð 	
ùò 
s   �A5­AA5c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   r   –   s   € ÷ 	
ñ 	
�[ñ 	
r   c                ó:  € V P                    Uu. uF€  pV P                  V,          '       dc   V P                  V,          V P                  V,          R,          V P                  V,          ,          ,
          V P                  V,          ,          M^ NK‚  	  up# u upi )z$Variance for each band in the image.g       @)r   r6   rD   r4   r5   s   & r   ÚvarÚStat.var•   s}   € ð —Z’Zó
ñ  �ð —:‘:˜a—=”=ð —‘˜1• §¡¨!¥°Õ!3°t·z±zÀ!µ}Õ DÕDÈÏ
É
ÐSTÍÖUàòñ  ñ
ð 	
ùò 
s   �B­A(Bc               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   r   ¢   s   € ÷ <ñ <˜ñ <r   c                óŽ   € V P                    Uu. uF*  p\        P                  ! V P                  V,          4      NK,  	  up# u upi )z.Standard deviation for each band in the image.)r   rS   rT   rY   r5   s   & r   ÚstddevÚStat.stddev¡   s1   € ð 15·
²
Ó;±
¨1”—	’	˜$Ÿ(™( 1�+Ö&±
Ñ;Ð;ùÒ;s   �0A)r   r   )N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r    r   r/   r6   r4   rD   rH   rO   rU   rY   r]   Ú__static_attributes__r   r   r   r   r      sÁ   † ÷5ð< ôHó ðHð8 ôNó ðNð ô	ó ð	ð ô	ó ð	ð ôYó ðYð ôó ðð ô
ó ð
ð ô	
ó ð	
ð ô<ó ô<r   r   )	Ú
__future__r   rS   Ú	functoolsr   Ú r   r   ÚGlobalr   r   r   Ú<module>rh      s'   ðõ. #ã Ý %å ÷E<ñ E<ðP 
‚r   