util ¶
Classes:
-
ExprVars
–A helper class for generating variable names used in RPN expressions.
Functions:
ExprVars ¶
ExprVars(
stop: SupportsIndex | Self | HoldsVideoFormatT | VideoFormatT,
/,
*,
expr_src: bool = False,
)
ExprVars(
start: SupportsIndex,
stop: SupportsIndex,
step: SupportsIndex = 1,
/,
*,
expr_src: bool = False,
)
ExprVars(
start_stop: SupportsIndex | Self | HoldsVideoFormatT | VideoFormatT,
stop: SupportsIndex | MissingT = MISSING,
step: SupportsIndex = 1,
/,
*,
expr_src: bool = False,
)
A helper class for generating variable names used in RPN expressions.
Initialize an ExprVars instance.
Parameters:
-
start_stop
¶SupportsIndex | Self | HoldsVideoFormatT | VideoFormatT
) –A start index or an object from which to infer the number of variables (e.g., video format).
-
stop
¶SupportsIndex | MissingT
, default:MISSING
) –Stop index (exclusive). Required only if
start_stop
is a numeric start value. -
step
¶SupportsIndex
, default:1
) –Step size for iteration.
-
expr_src
¶bool
, default:False
) –Whether to use
srcX
naming or use alphabetic variables.
Raises:
-
CustomIndexError
–If
start
is negative orstop
is not greater thanstart
. -
CustomTypeError
–If invalid types are provided.
Methods:
-
__call__
–Allows an ExprVars instance to be called like a function to create a new instance with new parameters.
-
cycle
–An infinite generator of variable names, looping through
EXPR_VARS
then continuing withsrcX
style. -
get_var
–Get a variable name for a specific index.
Attributes:
-
curr
(int
) –Current index in iteration.
-
expr_src
(bool
) –If True, variables are named as
src0
,src1
, etc. Otherwise, "x", "y", "z", "a" and so on. -
start
(int
) –Starting index for variable generation (inclusive).
-
step
(int
) –Step size for iteration.
-
stop
(int
) –Ending index for variable generation (exclusive).
Source code
64 65 66 67 68 69 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 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
|
expr_src instance-attribute
¶
If True, variables are named as src0
, src1
, etc. Otherwise, "x", "y", "z", "a" and so on.
__call__ ¶
__call__(
stop: SupportsIndex | Self | HoldsVideoFormatT | VideoFormatT,
/,
*,
expr_src: bool = False,
) -> Self
__call__(
start: SupportsIndex,
stop: SupportsIndex,
step: SupportsIndex = 1,
/,
*,
expr_src: bool = False,
) -> Self
__call__(
start_stop: SupportsIndex | Self | HoldsVideoFormatT | VideoFormatT,
stop: SupportsIndex | MissingT = MISSING,
step: SupportsIndex = 1,
/,
*,
expr_src: bool = False,
) -> Self
Allows an ExprVars instance to be called like a function to create a new instance with new parameters.
Parameters:
-
start_stop
¶SupportsIndex | Self | HoldsVideoFormatT | VideoFormatT
) –A start index or an object from which to infer the number of variables (e.g., video format).
-
stop
¶SupportsIndex | MissingT
, default:MISSING
) –Stop index (exclusive). Required only if
start_stop
is a numeric start value. -
step
¶SupportsIndex
, default:1
) –Step size for iteration.
-
expr_src
¶bool
, default:False
) –Whether to use
srcX
naming or use alphabetic variables.
Returns:
-
Self
–A new instance with the specified parameters.
Source code
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 |
|
cycle classmethod
¶
An infinite generator of variable names, looping through EXPR_VARS
then continuing with srcX
style.
Returns:
Source code
226 227 228 229 230 231 232 233 234 235 236 |
|
get_var classmethod
¶
get_var(value: SupportsIndex) -> str
Get a variable name for a specific index.
Parameters:
-
value
¶SupportsIndex
) –Index to convert to variable name.
Returns:
-
str
–The variable name.
Raises:
-
CustomIndexError
–If the index is negative.
Source code
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 |
|
bitdepth_aware_tokenize_expr ¶
bitdepth_aware_tokenize_expr(
clips: Sequence[VideoNode],
expr: str,
chroma: bool,
func: FuncExceptT | None = None,
) -> str
Source code
250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 |
|
extra_op_tokenize_expr ¶
Source code
239 240 241 242 243 244 245 246 247 |
|
norm_expr_planes ¶
norm_expr_planes(
clip: VideoNode,
expr: str | list[str],
planes: PlanesT = None,
**kwargs: Iterable[SupportsString] | SupportsString
) -> list[str]
Source code
290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 |
|