
    Rj+                         U d dl mZmZ d dlmZmZmZ ed         Zeed<    G d de	e
ef                   Z G d de          Z G d	 d
e          Ze G d d                      ZdS )    )	dataclassfield)Literal	TypeAliascast)AUTOFlateDecode	DCTDecode	JPXDecode	LZWDecodeCCITTFaxDecodeImageFilterc                       e Zd ZdZedefd            Zedefd            Zedefd            Zedefd            Z	de
fdZded	ed
ededeeeeef         f
dZdS )	ImageInfozInformation about an image used in the PDF document (base class).
    We subclass this to distinguish between raster and vector images.returnc                 8    t          t          | d                   S )zIntrinsic image widthwr   floatselfs    Z/usr/local/lib/hermes-agent/venv/lib/python3.11/site-packages/fpdf/image_datastructures.pywidthzImageInfo.width        E49%%%    c                 8    t          t          | d                   S )zIntrinsic image heighthr   r   s    r   heightzImageInfo.height   r   r   c                 8    t          t          | d                   S );Only available if the image has been placed on the documentrendered_widthr   r   s    r   r!   zImageInfo.rendered_width   s     E4 01222r   c                 8    t          t          | d                   S )r    rendered_heightr   r   s    r   r#   zImageInfo.rendered_height"   s     E4 12333r   c                 J    d |                                  D             }d| dS )Nc                 &    i | ]\  }}||d v rdn|S ))dataiccpsmaskz... ).0kvs      r   
<dictcomp>z%ImageInfo.__str__.<locals>.<dictcomp>(   s:     
 
 
DHAqA777Q
 
 
r   zself.__class__.__name__())items)r   ds     r   __str__zImageInfo.__str__'   s;    
 
LPJJLL
 
 
 /!....r   xyr   r   c                     | d         }| d         }||z  }||z  |k     r||z  }|}	|||z
  dz  z  }n||z  }	|}|||	z
  dz  z  }||||	fS )z
        Make an image fit within a bounding box, maintaining its proportions.
        In the reduced dimension it will be centered within the available space.
        r   r      r)   )
r   r2   r3   r   r   img_wimg_hrationew_wnew_hs
             r   scale_inside_boxzImageInfo.scale_inside_box-   s}     CyCyu9q==IEE!e)q AAIEE!e)q A!UE!!r   N)__name__
__module____qualname____doc__propertyr   r   r   r!   r#   strr1   tupler;   r)   r   r   r   r      s!       I I &u & & & X& & & & & X& 3 3 3 3 X3 4 4 4 4 X4/ / / / /"" "%*"/4"	ueUE)	*" " " " " "r   r   c                   >    e Zd ZdZ	 d	dedededeeef         fdZdS )
RasterImageInfoz9Information about a raster image used in the PDF document   r   r   scaler   c                     | d         }| d         }|dk    r|dk    r||z  }||z  }n|dk    r	||z  |z  }n|dk    r||z  |z  }||fS )Nr   r   r   r)   )r   r   r   rF   r6   r7   s         r   size_in_document_unitsz&RasterImageInfo.size_in_document_unitsE   st     CyCy66a1ffAAA!VVE	E!AA!VVE	E!A!tr   N)rE   )r<   r=   r>   r?   r   rB   rH   r)   r   r   rD   rD   B   sa        ?? 23  ).	ue|	     r   rD   c                       e Zd ZdZdS )VectorImageInfoz9Information about a vector image used in the PDF documentN)r<   r=   r>   r?   r)   r   r   rJ   rJ   T   s        ????r   rJ   c                       e Zd ZU  ee          Zeeeez  f         e	d<    ee          Z
eeef         e	d<   dZee	d<   d	dZdS )

ImageCache)default_factoryimagesicc_profilesr   image_filterr   Nc                 H    | j                                         D ]}d|d<   d S )Nr   usages)rN   values)r   imgs     r   reset_usageszImageCache.reset_usagesc   s4    ;%%'' 	 	CCMM	 	r   )r   N)r<   r=   r>   r   dictrN   rA   rD   rJ   __annotations__rO   bytesintrP   r   rU   r)   r   r   rL   rL   Z   s          <A5QU;V;V;VFDo778VVV%*U4%@%@%@L$ucz"@@@ &L+&&&     r   rL   N)dataclassesr   r   typingr   r   r   r   rW   rV   rA   objectr   rD   rJ   rL   r)   r   r   <module>r]      s,   ( ( ( ( ( ( ( ( ( + + + + + + + + + + Y   0" 0" 0" 0" 0"S&[! 0" 0" 0"f    i   $@ @ @ @ @i @ @ @ 
 
 
 
 
 
 
 
 
 
r   