+
    Cåûj  ã                   ó¤  € R t ^ RIt^ RIt^ RIHt ^ RIHtHtHt ^ RIHt ^ RI	H
t
Ht ^ RIt]P                  ! R4      t^ RIHt Rt]P"                  '       d    ^ RIHt ^ R	IHt ^ R
IHtHtHt ]fD   R t ! R R]P8                  4      t ! R R]P8                  4      t ! R R]P:                  4      tM]! ^ 4      t]P<                  '       g   RR ltMRR lt]P@                  '       g   ]t!M]'       d   ]t!MR t!]P<                  '       g   R t"MR t" ! R R]#4      t$RR lt%R t&R#   ] d   t]P5                  R4        RtALÚRtAii ; i)zŸHelper functions for wrapping array-using operations

These are functions intended to be used in wrapping
GL functions that deal with OpenGL array data-types.
N)Ú_configflags)ÚcontextdataÚerrorÚ
converters)Úarraydatatype)ÚbytesÚunicodezOpenGL.arrays.arrayhelpers)Úacceleratesupport)ÚAsArrayTypedSizeChecked)ÚreturnPyArgumentIndex)ÚAsArrayOfTypeÚAsArrayTypedÚAsArrayTypedSizez>Unable to load arrayhelpers accelerator from OpenGL_acceleratec                ó   € V^ ,          # )zgReturn the converted object as result of function

Note: this is a hack that always returns pyArgs[0]!
© )ÚresultÚbaseOperationÚpyArgsÚcArgss   &&&&ÚVC:\Ai_Coding\apps\studio\ComfyUI\.venv\Lib\site-packages\OpenGL\arrays\arrayhelpers.pyÚreturnPointerr       s   € ð �a�yÐó    c                   ó<   a € ] tR t^,t o RtRtRtRR ltR tRt	V t
R# )r   zÆGiven arrayName and typeName coerce arrayName to array of type typeName

TODO: It should be possible to drop this if ERROR_ON_COPY,
as array inputs always have to be the final objects in that
case.
c                ó   € Wn         W n        R # ©N©Ú	arrayNameÚtypeName)Úselfr   r   s   &&&r   Ú__init__ÚAsArrayOfType.__init__:   s   € Ø&ŒNØ$ŽMr   c                óv   € W0P                   ,          p\        P                  V,          pVP                  V4      # ©z/Get the arg as an array of the appropriate type)Ú	typeIndexr   ÚGL_CONSTANT_TO_ARRAY_TYPEÚasArray)r   ÚargÚwrappedOperationÚargsÚtypeÚ	arrayTypes   &&&&  r   Ú__call__ÚAsArrayOfType.__call__>   s/   € àŸ™Õ'ˆDÜ%×?Ñ?ÀÕEˆIØ×$Ñ$ SÓ)Ð)r   r   N)©Ú
arrayIndexr   Ú
pyArgIndex)r#   r   r/   )Úpointerr)   ©Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__ÚargNamesÚindexLookupsr   r+   Ú__static_attributes__Ú__classdictcell__©Ú__classdict__s   @r   r   r   ,   s'   ø‡ € ñ	ð -ˆð
ˆô
	%÷	*ð 	*r   r   c                   ó<   a € ] tR t^Dt o RtRtRtRR ltR tRt	V t
R# )r   zÀGiven arrayName and arrayType, convert arrayName to array of type

TODO: It should be possible to drop this if ERROR_ON_COPY,
as array inputs always have to be the final objects in that
case.
Nc                ó   € Wn         W n        R # r   ©r   r*   ©r   r   r*   s   &&&r   r   ÚAsArrayTyped.__init__O   ó   € Ø&ŒNØ&ŽNr   c                ó8   € V P                   P                  V4      # r"   )r*   r%   )r   r&   r'   r(   s   &&&&r   r+   ÚAsArrayTyped.__call__S   s   € à—>‘>×)Ñ)¨#Ó.Ð.r   r?   ©r-   ©r0   Nr1   r;   s   @r   r   r   D   s%   ø‡ € ñ	ð .ˆØCˆô	'÷	/ð 	/r   r   c                   ó<   a € ] tR t^Wt o RtRtRtRR ltR tRt	V t
R# )r   z:Given arrayName and arrayType, determine size of arrayNameNc                ó   € Wn         W n        R # r   r?   r@   s   &&&r   r   ÚAsArrayTypedSize.__init__]   rB   r   c                óX   € V P                   P                  WP                  ,          4      # r"   )r*   Ú	arraySizer.   )r   r   Úindexr'   s   &&&&r   r+   ÚAsArrayTypedSize.__call__a   s   € à—>‘>×+Ñ+¨F·?±?Õ,CÓDÐDr   r?   rE   rF   r1   r;   s   @r   r   r   W   s#   ø‡ € ÙHà-ˆØCˆô	'÷	Eð 	Er   r   c                óB   € \         P                  ! V P                  4      # )z9Create PyConverter to get first argument as array of type)r   ÚCallFuncPyConverterr%   ©ÚtypÚsizes   &&r   ÚasArrayTyperS   j   s   € ä×-Ò-¨c¯k©kÓ:Ð:r   c                ó   € R# )zNo converter requiredNr   rP   s   &&r   rS   rS   p   ó   € ár   c                ó‚   a aa€ S P                   o\        P                  ! S P                  4      V,          oVVV 3R lpV# )zuCreate PyConverter function to get array as type and check size

