abstract ¶
Classes:
-
BoundingBox
– -
DeferredMask
–Abstract DeferredMask interface
-
GeneralMask
–Abstract GeneralMask interface
BoundingBox ¶
Bases: GeneralMask
Methods:
-
apply_mask
– -
get_mask
–
Attributes:
Source code
47 48 49 50 51 52 53 54 55 |
|
apply_mask ¶
apply_mask(
_clipa: VideoNode,
_clipb: VideoNode,
_ref: VideoNode | None = None,
/,
**kwargs: Any,
) -> ConstantFormatVideoNode
Source code
27 28 29 30 31 |
|
get_mask ¶
Source code
57 58 59 |
|
DeferredMask ¶
DeferredMask(
ranges: FrameRangeN | FrameRangesN | None = None,
bound: BoundingBox | None = None,
*,
blur: bool = False,
refframes: int | list[int | None] | None = None
)
Bases: GeneralMask
Abstract DeferredMask interface
Parameters:
-
ranges
¶FrameRangeN | FrameRangesN | None
, default:None
) –The frame ranges that the mask should be applied to.
-
bound
¶BoundingBox | None
, default:None
) –An optional bounding box that defines the area of the frame where the mask will be applied. If None, the mask applies to the whole frame.
-
blur
¶bool
, default:False
) –Whether to apply a box blur effect to the mask.
-
refframes
¶int | list[int | None] | None
, default:None
) –A list of reference frames used in building the final mask for each specified range. Must have the same length as
ranges
.
Methods:
-
apply_mask
– -
get_mask
–Get the constructed mask
Attributes:
-
blur
(bool
) – -
bound
(BoundingBox | None
) – -
ranges
(FrameRangesN
) – -
refframes
(list[int | None]
) –
Source code
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
|
ranges instance-attribute
¶
ranges: FrameRangesN = (
ranges
if isinstance(ranges, Sequence)
else [(0, None)] if ranges is None else [ranges]
)
apply_mask ¶
apply_mask(
_clipa: VideoNode,
_clipb: VideoNode,
_ref: VideoNode | None = None,
/,
**kwargs: Any,
) -> ConstantFormatVideoNode
Source code
27 28 29 30 31 |
|
get_mask ¶
Get the constructed mask
Parameters:
-
clip
¶VideoNode
) –Source clip.
-
ref
¶VideoNode
) –Reference clip.
-
**kwargs
¶Any
, default:{}
) –Keyword arguments passed to the internal
_mask
method.
Returns:
-
ConstantFormatVideoNode
–Constructed mask
Source code
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 |
|
GeneralMask ¶
Bases: ABC
Abstract GeneralMask interface
Methods:
-
apply_mask
– -
get_mask
–
apply_mask ¶
apply_mask(
_clipa: VideoNode,
_clipb: VideoNode,
_ref: VideoNode | None = None,
/,
**kwargs: Any,
) -> ConstantFormatVideoNode
Source code
27 28 29 30 31 |
|