Skip to content

Commit

Permalink
Fix kwargs in SampleGridModel
Browse files Browse the repository at this point in the history
Fix #33
  • Loading branch information
Setsugennoao committed Aug 10, 2024
1 parent baeeeb6 commit 766eb6f
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions vskernels/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,8 @@ class SampleGridModel(CustomIntEnum):
MATCH_CENTERS = 1

def __call__(
self, width: int, height: int, src_width: int, src_height: int, shift: tuple[float, float]
self, width: int, height: int, src_width: int, src_height: int, shift: tuple[float, float], kwargs: KwargsT
) -> tuple[KwargsT, tuple[float, float]]:
kwargs = KwargsT()

if self is SampleGridModel.MATCH_CENTERS:
src_width = src_width * (width - 1) / (src_width - 1)
src_height = src_height * (height - 1) / (src_height - 1)
Expand All @@ -67,15 +65,15 @@ def for_scale(
src_width = kwargs.get('src_width', width)
src_height = kwargs.get('src_height', height)

return self(src_width, src_height, width, height, shift)
return self(src_width, src_height, width, height, shift, kwargs)

def for_descale(
self, clip: vs.VideoNode, width: int, height: int, shift: tuple[float, float], **kwargs: Any
) -> tuple[KwargsT, tuple[float, float]]:
src_width = kwargs.get('src_width', clip.width)
src_height = kwargs.get('src_height', clip.height)

return self(width, height, src_width, src_height, shift)
return self(width, height, src_width, src_height, shift, kwargs)


TopShift: TypeAlias = float
Expand Down

0 comments on commit 766eb6f

Please sign in to comment.