Ë
    Aôjg  ã                   ó  — d dl Z d dlmZ d dlmZ d dlmZ  e j                  e	 e	«       «      Z
e j                  e j                   G d„ de«      «       «       Ze j                  e j                   G d„ d«      «       «       Zy)	é    N)Úlibav)ÚSideData)Ú	uintptr_tc                   óh   — e Zd Zdedej
                  fd„Zd„ Zd„ Zdej                  fd„Z
d„ Zd„ Zy	)
ÚMotionVectorsÚframeÚindexc                 ó²   — t        j                  | |||«       | j                  j                  t	        j
                  t        j                  «      z  | _        y ©N)	r   Ú__init__ÚptrÚsizeÚcythonÚsizeofÚlibÚAVMotionVectorÚ_len)ÚselfÚsentinelr   r	   s       új/var/www/html/academy/tools/voices/clone/fw-venv/lib/python3.12/site-packages/av/sidedata/motionvectors.pyr   zMotionVectors.__init__   s9   € Ü×Ñ˜$ ¨%°Ô7Ø—H‘H—M‘M¤V§]¡]´3×3EÑ3EÓ%FÑFˆ�	ó    c           	      ó®   — d| j                   j                  › dt        | «      › dt        j                  t
        | j                   j                  «      d›d�S )Nz<av.sidedata.MotionVectors z
 bytes of z vectors at 0xÚ0xú>)r   r   Úlenr   Úcastr   Údata©r   s    r   Ú__repr__zMotionVectors.__repr__   sJ   € à)¨$¯(©(¯-©-¨ð 9Ü�d“)�˜N¬6¯;©;´yÀ$Ç(Á(Ç-Á-Ó+PÐQSÐ*TÐTUðWð	
r   c                 ó   — | j                   S r   )r   r   s    r   Ú__len__zMotionVectors.__len__   s   € Ø�y‰yÐr   c                 óŠ   — |dk  r|| j                   z  }|dk  s|| j                   k\  rt        |«      ‚t        t        | |«      S )Nr   )r   Ú
IndexErrorÚMotionVectorÚ_cinit_bypass_sentinel)r   r	   s     r   Ú__getitem__zMotionVectors.__getitem__   sD   € Ø�1Š9Ø�T—Y‘YÑˆEØ�1Š9˜ §¡Ò*Ü˜UÓ#Ð#äÔ2°D¸%Ó@Ð@r   c              #   óN   K  — t        | j                  «      D ]	  }| |   –— Œ y­w)z Iterate over all motion vectors.N)Úranger   )r   Úis     r   Ú__iter__zMotionVectors.__iter__!   s'   è ø€ ä�t—y‘yÓ!ò 	ˆAØ�q‘'‹Mñ	ùs   ‚#%c                 óV   — ddl }|j                  | |j                  g d¢d¬«      ¬«      S )zŸ
        Convert motion vectors to a NumPy structured array.

        Returns a NumPy array with fields corresponding to the AVMotionVector structure.
        r   N))ÚsourceÚint32)ÚwÚuint8)Úhr/   )Úsrc_xÚint16)Úsrc_yr2   )Údst_xr2   )Údst_yr2   )ÚflagsÚuint64)Úmotion_xr-   )Úmotion_yr-   )Úmotion_scaleÚuint16T)Úalign)Údtype)ÚnumpyÚ
frombufferr=   )r   Únps     r   Ú
to_ndarrayzMotionVectors.to_ndarray&   s;   € ó 	à�}‰}ØØ—(‘(òð ð ó ð ó 
ð 	
r   N)Ú__name__Ú
__module__Ú__qualname__ÚFramer   Úintr   r   r!   Ú
Py_ssize_tr&   r*   rA   © r   r   r   r   	   sD   „ ðG¨ð G°f·j±jó Gò
òðA ×!2Ñ!2ó Aòó

r   r   c                   óÚ   — e Zd ZdZdedej                  fd„Zd„ Ze	d„ «       Z
e	d„ «       Ze	d„ «       Ze	d	„ «       Ze	d
„ «       Ze	d„ «       Ze	d„ «       Ze	d„ «       Ze	d„ «       Ze	d„ «       Zy)r$   z�
    Represents a single motion vector from video frame data.

    Motion vectors describe the motion of a block of pixels between frames.
    Úparentr	   c                 óÞ   — |t         urt        d«      ‚|| _        t        j                  t        j
                  t        j                     |j                  j                  «      }||z   | _        y )Nz(cannot manually instantiate MotionVector)
