Skip to content

Commit

Permalink
lol
Browse files Browse the repository at this point in the history
  • Loading branch information
shssoichiro committed Oct 14, 2024
1 parent 032a9f1 commit 2504281
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,6 @@ dmypy.json
# Pyre type checker
.pyre/

# Local test file
*test*.py

# Editor local configs
.vscode
.idea
Expand Down
26 changes: 26 additions & 0 deletions tests/test_funcs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from unittest import TestCase

import vapoursynth as vs
from vskernels import Bicubic, Bilinear

from vsscale import MergeScalers


class TestFuncs(TestCase):
def test_merge_scalers_downscale(self) -> None:
input = vs.core.std.BlankClip(width=1920, height=1080, format=vs.YUV420P8)
scaler = MergeScalers((Bicubic, 0.5), (Bilinear, 0.5))
output = scaler.scale(input, 1280, 720)
self.assertEqual(output.width, 1280)
self.assertEqual(output.height, 720)
self.assertEqual(output.format.color_family, vs.YUV)
self.assertEqual(output.format.bits_per_sample, 8)

def test_merge_scalers_upscale(self) -> None:
input = vs.core.std.BlankClip(width=1280, height=720, format=vs.YUV420P8)
scaler = MergeScalers((Bicubic, 0.5), (Bilinear, 0.5))
output = scaler.scale(input, 1920, 1080)
self.assertEqual(output.width, 1920)
self.assertEqual(output.height, 1080)
self.assertEqual(output.format.color_family, vs.YUV)
self.assertEqual(output.format.bits_per_sample, 8)

0 comments on commit 2504281

Please sign in to comment.