Ë
    œ…jÅ  ã                  óä   — d Z ddlmZ ddlmZ ddlmZ ddlmZm	Z	m
Z
 ddlmZ ddlmZ ddlmZ erdd	lmZ dd
lmZ ddlmZ  G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Zy)zAShapes based on the `p:pic` element, including Picture and Movie.é    )Úannotations)ÚTYPE_CHECKING©Ú
LineFormat)Ú	MSO_SHAPEÚMSO_SHAPE_TYPEÚPP_MEDIA_TYPE)Ú	BaseShape)ÚParentedElementProxy)Úlazyproperty)Ú
CT_Picture)ÚCT_LineProperties)ÚProvidesPartc                  ó.  ‡ — e Zd ZdZdˆ fd„Zedd„«       Zej                  dd„«       Zedd„«       Zej                  dd„«       Zedd„«       Z	e	j                  dd„«       Z	edd	„«       Z
e
j                  dd
„«       Z
d„ Zedd„«       Zedd„«       Zˆ xZS )Ú_BasePicturez1Base class for shapes based on a `p:pic` element.c                ó<   •— t         t        | �  ||«       || _        y ©N)Úsuperr   Ú__init__Ú_pic)ÚselfÚpicÚparentÚ	__class__s      €úT/root/aria/tools/markitdown-venv/lib/python3.12/site-packages/pptx/shapes/picture.pyr   z_BasePicture.__init__   s   ø€ ÜŒl˜DÑ*¨3°Ô7Øˆ�	ó    c                ó.   — | j                   j                  S )zÞ|float| representing relative portion cropped from shape bottom.

        Read/write. 1.0 represents 100%. For example, 25% is represented by 0.25. Negative values
        are valid as are values greater than 1.0.
        ©r   Ú	srcRect_b©r   s    r   Úcrop_bottomz_BasePicture.crop_bottom   ó   € ð �y‰y×"Ñ"Ð"r   c                ó&   — || j                   _        y r   r   ©r   Úvalues     r   r!   z_BasePicture.crop_bottom#   ó   € à#ˆ�	‰	Õr   c                ó.   — | j                   j                  S )z¹|float| representing relative portion cropped from left of shape.

        Read/write. 1.0 represents 100%. A negative value extends the side beyond the image
        boundary.
        ©r   Ú	srcRect_lr    s    r   Ú	crop_leftz_BasePicture.crop_left'   r"   r   c                ó&   — || j                   _        y r   r(   r$   s     r   r*   z_BasePicture.crop_left0   r&   r   c                ó.   — | j                   j                  S )zu|float| representing relative portion cropped from right of shape.

        Read/write. 1.0 represents 100%.
        ©r   Ú	srcRect_rr    s    r   Ú
crop_rightz_BasePicture.crop_right4   ó   € ð �y‰y×"Ñ"Ð"r   c                ó&   — || j                   _        y r   r-   r$   s     r   r/   z_BasePicture.crop_right<   r&   r   c                ó.   — | j                   j                  S )zp|float| representing relative portion cropped from shape top.

        Read/write. 1.0 represents 100%.
        ©r   Ú	srcRect_tr    s    r   Úcrop_topz_BasePicture.crop_top@   r0   r   c                ó&   — || j                   _        y r   r3   r$   s     r   r5   z_BasePicture.crop_topH   r&   r   c                ó6   — | j                   j                  «       S )z…Return the `a:ln` element for this `p:pic`-based image.

        The `a:ln` element contains the line format properties XML.
        )r   Úget_or_add_lnr    s    r   r8   z_BasePicture.get_or_add_lnL   s   € ð
 �y‰y×&Ñ&Ó(Ð(r   c                ó   — t        | «      S )zRProvides access to properties of the picture outline, such as its color and width.r   r    s    r   Úlinez_BasePicture.lineS   s   € ô ˜$ÓÐr   c                ó.   — | j                   j                  S )z¨The `a:ln` element for this `p:pic`.

        Contains the line format properties such as line color and width. |None| if no `a:ln`
        element is present.
        )r   Úlnr    s    r   r<   z_BasePicture.lnX   s   € ð �y‰y�|‰|Ðr   )r   r   r   r   )ÚreturnÚfloat)r%   r>   )r=   r   )r=   zCT_LineProperties | None)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Úpropertyr!   Úsetterr*   r/   r5   r8   r   r:   r<   Ú__classcell__)r   s   @r   r   r      sî   ø„ Ù;õð ò#ó ð#ð ×Ñò$ó ð$ð ò#ó ð#ð ×Ñò$ó ð$ð ò#ó ð#ð ×Ñò$ó ð$ð ò#ó ð#ð ‡_�_ò$ó ð$ò)ð ò ó ð ð òó ôr   r   c                  óV   — e Zd ZdZedd„«       Zedd„«       Zed„ «       Zed	d„«       Z	y)
ÚMoviezùA movie shape, one that places a video on a slide.

    Like |Picture|, a movie shape is based on the `p:pic` element. A movie is composed of a video
    and a *poster frame*, the placeholder image that represents the video before it is played.
    c                ó.   — t        | j                  | «      S )z�The |_MediaFormat| object for this movie.

        The |_MediaFormat| object provides access to formatting properties for the movie.
        )Ú_MediaFormatr   r    s    r   Úmedia_formatzMovie.media_formati   s   € ô ˜DŸI™I tÓ,Ð,r   c                ó"   — t         j                  S )z�Member of :ref:`PpMediaType` describing this shape.

        The return value is unconditionally `PP_MEDIA_TYPE.MOVIE` in this case.
        )r	   ÚMOVIEr    s    r   Ú
