From 1be6d4b23618c13c32e7b84c9d2b8f56654204ec Mon Sep 17 00:00:00 2001 From: LightArrowsEXE Date: Mon, 23 Sep 2024 08:51:28 +0200 Subject: [PATCH] based_aa: Add rfactor value check --- vsaa/funcs.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/vsaa/funcs.py b/vsaa/funcs.py index f97592b..f3eff8f 100644 --- a/vsaa/funcs.py +++ b/vsaa/funcs.py @@ -9,8 +9,9 @@ from vsmasktools import EdgeDetect, EdgeDetectT, Prewitt, ScharrTCanny from vsrgtools import MeanMode, RepairMode, box_blur, contrasharpening_median, repair, unsharp_masked from vstools import ( - MISSING, CustomOverflowError, CustomRuntimeError, FormatsMismatchError, FunctionUtil, KwargsT, MissingT, PlanesT, - VSFunction, get_h, get_peak_value, get_w, get_y, join, normalize_planes, plane, scale_8bit, scale_value, split, vs + MISSING, CustomOverflowError, CustomRuntimeError, CustomValueError, FormatsMismatchError, FunctionUtil, KwargsT, + MissingT, PlanesT, VSFunction, get_h, get_peak_value, get_w, get_y, join, normalize_planes, plane, scale_8bit, + scale_value, split, vs ) from .abstract import Antialiaser, SingleRater @@ -402,6 +403,9 @@ def based_aa( and max(aah, func.work_clip.height) % min(aah, func.work_clip.height) == 0 ) else Catrom + if rfactor <= 0.0: + raise CustomValueError('rfactor must be greater than 0!', based_aa, rfactor) + if rfactor < 1.0: downscaler, supersampler = supersampler, downscaler