freqs ¶
Classes:
-
MeanMode
–Enum of different mean for combining clips.
MeanMode ¶
Bases: CustomEnum
Enum of different mean for combining clips.
Methods:
-
__call__
–Applies the selected mean to multiple clips.
-
expr
–Builds a mean expression using a specified mode.
-
single
–Applies the selected mean to one clip, spatially or temporally.
Attributes:
-
ARITHMETIC
–Arithmetic mean.
-
CONTRAHARMONIC
–Contraharmonic mean, implemented as a Lehmer mean withs p=2
-
GEOMETRIC
–Geometric mean, implemented as a Lehmer mean with p=0.5.
-
HARMONIC
–Harmonic mean, implemented as a Lehmer mean with p=0.
-
LEHMER
–Lehmer mean, configurable with parameter
p
. -
MAXIMUM
–Maximum value across all clips
-
MEDIAN
–Median value across all clips
-
MINIMUM
–Minimum value across all clips
CONTRAHARMONIC class-attribute
instance-attribute
¶
CONTRAHARMONIC = 2
Contraharmonic mean, implemented as a Lehmer mean withs p=2
GEOMETRIC class-attribute
instance-attribute
¶
GEOMETRIC = 0.5
Geometric mean, implemented as a Lehmer mean with p=0.5.
HARMONIC class-attribute
instance-attribute
¶
HARMONIC = 0
Harmonic mean, implemented as a Lehmer mean with p=0.
LEHMER class-attribute
instance-attribute
¶
LEHMER = 3
Lehmer mean, configurable with parameter p
.
Note: An odd number for p
is preferred as it will avoid negative inputs.
__call__ ¶
__call__(
*_clips: VideoNodeIterableT[VideoNode],
p: float = 3,
planes: Planes = None,
func: FuncExcept | None = None
) -> ConstantFormatVideoNode
__call__(
*_clips: VideoNodeIterableT[VideoNode],
planes: Planes = None,
func: FuncExcept | None = None
) -> ConstantFormatVideoNode
__call__(
*_clips: VideoNodeIterableT[VideoNode],
planes: Planes = None,
func: FuncExcept | None = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Applies the selected mean to multiple clips.
Parameters:
-
*_clips
¶VideoNodeIterableT[VideoNode]
, default:()
) –Input clips to combine.
-
planes
¶Planes
, default:None
) –Which planes to process.
-
func
¶FuncExcept | None
, default:None
) –An optional function to use for error handling.
-
**kwargs
¶Any
, default:{}
) –Additional keyword arguments for certain modes.
- p (float): Exponent for
LEHMER
mode. Defaults to 3.
- p (float): Exponent for
Raises: CustomValueError: If there is no clip.
Returns:
-
ConstantFormatVideoNode
–A new clip containing the combined frames.
Source code in vsrgtools/freqs.py
90 91 92 93 94 95 96 97 98 99 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 |
|
expr ¶
expr(
n: (
SupportsIndex
| Sequence[SupportsString]
| HoldsVideoFormat
| VideoFormatLike
),
**kwargs: Any
) -> ExprList
Builds a mean expression using a specified mode.
Parameters:
-
n
¶SupportsIndex | Sequence[SupportsString] | HoldsVideoFormat | VideoFormatLike
) –Object from which to infer the variables.
-
**kwargs
¶Any
, default:{}
) –Additional keyword arguments for certain modes.
- p (float): Exponent for
LEHMER
mode. Defaults to 3.
- p (float): Exponent for
Returns:
-
ExprList
–Mean expression.
Source code in vsrgtools/freqs.py
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 |
|
single ¶
single(
clip: VideoNode,
radius: int | Sequence[int] = 1,
mode: ConvMode = SQUARE,
exclude: Iterable[tuple[int, int]] | None = None,
include: Iterable[tuple[int, int]] | None = None,
planes: Planes = None,
func: FuncExcept | None = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Applies the selected mean to one clip, spatially or temporally.
Parameters:
-
clip
¶VideoNode
) –Input clip.
-
radius
¶int | Sequence[int]
, default:1
) –The radius per plane (Sequence) or uniform radius (int). Only int is allowed in temporal mode.
-
mode
¶ConvMode
, default:SQUARE
) –The convolution mode. Defaults to ConvMode.SQUARE.
-
exclude
¶Iterable[tuple[int, int]] | None
, default:None
) –Optional set of (x, y) coordinates to exclude from the matrix.
-
include
¶Iterable[tuple[int, int]] | None
, default:None
) –Optional set of (x, y) coordinates to include in the matrix.
-
planes
¶Planes
, default:None
) –Which planes to process.
-
func
¶FuncExcept | None
, default:None
) –An optional function to use for error handling.
-
**kwargs
¶Any
, default:{}
) –Additional keyword arguments for certain modes.
- p (float): Exponent for
LEHMER
mode. Defaults to 3.
- p (float): Exponent for
Raises:
-
CustomValueError
–If a list is passed for radius in temporal mode, which is unsupported.
Returns:
-
ConstantFormatVideoNode
–A new clip with the mean applied.
Source code in vsrgtools/freqs.py
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 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 |
|