MCPcopy Create free account
hub / github.com/Infiziert90/getnative / __init__

Method __init__

getnative/app.py:32–54  ·  view source on GitHub ↗

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: str, b: Union[float, int] = 0, c: Union[float, int] = 0, taps: int = 0)

Source from the content-addressed store, hash-verified

30
31class _DefineScaler:
32 def __init__(self, kernel: str, b: Union[float, int] = 0, c: Union[float, int] = 0, taps: int = 0):
33 """
34 Get a scaler for getnative from descale
35
36 :param kernel: kernel for descale
37 :param b: b value for kernel "bicubic" (default 0)
38 :param c: c value for kernel "bicubic" (default 0)
39 :param taps: taps value for kernel "lanczos" (default 0)
40 """
41
42 self.kernel = kernel
43 self.b = b
44 self.c = c
45 self.taps = taps
46 self.plugin = get_attr(core, 'descale', None)
47 if self.plugin is None:
48 return
49
50 self.descaler = getattr(self.plugin, f'De{self.kernel}', None)
51 self.upscaler = getattr(core.resize, self.kernel.title())
52
53 self.check_input()
54 self.check_for_extra_paras()
55
56 def check_for_extra_paras(self):
57 if self.kernel == 'bicubic':

Callers

nothing calls this directly

Calls 3

check_inputMethod · 0.95
check_for_extra_parasMethod · 0.95
get_attrFunction · 0.90

Tested by

no test coverage detected