Ë
    ÛÍ:j  ã            
       óÀ  — d dl Z d dl mZ  e j                  e e«       «      Ze j                  dej                  dedede	dz  fd„«       Z
e j                   e j                  ej                  d¬	«      d
e j                  dej                  fd„«       «       Ze j                  e j                    G d„ d«      «       «       Z	e j                  e j                    G d„ d«      «       «       Z e«       Z e j                  e j(                  e j*                  ej,                        e j.                  «      Z	 ej3                  e«      Zesyej5                  ej6                  «       Œ0)é    N)ÚuintÚc_formatÚwidthÚheightÚreturnc                 ó�   — | t         j                  k(  ry t        j                  t        t        «      }|j                  | ||«       |S ©N)ÚlibÚAV_PIX_FMT_NONEÚVideoFormatÚ__new__Ú_cinit_bypass_sentinelÚ_init)r   r   r   Úformats       úd/home/mcse/projects/srt_converter/srt-converter-venv/lib/python3.12/site-packages/av/video/format.pyÚget_video_formatr      s=   € ð ”3×&Ñ&Ò&Øä%×-Ñ-¬kÔ;QÓR€FØ
‡L�L�˜5 &Ô)Ø€Mó    F)ÚcheckÚnamec                 ór   — t         j                  | «      }|t         j                  k(  rt        d| z  «      ‚|S )z3Wrapper for lib.av_get_pix_fmt with error checking.znot a pixel format: %r)r
   Úav_get_pix_fmtr   Ú
ValueError)r   Úpix_fmts     r   Úget_pix_fmtr      s8   € ô
 "%×!3Ñ!3°DÓ!9€GØ”#×%Ñ%Ò%ÜÐ1°DÑ8Ó9Ð9Ø€Nr   c                   óŠ  — e Zd ZdZdd„Zej                  dej                  de	de	fd„«       Z
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ej0                  ddej2                  fd„«       Zej0                  ddej2                  fd„«       Zy)r   zM

    >>> format = VideoFormat('rgb24')
    >>> format.name
    'rgb24'

    c                 ó  — |t         u ry t        |t        «      rTt        j                  t        |«      }| j                  |j                  |xs |j                  |xs |j                  «       y t        |«      }| j                  |||«       y r	   )
r   Ú
isinstancer   ÚcythonÚcastr   r   r   r   r   )Úselfr   r   r   Úotherr   s         r   Ú	__cinit__zVideoFormat.__cinit__)   sk   € ØÔ)Ñ)Øä�dœKÔ(Ü!'§¡¬[¸$Ó!?ˆEØ�J‰J�u—}‘} eÒ&:¨u¯{©{¸FÒ<RÀeÇlÁlÔSØä%0°Ó%6ˆØ�
‰
�7˜E 6Õ*r   r   r   r   c                 ób   — || _         t        j                  |«      | _        || _        || _        y r	   )r   r
   Úav_pix_fmt_desc_getÚptrr   r   )r    r   r   r   s       r   r   zVideoFormat._init5   s)   € àˆŒÜ×*Ñ*¨7Ó3ˆŒØˆŒ
