Files
serveur-d-authentification/venv/lib/python3.10/site-packages/PIL/__pycache__/ImageDraw.cpython-310.pyc

250 lines
24 KiB
Plaintext
Raw Normal View History

o
<00>Q<EFBFBD>j<EFBFBD><6A><00>@s<>UddlmZddlZddlZddlmZddlmZddlm Z m
Z
m Z dZ e rMddlm Z dd lmZdd
lmZmZdd lmZmZdd lmZmZe jjZd ed< Gdd<10>d<10>Zd4d5dd<17>Zd4d6dd<1B>Z  d7d8d&d'<27>Zd9d.d/<2F>Zd:d2d3<64>Z dS);<3B>)<01> annotationsN)<01>Sequence)<01>cast<73>)<03>Image<67>
ImageColor<EFBFBD> ImageTextF)<01>Callable)<01>
ModuleType)<02>Any<6E>AnyStr)<02>
ImageDraw2<EFBFBD> ImageFont)<02>Coords<64>_Inkz!Callable[[], Image.core._Outline]<5D>Outlinec@s<>eZdZUdZded<dmdnd
d <0B>Zdod d<0E>Zdpdd<12>Z dmdqdd<18>Z  drdsd!d"<22>Z dmdtd%d&<26>Z
  dudvd(d)<29>Z   dudwd*d+<2B>Z   dudxd.d/<2F>Z  0 dydzd2d3<64>Z  d{d|d6d7<64>Z   dudvd8d9<64>Zdmd}d:d;<3B>Z   dudwd<d=<3D>Z 0   d~ddBdC<64>Z   dudwdDdE<64>Z 0   d~ddF<64>d<>dIdJ<64>Z    K L    0  Md<4D>d<EFBFBD>d`da<64>Z    K L    0  Md<4D>ddb<64>d<>ddde<64>Z     Md<4D>ddb<64>d<>dfdg<64>Z   K L    0 Md<4D>ddb<64>d<>didj<64>Z   K L    0 Md<4D>ddb<64>d<>dkdl<64>ZdS)<29><> ImageDrawN<77>NImageFont.ImageFont | ImageFont.FreeTypeFont | ImageFont.TransposedFont | None<6E>font<6E>im<69> Image.Image<67>mode<64>
str | None<6E>return<72>NonecCs<>|<01><00>d}|dur |j}||jkr$|dkr|jdkrd}nd}t|<04><01>|dkr-|j|_nd|_||_|j|_tj<07>|j|<03>|_||_|dvrO|j<08> d<05>|_
n|j<08> d <09>|_
|d
vr^d |_ nd |_ d |_ dS)a<>
Create a drawing instance.
:param im: The image to draw in.
:param mode: Optional mode to use for color values. For RGB
images, this argument can be RGB or RGBA (to blend the
drawing into the image). For all other modes, this argument
must be the same as the image mode. If omitted, the mode
defaults to the mode of the image.
rN<>RGBA<42>RGBrz mode mismatch<63>P)<02>I<>F<><46><EFBFBD><EFBFBD><EFBFBD>)<04>1rrrr!<00>LF) <0A>_ensure_mutabler<00>
ValueError<EFBFBD>palette<74>_imagerr<00>core<72>draw<61>draw_ink<6E>ink<6E>fontmode<64>fill)<05>selfrr<00>blend<6E>msg<73>r0<00>p/home/sorel/systeme_gestion_cerfig/serveur-d-authentification/venv/lib/python3.10/site-packages/PIL/ImageDraw.py<70>__init__Bs. 


zImageDraw.__init__<5F>GImageFont.ImageFont | ImageFont.FreeTypeFont | ImageFont.TransposedFontcCs"|jsddlm}|<01><03>|_|jS)a=
Get the current default font.
To set the default font for this ImageDraw instance::
from PIL import ImageDraw, ImageFont
draw.font = ImageFont.truetype("Tests/fonts/FreeMono.ttf")
To set the default font for all future ImageDraw instances::
from PIL import ImageDraw, ImageFont
ImageDraw.ImageDraw.font = ImageFont.truetype("Tests/fonts/FreeMono.ttf")
If the current default font is ``None``,
it is initialized with ``ImageFont.load_default()``.
:returns: An image font.r<00>r)r<00>r<00> load_default)r-rr0r0r1<00>getfontjs 
zImageDraw.getfont<6E> font_size<7A> float | NonecCs&|durddlm}|<02>|<01>S|<00><03>S)Nrr4)r5rr6r7)r-r8rr0r0r1<00>_getfont<6E>s 
zImageDraw._getfontr*<00> _Ink | Noner,<00>tuple[int | None, int | None]cCs<>d}d}|dur|dur|jr|j}||fS|j}||fS|durCt|t<03>r-t<04>||j<06>}|jr=t|t<08>r=|j<07>||j <09>}|j
<EFBFBD> |<01>}|durit|t<03>rSt<04>||j<06>}|jrct|t<08>rc|j<07>||j <09>}|j
<EFBFBD> |<02>}||fS<00>N) r,r*<00>
isinstance<EFBFBD>strr<00>getcolorrr%<00>tupler&r(r))r-r*r,<00>
result_ink<EFBFBD> result_fillr0r0r1<00>_getink<6E>s*<06><08>
 
 zImageDraw._getinkr<00>xyr<00>start<72>float<61>end<6E>width<74>intcCs2|<00>|<04>\}}|dur|j<01>|||||<05>dSdS)z Draw an arc.N)rDr(<00>draw_arc)r-rErFrHr,rIr*r0r0r1<00>arc<72>s <04>z ImageDraw.arc<72> Sequence[int]<5D>bitmapcCsD|<02><00>|<00>|<03>\}}|dur|}|dur |j<02>||j|<04>dSdS)zDraw a bitmap.N)<05>loadrDr(<00> draw_bitmapr)r-rErNr,r*r0r0r1rN<00>s<04>zImageDraw.bitmap<61>outlinec C<01>j|<00>||<04>\}}|dur|j<01>||||d<02>|dur/||kr1|dkr3|j<01>||||d|<06>dSdSdSdS)z Draw a chord.Nrr)rDr(<00>
draw_chord<EFBFBD> r-rErFrHr,rQrIr*<00>fill_inkr0r0r1<00>chord<72><00> 
 <0C>zImageDraw.chordcC<01>b|<00>||<02>\}}|dur|j<01>||d<02>|dur+||kr-|dkr/|j<01>||d|<04>dSdSdSdS)zDraw an ellipse.Nrr)rDr(<00> draw_ellipse<73>r-rEr,rQrIr*rUr0r0r1<00>ellipse<73><00>  <0C>zImageDraw.ellipse<73>Sequence[float]<5D>radiuscCs@|d||d||d||d|f}|<00>||||<05>dS)z4Draw a circle given center coordinates and a radius.rrN)r[)r-rEr^r,rQrI<00>
ellipse_xyr0r0r1<00>circle<6C>s, zImageDraw.circler<00>jointcsR|<00>|<02>d}|du<01>r!|j<01><02>|<05><00>|dk<02>r#<23>dk<04>r%t<03>dttf<02>r1tttt<00><01>}n<0F>fdd<06>t dt
<EFBFBD><01>d<07>D<00>}t dt
|<06>d<00>D]<5D>}||}d d<06>||d|f|||dffD<00>} | d| dkrmqId<17>fdd<11> }
| d| dko<>| dd| dkp<>| d| dko<>| dd| dk} |d<00>dd|d<00>ddf|d<00>dd|d<00>ddfg} | r<>| dd| dd} }n | dd| dd} }|<00> | | d|d|<02><00>dk<04>r | <0B>r|
|| dd<00>||
|| dd<00>g}n|
|| dd<00>||
|| dd<00>g}|j ||dd<16>qIdSdSdSdS)z6Draw a line, or a connected sequence of line segments.rN<>curve<76>c s*g|]}tttt<03>||d<00><00><01><02>qS)<01>)rrrGrA<00><02>.0<EFBFBD>i)rEr0r1<00>
<listcomp><3E>s<1C><06>z"ImageDraw.line.<locals>.<listcomp>rdrc
Ss>g|]\}}t<00>t<00>|d|d|d|d<00><02>d<00>qS)rr<00>h)<03>math<74>degrees<65>atan2)rfrFrHr0r0r1rhs (<28><02><06><>coordr]<00>anglerGr<00>tuple[float, ...]c
sZ|\}}|d8}<01>dd}tdd<05>||t<01>t<01>|<01><01>f||t<01>t<01>|<01><01>ffD<00><01>S)N<>Zrdrcss4<00>|]\}}||dkrt<00>|<02>nt<00>|<02>VqdS)rN)rj<00>floor<6F>ceil)rf<00>p<>p_dr0r0r1<00> <genexpr>s
<02><1E>
<EFBFBD>z9ImageDraw.line.<locals>.coord_at_angle.<locals>.<genexpr>)rArj<00>cos<6F>radians<6E>sin)rmrn<00>x<>y<>distance<63>rIr0r1<00>coord_at_angle s <02><08>z&ImageDraw.line.<locals>.coord_at_angle<6C><65>rp<00><00>r|)rmr]rnrGrro) rDr(<00>
draw_linesr><00>listrArrrG<00>range<67>len<65>pieslice<63>line)r-rEr,rIrar*<00>pointsrg<00>point<6E>anglesr}<00>flipped<65>coordsrFrH<00>
gap_coordsr0)rIrEr1r<><00>sZ

<06><02><06>"<02>"<02>&&<04>
<06><04><02><04> zImageDraw.line<6E>shape<70>Image.core._OutlinecCs\|<01><00>|<00>||<02>\}}|dur|j<02>||d<02>|dur*||kr,|j<02>||d<03>dSdSdS)z(Experimental) Draw a shape.Nrr)<04>closerDr(<00> draw_outline)r-r<>r,rQr*rUr0r0r1r<>7s<08>zImageDraw.shapec CrR)zDraw a pieslice.Nrr)rDr(<00> draw_pieslicerTr0r0r1r<>ErWzImageDraw.pieslicecCs,|<00>|<02>\}}|dur|j<01>||<03>dSdS)z#Draw one or more individual pixels.N)rDr(<00> draw_points)r-rEr,r*r0r0r1r<>Us<04>zImageDraw.pointc
Cs<>|<00>||<02>\}}|dur|j<01>||d<02>|dur`||krb|dkrd|dkr/|j<01>||d|<04>dS|jdurft<04>d|jj<06>}|<00>d<02>d}t|<07>} | j<01>||d<02>|j<01>||d|dd|j<03>dSdSdSdSdS)zDraw a polygon.Nrrr!rd)rDr(<00> draw_polygonrr<00>new<65>size<7A>Draw)
r-rEr,rQrIr*rU<00>mask<73>mask_inkr(r0r0r1<00>polygon[s
" <0C>zImageDraw.polygon<6F>bounding_circle<6C>!Sequence[Sequence[float] | float]<5D>n_sides<65>rotationcCs t|||<03>}|<00>||||<06>dS)zDraw a regular polygon.N)<02>!_compute_regular_polygon_verticesr<73>)r-r<>r<>r<>r,rQrIrEr0r0r1<00>regular_polygonss
zImageDraw.regular_polygoncCrX)zDraw a rectangle.Nrr)rDr(<00>draw_rectanglerZr0r0r1<00> rectangle<6C>r\zImageDraw.rectangle<6C><01>cornersr<73><00>$tuple[bool, bool, bool, bool] | Nonec snt|dttf<02>rtttt|<01>\\<02><08>
\<02> <09> n ttt|<01>\<04><08>
<EFBFBD> <09> <0B> <09>kr.d}t|<07><01><01> <0B>
kr8d}t|<07><01><01>dur>d<05>|d<00>t<07><08><01>t<07>
<EFBFBD><01>
t<07> <09><01> t<07> <0B><01> d\<02><03>t<08><00>r<><72><01> <09>dk<05><03>rh<72> <09><00><01><01> <0B>
dk<05><04>rv<72> <0B>
<00><01>r<><72>r<><72><06> |||<04><07>S<00>dks<>t
<EFBFBD><00>s<><73><06> |||<04><07>St <0C>d<00>}<08><06> ||<03>\<02><05>d<12><00><01><02><03><04><05><06><07><08> <09>
<EFBFBD> f d d<0E> } <09>du<01>rT| d<0F><00>r҈j<0E><0F><08>
|d<00> <09> |df<04>d<08>n <20> |d<00>|dkr<><72>j<0E><0F>|d<00>
<EFBFBD> |d<00> f<04>d<08><00><03>sT<73><04>sT<73><08>
<EFBFBD>|<00> g}
<EFBFBD>d<00>r|
d|d7<<00>d<00>r|
d|d8<<00>j<0E>|
<EFBFBD>d<08><00> |<00>
<EFBFBD> <09> g} <0B>d<00>r=| d|d7<<00>d<00>rL| d|d8<<00>j<0E>| <0B>d<08><00>du<01>r/<2F><05>k<03>r1<72>dk<03>r3| d<11><00><03>sʈ<08>
<EFBFBD> <09>
<EFBFBD>dg} <0C>d<00>r<>| d|d7<<00>d<00>r<>| d|d8<<00>j<0E>| <0C>d<08><00><08> <0B>d<00> <09> g} <0A>d<00>r<>| d|d7<<00>d<00>r<>| d|d8<<00>j<0E>| <0A>d<08><00><04>s5<73><08>
<EFBFBD><08>d<00> g}
<EFBFBD>d<00>r<>|
d|d7<<00>d<00>r<>|
d|d8<<00>j<0E>|
<EFBFBD>d<08><00> <09>d<00>
<EFBFBD> <09> g} <0B>d<00>r| d|d7<<00>d<00>r%| d|d8<<00>j<0E>| <0B>d<08>dSdSdSdSdS)zDraw a rounded rectangle.rz&x1 must be greater than or equal to x0z&y1 must be greater than or equal to y0N)TTTTrd)FFrr<><00>boolrrc
s*<00>r<1D><08>
<EFBFBD><08><00>
<EFBFBD>fddf<03><08> <0B><00><08><00> fddff}nZ<6E>r:<3A><08>
<EFBFBD><08><00>
<EFBFBD>fddf<03> <09><00>
<EFBFBD> <09>
<EFBFBD>fddff}n=t<00>fdd<07>t<01><08>
<EFBFBD><08><00>
<EFBFBD>fddf<03> <09><00>
<EFBFBD> <09>
<EFBFBD>fddf<03> <09><00> <0B><00> <09> fddf<03><08> <0B><00><08><00> fddff<04>D<00><01>}|D]}|r<><72>jj|<02>df<00>qy<71>jj|<02><05>f<00>qydS) Nr~rirrp<00>c3s <00>|] \}}<02>|r|VqdSr=r0)rfrg<00>partr<74>r0r1ru<00>s<02><02>
<EFBFBD>zDImageDraw.rounded_rectangle.<locals>.draw_corners.<locals>.<genexpr>r)rA<00> enumerater(r<>rK)r<><00>partsr<73><00> r<><00>drU<00>full_x<5F>full_yr*r-rI<00>x0<78>x1<78>y0<79>y1r0r1<00> draw_corners<72>s,<06><06> <02><02><08> <04>z1ImageDraw.rounded_rectangle.<locals>.draw_cornersTr<54>F)r<>r<>rr)r>r<>rArrrGr$<00>round<6E>allr[<00>anyr<79>rJrDr(r<>)r-rEr^r,rQrIr<>r/<00>rr<72><00>left<66>right<68>top<6F>bottomr0r<>r1<00>rounded_rectangle<6C>s<>  $
"*( 











 <0C>zImageDraw.rounded_rectanglercr<>F<>tuple[float, float]<5D>text<78>AnyStr | ImageText.Text[AnyStr]<5D>anchor<6F>spacing<6E>alignr?<00> direction<6F>features<65>list[str] | None<6E>language<67> stroke_width<74> stroke_fill<6C>embedded_colorr<72><00>argsr <00>kwargsc st|tj<02>r |<02>n&|dur<15><08><03><05>d<02><01>}t<01>||<04>j|<06><01><03><06><07><04>r'<27><04><06>| r/<2F><04>| | <0C>d<10>fdd<08> }||<03>}|dur@dSd}<12>jrQ<72>j durO|<10>j <09>n|}<12><04>
