
    kj"                     J    d dl mZmZ d dlmZ d dlmZ  G d de          ZdS )    )AnyOptional)Image)ResourceDescriptionc            #       h    e Zd ZdZdZdZ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d*dee         d	ee         d
ededededee	e
e
f                  dedee         dee
         dee         dee         dee         dee         dee         dee         def" fdZedee         fd            Zedee         fd            Zedee         fd            Zej        deddfd            Zedee	e
e
f                  fd             Zedee
         fd!            Zedee         fd"            Zedee         fd#            Zedee         fd$            Zedee         fd%            Zedee         fd&            Zedee         fd'            Zedee         fd(            Zedee         fd)            Z xZS )+TextureDescriptiona  Describes a texture to load.

    Example:

    .. code:: python

        # Loading a 2d texture
        TextureDescription(path='textures/wood.png')

        # Loading a 2d texture with mimpmaps with anisotropy
        TextureDescription(path='textures/wood.png', mipmap=True, anisotropy=16.0)

        # Loading texture array containing 10 layers
        TextureDescription(path='textures/tiles.png', layers=10, kind='array')
    2dtexturesNTF      ?pathkindflipflip_xflip_ymipmapmipmap_levels
anisotropyimagelayerspos_xpos_ypos_zneg_xneg_yneg_zkwargsc                     |                     ||||o|||||
|	||||||d            t                      j        di | dS )aa  Describes a texture resource

        Args:
            path (str): path to resource relative to search directories
            kind (str): The kind of loader to use
            flip (boolean): (use flip_y) Flip the image vertically (top to bottom)
            flip_x (boolean): Flip the image horizontally (left to right)
            flip_y (boolean): Flip the image vertically (top to bottom)
            mipmap (bool): Generate mipmaps. Will generate max possible levels unless
                           `mipmap_levels` is defined.
            mipmap_levels (tuple): (base, max_level) controlling mipmap generation.
                                   When defined the `mipmap` parameter is automatically `True`.
            anisotropy (float): Number of samples for anisotropic filtering
            image: PIL image for when loading embedded resources
            layers: (int): Number of layers for texture arrays
            neg_x (str): Path to negative x texture in a cube map
            neg_y (str): Path to negative y texture in a cube map
            neg_z (str): Path to negative z texture in a cube map
            pos_x (str): Path to positive x texture in a cube map
            pop_y (str): Path to positive y texture in a cube map
            pos_z (str): Path to positive z texture in a cube map
            **kwargs: Any optional/custom attributes
        )r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   N )updatesuper__init__)selfr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   	__class__s                     W/home/agentuser/manim-venv/lib/python3.11/site-packages/moderngl_window/meta/texture.pyr!   zTextureDescription.__init__   s|    V 	 /6 !.(  	
 	
 	
& 	""6"""""    returnc                 6    | j                             d          S )zAbool: If the image should be flipped horizontally (left to right)r   _kwargsgetr"   s    r$   r   zTextureDescription.flip_x\        |)))r%   c                 6    | j                             d          S )z?bool: If the image should be flipped vertically (top to bottom)r   r(   r+   s    r$   r   zTextureDescription.flip_ya   r,   r%   c                 6    | j                             d          S )z$bool: If mipmaps should be generatedr   r(   r+   s    r$   r   zTextureDescription.mipmapf   r,   r%   valuec                     || j         d<   d S )Nr   )r)   )r"   r/   s     r$   r   zTextureDescription.mipmapk   s    !&Xr%   c                 6    | j                             d          S )z6tuple[int, int]: base, max_level for mipmap generationr   r(   r+   s    r$   r   z TextureDescription.mipmap_levelso   s     |000r%   c                 6    | j                             d          S )z&int: Number of layers in texture arrayr   r(   r+   s    r$   r   zTextureDescription.layerst   r,   r%   c                 6    | j                             d          S )z2float: Number of samples for anisotropic filteringr   r(   r+   s    r$   r   zTextureDescription.anisotropyy   s     |---r%   c                 6    | j                             d          S )z0Image: PIL image when loading embedded resourcesr   r(   r+   s    r$   r   zTextureDescription.image~        |(((r%   c                 6    | j                             d          S )z,str: Path to positive x in a cubemap texturer   r(   r+   s    r$   r   zTextureDescription.pos_x   r5   r%   c                 6    | j                             d          S )z,str: Path to positive y in a cubemap texturer   r(   r+   s    r$   r   zTextureDescription.pos_y   r5   r%   c                 6    | j                             d          S )z,str: Path to positive z in a cubemap texturer   r(   r+   s    r$   r   zTextureDescription.pos_z   r5   r%   c                 6    | j                             d          S )z,str: Path to negative x in a cubemap texturer   r(   r+   s    r$   r   zTextureDescription.neg_x   r5   r%   c                 6    | j                             d          S )z,str: Path to negative y in a cubemap texturer   r(   r+   s    r$   r   zTextureDescription.neg_y   r5   r%   c                 6    | j                             d          S )z,str: Path to negative z in a cubemap texturer   r(   r+   s    r$   r   zTextureDescription.neg_z   r5   r%   )NNTFTFNr   NNNNNNNN)__name__
__module____qualname____doc__default_kindresource_typer   strbooltupleintfloatr   r   r!   propertyr   r   r   setterr   r   r   r   r   r   r   r   r   r   __classcell__)r#   s   @r$   r   r      s          LM #"37!% $#######># >#sm># sm># 	>#
 ># ># >#  c3h0># ># ># ># }># }># }># }>#  }!>#" }#>#$ %># ># ># ># ># >#@ * * * * X* * * * * X* * * * * X* ]'E 'd ' ' ' ]' 1xc3h8 1 1 1 X1 * * * * X* .HUO . . . X. )x ) ) ) X) )x} ) ) ) X) )x} ) ) ) X) )x} ) ) ) X) )x} ) ) ) X) )x} ) ) ) X) )x} ) ) ) X) ) ) ) )r%   r   N)typingr   r   	PIL.Imager   moderngl_window.meta.baser   r   r   r%   r$   <module>rM      s                          9 9 9 9 9 9W) W) W) W) W), W) W) W) W) W)r%   