Skip to content

Commit

Permalink
based_aa: remove mask_thr error raise
Browse files Browse the repository at this point in the history
  • Loading branch information
LightArrowsEXE committed Sep 23, 2024
1 parent 9eeb1b2 commit 74b4512
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions vsaa/funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@
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, 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
MISSING, 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 @@ -411,13 +410,8 @@ def based_aa(

if mask and not isinstance(mask, vs.VideoNode):
mask = EdgeDetect.ensure_obj(mask, based_aa)

if mask_thr > 255:
raise CustomOverflowError(
f'"mask_thr" must be less or equal than 255! ({mask_thr})', based_aa
)

mask = mask.edgemask(plane(func.work_clip, 0)).std.Binarize(scale_8bit(func.work_clip, mask_thr))
mask = mask.edgemask(plane(func.work_clip, 0))
mask = mask.std.Binarize(scale_8bit(func.work_clip, min(mask_thr, 255)))
mask = box_blur(mask.std.Maximum()).std.Limiter()

if show_mask:
Expand Down

0 comments on commit 74b4512

Please sign in to comment.