abstract ¶
Classes:
-
BoundingBox
– -
DeferredMask
–Abstract DeferredMask interface
-
GeneralMask
–Abstract GeneralMask interface
BoundingBox ¶
Bases: GeneralMask
Methods:
-
apply_mask
– -
get_mask
–
Attributes:
Source code
57 58 59 60 61 62 63 64 65 |
|
apply_mask ¶
apply_mask(
_clipa: VideoNode,
_clipb: VideoNode,
_ref: VideoNode | None = None,
/,
**kwargs: Any,
) -> ConstantFormatVideoNode
Source code
37 38 39 40 41 |
|
get_mask ¶
Source code
67 68 69 70 |
|
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
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
|
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
37 38 39 40 41 |
|
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
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 146 147 148 149 150 151 152 153 154 155 156 |
|
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
37 38 39 40 41 |
|