
    &h}                        S r SSKrSSKr\R                  R                  \R                  R                  \5      5      S   r\R                  R                  \S5      r
S rS r\S:X  a  \" 5         \R                  " 5         gg)a!  pygame.examples.pixelarray

PixelArray does array processing of pixels.
Sort of like another array processor called 'numpy' - But for pixels.

    Flip it,
            stripe it,
                      rotate it.

Controls
--------

To see different effects - press a key or click a mouse.
    Ndatac                    [         R                  R                  5       nUR                  S5        UR	                  U S5        [         R                  R                  5          [         R                  R                  5       nUR                  [         R                  :X  a  [         R                  " 5         [        eUR                  [         R                  [         R                  4;   a  g M  )N   r   r   )r   r   )pgdisplayget_surfacefillblitflipeventwaittypeQUITquit
SystemExitMOUSEBUTTONDOWNKEYDOWN)imagescreenr   s      R/var/www/auris/envauris/lib/python3.13/site-packages/pygame/examples/pixelarray.pyshowr      s    ZZ##%F
KK 
KKvJJOO
:: GGI::",,bjj99     c                  	   [         R                  " 5         [         R                  R                  S5        [         R                  " S5      n [         R                  R                  5         [         R                  " U 5      n[        S5       H  nX"UpTnX4U4US S 2U4'   M     A[        U 5        [         R                  " U 5      nUS S 2S S S24   US S & A[        U 5        [         R                  " U 5      nSUS S S2'   A[        U 5        [         R                  " U 5      nSUS S 2S S S24'   A[        U 5        [         R                  R                  [        R                  R                  [        S5      5      n [         R                  " U 5      nUS S 2S S S24   US S & A[        U 5        [         R                  " U 5      nUS S S2S S 24   US S & A[        U 5        [         R                  " U 5      nSUS S S2'   A[        U 5        [         R                  " U 5      nUS S S2S S S24   US S & A[        U 5        U R                  5       u  pg[         R                  " Xv4U R!                  5       U 5      n[         R                  " U 5      n[         R                  " U5      n	UR#                  5       S S S2S S 24   U	S	'   AA	[        U5        [         R                  R                  [        R                  R                  [        S5      5      n [         R                  " U 5      nUS S S2S S S24   R%                  5       n
A[        U
5        [         R                  " U 5      nUR'                  S
SS5        A[        U 5        [         R                  R                  [        R                  R                  [        S5      5      n [         R                  " U 5      nUR)                  SS5      n	U	R*                  n
AA	[        U
5        [         R                  R                  [        R                  R                  [        S5      5      n [         R                  R                  [        R                  R                  [        S5      5      n[         R                  " U 5      n[         R                  " U5      n	UR-                  U	S5      nUR*                  nAA	A[        U5        g )N)r   r   r   )r   r   r      )r   r   r   zarraydemo.bmpr   .)<   r   r   gQ?)r   r   r   gQ?z
alien1.gifz
alien2.gif)r   initr   set_modeSurfacer   
PixelArrayranger   r   loadospathjoindata_dirget_size	get_flags	transposemake_surfacereplaceextractsurfacecompare)r.   aryrgbwhsurface2ar2sf2ar1ar3sf3s                 r   mainr=   &   s   GGIJJ
#jj$GJJOO 
w	B 3Za!91a4  	M 
w	Bq$B$wKBqE
M 
w	BBssG
M 
w	BBq#A#vJ
M hhmmBGGLL?CDG	w	Bq$B$wKBqE
M 
w	BttQwKBqE
M 
w	BBssG
M 
w	BttTrTzNBqE
M DAzz1&'"3"3"5w?H	w	B
--
!C||~ddAg&CH
CN hhmmBGGLL?CDG	w	B
SqS#A#X,
#
#
%C
I 
w	BJJ}k40
M hhmmBGGLL?CDG	w	B
**Y
%C
++C
CI hhmmBGGLL<@AGxx}}RWW\\(LABH
--
 C
--
!C
++c4
 C
++CS#Ir   __main__)__doc__r$   pygamer   r%   splitabspath__file__main_dirr&   r'   r   r=   __name__r    r   r   <module>rG      su    
  77==23A677<<&)cL zFGGI r   