Skip to content

DGIndex

Bases: D2VWitch

Methods:

get_cmd

get_cmd(
    files: list[SPath],
    output: SPath,
    idct_algo: int = 5,
    field_op: int = 2,
    yuv_to_rgb: int = 1,
) -> list[str]
Source code
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
def get_cmd(
    self, files: list[SPath], output: SPath,
    idct_algo: int = 5, field_op: int = 2, yuv_to_rgb: int = 1
) -> list[str]:
    is_linux = os.name != 'nt'

    if is_linux:
        output = SPath(f'Z:\\{str(output)[1:]}')
        paths = list(subprocess.check_output(['winepath', '-w', f]).decode('utf-8').strip() for f in files)
    else:
        paths = list(map(str, files))

    return list(map(str, [
        self._get_bin_path(),
        '-i', *paths, '-ia', idct_algo, '-fo', field_op, '-yr', yuv_to_rgb,
        '-om', '0', '-o', output.with_suffix(""), '-hide', '-exit'
    ]))