r%   ÚRuntimeErrorrJ   r   r   Úpointerr   r   r   r   )r   r   rJ   r	   Úbases        r   r   zMotionVector.__init__L   sU   € ØÔ1Ñ1ÜÐIÓJÐJØˆŒÜ39·;±;Ü�N‰Nœ3×-Ñ-Ñ.°·
±
·±ó4
ˆð ˜%‘<ˆ�r   c                 ó¤   — d| j                   › d| j                  › d| j                  › d| j                  › d| j                  › d| j
                  › d�S )Nz<av.sidedata.MotionVector Úxz from (ú,z) to (z)>)r.   r0   r1   r3   r4   r5   r   s    r   r   zMotionVector.__repr__U   sP   € à(¨¯©¨°°$·&±&°ð :Ø—Z‘Z�L  $§*¡* ¨V°D·J±J°<¸qÀÇÁÀÈBðPð	
r   c                 ó.   — | j                   j                  S r   )r   r,   r   s    r   r,   zMotionVector.source[   s   € à�x‰x�‰Ðr   c                 ó.   — | j                   j                  S r   )r   r.   r   s    r   r.   zMotionVector.w_   ó   € à�x‰x�z‰zÐr   c                 ó.   — | j                   j                  S r   )r   r0   r   s    r   r0   zMotionVector.hc   rT   r   c                 ó.   — | j                   j                  S r   )r   r1   r   s    r   r1   zMotionVector.src_xg   ó   € à�x‰x�~‰~Ðr   c                 ó.   — | j                   j                  S r   )r   r3   r   s    r   r3   zMotionVector.src_yk   rW   r   c                 ó.   — | j                   j                  S r   )r   r4   r   s    r   r4   zMotionVector.dst_xo   rW   r   c                 ó.   — | j                   j                  S r   )r   r5   r   s    r   r5   zMotionVector.dst_ys   rW   r   c                 ó.   — | j                   j                  S r   )r   r8   r   s    r   r8   zMotionVector.motion_xw   ó   € à�x‰x× Ñ Ð r   c                 ó.   — | j                   j                  S r   )r   r9   r   s    r   r9   zMotionVector.motion_y{   r\   r   c                 ó.   — | j                   j                  S r   )r   r:   r   s    r   r:   zMotionVector.motion_scale   s   € à�x‰x×$Ñ$Ð$r   N)rB   rC   rD   Ú__doc__r   r   rF   r   r   Úpropertyr,   r.   r0   r1   r3   r4   r5   r8   r9   r:   rH   r   r   r$   r$   C   së   „ ñð ¨ð  ¸v¿z¹zó  ò
ð ñó ðð ñó ðð ñó ðð ñó ðð ñó ðð ñó ðð ñó ðð ñ!ó ð!ð ñ!ó ð!ð ñ%ó ñ%r   r$   )r   Úcython.cimportsr   r   Ú$cython.cimports.av.sidedata.sidedatar   Úcython.cimports.libc.stdintr   ÚdeclareÚobjectr%   ÚfinalÚcclassr   r$   rH   r   r   ú<module>rh      s{   ðÛ Ý (Ý 9Ý 1à'˜Ÿ™¨±³Ó9Ð ð ‡�Ø‡�ô5
�Hó 5
ó ó ð5
ðp ‡�Ø‡�÷<%ð <%ó ó ñ<%r   