+
    X‹çj¾(  ã            
       ó¾  € R t ^ RIt^ RIHtHtHtHt ]P                  P                  ]P                  P                  ]P                  P                  ]4      4      RRRRRRR4      t^t^
tRR	 ltRR
 ltRR ltR t^`^^^^]3R ltR tRR ltR RR^],          R3R ltR tR tR!R ltR"R ltRR lt]RRRRR#RR3R ltR t]R8X  d   ]! ]! 4       ]4       R# R# )$a  Generate the textures of the cinematic Home (docs/plan/skin-milionar/190-cinema.md).

Shapes only (panels, masks, the focus frame); every icon stays Estuary's own. White textures are tinted in the XML with
`colordiffuse`. Run after changing a shape; the PNGs are committed.
N)ÚImageÚ
ImageChopsÚ	ImageDrawÚImageFilterz..Ú	resourceszskin.milionarÚmediaÚmilionarÚcinemac                óh  € V w  r4\         P                  ! RV\        ,          V\        ,          3^ 4      p\        P                  ! V4      pVP                  ^ ^ V\        ,          ^,
          V\        ,          ^,
          3V\        ,          ^ÿVR7       VP                  W43\         P                  4      # )zNAnti-aliased alpha mask (L) of a rounded rectangle; `corners`: tl, tr, br, bl.ÚL)ÚfillÚcorners)r   ÚnewÚSSr   ÚDrawÚrounded_rectangleÚresizeÚLANCZOS)ÚsizeÚradiusr   ÚwÚhÚbigÚdraws   &&&    Úv/Users/chudy/Library/Application Support/Kodi/addons/plugin.video.milionar/scripts/skin_harness/gen_cinema_textures.pyÚroundedr      s‚   € à�D€AÜ
�)Š)�C˜!œb�& !¤b¥&Ð)¨1Ó
-€CÜ�>Š>˜#Ó€DØ×Ñ˜A˜q !¤b¥&¨1¥*¨a´"­f°q­jÐ9¸6ÄB½;ÈSÐZaÐÔbØ�:‰:�q�fœeŸm™mÓ,Ð,ó    c                 ó¤   a€ \        WV4      P                  V3R  l4      p\        P                  ! RWR,           4      pVP	                  V4       V# )c                 ó$   <€ V S,          ^ÿ,          # )éÿ   © )ÚvÚalphas   &€r   Ú<lambda>Úsolid.<locals>.<lambda>   s   ø€ ¸!¸e½)ÀsÖ:Jr   ÚRGBA©é    )r   Úpointr   r   Úputalpha)r   r   Úcolorr"   r   ÚmaskÚimages   &&&f&  r   Úsolidr-      s@   ø€ Ü�4 Ó)×/Ñ/Ô0JÓK€DÜ�IŠI�f˜d¨D¥LÓ1€EØ	‡N�N�4ÔØ€Lr   c                ój  aa€ \        W4      p\        P                  ! RV ^ 4      pVP                  \        V ^ ,          ^V,          ,
          V ^,          ^V,          ,
          3W,
          4      WD34       \        P
                  ! WV4      p\        P                  ! RV SR,          R,           4      pVP                  VP                  V3R l4      4       \        P                  ! RV SR,          R,           4      p	V	P                  VP                  V3R l4      4       \        P                  ! W‰4      # )z:Rounded panel with a thin inner border (the ghost button).r   r%   :Né   Nc                 ó2   <€ V S^,          ,          ^ÿ,          # ©r/   r    )r!   r   s   &€r   r#   Úoutlined.<locals>.<lambda>(   s   ø€ ¨¨T°!­W­¸Ö);r   c                 ó2   <€ V S^,          ,          ^ÿ,          # r1   r    )r!   Úborders   &€r   r#   r2   *   s   ø€  q¨6°!­9¥}¸Ö';r   r&   )	r   r   r   Úpaster   Úsubtractr)   r(   Úalpha_composite)
r   r   r   r4   ÚwidthÚouterÚinnerÚringr,   Úedges
   &&ff&     r   Úoutlinedr=   !   sÛ   ù€ ä�DÓ!€EÜ�IŠI�c˜4 Ó#€EØ	‡K�K”˜˜a� 1 u¥9Õ,¨d°1­g¸¸E½	Õ.AÐBÀFÅNÓSÐV[ÐUcÔdÜ×Ò˜uÓ,€DÜ�IŠI�f˜d D¨¥H¨t¥OÓ4€EØ	‡N�N�5—;‘;Ô;Ó<Ô=Ü�9Š9�V˜T 6¨"¥:°Õ#4Ó5€DØ‡M�M�$—*‘*Ô;Ó<Ô=Ü× Ò  Ó-Ð-r   c                 óB  € \         P                  ! W4      p\         P                  ! V P                  \        P                  ! V4      4      V4      P                  R  4      p\        P                  ! RW"3R4      pVP                  \         P                  ! WE4      4       V# )c                 ó"   € V ^–,          ^ÿ,          # )é–   r    )r!   s   &r   r#   Ú_frame.<locals>.<lambda>0   s   € ÐdeÐhkÕdkÐorÖdrr   r%   ©r   r   r   r'   )
r   r6   Úfilterr   ÚGaussianBlurr(   r   r   r)   Úlighter)r9   r:   r   Úglowr;   Úhalor,   s   &&&&   r   Ú_framerH   .   su   € Ü×Ò˜uÓ,€DÜ×Ò˜uŸ|™|¬K×,DÒ,DÀTÓ,JÓKÈUÓS×YÑYÑZrÓs€DÜ�IŠI�f˜t˜lÐ,>Ó?€EØ	‡N�N”:×%Ò% dÓ1Ô2Ø€Lr   c                óÖ  € V ^V,          ,
          p\         P                  ! RW 3^ 4      pVP                  \        V^V,          ,           V^V,          ,           3WR,           4      W,
          W,
          34       \         P                  ! RW 3^ 4      pVP                  \        V^V,          ,
          V^V,          ,
          3WT,
          4      W,           W,           34       \	        WxW4      # )aa  White ring with a soft outer glow around a card whose edge lies `margin` px inside the texture.

The ring lies outside the card, with the card's own corner radius on its inner edge, so it covers no picture and
no corner of the card shows outside it; `overlap` px reach under the card's edge so that no seam opens between
the two when the skin is scaled.r   )r   r   r5   r   rH   )	r   Úmarginr8   rF   Úoverlapr   Úboxr9   r:   s	   &&&&&&   r   Úfocus_framerM   6   sº   € ð ��V•Õ
€CÜ�IŠI�c˜D˜<¨Ó+€EØ	‡K�K”˜˜q 5�y�¨#°°Eµ	­/Ð:¸F½NÓKÈfÍnÐ^dÕ^lÐMmÔnÜ�IŠI�c˜D˜<¨Ó+€EØ	‡K�K”˜˜q 7�{Õ*¨C°!°gµ+Õ,=Ð>ÀÕ@PÓQÐTZÕTdÐflÕfvÐSwÔxÜ�% Ó+Ð+r   c                 óh   € \        R \        RV 4      4      p W ,          ^^V ,          ,
          ,          # )ç      ð?ç        )ÚminÚmax)Úts   &r   ÚsmoothrT   D   s)   € ÜˆC”�S˜!“Ó€AØ�5�A˜˜A�•IÕÐr   c                óš  € V w  rV\         P                  ! RV R4      pVP                  4       p\        V4       EF  p	R\	        W–R,
          ,          V^ ,          ,
          V^,          V^ ,          ,
          ,          4      ,
          p
\        V4       F²  pVRV,
          \	        WµR,
          ,          V^ ,          ,
          V^,          V^ ,          ,
          ,          4      ,          ,           pV'       d'   V\	        WµR,
          ,          V,          4      ,          p^ÿ^ÿ^ÿ\        \        ^ÿV,          V
,          4      4      3W‹V	3&   K´  	  EK  	  V# )zÙDiffuse mask of the hero backdrop: dim on the left (under the text), gone at the bottom (under the rows);
`edge` > 0 also fades its left edge in from nothing over that part of the width (no hard line where it starts).r%   rO   )r   r   r   r   )r   r   ÚloadÚrangerT   ÚintÚround)r   ÚleftÚfloorÚbottomr<   r   r   r,   ÚpixelsÚyÚdownÚxÚacrosss   &&&&&        r   Ú	hero_faderb   I   sÿ   € ð �D€AÜ�IŠI�f˜dÐ$8Ó9€EØ�Z‰Z‹\€FÜ�1�XˆØ”V˜Q c¥'�]¨V°A­YÕ6¸6À!½9ÀvÈaÅyÕ;PÕQÓRÕRˆÜ�q–ˆAØ˜c E�k¬V°Q¸c½'µ]ÀTÈ!ÅWÕ5LÐQUÐVWÕQXÐ[_Ð`aÕ[bÕQbÕ4cÓ-dÕdÕdˆFßØœ& ¨#¥g¥°Õ!5Ó6Õ6�Ø  c¬3¬u°S¸6µ\ÀDÕ5HÓ/IÓ+JÐKˆF�a�4‹Lô	 ñ ð €Lr   çffffffæ?ç333333ë?rO   c                óÖ  € V w  rV\         P                  ! RV ^ 4      pVP                  4       p\        V4       Ff  p	\	        \        ^ÿV,          \        W–R,
          ,          V,
          WA,
          ,          4      ,          4      4      p
\        V4       F  pW¨W¹3&   K
  	  Kh  	  \         P                  ! RV R4      pVP                  \        P                  ! V\        W4      4      4       V# )zTDark foot of a poster (under its status badge), cut to the poster's rounded corners.r   rO   r%   ©r'   r'   r'   r'   )r   r   rV   rW   rX   rY   rT   r)   r   Úmultiplyr   )r   ÚstartÚstrengthr   Úendr   r   Úrampr]   r^   Úvaluer`   r,   s   &&&&&        r   Úshaderm   Y   s±   € à�D€AÜ�9Š9�S˜$ Ó"€DØ�Y‰Y‹[€FÜ�1ŽXˆÜ”E˜# �.¬6°1¸C½µ=À5Õ3HÈSÍ[Õ2YÓ+ZÕZÓ[Ó\ˆÜ�q–ˆAØ �1�4‹Ló ñ ô �IŠI�f˜d LÓ1€EØ	‡N�N”:×&Ò& t¬W°TÓ-BÓCÔDØ€Lr   c                 óê   € R^r\         P                  ! RV R4      pVP                  \        V RRRVR7      P	                  R4      4       R\        W4      RVR	\        RVR4      R
\        RVRR^4      /# )z®The continuation still fades softly into one navy foot under its two lines of text and keeps the upper half of
the picture clear; white RGB is essential for the diffuse mask.r%   gÃõ(\�ÂÕ?g=
×£p=ê?g\�Âõ(\ï?)rh   rj   ri   r   ÚAzwatch_mask.pngzwatch_shade.pngzwatch_base.pngzwatch_edge.png)iX  i,  )é   é   é&   r'   ©é@   rt   ©rp   rq   rr   rf   )r   r   r   é-   )r   r   r)   rm   Ú
getchannelr-   r=   )r   r   r,   s      r   Úwatch_texturesrx   g   s   € ð ˜rˆ&Ü�IŠI�f˜d OÓ4€EØ	‡N�N”5˜ T¨t¸dÈ6ÔR×]Ñ]Ð^aÓbÔcØœe DÓ1Ð3DÀeØœe H¨f°lÓCØœh x°¸ÐGZÐ\]Ó^ð`ð `r   c                óB  € \         P                  ! RV \        ,          V \        ,          3^ 4      p\        P                  ! V4      P                  ^ ^ V \        ,          ^,
          V \        ,          ^,
          3^ÿR7       VP                  W 3\         P                  4      # )z>Anti-aliased alpha mask (L) of a circle that fills the square.r   ©r   )r   r   r   r   r   Úellipser   r   )r   r   s   & r   Údiscr|   r   sm   € ä
