ó
    pyüi‘[  ã                   ó"  • S r SSKrSSKrSSKrSSKrSSKJr  SSKJ	r
  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  \R*                  r\R,                  " \5      r " S S	\
R2                  5      rS
 r              SS jr " S S5      rg))ÚPdfPageÚPdfColorSchemeé    N)ÚPdfiumError)Ú	PdfBitmap)ÚPdfTextPage)Ú	PdfObject)ÚPDFIUM_INFOc                   ó4  ^ • \ rS rSrSrU 4S jr\S 5       r\S 5       r	S r
S rS rS	 rS
 rS rS%S jrS rS%S jrS rS%S jrS rS%S jrS rS%S jrS rS rS rS rS rS rS&S jr\ RB                  4S jr"S SS!S\#RH                  SS"4S# jr%S$r&U =r'$ )'r   é   a@  
Page helper class.

Attributes:
    raw (FPDF_PAGE):
        The underlying PDFium page handle.
    pdf (PdfDocument):
        Reference to the document this page belongs to.
    formenv (PdfFormEnv | None):
        Formenv handle, if the parent pdf had an active formenv at the time of page retrieval. None otherwise.
c                 óz   >• Xl         X l        X0l        [        TU ]  [
        R                  U R                  5        g ©N)ÚrawÚpdfÚformenvÚsuperÚ__init__r   Ú_close_impl)Úselfr   r   r   Ú	__class__s       €ÚT/home/mande/repo/quber/.venv/lib/python3.13/site-packages/pypdfium2/_helpers/page.pyr   ÚPdfPage.__init__#   s+   ø€ ØŒØŒØŒÜ‰Ñœ×,Ñ,¨d¯l©lÕ;ó    c                 ój   • U(       a  [         R                  " X5        [         R                  " U 5        g r   )Úpdfium_cÚFORM_OnBeforeClosePageÚFPDF_ClosePage)r   r   s     r   r   ÚPdfPage._close_impl*   s!   € æÜ×+Ò+¨CÔ9Ü×Ò Õ$r   c                 óL   • U R                   c  U R                  $ U R                   $ r   )r   r   ©r   s    r   ÚparentÚPdfPage.parent1   s    € ð  Ÿ<™<Ñ/ˆt�x‰xÐA°T·\±\ÐAr   c                 ó.   • [         R                  " U 5      $ )zH
Returns:
    float: Page width (horizontal size), in PDF canvas units.
)r   ÚFPDF_GetPageWidthFr   s    r   Ú	get_widthÚPdfPage.get_width7   s   € ô
 ×*Ò*¨4Ó0Ð0r   c                 ó.   • [         R                  " U 5      $ )zG
Returns:
    float: Page height (vertical size), in PDF canvas units.
)r   ÚFPDF_GetPageHeightFr   s    r   Ú
get_heightÚPdfPage.get_height>   s   € ô
 ×+Ò+¨DÓ1Ð1r   c                 óB   • U R                  5       U R                  5       4$ )zJ
