ó
î Xc           @   sś   d  Z  d d l m Z m Z m Z e j Z e j Z e j Z	 d   Z
 d e j f d     YZ e j d e e
  e j d d  e j d d  e j d d	  e j d d
  d S(   s   0.2i˙˙˙˙(   t   Imaget	   ImageFilet   _binaryc         C   s   t  |   d k S(   NiÚ  (   t   i16(   t   prefix(    (    s6   /usr/lib/python2.7/dist-packages/PIL/SgiImagePlugin.pyt   _accept   s    t   SgiImageFilec           B   s   e  Z d  Z d Z d   Z RS(   t   SGIs   SGI Image File Formatc         C   s  |  j  j d  } t |  d k r3 t d   n  t | d  } t | d  t | d  t | d  f } | d k s | d k r d	 |  _ n< | d k rŹ d
 |  _ n$ | d k rÄ d |  _ n t d   t | d  t | d  f |  _ | d k r{d } |  j d |  j d | d } g  |  _ xe |  j D]< } |  j j d d |  j | | d d f f  | | } q8Wn | d k rt d   n  d  S(   Ni   iÚ  s   Not an SGI image filei   i   i   i
   i   t   Lt   RGBt   RGBAs   Unsupported SGI image modei   i   i    t   rawi˙˙˙˙s   SGI RLE encoding not supported(   i   i   i   (   i   i   i   (   i   i   i   (   i   i   i   (   i    i    (	   t   fpt   readR   t
   ValueErrort   i8t   modet   sizet   tilet   append(   t   selft   st   compressiont   layoutt   offsett   pagesizet   layer(    (    s6   /usr/lib/python2.7/dist-packages/PIL/SgiImagePlugin.pyt   _open+   s.    -# 		#(   t   __name__t
   __module__t   formatt   format_descriptionR   (    (    (    s6   /usr/lib/python2.7/dist-packages/PIL/SgiImagePlugin.pyR   &   s   R   s   .bws   .rgbs   .rgbas   .sgiN(   t   __version__t   PILR    R   R   R   t   i16beR   t   i32bet   i32R   R   t   register_opent   register_extension(    (    (    s6   /usr/lib/python2.7/dist-packages/PIL/SgiImagePlugin.pyt   <module>   s   				.