+
     ]iX  c                   sF    ^ RI t^ RIHt ^RIHt ^ RIHt  ! R R4      tR# )i    N)cbook)RendererAgg)process_figure_for_rasterizingc                   s@   a  ] tR t^t o RtRR ltR tR tR tRt	V t
R# )	MixedModeRenderera  
A helper class to implement a renderer that switches between
vector and raster drawing.  An example may be a PDF writer, where
most things are drawn with PDF vector commands, but some very
complex objects, such as quad meshes, are rasterised and then
output as images.
Nc                s    Vf   \         pW`n        W n        W0n        W@n        WPn        RV n        Wn        VP                  V n        Wpn	        WPn
        R# )a  
Parameters
----------
figure : `~matplotlib.figure.Figure`
    The figure instance.
width : float
    The width of the canvas in logical units
height : float
    The height of the canvas in logical units
dpi : float
    The dpi of the canvas
vector_renderer : `~matplotlib.backend_bases.RendererBase`
    An instance of a subclass of
    `~matplotlib.backend_bases.RendererBase` that will be used for the
    vector drawing.
raster_renderer_class : `~matplotlib.backend_bases.RendererBase`
    The renderer class to use for the raster drawing.  If not provided,
    this will use the Agg backend (which is currently the only viable
    option anyway.)

N)r   _raster_renderer_class_width_heightdpi_vector_renderer_raster_rendererfigure_figdpi_bbox_inches_restore	_renderer)selfr
   Zwidthheightr   Zvector_rendererZraster_renderer_classZbbox_inches_restores   &&&&&&&&H/usr/lib64/python3.14/site-packages/matplotlib/backends/backend_mixed.py__init__ZMixedModeRenderer.__init__   sP    0 !($/!&;# / $
 zz$7!(    c                s.    \        V P                  V4      # )N)Zgetattrr   )r   Zattrs   &&r   __getattr__ZMixedModeRenderer.__getattr__>   s     t~~t,,r   c                s~   V P                   V P                  n         V P                  '       d'   \        V P                  V P                  4      pWn        V P	                  V P
                  V P                   ,          V P                  V P                   ,          V P                   4      V n        V P                  V n        R# )z
Enter "raster" mode.  All subsequent drawing commands (until
`stop_rasterizing` is called) will be drawn with the raster backend.
N)	r   r
   r   r   r   r   r   r	   r   )r   rs   & r   start_rasterizingZ#MixedModeRenderer.start_rasterizingG   s     (($$$.t{{/3/H/HJA()% $ ; ;KK $,,txx"7!C..r   c           	     sB   V P                   V n        V P                  V P                  ,          p\        P
                  ! V P                  P                  4       4      p\        P                  ! VR,          4      w  r4W#V3,          pVP                  '       d   V P                  P                  4       pV P                  P                  VVP                  V P                  ,          V P                  ,          WP                  ,
          V P                  ,          V P                  ,          VRRR1,          4       RV n        V P                  V P                   n        V P"                  '       d4   \%        V P                   V P"                  V P                  4      pWpn        R# R# )z
Exit "raster" mode.  All of the drawing that was done since
the last `start_rasterizing` call will be copied to the
vector backend by calling draw_image.
N).i   i)r   r   r   r   npZasarrayr	   Zbuffer_rgbar    Z_get_nonzero_slicesZsizeZnew_gcZ
draw_imageZstartr   Zstopr
   r   r   )r   r   ZimgZslice_yZslice_xZcropped_imgZgcr   s   &       r   stop_rasterizingZ"MixedModeRenderer.stop_rasterizingW   s.    ..(jj..::<= 44S[A7*+&&(B NN%%,txx7,,&$,,6ADbD!	#
 !% ,,$$$.t{{/3/H/H/3||=A )*%	 %r   )
r   r   r   r	   r   r   r   r   r   r
   )NN)Z__name__Z
__module__Z__qualname__Z__firstlineno__Z__doc__r   r   r   r   Z__static_attributes__Z__classdictcell__)Z__classdict__s   @r   r   r      s$     ,)\-/  *  *r   r   )	Znumpyr   Z
matplotlibr    Zbackend_aggr   Zmatplotlib._tight_bboxr   r   ) r   r   <module>r      s      $ Ao* o*r   