ó
F	.\c           @  s9   d  d l  m Z d  d l Td  d l Z d Z d „  Z d S(   iÿÿÿÿ(   t   unicode_literals(   t   *NuQ   /System/Library/Extensions/IOStorageFamily.kext/Contents/Resources/Removable.icnsc   /   	   C  s[  t  d  t t t ƒ } t | d  ƒ } t | ƒ } t  d  |  t t ƒ } t | d  ƒ } | d  k	 sp t d |  ƒ ‚ t | ƒ } t  d  | t t ƒ } t | d | d  ƒ } t	 t
 ƒ } d }	 d d d  d! f }
 d" } xzt | ƒ D]l} t | | d  ƒ } | d } | d } | d } | d } d  } d  } d  } d  } d  } xÛ t | ƒ D]Í } t | | d  ƒ } | d } | d } | d } | d } | d  k sô| | k rH| | k sô| | k sô| | k rH| | k rH| | k rH| d  k sô| | k rH| } | } | } | } | } qHqHWt | | d  ƒ } t j | ƒ } t | | d  ƒ } t j | ƒ }  t j d ƒ }! t j d ƒ }" t j d ƒ }# t j d ƒ }$ |" j | t ƒ |" j |	 t | ƒ | t ƒ |" j d t ƒ | |	 |
 d d | |	 |
 d d f }% | |	 |
 d d | |	 |
 d d f }& | |	 |
 d d | |	 |
 d d f }' | |	 |
 d d | |	 |
 d d f }( |" j t ƒ }) | d k r&|# j |) t ƒ |# j t j |% Œ  d ƒ |# j t j |& Œ  d ƒ |# j t j |' Œ  d ƒ |# j t j |( Œ  d ƒ |# j t ƒ }) n  t j ƒ  }* |* j t j | d d
 |	 | ƒ t j | d d
 |	 | ƒ ƒ |$ j |) t ƒ |$ j |* d ƒ |$ j t ƒ }) |! j |) t ƒ |! j |  t  ƒ |! j t ƒ }+ t! d  | | d d | t" ƒ }, t# j$ |, d  ƒ }- |- j% |+ d# | | f f d$ | | f f ƒ t& |, ƒ }. t' | |. | ƒ qÝ Wt( | ƒ d  S(%   Nu    Unable to process image file: %su   com.apple.icnsg      ð?gš™™™™™É?gffffffî?gš™™™™™é?g333333ë?gffffffÖ?g333333Ã?g      à?u
   PixelWidthu   PixelHeightu   DPIWidthu   Depthu   CISourceOverCompositingu   CILanczosScaleTransformu   CIPerspectiveTransformu   CIAffineTransformi    i   i   i   i   u   inputTopLeftu   inputTopRightu   inputBottomRightu   inputBottomLeftu   inputTransformi   (   gš™™™™™É?gffffffî?(   gš™™™™™é?gffffffî?(   g333333ë?gffffffÖ?(   g333333Ã?gffffffÖ?(   g      à?g      à?(   i    i    (   i    i    ()   t   CFURLCreateWithFileSystemPatht   Nonet   _REMOVABLE_DISK_PATHt   kCFURLPOSIXPathStylet   Falset   CGImageSourceCreateWithURLt   CGImageSourceGetCountt   AssertionErrort   CGImageDestinationCreateWithURLt   CGColorSpaceCreateWithNamet   kCGColorSpaceGenericRGBt   ranget"   CGImageSourceCopyPropertiesAtIndext   CGImageSourceCreateImageAtIndext   CIImaget   imageWithCGImage_t   CIFiltert   filterWithName_t   setValue_forKey_t   kCIInputImageKeyt   floatt   kCIInputScaleKeyt   kCIInputAspectRatioKeyt   valueForKey_t   kCIOutputImageKeyt   CIVectort   vectorWithX_Y_t   NSAffineTransformt	   transformt   translateXBy_yBy_t   matht   floort   kCIInputBackgroundImageKeyt   CGBitmapContextCreatet   kCGImageAlphaPremultipliedLastt	   CIContextt   contextWithCGContext_options_t   drawImage_inRect_fromRect_t   CGBitmapContextCreateImaget   CGImageDestinationAddImaget   CGImageDestinationFinalize(/   t
   badge_filet   output_filet   urlt   backdropt   backdropCountt   badget
   badgeCountt   targett   rgbColorSpacet   scalet   cornerst   positiont   nt   propst   widtht   heightt   dpit   deptht	   bestWidtht
   bestHeightt	   bestBadget	   bestDeptht   bestDPIt   mt
   badgePropst
   badgeWidtht   badgeHeightt   badgeDPIt
   badgeDeptht
   badgeImaget   badgeCIt   backgroundImaget   backgroundCIt
   compositort   lanczost   perspectiveR   t   topLeftt   topRightt   bottomRightt
   bottomLeftt   outt   tfmt   resultt	   cgContextt   contextt   image(    (    s   dmgbuild/badge.pyt   badge_disk_icon	   sÊ    				







" 		(   t
   __future__R    t   QuartzR    R   RY   (    (    (    s   dmgbuild/badge.pyt   <module>   s   
