
    &hK                         S r SSKrS rS rS r " S S5      r\S:X  aK  SSKr\\R                  l        \\R                  l        \R                  R                  R                  5         gg)	zpygame.camera.Camera implementation using the videocapture module for windows.

http://videocapture.sourceforge.net/

Binary windows wheels:
  https://www.lfd.uci.edu/~gohlke/pythonlibs/#videocapture
    Nc                      S/$ )zSAlways only lists one camera.

Functionality not supported in videocapture module.
r    r       Q/var/www/auris/envauris/lib/python3.13/site-packages/pygame/_camera_vidcapture.pylist_camerasr      s    
 3Jr   c                  B     SS K n U q g ! [         a    SSKJ n    U q g f = f)Nr   vidcap)r
   ImportErrorVideoCapture)vcs    r   initr      s*    . F  .-F.s   	 c                      S q g Nr	   r   r   r   quitr   '   s    Fr   c                   \    \ rS rSrSS jrS rS rS rS rS r	S r
S	 rSS jrSS jrSrg
)Camera,   c                 v    [         R                  X5      U l        Uu  pVU R                  R                  XV5        g)a  device:  VideoCapture enumerates the available video capture devices
         on your system.  If you have more than one device, specify
         the desired one here.  The device number starts from 0.

show_video_window: 0 ... do not display a video window (the default)
                   1 ... display a video window

                 Mainly used for debugging, since the video window
                 can not be closed or moved around.
N)r
   new_Devdevsetresolution)selfdevicesizemodeshow_video_windowwidthheights          r   __init__Camera.__init__.   s-     >>&<u-r   c                 8    U R                   R                  5         g)zDisplays a dialog containing the property page of the capture filter.

For VfW drivers you may find the option to select the resolution most
likely here.
N)r   displaycapturefilterpropertiesr   s    r   !display_capture_filter_properties(Camera.display_capture_filter_properties=   s     	//1r   c                 8    U R                   R                  5         g)zDisplays a dialog containing the property page of the capture pin.

For WDM drivers you may find the option to select the resolution most
likely here.
N)r   displaycapturepinpropertiesr$   s    r   display_capture_pin_properties%Camera.display_capture_pin_propertiesE   s     	,,.r   c                 :    U R                   R                  X5        g)z-Sets the capture resolution. (without dialog)N)r   r   )r   r   r   s      r   set_resolutionCamera.set_resolutionM   s    u-r   c                 6    U R                   R                  5       $ )z/Returns a string containing the raw pixel data.)r   	getbufferr$   s    r   
get_bufferCamera.get_bufferQ   s    xx!!##r   c                     gzNot implemented.Nr   r$   s    r   startCamera.startU       r   c                     gr3   r   )r   kwargss     r   set_controlsCamera.set_controlsX   r6   r   c                     gr3   r   r$   s    r   stopCamera.stop[   r6   r   Nc                 $    U R                  U5      $ ) )get_surface)r   	dest_surfs     r   	get_imageCamera.get_image^   s    	**r   c                     U R                  5       u  p#nU(       d  g[        R                  R                  X#U4S5      n[        R                  R                  USS5      nU(       a  UR                  US5        U$ UnU$ )zReturns a pygame Surface.NBGRr      )r   r   )r0   pygameimage
frombuffer	transformflipblit)r   rA   abufferr   r   surfs         r   r@   Camera.get_surfaceb   ss    !%!2||&&wG$$T1a0NN4(  Ir   )r   )r   )i  i  RGBr   r   )__name__
__module____qualname____firstlineno__r    r%   r)   r,   r0   r4   r9   r<   rB   r@   __static_attributes__r   r   r   r   r   ,   s4    .2/.$+r   r   __main__)__doc__rG   r   r   r   r   rQ   pygame.examples.cameracameraexamplesmainr   r   r   <module>r\      sk    $
B BJ z!!FMM!-FMM
OO! r   