Produces a raw function, not a PyConverter instance
c                 ó¨   <€ SP                  V 4      pVP                  V S4      pVP                  V4      pVS8w  d   \        R S: RV: R2V 4      hV# )z	Expected z byte array, got z byte array)Ú
getHandlerr%   ÚarrayByteCountÚ
ValueError)	ÚincomingÚfunctionr(   Úhandlerr   ÚbyteSizeÚdataTypeÚexpectedBytesrQ   s	   &&&   €€€r   ÚasArraySizeÚ$asArrayTypeSize.<locals>.asArraySize†   s_   ø€ ØŸ.™.¨Ó2�Ø Ÿ™¨°8Ó<�à"×1Ñ1°&Ó9�Ø˜}Ô,Ý$ó *Û$ðð
 !óð ð �r   )ÚtypeConstantÚctypesÚsizeofÚbaseType)rQ   rR   ra   r_   r`   s   f& @@r   ÚasArrayTypeSizerg   |   s4   ú€ ð ×'Ñ'ˆHä"ŸMšM¨#¯,©,Ó7¸$Õ>ˆM÷ð  Ðr   c                 óN   € ^ RI Hp  \        P                  ! V P                  4      # )z=Create PyConverter returning incoming as an array of any type©ÚArrayDatatype)ÚOpenGL.arraysrj   r   rO   r%   ri   s    r   ÚasVoidArrayrl   ›   s   € å/ä×-Ò-¨m×.CÑ.CÓDÐDr   c                 ó   € R# )z9If there's no copying allowed, we can use default passingNr   r   r   r   rl   rl   £   rU   r   c                   ó6   a € ] tR t^¨t o RtR tR tR tRtV t	R# )ÚstorePointerTypeaJ  Store named pointer value in context indexed by constant

pointerName -- named pointer argument
constant -- constant used to index in the context storage

Note: OpenGL.STORE_POINTERS can be set with ERROR_ON_COPY
to ignore this storage operation.

Stores the pyArgs (i.e. result of pyConverters) for the named
pointer argument...
c                ó   € Wn         W n        R # r   )ÚpointerNameÚconstant)r   rq   rr   s   &&&r   r   ÚstorePointerType.__init__µ   s   € Ø&ÔØ Žr   c                óF   € VP                  V P                  4      V n        R # r   )r/   rq   ÚpointerIndex)r   Úwrappers   &&r   ÚfinaliseÚstorePointerType.finalise¹   s   € Ø#×.Ñ.¨t×/?Ñ/?Ó@ˆÖr   c                óh   € \         P                  ! V P                  W0P                  ,          4       R # r   )r   ÚsetValuerr   ru   )r   r   r   r   r   s   &&&&&r   r+   ÚstorePointerType.__call__¼   s   € Ü×Ò˜TŸ]™]¨F×3DÑ3DÕ,EÖFr   )rr   ru   rq   N)
r2   r3   r4   r5   r6   r   rw   r+   r9   r:   r;   s   @r   ro   ro   ¨   s!   ø‡ € ñ
ò!òA÷Gð Gr   ro   c                óN   € ^ RI Hp VP                  V 4      P                  W14      # )a’  Decorate function with vector-handling code for a single argument

if OpenGL.ERROR_ON_COPY is False, then we return the
named argument, converting to the passed array type,
optionally checking that the array matches size.

if OpenGL.ERROR_ON_COPY is True, then we will dramatically
simplify this function, only wrapping if size is True, i.e.
only wrapping if we intend to do a size check on the array.
)rv   )ÚOpenGLrv   ÚsetInputArraySize)r   rR   r)   ÚargNamerv   s   &&&& r   ÚsetInputArraySizeTyper€   À   s!   € õ à�?‰?˜=Ó)×;Ñ;¸GÓJÐJr   c                 ó0   aa€ V P                   oVV3R  lpV# )c                ó2   <€ V ^ ,          pVf   S# S! V4      # )z+Return the array size of the first argumentr   )r   rL   r   ÚarrayÚdefaultÚunitSizes   &&& €€r   ÚarraySizeOfFirstÚ.arraySizeOfFirstType.<locals>.arraySizeOfFirstÓ   s    ø€ à�q•	ˆØŠ=ØˆNá˜E“?Ð"r   )r…   )rQ   r„   r†   r…   s   &f @r   ÚarraySizeOfFirstTyperˆ   Ð   s   ù€ Ø�|‰|€Hö#ð Ðr   r   )é    )'r6   r}   rd   r   r   r   r   rk   r   ÚOpenGL._bytesr   r   ÚloggingÚ	getLoggerÚ_logr	   r
   ÚACCELERATE_AVAILABLEÚOpenGL_accelerate.arraydatatypeÚOpenGL_accelerate.wrapperr   r   r   r   ÚImportErrorÚerrÚwarningr   ÚPyConverterÚ
CConverterÚERROR_ON_COPYrS   ÚARRAY_SIZE_CHECKINGrg   rl   Úobjectro   r€   rˆ   r   r   r   Ú<module>r™      s>  ðñó Û Ý ß 1Ñ 1Ý 'ß (Û à×ÒÐ5Ó6€Ý $àÐ Ø×)×)Ð)ð	WÝKÝC÷	
ñ 	
ð Ò"ò
ô*˜
×.Ñ.ô *ô0/�z×-Ñ-ô /ô&E˜:×0Ñ0õ Eñ *¨!Ó,€Mà×!×!Ð!õ;ôð
 ×'×'Ð'Ø!�OçØ1‰ò	ð: ×!×!Ð!óEòô
G�vô Gô0Kô øði ô WØ�‰ÐU×VÑVûðWús   ÁD- Ä-EÄ4E
Å
E