
    W|h                     D    S SK Jr  S SKrS SKJr  \ " S S\5      5       rg)    )	dataclassN)Effectc                   <    \ rS rSr% SrSr\\S'   Sr\	\S'   S r
Srg)	BlackAndWhite   zDesaturates the picture, makes it black and white.
Parameter RGB allows to set weights for the different color
channels.
If RBG is 'CRT_phosphor' a special set of values is used.
preserve_luminosity maintains the sum of RGB to 1.
NRGBTpreserve_luminosityc                 8  ^^^ U R                   c	  / SQU l         U R                   S:X  a	  / SQU l         S[        R                  " U R                   5      -  U R                  (       a  [	        U R                   5      OS-  u  mmmUUU4S jnUR                  U5      $ )zApply the effect to the clip.)   r   r   CRT_phosphor)g333333?gjq?gL
F%u?g      ?r   c                    > TU S S 2S S 2S4   -  TU S S 2S S 2S4   -  -   TU S S 2S S 2S4   -  -   n [         R                  " SU /-  5      R                  S5      $ )Nr   r         uint8)npdstackastype)imBGRs    X/home/james-whalen/.local/lib/python3.13/site-packages/moviepy/video/fx/BlackAndWhite.pyfilter#BlackAndWhite.apply.<locals>.filter"   s\    R1a[1r!Q'{?2QAq!G_DB99Q"X&--g66    )r   r   arrayr	   sumimage_transform)selfclipr   r   r   r   s      @@@r   applyBlackAndWhite.apply   s    88 DH88~%/DH hhtxx ! $ 8 8s488}aA 	1a	7 ##F++r   )r   )__name__
__module____qualname____firstlineno____doc__r   str__annotations__r	   boolr!   __static_attributes__ r   r   r   r      s"     CO $$,r   r   )dataclassesr   numpyr   moviepy.Effectr   r   r,   r   r   <module>r0      s)    !  ! ,F , ,r   