Skip to content

Commit

Permalink
Add inject_kwargs_params to get_scale/descale/resample_args
Browse files Browse the repository at this point in the history
  • Loading branch information
Setsugennoao committed Dec 14, 2023
1 parent 3ddc52b commit 9cf8ea1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions vskernels/kernels/abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ def multi(

return self.scale(clip, dst_width, dst_height, shift, **kwargs)

@inject_kwargs_params
def get_scale_args(
self, clip: vs.VideoNode, shift: tuple[TopShift, LeftShift] = (0, 0),
width: int | None = None, height: int | None = None,
Expand Down Expand Up @@ -289,6 +290,7 @@ def descale( # type: ignore[override]

return depth(descaled, bits)

@inject_kwargs_params
def get_descale_args(
self, clip: vs.VideoNode, shift: tuple[TopShift, LeftShift] = (0, 0),
width: int | None = None, height: int | None = None,
Expand Down Expand Up @@ -503,6 +505,7 @@ def get_params_args(
) -> KwargsT:
return dict(width=width, height=height) | kwargs

@inject_kwargs_params
def get_scale_args(
self, clip: vs.VideoNode, shift: tuple[TopShift, LeftShift] = (0, 0),
width: int | None = None, height: int | None = None,
Expand All @@ -514,6 +517,7 @@ def get_scale_args(
| self.get_params_args(False, clip, width, height, **kwargs)
)

@inject_kwargs_params
def get_descale_args(
self, clip: vs.VideoNode, shift: tuple[TopShift, LeftShift] = (0, 0),
width: int | None = None, height: int | None = None,
Expand All @@ -525,6 +529,7 @@ def get_descale_args(
| self.get_params_args(True, clip, width, height, **kwargs)
)

@inject_kwargs_params
def get_resample_args(
self, clip: vs.VideoNode, format: int | VideoFormatT | HoldsVideoFormatT,
matrix: MatrixT | None, matrix_in: MatrixT | None,
Expand Down
1 change: 1 addition & 0 deletions vskernels/kernels/fmtconv.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ def _clean_args(self, **kwargs: Any) -> dict[str, Any]:

return kwargs

@inject_kwargs_params
def get_scale_args(
self, clip: vs.VideoNode, shift: tuple[TopShift, LeftShift] = (0, 0),
width: int | None = None, height: int | None = None,
Expand Down
1 change: 1 addition & 0 deletions vskernels/kernels/placebo.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def scale( # type: ignore[override]
trc=Transfer.from_param_or_video(curve, clip).value_libplacebo
)

@inject_kwargs_params
def get_scale_args(
self, clip: vs.VideoNode, shift: tuple[TopShift, LeftShift] = (0, 0),
width: int | None = None, height: int | None = None,
Expand Down

0 comments on commit 9cf8ea1

Please sign in to comment.