Files
old-saburly-wagtail-web/env/lib/python3.10/site-packages/PIL/__pycache__/ImageMath.cpython-310.pyc

149 lines
11 KiB
Plaintext
Raw Normal View History

2024-08-27 20:33:44 +02:00
o
<00><><EFBFBD>f<EFBFBD>,<00>@s<>ddlmZddlZddlmZddlmZmZddlm Z m
Z
ddl m Z Gdd <09>d <09>Z d,d d <0A>Zd,dd<0F>Zd-dd<13>Zd-dd<15>Zd-dd<17>Zd-dd<19>Zd.dd<1D>Zeeeeeeed<1E>Zifd/d%d&<26>Zifd0d'd(<28>Zifd1d*d+<2B>ZdS)2<>)<01> annotationsN)<01>CodeType)<02>Any<6E>Callable<6C>)<02>Image<67> _imagingmath)<01> deprecatec@sfeZdZdZdTdd<05>ZdUd d
<EFBFBD>Z dVdWdd<13>ZdXdd<16>ZdYdd<18>ZdYdd<1A>Z dYdd<1C>Z
dZdd<1F>Z dZd d!<21>Z dZd"d#<23>Z dZd$d%<25>ZdZd&d'<27>ZdZd(d)<29>ZdZd*d+<2B>ZdZd,d-<2D>ZdZd.d/<2F>ZdZd0d1<64>ZdZd2d3<64>ZdZd4d5<64>ZdYd6d7<64>ZdZd8d9<64>ZdZd:d;<3B>ZdZd<d=<3D>ZdZd>d?<3F>ZdZd@dA<64>ZdZdBdC<64>ZdZdDdE<64>ZdZdFdG<64>ZdHdI<64>Z dJdK<64>Z!dZdLdM<64>Z"dZdNdO<64>Z#dZdPdQ<64>Z$dZdRdS<64>Z%d S)[<5B>_Operandz4Wraps an image operand, providing standard operators<72>im<69> Image.ImagecCs
||_dS<00>N)r )<02>selfr <00>r<00>O/home/amir/Desktop/saburlyweb/env/lib/python3.10/site-packages/PIL/ImageMath.py<70>__init__s
z_Operand.__init__<5F>im1<6D>_Operand | float<61>returncCs<>t|t<01>r%|jjdvr|j<02>d<02>S|jjdvr|jSd|jj<03><00>}t|<02><01>t|ttf<02>r;|jjdvr;t<08> d|jj
|<01>St<08> d|jj
|<01>S)N)<02>1<>L<>I)r<00>Fzunsupported mode: )rrrr) <0B>
isinstancer
r <00>mode<64>convert<72>
ValueError<EFBFBD>int<6E>floatr<00>new<65>size)rr<00>msgrrr<00>__fixup!s
   z_Operand.__fixupN<70>op<6F>str<74>im2<6D>_Operand | float | Noner<00>
str | Nonec
Cs<>|<00>|<02>}|durLt<01>|p|j|jd<00>}|<05><05>z tt|<01>d|j<03><00><03>}Wnty<}z d|<01>d<03>}t |<08>|<07>d}~wwt<07>
||j j |j j <0C>t|<06>S|<00>|<03>} |j| jkrk|jdkra|<05> d<04>}| jdkrk| <09> d<04>} |j| jkr<>t|jd| jd<00>t|jd| jd<00>f}
|j|
kr<>|<05>d|
<00>}| j|
kr<>| <09>d|
<00>} t<01>|p<>|j|jd<00>}|<05><05>| <09><05>z tt|<01>d|j<03><00><03>}Wnty<>}z d|<01>d<03>}t |<08>|<07>d}~wwt<07>||j j |j j | j j <0C>t|<06>S)N<>_zbad operand type for '<27>'rrr)rr)<12>_Operand__fixuprrrr <00>load<61>getattrr<00>AttributeError<6F> TypeError<6F>unopr <00>idr<00>min<69>crop<6F>binopr
) rr#rr%r<00>im_1<5F>out<75>er!<00>im_2r rrr<00>apply3sN
 
<08><02>
<EFBFBD> 



 <04>

 