|||<07>D])<29>dd<12><00><01><02><03><04><05><06><07>f dd<0F> }|dur}||<12>j<08>||kr|||<11>qX||<11>qXdS)z
Draw text.Nr8r,r;rrJcs*<00><00>|<00>\}}|dur|dusJ<00>|S|Sr=)rD)r,r*rU)r-r0r1<00>getink?s
 zImageDraw.text.<locals>.getinkrr*r<>rGrc
s<><00>j}|dkr <0B>r d}t<01>j<02>}t<01>j<03>}t<04><05>j<02>dt<04><05>j<03>df}z)<29>jj<07>j|g<02><00>R<00><01><03>|d<03>j ||d<04><08><05><01>\}}||d7}||d7}Wn4t
y<EFBFBD>z<1A>jj <0B>j|<02><01><03>|<01>j |g<08><00>Rd|i<01><05><01>}Wnt y<00>j<06> <0B>j<08>}YnwYnw|dkr<>||<06> d<07>}}t<0E>d|<00>d} |<08>d| <09><00>jdur<><72>j<11>|||||jd||jdf|<06>dSdS<00>j<14>||f||<00>dS) NrrT)r<>r<>r<>r<><00> stroke_filledr<64>r*rFrrFr<>rg)r+rJryrzrj<00>modfr<00>getmask2r<32>r<><00>AttributeError<6F>getmask<73> TypeError<6F>getband<6E>struct<63>pack<63>fillbandr<00>paster<65>r(rP)
r*r<>rryrzrFr<><00>offset<65>color<6F> ink_alpha<68> r<>r<>r<>r<><00>
image_textr<EFBFBD>r<>r<>r-r0r1<00> draw_textTsv 

 <02> <04><04>
