From 07290b2095ef6de7854a915899b1b555983ea680 Mon Sep 17 00:00:00 2001 From: Nayam Amarshe <25067102+NayamAmarshe@users.noreply.github.com> Date: Sun, 9 Apr 2023 09:24:08 +0530 Subject: [PATCH] Added gitignore --- .gitignore | 3 +- main/utils/getArguments.js | 109 +++++++++++++++++++++++++++++++++++++ 2 files changed, 111 insertions(+), 1 deletion(-) create mode 100644 main/utils/getArguments.js diff --git a/.gitignore b/.gitignore index 8d88d9d..fe15be6 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,8 @@ /.pnp .pnp.js +/main/*.js + # testing /coverage @@ -42,4 +44,3 @@ build-dir/ #vscode .vscode/ -main/* \ No newline at end of file diff --git a/main/utils/getArguments.js b/main/utils/getArguments.js new file mode 100644 index 0000000..6f76d6c --- /dev/null +++ b/main/utils/getArguments.js @@ -0,0 +1,109 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getBatchSharpenArguments = exports.getBatchArguments = exports.getDoubleUpscaleSecondPassArguments = exports.getDoubleUpscaleArguments = exports.getSingleImageSharpenArguments = exports.getSingleImageArguments = void 0; +const getSingleImageArguments = (inputDir, fullfileName, outFile, modelsPath, model, scale, gpuId, saveImageAs) => { + return [ + "-i", + inputDir + "/" + fullfileName, + "-o", + outFile, + "-s", + scale == "2" ? "4" : scale, + "-m", + modelsPath, + "-n", + model, + gpuId ? `-g ${gpuId}` : "", + "-f", + saveImageAs, + ]; +}; +exports.getSingleImageArguments = getSingleImageArguments; +const getSingleImageSharpenArguments = (inputDir, fullfileName, outFile, modelsPath, model, scale, gpuId, saveImageAs) => { + return [ + "-i", + inputDir + "/" + fullfileName, + "-o", + outFile, + "-s", + scale, + "-x", + "-m", + modelsPath + "/" + model, + gpuId ? `-g ${gpuId}` : "", + "-f", + saveImageAs, + ]; +}; +exports.getSingleImageSharpenArguments = getSingleImageSharpenArguments; +const getDoubleUpscaleArguments = (inputDir, fullfileName, outFile, modelsPath, model, gpuId, saveImageAs) => { + return [ + "-i", + inputDir + "/" + fullfileName, + "-o", + outFile, + "-s", + "4", + "-m", + modelsPath, + "-n", + model, + gpuId ? `-g ${gpuId}` : "", + "-f", + saveImageAs, + ]; +}; +exports.getDoubleUpscaleArguments = getDoubleUpscaleArguments; +const getDoubleUpscaleSecondPassArguments = (isAlpha, outFile, modelsPath, model, gpuId, saveImageAs) => { + return [ + "-i", + isAlpha ? outFile + ".png" : outFile, + "-o", + isAlpha ? outFile + ".png" : outFile, + "-s", + "4", + "-m", + modelsPath, + "-n", + model, + gpuId ? `-g ${gpuId}` : "", + "-f", + isAlpha ? "" : saveImageAs, + ]; +}; +exports.getDoubleUpscaleSecondPassArguments = getDoubleUpscaleSecondPassArguments; +const getBatchArguments = (inputDir, outputDir, modelsPath, model, gpuId, saveImageAs) => { + return [ + "-i", + inputDir, + "-o", + outputDir, + "-s", + "4", + "-m", + modelsPath, + "-n", + model, + gpuId ? `-g ${gpuId}` : "", + "-f", + saveImageAs, + ]; +}; +exports.getBatchArguments = getBatchArguments; +const getBatchSharpenArguments = (inputDir, outputDir, modelsPath, model, gpuId, saveImageAs) => { + return [ + "-i", + inputDir, + "-o", + outputDir, + "-s", + "4", + "-x", + "-m", + modelsPath + "/" + model, + gpuId ? `-g ${gpuId}` : "", + "-f", + saveImageAs, + ]; +}; +exports.getBatchSharpenArguments = getBatchSharpenArguments;