<08><02>z_Operand.apply<6C>boolcCs|j<00><01>duSr )r <00>getbbox<6F>rrrr<00>__bool__dsz_Operand.__bool__cC<01> |<00>d|<00>S)N<>abs<62>r8r;rrr<00>__abs__h<00> z_Operand.__abs__cCs|Sr rr;rrr<00>__pos__ksz_Operand.__pos__cCr=)N<>negr?r;rrr<00>__neg__nrAz_Operand.__neg__<5F>othercC<01>|<00>d||<01>S<00>N<>addr?<00>rrErrr<00>__add__r<00>z_Operand.__add__cC<01>|<00>d||<00>SrGr?rIrrr<00>__radd__urKz_Operand.__radd__cCrF<00>N<>subr?rIrrr<00>__sub__xrKz_Operand.__sub__cCrLrNr?rIrrr<00>__rsub__{rKz_Operand.__rsub__cCrF<00>N<>mulr?rIrrr<00>__mul__~rKz_Operand.__mul__cCrLrRr?rIrrr<00>__rmul__<5F>rKz_Operand.__rmul__cCrF<00>N<>divr?rIrrr<00> __truediv__<5F>rKz_Operand.__truediv__cCrLrVr?rIrrr<00> __rtruediv__<5F>rKz_Operand.__rtruediv__cCrF<00>N<>modr?rIrrr<00>__mod__<5F>rKz_Operand.__mod__cCrLrZr?rIrrr<00>__rmod__<5F>rKz_Operand.__rmod__cCrF<00>N<>powr?rIrrr<00>__pow__<5F>rKz_Operand.__pow__cCrLr^r?rIrrr<00>__rpow__<5F>rKz_Operand.__rpow__cCr=)N<>invertr?r;rrr<00>
__invert__<EFBFBD>rAz_Operand.__invert__cCrF<00>N<>andr?rIrrr<00>__and__<5F>rKz_Operand.__and__cCrLrdr?rIrrr<00>__rand__<5F>rKz_Operand.__rand__cCrF<00>N<>orr?rIrrr<00>__or__<5F>rKz_Operand.__or__cCrLrhr?rIrrr<00>__ror__<5F>rKz_Operand.__ror__cCrF<00>N<>xorr?rIrrr<00>__xor__<5F>rKz_Operand.__xor__cCrLrlr?rIrrr<00>__rxor__<5F>rKz_Operand.__rxor__cCrF)N<>lshiftr?rIrrr<00>
__lshift__<EFBFBD>rKz_Operand.__lshift__cCrF)N<>rshiftr?rIrrr<00>
__rshift__<EFBFBD>rKz_Operand.__rshift__cCrF)N<>eqr?rIrrr<00>__eq__<5F>rKz_Operand.__eq__cCrF)N<>ner?rIrrr<00>__ne__<5F>rKz_Operand.__ne__cCrF)N<>ltr?rIrrr<00>__lt__<5F>rKz_Operand.__lt__cCrF)N<>ler?rIrrr<00>__le__<5F>rKz_Operand.__le__cCrF)N<>gtr?rIrrr<00>__gt__<5F>rKz_Operand.__gt__cCrF)N<>ger?rIrrr<00>__ge__<5F>rKz_Operand.__ge__)r r )rrrr )NN)
r#r$rrr%r&rr'rr
)rr9)rr
)rErrr
)&<26>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__doc__rr*r8r<r@rBrDrJrMrPrQrTrUrXrYr\r]r`rarcrfrgrjrkrnrorqrsrurwryr{r}rrrrrr
sL

 <0C>
1


























r
rrcC<01>t|j<01>d<01><01>S)Nr<00>r
r rr;rrr<00> imagemath_int<6E><00>r<>cCr<>)Nrr<>r;rrr<00>imagemath_float<61>r<>r<>rEr&cC<01>|jd||dd<03>S)Nrtr<00>rr?rIrrr<00>imagemath_equal<61><00>r<>cCr<>)Nrvrr<>r?rIrrr<00>imagemath_notequal<61>r<>r<>cCrF)Nr1r?rIrrr<00> imagemath_min<69>rKr<>cCrF)N<>maxr?rIrrr<00> imagemath_max<61>rKr<>rr$cCst|j<01>|<01><01>Sr r<>)rrrrr<00>imagemath_convert<72>r<>r<>)rr<00>equal<61>notequalr1r<>r<00>
expression<EFBFBD>Callable[[dict[str, Any]], Any]<5D>options<6E>dict[str, Any]<5D>kwrcKslt<00><01>}|<03>|<01>|<03>|<02>|<03><03>D]\}}t|d<01>r!t|<05>||<q||<03>}z|jWSty5|YSw)a<>
Returns the result of an image function.
:py:mod:`~PIL.ImageMath` only supports single-layer images. To process multi-band
images, use the :py:meth:`~PIL.Image.Image.split` method or
:py:func:`~PIL.Image.merge` function.
:param expression: A function that receives a dictionary.
:param options: Values to add to the function's dictionary. You
can either use a dictionary, or one or more keyword
arguments.
:return: The expression result. This is usually an image object, but can
also be an integer, a floating point value, or a pixel tuple,
depending on the expression.
r )<08>ops<70>copy<70>update<74>items<6D>hasattrr
r r-)r<>r<>r<><00>args<67>k<>vr5rrr<00> lambda_eval<61>s


 <02> <02>r<EFBFBD>c s<>t<00><01><00>t|<01><03><00>t|<02><03><00>D]}d|vstt|<03>r%d|<03>d<03>}t|<04><01>q<10><00>|<01><00><00>|<02><00><00><08>D]\}}t|d<04>rCt |<05><01>|<q4t
|dd<06><03>d<10><00><01>fd d <0C> <0C><02><02><01>t<05> |d dt ii<01><00>}z|j WStyq|YSw)a<>
Evaluates an image expression. This uses Python's ``eval()`` function to process
the expression string, and carries the security risks of doing so. It is not
recommended to process expressions without considering this.
:py:meth:`~lambda_eval` is a more secure alternative.
:py:mod:`~PIL.ImageMath` only supports single-layer images. To process multi-band
images, use the :py:meth:`~PIL.Image.Image.split` method or
:py:func:`~PIL.Image.merge` function.
:param expression: A string containing a Python-style expression.
:param options: Values to add to the evaluation context. You
can either use a dictionary, or one or more keyword
arguments.
:return: The evaluated expression. This is usually an image object, but can
also be an integer, a floating point value, or a pixel tuple,
depending on the expression.
<20>__r)<00> ' not allowedr z<string><3E>eval<61>coderr<00>NonecsX|jD]}t|<01>t<01><01>ur<11>|<01>q|jD]}|<02>vr)|dkr)d|<02>d<03>}t|<03><01>qdS)Nr>r)r<>)<04> co_consts<74>type<70>co_namesr)r<><00>const<73>namer!<00>r<><00> compiled_code<64>scanrrr<>9s
<02>
 <02><04>zunsafe_eval.<locals>.scan<61>
__builtinsr>N)r<>rrr<>)r<>r<><00>list<73>keysr<73><00>builtinsrr<>r<>r
<00>compiler<65>r>r r-)r<>r<>r<>r<>r!r<>r5rr<>r<00> unsafe_evals* <02>


 <02> 
 <02>r<EFBFBD><00>_dictcKstddd<03>t||fi|<02><01>S)a1
Evaluates an image expression.
Deprecated. Use lambda_eval() or unsafe_eval() instead.
:param expression: A string containing a Python-style expression.
:param _dict: Values to add to the evaluation context. You
can either use a dictionary, or one or more keyword
arguments.
:return: The evaluated expression. This is usually an image object, but can
also be an integer, a floating point value, or a pixel tuple,
depending on the expression.
.. deprecated:: 10.3.0
zImageMath.eval<61> z.ImageMath.lambda_eval or ImageMath.unsafe_eval)r r<>)r<>r<>r<>rrrr<>Ks <04>r<>)rr
rr
)rr
rEr&rr
)rr
rr$rr
)r<>r<>r<>r<>r<>rrr)r<>r$r<>r<>r<>rrr)r<>r$r<>r<>r<>rrr)<19>
__future__rr<><00>typesr<00>typingrr<00>rr<00>
_deprecater r
r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>rrrr<00><module>s:   
-





<06> <0C>% <0C>;<10>