
     h	                     B    d dl mZ d dlmZmZmZmZ  G d deee      Zy)    )BaseElement)	Transform_vert_horizClippingc                   6     e Zd ZdZdZd fd	Zd ZddZ xZS )Imagea%   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                     t        t        | 
  d	i | || d<   ||d   | d<   |d   | d<   ||d   | d<   |d   | d<   yy)
a1  
        :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        j/home/developers/rajanand/mypropertyqr-fmb-refixing-v2/venv/lib/python3.12/site-packages/svgwrite/image.pyr   zImage.__init__   sf     	eT#,e,!\q	DIq	DI GDM!!WDN     c                     d| d<   y)zh Stretch viewBox in x and y direction to fill viewport, does not
        preserve aspect ratio.
        nonepreserveAspectRatioNr   )r   s    r   stretchzImage.stretch&   s     '-"#r   c                     | j                   r|dvrt        d|z        t        |   t        |   d|| j                  d<   y)ai   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   fitz	Image.fit,   sC     ::%'88;eCDD;A%=tV[.\*+r   )NN)centermiddler!   )	__name__
__module____qualname____doc__elementnamer   r   r*   __classcell__)r   s   @r   r	   r	      s     K%"-]r   r	   N)svgwrite.baser   svgwrite.mixinsr   r   r   r   r	   r   r   r   <module>r5      s"    & > >1]KH 1]r   