ó
O'—^c           @  sx   d  d l  m Z d  d l m Z m Z y d  d l Z Wn# e k
 r[ d  d l Z e Z n Xe j Z	 d „  Z
 d Z d S(   iÿÿÿÿ(   t   print_function(   t   Imaget   _binaryNc         C  s  t  |  d ƒ r |  } n t j |  d ƒ } | j d ƒ } t | d ƒ t | d ƒ f } t | d ƒ } | j | ƒ t j d | | j | d	 | d
 ƒ ƒ } | j t	 ƒ d | _
 d | _ | d  j d d
 ƒ d	 | j d <| d d !j d d
 ƒ d	 } | r| | j d <n  | S(   s  
    Load texture from a Quake2 WAL texture file.

    By default, a Quake2 standard palette is attached to the texture.
    To override the palette, use the <b>putpalette</b> method.

    :param filename: WAL file name, or an opened file handle.
    :returns: An image instance.
    t   readt   rbi    i   i   i$   i(   t   Pi    i   t   WALs   Quake2 Textures    t   namei8   t	   next_namei8   iX   id   iX   (   t   hasattrt   builtinst   openR   t   i32t   seekR   t	   frombytest
   putpalettet   quake2palettet   formatt   format_descriptiont   splitt   info(   t   filenamet   fpt   headert   sizet   offsett   imR   (    (    s2   /tmp/pip-unpacked-wheel-ivxKtu/PIL/WalImageFile.pyR   %   s     	*		!s   """&&&))),,,///222555777:::<<<$" 


##&""%" #!"  -( )$'"%8.1),%& <07,3(-$("
10.,*'
%!


)#'!& %#! 

&# 

3"5)&7/-95479:379046+14'.1"+/(,%* &%"
 
,!!*)'&$"!


.0)-.'+,&**$()#''!&&$$""
0-,*(&$!



()8&'6%&4$$1""/ !-*'%!
/2)-0&+.$),!'*%(#&!%"

?<9 5#1#-#)?????9??1??*?? ???<?9?5?2?-=*;&9!742/-*'#=???<.*6' 0!)<9772/1,(+&!0" (   t
   __future__R    t   PILR   R   R
   t   ImportErrort   __builtin__t   i32leR   R   R   (    (    (    s2   /tmp/pip-unpacked-wheel-ivxKtu/PIL/WalImageFile.pyt   <module>   s   
		+