media_typezMovie.media_typeq   s   € ô ×"Ñ"Ð"r   c                ón   — | j                   | j                  j                  }}|€y|j                  |«      S )zŒReturn |Image| object containing poster frame for this movie.

        Returns |None| if this movie has no poster frame (uncommon).
        N)Úpartr   Úblip_rIdÚ	get_image©r   Ú
slide_partÚrIds      r   Úposter_framezMovie.poster_framey   s4   € ð Ÿ)™) T§Y¡Y×%7Ñ%7�Cˆ
Øˆ;ØØ×#Ñ# CÓ(Ð(r   c                ó"   — t         j                  S )zžReturn member of :ref:`MsoShapeType` describing this shape.

        The return value is unconditionally `MSO_SHAPE_TYPE.MEDIA` in this
        case.
        )r   ÚMEDIAr    s    r   Ú
shape_typezMovie.shape_type„   s   € ô ×#Ñ#Ð#r   N)r=   rI   )r=   r	   ©r=   r   )
r?   r@   rA   rB   r   rJ   rC   rM   rU   rX   © r   r   rG   rG   b   sW   „ ñð ò-ó ð-ð ò#ó ð#ð ñ)ó ð)ð ò$ó ñ$r   rG   c                  ój   — e Zd ZdZedd„«       Zej                  dd„«       Zed„ «       Zed	d„«       Zy)
ÚPicturez]A picture shape, one that places an image on a slide.

    Based on the `p:pic` element.
    c                ó`   — | j                   j                  j                  }|€y|j                  S )a  Member of MSO_SHAPE indicating masking shape.

        A picture can be masked by any of the so-called "auto-shapes" available in PowerPoint,
        such as an ellipse or triangle. When a picture is masked by a shape, the shape assumes the
        same dimensions as the picture and the portion of the picture outside the shape boundaries
        does not appear. Note the default value for a newly-inserted picture is
        `MSO_AUTO_SHAPE_TYPE.RECTANGLE`, which performs no cropping because the extents of the
        rectangle exactly correspond to the extents of the picture.

        The available shapes correspond to the members of :ref:`MsoAutoShapeType`.

        The return value can also be |None|, indicating the picture either has no geometry (not
        expected) or has custom geometry, like a freeform shape. A picture with no geometry will
        have no visible representation on the slide, although it can be selected. This is because
        without geometry, there is no "inside-the-shape" for it to appear in.
        N)r   ÚspPrÚprstGeomÚprst)r   r_   s     r   Úauto_shape_typezPicture.auto_shape_type”   s*   € ð$ —9‘9—>‘>×*Ñ*ˆØÐØØ�}‰}Ðr   c                óÄ   — t        j                  |«       | j                  j                  }|j                  }|€ |j                  «        |j                  «       }||_        y r   )r   Úvalidater   r^   r_   Ú_remove_custGeomÚ_add_prstGeomr`   )r   Úmemberr^   r_   s       r   ra   zPicture.auto_shape_type«   sM   € ä×Ñ˜6Ô"Ø�y‰y�~‰~ˆØ—=‘=ˆØÐØ×!Ñ!Ô#Ø×)Ñ)Ó+ˆHØˆ�r   c                ó‚   — | j                   | j                  j                  }}|€t        d«      ‚|j	                  |«      S )z†The |Image| object for this picture.

        Provides access to the properties and bytes of the image in this picture shape.
        zno embedded image)rO   r   rP   Ú
ValueErrorrQ   rR   s      r   ÚimagezPicture.imageµ   s=   € ð Ÿ)™) T§Y¡Y×%7Ñ%7�Cˆ
Øˆ;ÜÐ0Ó1Ð1Ø×#Ñ# CÓ(Ð(r   c                ó"   — t         j                  S )z6Unconditionally `MSO_SHAPE_TYPE.PICTURE` in this case.)r   ÚPICTUREr    s    r   rX   zPicture.shape_typeÀ   s   € ô ×%Ñ%Ð%r   N)r=   zMSO_SHAPE | None)rf   r   rY   )	r?   r@   rA   rB   rC   ra   rD   ri   rX   rZ   r   r   r\   r\   Ž   s]   „ ñð
 òó ðð, ×Ñòó ðð ñ)ó ð)ð ò&ó ñ&r   r\   c                  ó   — e Zd ZdZy)rI   z�Provides access to formatting properties for a Media object.

    Media format properties are things like start point, volume, and
    compression type.
    N)r?   r@   rA   rB   rZ   r   r   rI   rI   Æ   s   „ òr   rI   N)rB   Ú
__future__r   Útypingr   Úpptx.dml.liner   Úpptx.enum.shapesr   r   r	   Úpptx.shapes.baser
   Úpptx.sharedr   Ú	pptx.utilr   Úpptx.oxml.shapes.picturer   Úpptx.oxml.shapes.sharedr   Ú
pptx.typesr   r   rG   r\   rI   rZ   r   r   ú<module>rw      sb   ðÙ Gå "å  å $ß EÑ EÝ &Ý ,Ý "áÝ3Ý9Ý'ôL�9ô Lô^)$ˆLô )$ôX5&ˆlô 5&ôpÐ'õ r   