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

91 lines
14 KiB
Plaintext
Raw Normal View History

Ë
ß¼jz'ã óddlmZddlZddlZddlZddlZddlZddlmZddl m
Z
ddl m Z gZ
d)d*dZd+d,dZGd „d
«ZGd d e«Zej$d
k(ree«Gdde«Zej$dk(ree«Gddej(e«ZGdde«ZGdde«ZGdde«ZGdde«ZGdde«Zej$dvrej6d«ree«ej6d«ree«ej6d «ree«ej6d!«ree«ej6d"«ree«Gd#„d$e«Z dd%lmZee«e!d&k(rse"ejF«d'kre$d(«ejJ«e jLejFd«5Z'e$ee'gejFd'd¢­Ž«ddd«yy#e $rYŒ€wxYw#1swYyxYw)-é)Ú annotationsN©Úquote)ÚAnyé)ÚImagecó´t|t«rt|t«r|«}|dkDrtj |«ytj
d|«y)a$
The :py:func:`register` function is used to register additional viewers::
from PIL import ImageShow
ImageShow.register(MyViewer()) # MyViewer will be used as a last resort
ImageShow.register(MySecondViewer(), 0) # MySecondViewer will be prioritised
ImageShow.register(ImageShow.XVViewer(), 0) # XVViewer will be prioritised
:param viewer: The viewer to be registered.
:param order:
Zero or a negative integer to prepend this viewer to the list,
a positive integer to append it.
rN)Ú
isinstanceÚtypeÚ
issubclassÚViewerÚ_viewersÚappendÚinsert)ÚviewerÚorders úP/home/antigravity/intellecton/venv/lib/python3.12/site-packages/PIL/ImageShow.pyÚregisterrs?ô&œ$Ô¤J¨v´vÔ$>ÙˆØ ˆq‚yܘÕ䘘6Õc óHtD]}|j|fd|i|¤ŽsŒyy)a 
Display a given image.
:param image: An image object.
:param title: Optional title. Not all viewers can display the title.
:param \**options: Additional viewer options.
:returns: ``True`` if a suitable viewer was found, ``False`` otherwise.
ÚtitleTF)rÚshow)ÚimagerÚoptionsrs rrr3s3ôòˆØ ˆ6;‰; 5 EÐ 5¨WÓ ðð rcóbeZdZUdZd
dZdZded< iZded< ddZdd „Z dd
Z
d
d Z dd Z y)r
zBase class for viewers.rc óü|jdvs\|jdk(r|jdvs?tj|j«}|j|k7r|j |«}|j
|fi|¤ŽS)
The main function for displaying an image.
Converts the given image to the target format and displays it.
)ÚRGBAÚPNG)zI;16ÚLA)ÚmodeÚformatrÚ getmodebaseÚconvertÚ
show_image)ÚselfrrÚbases rrz Viewer.showGskð
J‰J˜  ˜uÒ¯©°~Ñ)Eä×$ U§Z¡ZÓ0ˆz‰z˜Ÿ
 dÓ+àˆt˜uÑÑ0r
str | Noner"zdict[str, Any]có|jS)z3Return format name, or ``None`` to save as PGM/PPM.)r"©r&rs rÚ
get_formatzViewer.get_format^s à{‰{Ðrc ód}t|«)zj
Returns the command used to display the file.
Not implemented in the base class.
zunavailable in base viewer)ÚNotImplementedError)r&ÚfilerÚmsgs rÚ get_commandzViewer.get_commandbsð
+ˆÜ! &rcó\|jdd|j|«i|j¤ŽS)z+Save to temporary file and return filename.r"©)Ú_dumpr+rr*s rÚ
save_imagezViewer.save_imagejs(àˆu{‰{ÑI $§/¡/°%Ó"8ÐI¸D¿L¹LÑIrc óF|j|j|«fi|¤ŽS)zDisplay the given image.)Ú show_filer4©r&rrs rr%zViewer.show_imagens!àˆt~‰~˜dŸo™o¨eÓ@¸Ñ@rc óštjj|«sttj|j
|fi|¤Ž«y)ú%
Display given file.
r)ÚosÚpathÚexistsÚFileNotFoundErrorÚsystemr0©r&r;rs rr6zViewer.show_filers<ôw‰w~‰~˜ 
‰ Ð"$×" 3¨7Ñr©rú Image.ImagerrÚreturnÚint)rrArBr(©r.ÚstrrrrBrE)rrArBrE©r;rErrrBrC)
Ú__name__Ú
__module__Ú __qualname__Ú__doc__rr"Ú__annotations__rr+r0r4r%r6r2rrr
r
BsAÙ1ð$€FˆJÓØ €Gˆ^Ó ØóJóAôrr
có.eZdZdZdZdddœZd dZd
dZy) Ú
WindowsViewerzNThe default viewer on Windows is the default system application for PNG files.rrÚcompress_levelÚsave_allc ód|d|dS)Nzstart "Pillow" /WAIT "z)" && ping -n 4 127.0.0.1 >NUL && del /f "ú"r2©r&r.rs rr0zWindowsViewer.get_command…sà$ T +à˜˜qð