Øˆ�r   c           	      ó  — | j                   s| j                  rAd| j                  j                  › d| j                  › d| j                   › d| j                  › d�	S d| j                  j                  › d| j                  › d�S )Nz<av.ú z, Úxú>)r   r   Ú	__class__Ú__name__r   ©r    s    r   Ú__repr__zVideoFormat.__repr__<   sl   € Ø�:Š:˜ŸšØ˜$Ÿ.™.×1Ñ1Ð2°!°D·I±I°;¸bÀÇÁÀÈAÈdÏkÉkÈ]ÐZ[Ð\Ð\à˜$Ÿ.™.×1Ñ1Ð2°!°D·I±I°;¸aÐ@Ð@r   c                 ó,   — t        | j                  «      S r	   )Úintr   r,   s    r   Ú__int__zVideoFormat.__int__B   s   € Ü�4—<‘<Ó Ð r   c                 ó^   — t        j                  t        | j                  j                  «      S )z#Canonical name of the pixel format.)r   r   Ústrr%   r   r,   s    r   r   zVideoFormat.nameE   s   € ô �{‰{œ3 §¡§¡Ó.Ð.r   c                 óf   ‡ — t        ˆ fd„t        ‰ j                  j                  «      D «       «      S )Nc              3   ó6   •K  — | ]  }t        ‰|«      –— Œ y ­wr	   )ÚVideoFormatComponent)Ú.0Úir    s     €r   ú	<genexpr>z)VideoFormat.components.<locals>.<genexpr>L   s   øè ø€ ò 
Ø./Ô   q×)ñ
ùs   ƒ)ÚtupleÚranger%   Únb_componentsr,   s   `r   Ú
componentszVideoFormat.componentsJ   s,   ø€ äó 
Ü38¸¿¹×9OÑ9OÓ3Pô
ó 
ð 	
r   c                 ó@   — t         j                  | j                  «      S r	   )r
   Úav_get_bits_per_pixelr%   r,   s    r   Úbits_per_pixelzVideoFormat.bits_per_pixelP   s   € ä×(Ñ(¨¯©Ó2Ð2r   c                 ó@   — t         j                  | j                  «      S r	   )r
   Úav_get_padded_bits_per_pixelr%   r,   s    r   Úpadded_bits_per_pixelz!VideoFormat.padded_bits_per_pixelT   s   € ä×/Ñ/°·±Ó9Ð9r   c                 ób   — t        | j                  j                  t        j                  z  «      S )zPixel format is big-endian.)Úboolr%   Úflagsr
   ÚAV_PIX_FMT_FLAG_BEr,   s    r   Úis_big_endianzVideoFormat.is_big_endianX   s"   € ô �D—H‘H—N‘N¤S×%;Ñ%;Ñ;Ó<Ð<r   c                 ób   — t        | j                  j                  t        j                  z  «      S )zJPixel format has a palette in data[1], values are indexes in this palette.)rD   r%   rE   r
   ÚAV_PIX_FMT_FLAG_PALr,   s    r   Úhas_palettezVideoFormat.has_palette]   ó"   € ô �D—H‘H—N‘N¤S×%<Ñ%<Ñ<Ó=Ð=r   c                 ób   — t        | j                  j                  t        j                  z  «      S )z9All values of a component are bit-wise packed end to end.)rD   r%   rE   r
   ÚAV_PIX_FMT_FLAG_BITSTREAMr,   s    r   Úis_bit_streamzVideoFormat.is_bit_streamb   s"   € ô �D—H‘H—N‘N¤S×%BÑ%BÑBÓCÐCr   c                 ób   — t        | j                  j                  t        j                  z  «      S )z<At least one pixel component is not in the first data plane.)rD   r%   rE   r
   ÚAV_PIX_FMT_FLAG_PLANARr,   s    r   Ú	is_planarzVideoFormat.is_planarg   s"   € ô �D—H‘H—N‘N¤S×%?Ñ%?Ñ?Ó@Ð@r   c                 ób   — t        | j                  j                  t        j                  z  «      S )zFThe pixel format contains RGB-like data (as opposed to YUV/grayscale).)rD   r%   rE   r
   ÚAV_PIX_FMT_FLAG_RGBr,   s    r   Úis_rgbzVideoFormat.is_rgbl   rK   r   c                 ób   — t        | j                  j                  t        j                  z  «      S )z%The pixel format contains Bayer data.)rD   r%   rE   r
   ÚAV_PIX_FMT_FLAG_BAYERr,   s    r   Úis_bayerzVideoFormat.is_bayerq   s"   € ô �D—H‘H—N‘N¤S×%>Ñ%>Ñ>Ó?Ð?r   Ú
luma_widthc                 ó`   — |xs | j                   }|r| | j                  j                  z	   S dS )z´chroma_width(luma_width=0)

        Width of a chroma plane relative to a luma plane.

        :param int luma_width: Width of the luma plane; defaults to ``self.width``.

        r   )r   r%   Úlog2_chroma_w)r    rX   s     r   Úchroma_widthzVideoFormat.chroma_widthv   s3   € ð  Ò- 4§:¡:ˆ