<EFBFBD>  <02>
<06> <02>
<EFBFBD> <02><04><02> 
"<08><04>z!ImageDraw.text.<locals>.draw_text)r,r;rrJ)r)r*rJr<>rGrr) r>r<00>Textr:<00>getr<00> embed_color<6F>stroker<65>r<><00>_split)r-rEr<>r,rr<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r*<00>
stroke_inkr<EFBFBD>r0r<>r1r<>s< <04> 

<EFBFBD><02> 7 <02>
<04>zImageDraw.text<78>r8r cCs&|j||||||||| |
| | | |d<01>S<00>Nr<4E>)r<>)r-rEr<>r,rr<>r<>r<>r<>r<>r<>r<>r<>r<>r8r0r0r1<00>multiline_text<78>s <06>zImageDraw.multiline_textc Cs>|dur |<00>|<07>}tj|||j|||d<02>}|r|<08><04>|<08><05>S)z@Get the length of a given string, in pixels with 1/64 precision.N)r<>r<>r<>)r:rr<>rr<><00>
get_length) r-r<>rr<>r<>r<>r<>r8r<>r0r0r1<00>
textlength<EFBFBD>s
<06>zImageDraw.textlength<74>!tuple[float, float, float, float]c  CsR|dur |<00>| <0C>}t<01>|||j|||| <09>} | r| <0A><04>|
r"| <0A>|
<EFBFBD>| <0A>|||<06>S)z2Get the bounding box of a given string, in pixels.N)r:rr<>rr<>r<><00>get_bbox)r-rEr<>rr<>r<>r<>r<>r<>r<>r<>r<>r8r<>r0r0r1<00>textbbox<6F>s
<04>
zImageDraw.textbboxc  Cs"|j||||||||| |
| | d<01> Sr<>)r<>) r-rEr<>rr<>r<>r<>r<>r<>r<>r<>r<>r8r0r0r1<00>multiline_textbbox<6F>s<06>zImageDraw.multiline_textbboxr=)rrrrrr)rr3)r8r9rr3)r*r;r,r;rr<)Nr) rErrFrGrHrGr,r;rIrJrr)rErMrNrr,r;rr)NNr)rErrFrGrHrGr,r;rQr;rIrJrr)
rErr,r;rQr;rIrJrr) rEr]r^rGr,r;rQr;rIrJrr)NrN)
rErr,r;rIrJrarrr)NN)r<>r<>r,r;rQr;rr)rErr,r;rr)rNNr)r<>r<>r<>rJr<>rGr,r;rQr;rIrJrr)rErr^rGr,r;rQr;rIrJr<>r<>rr) NNNrcr<>NNNrNF) rEr<>r<>r<>r,r;rrr<>rr<>rGr<>r?r<>rr<>r<>r<>rr<>rGr<>r;r<>r<>r<>r r<>r rr)rEr<>r<>r r,r;rrr<>rr<>rGr<>r?r<>rr<>r<>r<>rr<>rGr<>r;r<>r<>r8r9rr)NNNNF)r<>r rrr<>rr<>r<>r<>rr<>r<>r8r9rrG) NNrcr<>NNNrF)rEr<>r<>r rrr<>rr<>rGr<>r?r<>rr<>r<>r<>rr<>rGr<>r<>r8r9rr<>)<1B>__name__<5F>
__module__<EFBFBD> __qualname__r<00>__annotations__r2r7r:rDrLrNrVr[r`r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r0r0r0r1r=s<>

<EFBFBD> 
(
 <0C> <0C> <0C> <0C> <0C> <0C> <0C>P <0C> <0C>   <0C> <0C> <0C><02><0E> <0C><02><0E>0<02><0E>(<02><0E>*<02><12>rrrrrrcCs.zt|d<01>|<01>WStyt||<01>YSw)a<>
A simple 2D drawing interface for PIL images.
:param im: The image to draw in.
:param mode: Optional mode to use for color values. For RGB
images, this argument can be RGB or RGBA (to blend the
drawing into the image). For all other modes, this argument
must be the same as the image mode. If omitted, the mode
defaults to the mode of the image.
<20>getdraw)<03>getattrr<72>r)rrr0r0r1r<>#s
  <02>r<EFBFBD><00>Image.Image | None<6E>)tuple[ImageDraw2.Draw | None, ModuleType]cCs*ddlm}|dur|<01>|<00>nd}||fS)zm
:param im: The image to draw in.
:returns: A (drawing context, drawing resource factory) tuple.
r)r N)r5r r<>)rr r(r0r0r1r<>4s r<><00>imagerE<00>tuple[int, int]<5D>value<75>float | tuple[int, ...]<5D>border<65>float | tuple[int, ...] | None<6E>threshrGrc Csn|<00><00>}|dus
J<00>|\}}z|||f}t||<08>|krWdS||||f<Wn ttfy2YdSw||fh} t<04>}
| r<>t<04>} | D]j\}}|d|f|d|f||df||dffD]O\} } | | f|
vsn| dksn| dkroq\z|| | f}Wn ttfy<>Yq\w|
<EFBFBD>| | f<02>|dur<>t||<08>|k}n|||fv}|r<>||| | f<| <0B>| | f<02>q\qB| }
| } | s=dSdS)a<>
.. warning:: This method is experimental.
Fills a bounded region with a given color.
:param image: Target image.
:param xy: Seed position (a 2-item coordinate tuple). See
:ref:`coordinate-system`.
:param value: Fill color.
:param border: Optional border value. If given, the region consists of
pixels with a color different from the border color. If not given,
the region consists of pixels having the same color as the seed
pixel.
:param thresh: Optional threshold value which specifies a maximum
tolerable difference of a pixel value from the 'background' in
order for it to be replaced. Useful for filling regions of
non-homogeneous, but similar, colors.
Nrr)rO<00> _color_diffr$<00>
IndexError<EFBFBD>set<65>add)r<>rEr<>r<>r<><00>pixelryrz<00>
background<EFBFBD>edge<67> full_edge<67>new_edge<67>s<>trsr,r0r0r1<00> floodfill?sH  <02>
 4<02>  <02><02> <0C>rr<>r<>r<>rJr<><00>list[tuple[float, float]]cs<>t|t<01>s d}t|<03><01>|dkrd}t|<03><01>t|ttf<02>s"d}t|<03><01>t|<00>dkrDtdd<06>|D<00><01>s7d}t|<03><01>ttt t|<00><01><02>^<00><02>nPt|<00>dkr<>t|d ttf<02>r<>td
d<06>|d D<00><01>rgt|d tt f<02>smd}t|<03><01>t|d <00>dkr{d }t|<03><01>ttt t|d <00><01><02>tt |d <00><02>nd }t|<03><01><01>d kr<>d}t|<03><01>t|tt f<02>s<>d}t|<03><01>d#<23>fdd<17> <0C>d$<24><00>fdd<1A> <0C>d%dd<1F>}|||<02>}<05>fd d!<21>|D<00>S)&u<>
Generate a list of vertices for a 2D regular polygon.
:param bounding_circle: The bounding circle is a sequence defined
by a point and radius. The polygon is inscribed in this circle.
(e.g. ``bounding_circle=(x, y, r)`` or ``((x, y), r)``)
:param n_sides: Number of sides
(e.g. ``n_sides=3`` for a triangle, ``6`` for a hexagon)
:param rotation: Apply an arbitrary rotation to the polygon
(e.g. ``rotation=90``, applies a 90 degree rotation)
:return: List of regular polygon vertices
(e.g. ``[(25, 50), (50, 50), (50, 25), (25, 25)]``)
How are the vertices computed?
1. Compute the following variables
- theta: Angle between the apothem & the nearest polygon vertex
- side_length: Length of each polygon edge
- centroid: Center of bounding circle (1st, 2nd elements of bounding_circle)
- polygon_radius: Polygon radius (last element of bounding_circle)
- angles: Location of each polygon vertex in polar grid
(e.g. A square with 0 degree rotation => [225.0, 315.0, 45.0, 135.0])
2. For each angle in angles, get the polygon vertex at that angle
The vertex is computed using the equation below.
X= xcos(φ) + ysin(φ)
Y= −xsin(φ) + ycos(φ)
Note:
φ = angle in degrees
x = 0
y = polygon_radius
The formula above assumes rotation around the origin.
In our case, we are rotating around the centroid.
To account for this, we use the formula below
X = xcos(φ) + ysin(φ) + centroid_x
Y = −xsin(φ) + ycos(φ) + centroid_y
zn_sides should be an intr<74>zn_sides should be an int > 2z$bounding_circle should be a sequencecs<01><00>|]
}t|ttf<02>VqdSr=<00>r>rJrGrer0r0r1ru<00>s<02>z4_compute_regular_polygon_vertices.<locals>.<genexpr>z0bounding_circle should only contain numeric datardrcsrr=r rer0r0r1ru<00>s<02>
<EFBFBD>rzBbounding_circle centre should contain 2D coordinates (e.g. (x, y))z[bounding_circle should contain 2D coordinates and a radius (e.g. (x, y, r) or ((x, y), r) )z$bounding_circle radius should be > 0z"rotation should be an int or floatr<74><00> list[float]rkrGrr<>c
s<>t|dt<01>t<01>d|<00><01>|dt<01>t<01>d|<00><01><00>dd<04>t|dt<01>t<01>d|<00><01>|dt<01>t<01>d|<00><01><00>dd<04>fS)Nrrirrd)r<>rjrvrwrx)r<>rk)<01>centroidr0r1<00>_apply_rotation<6F>s"<02><02><02><02><02><02><04>z:_compute_regular_polygon_vertices.<locals>._apply_rotationrncs<00>dg}<01>||<00>S<00>Nrr0)rn<00> start_point)r <00>polygon_radiusr0r1<00>_compute_polygon_vertex<65>s
zB_compute_regular_polygon_vertices.<locals>._compute_polygon_vertexr<78>rJr<>cSsPg}d|}dd||}t|<00>D]}|<02>|<04>||7}|dkr%|d8}q|S)Nrir<>g<00>?)r<><00>append)r<>r<>r<>rk<00> current_angle<6C>_r0r0r1<00> _get_angles<65>s 
<02>z6_compute_regular_polygon_vertices.<locals>._get_anglescsg|]}<01>|<01><01>qSr0r0)rfrn)rr0r1rh<00>sz5_compute_regular_polygon_vertices.<locals>.<listcomp>N)r<>r
rkrGrr<>)rnrGrr<>)r<>rJr<>rGrr
)
r>rJr<>r$r<>rAr<>r<>rrG)r<>r<>r<>r/rr<>r0)r rr rr1r<><00>sR
+ <08><02><02>

r<><00>color1<72>color2csHt|t<01>r|n|f<01>t|t<01>r|n|f<01>t<02><00>fdd<02>tt<04><01><01>D<00><01>S)zJ
Uses 1-norm distance to calculate difference between two values.
c3s$<00>|] }t<00>|<00>|<00>VqdSr=)<01>absre<00><02>first<73>secondr0r1ru s<02>"z_color_diff.<locals>.<genexpr>)r>rA<00>sumr<6D>r<>)rrr0rr1r<>s r<>r=)rrrrrr)rr<>rr<>r ) r<>rrEr<>r<>r<>r<>r<>r<>rGrr)r<>r<>r<>rJr<>rGrr)rr<>rr<>rrG)!<21>
__future__rrjr<><00>collections.abcr<00>typingrr5rrr<00> TYPE_CHECKINGr <00>typesr
r r r r<00>_typingrrr'rQrr<>rr<>r<>rr<>r<>r0r0r0r1<00><module>s:     k  <0C>
A