Skip to content

Commit

Permalink
based_aa: Add rfactor value check
Browse files Browse the repository at this point in the history
  • Loading branch information
LightArrowsEXE committed Sep 23, 2024
1 parent 52ffa9f commit 1be6d4b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions vsaa/funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 1be6d4b

Please sign in to comment.