o
    OZŽh  ã                   @   s¬   d Z dZddlZddlZdejd< ddlZej ¡  ej 	d¡Z
dd„ Zd	d
„ ZedkrTdejv rNejdd… \ZZZZeeeegƒ\ZZeeeeeƒ dS eeƒ dS dS )a%   pygame.examples.headless_no_windows_needed

How to use pygame with no windowing system, like on headless servers.

Thumbnail generation with scaling is an example of what you can do with pygame.
NOTE: the pygame scale function uses mmx/sse if available, and can be run
  in multiple threads.
zU-scale inputimage outputimage new_width new_height
eg.  -scale in.png out.png 50 50

é    NÚdummyZSDL_VIDEODRIVER)é   r   c                 C   sP   t j | ¡}tt jdƒrt j |||f¡}n	t j |||f¡}t j ||¡ d S )NÚsmoothscale)ÚpgÚimageÚloadÚhasattrZ	transformr   ÚscaleÚsave)ÚfinÚfoutÚwÚhÚiZscaled_image© r   úY/var/www/auris/lib/python3.10/site-packages/pygame/examples/headless_no_windows_needed.pyÚscaleit   s
   r   c                 C   s   t | |||ƒ dS )z<smoothscale image file named fin as fout with new size (w,h)N)r   )r   r   r   r   r   r   r   Úmain'   s   r   Ú__main__z-scaleé   )Ú__doc__ÚusageÚosÚsysÚenvironZpygamer   ÚdisplayÚinitÚset_modeÚscreenr   r   Ú__name__Úargvr   r   r   r   ÚmapÚintÚprintr   r   r   r   Ú<module>   s"   



ú