�)Š)�C˜$¤�) T¬B¥YÐ/°Ó
3€CÜ‡N‚N�3Ó×Ñ  A t¬b¥y°1¥}°d¼RµiÀ!µmÐ DÈ3ÐÔOØ�:‰:�t�l¤E§M¡MÓ2Ð2r   c                óz  € V ^V,          ,
          p\         P                  ! RW 3^ 4      pVP                  \        V^V,          ,           4      W,
          W,
          34       \         P                  ! RW 3^ 4      pVP                  \        V^V,          ,
          4      W,           W,           34       \	        WgW4      # )zQThe focus frame of a round card (focus_frame as a circle); twice the card's size.r   )r   r   r5   r|   rH   )r   rJ   r8   rF   rK   rL   r9   r:   s   &&&&&   r   Ú
focus_ringr~   y   s�   € à
��V•Õ
€CÜ�IŠI�c˜D˜<¨Ó+€EØ	‡K�K”�S˜1˜u�9•_Ó%¨­¸½Ð'GÔHÜ�IŠI�c˜D˜<¨Ó+€EØ	‡K�K”�S˜1˜w�;Õ&Ó'¨&Õ*:¸FÕ<LÐ)MÔNÜ�% Ó+Ð+r   c                óV  a€ V \         ,          R,          o\        P                  ! RV \         ,          V \         ,          3R4      p\        P                  ! V4      p\        ^^`^4       Fš  pTP                  \        ;QJ d7    . V3R l^`V,
          ^`V,
          ^`V,           ^`V,           3 4       F  NK  	  5M0! V3R l^`V,
          ^`V,
          ^`V,           ^`V,           3 4       4      R	\        ^\        S4      4      R7       Kœ  	  TP                  \        ;QJ d    . V3R lR
 4       F  NK  	  5M! V3R lR
 4       4      RR7       VP                  W 3\        P                  4      pVP                  \        P                  ! VP                  R4      \!        V 4      4      4       V# )zLSubtle grooves and the spindle hole of a record, cut to the record's circle.g      h@r%   c              3   óH   <"  € T F  p\        VS,          4      x € K  	  R # 5i©N©rX   ©Ú.0r!   Úscales   & €r   Ú	<genexpr>Úgrooves.<locals>.<genexpr>‰   s   øé € ÐhÑ3g¨aœ3˜q 5�yŸ>˜>Ó3gùó   ƒ")Úoutliner8   c              3   óH   <"  € T F  p\        VS,          4      x € K  	  R # 5ir�   r‚   rƒ   s   & €r   r†   r‡   ‹   s   øé € ÐBÑ/A¨!”s˜1˜u�9—~�~Ó/Aùrˆ   rz   ro   rf   )r   r   r   é   )éY   rŒ   ég   r�   )é   é   é   éë   )r   r   r   r   r   rW   r{   ÚtuplerR   rX   r   r   r)   r   rg   rw   r|   )r   r,   r   r   r…   s   &   @r   Úgroovesr“   ƒ   s8  ø€ à”2�I˜Õ€EÜ�IŠI�f˜t¤b�y¨$´­)Ð4°lÓC€EÜ�>Š>˜%Ó €DÜ˜˜B Ö"ˆØ�‰—U”UÔh°B¸µKÀÀfÅÈbÐSYÍkÐ[]Ð`fÕ[fÑ3gÓh—U‘UÔh°B¸µKÀÀfÅÈbÐSYÍkÐ[]Ð`fÕ[fÑ3gÓhÓhØ0¼¸A¼sÀ5»zÓ8Jð 	ö 	Lñ #ð 	‡L�L—”ÔBÑ/AÓB—‘ÔBÑ/AÓBÓBÈ€LÔYØ�L‰L˜$˜¤u§}¡}Ó5€EØ	‡N�N”:×&Ò& u×'7Ñ'7¸Ó'<¼dÀ4»jÓIÔJØ€Lr   c                óä   € \         P                  ! RW 3R4      p\         P                  ! RW 3^ 4      pVP                  \        W3W#4      ^ W,
          ^,          34       VP	                  V4       V# )aX  Mask of a square picture shown through a wide rounded window (the middle `height` rows of the square).

Kodi lays the diffuse mask over the whole picture, also over the part an `aspectratio` scale crops away, so a mask
of the card's own size loses its corners. The card therefore draws the square cover uncropped and this mask opens
the window.r%   r   rB   )r   r   r5   r   r)   )r8   Úheightr   r   r,   r"   s   &&&&  r   Úbandr–   ‘   sb   € ô �IŠI�f˜u˜nÐ.@ÓA€EÜ�IŠI�c˜E˜>¨1Ó-€EØ	‡K�K”˜˜¨Ó9¸AÀÅÐSTÕ?TÐ;UÔVØ	‡N�N�5ÔØ€Lr   c                óØ  € R-p^V ,          p	\         P                  ! RR.R/4      p
V
P                  \        R4      4       / RV
bR\	        4       bRT;'       g    \        4       bR\        R0W˜R7      bR\        R	R
W˜R7      bR\        RRV	4      bR\        RRV	4      bR\        R1V	4      bR\        R2V 4      bR\        R3V 4      bR\        R4V 4      bR\        R5RRV	R7      bR\        R6RRV	R7      bR\        V^ ,          V^,          V	R7      bR\        RRV	R7      bR\        R7R RV	R7      bR!T;'       g    \        4       bR"T;'       g    \        R8V 4      R#T;'       g    \        R8V R9R:4      R$T;'       g    \        V R%7      R&T;'       g    \        R8V R;^ð4      R'\        R<V	4      R(\        R7V	R-R7      R)\        R=^4      R*\        R>^4      R+\        R>^R?R@^4      R,\        RA^4      /
C# )Baa  Every texture of the cinematic Home; skin.milionar.modern builds them again with its own shapes
(gen_modern_textures.py): `radius` of cards and buttons, and the images of the button, the ghost button, the card
and the focus frames (of a card, of a round card) when they are not the plain ones, and where a poster's dark foot starts and how dark it gets.r%   é€  zmask_circle.pngzrecord_grooves.pngzfocus_circle.pngzmask_square.png)r   zmask_music_wide.pngéŒ  ip  zmask_banner.pngéÔ  é(  zmask_genre.pngéð  éP  zmask_track.pngzmask_hero_cover.pngzmask_detail_cover.pngzmask_detail_track.pngzshade_music.pngg333333Ó?g¸…ëQ¸î?)rh   ri   r   zshade_genre.pngçš™™™™™Ù?zshade_poster.pngzshade_foot.pnggö(\�Âõè?gÍÌÌÌÌÌì?zshade_wide.pngrc   zhero_fade.pngz
button.pngzbutton_ghost.pngz	focus.png)r   zcard.pngzmask_poster.pngzmask_wide.pngz	badge.pngzmask_logo.pngzring_logo.pngzbar.png)TTFF)r˜   r˜   rB   )é°  rŸ   )é¨   r    )r�   r�   )é�  r¡   )éH   r¢   )rš   r›   )rœ   r�   )r™   in  rs   )é   é   é.   é¸   )r   r   r   r¢   ru   ©iÐ  i¸  )é(   é    )éP   rª   rf   )r   r   r   éT   )é   é   )r   r   r)   r|   r“   r~   r-   r–   rm   rb   r=   rM   )r   ÚbuttonÚghostÚcardÚframeÚposter_shader;   ÚfadeÚtopr   Úcircles   &&&&&&&&   r   Úbuildr¶   ž   sK  € ð
 %€CØ
ˆf�*€CÜ�YŠY�v˜zÐ+=Ó>€FØ
‡O�O”D˜“IÔðØ˜6ðàœg›iðð 	˜D×0Ð0¤J£Lðð 	œ5 ¨SÔ>ð	ð
 	œt C¨¨cÔ?ðð 	œ4  S¨#Ó.ðð 	œ$˜s C¨Ó-ðð 	œ% 
¨CÓ0ðð 	œu Z°Ó8ðð 	 ¤ z°6Ó!:ðð 	 ¤ x°Ó!8ðð 	œ5 °4À$ÈsÔSðð 	œ5 °4À$ÈsÔSðð 	œE¨°Q­À,ÈqÅ/ÐZ]Ô^ðð 	œ% d°SÀÔEðð  	œ% 
°#ÀÈCÔPð!ð" 	˜×,Ð,¤£ð#ð$ 	�f×7Ð7¤ h°Ó 7Ø˜E×gÐg¤X¨h¸Ð@QÐSfÓ%gØ�U×8Ð8œk°Ô8Ø�D×FÐFœE (¨F°LÀ#ÓFØœ5 ¨SÓ1Øœ˜z¨3Ð8RÔSØ”U˜8 QÓ'ð 	œ˜x¨Ó,Øœ (¨B°Ð>QÐSTÓUØ”5˜ !Ó$ñ;ð r   c                 ób  € \         P                  ! VR R7       V P                  4        F‚  w  r#\         P                  P	                  W4      p\         P                  ! \         P                  P                  V4      R R7       VP                  VR R7       \        RW#P                  4       K„  	  R# )T)Úexist_ok)ÚoptimizeÚwroteN)	ÚosÚmakedirsÚitemsÚpathÚjoinÚdirnameÚsaveÚprintr   )ÚimagesÚfolderÚnamer,   r¾   s   &&   r   rÁ   rÁ   È   sm   € Ü‡K‚K� Õ&Ø—|‘|–~‰ˆÜ�w‰w�|‰|˜FÓ)ˆÜ
�Š”B—G‘G—O‘O DÓ)°DÕ9Ø�
‰
�4 $ˆ
Ô'Üˆg�tŸZ™ZÖ(ó	 &r   Ú__main__)©TTTT))r   r   r   r   rÇ   )é   ))iæ  i  )gš™™™™™É?g{®Gázä?g¸…ëQ¸¾?)rž   g®Gáz®ç?rP   r§   )iÀ  r©   r­   é   rÈ   )r˜   )rc   rd   )Ú__doc__r»   ÚPILr   r   r   r   r¾   r¿   rÀ   ÚabspathÚ__file__ÚOUTr   ÚRADIUSr   r-   r=   rH   rM   rT   rb   rm   rx   r|   r~   r“   r–   r¶   rÁ   Ú__name__r    r   r   Ú<module>rÑ      sü   ðñó
 
ç 9Ó 9à‡g�g‡l�l�2—7‘7—?‘? 2§7¡7§?¡?°8Ó#<Ó=¸tÀTÈ;ÐXgÐipØ˜xó)€à€Ø	€ô-ôô
.òð  ¨!°!¸QÀvô ,òô
ð   °¸QÀ½ZÈSô ò`ò3ô,ôô
ð  ¨D°tÀ4ÐVbÐimÐtxô 'òT)ð ˆzÔÙ‰‹�#Öñ r   