Files
intellecton/venv/lib/python3.12/site-packages/PIL/__pycache__/ImageDraw2.cpython-312.pyc
T

101 lines
9.6 KiB
Plaintext
Raw Normal View History

Ë
ß¼j:ãó¤dZddlmZddlmZmZmZddlmZm Z m
Z
m Z m Z ddl
mZmZGdd«ZGd „d
«ZGd d «ZGd
d«Zy)z]
(Experimental) WCK-style drawing interface operations
.. seealso:: :py:mod:`PIL.ImageDraw`
é)Ú annotations)ÚAnyÚAnyStrÚBinaryIOé)ÚImageÚ
ImageColorÚ ImageDrawÚ ImageFontÚ ImagePath)ÚCoordsÚStrOrBytesPathcóeZdZdZdddZy)ÚPenz"Stores an outline color and width.cóFtj|«|_||_y©N)r ÚgetrgbÚcolorÚwidth)ÚselfrrÚopacitys úQ/home/antigravity/intellecton/venv/lib/python3.12/site-packages/PIL/ImageDraw2.pyÚ__init__z Pen.__init__%sÜ×& -ˆŒ
؈
óN)réÿ)rÚstrrÚintrrÚreturnÚNone©Ú__name__Ú
__module__Ú __qualname__Ú__doc__r©rrrr"s
ÙrrcóeZdZdZdddZy)ÚBrushzStores a fill colorcó8tj|«|_yr)r rr)rrrs rrzBrush.__init__-sÜ×& -ˆ
rN)r)rrrrrrr r%rrr'r'*s
Ùõ.rr'có*eZdZdZ d ddZy)ÚFontz Stores a TrueType font and colorcóntj|«|_tj||«|_yr)r rrr ÚtruetypeÚfont)rrÚfileÚsizes rrz
Font.__init__4s*ô ×& -ˆŒ
Ü×& t¨TÓ2ˆ rN)é )rrr.zStrOrBytesPath | BinaryIOr/Úfloatrrr r%rrr*r*1s1ÙJLðð3Ø 9ð3ØAFð
ô3rr*cóeZdZdZ d ddZddZ d ddZddZ ddZ ddZ dd „Z
dd
Z dd Z dd Z
dd
ZddZ ddZddZy)ÚDrawz4
(Experimental) WCK-style drawing interface
NcóÀt|t«r&|
d}t|«tj|||«}t j |«|_||_d|_ y)Nz>If image argument is mode string, size must be a list or tuple)
Ú
isinstancerÚ
ValueErrorrÚnewr
r3ÚdrawÚimageÚ transform)rr9r/rÚmsgs rrz
Draw.__init__AsRô eœSÔ ˆ|ØVÜ  “oЗI‘I˜e T¨5Ó1ˆEÜ—N‘N 5ÓŒ ؈Œ
ØQUˆrcó|jSr)r9)rs rÚflushz
Draw.flushPs Øz‰zÐrc ó~dx}}d}t|t«r|j}|j}n(t|t«r|j}|j}t|t«r
|j}nt|t«r |j}|j
r2t
j|«} | j |j
«| }|dvr|jd|«n$|jd|«|jd|«|dk(r|jd|«t|j|«|fi|¤Žy)Nr)ÚarcÚlineÚfillÚoutliner@r) r5rrrr'r:r ÚPathÚ
setdefaultÚgetattrr8)
rÚopÚxyÚpenÚbrushÚkwargsrBrArÚpaths
rÚrenderz Draw.renderSsðЈˆÜ cœ3Ô Ø—i‘iˆGØ—I‘I‰EÜ
˜œsÔ
—k‘kˆGØ—K‘KˆEÜ eœUÔ —;‘;‰DÜ
˜œUÔ
—99ˆ >Š>Ü—>> %ˆ N‰N˜4Ÿ>™>Ô ˆ
Ñ Ø × Ñ ˜f gÕ × Ñ ˜f dÔ × Ñ ˜i¨Ô
Š<Ø × Ñ ˜g uÔ Œ— ‘ ˜2Ó˜, ,rcó(|\}}dd|dd|f|_y)zSets a transformation offset.rrN)r:)rÚoffsetÚxoffsetÚyoffsets rÚ settransformzDraw.settransformws àˆØ˜Q ¨¨A¨wÐrcó6|jd||g|¢­||dœŽy)
Draws an arc (a portion of a circle outline) between the start and end
angles, inside the given bounding box.
.. seealso:: :py:meth:`PIL.ImageDraw.ImageDraw.arc`
r?©ÚstartÚendN©rL©rrGrHrTrUÚoptionss rr?zDraw.arc|s"ð ˆ E˜2˜sÐC C°E¸Crcó6|jd||g|¢­||dœŽy)
Same as :py:meth:`~PIL.ImageDraw2.Draw.arc`, but connects the end points
with a straight line.
.. seealso:: :py:meth:`PIL.ImageDraw.ImageDraw.chord`
ÚchordrSNrVrWs rrZz
Draw.chordŒs"ð ˆ G˜ÐE E°eÀÔErcó.|jd||g|¢­Žy)z
Draws an ellipse inside the given bounding box.
.. seealso:: :py:meth:`PIL.ImageDraw.ImageDraw.ellipse`
ÚellipseNrV©rrGrHrXs rr\z Draw.ellipseœsð ˆ I˜r 3ÐÔ1rcó.|jd||g|¢­Žy)zˆ
Draws a line between the coordinates in the ``xy`` list.
.. seealso:: :py:meth:`PIL.ImageDraw.ImageDraw.line`
r@NrVr]s rr@z Draw.line¤sð ˆ F˜B Ð. .rcó6|jd||g|¢­||dœŽy)
Same as arc, but also draws straight lines between the end points and the
center of the bounding box.
.. seealso:: :py:meth:`PIL.ImageDraw.ImageDraw.pieslice`
ÚpieslicerSNrVrWs rr`z
Draw.pieslice¬s"ð ˆ J  H¨'ÑH¸ÀCÔHrcó.|jd||g|¢­Žy)a 
Draws a polygon.
The polygon outline consists of straight lines between the given
coordinates, plus a straight line between the last and the first
coordinate.
.. seealso:: :py:meth:`PIL.ImageDraw.ImageDraw.polygon`
ÚpolygonNrVr]s rrbz Draw.polygon¼sð ˆ I˜r 3ÐÔ1rcó.|jd||g|¢­Žy)zg
Draws a rectangle.
.. seealso:: :py:meth:`PIL.ImageDraw.ImageDraw.rectangle`
Ú rectangleNrVr]s rrdzDraw.rectangleÉsð ˆ K  3¨7Ô3rcóæ|jr2tj|«}|j|j«|}|jj |||j
|j ¬«y)zw
Draws the string at the given position.
.. seealso:: :py:meth:`PIL.ImageDraw.ImageDraw.text`
)r-rAN)r:r rCr8Útextr-r©rrGrfr-rKs rrfz Draw.textÑsNð >Š>Ü—>> %ˆ N‰N˜4Ÿ>™>Ô ˆ r˜4 d§i¡i°d·j±jˆÕArcóÎ|jr2tj|«}|j|j«|}|jj |||j
¬«S)
Returns bounding box (in pixels) of given text.
:return: ``(left, top, right, bottom)`` bounding box
.. seealso:: :py:meth:`PIL.ImageDraw.ImageDraw.textbbox`
©r-)r:r rCr8Útextbboxr-rgs rrjz
Draw.textbboxÝsNð >Š>Ü—>> %ˆ N‰N˜4Ÿ>™>Ô ˆy‰y×! " ·±Ð;rcóP|jj||j¬«S)
Returns length (in pixels) of given text.
This is the amount by which following text should be offset.