
    p"h	                     B    S SK Jr  S SKJrJrJrJr   " S S\\\5      rg)    )BaseElement)	Transform_vert_horizClippingc                   D   ^  \ rS rSrSrSrSU 4S jjrS rS	S jrSr	U =r
$ )
Image   a  The **image** element indicates that the contents of a complete file are
to be rendered into a given rectangle within the current user coordinate
system. The **image** element can refer to raster image files such as PNG
or JPEG or to files with MIME type of "image/svg+xml".

imagec                    > [         [        U ]
  " S	0 UD6  XS'   Ub  US   U S'   US   U S'   Ub  US   U S'   US   U S'   gg)
a  
:param string href: hyperlink to the image resource
:param 2-tuple insert: insert point (**x**, **y**)
:param 2-tuple size: (**width**, **height**)
:param dict attribs: additional SVG attributes
:param extra: additional SVG attributes as keyword-arguments
z
xlink:hrefNr   x   ywidthheight )superr	   __init__)selfhrefinsertsizeextra	__class__s        @/var/www/html/env/lib/python3.13/site-packages/svgwrite/image.pyr   Image.__init__   sd     	eT#,e,!\q	DIq	DI GDM!!WDN     c                     SU S'   g)zWStretch viewBox in x and y direction to fill viewport, does not
preserve aspect ratio.
nonepreserveAspectRatioNr   )r   s    r   stretchImage.stretch&   s     '-"#r   c                     U R                   (       a  US;  a  [        SU-  5      e[        U   < [        U   < SU< 3U R                  S'   g)a  Set the preserveAspectRatio attribute.

:param string horiz: horizontal alignment ``'left'|'center'|'right'``
:param string vert: vertical alignment ``'top'|'middle'|'bottom'``
:param string scale: scale method ``'meet'|'slice'``

============= ===========
Scale methods Description
============= ===========
``meet``      preserve aspect ration and zoom to limits of viewBox
``slice``     preserve aspect ration and viewBox touch viewport on all bounds, viewBox will extend beyond the bounds of the viewport
============= ===========

)meetslicezInvalid scale parameter '%s' r    N)debug
ValueErrorr   r   attribs)r   horizvertscales       r   fit	Image.fit,   sC     ::%'88;eCDD;A%=tV[.\*+r   r   )NN)centermiddler$   )__name__
__module____qualname____firstlineno____doc__elementnamer   r!   r-   __static_attributes____classcell__)r   s   @r   r	   r	      s%     K%"-] ]r   r	   N)svgwrite.baser   svgwrite.mixinsr   r   r   r   r	   r   r   r   <module>r;      s"    & > >1]KH 1]r   