HEX
Server: LiteSpeed
System: Linux standart9.isimtescil.net 3.10.0-962.3.2.lve1.5.26.7.el7.x86_64 #1 SMP Wed Oct 2 07:53:12 EDT 2019 x86_64
User: karalev (5310)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: //opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyo
�
�)�Uc@ s�dZddlmZddlZddlZddlZddlmZddlm	Z	ddl
jZddl
m
Z
ddljZddljZddljZddljZddljZddlTddlmZmZddljZd	ejejfd
��YZ de fd��YZ!d
e!fd��YZ"dejejfd��YZ#dejejfd��YZ$de fd��YZ%e&d�Z'e&e&e&e&e&dd�Z(d�Z)dde*d�Z+dS(sS
The image module supports basic image loading, rescaling and display
operations.

i����(tdivisionN(tma(trcParams(tallow_rasterization(t*(tBboxBasetBboxt_AxesImageBasecB s�eZdZiejd6ejd6ejd6ejd6ejd6ej	d6ej
d6ejd6ejd	6ej
d
6ejd6ejd6ejd
6ejd6ejd6ejd6ejd6Zegej�D]\ZZeef^q��Zej�Zd�Zd,d,d,d,dded�Z d�Z!d�Z"d�Z#dd�Z$d�Z%e&d��Z'd�Z(d�Z)e*d��Z+d �Z,ed!�Z-d"�Z.d#�Z/d$�Z0d%�Z1d&�Z2d'�Z3d(�Z4d)�Z5d*�Z6d+�Z7RS(-itnearesttbilineartbicubictspline16tspline36thanningthammingthermitetkaisertquadrictcatromtgaussiantbesseltmitchelltsinctlanczostblackmancC sdt|jjj�S(NsAxesImage(%g,%g;%gx%g)(ttupletaxestbboxtbounds(tself((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyt__str__:sig@c	
K s�tjj|�tjj|||�|dkr?td}n||_|j|�|j	|�||_
|j|�|j|�||_
d|_d|_|j|	�dS(s�
        interpolation and cmap default to their rc settings

        cmap is a colors.Colormap instance
        norm is a colors.Normalize instance to map luminance to 0-1

        extent is data axes (left, right, bottom, top) for making image plots
        registered with data plots.  Default is to label the pixel
        centers with the zero-based row and column indices.

        Additional kwargs are matplotlib.artist properties

        simage.originN(tmartisttArtistt__init__tcmtScalarMappabletNoneRtorigintset_filternormt
set_filterradt
_filterradtset_interpolationtset_resampleRt_imcachet_image_skew_coordinatetupdate(
Rtaxtcmaptnormt
interpolationR%t
filternormt	filterradtresampletkwargs((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyR!=s
	

	

			cC s,|jdkrtd��n|jjd S(s+Get the numrows, numcols of the input images"You must first set the image arrayiN(t_AR$tRuntimeErrortshape(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pytget_sizelscC s tjj||�d|_dS(sw
        Set the alpha value used for blending - not supported on
        all backends

        ACCEPTS: float
        N(RR t	set_alphaR$R+(Rtalpha((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyR:sscC s&d|_d|_tjj|�dS(sb
        Call this whenever the mappable is changed so observers can
        update state
        N(R$R+t
_rgbacacheR"R#tchanged(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyR=}s		g�?cC std��dS(Ns)The make_image method must be overridden.(R7(Rt
magnification((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyt
make_image�scC s�|\}}}}||}||}	|jdkrJ|dkrJd}
n
||j}
|jdkr{|	dkr{d}n
|	|j}|jd \}}
|
dkr\|j|||
}tdt||j��}|j|||
}t|
t||j��}t	||�}|}||||
}||||
}||}||j}
nt	d|
�}|dkrU|j
||	|}tdt||j��}|j||	|}t|t||j��}|jdkrt	||||�}nt	||�}|}|||	|}|||	|}||}	|	|j}nt	d|�}||j
ks�||jkr�d|_||_
||_n|jdkr�|jjtjkrt|jj�dkrtj|j||dd�fd�}t|_n�|jdkrC|j|j|j�}||_n	|j}tj|||fd�}t|jj�dkr�|jj�|_n	t|_||_|jdkr�|j �q�n	|j}|||||	|
|fS(s
        convert numpy array A with given extents ([x1, x2, y1, y2] in
        data coordinate) into the Image, given the vielim (should be a
        bbox instance).  Image will be clipped if the extents is
        significantly larger than the viewlim.
        gg�?iitupperiN(!twidththeightR8tx0tmaxtintR(tx1tmintslicety0ty1R%t
_oldxslicet
_oldysliceR$R+R6tdtypetnptuint8tlent_imagetfrombytetFalsetis_grayscaleR<tto_rgbat_alphat	fromarrayR/tis_grayt	flipud_in(RtAt
image_extentstviewlimtxmintxmaxtymintymaxtdxintvtdyintvtsxtsytnumrowstnumcolsRCtix0RFtix1txslicetxmin_oldRItiy0RJtiy1tyslicetymin_oldtimtx((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyt_get_unsampled_image�sr

	
	


		-(				cC s,tj�}|j||�|j||f�\}}|j||f�\}	}
d||
||	tj|
|g|	|gg�}|tj|g|gg�j\}}
|tj|gdgg�j\}}tjj|||
|dd�}||tj�j||�j�j	�}|S(sh
        Retuen a transform that does
         (x1, y1) -> (x1, y1)
         (x2, y2) -> (x2, y2)
         (x2, y1) -> (x3, y3)

        It was intended to derive a skew transform that preserve the
        lower-left corner (x1, y1) and top-right corner(x2,y2), but
        change the the lower-right-corner(x2, y1) to a new position
        (x3, y3).
        g�?i(
tmtransformstAffine2Dt	translatettransform_pointRNtmattflattfrom_valuestinvertedt
get_affine(RFRJtx2ty2tx3ty3ttr1tx2aty2atx3aty3atinv_mattatbtctdttr2ttr((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyt_get_rotate_and_skew_transform�s
7((!,c+C s�|j�}|j�\}}}}|jtj||f||fg��}|d\}	}
|d\}}|	||
|f}
|jr�|j\}}|jtj||fg��}|d\}}|j|	|
||||�}||j�}n|j�}|jj	j
\}}}}|j�}|jtj||f||f||f||fg��}t
|dd�df�t|dd�df�}}t
|dd�df�t|dd�df�}}tj||||�}|j|j|
|�\} }!}"}#}$}%}&| dkr0dS|jjj�}'tjj|'d�}(| j|(�| j�| j�\})}*| j|*|)�|j�| _|j||!|"| |#|$|�dS(su
        draw unsampled image. The renderer should support a draw_image method
        with scale parameter.
        iiN( t
get_transformt
get_extentttransform_non_affineRNtarrayR,R�RzRRtextentsRyt	transformRGRDRtfrom_extentsRqR6R$tpatcht
get_facecolortmcolorstcolorConverterRUtset_bgtreset_matrixR9tresizetget_urlt_urlt
draw_image(+Rtrenderertgcttranstx_llctx_trcty_llcty_trctxyt_xx1t_yy1t_xx2t_yy2textent_in_ictx_lrcty_lrctxy2t_xx3t_yy3ttr_rotate_skewttrans_ic_to_canvasRFRJR{R|ttrans_canvas_to_ictxy_tx1_tx2_ty1_ty2_t
viewLim_in_icRoR]R_RaRbRcRdtfctbgReRf((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyt_draw_unsampled_image�sJ
	!		99-

cC stS(s{
        return True if the image is better to be drawn unsampled.
        The derived class needs to override it.
        (RS(RR�((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyt_check_unsampled_imageIsc
O s6|j�sdS|jj�dks:|jj�dkrJtjd�n|jjj\}}}}|j�}|j	|jjj
��|j|j��|j
|�r�|j||�ni|jdk	r�tjd�n|j|j��}	|	dkrdS|j�|	_|j||||	�|j�dS(Ntlinears,Images are not supported on non-linear axes.s4Image will not be shown correctly with this backend.(tget_visibleRt
get_xscalet
get_yscaletwarningstwarnRRtnew_gctset_clip_rectangletfrozent
set_clip_patht
get_clip_pathR�R�R,R$R?tget_image_magnificationR�R�R�trestore(
RR�targsR5tlR�twidthDisplayt
heightDisplayR�Ro((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pytdrawPs&c	C s�t|j�r|j||�S|j|j}}|j�\}}}}||krf||}}n||kr�||}}n|dk	r�|dk	r�||ko�||ko�||ko�||k}nt}|ifS(sH
        Test whether the mouse event occured within the image.
        N(tcallablet	_containstxdatatydataR�R$RS(	Rt
mouseeventRptyR]R^R_R`tinside((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pytcontainsis3c	C s�|j�}|dkrdS|r^|j�\}}|j�|jd�|j||�n|j�|j�\}}}tj	||||�dS(s&Write the image to png file with fnameNi(
R?R$R9R�R)R�t
flipud_outtas_rgba_strt_pngt	write_png(	RtfnametnoscaleRoReRftrowstcolstbuffer((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyR��s


cC s�t|d�r!t|�|_ntj|�|_|jjtjkrstj|jjtj	�rst
d��n|jjd	ks�|jjdkr�|jjdd
kr�t
d��nd|_d|_d|_d|_dS(sI
        Set the image array

        ACCEPTS: numpy/PIL Image A
        tgetpixels#Image data can not convert to floatiii����is!Invalid dimensions for image dataN(ii(ii(thasattrtpil_to_arrayR6tcbooktsafe_masked_invalidRMRNROtcan_casttfloatt	TypeErrortndimR8R$R+R<RKRL(RRZ((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pytset_data�s1(			cC s|j|�dS(sq
        retained for backwards compatibility - use set_data instead

        ACCEPTS: numpy array A or PIL ImageN(R�(RRZ((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyt	set_array�s	cC s|jS(s
        Return the interpolation method the image uses when resizing.

        One of 'nearest', 'bilinear', 'bicubic', 'spline16', 'spline36', 'hanning',
        'hamming', 'hermite', 'kaiser', 'quadric', 'catrom', 'gaussian',
        'bessel', 'mitchell', 'sinc', 'lanczos',
        (t_interpolation(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pytget_interpolation�scC sP|dkrtd}n|j�}||jkrCtd��n||_dS(s?
        Set the interpolation method the image uses when resizing.

        ACCEPTS: ['nearest' | 'bilinear' | 'bicubic' | 'spline16' |
          'spline36' | 'hanning' | 'hamming' | 'hermite' | 'kaiser' |
          'quadric' | 'catrom' | 'gaussian' | 'bessel' | 'mitchell' |
          'sinc' | 'lanczos' | ]

        simage.interpolationsIllegal interpolation stringN(R$Rtlowert_interpdt
ValueErrorR�(Rts((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyR)�s

cC s&|dkrtd}n||_dS(sZ
        set whether or not image resampling is used

        ACCEPTS: True|False
        simage.resampleN(R$Rt	_resample(Rtv((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyR*�s
cC s|jS(s!return the image resample boolean(R�(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pytget_resample�scC s|rd|_n	d|_dS(sy
        Set whether the resize filter norms the weights -- see
        help for imshow

        ACCEPTS: 0 or 1
        iiN(t_filternorm(RR2((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyR&�scC s|jS(sreturn the filternorm setting(R�(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pytget_filternorm�scC st|�}||_dS(s�
        Set the resize filter radius only applicable to some
        interpolation schemes -- see help for imshow

        ACCEPTS: positive float
        N(R�R((RR3tr((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyR'�scC s|jS(sreturn the filterrad setting(R((R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyt
get_filterrad�sN(8t__name__t
__module__tzorderRQtNEARESTtBILINEARtBICUBICtSPLINE16tSPLINE36tHANNINGtHAMMINGtHERMITEtKAISERtQUADRICtCATROMtGAUSSIANtBESSELtMITCHELLtSINCtLANCZOStBLACKMANR�tdicttitemstkR�t	_interpdrtkeystinterpnamesRR$RSR!R9R:R=R?RqtstaticmethodR�R�R�RR�R�R�R�R�R�R)R*R�R&R�R'R�(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyRsd
















1	(		
			R	O				
	
							t	AxesImagec	B sYeZd�Zd	d	d	d	d	dded�Zdd�Zd�Zd�Zd�Z	RS(
cC sdt|jjj�S(NsAxesImage(%g,%g;%gx%g)(RRRR(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyR�sig@c
K sJ||_tj||d|d|d|d|d|d|d|	|
�dS(	s�
        interpolation and cmap default to their rc settings

        cmap is a colors.Colormap instance
        norm is a colors.Normalize instance to map luminance to 0-1

        extent is data axes (left, right, bottom, top) for making image plots
        registered with data plots.  Default is to label the pixel
        centers with the zero-based row and column indices.

        Additional kwargs are matplotlib.artist properties

        R/R0R1R%R2R3R4N(t_extentRR!(RR.R/R0R1R%textentR2R3R4R5((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyR!�s	g�?c"C s�|jdkrtd��n|j�\}}}}|j�}|jtj||f||fg��}|d\}}	|d\}
}tj	|j
j|�}|j|j||
|	|g|�\}
}}}}}}|j
j
j�}tjj|d�}|
j|�|
j�|
j�\}}|dksE|dkrIdS|
j|j|j�|
j|j�|dkr�d}n||j||}|dkr�d}n||j||}|
j||�|j
jj\}}}}t||�dt||�d}t||�dt||�d}||} ||}!|
j | ||!|�|
j!t"|d�t"|d�d|j#d|j$�|
S(Ns9You must first set the image array or the image attributeiigg�?R0tradius(%R6R$R7R�R�R�RNR�RrtTransformedBboxRtviewLimRqR�R�R�R�RUR�R�R9R)R�R�R*R�RCRItapply_translationRR�troundt
apply_scalingR�RER�R(("RR>RFR{RJR|R�R�t_x1t_y1t_x2t_y2ttransformed_viewLimRoR]R_RaRbRcRdR�R�ReRfttxttyR�R�R�ttR�R�trxtry((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyR?'sJ	

		&&

#cC s*|j�r"|j�dkr"tStSdS(sK
        return True if the image is better to be drawn unsampled.
        RN(toption_scale_imageR�tTrueRS(RR�((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyR�ascC s�||_|\}}}}||f||ff}|jj|�|jjrn|jj||fdd�n|jjr�|jj||fdd�ndS(sc
        extent is data axes (left, right, bottom, top) for making image plots

        This updates ax.dataLim, and, if autoscaling, sets viewLim
        to tightly fit the image, regardless of dataLim.  Autoscaling
        state is not changed, so following this with ax.autoscale_view
        will redo the autoscaling in accord with dataLim.

        tautoN(RRtupdate_datalimt
_autoscaleXontset_xlimR$t
_autoscaleYontset_ylim(RRR]R^R_R`tcorners((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyt
set_extentjs
	cC sq|jdk	r|jS|j�}|\}}|jdkrUd|d|ddfSd|dd|dfSdS(s.get the image extent: left, right, bottom, topR@g�g�?N(RR$R9R%(RtszReRf((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyR�~sN(
R�R�RR$RSR!R?R�R.R�(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyR�s	 :			tNonUniformImagecB sneZd�Zd�Zdd�Zd�Zd�Zd�Zd�Zd�Z	d	�Z
d
�Zd�ZRS(cK s6|jdd�}tj|||�|j|�dS(sx
        kwargs are identical to those for AxesImage, except
        that 'interpolation' defaults to 'nearest'
        R1RN(tpopRR!R)(RR.R5tinterp((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyR!�scC stS(s;
        return False. Do not use unsampled image.
        (RS(RR�((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyR��sg�?cC s0|jdkrtd��n|jjj\}}}}|jjj\}}}}	t|�dt|�d}
t|	�dt|�d}|
|9}
||9}t	j
|j|j|j||
||||||f|j
|j�}|jjj�}
tjj|
d�}|j|�|j|_|S(Ns"You must first set the image arrayg�?i(R6R$R7RRRRR�RRQtpcolort_Axt_AyR�R�R�R�R�R�RUR�RT(RR>RCRItv_widthtv_heightR�R�R�R"RARBRoR�R�((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyR?�s"


c
C s�tj|tj�}tj|tj�}tj|�}t|j�dks�t|j�dks�|jdd!|jd|jdfkr�td��nt|j�dkr�td��nt|j�dkr�|jddkr�td��nt|j�dkr5|jddkr5|jdd!|_nt|j�dkr�|jtj	kr�|j
|j|��d	jtj	�}|j
j
�|_q�tj|d
d
�d
d
�tjfdd�}d	|d
d
�d
d
�df<t|_n�|jtj	kr d	|jtj	�}n|jddkr�ttt|jdd!�dg�tj	�}||d
d
�d
d
�dd�f<d	|d
d
�d
d
�df<|}nt|_||_||_||_d
|_d
|_d
|_d
S(
sT
        Set the grid for the pixel centers, and the pixel values.

          *x* and *y* are 1-D ndarrays of lengths N and M, respectively,
             specifying pixel centers

          *A* is an (M,N) ndarray or masked array of values to be
            colormapped, or a (M,N,3) RGB array, or a (M,N,4) RGBA
            array.
        iiisAxes don't match array shapeisCan only plot 2D or 3D datais?3D arrays must have three (RGB) or four (RGBA) color componentsi�N(ii(iii(RNtasarraytfloat32R�R�RPR8R�RMROR/R0tastypeRXRTtrepeattnewaxisR&tzerosRtlistRSR6R4R5R$R+RKRL(RRpR�RZtB((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyR��sB**(((1/%							cG std��dS(NsMethod not supported(tNotImplementedError(RR�((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyR��scC s;|dkr'|dkr'td��ntj||�dS(NRR	s?Only nearest neighbor and bilinear interpolations are supported(snearestsbilinear(R$R@RR)(RR�((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyR)�scC sJ|jdkrtd��n|jd|jd|jd|jdfS(NsMust set data firstii����(R6R$R7R4R5(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyR��scC sdS(N((RR�((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyR&�scC sdS(N((RR�((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyR'�scC s5|jdk	rtd��ntjj||�dS(Ns'Cannot change colors after loading data(R6R$R7R"R#tset_norm(RR0((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyRA�scC s5|jdk	rtd��ntjj||�dS(Ns'Cannot change colors after loading data(R6R$R7R"R#tset_cmap(RR/((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyRB�s(
R�R�R!R�R?R�R�R)R�R&R'RARB(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyR0�s	
		4						tPcolorImagecB s\eZdZdddddd�Zdd�Zed��Zd�Zd�Z	d�Z
RS(	s�
    Make a pcolor-style plot with an irregular rectangular grid.

    This uses a variation of the original irregular image code,
    and it is used by pcolorfast for the corresponding grid type.
    cK s\tjj|�tjj|||�||_d|_|j|�|j	|||�dS(s�
        cmap defaults to its rc setting

        cmap is a colors.Colormap instance
        norm is a colors.Normalize instance to map luminance to 0-1

        Additional kwargs are matplotlib.artist properties

        N(
RR R!R"R#RR$R<R-R�(RR.RpR�RZR/R0R5((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyR!
s		
g�?c

C s�|jdkrtd��n|jjj�}tjj|d�}t	j
|�djt	j�}|jj
j\}}}}t|�dt|�d}t|�dt|�d}	||}|	|}	|jd�r2|j|jd|jdt�}
|
|_|jjdkr;|jj�|_q;n	|j}
|jj}tj|j|j|
|	||j|j|j|j f|�}|j|_|S(	Ns"You must first set the image arrayii�g�?R�R;tbytesi(!R6R$R7RR�R�R�R�RURNR�R:RORR�Rtcheck_updateRVR&R<R�R/RXRTRRQtpcolor2R4R5RCRFRIRJ(
RR>R�R�R�R�R�R"RARBRZtvlRo((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyR?"s0

!			cO s�|j�sdS|j|j��}|j�}|j|jjj��|j|j	��|j
|t|jjj�t|jjj
�|�|j�dS(N(R�R?R�R�R�RRR�R�R�R�RR]R_R�(RR�R�R5RoR�((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyR�=s	cC sMtj|�}|dkrDtjd|jdddtj�}ntj|tj�j�}|dkr�tjd|jdddtj�}ntj|tj�j�}|jd |j	d|j	dfkr�|jGH|j	GH|j	GHt
d��n|jdkrt
d��n|jdkrP|jddkrP|jd |_nt|_
|jdkr!|jddkr|dd�dd�df|dd�dd�dfkj�r|dd�dd�df|dd�dd�dfkj�rt|_
qq!t
d	��n||_||_||_t|jd
<dS(
NiiRMisAxes don't match array shapeisA must be 2D or 3Dis+3D arrays must have RGB or RGBA as last dimR�(ii(ii(R�R�R$RNtarangeR8tfloat64R8traveltsizeR�R�RSRTtallR&R6R4R5tupdate_dict(RRpR�RZ((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyR�Ks4))'"	�			cG std��dS(NsMethod not supported(R@(RR�((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyR�kscC s$tjj||�t|jd<dS(sw
        Set the alpha value used for blending - not supported on
        all backends

        ACCEPTS: float
        R�N(RR R:R&RM(RR;((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyR:nsN(R�R�t__doc__R$R!R?RR�R�R�R:(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyRCs	 	tFigureImagecB sweZdZdddddd�Zd�Zd�Zd�Zd�Zd�Z	dd�Z
ed	��Zd
�Z
RS(icK s}tjj|�tjj|||�|dkr?td}n||_||_||_	||_
|j|�d|_dS(s�
        cmap is a colors.Colormap instance
        norm is a colors.Normalize instance to map luminance to 0-1

        kwargs are an optional list of Artist keyword args
        simage.origing�?N(
RR R!R"R#R$RR%tfiguretoxtoyR-R>(RtfigR/R0toffsetxtoffsetyR%R5((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyR!zs
				
c	C s�t|j�r|j||�S|j�\}}}}|j|j}}|dk	r�|dk	r�||ko�||ko�||ko�||k}nt}|ifS(s?Test whether the mouse event occured within the image.
        N(R�R�R�RpR�R$RS(	RR�R]R^R_R`R�R�R�((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyR��s3cC s,|jdkrtd��n|jjd S(s+Get the numrows, numcols of the input images"You must first set the image arrayiN(R6R$R7R8(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyR9�scC sF|j�\}}d|j|d|jd|j|d|jfS(s.get the image extent: left, right, bottom, topg�g�?(R9RQRR(RReRf((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyR��scC s tjj|tj|��dS(s&
        Set the image array

        N(R"R#R�R�R�(RRZ((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyR��scC s|j|�dS(sR
        Deprecated; use set_data for consistency with other image types.
        N(R�(RRZ((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyR��sg�?c	C s9|jdkrtd��n|j|j|j�}||_|dk}|rZd}nd}tj||�}|jj	�}|j
tjj|d��|j
jdko�t|jj�dk|_|r|j�\}}||9}||9}|jtj�|j||�n|jdkr5|j�n|S(Ns"You must first set the image arrayiitgrayiR@(R6R$R7RURVR>RQRWRPR�R�R�R�R/tnameRPR8RTR9R)R�R�R%R�(	RR>RptismagtisoutputRoR�ReRf((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyR?�s,		


cO s�|j�sdS|j|j��}|j�}|j|jj�|j|j��|j	|t
|j�t
|j�|�|j
�dS(N(R�R?R�R�R�RPRR�R�R�RRQRRR�(RR�R�R5RoR�((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyR��s(cC s;|j�}|j�\}}}tj||||�dS(s&Write the image to png file with fnameN(R?R�R�R�(RR�RoR�R�R�((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyR��sN(R�R�R�R$R!R�R9R�R�R�R?RR�R�(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyROxs					t	BboxImagecB seeZdZd
d
d
d
dded�Zd
d�Zd�Zd�Zdd�Z	e
d	��ZRS(sE
    The Image class whose size is determined by the given bbox.
    ig@c	
K sMtj|dd	d|d|d|d|d|d|d||	�||_d	S(
s�
        cmap is a colors.Colormap instance
        norm is a colors.Normalize instance to map luminance to 0-1

        kwargs are an optional list of Artist keyword args
        R.R/R0R1R%R2R3R4N(RR!R$R(
RRR/R0R1R%R2R3R4R5((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyR!�scC sc|dkr|j�j}nt|jt�r7|jSt|j�rS|j|�Std��dS(Nsunknown type of bbox(R$t
get_figuret_cachedRenderert
isinstanceRRR�R�(RR�((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pytget_window_extents
cC sjt|j�r|j||�S|j�s5tifS|j|j}}|j�j||�}|ifS(s?Test whether the mouse event occured within the image.
        (R�R�R�RSRpR�R^R�(RR�RpR�R�((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyR�s
cC s,|jdkrtd��n|jjd S(s+Get the numrows, numcols of the input images"You must first set the image arrayiN(R6R$R7R8(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyR9(sg�?cC s;|jdkrtd��n|jdkr'|jjtjkr{t|jj�dkr{t	j
|jd�}t|_n�|j
dkr�|j|j|j�}||_
n	|j
}t	j|d�}t|jj�dkr�|jj�|_n	t|_||_|jdkr0|j�q0n	|j}|j�|j|j|j�|j|j�|j|�j\}}}}t|�dt|�d}	t|�dt|�d}
|	|9}	|
|9}
|jjd \}}|	|}
|
|}|j|
|�|jt |	�t |
�d|j!d|j"�|S(	Ns9You must first set the image array or the image attributeiiiR@g�?R0R(#R6R$R7R+RMRNRORPR8RQRRRSRTR<RURVRWR/RXR%RYR�R)R�R�R*R�R^R�RRR�RER�R((RR�R>RoRpR�R�R�R"R�R�ReRfR#R$((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyR?/sB-				




cO s�|j�sdS|j�}|j||�}|j|�j\}}}}	|j�}
|j|
�|j|
t|�t|�|�|
j	�dS(N(
R�R�R?R^R�R�t_set_gc_clipR�RR�(RR�R�R5t	image_magRoR�R�R�R"R�((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyR�ds
"N(R�R�RNR$RSR!R^R�R9R?RR�(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyRZ�s		5c s��fd�}itjd6}|dkrntj��retjj��\}}|j�d}qtd}n|}||j	�kr�|�}|dkr�t
d|j	���n|S||}tj��r�t�d��n|��S(s�
    Return image file in *fname* as :class:`numpy.array`.  *fname* may
    be a string path or a Python file-like object.

    If *format* is provided, will try to read file of that type,
    otherwise the format is deduced from the filename.  If nothing can
    be deduced, PNG is tried.

    Return value is a :class:`numpy.array`.  For grayscale images, the
    return array is MxN.  For RGB images, the return value is MxNx3.
    For RGBA images the return value is MxNx4.

    matplotlib can only read PNGs natively, but if `PIL
    <http://www.pythonware.com/products/pil/>`_ is installed, it will
    use it to load the image and return an array (if possible) which
    can be used with :func:`~matplotlib.pyplot.imshow`.
    c s>yddl}Wntk
r$dSX|j��}t|�S(s-try to load the image with PIL or return Nonei����N(tImagetImportErrorR$topenR�(Ratimage(R�(sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pytpilread�s
tpngis\Only know how to handle extensions: %s; with PIL installed matplotlib can handle more imagestrbN(R�tread_pngR$R�tis_string_liketostpathtsplitextR�RR�Rc(R�tformatRethandlerstbasenametextRothandler((R�sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pytimreadss"		
idc
C s�ddlm}ddlm}	g|jddd�D]}
|
t|�^q7}|	d|d|dt�}||�}
|j|d|d	|d
|d|�}|j|d|d|�dS(
s
    Saves a 2D :class:`numpy.array` as an image with one pixel per element.
    The output formats available depend on the backend being used.

    Arguments:
      *fname*:
        A string containing a path to a filename, or a Python file-like object.
        If *format* is *None* and *fname* is a string, the output
        format is deduced from the extension of the filename.
      *arr*:
        A 2D array.
    Keyword arguments:
      *vmin*/*vmax*: [ None | scalar ]
        *vmin* and *vmax* set the color scaling for the image by fixing the
        values that map to the colormap color limits. If either *vmin* or *vmax*
        is None, that limit is determined from the *arr* min/max value.
      *cmap*:
        cmap is a colors.Colormap instance, eg cm.jet.
        If None, default to the rc image.cmap value.
      *format*:
        One of the file extensions supported by the active
        backend.  Most backends support png, pdf, ps, eps and svg.
      *origin*
        [ 'upper' | 'lower' ] Indicates where the [0,0] index of
        the array is in the upper left or lower left corner of
        the axes. Defaults to the rc image.origin value.
      *dpi*
        The DPI to store in the metadata of the file.  This does not affect the
        resolution of the output image.
    i����(tFigureCanvasAgg(tFigureNtfigsizetdpitframeonR/tvmintvmaxR%Rm(	tmatplotlib.backends.backend_aggRstmatplotlib.figureRtR8R�RStfigimagetsavefig(R�tarrRxRyR/RmR%RvtFigureCanvasRtRpRuRStcanvasRo((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pytimsave�s 3'cC sd�}|jdkr!|}n�|jdkrc|}||�}|jd|jdf|_|S|jdkr�|}||�}|jd|jddf|_|Sy|jd�}Wntk
r�td	��nX||�}|jd|jdd
f|_|S(s�
    load a PIL image and return it as a numpy array of uint8.  For
    grayscale images, the return array is MxN.  For RGB images, the
    return value is MxNx3.  For RGBA images the return value is MxNx4
    cS s4|jd|jdd�}tj|tj�}|S(sreturn a 1D array of floatstrawii����(ttostringtmodeRNt
fromstringRO(Rotx_strRp((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyttoarray�stRGBAtRGBXtLiitRGBisUnknown image modei(R�R�(R�RKR8tconvertR�R7(tpilImageR�RoRp((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyR��s(		 
 g�������?R	c
C s�tjj|�\}}tjj|�\}}t|�}	|	j\}
}}d}
t|
�|
|}t|�|
|}|j�}|r�ddlj	}|j
d||fd|
�}n�|dkr�ddlm}nJ|dkr�dd	l
m}n+|d
krddlm}ntd��dd
lm}|d||fd|
�}||�}|jddddgdddtdgdg�}tjj|�\}}|j|	dddtdd�|j|d|
�|S(s�
    make a thumbnail of image in *infile* with output filename
    *thumbfile*.

      *infile* the image file -- must be PNG or PIL readable if you
         have `PIL <http://www.pythonware.com/products/pil/>`_ installed

      *thumbfile*
        the thumbnail filename

      *scale*
        the scale factor for the thumbnail

      *interpolation*
        the interpolation scheme used in the resampling


      *preview*
        if True, the default backend (presumably a user interface
        backend) will be used which will cause a figure to be raised
        if :func:`~matplotlib.pyplot.show` is called.  If it is False,
        a pure image backend will be used depending on the extension,
        'png'->FigureCanvasAgg, 'pdf'->FigureCanvasPDF,
        'svg'->FigureCanvasSVG


    See examples/misc/image_thumbnail.py.

    .. htmlonly::

        :ref:`misc-image_thumbnail`

    Return value is the figure instance containing the thumbnail

    idi����NRuRvs.png(Rss.pdf(tFigureCanvasPDFs.svg(tFigureCanvasSVGs0Can only handle extensions 'png', 'svg' or 'pdf'(RtiitaspectR'RwtxtickstyticksR4R1R	(RjRktsplitRlRrR8R�R�tmatplotlib.pyplottpyplotRPRzRstmatplotlib.backends.backend_pdfR�tmatplotlib.backends.backend_svgR�R�R{Rttadd_axesRStimshowR&R}(tinfilet	thumbfiletscaleR1tpreviewtbasedirRotbaseouttextoutRoR�R�tdepthRvRBRAt	extensiontpltRSRRtR�R.Rp((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyt	thumbnail�s4&!3(,RNt
__future__RRjR�tnumpyRNRt
matplotlibRtmatplotlib.artisttartistRRtmatplotlib.colorstcolorsR�t
matplotlib.cmR"tmatplotlib.cbookR�tmatplotlib._imageRQtmatplotlib._pngR�tmatplotlib.transformsRRt
transformsRrR R#RRR0RCRORZR$RrR�R�RSR�(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/image.pyt<module>s8
���vus�5)	&