+
    f0i#                     :    Rt ^ RIt^ RIt^ RIHt  ! R R 4      tR# )	PdfMatrixNc                      a  ] tR t^t o RtRR ltR tR t]R 4       t	R t
]R 4       tR tR	 tR
 tR tRR ltR tRR ltR tR tRtV tR# )r   a_  
PDF transformation matrix helper class.

See the PDF 1.7 specification, Section 8.3.3 ("Common Transformations").

Note:
    * The PDF format uses row vectors.
    * Transformations operate from the origin of the coordinate system
      (PDF coordinates: commonly bottom left, but can be any corner in principle. Device coordinates: top left).
    * Matrix calculations are implemented independently in Python.
    * Matrix objects are immutable, so transforming methods return a new matrix.
    * Matrix objects implement ctypes auto-conversion to ``FS_MATRIX`` for easy use as C function parameter.

Attributes:
    a (float): Matrix value [0][0].
    b (float): Matrix value [0][1].
    c (float): Matrix value [1][0].
    d (float): Matrix value [1][1].
    e (float): Matrix value [2][0] (X translation).
    f (float): Matrix value [2][1] (Y translation).
c                Z    WW4WV3w  V n         V n        V n        V n        V n        V n        R # Nabcdef)selfr   r   r	   r
   r   r   s   &&&&&&&_/Users/agent/.openclaw/workspace/venv/lib/python3.14/site-packages/pypdfium2/_helpers/matrix.py__init__PdfMatrix.__init__&   s'    9:qQ9I6    c                (    R V P                  4        2# r   )getr   s   &r   __repr__PdfMatrix.__repr__)   s    488:,''r   c                x    \        V 4      \        V4      Jd   R # V P                  4       VP                  4       8H  # F)typer   r   others   &&r   __eq__PdfMatrix.__eq__,   s,    :T%[(xxzUYY[((r   c                J    \         P                  ! V P                  4       4      # r   )ctypesbyrefto_rawr   s   &r   _as_parameter_PdfMatrix._as_parameter_1   s    ||T[[],,r   c                    V P                   V P                  V P                  V P                  V P                  V P
                  3# )z9
Get the matrix as tuple of the form (a, b, c, d, e, f).
r   r   s   &r   r   PdfMatrix.get6   s/     ??r   c                    V ! VP                   VP                  VP                  VP                  VP                  VP
                  4      # )zB
Load a :class:`.PdfMatrix` from a raw :class:`FS_MATRIX` object.
r   )clsraws   &&r   from_rawPdfMatrix.from_raw=   s1    
 355#%%suucee<<r   c                F    \         P                  ! V P                  4       !  # )z8
Convert the matrix to a raw :class:`FS_MATRIX` object.
)pdfium_c	FS_MATRIXr   r   s   &r   r"   PdfMatrix.to_rawE   s     !!488:..r   c           
     D   \        V P                  VP                  ,          V P                  VP                  ,          ,           V P                  VP                  ,          V P                  VP                  ,          ,           V P                  VP                  ,          V P                  VP                  ,          ,           V P                  VP                  ,          V P                  VP                  ,          ,           V P
                  VP                  ,          V P                  VP                  ,          ,           VP
                  ,           V P
                  VP                  ,          V P                  VP                  ,          ,           VP                  ,           R7      # )zV
Multiply this matrix by another :class:`.PdfMatrix`, to concatenate transformations.
r   )r   r   r   r	   r
   r   r   r   s   &&r   multiplyPdfMatrix.multiplyL   s     uww/uww/uww/uww/uww/%''9uww/%''9
 	
r   c           
     >    V P                  \        ^^ ^ ^W4      4      # )zc
Parameters:
    x (float): Horizontal shift (<0: left, >0: right).
    y (float): Vertical shift.
r1   r   r   xys   &&&r   	translatePdfMatrix.translate_   s      }}i1aA9;;r   c                <    V P                  \        V^ ^ V4      4      # )z
Parameters:
    x (float): A factor to scale the X axis (<1: compress, >1: stretch).
    y (float): A factor to scale the Y axis.
