diff --git a/vskernels/kernels/bicubic.py b/vskernels/kernels/bicubic.py index 555a9c5..3ef82f2 100644 --- a/vskernels/kernels/bicubic.py +++ b/vskernels/kernels/bicubic.py @@ -3,8 +3,7 @@ from math import acos, asinh, cos, sqrt from typing import TYPE_CHECKING, Any -from stgpytools import classproperty -from vstools import CustomValueError, core, vs +from vstools import CustomValueError, core, vs, inject_self from .complex import ComplexKernel @@ -69,7 +68,7 @@ def get_params_args( return args | dict(b=self.b, c=self.c) return args | dict(filter_param_a=self.b, filter_param_b=self.c) - @classproperty + @inject_self.property def kernel_size(self) -> int: return 1 + ((self.b, self.c) != (0, 0)) diff --git a/vskernels/kernels/placebo.py b/vskernels/kernels/placebo.py index 0afe2c6..8c44dfa 100644 --- a/vskernels/kernels/placebo.py +++ b/vskernels/kernels/placebo.py @@ -3,7 +3,6 @@ from math import ceil from typing import TYPE_CHECKING, Any -from stgpytools import classproperty from vstools import Transfer, TransferT, core, fallback, inject_self, vs from .complex import LinearScaler @@ -94,6 +93,6 @@ def _kernel_size(self, taps: float | None = None, b: float | None = None, c: flo return 1 - @classproperty + @inject_self.property def kernel_size(self) -> int: return self._kernel_size(self.taps, self.b, self.c) diff --git a/vskernels/kernels/resize.py b/vskernels/kernels/resize.py index 4bddc59..95606ea 100644 --- a/vskernels/kernels/resize.py +++ b/vskernels/kernels/resize.py @@ -3,8 +3,7 @@ from math import ceil from typing import Any -from stgpytools import classproperty -from vstools import core, vs +from vstools import core, vs, inject_self from .zimg import ZimgComplexKernel @@ -27,7 +26,7 @@ class Bilinear(ZimgComplexKernel): scale_function = resample_function = core.lazy.resize.Bilinear descale_function = core.lazy.descale.Debilinear - @classproperty + @inject_self.property def kernel_size(self) -> int: return 1 @@ -58,6 +57,6 @@ def get_params_args( return args | dict(taps=self.taps) return args | dict(filter_param_a=self.taps) - @classproperty + @inject_self.property def kernel_size(self) -> int: return ceil(self.taps) diff --git a/vskernels/kernels/spline.py b/vskernels/kernels/spline.py index bff41d4..6f0acf4 100644 --- a/vskernels/kernels/spline.py +++ b/vskernels/kernels/spline.py @@ -4,8 +4,7 @@ from math import ceil, isqrt from typing import Any -from stgpytools import classproperty -from vstools import core +from vstools import core, inject_self from .zimg import ZimgComplexKernel from .fmtconv import FmtConv @@ -21,7 +20,7 @@ class _SplineKernelSize: """Spline kernel size sub-class.""" - @classproperty + @inject_self.property def kernel_size(self) -> int: radius = re.search(r'\d+$', self.__class__.__name__) @@ -39,7 +38,7 @@ class Spline(FmtConv): def __init__(self, taps: int = 2, **kwargs: Any) -> None: super().__init__(taps=taps, **kwargs) - @classproperty + @inject_self.property def kernel_size(self) -> int: return ceil(self.taps)