Skip to content

Commit

Permalink
Rename SampleGridModel methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Setsugennoao committed Aug 21, 2024
1 parent 0535340 commit 32a081c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions vskernels/kernels/abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,8 @@ def descale( # type: ignore[override]
sh if isinstance(sh, tuple) else (sh, sh) for sh in shift
)

kwargs_tf, shift = sample_grid_model.for_descale(clip, width, height, (shift_y[0], shift_x[0]), **kwargs)
kwargs_bf, shift = sample_grid_model.for_descale(clip, width, height, (shift_y[1], shift_x[1]), **kwargs)
kwargs_tf, shift = sample_grid_model.for_src(clip, width, height, (shift_y[0], shift_x[0]), **kwargs)
kwargs_bf, shift = sample_grid_model.for_src(clip, width, height, (shift_y[1], shift_x[1]), **kwargs)

de_kwargs_tf = self.get_descale_args(clip, (shift_y[0], shift_x[0]), *de_base_args, **kwargs_tf)
de_kwargs_bf = self.get_descale_args(clip, (shift_y[1], shift_x[1]), *de_base_args, **kwargs_bf)
Expand All @@ -322,7 +322,7 @@ def descale( # type: ignore[override]
if any(isinstance(sh, tuple) for sh in shift):
raise CustomValueError('You can\'t descale per-field when the input is progressive!', self.descale)

kwargs, shift = sample_grid_model.for_descale(clip, width, height, shift, **kwargs) # type: ignore
kwargs, shift = sample_grid_model.for_src(clip, width, height, shift, **kwargs) # type: ignore

de_kwargs = self.get_descale_args(clip, shift, *de_base_args, **kwargs) # type: ignore

Expand Down
2 changes: 1 addition & 1 deletion vskernels/kernels/complex.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def scale( # type: ignore[override]

kwargs, shift, out_sar = self._handle_crop_resize_kwargs(clip, width, height, shift, **kwargs)

kwargs, shift = sample_grid_model.for_scale(clip, width, height, shift, **kwargs)
kwargs, shift = sample_grid_model.for_dst(clip, width, height, shift, **kwargs)

padded = border_handling.prepare_clip(clip, self.kernel_radius)

Expand Down
4 changes: 2 additions & 2 deletions vskernels/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ def __call__(

return kwargs, shift

def for_scale(
def for_dst(
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', width)
src_height = kwargs.get('src_height', height)

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

def for_descale(
def for_src(
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)
Expand Down

0 comments on commit 32a081c

Please sign in to comment.