
    3j)                     D   S r SrSSKrSSKJr  \R
                  " \5      r SSKrSSKr\(       d   eSSKrSSKJr  SSKJr  SSKJr  SS	KJr  SS
KJr  \R*                  rSSKJr  Sr\R0                  (       a   SSKJr  \cI  \R6                  " / SQS5      r\" \S5      (       a  S rOS r C\ " \5      r " S S\RB                  5      r \R6                  " S/S5        Sr"S r%\%" S5      \RL                  \%" S5      \RN                  \%" S5      \RP                  \%" S5      \RR                  \%" \"5      \RT                  \%" \$5      \RV                  \%" S5      \RX                  \%" S5      \RX                  \%" S5      \RZ                  \%" S 5      \R\                  SS0r/0 \RL                  \%" S5      _\RN                  \%" S5      _\RP                  \%" S5      _\RR                  \%" S5      _\RZ                  \%" S5      _\RT                  \%" \"5      _\R\                  \%" S 5      _\RX                  \%" S5      _\RV                  \%" \$5      _\R`                  \%" S!5      _SS_S\%" S5      _S\%" S5      _S\%" S5      _S\%" S5      _S \%" S 5      _S\%" S5      _\%" S5      \%" S5      \%" S5      \%" S5      S".Er1g! \	 a  r
\	" S\
-  5      eSr
C
ff = f! \	 a  r
\R5                  S5         Sr
C
GNmSr
C
ff = f! \ a  r
 Sr
C
GNRSr
C
ff = f! \# a  r
Sr"Sr$ Sr
C
GN6Sr
C
ff = f)#zNumpy (new version) module implementation of the OpenGL-ctypes array interfaces

XXX Need to register handlers for all of the scalar types that numpy returns,
would like to have all return values be int/float if they are of  compatible
type as well.
numpy    N)_configflagszNo numpy module present: %s)long)_types)GL_1_1error)formathandler)acceleratesupport)NumpyHandlerzEUnable to load numpy_formathandler accelerator from OpenGL_accelerate)            i__array_interface__c                 
    [        UR                  S   S   5      $ ! [         a[    U R                  U5      n [        UR                  S   S   5      s $ ! [         a    [        UR                  S   S5      s s $ f = ff = f)8Convert given instance to a data-pointer value (integer)datar   )r   r   AttributeErrorasArray__array_data__clsinstances     S/home/wildlama/miniconda3/lib/python3.13/site-packages/OpenGL/arrays/numpymodule.pydataPointerr   (   s    >H88@CDD! >;;2> < <V DQ GHH% > 7 7 :1==>	>s,    BAB#A>9B=A>>Bc                     [        UR                  S   S5      $ ! [         a[    U R                  U5      n [        UR                  S   S   5      s $ ! [         a    [        UR                  S   S5      s s $ f = ff = f)r   r   r   )r   r   r   r   r   r   s     r   r   r   3   s    >H33A6q99! >;;2> < <V DQ GHH% > 7 7 :1==>	>s,    B AB #A<7B ;A<<B c                   p   \ rS rSrSr\R                  \R                  \R                  \R                  \R                  \R                  \R                  \R                  \R                  \R                  \R                   \R"                  \R                   \R"                  \R$                  \R&                  \R(                  \R*                  \R,                  \R.                  \R0                  \R2                  \R4                  \R6                  4r\" \S5      (       a  \\R<                  4-  r\" \S5      (       a  \\R>                  4-  r\ r Sr!\"RF                  r#\$S 5       r%\$S 5       r&\$SS	 j5       r'\$SS
 j5       r(\$SS j5       r)\$SS j5       r*\$SS j5       r+\$SS j5       r,\$SS j5       r-Sr.g)r   D   zNumpy-specific data-type handler for OpenGL

Attributes:

    ERROR_ON_COPY -- if True, will raise errors
        if we have to copy an array object in order to produce
        a contiguous array of the correct type.
float128
complex256Tc                 h    [         R                  " USS9n[         R                  " U[        U   5      $ )z)Return Numpy array of zeros in given sizer   dtype)r   arrayzerosGL_TYPE_TO_ARRAY_MAPPING)r   dimstypeCodes      r   r'   NumpyHandler.zerosn   s+     ;;C0D;;&>x&HII    c           	          UR                   n[        R                  U5      nUc2  [        SU< S[	        [        R                  5       5      < SU< 35      eU$ )z=Given a value, guess OpenGL type of the corresponding pointerz%Don't know GL type for array of type z, known types: z
value:)r%   ARRAY_TO_GL_TYPE_MAPPINGget	TypeErrorlistkeys)r   valuer*   constants       r   arrayToGLTypeNumpyHandler.arrayToGLTypes   sR     {{H/33X?H $'?'D'D'F"G 
 Or,   Nc                     UR                   $ )z6Given a data-value, calculate dimensions for the array)sizer   r3   r*   s      r   	arraySizeNumpyHandler.arraySize   s     ::r,   c                      UR                   $ ! [         aQ    U R                  (       a   [        R                  " S[        U5      5      eU R                  X5      nUR                   s $ f = f)zCGiven a data-value, calculate number of bytes required to representz2Non-numpy array passed to numpy arrayByteCount: %s)nbytesr   ERROR_ON_COPYr	   	CopyErrortyper   r9   s      r   arrayByteCountNumpyHandler.arrayByteCount   s^    	$||#! $$$//PU  U6||#$s    AA)(A)c                 .    Uc  U$ U R                  X5      $ )z7Convert given value to an array value of given typeCode)
contiguousr9   s      r   r   NumpyHandler.asArray   s     }~~u88r,   c                 T   [         U   n UR                  R                  nU(       a  Ub  X!R                  R                  :X  a  U$ U(       a?  U R
                  (       a.  SSKJn  UR                  " SUR                  R                  U5      eU R
                  (       a  SSKJn  UR                  " SU5      eUc  UR                  R                  n[        R                  " X5      $ ! [         a8    U(       a  [        R                  " X5      s $ [        R                  " U5      s $ f = f)a  Get contiguous array from source

source -- numpy Python array (or compatible object)
    for use as the data source.  If this is not a contiguous
    array of the given typeCode, a copy will be made,
    otherwise will just be returned unchanged.
typeCode -- optional 1-character typeCode specifier for
    the numpy.array function.

All gl*Pointer calls should use contiguous arrays, as non-
contiguous arrays will be re-copied on every rendering pass.
Although this doesn't raise an error, it does tend to slow
down rendering.
r   r   2Array of type %r passed, required array of type %rzNon-contiguous array passed)r(   flagsrD   r%   charr>   OpenGLr	   r?   r   ascontiguousarrayr   )r   sourcer*   rD   r	   s        r   rD   NumpyHandler.contiguous   s      0;HG#\\44
 8#3xARAR7R!M S%6%6,//P))8  ((0#oo="   '#)<<#4#4 22FFF9 " = 22FFF 22F<<	=s   C% %'D'D'&D'c                      UR                   S   $ )z-Determine unit size of an array (if possible)shaper9   s      r   unitSizeNumpyHandler.unitSize   s     ;;r?"r,   c                     UR                   $ )z<Determine dimensions of the passed array value (if possible)rP   r9   s      r   
dimensionsNumpyHandler.dimensions   s     ;;r,   c                 H    U R                  U5      nU(       aC  UR                  [        U   :w  a,  [        R                  " SUR                  R
                  U5      e[        U5      $ ! [         a/    U R                  X5      nU R                  U5      nU4Ul	        Us $ f = f)NrG   )
r   r%   r(   r	   r?   rI   c_void_pr0   r   _temporary_array_)r   r   r*   pointerr&   pps         r   
from_paramNumpyHandler.from_param   s    +//85 2JH2V V//P ++X   **  X9__e-(-x$		s   A( (6B! B! )N)/__name__
__module____qualname____firstlineno____doc__r   ndarraybool_intcuintcint8uint8int16uint16int32uint32int64uint64float16float32float64	complex64
complex128bytes_str_void
datetime64timedelta64HANDLED_TYPEShasattrr!   r"   r   isOutputr   r>   classmethodr'   r5   r:   rA   r   rD   rR   rU   r\   __static_attributes__r^   r,   r   r   r   D   s   	 MMKKJJKKJJKKKKLLKKLLKKLLKKLLMMMMMMOOLLJJJJ1
4 5$$enn..M5&&e..00M!$22		J 
	J 

	 

	 
	 
	 
	$ 
	$ 
	9 
	9 
.	G 
.	G^ 
	# 
	# 
	 
	 
	+ 
	+r,   r   r   shHc                 @    [         R                  " SU S9R                  $ )N)r   r$   )r   r'   r%   )rI   s    r   lookupDtyper      s    ;;D*000r,   dfeBcbIP)r   r   r   r   )2rc   REGISTRY_NAMEloggingrJ   r   	getLoggerr_   _logr   ImportErrorerrctypesOpenGL._bytesr   OpenGL.raw.GLr   OpenGL.raw.GL.VERSIONr   r	   OpenGL.arraysr
   rX   r   r   ACCELERATE_AVAILABLE%OpenGL_accelerate.numpy_formathandlerwarningr&   	testArrayr{   r   	NameErrorr}   FormatHandler
SHORT_TYPEr0   USHORT_TYPEr   	GL_DOUBLEGL_FLOATGL_HALF_FLOATGL_INTGL_SHORTGL_UNSIGNED_SHORTGL_UNSIGNED_BYTEGL_BYTEGL_UNSIGNED_INTr.   	GL_VOID_Pr(   r^   r,   r   <module>r      s     ($@ v     (  '?? $))
F
 Ys,I y.//		>		> {,K\+33 \+|	KK!cJ
1 f&&foof**fmm
V__f66f--f--fnnf,,$ 
k#&
OOK$ +c* MM;s#	
 NNK$ OO[, K, [- k+6 k#& 	$ S	 S	 S	 S	  S	!" S	#$ 
S		S		S		S	+ [  @
8#>
??@   
S	
 	

D  L  JKsY   J8 ;K /K6 L
 8K>K		KK3K..K36LL
LLL