Skip to content

base

ShaderFileBase

Bases: ShaderFileCustomBase, CustomStrEnum

CUSTOM instance-attribute

value instance-attribute

value: str

ShaderFileCustom

Bases: ShaderFile

CUSTOM class-attribute instance-attribute

CUSTOM = 'custom'

FSRCNNX_x16 class-attribute instance-attribute

FSRCNNX_x16 = 'FSRCNNX_x2_16-0-4-1.glsl'

FSRCNNX_x56 class-attribute instance-attribute

FSRCNNX_x56 = 'FSRCNNX_x2_56-16-4-1.glsl'

FSRCNNX_x8 class-attribute instance-attribute

FSRCNNX_x8 = 'FSRCNNX_x2_8-0-4-1.glsl'

SSIM_DOWNSCALER class-attribute instance-attribute

SSIM_DOWNSCALER = 'SSimDownscaler.glsl'

SSIM_SUPERSAMPLER class-attribute instance-attribute

SSIM_SUPERSAMPLER = 'SSimSuperRes.glsl'

value instance-attribute

value: str

__call__

__call__() -> Path
__call__(file_name: str | Path) -> Path
__call__(file_name: str | Path | MissingT = MISSING) -> Path

Get a path from the shader member, name or path.

Source code
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
def __call__(self, file_name: str | Path | MissingT = MISSING) -> Path:
    """Get a path from the shader member, name or path."""

    if self is not ShaderFile.CUSTOM:
        file_name = self.value

    if file_name is MISSING:  # type: ignore
        raise TypeError("ShaderFile.__call__() missing 1 required positional argument: 'file_name'")

    file_name, cwd = Path(file_name), Path.cwd()

    assets_dirs = [
        file_name,
        cwd / file_name,
        cwd / '.shaders' / file_name,
        cwd / '_shaders' / file_name,
        cwd / '.assets' / file_name,
        cwd / '_assets' / file_name
    ]

    for asset_dir in assets_dirs:
        if asset_dir.is_file():
            return asset_dir

    mpv_dir = get_user_data_dir().parent / 'Roaming' / 'mpv' / 'shaders' / file_name

    if mpv_dir.is_file():
        return mpv_dir

    raise FileWasNotFoundError(f'"{file_name}" could not be found!', str(ShaderFile.CUSTOM))

ShaderFileCustomBase

CUSTOM instance-attribute