Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, kernel: str, b: Union[float, int] = 0, c: Union[float, int] = 0, taps: int = 0):
"""
Get a scaler for getnative from descale
:param kernel: kernel for descale
:param b: b value for kernel "bicubic" (default 0)
:param c: c value for kernel "bicubic" (default 0)
:param taps: taps value for kernel "lanczos" (default 0)
"""
self.kernel = kernel
self.b = b
self.c = c
self.taps = taps
_d = plugin_from_identifier(core, "tegaf.asi.xe")
self.plugin = _d if _d is not None else get_attr(core, 'descale', None)
if self.plugin is None:
return
self.descaler = getattr(self.plugin, f'De{self.kernel}', None)
self.upscaler = getattr(core.resize, self.kernel.title())
self.check_input()
self.check_for_extra_paras()
def _getnative():
args = parser.parse_args()
if args.use:
source_filter = get_attr(core, args.use)
if not source_filter:
raise GetnativeException(f"{args.use} is not available.")
print(f"Using {args.use} as source filter")
else:
source_filter = get_source_filter(core, imwri, args)
src = source_filter(args.input_file)
mode = [None] # default
if args.mode == "bilinear":
mode = [common_scaler["bilinear"][0]]
elif args.mode == "bicubic":
mode = [scaler for scaler in common_scaler["bicubic"]]
elif args.mode == "bl-bc":
mode = [scaler for scaler in common_scaler["bicubic"]]
mode.append(common_scaler["bilinear"][0])