Ù=G�:�+ $§(¡(×"8Ñ"8Ñ8Ð9ÐNÈQÐNr   Úluma_heightc                 ó`   — |xs | j                   }|r| | j                  j                  z	   S dS )zºchroma_height(luma_height=0)

        Height of a chroma plane relative to a luma plane.

        :param int luma_height: Height of the luma plane; defaults to ``self.height``.

        r   )r   r%   Úlog2_chroma_h)r    r\   s     r   Úchroma_heightzVideoFormat.chroma_height‚   s3   € ð "Ò0 T§[¡[ˆÙ>I�;�, 4§8¡8×#9Ñ#9Ñ9Ð:ÐPÈqÐPr   N)r   r   )r   )r+   Ú
__module__Ú__qualname__Ú__doc__r"   r   Úcfuncr
   ÚAVPixelFormatÚcuintr   r-   r0   Úpropertyr   r<   r?   rB   rG   rJ   rN   rQ   rT   rW   Úccallr/   r[   r_   © r   r   r   r      sd  „ ñó
+ð ‡\�\ð˜S×.Ñ.ð °uð Àeò ó ðòAò!ð ñ/ó ð/ð ñ
ó ð
ð
 ñ3ó ð3ð ñ:ó ð:ð ñ=ó ð=ð ñ>ó ð>ð ñDó ðDð ñAó ðAð ñ>ó ð>ð ñ@ó ð@ð ‡\�\ñ	O v§z¡zò 	Oó ð	Oð ‡\�\ñ	Q¨¯©ò 	Qó ñ	Qr   r   c                   ó    — e Zd Zdedej
                  fd„Zed„ «       Zed„ «       Z	ed„ «       Z
ed„ «       Zed„ «       Zed	„ «       Zed
„ «       Zy)r5   r   Úindexc                 ó‚   — || _         || _        t        j                  |j                  j
                  |   «      | _        y r	   )r   rj   r   Úaddressr%   Úcomp)r    r   rj   s      r   r"   zVideoFormatComponent.__cinit__’   s-   € ØˆŒØˆŒ
Ü—>‘> &§*¡*§/¡/°%Ñ"8Ó9ˆ�r   c                 ó.   — | j                   j                  S )z5The index of the plane which contains this component.)r%   Úplaner,   s    r   ro   zVideoFormatComponent.plane—   ó   € ð �x‰x�~‰~Ðr   c                 ó.   — | j                   j                  S )z Number of bits in the component.)r%   Údepthr,   s    r   ÚbitszVideoFormatComponent.bitsœ   rp   r   c                 óÖ   — | j                   dk(  xr# | j                  j                  j                  dk(  xs4 | j                   dk(  xr# | j                  j                  j                  dk(  S )z#Is this component an alpha channel?é   é   é   é   )rj   r   r%   r;   r,   s    r   Úis_alphazVideoFormatComponent.is_alpha¡   sT   € ð —
‘
˜a‘ÒF D§K¡K§O¡O×$AÑ$AÀQÑ$Fò 
Ø�J‰J˜!‰OÒB §¡§¡× =Ñ =ÀÑ Bð	
r   c                 óæ   — | j                   dk(  xra | j                  j                  j                  dk(  xs< | j                  j                  j                  dk(  xs | j                  j                   S )z!Is this component a luma channel?r   ru   rv   )rj   r   r%   r;   rT   r,   s    r   Úis_lumazVideoFormatComponent.is_luma¨   s_   € ð �z‰z˜Q‰ò 
Ø�K‰K�O‰O×)Ñ)¨QÑ.ò &Ø�{‰{�‰×,Ñ,°Ñ1ò&à—;‘;×%Ñ%Ð%ð	
r   c                 óÊ   — | j                   dk(  xs | j                   dk(  xrB | j                  j                  j                  xs  | j                  j                  j                  S )z#Is this component a chroma channel?ru   rv   )rj   r   r%   rZ   r^   r,   s    r   Ú	is_chromazVideoFormatComponent.is_chroma±   sJ   € ð —
‘
˜a‘Ò2 4§:¡:°¡?ò 
Ø�K‰K�O‰O×)Ñ)ÒJ¨T¯[©[¯_©_×-JÑ-Jð	
r   c                 óz   — | j                   r| j                  j                  «       S | j                  j                  S )zqThe width of this component's plane.

        Requires the parent :class:`VideoFormat` to have a width.

        )r}   r   r[   r   r,   s    r   r   zVideoFormatComponent.width¸   s,   € ð .2¯^ª^ˆt�{‰{×'Ñ'Ó)ÐRÀÇÁ×ARÑARÐRr   c                 óz   — | j                   r| j                  j                  «       S | j                  j                  S )zsThe height of this component's plane.

        Requires the parent :class:`VideoFormat` to have a height.

        )r}   r   r_   r   r,   s    r   r   zVideoFormatComponent.heightÁ   s,   € ð /3¯nªnˆt�{‰{×(Ñ(Ó*ÐTÀ$Ç+Á+×BTÑBTÐTr   N)r+   r`   ra   r   r   Úsize_tr"   rf   ro   rs   ry   r{   r}   r   r   rh   r   r   r5   r5   �   s©   „ ð: ð :°F·M±Mó :ð
 ñó ðð ñó ðð ñ
ó ð
ð ñ
ó ð
ð ñ
ó ð
ð ñSó ðSð ñUó ñUr   r5   )r   r   re   ÚdeclareÚobjectr   rc   r
   rd   r   r   Ú	exceptvalr   Úp_const_charr   ÚfinalÚcclassr5   ÚsetÚnamesÚpointerÚconstÚAVPixFmtDescriptorÚNULLÚdescÚav_pix_fmt_desc_nextÚaddr   rh   r   r   ú<module>r�      st  ðÛ Ý  à'˜Ÿ™¨±³Ó9Ð ð ‡�ðØ×ÑðØ(-ðØ7<ðà�4Ñòó ðð ‡�Ø€×Ñ�#×%Ñ%¨UÔ3ð�f×)Ñ)ð ¨c×.?Ñ.?ò ó 4ó ðð ‡�Ø‡�÷lQð lQó ó ðlQð^ ‡�Ø‡�÷7Uð 7Uó ó ð7Uñt 	‹€Ø€v‡~�~�f—n‘n V§\¡\°#×2HÑ2HÑ%IÑJÈFÏKÉKÓX€Ø
Ø×#Ñ# DÓ)€DÙØØ	‡I�Iˆd�i‰iÔð	 r   