§ v<ˆjg ãóœ—ddlZddlZddlmZmZddlmZddlmZej e ¦«Z Gd„de ¦«Z d„ZGd„d e¦«ZdS) éN)ÚImageÚ ImageChops)Úgrab)ÚDisplaycó—eZdZdS)ÚDisplayTimeoutErrorN)Ú__name__Ú __module__Ú __qualname__©óúo/builddir/build/BUILD/cloudlinux-venv-1.0.12/venv/lib/python3.11/site-packages/pyvirtualdisplay/smartdisplay.pyrr s€€€€€Ø€Dr rcóü—|jdkr| d¦«}tjd|j|¦«}t j||¦«}| ¦«}|r| |¦«SdS)zÙCrop borders off an image. :param im: Source image. :param bgcolor: Background color, using either a color tuple. :return: An image without borders, or None if there's no actual content in the image. ÚRGBN) ÚmodeÚconvertrÚnewÚsizerÚ differenceÚgetbboxÚcrop)ÚimÚbgcolorÚbgÚdiffÚbboxs rÚautocroprss€ð „w�%ÒÐØ �ZŠZ˜Ñ Ô ˆÝ Œ�5˜"œ' 7Ñ +Ô +€BÝ Ô   RÑ (Ô (€DØ �<Š<‰>Œ>€DØ ðØ�wŠw�t‰}Œ}ÐØ ˆ4r có$—eZdZd„Zdd„Zdd„ZdS) Ú SmartDisplaycó,—t||j¦«S)z£Crop borders off an image. :param im: Source image. :return: An image without borders, or None if there's no actual content in the image. )rÚ_bgcolor)Úselfrs rrzSmartDisplay.autocrop"s€õ ˜˜DœMÑ*Ô*Ð*r Tcó^—t|j¬¦«}|r| |¦«}|S)N)Úxdisplay)rÚnew_display_varr)r"rÚimgs rrzSmartDisplay.grab*s3€å˜DÔ0Ð1Ñ1Ô1ˆà ð %Ø—-’- Ñ$Ô$ˆC؈ r é<Ncó¢—d}d}d} t dt|¦«z¦«tj|¦«||z }| d¬¦«}| |¦«}|r|}|r|snL||¦«rn@|}|dz }||krd|›d |›d �} t| ¦«‚t d ¦«ŒÃ|sJ‚|S) ažstart process and create screenshot. Repeat screenshot until it is not empty and cb_imgcheck callback function returns True for current screenshot. :param autocrop: True -> crop screenshot :param timeout: int :param cb_imgcheck: None or callback for testing img, True = accept img, False = reject img rg333333Ó?gà?ézsleeping %s secsF)rzTimeout! elapsed time:z timeout:ú zscreenshot is empty, next try..)ÚlogÚdebugÚstrÚtimeÚsleeprrr) r"ÚtimeoutrÚ cb_imgcheckÚtÚ sleep_timeÚ repeat_timer&Úimg_cropÚmsgs rÚwaitgrabzSmartDisplay.waitgrab2s€ð ˆØˆ ؈ ð 9Ý �IŠIÐ(­3¨z©?¬?Ñ:Ñ ;Ô ;Ð ;Ý ŒJ�zÑ "Ô "Ð "Ø �‰OˆAØ—)’) U�)Ñ+Ô+ˆCØ—}’} SÑ)Ô)ˆHØð Ø�Øð Ø"ðØØ�;˜sÑ#Ô#ðØØ$ˆJØ ˜3Ñ ˆKØ�7Š{ˆ{ˆ{Ø@AÀÀÀ7À7À7ÐK�Ý)¨#Ñ.Ô.Ð.õ �IŠIÐ7Ñ 8Ô 8Ð 8ð) 9ð*ˆ ˆ ˆsðˆ r )T)r'TN)r r r rrr7r r rrr!sK€€€€€ð+ð+ð+ððððð'ð'ð'ð'ð'ð'r r)Úloggingr.ÚPILrrÚ PIL.ImageGrabrÚpyvirtualdisplayrÚ getLoggerr r+Ú Exceptionrrrr r rúr>sÒðØ€€€Ø € € € à!Ð!Ð!Ð!Ð!Ð!Ð!Ð!ØÐÐÐÐÐà$Ð$Ð$Ð$Ð$Ð$à€gÔ˜Ñ!Ô!€ð ð ð ð ð ˜)ñ ô ð ðððð"8ð8ð8ð8ð8�7ñ8ô8ð8ð8ð8r