Hacked By AnonymousFox
�
�܋fg
� � � d dl Z d dlZd dlmZmZ d dlmZ d dlmZ e j e
� � Z G d� de� � Z
d� Z G d� d e� � ZdS )
� N)�Image�
ImageChops)�grab)�Displayc � � e Zd ZdS )�DisplayTimeoutErrorN)�__name__�
__module__�__qualname__� � �n/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/pyvirtualdisplay/smartdisplay.pyr r s � � � � � ��Dr
r c � � | j dk r| � d� � } t j d| j |� � }t j | |� � }|� � � }|r| � |� � S dS )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 �autocropr ss � �
�w�%���
�Z�Z��
�
�� ��5�"�'�7� +� +�B�� ��R�(�(�D��<�<�>�>�D�� ��w�w�t�}�}���4r
c �$ � e Zd Zd� 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)�selfr s r r zSmartDisplay.autocrop"