
56ic           @  s  d  d l  m Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d e	 f d     YZ
 d e	 f d     YZ e   a d   Z d e j j j f d	     YZ d
 e f d     YZ d e f d     YZ d e f d     YZ d e f d     YZ d e f d     YZ d e f d     YZ d e f d     YZ d e f d     YZ i  Z d   Z e d d  Z d e f d     YZ d e f d      YZ d! e f d"     YZ d# e f d$     YZ  d% e! f d&     YZ" d' d( d) f d*  Z# d+ d, d- f d' d( d) f d.  Z$ d/   Z% d0   Z& d1 e f d2     YZ' d3 e f d4     YZ( e) d5  Z* d6   Z+ d7   Z, d8   Z- d S(9   i(   t   print_functionNt
   CacheEntryc           B  s   e  Z d    Z RS(   c         C  s>   | |  _  | |  _ | j   \ } } | | |  _ d |  _ d  S(   Ni    (   t   whatt   surft   get_sizet   sizet   time(   t   selfR   R   t   wt   h(    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyt   __init__'   s
    		(   t   __name__t
   __module__R
   (    (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR   %   s   t   Cachec           B  s   e  Z d    Z d   Z d   Z d   Z d   Z d   Z e e d  Z	 d   Z
 d   Z d	   Z d
   Z d   Z d   Z d   Z RS(   c         C  s   d |  _  i  |  _ g  |  _ t |  _ d |  _ d |  _ t j   |  _	 t j   |  _
 t |  _ i  |  _ t   |  _ d |  _ t j d |  j d d  |  _ |  j j t  |  j j   t   |  _ g  |  _ d  S(   Ni    t   targett   namet	   preloader(   R   t   cachet   preloadst   Truet   first_preload_in_tickt   size_of_current_generationt   total_cache_sizet	   threadingt	   Conditiont   lockt   preload_lockt   keep_preloadingt	   pin_cachet   sett   preload_blacklistt   cache_limitt   Threadt   preload_thread_maint   preload_threadt	   setDaemont   startt   addedt   load_log(   R   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR
   <   s"    										c         C  s'   t  j j t  j j t  j j |  _ d S(   st   
        Updates the cache object to make use of settings that might be provided
        by the game-maker.
        N(   t   renpyt   configt   image_cache_sizet   screen_widtht   screen_heightR   (   R   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyt   initu   s    c         C  sT   |  j  j   s d  S|  j  t |  _ |  j j   Wd  QX|  j  j   |  j   d  S(   N(   R"   t   isAliveR   t   FalseR   t   notifyt   joint   clear(   R   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyt   quit}   s    
	c         C  sa   |  j  j   g  |  _ i  |  _ i  |  _ t |  _ d |  _ d |  _ |  j	 j
   |  j  j   d  S(   Ni    (   R   t   acquireR   R   R   R   R   R   R   R%   R1   t   release(   R   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR1      s    						c         C  s   |  j  < |  j d 7_ g  |  _ t |  _ d |  _ |  j j   Wd  QXt j	 j
 r t j j j d  t j j   \ } } t j j j d | |  n  d  S(   Ni   i    s   ----s   %s %d(   R   R   R   R   R   R   R%   R1   R'   R(   t   debug_image_cachet   displayt   ic_logt   writet   exportst   get_filename_line(   R   t   filenamet   line(    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyt   tick   s    
			c         C  s   g  |  _  d  S(   N(   R   (   R   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyt   end_tick   s    c      
   C  s  t  | t  s, t d t |  d   n  | j sX | j   } t j j j	 |  | S|  j j
 | d   } | d  k ry` | |  j k r |  j | } n= | s t j j d |   | j   } Wd  QXn | j   } Wn
   n X|  j  t | |  } | |  j k r#|  j | j 7_ n  | |  j | <t j j j	 | j  t j j r| rt j j j d | j d |  j |  j  qt j j j d | j  n  Wd  QXn  | j |  j k r|  j | _ |  j | j 7_ n  | j S(   Ns'   Expected an image of some sort, but gott   .s   While loading %r:s   Added %r (%.02f%%)g      Y@s   Total Miss %r(   t
   isinstancet	   ImageBaset	   Exceptiont   strR   t   loadR'   R6   t   rendert   mutated_surfacet   gett   NoneR   t   gamet   ExceptionInfoR   R   R   R   R   R(   R5   R7   R8   R   R   R   R   (   R   t   imaget   predictt   textureR   t   ce(    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyRG      s>    	
-%c         C  s   | j  |  j  k r' |  j | j 8_ n  t j j j | j  |  j | j 8_ |  j	 | j
 =t j j r t j j j d | j
  n  d  S(   Ns
   Removed %r(   R   R   R   R'   R6   t   drawRF   R   R   R   R   R(   R5   R7   R8   (   R   RN   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyt   kill   s    c         C  s|   |  j  |  j k r t Sx_ t |  j j   d d   D]? } | j |  j k rQ t S|  j |  |  j  |  j k r5 Pq5 q5 Wt S(   s   
        Cleans out the cache, if it's gotten too large. Returns True
        if the cache is smaller than the size limit, or False if it's
        bigger and we don't want to continue preloading.
        t   keyc         S  s   |  j  S(   N(   R   (   t   a(    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyt   <lambda>  s    (	   R   R   R   t   sortedR   t
   itervaluesR   R.   RP   (   R   RN   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyt   cleanout   s    %c         C  s,   |  j  | d t } t j j j |  d S(   si   
        Preloads `im` into the cache, and loads the corresponding texture
        into the GPU.
        RL   N(   RG   R   R'   R6   RO   t   load_texture(   R   t   imR   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyt   preload_texture  s    c         C  s   t  | t  s d  S|  j c | |  j k r0 d  S|  j j |  | |  j k re |  j |  t } n |  j j	 |  t
 } Wd  QX| s |  j  |  j j   Wd  QXn  | r t j j r t j j j d |  n  d  S(   Ns   Kept %r(   R@   RA   R   R%   t   addR   RY   R   R   t   appendR.   R   R/   R'   R(   R5   R6   R7   R8   (   R   RX   t   in_cache(    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyt   preload_image%  s     
	
c         C  s!   |  j   |  j  j   Wd QXd S(   s|   
        Called at the start of prediction, to ensure the thread runs
        at least once to clean out the cache.
        N(   R   R/   (   R   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyt   start_prediction@  s    
c         C  s"  x|  j  r|  j j   |  j j   |  j j   x |  j r
|  j  r
|  j W |  j   s t j	 j
 r x* |  j D] } t j j j d |  qt Wn  g  |  _ Pn  Wd  QXyS |  j j d  } | |  j k r y |  j |  Wq |  j j |  q Xn  Wq6 q6 Xq6 W|  j  |  j   Wd  QX|  j  r t j j r t t j j  } xJ |  j j   D]9 } | | k r| j |  q]|  j | } |  j | =q]Wx} | D]r } | |  j k rqn  |  j rPn  y0 | j   } | |  j | <t j j j |  Wq|  j j |  qXqWq q Wd  S(   Ns   Overfull %ri    (   R   R   R3   t   waitR4   R   R   RV   R'   R(   R5   R6   R7   R8   t   popR   RY   RZ   RI   t   less_memoryR   t   storet   _cache_pin_setR   t   keyst   removeRD   RO   RW   (   R   t   iRK   t   worksetR   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR!   I  sR    
	

	c         C  st   t  j j s d  St j   |  j k } |  j j d t j   | | f  x& t	 |  j  d k ro |  j j
   qJ Wd  S(   Ni    id   (   R'   R(   t	   developerR   t   current_threadR"   R&   t   insertR   t   lenR`   (   R   R;   t   preload(    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyt   add_load_log  s    "(   R   R   R
   R,   R2   R1   R=   R>   R.   RG   RP   RV   RY   R]   R^   R!   Rm   (    (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR   :   s   	9					<			
				Hc           C  s   t  j j j   t j   d S(   s   
    Frees some memory.
    N(   R'   R6   RO   t   free_memoryR   R1   (    (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyRn     s    RA   c           B  se   e  Z d  Z d Z d   Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 d	   Z d
   Z RS(   sf   
    This is the base class for all of the various kinds of images that
    we can possibly have.
    i   c         C  s   | d k  r t  |  _ n  d  S(   Ni   (   R   R   (   R   t   version(    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyt   after_upgrade  s    c         O  sm   | j  d d   |  _ | j  d t  |  _ | j d d  t t |   j |   t	 |   j
 f | |  _ d  S(   Nt   rleR   t   styleRK   (   R`   RH   Rq   R   R   t
   setdefaultt   superRA   R
   t   typeR   t   identity(   R   t   argst
   properties(    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR
     s
    c         C  s   t  |  j  S(   N(   t   hashRv   (   R   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyt   __hash__  s    c         C  s#   t  | t  s t S|  j | j k S(   N(   R@   RA   R.   Rv   (   R   t   other(    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyt   __eq__  s    c         C  s1   d d j  g  |  j D] } t |  ^ q  d S(   Nt   <t    t   >(   R0   Rv   t   repr(   R   Rf   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyt   __repr__  s    c         C  s   t  d   d S(   s   
        This function is called by the image cache code to cause this
        image to be loaded. It's expected that children of this class
        would override this.
        s   load method not implemented.N(   RB   (   R   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyRD     s    c         C  sb   t  j |   } t j j j |  } | j   \ } } t j j j | |  } | j	 | d  | S(   Ni    (   i    i    (
   R   RG   R'   R6   RO   RW   R   RE   t   Rendert   blit(   R   R   R	   t   stt   atRX   RM   t   rv(    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyRE     s    c         C  s   t  j j j |   d  S(   N(   R'   R6   RL   RK   (   R   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyt   predict_one  s    c         C  s   g  S(   so   
        Returns a list of files that will be accessed when this image
        operation is performed.
        (    (   R   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyt   predict_files  s    (   R   R   t   __doc__t   __version__Rp   R
   Rz   R|   R   RD   RE   R   R   (    (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyRA     s   		
						
	t   Imagec           B  s>   e  Z d  Z d   Z d   Z d   Z e d  Z d   Z RS(   s<   
    This image manipulator loads an image from a file.
    c         K  s&   t  t |   j | |  | |  _ d S(   sS   
        @param filename: The filename that the image will be loaded from.
        N(   Rt   R   R
   R;   (   R   R;   Rx   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR
     s    c         C  s3   t  |  j  d k  r  d |  j Sd |  j d Sd  S(   Ni   u   Image %ru   Image …%si(   Rk   R;   (   R   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyt   __unicode__  s    c         C  s   t  j j |  j  S(   N(   R'   t   loadert   get_hashR;   (   R   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR      s    c         C  s   t  j |  j  ye | rF t j j j t j j |  j  |  j  } n* t j j j	 t j j |  j  |  j  } | SWnV t
 k
 r } t j j r t j j |  j  } | d  k r |  n  | j   S  n Xd  S(   N(   R   Rm   R;   R'   R6   t   pgrendert   load_image_unscaledR   RD   t
   load_imageRB   R(   t   missing_image_callbackRH   (   R   t   unscaledR   t   eRX   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyRD     s    -*	
c         C  sg   t  j j |  j  r |  j g St  j j rY t  j j |  j  } | d  k	 rY | j   Sn  |  j g Sd  S(   N(   R'   R   t   loadableR;   R(   R   RH   R   (   R   RX   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR     s    
(	   R   R   R   R
   R   R   R.   RD   R   (    (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR     s   			t   ZipFileImagec           B  s&   e  Z d  d  Z d   Z d   Z RS(   i    c         K  s5   t  t |   j | | | |  | |  _ | |  _ d  S(   N(   Rt   R   R
   t   zipfilenameR;   (   R   R   R;   t   mtimeRx   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR
   *  s    	c         C  s   yc t  j |  j d  } | j |  j  } t j |  } t j j	 j
 | |  j  } | j   | SWn t j j	 j d t  SXd  S(   Nt   ri   (   i   i   (   t   zipfilet   ZipFileR   t   readR;   t	   cStringIOt   StringIOR'   R6   R   R   t   closet   surfaceR   (   R   t   zft   datat   sioR   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyRD   0  s    
c         C  s   g  S(   N(    (   R   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR   ;  s    (   R   R   R
   RD   R   (    (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR   (  s   	t	   Compositec           B  s2   e  Z d  Z d   Z d   Z d   Z d   Z RS(   s  
    :doc: im_im

    This image manipulator composites multiple images together to
    form a single image.

    The `size` should be a (width, height) tuple giving the size
    of the composed image.

    The remaining positional arguments are interpreted as groups of
    two. The first argument in a group should be an (x, y) tuple,
    while the second should be an image manipulator. The image
    produced by the image manipulator is composited at the location
    given by the tuple.

    ::

        image girl clothed happy = im.Composite(
            (300, 600),
            (0, 0), "girl_body.png",
            (0, 0), "girl_clothes.png",
            (100, 100), "girl_happy.png"
            )

    c         O  s   t  t |   j | | |  t |  d d k rA t d   n  | |  _ | d d  d  |  _ g  | d d  d  D] } t |  ^ qt |  _ d  S(   Ni   i    s.   Composite requires an odd number of arguments.i   (	   Rt   R   R
   Rk   RB   R   t	   positionsRK   t   images(   R   R   Rw   Rx   Rf   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR
   Z  s    	c         C  s.   d } x! |  j  D] } | | j   7} q W| S(   Ni    (   R   R   (   R   R   Rf   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR   e  s    c         C  s   |  j  r |  j  } n t j |  j d  j   } t j j j | t	  } x< t
 |  j |  j  D]% \ } } | j t j |  |  q_ W| S(   Ni    (   R   R   RG   R   R   R'   R6   R   R   R   t   zipR   R   (   R   R   R   t   posRX   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyRD   m  s    	"c         C  s1   g  } x$ |  j  D] } | j | j    q W| S(   N(   R   t   extendR   (   R   R   Rf   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR   {  s    (   R   R   R   R
   R   RD   R   (    (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR   ?  s
   			t   Scalec           B  s5   e  Z d  Z e d  Z d   Z d   Z d   Z RS(   s?  
    :doc: im_im

    An image manipulator that scales `im` (an image manipulator) to
    `width` and `height`.

    If `bilinear` is true, then bilinear interpolation is used for
    the scaling. Otherwise, nearest neighbor interpolation is used.

    ::

        image logo scale = im.Scale("logo.png", 100, 150)
    c         K  sb   t  |  } t t |   j | | | | |  | |  _  t |  |  _ t |  |  _ | |  _ d  S(   N(   RK   Rt   R   R
   t   intt   widtht   heightt   bilinear(   R   RX   R   R   R   Rx   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR
     s    "	c         C  s   |  j  j   S(   N(   RK   R   (   R   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR     s    c         C  s   t  j |  j  } |  j rp z; t j j j j   t j j	 j
 | |  j |  j f  } Wd  t j j j j   XnR z; t j j j j   t j j j | |  j |  j f  } Wd  t j j j j   X| S(   N(   R   RG   RK   R   R'   R6   RE   t	   blit_lockR3   t   scalet   smoothscaleR   R   R4   R   t   transform_scale(   R   t   childR   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyRD     s    	((c         C  s   |  j  j   S(   N(   RK   R   (   R   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR     s    (   R   R   R   R   R
   R   RD   R   (    (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR     s
   
		t   FactorScalec           B  s8   e  Z d  Z d e d  Z d   Z d   Z d   Z RS(   s  
    :doc: im_im

    An image manipulator that scales `im` (a second image manipulator)
    to `width` times its original `width`, and `height` times its
    original height. If `height` is omitted, it defaults to `width`.

    If `bilinear` is true, then bilinear interpolation is used for
    the scaling. Otherwise, nearest neighbor interpolation is used.

    ::

        image logo doubled = im.FactorScale("logo.png", 1.5)
    c         K  sk   | d  k r | } n  t |  } t t |   j | | | | |  | |  _ | |  _ | |  _ | |  _ d  S(   N(   RH   RK   Rt   R   R
   R   R   R   (   R   RX   R   R   R   Rx   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR
     s    	"			c         C  s   |  j  j   S(   N(   RK   R   (   R   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR     s    c         C  s   t  j |  j  } | j   \ } } t | |  j  } t | |  j  } |  j r z5 t j	 j
 j j   t j	 j j | | | f  } Wd  t j	 j
 j j   XnL z5 t j	 j
 j j   t j	 j j | | | f  } Wd  t j	 j
 j j   X| S(   N(   R   RG   RK   R   R   R   R   R   R'   R6   RE   R   R3   R   R   R4   R   R   (   R   R   R   R   R   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyRD     s    	""c         C  s   |  j  j   S(   N(   RK   R   (   R   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR     s    N(	   R   R   R   RH   R   R
   R   RD   R   (    (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR     s
   		t   Flipc           B  s8   e  Z d  Z e e d  Z d   Z d   Z d   Z RS(   s  
    :doc: im_im

    An image manipulator that flips `im` (an image manipulator)
    vertically or horizontally.  `vertical` and `horizontal` control
    the directions in which the image is flipped.

    ::

        image eileen flip = im.Flip("eileen_happy.png", vertical=True)
    c         K  se   | p	 | s t  d   n  t |  } t t |   j | | | |  | |  _ | |  _ | |  _ d  S(   NsD   im.Flip must be called with a true value for horizontal or vertical.(   RB   RK   Rt   R   R
   t
   horizontalt   vertical(   R   RX   R   R   Rx   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR
     s    		c         C  s   |  j  j   S(   N(   RK   R   (   R   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR     s    c         C  se   t  j |  j  } z8 t j j j j   t j j j	 | |  j
 |  j  } Wd  t j j j j   X| S(   N(   R   RG   RK   R'   R6   RE   R   R3   R   t   flipR   R   R4   (   R   R   R   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyRD     s    %c         C  s   |  j  j   S(   N(   RK   R   (   R   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR     s    (   R   R   R   R.   R
   R   RD   R   (    (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR     s
   		t   Rotozoomc           B  s2   e  Z d  Z d   Z d   Z d   Z d   Z RS(   sg   
    This is an image manipulator that is a smooth rotation and zoom of another image manipulator.
    c         K  sJ   t  |  } t t |   j | | | |  | |  _  | |  _ | |  _ d S(   s  
        @param im: The image to be rotozoomed.

        @param angle: The number of degrees counterclockwise the image is
        to be rotated.

        @param zoom: The zoom factor. Numbers that are greater than 1.0
        lead to the image becoming larger.
        N(   RK   Rt   R   R
   t   anglet   zoom(   R   RX   R   R   Rx   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR
   %  s
    		c         C  s   |  j  j   S(   N(   RK   R   (   R   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR   7  s    c         C  se   t  j |  j  } z8 t j j j j   t j j j	 | |  j
 |  j  } Wd  t j j j j   X| S(   N(   R   RG   RK   R'   R6   RE   R   R3   R   t   rotozoomR   R   R4   (   R   R   R   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyRD   :  s    %c         C  s   |  j  j   S(   N(   RK   R   (   R   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR   F  s    (   R   R   R   R
   R   RD   R   (    (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR      s
   			t   Cropc           B  s;   e  Z d  Z d d d d  Z d   Z d   Z d   Z RS(   s   
    :doc: im_im
    :args: (im, rect)

    An image manipulator that crops `rect`, a (x, y, width, height) tuple,
    out of `im`, an image manipulator.

    ::

        image logo crop = im.Crop("logo.png", (0, 0, 100, 307))
    c         K  s   t  |  } | d  k r- | \ } } } } n  t t |   j | | | | | |  | |  _  | |  _ | |  _ | |  _ | |  _ d  S(   N(	   RK   RH   Rt   R   R
   t   xt   yR   R	   (   R   RX   R   R   R   R	   Rx   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR
   W  s    %				c         C  s   |  j  j   S(   N(   RK   R   (   R   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR   f  s    c         C  s1   t  j |  j  j |  j |  j |  j |  j f  S(   N(   R   RG   RK   t
   subsurfaceR   R   R   R	   (   R   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyRD   i  s    c         C  s   |  j  j   S(   N(   RK   R   (   R   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR   m  s    N(   R   R   R   RH   R
   R   RD   R   (    (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR   J  s
   		c         C  s   t  j |  | f d  } | d k r g  } xJ t d d  D]9 } | d } | j t t | | |  d |    q: Wd j |  } | t  |  | f <n  | S(   s   
    Returns a 256 character linear ramp, where the first character has
    the value start and the last character has the value end. Such a
    ramp can be used as a map argument of im.Map.
    i    i   g     o@g      ?t    N(   t
   ramp_cacheRG   RH   t   rangeR[   t   chrR   R0   (   R$   t   endR   t   charsRf   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyt   rampt  s    
-i    i   t   Mapc           B  sA   e  Z d  Z e e e e e d  Z d   Z d   Z d   Z RS(   s   
    This adjusts the colors of the image that is its child. It takes
    as arguments 4 256 character strings. If a pixel channel has a
    value of 192, then the value of the 192nd character in the string
    is used for the mapped pixel component.
    c         K  sn   t  |  } t t |   j | | | | | | |  | |  _  | |  _ | |  _ | |  _ | |  _ | |  _ d  S(   N(	   RK   Rt   R   R
   t   rmapt   gmapt   bmapt   amapt   force_alpha(   R   RX   R   R   R   R   R   Rx   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR
     s    (					c         C  s   |  j  j   S(   N(   RK   R   (   R   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR     s    c         C  sb   t  j |  j  } t j j j | j   t  } t j j	 j
 | | |  j |  j |  j |  j  | S(   N(   R   RG   RK   R'   R6   R   R   R   R   t   modulet   mapR   R   R   R   (   R   R   R   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyRD     s
    c         C  s   |  j  j   S(   N(   RK   R   (   R   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR     s    (	   R   R   R   Rv   R.   R
   R   RD   R   (    (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR     s   			t   Twocolorc           B  s5   e  Z d  Z e d  Z d   Z d   Z d   Z RS(   sp  
    This takes as arguments two colors, white and black. The image is
    mapped such that pixels in white have the white color, pixels in
    black have the black color, and shades of gray are linearly
    interpolated inbetween.  The alpha channel is mapped linearly
    between 0 and the alpha found in the white color, the black
    color's alpha is ignored.
    c         K  sz   t  j j |  } t  j j |  } t |  } t t |   j | | | | |  | |  _ | |  _ | |  _ | |  _	 d  S(   N(
   R'   t   easyt   colorRK   Rt   R   R
   t   whitet   blackR   (   R   RX   R   R   R   Rx   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR
     s    "			c         C  s   |  j  j   S(   N(   RK   R   (   R   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR     s    c         C  sV   t  j |  j  } t j j j | j   t  } t j j	 j
 | | |  j |  j  | S(   N(   R   RG   RK   R'   R6   R   R   R   R   R   t   twomapR   R   (   R   R   R   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyRD     s
    c         C  s   |  j  j   S(   N(   RK   R   (   R   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR     s    (   R   R   R   R.   R
   R   RD   R   (    (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR     s
   		t   Recolorc           B  sA   e  Z d  Z d d d d e d  Z d   Z d   Z d   Z RS(   s   
    This adjusts the colors of the image that is its child. It takes as an
    argument 4 numbers between 0 and 255, and maps each channel of the image
    linearly between 0 and the supplied color.
    i   c         K  s~   t  |  } t t |   j | | | | | | |  | |  _  | d |  _ | d |  _ | d |  _ | d |  _ | |  _ d  S(   Ni   (	   RK   Rt   R   R
   t   rmult   gmult   bmult   amulR   (   R   RX   R   R   R   R   R   Rx   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR
     s    (	c         C  s   |  j  j   S(   N(   RK   R   (   R   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR     s    c         C  sb   t  j |  j  } t j j j | j   t  } t j j	 j
 | | |  j |  j |  j |  j  | S(   N(   R   RG   RK   R'   R6   R   R   R   R   R   t   linmapR   R   R   R   (   R   R   R   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyRD     s
    c         C  s   |  j  j   S(   N(   RK   R   (   R   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR     s    (   R   R   R   R.   R
   R   RD   R   (    (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR     s   			t   MatrixColorc           B  s2   e  Z d  Z d   Z d   Z d   Z d   Z RS(   s  
    :doc: im_matrixcolor

    An image operator that uses `matrix` to linearly transform the
    image manipulator `im`.

    `Matrix` should be a list, tuple, or :func:`im.matrix` that is 20
    or 25 elements long. If the object has 25 elements, then elements
    past the 20th are ignored.

    When the four components of the source color are R, G, B, and A,
    which range from 0.0 to 1.0; the four components of the transformed
    color are R', G', B', and A', with the same range; and the elements
    of the matrix are named::

        [ a, b, c, d, e,
          f, g, h, i, j,
          k, l, m, n, o,
          p, q, r, s, t ]

    the transformed colors can be computed with the formula::

        R' = (a * R) + (b * G) + (c * B) + (d * A) + e
        G' = (f * R) + (g * G) + (h * B) + (i * A) + j
        B' = (k * R) + (l * G) + (m * B) + (n * A) + o
        A' = (p * R) + (q * G) + (r * B) + (s * A) + t

    The components of the transformed color are clamped to the
    range [0.0, 1.0].
    c         K  s   t  |  } t |  d k rI t |  d k rI t d t |    n  t |  } t t |   j | | |  | |  _  | |  _ d  S(   Ni   i   s?   ColorMatrix expects a 20 or 25 element matrix, got %d elements.(   RK   Rk   RB   t   tupleRt   R   R
   t   matrix(   R   RX   R   Rx   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR
   (  s    $	c         C  s   |  j  j   S(   N(   RK   R   (   R   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR   5  s    c         C  sP   t  j |  j  } t j j j | j   t  } t j j	 j
 | | |  j  | S(   N(   R   RG   RK   R'   R6   R   R   R   R   R   t   colormatrixR   (   R   R   R   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyRD   8  s    c         C  s   |  j  j   S(   N(   RK   R   (   R   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR   B  s    (   R   R   R   R
   R   RD   R   (    (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR     s
   			
R   c           B  s  e  Z d  Z d   Z d   Z d   Z d   Z d   Z e Z d   Z	 d   Z
 d   Z d	   Z d
   Z e d    Z e d d   Z e d    Z e d    Z e d    Z e d    Z e d    Z e d    Z e d    Z e d    Z RS(   s  
    :doc: im_matrixcolor

    Constructs an im.matrix object from `matrix`. im.matrix objects
    support The operations supported are matrix multiplication, scalar
    multiplication, element-wise addition, and element-wise
    subtraction. These operations are invoked using the standard
    mathematical operators (\*, \*, +, and -, respectively). If two
    im.matrix objects are multiplied, matrix multiplication is
    performed, otherwise scalar multiplication is used.

    `matrix` is a 20 or 25 element list or tuple. If it is 20 elements
    long, it is padded with (0, 0, 0, 0, 1) to make a 5x5 matrix,
    suitable for multiplication.
    c         G  s   t  |  d k r% t | d  } n  t  |  d k rD | d } n  t  |  d k ro t d t  |    n  t j |  |  S(   Ni   i    i   i   s4   Matrix expects to be given 20 or 25 entries, not %d.(   i    i    i    i    i   (   Rk   R   RB   t   __new__(   t   clsRw   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR   W  s    c         C  s   t  | t  s t |  } n  t  | t  sU t  | t j j  rF t St |  } n  d g d } x t d d  D]n } xe t d d  D]T } xK t d d  D]: } | | | d c | | | d | | | d 7<q Wq Wqr Wt |  S(   Ni    i   i   (   R@   R   R'   R   t   Colort   NotImplementedR   (   R   RR   t   bt   resultR   R   Rf   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyt   muld  s    @c         C  s-   t  |  } t g  |  D] } | | ^ q  S(   N(   t   floatR   (   R   R{   Rf   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyt
   scalar_mulx  s    c         C  s#  | d |  d | d |  d | d |  d | d |  d |  d | d |  d | d |  d | d |  d | d |  d	 |  d
 | d |  d | d |  d | d |  d | d |  d |  d | d |  d | d |  d | d |  d | d |  d |  d d f S(   Ni    i   i   i   i   i   i   i   i   i	   i
   i   i   i   i   i   i   i   i   i   (    (   R   t   o(    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyt
   vector_mul|  s
    GGGGc         C  s~   t  | t t f  rB t |  } t g  |  D] } | | ^ q+  St |  } t g  t |  |  D] \ } } | | ^ qa  S(   N(   R@   R   R   R   R   (   R   R{   Rf   t   j(    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyt   __add__  s
    !c         C  s   |  | d S(   Ni(    (   R   R{   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyt   __sub__  s    c         C  s   |  d | S(   Ni(    (   R   R{   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyt   __rsub__  s    c         C  s2   t  | t t f  r" |  j |  S|  j |  |  S(   N(   R@   R   R   R   R   (   R   R{   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyt   __mul__  s    c         C  s2   t  | t t f  r" |  j |  S|  j | |   S(   N(   R@   R   R   R   R   (   R   R{   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyt   __rmul__  s    c         C  s   d |  S(   Ns   im.matrix(%f, %f, %f, %f, %f.
          %f, %f, %f, %f, %f,
          %f, %f, %f, %f, %f,
          %f, %f, %f, %f, %f,
          %f, %f, %f, %f, %f)(    (   R   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR     s    c           C  sC   t  d d d d d d d d d d d d d d d d d d d d  S(   s   
        :doc: im_matrixcolor
        :name: im.matrix.identity

        Returns an identity matrix, one that does not change color or
        alpha.
        i   i    (   R   (    (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyRv     s    
gz6?g,C?g]m{?c           s   | \ } } }   f d   } t  | | d  | | d  | | d  d d | | d  | | d  | | d  d d | | d  | | d  | | d  d d d d d d d  S(   s  
        :doc: im_matrixcolor
        :name: im.matrix.saturation

        Returns an im.matrix that alters the saturation of an
        image. The alpha channel is untouched.

        `level`
            The amount of saturation in the resulting image. 1.0 is
            the unaltered image, while 0.0 is grayscale.

        `desat`
            This is a 3-element tuple that controls how much of the
            red, green, and blue channels will be placed into all
            three channels of a fully desaturated image. The default
            is based on the constants used for the luminance channel
            of an NTSC television signal. Since the human eye is
            mostly sensitive to green, more of the green channel is
            kept then the other two channels.
        c           s   |  | |    S(   N(    (   RR   R   (   t   level(    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyt   I  s    i   i    (   R   (   R   t   desatR   t   gR   R   (    (   R   s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyt
   saturation  s    -**c           C  s   t  j d  S(   s   
        :doc: im_matrixcolor
        :name: im.matrix.desaturate

        Returns an im.matrix that desaturates the image (makes it
        grayscale). This is equivalent to calling
        im.matrix.saturation(0).
        g        (   R   R   (    (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyt
   desaturate  s    c         C  sC   t  |  d d d d d | d d d d d | d d d d d d d  S(   s  
        :doc: im_matrixcolor
        :name: im.matrix.tint

        Returns an im.matrix that tints an image, without changing
        the alpha channel. `r`, `g`, and `b` should be numbers between
        0 and 1, and control what fraction of the given channel is
        placed into the final image. (For example, if `r` is .5, and
        the value of the red channel is 100, the transformed color
        will have a red value of 50.)
        i    i   (   R   (   R   R   R   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyt   tint  s    c           C  sC   t  d d d d d d d d d d d d d d d d d d d d  S(   s   
        :doc: im_matrixcolor
        :name: im.matrix.invert

        Returns an im.matrix that inverts the red, green, and blue
        channels of the image without changing the alpha channel.
        ii    i   (   R   (    (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyt   invert  s    
c         C  sC   t  d d d d |  d d d d |  d d d d |  d d d d d  S(   sM  
        :doc: im_matrixcolor
        :name: im.matrix.brightness

        Returns an im.matrix that alters the brightness of an image.

        `b`
            The amount of change in image brightness. This should be
            a number between -1 and 1, with -1 the darkest possible
            image and 1 the brightest.
        i   i    (   R   (   R   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyt
   brightness  s    c         C  sC   t  d d d d d d d d d d d d d d d d d d |  d  S(   s   
        :doc: im_matrixcolor
        :name: im.matrix.opacity

        Returns an im.matrix that alters the opacity of an image. An
        `o` of 0.0 is fully transparent, while 1.0 is fully opaque.
        i   i    (   R   (   R   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyt   opacity  s    
c         C  s-   t  j d  t  j |  |  |   t  j d  S(   s"  
        :doc: im_matrixcolor
        :name: im.matrix.contrast

        Returns an im.matrix that alters the contrast of an image. `c` should
        be greater than 0.0, with values between 0.0 and 1.0 decreasing contrast, and
        values greater than 1.0 increasing contrast.
        g      g      ?(   R   R   R   (   t   c(    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyt   contrast)  s    c         C  s@  |  t  j d }  t  j |   } t  j |   } d } d } d } t | | d | | | | | | | | | | | | d | d d | | | | d | | d | | d | | | | d	 d d | | | | d | | | | | | | | d | | | d d d d d d d d d d d d  S(
   s   
        :doc: im_matrixcolor
        :name: im.matrix.hue

        Returns an im.matrix that rotates the hue by `h` degrees, while
        preserving luminosity.
        i   g$C?gzG?g;On?i   i    gM?gQ?g&1ҿ(   t   matht   pit   cost   sinR   (   R	   t   cosValt   sinValt   lumRt   lumGt   lumB(    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyt   hue7  s    
KEJc   
      C  s   t  j j |   \ } } } } t  j j |  \ } } } }	 | d :} | d :} | d :} | d :} | d :} | d :} t | | d d d | d | | d d | d d | | d | d d d d d  S(   s  
        :doc: im_matrixcolor
        :name: im.matrix.colorize

        Returns an im.matrix that colorizes a black and white image.
        `black_color` and `white_color` are Ren'Py style colors, so
        they may be specified as strings or tuples of (0-255) color
        values. ::

            # This makes black colors red, and white colors blue.
            image logo colored = im.MatrixColor(
                "bwlogo.png",
                im.matrix.colorize("#f00", "#00f"))

        g     o@i    i   (   R'   R   R   R   (
   t   black_colort   white_colort   r0t   g0t   b0t   _a0t   r1t   g1t   b1t   _a1(    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyt   colorizeO  s    





(   gz6?g,C?g]m{?(   R   R   R   R   R   R   R   R   t   __radd__R   R   R   R   R   t   staticmethodRv   R   R   R   R   R   R   R   R  R  (    (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR   F  s.   										 gz6?g,C?g]m{?c         K  s   t  |  t j d |  |  S(   s   
    :doc: im_im
    :args: (im, **properties)

    An image manipulator that creates a desaturated version of the image
    manipulator `im`.
    g        (   R   R   R   (   RX   R   Rx   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyt	   Grayscaleq  s    	g      ?gGz?gRQ?c         K  s;   t  |  t j d |  t j | d | d | d  |  S(   s   
    :doc: im_im
    :args: (im, **properties)

    An image manipulator that creates a sepia-toned version of the image
    manipulator `im`.
    g        i    i   i   (   R   R   R   R   (   RX   R   R   Rx   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyt   Sepia}  s    	c         C  s4   t  j j |  \ } } } } t |  | | | |  S(   sx   
    This recolors the supplied image, mapping colors such that black is
    black and white is the supplied color.
    (   R'   R   R   R   (   RX   R   R   R   R   RR   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR     s    c      	   K  s)   t  |  d d d t d |  d t | S(   s  
    Returns an alpha-mapped version of the image. Alpha is the maximum
    alpha that this image can have, a number between 0.0 (fully
    transparent) and 1.0 (opaque).

    If an image already has an alpha channel, values in that alpha
    channel are reduced as appropriate.
    i   R   (   R   R   R   (   RK   t   alphaRx   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyt   Alpha  s    
t   Tilec           B  s5   e  Z d  Z d d  Z d   Z d   Z d   Z RS(   s  
    :doc: im_im

    An image manipulator that tiles the image manipulator `im`, until
    it is `size`.

    `size`
        If not None, a (width, height) tuple. If None, this defaults to
        (:var:`config.screen_width`, :var:`config.screen_height`).
    c         K  s>   t  |  } t t |   j | | |  | |  _  | |  _ d  S(   N(   RK   Rt   R  R
   R   (   R   RX   R   Rx   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR
     s    	c         C  s   |  j  j   S(   N(   RK   R   (   R   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR     s    c   
      C  s   |  j  } | d  k r0 t j j t j j f } n  t j |  j  } t j	 j
 j | t  } | \ } } | j   \ } } xM t d | |  D]9 } x0 t d | |  D] }	 | j | |	 | f  q Wq W| S(   Ni    (   R   RH   R'   R(   R*   R+   R   RG   RK   R6   R   R   R   R   R   R   (
   R   R   R   R   R   R   t   swt   shR   R   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyRD     s    	c         C  s   |  j  j   S(   N(   RK   R   (   R   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR     s    N(   R   R   R   RH   R
   R   RD   R   (    (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR    s
   
		t	   AlphaMaskc           B  s2   e  Z d  Z d   Z d   Z d   Z d   Z RS(   s  
    :doc: im_im

    An image manipulator that takes two image manipulators, `base` and
    `mask`, as arguments. It replaces the alpha channel of `base` with
    the red channel of `mask`.

    This is used to provide an image's alpha channel in a second
    image, like having one jpeg for color data, and a second one
    for alpha. In some cases, two jpegs can be smaller than a
    single png file.

    Note that this takes different arguments from :func:`AlphaMask`,
    which uses the mask's alpha channel.
    c         K  s>   t  t |   j | | |  t |  |  _ t |  |  _ d  S(   N(   Rt   R  R
   RK   t   baset   mask(   R   R  R  Rx   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR
     s    c         C  s   |  j  j   |  j j   S(   N(   R  R   RK   (   R   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR     s    c         C  s}   t  j |  j  } t  j |  j  } | j   | j   k rK t d   n  t j j j	 |  } t j j
 j | | t  | S(   Ns)   AlphaMask surfaces must be the same size.(   R   RG   R  R  R   RB   R'   R6   R   t   copy_surfaceR   t   alpha_mungeRv   (   R   t   basesurft   masksurfR   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyRD     s    c         C  s   |  j  j   |  j j   S(   N(   R  R   R  (   R   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR     s    (   R   R   R   R
   R   RD   R   (    (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR    s
   			c         K  s   t  |  t  r |  St  |  t  r/ t |  |  St  |  t j j j  rg |  j   t |  j	 d | | St  |  t
  r g  } x( |  D]  } | j d  | j |  q Wt d |  S| r |  St  |  t j j j  r t d   n t d   d S(   s   
    :doc: im_image
    :name: Image
    :args: (filename, **properties)

    Loads an image from a file. `filename` is a
    string giving the name of the file.

    `filename` should be a JPEG or PNG file with an appropriate
    extension.
    t   loosei    s1   Expected an image, but got a general displayable.s(   Could not construct image from argument.N(   i    i    (   R@   RA   t
   basestringR   R'   R6   RK   t   ImageReferencet   find_targetR   R   R[   R   RH   t   coret   DisplayableRB   (   t   argR"  Rx   t   paramsRf   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyRK     s$    
c         C  s(   t  j t |    } t j j j |  S(   so   
    :doc: udd_utility

    Loads the image manipulator `im` using the image cache, and returns a texture.
    (   R   RG   RK   R'   R6   RO   RW   (   RX   R   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyR   /  s    c         C  s   t  j t |    S(   sv   
    :doc: udd_utility

    Loads the image manipulator `im` using the image cache, and returns a pygame Surface.
    (   R   RG   RK   (   RX   (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyt   load_surface:  s    c           C  s   t  d  t   a d  S(   Ns   Resetting cache.(   t   printR   R   (    (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyt   reset_moduleD  s    
(.   t
   __future__R    t   renpy.displayR'   R   R   R   R   R   t   objectR   R   R   Rn   R6   R&  R'  RA   R   R   R   R   R   R   R   R   R   R   Rv   R   R   R   R   R   R   R  R  R   R  R  R  R.   RK   R   R*  R,  (    (    (    s_   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\im.pyt   <module>   sN    f			B;F3<,*'	)+(> ,!		/,3		