rc ó¼tjj|«stt j
|j |fi|¤Ždttd«¬«y)r9CREATE_NO_WINDOW)ÚshellÚ
creationflagsr)r:r;r<r=Ú
subprocessÚPopenr0Úgetattrr?s rr6zWindowsViewer.show_fileŒsPôw‰w~‰~˜dÔ ×ÑØ ˆD× Ñ ˜TÑ - WÑ Ü!¤*Ð.@Ó
ð
rNrDrF©rGrHrIrJr"rr0r6r2rrrMrMsÙ
€FØ!"°Ñ5€Gó
ô rrMÚwin32có.eZdZdZdZdddœZd dZd
dZy) Ú MacViewerz2The default viewer on macOS using ``Preview.app``.rrTrNc óFd}d|dt|«dt|«d}|S)Nzopen -a Preview.appú z; sleep 20; rm -f z)&r©r&r.rÚcommands rr0zMacViewer.get_command¤s1ð(ˆØgY˜  ˜}Ð,>¼uÀT»{¸mÈ2ÐNˆØˆrc óTtjj|«stt j
ddd|g«t
tdd«xrttd«}| xrtjxstjd«}|rt j|dd |g«y
) r9Úopenz-az Preview.appÚfrozenFÚ_MEIPASSÚpython3z-cz<import os, sys, time; time.sleep(20); os.remove(sys.argv[1])r)
r:r;r<r=rXÚcallrZÚsysÚhasattrÚ
executableÚshutilÚwhichrY)r&r;rÚ pyinstallerrls rr6zMacViewer.show_file«ôw‰w~‰~˜dÔ ˜  }°dМc 8¨UÓÄÀZÓ8Pˆ Ø%8¬#¯.©.ÒT¼V¿\¹\È)Ó=Tˆ
Ù Ü × Ñ àØØð ô
ðrNrDrFr[r2rrr^r^žsÙ
€FØ!"°Ñ5€Góôrr^ÚdarwincóHeZdZdZdddœZej dd«Zd dZy)
Ú
UnixViewerrrTrNc óy©Nr2rSs rÚget_command_exzUnixViewer.get_command_exÉsà rc óN|j|fi|¤Žd}|dt|«S)Nrra)rurrbs rr0zUnixViewer.get_commandÍs3Ø%$×% 6¨gÑ6°qÑ9ˆØ˜!œE $K˜)rr.rErrrBútuple[str, str]rD) rGrHrIr"rÚabcÚabstractmethodrur0r2rrrrrrÅs.Ø
€FØ!"°Ñ5€Gà×Ñò
óð
ô*rrrcó eZdZdZddZddZy)Ú XDGViewerz3
The freedesktop.org ``xdg-open`` command.
c ódx}}||fS)xdg-openr2)r&r.rrcrls rruzXDGViewer.get_command_ex×sØ)ˆ˜
Ð"rc ó|tjj|«stt j
d|g«y)r9r~r©r:r;r<r=rXrYr?s rr6zXDGViewer.show_fileÛs0ôw‰w~‰~˜dÔ ×ј* rNrwrF©rGrHrIrJrur6r2rrr|r|Òsñórr|có2eZdZdZ d ddZddZy)Ú
DisplayViewerz`
The ImageMagick ``display`` command.
This viewer supports the ``title`` parameter.
Nc ó8dx}}|r|dt|«z