Returns:
    (float, float): Page width and height, in PDF canvas units.
)r$   r(   r   s    r   Úget_sizeÚPdfPage.get_sizeE   s   € ð
 —‘Ó  $§/¡/Ó"3Ð4Ð4r   c                 óv   • [         R                  " U 5      nUS:X  a  [        S5      e[        R                  U   $ )z7
Returns:
    int: Clockwise page rotation in degrees.
éÿÿÿÿzFailed to get page rotation.)r   ÚFPDFPage_GetRotationr   Úpdfium_iÚRotationToDegrees)r   Úraw_rotations     r   Úget_rotationÚPdfPage.get_rotationO   s9   € ô
  ×4Ò4°TÓ:ˆØ˜2ÓÜÐ<Ó=Ð=Ü×)Ñ)¨,Ñ7Ð7r   c                 óT   • [         R                  " U [        R                  U   5        g)zL
Define the absolute, clockwise page rotation (0, 90, 180, or 270 degrees).
N)r   ÚFPDFPage_SetRotationr0   ÚRotationToConst)r   Úrotations     r   Úset_rotationÚPdfPage.set_rotationY   s   € ô 	×%Ò% d¬H×,DÑ,DÀXÑ,NÕOr   c                 óò   • [        5       [        5       [        5       [        5       4u  pEpgU" XXVU5      nU(       d  U(       a  U" 5       $ S $ UR                  UR                  UR                  UR                  4$ r   )Úc_floatÚvalue)	r   Úbox_funcÚfallback_funcÚfallback_okÚleftÚbottomÚrightÚtopÚoks	            r   Ú_get_boxÚPdfPage._get_box`   s\   € Ü#*£9¬g«i¼»ÄGÃIÐ#MÑ ˆ�eÙ�d &°Ó5ˆÞÞ'2‘M“OÐ=¸Ð=Ø—
‘
˜FŸL™L¨%¯+©+°s·y±yÐAÐAr   Tc                 óF   • U R                  [        R                  S U5      $ )a¸  
Returns:
    (float, float, float, float) | None:
    The page MediaBox in PDF canvas units, consisting of four coordinates (usually x0, y0, x1, y1).
    If MediaBox is not defined, returns ANSI A (0, 0, 612, 792) if ``fallback_ok=True``, None otherwise.

.. admonition:: Known issue

    Due to quirks in PDFium, all ``get_*box()`` functions except :meth:`.get_bbox` do not inherit from parent nodes in the page tree (as of PDFium 5418).
c                  ó   • g)N)r   r   id  i  © rJ   r   r   Ú<lambda>Ú&PdfPage.get_mediabox.<locals>.<lambda>t   s   € ÐDTr   )rF   r   ÚFPDFPage_GetMediaBox©r   r@   s     r   Úget_mediaboxÚPdfPage.get_mediaboxi   s   € ð �}‰}œX×:Ñ:Ñ<TÐVaÓbÐbr   c                 ó4   • [         R                  " XX#U5        g)z^
Set the page's MediaBox by passing four :class:`float` coordinates (usually x0, y0, x1, y1).
N)r   ÚFPDFPage_SetMediaBox©r   ÚlÚbÚrÚts        r   Úset_mediaboxÚPdfPage.set_mediaboxv   ó   € ô 	×%Ò% d¨q°QÕ7r   c                 óX   • U R                  [        R                  U R                  U5      $ )zK
Returns:
    The page's CropBox (If not defined, falls back to MediaBox).
)rF   r   ÚFPDFPage_GetCropBoxrO   rN   s     r   Úget_cropboxÚPdfPage.get_cropbox|   s#   € ð
 �}‰}œX×9Ñ9¸4×;LÑ;LÈkÓZÐZr   c                 ó4   • [         R                  " XX#U5        g)z
Set the page's CropBox.
N)r   ÚFPDFPage_SetCropBoxrS   s        r   Úset_cropboxÚPdfPage.set_cropboxƒ   ó   € ô 	×$Ò$ T¨a°AÕ6r   c                 óX   • U R                  [        R                  U R                  U5      $ )zK
Returns:
    The page's BleedBox (If not defined, falls back to CropBox).
)rF   r   ÚFPDFPage_GetBleedBoxr]   rN   s     r   Úget_bleedboxÚPdfPage.get_bleedbox‰   s#   € ð
 �}‰}œX×:Ñ:¸D×<LÑ<LÈkÓZÐZr   c                 ó4   • [         R                  " XX#U5        g)z
Set the page's BleedBox.
N)r   ÚFPDFPage_SetBleedBoxrS   s        r   Úset_bleedboxÚPdfPage.set_bleedbox�   rZ   r   c                 óX   • U R                  [        R                  U R                  U5      $ )zJ
Returns:
    The page's TrimBox (If not defined, falls back to CropBox).
)rF   r   ÚFPDFPage_GetTrimBoxr]   rN   s     r   Úget_trimboxÚPdfPage.get_trimbox–   s#   € ð
 �}‰}œX×9Ñ9¸4×;KÑ;KÈ[ÓYÐYr   c                 ó4   • [         R                  " XX#U5        g)z
Set the page's TrimBox.
N)r   ÚFPDFPage_SetTrimBoxrS   s        r   Úset_trimboxÚPdfPage.set_trimbox�   rc   r   c                 óX   • U R                  [        R                  U R                  U5      $ )zI
Returns:
    The page's ArtBox (If not defined, falls back to CropBox).
)rF   r   ÚFPDFPage_GetArtBoxr]   rN   s     r   Ú
get_artboxÚPdfPage.get_artbox£   s#   € ð
 �}‰}œX×8Ñ8¸$×:JÑ:JÈKÓXÐXr   c                 ó4   • [         R                  " XX#U5        g)z
Set the page's ArtBox.
N)r   ÚFPDFPage_SetArtBoxrS   s        r   Ú
set_artboxÚPdfPage.set_artboxª   s   € ô 	×#Ò# D¨Q°1Õ5r   c                 óØ   • [         R                  " 5       n[         R                  " X5      nU(       d  [        S5      eUR                  UR
                  UR                  UR                  4$ )zb
Returns:
    The bounding box of the page (the intersection between its media box and crop box).
z Failed to get page bounding box.)r   ÚFS_RECTFÚFPDF_GetPageBoundingBoxr   rA   rB   rC   rD   )r   ÚrectrE   s      r   Úget_bboxÚPdfPage.get_bbox±   sP   € ô
 × Ò Ó"ˆÜ×-Ò-¨dÓ9ˆÞÜÐ@ÓAÐAØ—	‘	˜4Ÿ;™;¨¯
©
°D·H±HÐ=Ð=r   c                 óŽ   • [         R                  " U 5      nU(       d  [        S5      e[        X5      nU R	                  U5        U$ )zA
Returns:
    PdfTextPage: A new text page handle for this page.
zFailed to load text page.)r   ÚFPDFText_LoadPager   r   Ú_add_kid)r   Úraw_textpageÚtextpages      r   Úget_textpageÚPdfPage.get_textpageÀ   s>   € ô
  ×1Ò1°$Ó7ˆÞÜÐ9Ó:Ð:Ü˜|Ó2ˆØ�‰�hÔØˆr   c                 ól  • UR                   (       a  [        S5      eUR                  (       a$  UR                  U R                  La  [        S5      e[        R                  " X5      nU(       d  [
        R                  S:¼  a  [        S5      eUR                  5         Xl         U R                  Ul        g)an  
Insert a pageobject into the page.

The pageobject must not belong to a page yet. If it belongs to a PDF, the target page must be part of that PDF.

Position and form are defined by the object's matrix.
If it is the identity matrix, the object will appear as-is on the bottom left corner of the page.

Parameters:
    pageobj (PdfObject): The pageobject to insert.
zAThe pageobject you attempted to insert already belongs to a page.zBThe pageobject you attempted to insert belongs to a different PDF.i�  zFailed to insert object.N)	ÚpageÚ
ValueErrorr   r   ÚFPDFPage_InsertObjectr	   Úbuildr   Ú_detach_finalizer©r   ÚpageobjrE   s      r   Ú
insert_objÚPdfPage.insert_objÍ   s�   € ð �<�<ÜÐ`ÓaÐaØ�;�;˜GŸK™K¨t¯x©xÒ7ÜÐaÓbÐbä×+Ò+¨DÓ:ˆÞ”k×'Ñ'¨4Ó/ÜÐ8Ó9Ð9Ø×!Ñ!Ô#ØŒØ—h‘hˆ�r   c                 ót  • UR                   U La  [        S5      eUR                  S:”  a@  UR                  c   e[        R
                  " UR                  U5      nSu  Ul        Ul        O%UR                  b   e[        R                  " X5      nU(       d  [        S5      eSUl         UR                  5         g)aÓ  
Remove a pageobject from the page.
As of PDFium 5692, detached pageobjects may be only re-inserted into existing pages of the same document.
If the pageobject is not re-inserted into a page, its ``close()`` method may be called.

Note:
    If the object's :attr:`~.PdfObject.type` is :data:`FPDF_PAGEOBJ_TEXT`, any :class:`.PdfTextPage` handles to the page should be closed before removing the object.

Parameters:
    pageobj (PdfObject): The pageobject to remove.
z@The pageobject you attempted to remove is not part of this page.r   N)r   NzFailed to remove pageobject.)	rŠ   r‹   ÚlevelÚ	containerr   ÚFPDFFormObj_RemoveObjectÚFPDFPage_RemoveObjectr   Ú_attach_finalizerr�   s      r   Ú
remove_objÚPdfPage.remove_objç   s¥   € ð �<‰<˜tÒ#ÜÐ_Ó`Ð`à�=‰=˜1ÓØ×$Ñ$Ñ0Ð0Ð0Ü×2Ò2°7×3DÑ3DÀgÓNˆBØ/6Ñ,ˆGŒM˜7Õ,à×$Ñ$Ñ,Ð,Ð,Ü×/Ò/°Ó>ˆBæÜÐ<Ó=Ð=àˆŒØ×!Ñ!Õ#r   c                 óT   • [         R                  " U 5      nU(       d  [        S5      eg)zÊ
Generate page content to apply additions, removals or modifications of pageobjects.

If page content was changed, this function should be called once before saving the document or re-loading the page.
z Failed to generate page content.N)r   ÚFPDFPage_GenerateContentr   )r   rE   s     r   Úgen_contentÚPdfPage.gen_content  s(   € ô ×.Ò.¨tÓ4ˆÞÜÐ@ÓAÐAð r   Nr   c           
   #   óf  #   • U(       a#  [         R                  n[         R                  nUnOC[         R                  n[         R                  nU nU(       a  UR
                  U La  [        S5      eU" U5      n	U	S:  a  [        S5      e[        U	5       H–  n
U" XŠ5      nU(       d  [        S5      e[        X°U R                  X4US9nU(       a  UR                  U;   a  Uv •  UR                  [         R                  :X  d  Mn  XBS-
  :  d  Mx  U R                  UUUUS-   US9 Sh  v•N   M˜     g N	7f)	a@  
Iterate through the pageobjects on this page.

Parameters:
    filter (list[int] | None):
        An optional list of pageobject types to filter (:attr:`FPDF_PAGEOBJ_*`).
        Any objects whose type is not contained will be skipped.
        If None or empty, all objects will be provided, regardless of their type.
    max_depth (int):
        Maximum recursion depth to consider when descending into Form XObjects.
    textpage (PdfTextPage | None):
        Text page to pass through to any :class:`.PdfTextObj` instances.

Yields:
    :class:`.PdfObject`: A pageobject.
z0The given textpage does not belong to this page.r   z$Failed to get number of pageobjects.zFailed to get pageobject.)rŠ   r   r•   r”   r†   é   )ÚfilterÚ	max_depthÚformr”   r†   N)r   ÚFPDFFormObj_CountObjectsÚFPDFFormObj_GetObjectÚFPDFPage_CountObjectsÚFPDFPage_GetObjectrŠ   r‹   r   Úranger   r   ÚtypeÚFPDF_PAGEOBJ_FORMÚget_objects)r   r¡   r¢   r£   r”   r†   Úcount_objectsÚ
get_objectr    Ú	n_objectsÚiÚraw_objÚ
helper_objs                r   r«   ÚPdfPage.get_objects  s  é € ö$ Ü$×=Ñ=ˆMÜ!×7Ñ7ˆJØ‰Fä$×:Ñ:ˆMÜ!×4Ñ4ˆJØˆFÞ˜HŸM™M°Ò5Ü Ð!SÓTÐTá! &Ó)ˆ	Ø�q‹=ÜÐDÓEÐEä�yÖ!ˆAá  Ó+ˆGÞÜ!Ð"=Ó>Ð>ô # 7¸4¿8¹8ÈtÐksÑtˆJÞ˜ZŸ_™_°Ó6Ø Ò à�‰¤(×"<Ñ"<Õ<ÀÐSTÉÕATØ×+Ñ+Ø#Ø )Ø%Ø! A™IØ'ð ,ð ÷ ò ò "ñùs   ‚C<D1ÄD1ÄD1Ä%D/Ä&
D1c                 ó¨   • U R                   (       d  [        S5      e[        R                  " X5      nU[        R                  :X  a  [        S5      eU$ )a+  
Flatten form fields and annotations into page contents.

Attention:
    * :meth:`~.PdfDocument.init_forms` must have been called on the parent pdf, before the page was retrieved, for this method to work. In other words, :attr:`.PdfPage.formenv` must be non-null.
    * Flattening may invalidate existing handles to the page, so you'll want to re-initialize these afterwards.

Parameters:
    flag (int): PDFium flattening target (:attr:`FLAT_*`)
Returns:
    int: PDFium flattening status (:attr:`FLATTEN_*`). :attr:`FLATTEN_FAIL` is handled internally.
zFpage.flatten() requires prior pdf.init_forms(), before page retrieval.z,Failed to flatten annotations / form fields.)r   ÚRuntimeErrorr   ÚFPDFPage_FlattenÚFLATTEN_FAILr   )r   ÚflagÚrcs      r   ÚflattenÚPdfPage.flattenI  sF   € ð �|�|ÜÐgÓhÐhÜ×&Ò& tÓ2ˆØ”×&Ñ&Ó&ÜÐLÓMÐMØˆ	r   r    )r   r   r   r   Fc                 óH  • [         R                  " U R                  5       U-  5      n	[         R                  " U R                  5       U-  5      n
US;   a  X©p©U Vs/ s H  n[         R                  " X±-  5      PM     nnX“S   -
  US   -
  nX£S   -
  US   -
  n[	        S XÍ4 5       5      (       a  [        S5      e[        U 40 UD6u  pïnnUb  U(       a  U[        R                  -  nU" XÍXïS9nUR                  USSXÍ5        US   * US   * Xš[        R                  U   4nUU /UQUP7nUc  [        R                  " U6   O„[        R                  " SS	9n[        R                  " US
S 5        UR                  U5      n[        R                   " / UQUPUP76 nU[        R"                  :X  d   e[        R$                  " U 5        U(       a2  U R&                  (       a!  [        R(                  " U R&                  /UQ76   [*        R,                  " U 5      U4Ul        U$ s  snf )a   
Rasterize the page to a :class:`.PdfBitmap`.

Parameters:
    
    scale (float):
        A factor scaling the number of pixels per PDF canvas unit. This defines the resolution of the image.
        To convert a DPI value to a scale factor, multiply it by the size of 1 canvas unit in inches (usually 1/72in). [#user_unit]_
    
    rotation (int):
        Additional rotation in degrees (0, 90, 180, or 270).
    
    crop (tuple[float, float, float, float]):
        Amount in PDF canvas units to cut off from page borders (left, bottom, right, top). Crop is applied after rotation.
    
    may_draw_forms (bool):
        If True, render form fields (provided the document has forms and :meth:`~.PdfDocument.init_forms` was called).
    
    bitmap_maker (typing.Callable):
        Callback function used to create the :class:`.PdfBitmap`.
    
    fill_color (tuple[int, int, int, int]):
        Color the bitmap will be filled with before rendering. This uses RGBA syntax regardless of the pixel format used, with values from 0 to 255.
        If the fill color is not opaque (i.e. has transparency), ``{BGR,RGB}A`` will be used.
    
    grayscale (bool):
        If True, render in grayscale mode.
    
    optimize_mode (None | str):
        Page rendering optimization mode (None, "lcd", "print").
    
    draw_annots (bool):
        If True, render page annotations.
    
    no_smoothtext (bool):
        If True, disable text anti-aliasing. Overrides ``optimize_mode="lcd"``.
    
    no_smoothimage (bool):
        If True, disable image anti-aliasing.
    
    no_smoothpath (bool):
        If True, disable path anti-aliasing.
    
    force_halftone (bool):
        If True, always use halftone for image stretching.
    
    limit_image_cache (bool):
        If True, limit image cache size.
    
    rev_byteorder (bool):
        If True, render with reverse byte order, leading to ``RGB{A/x}`` output rather than ``BGR{A/x}``.
        Other pixel formats are not affected.
    
    prefer_bgrx (bool):
        If True, use 4-byte ``{BGR/RGB}x`` rather than 3-byte ``{BGR/RGB}`` (i.e. add an unused byte).
        Other pixel formats are not affected.
    
    maybe_alpha (bool):
        If True, use a pixel format with alpha channel (i.e. ``{BGR/RGB}A``) if page content has transparency.
        This is recommended for performance in these cases, but as page-dependent format selection can be unexpected, it is not enabled by default.
    
    force_bitmap_format (int | None):
        If given, override automatic pixel format selection and enforce use of the given format (one of the :attr:`FPDFBitmap_*` constants). In this case, you should not pass any other format selection options, except potentially *rev_byteorder*.
    
    extra_flags (int):
        Additional PDFium rendering flags. May be combined with bitwise OR (``|`` operator).
    
    color_scheme (PdfColorScheme | None):
        A custom pdfium color scheme. Note that this may flatten different colors into one, so the usability of this is limited.
    
    fill_to_stroke (bool):
        If a *color_scheme* is given, whether to only draw borders around fill areas using the `path_stroke` color, instead of filling with the `path_fill` color.

Returns:
    PdfBitmap: Bitmap of the rendered page.

.. admonition:: Format selection
    
    This is the format selection hierarchy used by :meth:`.render`, from lowest to highest priority:
    
    * default: ``BGR``
    * ``prefer_bgrx=True``: ``BGRx``
    * ``grayscale=True``: ``L``
    * ``maybe_alpha=True``: ``BGRA`` if the page has transparency, else the format selected otherwise
    * ``fill_color[3] < 255``: ``BGRA`` (background color with transparency)
    * ``force_bitmap_format=...`` -> any supported by pdfium
    
    Additionally, ``rev_byteorder=True`` will swap ``BGR{A/x}`` to ``RGB{A/x}`` if applicable.

.. [#user_unit] Since PDF 1.6, pages may define an additional user unit factor. In this case, 1 canvas unit is equivalent to ``user_unit * (1/72)`` inches. PDFium does not currently provide an API to get the user unit, so this is not taken into account.
)éZ   i  r   é   r    é   c              3   ó*   #   • U  H	  oS :  v •  M     g7f)r    NrJ   )Ú.0Úds     r   Ú	<genexpr>Ú!PdfPage.render.<locals>.<genexpr>Ò  s   é € Ð.šo˜�1Žušoùs   ‚zCrop exceeds page dimensions)ÚformatÚrev_byteorder)ÚversionÚNeedToPauseNowc                 ó   • g)NFrJ   )Ú_s    r   rK   Ú PdfPage.render.<locals>.<lambda>ã  s   € ÀUr   )ÚmathÚceilr$   r(   Úanyr‹   Ú_parse_renderoptsr   ÚFPDF_CONVERT_FILL_TO_STROKEÚ	fill_rectr0   r7   ÚFPDF_RenderPageBitmapÚIFSDK_PAUSEÚset_callbackÚconvertÚ*FPDF_RenderPageBitmapWithColorScheme_StartÚFPDF_RENDER_DONEÚFPDF_RenderPage_Closer   ÚFPDF_FFLDrawÚweakrefÚrefÚ_render_args)r   Úscaler8   ÚcropÚmay_draw_formsÚbitmap_makerÚcolor_schemeÚfill_to_strokeÚkwargsÚ	src_widthÚ
src_heightÚcÚwidthÚheightÚ	cl_formatrÅ   Ú
fill_colorÚflagsÚbitmapÚpos_argsÚrender_argsÚpauseÚfpdf_csÚstatuss                           r   ÚrenderÚPdfPage.renderc  sÿ  € ôN —Y’Y˜tŸ~™~Ó/°5Ñ8Ó9ˆ	Ü—Y’Y˜tŸ™Ó0°5Ñ8Ó9ˆ
Ø�yÓ Ø$.�zá,0Ó1ªD q”—	’	˜!™'Ö"©DˆÐ1Ø 1™gÑ%¨¨Q©Ñ/ˆØ 1™gÑ%¨¨Q©Ñ/ˆÜÑ.˜u™oÓ.×.Ñ.ÜÐ;Ó<Ð<ä6GÈÑ6WÐPVÑ6WÑ3ˆ	 *¨eØÑ$®.Ø”X×9Ñ9Ñ9ˆEá˜e°IÑ[ˆØ×Ñ˜ Q¨¨5Ô9à˜!‘W�H˜t A™w˜h¨	¼x×?WÑ?WÐX`Ñ?aÐbˆØ˜tÐ6 hÐ6°Ñ6ˆàÑÜ×*Ò*¨KÒ8ä×(Ò(°Ñ3ˆEÜ×!Ò! %Ð)9¹?ÔKØ"×*Ñ*¨=Ó9ˆGÜ×HÒHÐfÈ+ÐfÐW^ÐfÐ`eÒfˆFØœX×6Ñ6Ó6Ð6Ð6Ü×*Ò*¨4Ô0æ˜dŸlŸlÜ×!Ò! $§,¡,Ð=°Ó=ä&Ÿ{š{¨4Ó0°(Ð;ˆÔØˆùò= 2s   Á"H)r   r   r   )T)Né   Nr   N)(Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   Ústaticmethodr   Úpropertyr    r$   r(   r+   r3   r9   rF   rO   rX   r]   ra   rf   rj   rn   rr   rv   rz   r€   r‡   r‘   r™   r�   r«   r   ÚFLAT_NORMALDISPLAYr¹   r   Ú
new_nativerñ   Ú__static_attributes__Ú__classcell__)r   s   @r   r   r      sè   ø† ñ
õ<ð ñ%ó ð%ð ñBó ðBò
1ò2ò5ò8òPòBôcò8ô[ò7ô[ò8ôZò7ôYò6ò	>ò
òò4$òBBô3ðl $×6Ñ6ô ð8 ØØØ!Ø$×/Ñ/ØØ"÷Jò Jr   r   c                 óô   • US   S:  d"  U(       a+  [         R                  " U 5      (       a  [         R                  $ U(       a  [         R                  $ U(       a  [         R                  $ [         R
                  $ )Nr¾   éÿ   )r   ÚFPDFPage_HasTransparencyÚFPDFBitmap_BGRAÚFPDFBitmap_GrayÚFPDFBitmap_BGRxÚFPDFBitmap_BGR)rŠ   ré   Ú	grayscaleÚprefer_bgrxÚmaybe_alphas        r   Ú_auto_bitmap_formatr	  ð  sY   € ð �!�}�sÓž{¬x×/PÒ/PÐQU×/VÑ/VÜ×'Ñ'Ð'Þ	Ü×'Ñ'Ð'Þ	Ü×'Ñ'Ð'ä×&Ñ&Ð&r   c                 ó´  • Uc  [        XX+U5      nOUnU[        R                  :X  a  Sn
UnU(       a  U[        R                  -  nU(       a  U[        R                  -  nU(       a  U[        R
                  -  nU(       a  U[        R                  -  nU(       a  U[        R                  -  nU(       a  U[        R                  -  nU	(       a  U[        R                  -  nU
(       a  U[        R                  -  nU(       aR  UR                  5       nUS:X  a  U[        R                  -  nO(US:X  a  U[        R                  -  nO[        SU 35      eXúUU4$ )NFÚlcdÚprintzInvalid optimize_mode )r	  r   r  ÚFPDF_GRAYSCALEÚ
FPDF_ANNOTÚFPDF_RENDER_NO_SMOOTHTEXTÚFPDF_RENDER_NO_SMOOTHIMAGEÚFPDF_RENDER_NO_SMOOTHPATHÚFPDF_RENDER_FORCEHALFTONEÚFPDF_RENDER_LIMITEDIMAGECACHEÚFPDF_REVERSE_BYTE_ORDERÚlowerÚFPDF_LCD_TEXTÚFPDF_PRINTINGr‹   )rŠ   ré   r  Úoptimize_modeÚdraw_annotsÚno_smoothtextÚno_smoothimageÚno_smoothpathÚforce_halftoneÚlimit_image_cacherÅ   r  r  Úforce_bitmap_formatÚextra_flagsrè   rê   s                    r   rÎ   rÎ   ý  s1  € ð$ Ñ"Ü'¨¸)ÐR]Ó^‰	à'ˆ	à”H×,Ñ,Ó,Øˆà€EÞØ”×(Ñ(Ñ(ˆÞØ”×$Ñ$Ñ$ˆÞØ”×3Ñ3Ñ3ˆÞØ”×4Ñ4Ñ4ˆÞØ”×3Ñ3Ñ3ˆÞØ”×3Ñ3Ñ3ˆÞØ”×7Ñ7Ñ7ˆÞØ”×1Ñ1Ñ1ˆæØ%×+Ñ+Ó-ˆØ˜EÓ!Ø”X×+Ñ+Ñ+‰EØ˜gÓ%Ø”X×+Ñ+Ñ+‰EäÐ5°m°_ÐEÓFÐFð  Z°Ð6Ð6r   c                   ó*   • \ rS rSrSrS rS rS rSrg)r   i6  z�
Rendering color scheme.
Each color shall be provided as a list of values for red, green, blue and alpha, ranging from 0 to 255.
c                 ó"   • [        XX4S9U l        g )N)Úpath_fill_colorÚpath_stroke_colorÚtext_fill_colorÚtext_stroke_color)ÚdictÚcolors)r   Ú	path_fillÚpath_strokeÚ	text_fillÚtext_strokes        r   r   ÚPdfColorScheme.__init__<  s   € ÜØ%Ø%ñ
ˆ�r   c                 óL   • [        U 5      R                   SU R                   S3$ )Nz(**Ú))r©   rô   r(  r   s    r   Ú__repr__ÚPdfColorScheme.__repr__B  s$   € Ü�t“*×%Ñ%Ð& c¨$¯+©+¨°aÐ8Ð8r   c           	      ó¶   • [         R                  " 5       nU R                  R                  5        H%  u  p4[	        X#[
        R                  " XA5      5        M'     U$ )zD
Returns:
    The color scheme as :class:`FPDF_COLORSCHEME` object.
)r   ÚFPDF_COLORSCHEMEr(  ÚitemsÚsetattrr0   Úcolor_tohex)r   rÅ   rï   Úkeyr=   s        r   rÔ   ÚPdfColorScheme.convertE  sE   € ô
 ×+Ò+Ó-ˆØŸ+™+×+Ñ+Ö-‰JˆCÜ�G¤(×"6Ò"6°uÓ"LÖMñ .àˆr   )r(  N)	rô   rõ   rö   r÷   rø   r   r0  rÔ   rý   rJ   r   r   r   r   6  s   † ñò

ò9õr   r   ))r   r   r   r   FNTFFFFFFFFNr   )Ú__all__rË   ÚctypesÚloggingrÙ   Úpypdfium2.rawr   r   Úpypdfium2.internalÚinternalr0   Úpypdfium2._helpers.miscr   Úpypdfium2._helpers.bitmapr   Úpypdfium2._helpers.textpager   Úpypdfium2._helpers.pageobjectsr   Úpypdfium2.versionr	   r<   Ú	getLoggerrô   ÚloggerÚAutoCloseabler   r	  rÎ   r   rJ   r   r   Ú<module>rG     sœ   ðð (€ã Û Û Û Ý  Ý %Ý /Ý /Ý 3Ý 4Ý )à
�.‰.€Ø	×	Ò	˜8Ó	$€ôWˆx×%Ñ%ô Wòt
'ð *ØØØØØØØØ!ØØØØ"Øô67÷rò r   