Skip to content

Commit

Permalink
hdcam: Move warn into helper function
Browse files Browse the repository at this point in the history
This prevents it from sending out the warning every single time the submodule gets loaded.
  • Loading branch information
LightArrowsEXE committed Dec 5, 2023
1 parent e19bae9 commit 1733df3
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions lvsfunc/hdcam.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@
]


warn(
"lvsfunc.hdcam: These are all experimental functions! "
"Please report any issues you find in the #lvsfunc channel in the JET discord!"
)
def _warn_hdcam() -> None:
warn(
"lvsfunc.hdcam: These are all experimental functions! "
"Please report any issues you find in the #lvsfunc channel in the JET discord!"
)


def hdcam_dering(
Expand Down Expand Up @@ -49,6 +50,8 @@ def hdcam_dering(
:return: Deringed clip or the ringing mask if show_mask=True.
"""
_warn_hdcam()

func = FunctionUtil(clip, hdcam_dering, 0, (vs.YUV, vs.GRAY), 16)

if not isinstance(kernel, vs.VideoNode):
Expand Down Expand Up @@ -121,7 +124,7 @@ def hdcam_dering(
nag1 = clip_y.std.Merge(nag, 0.5).std.MaskedMerge(nag, de_mask)

if callable(limiter):
deringed= limiter(nag, nag1, clip_y)
deringed = limiter(nag, nag1, clip_y)
elif limiter:
deringed = limit_filter(nag, nag1, clip_y)
else:
Expand Down

0 comments on commit 1733df3

Please sign in to comment.