
    lj7                    j   d dl mZ d dlZd dlZd dlZd dlmZ d dlmZm	Z	m
Z
 d dlmZmZ erd dlmZmZ dgZ ej        d          ZdMdZdNdZ e
d e	ddedd           e	ddddd           e	d eg dd !          d"           e	d#d$ddd%&           e	d'd(d e e ed)  ej                    D                                 d !          d*d+                     ed,  ej                    D                                 z   -           e	d.d/edd01           e	d2d3d4edd56           e	d7 ed8 eD             d !          d9d:;           e	d<d=ddd>?           e	d@dAdddB&           e	dCdddD&           e	dEdFddGH           e	dIddJd           e	dKddLd                    ZdS )O    )annotationsN)TYPE_CHECKING)Choiceoptionoption_group)	QUALITIESRendererType)ContextOptionrender_optionsmanimctxr
   paramr   value
str | Nonereturn#tuple[int] | tuple[int, int] | Nonec                ,   |dS 	 t          |          }|fS # t          $ r Y nw xY w	 t          t           t          j        d|                    \  }}n=# t          $ r0 t
                              d           t          j                     Y nw xY w||fS )a  If the ``value`` string is given, extract from it the scene range, which
    should be in any of these formats: 'start', 'start;end', 'start,end' or
    'start-end'. Otherwise, return ``None``.

    Parameters
    ----------
    ctx
        The Click context.
    param
        A Click option.
    value
        The optional string which will be parsed.

    Returns
    -------
    tuple[int] | tuple[int, int] | None
        If ``value`` is ``None``, the return value is ``None``. Otherwise, it's
        the scene range, given by a tuple which may contain a single value
        ``start`` or two values ``start`` and ``end``.

    Raises
    ------
    ValueError
        If ``value`` has an invalid format.
    N[;,\-]z)Couldn't determine a range for -n option.)	int	Exceptionmapresplitloggererrorsysexit)r   r   r   startends        Z/home/agentuser/manim-venv/lib/python3.11/site-packages/manim/cli/render/render_options.pyvalidate_scene_ranger"      s    8 }tE

x   bhy%8899
ss   @AAA




 #:s    
%%+A 7BBtuple[int, int] | Nonec                    |dS 	 t          t          t          j        d|                    \  }}n=# t          $ r0 t
                              d           t          j                     Y nw xY w||fS )aN  If the ``value`` string is given, extract from it the resolution, which
    should be in any of these formats: 'W;H', 'W,H' or 'W-H'. Otherwise, return
    ``None``.

    Parameters
    ----------
    ctx
        The Click context.
    param
        A Click option.
    value
        The optional string which will be parsed.

    Returns
    -------
    tuple[int, int] | None
        If ``value`` is ``None``, the return value is ``None``. Otherwise, it's
        the resolution as a ``(W, H)`` tuple.

    Raises
    ------
    ValueError
        If ``value`` has an invalid format.
    Nr   zResolution option is invalid.)	r   r   r   r   r   r   r   r   r   )r   r   r   widthheights        r!   validate_resolutionr'   B   s}    6 }tC)U!;!;<<vv   4555




 &=s   +2 7A,+A,zRender Optionsz-nz--from_animation_numberz]Start rendering from n_0 until n_1. If n_1 is left unspecified, renders all scenes after n_0.)callbackhelpdefaultz-az--write_allTz$Render all scenes in the input file.)is_flagr)   r*   z--format)pnggifmp4webmmovF)case_sensitive)typer*   z-sz--save_last_framez>Render and save only the last frame of a scene as a PNG image.)r*   r+   r)   z-qz	--qualityc                .    g | ]}|d          
|d          S )flag .0qs     r!   
<listcomp>r9      s%    NNNAfIN1V9NNN    zBRender quality at the follow resolution framerates, respectively: z, c                X    g | ]'}|d          
|d          d|d          d|d          d(S )r4   pixel_widthxpixel_height 
frame_rateFPSr5   r6   s     r!   r9   r9      sY       y'RR!N*;RRaoRRR  r:   )r*   r2   r)   z-rz--resolutionz>Resolution in "W,H" for when 16:9 aspect ratio isn't possible.)r(   r*   r)   z--fpsz--frame_rater@   zRender at this frame rate.)r2   r*   r)   z
--rendererc                    g | ]	}|j         
S r5   )r   )r7   renderer_types     r!   r9   r9      s    CCC]] CCCr:   z!Select a renderer for your Scene.cairo)r2   r)   r*   z-gz--save_pngsz$Save each frame as png (Deprecated).)r+   r*   r)   z-iz--save_as_gifzSave as a gif (Deprecated).z--save_sectionsz.Save section videos in addition to movie file.z-tz--transparentz!Render scenes with alpha channel.)r+   r)   z--use_projection_fill_shaderszVUse shaders for OpenGLVMobject fill which are compatible with transformation matrices.z--use_projection_stroke_shaderszXUse shaders for OpenGLVMobject stroke which are compatible with transformation matrices.)r   r
   r   r   r   r   r   r   )r   r
   r   r   r   r   r   r#   )
__future__r   loggingr   r   typingr   cloupr   r   r   manim.constantsr   r	   clickr
   r   __all__	getLoggerr   r"   r'   listreversedvaluesjoinfloatr   r5   r:   r!   <module>rR      s   " " " " " "  				 



             . . . . . . . . . . 3 3 3 3 3 3 3 3 &%%%%%%%%
		7	#	#+ + + +\$ $ $ $N 
F!%(   F3   FV888OOO  
 FM   FVDNN.>i.>.@.@NNNOOPP 
 
 
 R
))H -Y-//   
 
	
  & F$N   F)   FVCClCCC 
 
 
 1   F3   F*   F=	   F0	   F'e	   F)g	  Qn nr:   