Ë
    ÛÍ:jå  ã                   ó  — 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                  | |||«       i | _        | j                  j                  t        j                  t        j                  «      z  | _	        y ©N)
r   Ú__init__Ú_vectorsÚptrÚsizeÚcythonÚsizeofÚlibÚAVMotionVectorÚ_len)ÚselfÚsentinelr   r	   s       ún/home/mcse/projects/srt_converter/srt-converter-venv/lib/python3.12/site-packages/av/sidedata/motionvectors.pyr   zMotionVectors.__init__   s@   € Ü×Ñ˜$ ¨%°Ô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                 ó¸   — 	 | j                   |   S # t        $ r Y nw xY w|| j                  k\  rt        |«      ‚t	        t
        | |«      x}| j                   |<   |S r   )r   ÚKeyErrorr   Ú
IndexErrorÚMotionVectorÚ_cinit_bypass_sentinel)r   r	   Úvectors      r   Ú__getitem__zMotionVectors.__getitem__   si   € ð	Ø—=‘= Ñ'Ð'øÜò 	Ùð	úð �D—I‘IÒÜ˜UÓ#Ð#ä(4Ü" D¨%ó)
ð 	
ˆ�—‘˜uÑ%ð ˆs   ‚ ‘	œ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)Úhr2   )Úsrc_xÚint16)Úsrc_yr5   )Údst_xr5   )Údst_yr5   )ÚflagsÚuint64)Úmotion_xr0   )Úmotion_yr0   )Ú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-   rD   © r   r   r   r   	   sB   „ ðG¨ð G°f·j±jó Gò

òð ×!2Ñ!2ó òó

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'   ÚRuntimeErrorrM   r   r   Úpointerr   r   r   r   )r   r   rM   r	   Úbases        r   r   zMotionVector.__init__S   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)>)r1   r3   r4   r6   r7   r8   r   s    r   r    zMotionVector.__repr__\   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.sourceb   s   € à�x‰x�‰Ðr   c                 ó.   — | j                   j                  S r   )r   r1   r   s    r   r1   zMotionVector.wf   ó   € à�x‰x�z‰zÐr   c                 ó.   — | j                   j                  S r   )r   r3   r   s    r   r3   zMotionVector.hj   rW   r   c                 ó.   — | j                   j                  S r   )r   r4   r   s    r   r4   zMotionVector.src_xn   ó   € à�x‰x�~‰~Ðr   c                 ó.   — | j                   j                  S r   )r   r6   r   s    r   r6   zMotionVector.src_yr   rZ   r   c                 ó.   — | j                   j                  S r   )r   r7   r   s    r   r7   zMotionVector.dst_xv   rZ   r   c                 ó.   — | j                   j                  S r   )r   r8   r   s    r   r8   zMotionVector.dst_yz   rZ   r   c                 ó.   — | j                   j                  S r   )r   r;   r   s    r   r;   zMotionVector.motion_x~   ó   € à�x‰x× Ñ Ð r   c                 ó.   — | j                   j                  S r   )r   r<   r   s    r   r<   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)rE   rF   rG   Ú__doc__r   r   rI   r   r    Úpropertyr/   r1   r3   r4   r6   r7   r8   r;   r<   r=   rK   r   r   r&   r&   J   së   „ ñð ¨ð  ¸v¿z¹zó  ò
ð ñó ðð ñó ðð ñó ðð ñó ðð ñó ðð ñó ðð ñó ðð ñ!ó ð!ð ñ!ó ð!ð ñ%ó ñ%r   r&   )r   Úcython.cimportsr   r   Ú$cython.cimports.av.sidedata.sidedatar   Úcython.cimports.libc.stdintr   ÚdeclareÚobjectr'   ÚfinalÚcclassr   r&   rK   r   r   ú<module>rk      s{   ðÛ Ý (Ý 9Ý 1à'˜Ÿ™¨±³Ó9Ð ð ‡�Ø‡�ô<
�Hó <
ó ó ð<
ð~ ‡�Ø‡�÷<%ð <%ó ó ñ<%r   