r4   r5   s   &&&r   scalePdfMatrix.scalei   s     }}i1a355r   c                    V'       g   \         P                  ! V4      p\         P                  ! V4      \         P                  ! V4      rTT P	                  V'       d   \        WEV) V4      4      # \        WE) WT4      4      # )z
Parameters:
    angle (float): Angle by which to rotate the matrix.
    ccw (bool): If True, rotate counter-clockwise.
    rad (bool): If True, interpret the angle as radians.
)mathradianscossinr1   r   )r   angleccwradr	   ss   &&&&  r   rotatePdfMatrix.rotates   sZ     LL'Exx1}}iqb!4YY1bRSAWYYr   c                Z    T P                  V'       d   RM^V'       d   RR7      # ^R7      # )aR  
Parameters:
    invert_x (bool): If True, invert X coordinates (horizontal transform). Corresponds to flipping around the Y axis.
    invert_y (bool): If True, invert Y coordinates (vertical transform). Corresponds to flipping around the X axis.
Note:
    Flipping around a vertical axis leads to a horizontal transform, and vice versa.
)r6   r7   )r;   )r   invert_xinvert_ys   &&&r   mirrorPdfMatrix.mirror   s'     zz8RhzOOAzOOr   c           	         V'       g-   \         P                  ! V4      p\         P                  ! V4      pV P                  \        ^\         P                  ! V4      \         P                  ! V4      ^4      4      # )z
Parameters:
    x_angle (float): Inner angle to skew the X axis.
    y_angle (float): Inner angle to skew the Y axis.
    rad (bool): If True, interpret the angles as radians.
)r>   r?   r1   r   tan)r   x_angley_anglerD   s   &&&&r   skewPdfMatrix.skew   sP     ll7+Gll7+G}}i488G+<dhhw>OQRSUUr   c                    V P                   V,          V P                  V,          ,           V P                  ,           V P                  V,          V P                  V,          ,           V P
                  ,           3# )z1
Returns:
    (float, float): Transformed point.
)r   r	   r   r   r
   r   r5   s   &&&r   on_pointPdfMatrix.on_point   sP     FF1Htvvax$&&(FF1Htvvax$&&(
 	
r   c                   V P                  W4      V P                  W4      V P                  W44      V P                  W24      3p\        R V 4       4      \        R V 4       4      \        R V 4       4      \        R V 4       4      3# )zC
Returns:
    (float, float, float, float): Transformed rectangle.
c              3   2   "   T F  q^ ,          x  K  	  R# 5i    N .0ps   & r   	<genexpr>$PdfMatrix.on_rect.<locals>.<genexpr>        %f!f   c              3   2   "   T F  q^,          x  K  	  R# 5i   Nr[   r\   s   & r   r_   r`      ra   rb   c              3   2   "   T F  q^ ,          x  K  	  R# 5irY   r[   r\   s   & r   r_   r`      ra   rb   c              3   2   "   T F  q^,          x  K  	  R# 5ird   r[   r\   s   & r   r_   r`      ra   rb   )rU   minmax)r   leftbottomrighttoppointss   &&&&& r   on_rectPdfMatrix.on_rect   s     MM$$MM$'MM%%MM%(	
 %f%%%f%%%f%%%f%%	
 	
r   r   N)re   rZ   rZ   re   rZ   rZ   )FFr   )__name__
__module____qualname____firstlineno____doc__r   r   r   propertyr#   r   classmethodr*   r"   r1   r8   r;   rF   rL   rR   rU   ro   __static_attributes____classdictcell__)__classdict__s   @r   r   r      s}     0J()
 - -@ = =/
&<6
ZP
V	

 
r   r   )__all__r>   r    pypdfium2.rawr)   r-   r   r[   r   r   <module>r}      s!        
g
 g
r   