placebo ¶
Classes:
-
EwaBicubic
–Ewa Bicubic resizer.
-
EwaGinseng
–Ewa Ginseng resizer.
-
EwaHann
–Ewa Hann resizer.
-
EwaJinc
–Ewa Jinc resizer.
-
EwaLanczos
–Ewa Lanczos resizer.
-
EwaLanczos4Sharpest
–Ewa Lanczos resizer.
-
EwaLanczosSharp
–Ewa Lanczos resizer.
-
EwaRobidoux
–Ewa Robidoux resizer.
-
EwaRobidouxSharp
–Ewa Robidoux Sharp resizer.
-
Placebo
–Abstract Placebo scaler class.
EwaBicubic ¶
Bases: Placebo
Ewa Bicubic resizer.
Initialize the scaler with specific 'b' and 'c' parameters and optional arguments.
These keyword arguments are automatically forwarded to the _implemented_funcs
methods but only if the method explicitly accepts them as named parameters. If the same keyword is passed to both __init__
and one of the _implemented_funcs
, the one passed to func
takes precedence.
Parameters:
-
b
¶float
, default:0.0
) –The 'b' parameter for bicubic interpolation.
-
c
¶float
, default:0.5
) –The 'c' parameter for bicubic interpolation.
-
radius
¶int | None
, default:None
) –Overrides the filter kernel radius.
-
**kwargs
¶Any
, default:{}
) –Keyword arguments that configure the internal scaling behavior.
Classes:
-
cached_property
–Read only version of functools.cached_property.
Methods:
-
ensure_obj
–Ensure that the input is a scaler instance, resolving it if necessary.
-
from_param
–Resolve and return a scaler type from a given input (string, type, or instance).
-
get_scale_args
– -
kernel_radius
– -
multi
–Deprecated alias for
supersample
. -
pretty_string
–Cached property returning a user-friendly string representation.
-
scale
–Scale a clip to the given resolution, with aspect ratio and linear light support.
-
supersample
–Supersample a clip by a given scaling factor.
Attributes:
-
antiring
– -
b
– -
blur
– -
c
– -
clamp
– -
kwargs
(dict[str, Any]
) –Arguments passed to the implemented funcs or internal scale function.
-
radius
– -
scale_function
– -
taper
–
Source code
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 |
|
kwargs instance-attribute
¶
Arguments passed to the implemented funcs or internal scale function.
cached_property ¶
cached_property(func: Callable[Concatenate[_BaseScalerT, P], T_co])
Bases: cached_property[T_co]
Read only version of functools.cached_property.
Source code
291 |
|
ensure_obj classmethod
¶
ensure_obj(
scaler: str | type[Self] | Self | None = None,
/,
func_except: FuncExceptT | None = None,
) -> Self
Ensure that the input is a scaler instance, resolving it if necessary.
Parameters:
-
scaler
¶str | type[Self] | Self | None
, default:None
) –Scaler identifier (string, class, or instance).
-
func_except
¶FuncExceptT | None
, default:None
) –Function returned for custom error handling.
Returns:
-
Self
–Scaler instance.
Source code
371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 |
|
from_param classmethod
¶
from_param(
scaler: str | type[Self] | Self | None = None,
/,
func_except: FuncExceptT | None = None,
) -> type[Self]
Resolve and return a scaler type from a given input (string, type, or instance).
Parameters:
-
scaler
¶str | type[Self] | Self | None
, default:None
) –Scaler identifier (string, class, or instance).
-
func_except
¶FuncExceptT | None
, default:None
) –Function returned for custom error handling.
Returns:
-
type[Self]
–Resolved scaler type.
Source code
352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 |
|
get_scale_args ¶
get_scale_args(
clip: VideoNode,
shift: tuple[TopShift, LeftShift] = (0, 0),
width: int | None = None,
height: int | None = None,
**kwargs: Any
) -> dict[str, Any]
Source code
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 |
|
kernel_radius ¶
kernel_radius() -> int
Source code
106 107 108 109 110 111 112 113 114 115 116 117 |
|
multi ¶
multi(
clip: VideoNodeT,
multi: float = 2.0,
shift: tuple[TopShift, LeftShift] = (0, 0),
**kwargs: Any
) -> VideoNodeT
Deprecated alias for supersample
.
Parameters:
-
clip
¶VideoNodeT
) –The source clip.
-
multi
¶float
, default:2.0
) –Supersampling factor.
-
shift
¶tuple[TopShift, LeftShift]
, default:(0, 0)
) –Subpixel shift (top, left) applied during scaling.
-
**kwargs
¶Any
, default:{}
) –Additional arguments forwarded to the scale function.
Returns:
-
VideoNodeT
–The supersampled clip.
Source code
511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 |
|
pretty_string ¶
pretty_string() -> str
Cached property returning a user-friendly string representation.
Returns:
-
str
–Pretty-printed string with arguments.
Source code
419 420 421 422 423 424 425 426 427 |
|
scale ¶
scale(
clip: VideoNode,
width: int | None = None,
height: int | None = None,
shift: tuple[TopShift | list[TopShift], LeftShift | list[LeftShift]] = (
0,
0,
),
*,
linear: bool | None = None,
sigmoid: bool | tuple[Slope, Center] = False,
border_handling: BorderHandling = MIRROR,
sample_grid_model: SampleGridModel = MATCH_EDGES,
sar: Sar | float | bool | None = None,
dar: Dar | float | bool | None = None,
dar_in: Dar | bool | float | None = None,
keep_ar: bool | None = None,
blur: float | None = None,
**kwargs: Any
) -> VideoNode | ConstantFormatVideoNode
Scale a clip to the given resolution, with aspect ratio and linear light support.
Keyword arguments passed during initialization are automatically injected here, unless explicitly overridden by the arguments provided at call time. Only arguments that match named parameters in this method are injected.
Parameters:
-
clip
¶VideoNode
) –The source clip.
-
width
¶int | None
, default:None
) –Target width (defaults to clip width if None).
-
height
¶int | None
, default:None
) –Target height (defaults to clip height if None).
-
shift
¶tuple[TopShift | list[TopShift], LeftShift | list[LeftShift]]
, default:(0, 0)
) –Subpixel shift (top, left) applied during scaling. If a tuple is provided, it is used uniformly. If a list is given, the shift is applied per plane.
-
linear
¶bool | None
, default:None
) –Whether to linearize the input before descaling. If None, inferred from sigmoid.
-
sigmoid
¶bool | tuple[Slope, Center]
, default:False
) –Whether to use sigmoid transfer curve. Can be True, False, or a tuple of (slope, center).
True
applies the defaults values (6.5, 0.75). Keep in mind sigmoid slope has to be in range 1.0-20.0 (inclusive) and sigmoid center has to be in range 0.0-1.0 (inclusive). -
border_handling
¶BorderHandling
, default:MIRROR
) –Method for handling image borders during sampling.
-
sample_grid_model
¶SampleGridModel
, default:MATCH_EDGES
) –Model used to align sampling grid.
-
sar
¶Sar | float | bool | None
, default:None
) –Sample aspect ratio to assume or convert to.
-
dar
¶Dar | float | bool | None
, default:None
) –Desired display aspect ratio.
-
dar_in
¶Dar | bool | float | None
, default:None
) –Input display aspect ratio, if different from clip's.
-
keep_ar
¶bool | None
, default:None
) –Whether to adjust dimensions to preserve aspect ratio.
-
blur
¶float | None
, default:None
) –Amount of blur to apply during scaling.
Returns:
-
VideoNode | ConstantFormatVideoNode
–Scaled clip, optionally aspect-corrected and linearized.
Source code
527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 |
|
supersample ¶
supersample(
clip: VideoNodeT,
rfactor: float = 2.0,
shift: tuple[TopShift, LeftShift] = (0, 0),
**kwargs: Any
) -> VideoNodeT
Supersample a clip by a given scaling factor.
Parameters:
-
clip
¶VideoNodeT
) –The source clip.
-
rfactor
¶float
, default:2.0
) –Scaling factor for supersampling.
-
shift
¶tuple[TopShift, LeftShift]
, default:(0, 0)
) –Subpixel shift (top, left) applied during scaling.
-
**kwargs
¶Any
, default:{}
) –Additional arguments forwarded to the scale function.
Raises:
-
CustomValueError
–If resulting resolution is non-positive.
Returns:
-
VideoNodeT
–The supersampled clip.
Source code
480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 |
|
EwaGinseng ¶
Bases: Placebo
Ewa Ginseng resizer.
Initialize the kernel with a specific radius and optional keyword arguments.
These keyword arguments are automatically forwarded to the _implemented_funcs
methods but only if the method explicitly accepts them as named parameters. If the same keyword is passed to both __init__
and one of the _implemented_funcs
, the one passed to func
takes precedence.
Parameters:
-
radius
¶float
, default:3.238315484166236
) –Overrides the filter kernel radius. Has no effect if the filter kernel is not resizeable.
-
**kwargs
¶Any
, default:{}
) –Keyword arguments that configure the internal scaling behavior.
Classes:
-
cached_property
–Read only version of functools.cached_property.
Methods:
-
ensure_obj
–Ensure that the input is a scaler instance, resolving it if necessary.
-
from_param
–Resolve and return a scaler type from a given input (string, type, or instance).
-
get_scale_args
– -
kernel_radius
– -
multi
–Deprecated alias for
supersample
. -
pretty_string
–Cached property returning a user-friendly string representation.
-
scale
–Scale a clip to the given resolution, with aspect ratio and linear light support.
-
supersample
–Supersample a clip by a given scaling factor.
Attributes:
-
antiring
– -
b
– -
blur
– -
c
– -
clamp
– -
kwargs
(dict[str, Any]
) –Arguments passed to the implemented funcs or internal scale function.
-
radius
– -
scale_function
– -
taper
–
Source code
256 257 258 259 260 261 262 263 264 265 266 267 268 269 |
|
kwargs instance-attribute
¶
Arguments passed to the implemented funcs or internal scale function.
cached_property ¶
cached_property(func: Callable[Concatenate[_BaseScalerT, P], T_co])
Bases: cached_property[T_co]
Read only version of functools.cached_property.
Source code
291 |
|
ensure_obj classmethod
¶
ensure_obj(
scaler: str | type[Self] | Self | None = None,
/,
func_except: FuncExceptT | None = None,
) -> Self
Ensure that the input is a scaler instance, resolving it if necessary.
Parameters:
-
scaler
¶str | type[Self] | Self | None
, default:None
) –Scaler identifier (string, class, or instance).
-
func_except
¶FuncExceptT | None
, default:None
) –Function returned for custom error handling.
Returns:
-
Self
–Scaler instance.
Source code
371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 |
|
from_param classmethod
¶
from_param(
scaler: str | type[Self] | Self | None = None,
/,
func_except: FuncExceptT | None = None,
) -> type[Self]
Resolve and return a scaler type from a given input (string, type, or instance).
Parameters:
-
scaler
¶str | type[Self] | Self | None
, default:None
) –Scaler identifier (string, class, or instance).
-
func_except
¶FuncExceptT | None
, default:None
) –Function returned for custom error handling.
Returns:
-
type[Self]
–Resolved scaler type.
Source code
352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 |
|
get_scale_args ¶
get_scale_args(
clip: VideoNode,
shift: tuple[TopShift, LeftShift] = (0, 0),
width: int | None = None,
height: int | None = None,
**kwargs: Any
) -> dict[str, Any]
Source code
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 |
|
kernel_radius ¶
kernel_radius() -> int
Source code
106 107 108 109 110 111 112 113 114 115 116 117 |
|
multi ¶
multi(
clip: VideoNodeT,
multi: float = 2.0,
shift: tuple[TopShift, LeftShift] = (0, 0),
**kwargs: Any
) -> VideoNodeT
Deprecated alias for supersample
.
Parameters:
-
clip
¶VideoNodeT
) –The source clip.
-
multi
¶float
, default:2.0
) –Supersampling factor.
-
shift
¶tuple[TopShift, LeftShift]
, default:(0, 0)
) –Subpixel shift (top, left) applied during scaling.
-
**kwargs
¶Any
, default:{}
) –Additional arguments forwarded to the scale function.
Returns:
-
VideoNodeT
–The supersampled clip.
Source code
511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 |
|
pretty_string ¶
pretty_string() -> str
Cached property returning a user-friendly string representation.
Returns:
-
str
–Pretty-printed string with arguments.
Source code
419 420 421 422 423 424 425 426 427 |
|
scale ¶
scale(
clip: VideoNode,
width: int | None = None,
height: int | None = None,
shift: tuple[TopShift | list[TopShift], LeftShift | list[LeftShift]] = (
0,
0,
),
*,
linear: bool | None = None,
sigmoid: bool | tuple[Slope, Center] = False,
border_handling: BorderHandling = MIRROR,
sample_grid_model: SampleGridModel = MATCH_EDGES,
sar: Sar | float | bool | None = None,
dar: Dar | float | bool | None = None,
dar_in: Dar | bool | float | None = None,
keep_ar: bool | None = None,
blur: float | None = None,
**kwargs: Any
) -> VideoNode | ConstantFormatVideoNode
Scale a clip to the given resolution, with aspect ratio and linear light support.
Keyword arguments passed during initialization are automatically injected here, unless explicitly overridden by the arguments provided at call time. Only arguments that match named parameters in this method are injected.
Parameters:
-
clip
¶VideoNode
) –The source clip.
-
width
¶int | None
, default:None
) –Target width (defaults to clip width if None).
-
height
¶int | None
, default:None
) –Target height (defaults to clip height if None).
-
shift
¶tuple[TopShift | list[TopShift], LeftShift | list[LeftShift]]
, default:(0, 0)
) –Subpixel shift (top, left) applied during scaling. If a tuple is provided, it is used uniformly. If a list is given, the shift is applied per plane.
-
linear
¶bool | None
, default:None
) –Whether to linearize the input before descaling. If None, inferred from sigmoid.
-
sigmoid
¶bool | tuple[Slope, Center]
, default:False
) –Whether to use sigmoid transfer curve. Can be True, False, or a tuple of (slope, center).
True
applies the defaults values (6.5, 0.75). Keep in mind sigmoid slope has to be in range 1.0-20.0 (inclusive) and sigmoid center has to be in range 0.0-1.0 (inclusive). -
border_handling
¶BorderHandling
, default:MIRROR
) –Method for handling image borders during sampling.
-
sample_grid_model
¶SampleGridModel
, default:MATCH_EDGES
) –Model used to align sampling grid.
-
sar
¶Sar | float | bool | None
, default:None
) –Sample aspect ratio to assume or convert to.
-
dar
¶Dar | float | bool | None
, default:None
) –Desired display aspect ratio.
-
dar_in
¶Dar | bool | float | None
, default:None
) –Input display aspect ratio, if different from clip's.
-
keep_ar
¶bool | None
, default:None
) –Whether to adjust dimensions to preserve aspect ratio.
-
blur
¶float | None
, default:None
) –Amount of blur to apply during scaling.
Returns:
-
VideoNode | ConstantFormatVideoNode
–Scaled clip, optionally aspect-corrected and linearized.
Source code
527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 |
|
supersample ¶
supersample(
clip: VideoNodeT,
rfactor: float = 2.0,
shift: tuple[TopShift, LeftShift] = (0, 0),
**kwargs: Any
) -> VideoNodeT
Supersample a clip by a given scaling factor.
Parameters:
-
clip
¶VideoNodeT
) –The source clip.
-
rfactor
¶float
, default:2.0
) –Scaling factor for supersampling.
-
shift
¶tuple[TopShift, LeftShift]
, default:(0, 0)
) –Subpixel shift (top, left) applied during scaling.
-
**kwargs
¶Any
, default:{}
) –Additional arguments forwarded to the scale function.
Raises:
-
CustomValueError
–If resulting resolution is non-positive.
Returns:
-
VideoNodeT
–The supersampled clip.
Source code
480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 |
|
EwaHann ¶
Bases: Placebo
Ewa Hann resizer.
Initialize the kernel with a specific radius and optional keyword arguments.
These keyword arguments are automatically forwarded to the _implemented_funcs
methods but only if the method explicitly accepts them as named parameters. If the same keyword is passed to both __init__
and one of the _implemented_funcs
, the one passed to func
takes precedence.
Parameters:
-
radius
¶float
, default:3.238315484166236
) –Overrides the filter kernel radius. Has no effect if the filter kernel is not resizeable.
-
**kwargs
¶Any
, default:{}
) –Keyword arguments that configure the internal scaling behavior.
Classes:
-
cached_property
–Read only version of functools.cached_property.
Methods:
-
ensure_obj
–Ensure that the input is a scaler instance, resolving it if necessary.
-
from_param
–Resolve and return a scaler type from a given input (string, type, or instance).
-
get_scale_args
– -
kernel_radius
– -
multi
–Deprecated alias for
supersample
. -
pretty_string
–Cached property returning a user-friendly string representation.
-
scale
–Scale a clip to the given resolution, with aspect ratio and linear light support.
-
supersample
–Supersample a clip by a given scaling factor.
Attributes:
-
antiring
– -
b
– -
blur
– -
c
– -
clamp
– -
kwargs
(dict[str, Any]
) –Arguments passed to the implemented funcs or internal scale function.
-
radius
– -
scale_function
– -
taper
–
Source code
279 280 281 282 283 284 285 286 287 288 289 290 291 292 |
|
kwargs instance-attribute
¶
Arguments passed to the implemented funcs or internal scale function.
cached_property ¶
cached_property(func: Callable[Concatenate[_BaseScalerT, P], T_co])
Bases: cached_property[T_co]
Read only version of functools.cached_property.
Source code
291 |
|
ensure_obj classmethod
¶
ensure_obj(
scaler: str | type[Self] | Self | None = None,
/,
func_except: FuncExceptT | None = None,
) -> Self
Ensure that the input is a scaler instance, resolving it if necessary.
Parameters:
-
scaler
¶str | type[Self] | Self | None
, default:None
) –Scaler identifier (string, class, or instance).
-
func_except
¶FuncExceptT | None
, default:None
) –Function returned for custom error handling.
Returns:
-
Self
–Scaler instance.
Source code
371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 |
|
from_param classmethod
¶
from_param(
scaler: str | type[Self] | Self | None = None,
/,
func_except: FuncExceptT | None = None,
) -> type[Self]
Resolve and return a scaler type from a given input (string, type, or instance).
Parameters:
-
scaler
¶str | type[Self] | Self | None
, default:None
) –Scaler identifier (string, class, or instance).
-
func_except
¶FuncExceptT | None
, default:None
) –Function returned for custom error handling.
Returns:
-
type[Self]
–Resolved scaler type.
Source code
352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 |
|
get_scale_args ¶
get_scale_args(
clip: VideoNode,
shift: tuple[TopShift, LeftShift] = (0, 0),
width: int | None = None,
height: int | None = None,
**kwargs: Any
) -> dict[str, Any]
Source code
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 |
|
kernel_radius ¶
kernel_radius() -> int
Source code
106 107 108 109 110 111 112 113 114 115 116 117 |
|
multi ¶
multi(
clip: VideoNodeT,
multi: float = 2.0,
shift: tuple[TopShift, LeftShift] = (0, 0),
**kwargs: Any
) -> VideoNodeT
Deprecated alias for supersample
.
Parameters:
-
clip
¶VideoNodeT
) –The source clip.
-
multi
¶float
, default:2.0
) –Supersampling factor.
-
shift
¶tuple[TopShift, LeftShift]
, default:(0, 0)
) –Subpixel shift (top, left) applied during scaling.
-
**kwargs
¶Any
, default:{}
) –Additional arguments forwarded to the scale function.
Returns:
-
VideoNodeT
–The supersampled clip.
Source code
511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 |
|
pretty_string ¶
pretty_string() -> str
Cached property returning a user-friendly string representation.
Returns:
-
str
–Pretty-printed string with arguments.
Source code
419 420 421 422 423 424 425 426 427 |
|
scale ¶
scale(
clip: VideoNode,
width: int | None = None,
height: int | None = None,
shift: tuple[TopShift | list[TopShift], LeftShift | list[LeftShift]] = (
0,
0,
),
*,
linear: bool | None = None,
sigmoid: bool | tuple[Slope, Center] = False,
border_handling: BorderHandling = MIRROR,
sample_grid_model: SampleGridModel = MATCH_EDGES,
sar: Sar | float | bool | None = None,
dar: Dar | float | bool | None = None,
dar_in: Dar | bool | float | None = None,
keep_ar: bool | None = None,
blur: float | None = None,
**kwargs: Any
) -> VideoNode | ConstantFormatVideoNode
Scale a clip to the given resolution, with aspect ratio and linear light support.
Keyword arguments passed during initialization are automatically injected here, unless explicitly overridden by the arguments provided at call time. Only arguments that match named parameters in this method are injected.
Parameters:
-
clip
¶VideoNode
) –The source clip.
-
width
¶int | None
, default:None
) –Target width (defaults to clip width if None).
-
height
¶int | None
, default:None
) –Target height (defaults to clip height if None).
-
shift
¶tuple[TopShift | list[TopShift], LeftShift | list[LeftShift]]
, default:(0, 0)
) –Subpixel shift (top, left) applied during scaling. If a tuple is provided, it is used uniformly. If a list is given, the shift is applied per plane.
-
linear
¶bool | None
, default:None
) –Whether to linearize the input before descaling. If None, inferred from sigmoid.
-
sigmoid
¶bool | tuple[Slope, Center]
, default:False
) –Whether to use sigmoid transfer curve. Can be True, False, or a tuple of (slope, center).
True
applies the defaults values (6.5, 0.75). Keep in mind sigmoid slope has to be in range 1.0-20.0 (inclusive) and sigmoid center has to be in range 0.0-1.0 (inclusive). -
border_handling
¶BorderHandling
, default:MIRROR
) –Method for handling image borders during sampling.
-
sample_grid_model
¶SampleGridModel
, default:MATCH_EDGES
) –Model used to align sampling grid.
-
sar
¶Sar | float | bool | None
, default:None
) –Sample aspect ratio to assume or convert to.
-
dar
¶Dar | float | bool | None
, default:None
) –Desired display aspect ratio.
-
dar_in
¶Dar | bool | float | None
, default:None
) –Input display aspect ratio, if different from clip's.
-
keep_ar
¶bool | None
, default:None
) –Whether to adjust dimensions to preserve aspect ratio.
-
blur
¶float | None
, default:None
) –Amount of blur to apply during scaling.
Returns:
-
VideoNode | ConstantFormatVideoNode
–Scaled clip, optionally aspect-corrected and linearized.
Source code
527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 |
|
supersample ¶
supersample(
clip: VideoNodeT,
rfactor: float = 2.0,
shift: tuple[TopShift, LeftShift] = (0, 0),
**kwargs: Any
) -> VideoNodeT
Supersample a clip by a given scaling factor.
Parameters:
-
clip
¶VideoNodeT
) –The source clip.
-
rfactor
¶float
, default:2.0
) –Scaling factor for supersampling.
-
shift
¶tuple[TopShift, LeftShift]
, default:(0, 0)
) –Subpixel shift (top, left) applied during scaling.
-
**kwargs
¶Any
, default:{}
) –Additional arguments forwarded to the scale function.
Raises:
-
CustomValueError
–If resulting resolution is non-positive.
Returns:
-
VideoNodeT
–The supersampled clip.
Source code
480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 |
|
EwaJinc ¶
Bases: Placebo
Ewa Jinc resizer.
Initialize the kernel with a specific radius and optional keyword arguments.
These keyword arguments are automatically forwarded to the _implemented_funcs
methods but only if the method explicitly accepts them as named parameters. If the same keyword is passed to both __init__
and one of the _implemented_funcs
, the one passed to func
takes precedence.
Parameters:
-
radius
¶float
, default:3.238315484166236
) –Overrides the filter kernel radius. Has no effect if the filter kernel is not resizeable.
-
**kwargs
¶Any
, default:{}
) –Keyword arguments that configure the internal scaling behavior.
Classes:
-
cached_property
–Read only version of functools.cached_property.
Methods:
-
ensure_obj
–Ensure that the input is a scaler instance, resolving it if necessary.
-
from_param
–Resolve and return a scaler type from a given input (string, type, or instance).
-
get_scale_args
– -
kernel_radius
– -
multi
–Deprecated alias for
supersample
. -
pretty_string
–Cached property returning a user-friendly string representation.
-
scale
–Scale a clip to the given resolution, with aspect ratio and linear light support.
-
supersample
–Supersample a clip by a given scaling factor.
Attributes:
-
antiring
– -
b
– -
blur
– -
c
– -
clamp
– -
kwargs
(dict[str, Any]
) –Arguments passed to the implemented funcs or internal scale function.
-
radius
– -
scale_function
– -
taper
–
Source code
233 234 235 236 237 238 239 240 241 242 243 244 245 246 |
|
kwargs instance-attribute
¶
Arguments passed to the implemented funcs or internal scale function.
cached_property ¶
cached_property(func: Callable[Concatenate[_BaseScalerT, P], T_co])
Bases: cached_property[T_co]
Read only version of functools.cached_property.
Source code
291 |
|
ensure_obj classmethod
¶
ensure_obj(
scaler: str | type[Self] | Self | None = None,
/,
func_except: FuncExceptT | None = None,
) -> Self
Ensure that the input is a scaler instance, resolving it if necessary.
Parameters:
-
scaler
¶str | type[Self] | Self | None
, default:None
) –Scaler identifier (string, class, or instance).
-
func_except
¶FuncExceptT | None
, default:None
) –Function returned for custom error handling.
Returns:
-
Self
–Scaler instance.
Source code
371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 |
|
from_param classmethod
¶
from_param(
scaler: str | type[Self] | Self | None = None,
/,
func_except: FuncExceptT | None = None,
) -> type[Self]
Resolve and return a scaler type from a given input (string, type, or instance).
Parameters:
-
scaler
¶str | type[Self] | Self | None
, default:None
) –Scaler identifier (string, class, or instance).
-
func_except
¶FuncExceptT | None
, default:None
) –Function returned for custom error handling.
Returns:
-
type[Self]
–Resolved scaler type.
Source code
352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 |
|
get_scale_args ¶
get_scale_args(
clip: VideoNode,
shift: tuple[TopShift, LeftShift] = (0, 0),
width: int | None = None,
height: int | None = None,
**kwargs: Any
) -> dict[str, Any]
Source code
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 |
|
kernel_radius ¶
kernel_radius() -> int
Source code
106 107 108 109 110 111 112 113 114 115 116 117 |
|
multi ¶
multi(
clip: VideoNodeT,
multi: float = 2.0,
shift: tuple[TopShift, LeftShift] = (0, 0),
**kwargs: Any
) -> VideoNodeT
Deprecated alias for supersample
.
Parameters:
-
clip
¶VideoNodeT
) –The source clip.
-
multi
¶float
, default:2.0
) –Supersampling factor.
-
shift
¶tuple[TopShift, LeftShift]
, default:(0, 0)
) –Subpixel shift (top, left) applied during scaling.
-
**kwargs
¶Any
, default:{}
) –Additional arguments forwarded to the scale function.
Returns:
-
VideoNodeT
–The supersampled clip.
Source code
511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 |
|
pretty_string ¶
pretty_string() -> str
Cached property returning a user-friendly string representation.
Returns:
-
str
–Pretty-printed string with arguments.
Source code
419 420 421 422 423 424 425 426 427 |
|
scale ¶
scale(
clip: VideoNode,
width: int | None = None,
height: int | None = None,
shift: tuple[TopShift | list[TopShift], LeftShift | list[LeftShift]] = (
0,
0,
),
*,
linear: bool | None = None,
sigmoid: bool | tuple[Slope, Center] = False,
border_handling: BorderHandling = MIRROR,
sample_grid_model: SampleGridModel = MATCH_EDGES,
sar: Sar | float | bool | None = None,
dar: Dar | float | bool | None = None,
dar_in: Dar | bool | float | None = None,
keep_ar: bool | None = None,
blur: float | None = None,
**kwargs: Any
) -> VideoNode | ConstantFormatVideoNode
Scale a clip to the given resolution, with aspect ratio and linear light support.
Keyword arguments passed during initialization are automatically injected here, unless explicitly overridden by the arguments provided at call time. Only arguments that match named parameters in this method are injected.
Parameters:
-
clip
¶VideoNode
) –The source clip.
-
width
¶int | None
, default:None
) –Target width (defaults to clip width if None).
-
height
¶int | None
, default:None
) –Target height (defaults to clip height if None).
-
shift
¶tuple[TopShift | list[TopShift], LeftShift | list[LeftShift]]
, default:(0, 0)
) –Subpixel shift (top, left) applied during scaling. If a tuple is provided, it is used uniformly. If a list is given, the shift is applied per plane.
-
linear
¶bool | None
, default:None
) –Whether to linearize the input before descaling. If None, inferred from sigmoid.
-
sigmoid
¶bool | tuple[Slope, Center]
, default:False
) –Whether to use sigmoid transfer curve. Can be True, False, or a tuple of (slope, center).
True
applies the defaults values (6.5, 0.75). Keep in mind sigmoid slope has to be in range 1.0-20.0 (inclusive) and sigmoid center has to be in range 0.0-1.0 (inclusive). -
border_handling
¶BorderHandling
, default:MIRROR
) –Method for handling image borders during sampling.
-
sample_grid_model
¶SampleGridModel
, default:MATCH_EDGES
) –Model used to align sampling grid.
-
sar
¶Sar | float | bool | None
, default:None
) –Sample aspect ratio to assume or convert to.
-
dar
¶Dar | float | bool | None
, default:None
) –Desired display aspect ratio.
-
dar_in
¶Dar | bool | float | None
, default:None
) –Input display aspect ratio, if different from clip's.
-
keep_ar
¶bool | None
, default:None
) –Whether to adjust dimensions to preserve aspect ratio.
-
blur
¶float | None
, default:None
) –Amount of blur to apply during scaling.
Returns:
-
VideoNode | ConstantFormatVideoNode
–Scaled clip, optionally aspect-corrected and linearized.
Source code
527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 |
|
supersample ¶
supersample(
clip: VideoNodeT,
rfactor: float = 2.0,
shift: tuple[TopShift, LeftShift] = (0, 0),
**kwargs: Any
) -> VideoNodeT
Supersample a clip by a given scaling factor.
Parameters:
-
clip
¶VideoNodeT
) –The source clip.
-
rfactor
¶float
, default:2.0
) –Scaling factor for supersampling.
-
shift
¶tuple[TopShift, LeftShift]
, default:(0, 0)
) –Subpixel shift (top, left) applied during scaling.
-
**kwargs
¶Any
, default:{}
) –Additional arguments forwarded to the scale function.
Raises:
-
CustomValueError
–If resulting resolution is non-positive.
Returns:
-
VideoNodeT
–The supersampled clip.
Source code
480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 |
|
EwaLanczos ¶
Bases: Placebo
Ewa Lanczos resizer.
Initialize the kernel with a specific radius and optional keyword arguments.
These keyword arguments are automatically forwarded to the _implemented_funcs
methods but only if the method explicitly accepts them as named parameters. If the same keyword is passed to both __init__
and one of the _implemented_funcs
, the one passed to func
takes precedence.
Parameters:
-
radius
¶float
, default:3.238315484166236
) –Overrides the filter kernel radius. Has no effect if the filter kernel is not resizeable.
-
**kwargs
¶Any
, default:{}
) –Keyword arguments that configure the internal scaling behavior.
Classes:
-
cached_property
–Read only version of functools.cached_property.
Methods:
-
ensure_obj
–Ensure that the input is a scaler instance, resolving it if necessary.
-
from_param
–Resolve and return a scaler type from a given input (string, type, or instance).
-
get_scale_args
– -
kernel_radius
– -
multi
–Deprecated alias for
supersample
. -
pretty_string
–Cached property returning a user-friendly string representation.
-
scale
–Scale a clip to the given resolution, with aspect ratio and linear light support.
-
supersample
–Supersample a clip by a given scaling factor.
Attributes:
-
antiring
– -
b
– -
blur
– -
c
– -
clamp
– -
kwargs
(dict[str, Any]
) –Arguments passed to the implemented funcs or internal scale function.
-
radius
– -
scale_function
– -
taper
–
Source code
155 156 157 158 159 160 161 162 163 164 165 166 167 168 |
|
kwargs instance-attribute
¶
Arguments passed to the implemented funcs or internal scale function.
cached_property ¶
cached_property(func: Callable[Concatenate[_BaseScalerT, P], T_co])
Bases: cached_property[T_co]
Read only version of functools.cached_property.
Source code
291 |
|
ensure_obj classmethod
¶
ensure_obj(
scaler: str | type[Self] | Self | None = None,
/,
func_except: FuncExceptT | None = None,
) -> Self
Ensure that the input is a scaler instance, resolving it if necessary.
Parameters:
-
scaler
¶str | type[Self] | Self | None
, default:None
) –Scaler identifier (string, class, or instance).
-
func_except
¶FuncExceptT | None
, default:None
) –Function returned for custom error handling.
Returns:
-
Self
–Scaler instance.
Source code
371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 |
|
from_param classmethod
¶
from_param(
scaler: str | type[Self] | Self | None = None,
/,
func_except: FuncExceptT | None = None,
) -> type[Self]
Resolve and return a scaler type from a given input (string, type, or instance).
Parameters:
-
scaler
¶str | type[Self] | Self | None
, default:None
) –Scaler identifier (string, class, or instance).
-
func_except
¶FuncExceptT | None
, default:None
) –Function returned for custom error handling.
Returns:
-
type[Self]
–Resolved scaler type.
Source code
352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 |
|
get_scale_args ¶
get_scale_args(
clip: VideoNode,
shift: tuple[TopShift, LeftShift] = (0, 0),
width: int | None = None,
height: int | None = None,
**kwargs: Any
) -> dict[str, Any]
Source code
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 |
|
kernel_radius ¶
kernel_radius() -> int
Source code
106 107 108 109 110 111 112 113 114 115 116 117 |
|
multi ¶
multi(
clip: VideoNodeT,
multi: float = 2.0,
shift: tuple[TopShift, LeftShift] = (0, 0),
**kwargs: Any
) -> VideoNodeT
Deprecated alias for supersample
.
Parameters:
-
clip
¶VideoNodeT
) –The source clip.
-
multi
¶float
, default:2.0
) –Supersampling factor.
-
shift
¶tuple[TopShift, LeftShift]
, default:(0, 0)
) –Subpixel shift (top, left) applied during scaling.
-
**kwargs
¶Any
, default:{}
) –Additional arguments forwarded to the scale function.
Returns:
-
VideoNodeT
–The supersampled clip.
Source code
511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 |
|
pretty_string ¶
pretty_string() -> str
Cached property returning a user-friendly string representation.
Returns:
-
str
–Pretty-printed string with arguments.
Source code
419 420 421 422 423 424 425 426 427 |
|
scale ¶
scale(
clip: VideoNode,
width: int | None = None,
height: int | None = None,
shift: tuple[TopShift | list[TopShift], LeftShift | list[LeftShift]] = (
0,
0,
),
*,
linear: bool | None = None,
sigmoid: bool | tuple[Slope, Center] = False,
border_handling: BorderHandling = MIRROR,
sample_grid_model: SampleGridModel = MATCH_EDGES,
sar: Sar | float | bool | None = None,
dar: Dar | float | bool | None = None,
dar_in: Dar | bool | float | None = None,
keep_ar: bool | None = None,
blur: float | None = None,
**kwargs: Any
) -> VideoNode | ConstantFormatVideoNode
Scale a clip to the given resolution, with aspect ratio and linear light support.
Keyword arguments passed during initialization are automatically injected here, unless explicitly overridden by the arguments provided at call time. Only arguments that match named parameters in this method are injected.
Parameters:
-
clip
¶VideoNode
) –The source clip.
-
width
¶int | None
, default:None
) –Target width (defaults to clip width if None).
-
height
¶int | None
, default:None
) –Target height (defaults to clip height if None).
-
shift
¶tuple[TopShift | list[TopShift], LeftShift | list[LeftShift]]
, default:(0, 0)
) –Subpixel shift (top, left) applied during scaling. If a tuple is provided, it is used uniformly. If a list is given, the shift is applied per plane.
-
linear
¶bool | None
, default:None
) –Whether to linearize the input before descaling. If None, inferred from sigmoid.
-
sigmoid
¶bool | tuple[Slope, Center]
, default:False
) –Whether to use sigmoid transfer curve. Can be True, False, or a tuple of (slope, center).
True
applies the defaults values (6.5, 0.75). Keep in mind sigmoid slope has to be in range 1.0-20.0 (inclusive) and sigmoid center has to be in range 0.0-1.0 (inclusive). -
border_handling
¶BorderHandling
, default:MIRROR
) –Method for handling image borders during sampling.
-
sample_grid_model
¶SampleGridModel
, default:MATCH_EDGES
) –Model used to align sampling grid.
-
sar
¶Sar | float | bool | None
, default:None
) –Sample aspect ratio to assume or convert to.
-
dar
¶Dar | float | bool | None
, default:None
) –Desired display aspect ratio.
-
dar_in
¶Dar | bool | float | None
, default:None
) –Input display aspect ratio, if different from clip's.
-
keep_ar
¶bool | None
, default:None
) –Whether to adjust dimensions to preserve aspect ratio.
-
blur
¶float | None
, default:None
) –Amount of blur to apply during scaling.
Returns:
-
VideoNode | ConstantFormatVideoNode
–Scaled clip, optionally aspect-corrected and linearized.
Source code
527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 |
|
supersample ¶
supersample(
clip: VideoNodeT,
rfactor: float = 2.0,
shift: tuple[TopShift, LeftShift] = (0, 0),
**kwargs: Any
) -> VideoNodeT
Supersample a clip by a given scaling factor.
Parameters:
-
clip
¶VideoNodeT
) –The source clip.
-
rfactor
¶float
, default:2.0
) –Scaling factor for supersampling.
-
shift
¶tuple[TopShift, LeftShift]
, default:(0, 0)
) –Subpixel shift (top, left) applied during scaling.
-
**kwargs
¶Any
, default:{}
) –Additional arguments forwarded to the scale function.
Raises:
-
CustomValueError
–If resulting resolution is non-positive.
Returns:
-
VideoNodeT
–The supersampled clip.
Source code
480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 |
|
EwaLanczos4Sharpest ¶
EwaLanczos4Sharpest(
radius: float = 4.24106286379607,
blur: float = 0.8845120932605005,
antiring: float = 0.8,
**kwargs: Any
)
Bases: Placebo
Ewa Lanczos resizer.
Initialize the kernel with a specific radius and optional keyword arguments.
These keyword arguments are automatically forwarded to the _implemented_funcs
methods but only if the method explicitly accepts them as named parameters. If the same keyword is passed to both __init__
and one of the _implemented_funcs
, the one passed to func
takes precedence.
Parameters:
-
radius
¶float
, default:4.24106286379607
) –Overrides the filter kernel radius. Has no effect if the filter kernel is not resizeable.
-
blur
¶float
, default:0.8845120932605005
) –Additional blur coefficient. This effectively stretches the kernel, without changing the effective radius of the filter radius.
-
antiring
¶float
, default:0.8
) –Antiringing strength.
-
**kwargs
¶Any
, default:{}
) –Keyword arguments that configure the internal scaling behavior.
Classes:
-
cached_property
–Read only version of functools.cached_property.
Methods:
-
ensure_obj
–Ensure that the input is a scaler instance, resolving it if necessary.
-
from_param
–Resolve and return a scaler type from a given input (string, type, or instance).
-
get_scale_args
– -
kernel_radius
– -
multi
–Deprecated alias for
supersample
. -
pretty_string
–Cached property returning a user-friendly string representation.
-
scale
–Scale a clip to the given resolution, with aspect ratio and linear light support.
-
supersample
–Supersample a clip by a given scaling factor.
Attributes:
-
antiring
– -
b
– -
blur
– -
c
– -
clamp
– -
kwargs
(dict[str, Any]
) –Arguments passed to the implemented funcs or internal scale function.
-
radius
– -
scale_function
– -
taper
–
Source code
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 |
|
kwargs instance-attribute
¶
Arguments passed to the implemented funcs or internal scale function.
cached_property ¶
cached_property(func: Callable[Concatenate[_BaseScalerT, P], T_co])
Bases: cached_property[T_co]
Read only version of functools.cached_property.
Source code
291 |
|
ensure_obj classmethod
¶
ensure_obj(
scaler: str | type[Self] | Self | None = None,
/,
func_except: FuncExceptT | None = None,
) -> Self
Ensure that the input is a scaler instance, resolving it if necessary.
Parameters:
-
scaler
¶str | type[Self] | Self | None
, default:None
) –Scaler identifier (string, class, or instance).
-
func_except
¶FuncExceptT | None
, default:None
) –Function returned for custom error handling.
Returns:
-
Self
–Scaler instance.
Source code
371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 |
|
from_param classmethod
¶
from_param(
scaler: str | type[Self] | Self | None = None,
/,
func_except: FuncExceptT | None = None,
) -> type[Self]
Resolve and return a scaler type from a given input (string, type, or instance).
Parameters:
-
scaler
¶str | type[Self] | Self | None
, default:None
) –Scaler identifier (string, class, or instance).
-
func_except
¶FuncExceptT | None
, default:None
) –Function returned for custom error handling.
Returns:
-
type[Self]
–Resolved scaler type.
Source code
352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 |
|
get_scale_args ¶
get_scale_args(
clip: VideoNode,
shift: tuple[TopShift, LeftShift] = (0, 0),
width: int | None = None,
height: int | None = None,
**kwargs: Any
) -> dict[str, Any]
Source code
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 |
|
kernel_radius ¶
kernel_radius() -> int
Source code
106 107 108 109 110 111 112 113 114 115 116 117 |
|
multi ¶
multi(
clip: VideoNodeT,
multi: float = 2.0,
shift: tuple[TopShift, LeftShift] = (0, 0),
**kwargs: Any
) -> VideoNodeT
Deprecated alias for supersample
.
Parameters:
-
clip
¶VideoNodeT
) –The source clip.
-
multi
¶float
, default:2.0
) –Supersampling factor.
-
shift
¶tuple[TopShift, LeftShift]
, default:(0, 0)
) –Subpixel shift (top, left) applied during scaling.
-
**kwargs
¶Any
, default:{}
) –Additional arguments forwarded to the scale function.
Returns:
-
VideoNodeT
–The supersampled clip.
Source code
511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 |
|
pretty_string ¶
pretty_string() -> str
Cached property returning a user-friendly string representation.
Returns:
-
str
–Pretty-printed string with arguments.
Source code
419 420 421 422 423 424 425 426 427 |
|
scale ¶
scale(
clip: VideoNode,
width: int | None = None,
height: int | None = None,
shift: tuple[TopShift | list[TopShift], LeftShift | list[LeftShift]] = (
0,
0,
),
*,
linear: bool | None = None,
sigmoid: bool | tuple[Slope, Center] = False,
border_handling: BorderHandling = MIRROR,
sample_grid_model: SampleGridModel = MATCH_EDGES,
sar: Sar | float | bool | None = None,
dar: Dar | float | bool | None = None,
dar_in: Dar | bool | float | None = None,
keep_ar: bool | None = None,
blur: float | None = None,
**kwargs: Any
) -> VideoNode | ConstantFormatVideoNode
Scale a clip to the given resolution, with aspect ratio and linear light support.
Keyword arguments passed during initialization are automatically injected here, unless explicitly overridden by the arguments provided at call time. Only arguments that match named parameters in this method are injected.
Parameters:
-
clip
¶VideoNode
) –The source clip.
-
width
¶int | None
, default:None
) –Target width (defaults to clip width if None).
-
height
¶int | None
, default:None
) –Target height (defaults to clip height if None).
-
shift
¶tuple[TopShift | list[TopShift], LeftShift | list[LeftShift]]
, default:(0, 0)
) –Subpixel shift (top, left) applied during scaling. If a tuple is provided, it is used uniformly. If a list is given, the shift is applied per plane.
-
linear
¶bool | None
, default:None
) –Whether to linearize the input before descaling. If None, inferred from sigmoid.
-
sigmoid
¶bool | tuple[Slope, Center]
, default:False
) –Whether to use sigmoid transfer curve. Can be True, False, or a tuple of (slope, center).
True
applies the defaults values (6.5, 0.75). Keep in mind sigmoid slope has to be in range 1.0-20.0 (inclusive) and sigmoid center has to be in range 0.0-1.0 (inclusive). -
border_handling
¶BorderHandling
, default:MIRROR
) –Method for handling image borders during sampling.
-
sample_grid_model
¶SampleGridModel
, default:MATCH_EDGES
) –Model used to align sampling grid.
-
sar
¶Sar | float | bool | None
, default:None
) –Sample aspect ratio to assume or convert to.
-
dar
¶Dar | float | bool | None
, default:None
) –Desired display aspect ratio.
-
dar_in
¶Dar | bool | float | None
, default:None
) –Input display aspect ratio, if different from clip's.
-
keep_ar
¶bool | None
, default:None
) –Whether to adjust dimensions to preserve aspect ratio.
-
blur
¶float | None
, default:None
) –Amount of blur to apply during scaling.
Returns:
-
VideoNode | ConstantFormatVideoNode
–Scaled clip, optionally aspect-corrected and linearized.
Source code
527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 |
|
supersample ¶
supersample(
clip: VideoNodeT,
rfactor: float = 2.0,
shift: tuple[TopShift, LeftShift] = (0, 0),
**kwargs: Any
) -> VideoNodeT
Supersample a clip by a given scaling factor.
Parameters:
-
clip
¶VideoNodeT
) –The source clip.
-
rfactor
¶float
, default:2.0
) –Scaling factor for supersampling.
-
shift
¶tuple[TopShift, LeftShift]
, default:(0, 0)
) –Subpixel shift (top, left) applied during scaling.
-
**kwargs
¶Any
, default:{}
) –Additional arguments forwarded to the scale function.
Raises:
-
CustomValueError
–If resulting resolution is non-positive.
Returns:
-
VideoNodeT
–The supersampled clip.
Source code
480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 |
|
EwaLanczosSharp ¶
EwaLanczosSharp(
radius: float = 3.238315484166236,
blur: float = 0.9812505837223707,
**kwargs: Any
)
Bases: Placebo
Ewa Lanczos resizer.
Initialize the kernel with a specific radius and optional keyword arguments.
These keyword arguments are automatically forwarded to the _implemented_funcs
methods but only if the method explicitly accepts them as named parameters. If the same keyword is passed to both __init__
and one of the _implemented_funcs
, the one passed to func
takes precedence.
Parameters:
-
radius
¶float
, default:3.238315484166236
) –Overrides the filter kernel radius. Has no effect if the filter kernel is not resizeable.
-
blur
¶float
, default:0.9812505837223707
) –Additional blur coefficient. This effectively stretches the kernel, without changing the effective radius of the filter radius.
-
**kwargs
¶Any
, default:{}
) –Keyword arguments that configure the internal scaling behavior.
Classes:
-
cached_property
–Read only version of functools.cached_property.
Methods:
-
ensure_obj
–Ensure that the input is a scaler instance, resolving it if necessary.
-
from_param
–Resolve and return a scaler type from a given input (string, type, or instance).
-
get_scale_args
– -
kernel_radius
– -
multi
–Deprecated alias for
supersample
. -
pretty_string
–Cached property returning a user-friendly string representation.
-
scale
–Scale a clip to the given resolution, with aspect ratio and linear light support.
-
supersample
–Supersample a clip by a given scaling factor.
Attributes:
-
antiring
– -
b
– -
blur
– -
c
– -
clamp
– -
kwargs
(dict[str, Any]
) –Arguments passed to the implemented funcs or internal scale function.
-
radius
– -
scale_function
– -
taper
–
Source code
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 |
|
kwargs instance-attribute
¶
Arguments passed to the implemented funcs or internal scale function.
cached_property ¶
cached_property(func: Callable[Concatenate[_BaseScalerT, P], T_co])
Bases: cached_property[T_co]
Read only version of functools.cached_property.
Source code
291 |
|
ensure_obj classmethod
¶
ensure_obj(
scaler: str | type[Self] | Self | None = None,
/,
func_except: FuncExceptT | None = None,
) -> Self
Ensure that the input is a scaler instance, resolving it if necessary.
Parameters:
-
scaler
¶str | type[Self] | Self | None
, default:None
) –Scaler identifier (string, class, or instance).
-
func_except
¶FuncExceptT | None
, default:None
) –Function returned for custom error handling.
Returns:
-
Self
–Scaler instance.
Source code
371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 |
|
from_param classmethod
¶
from_param(
scaler: str | type[Self] | Self | None = None,
/,
func_except: FuncExceptT | None = None,
) -> type[Self]
Resolve and return a scaler type from a given input (string, type, or instance).
Parameters:
-
scaler
¶str | type[Self] | Self | None
, default:None
) –Scaler identifier (string, class, or instance).
-
func_except
¶FuncExceptT | None
, default:None
) –Function returned for custom error handling.
Returns:
-
type[Self]
–Resolved scaler type.
Source code
352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 |
|
get_scale_args ¶
get_scale_args(
clip: VideoNode,
shift: tuple[TopShift, LeftShift] = (0, 0),
width: int | None = None,
height: int | None = None,
**kwargs: Any
) -> dict[str, Any]
Source code
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 |
|
kernel_radius ¶
kernel_radius() -> int
Source code
106 107 108 109 110 111 112 113 114 115 116 117 |
|
multi ¶
multi(
clip: VideoNodeT,
multi: float = 2.0,
shift: tuple[TopShift, LeftShift] = (0, 0),
**kwargs: Any
) -> VideoNodeT
Deprecated alias for supersample
.
Parameters:
-
clip
¶VideoNodeT
) –The source clip.
-
multi
¶float
, default:2.0
) –Supersampling factor.
-
shift
¶tuple[TopShift, LeftShift]
, default:(0, 0)
) –Subpixel shift (top, left) applied during scaling.
-
**kwargs
¶Any
, default:{}
) –Additional arguments forwarded to the scale function.
Returns:
-
VideoNodeT
–The supersampled clip.
Source code
511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 |
|
pretty_string ¶
pretty_string() -> str
Cached property returning a user-friendly string representation.
Returns:
-
str
–Pretty-printed string with arguments.
Source code
419 420 421 422 423 424 425 426 427 |
|
scale ¶
scale(
clip: VideoNode,
width: int | None = None,
height: int | None = None,
shift: tuple[TopShift | list[TopShift], LeftShift | list[LeftShift]] = (
0,
0,
),
*,
linear: bool | None = None,
sigmoid: bool | tuple[Slope, Center] = False,
border_handling: BorderHandling = MIRROR,
sample_grid_model: SampleGridModel = MATCH_EDGES,
sar: Sar | float | bool | None = None,
dar: Dar | float | bool | None = None,
dar_in: Dar | bool | float | None = None,
keep_ar: bool | None = None,
blur: float | None = None,
**kwargs: Any
) -> VideoNode | ConstantFormatVideoNode
Scale a clip to the given resolution, with aspect ratio and linear light support.
Keyword arguments passed during initialization are automatically injected here, unless explicitly overridden by the arguments provided at call time. Only arguments that match named parameters in this method are injected.
Parameters:
-
clip
¶VideoNode
) –The source clip.
-
width
¶int | None
, default:None
) –Target width (defaults to clip width if None).
-
height
¶int | None
, default:None
) –Target height (defaults to clip height if None).
-
shift
¶tuple[TopShift | list[TopShift], LeftShift | list[LeftShift]]
, default:(0, 0)
) –Subpixel shift (top, left) applied during scaling. If a tuple is provided, it is used uniformly. If a list is given, the shift is applied per plane.
-
linear
¶bool | None
, default:None
) –Whether to linearize the input before descaling. If None, inferred from sigmoid.
-
sigmoid
¶bool | tuple[Slope, Center]
, default:False
) –Whether to use sigmoid transfer curve. Can be True, False, or a tuple of (slope, center).
True
applies the defaults values (6.5, 0.75). Keep in mind sigmoid slope has to be in range 1.0-20.0 (inclusive) and sigmoid center has to be in range 0.0-1.0 (inclusive). -
border_handling
¶BorderHandling
, default:MIRROR
) –Method for handling image borders during sampling.
-
sample_grid_model
¶SampleGridModel
, default:MATCH_EDGES
) –Model used to align sampling grid.
-
sar
¶Sar | float | bool | None
, default:None
) –Sample aspect ratio to assume or convert to.
-
dar
¶Dar | float | bool | None
, default:None
) –Desired display aspect ratio.
-
dar_in
¶Dar | bool | float | None
, default:None
) –Input display aspect ratio, if different from clip's.
-
keep_ar
¶bool | None
, default:None
) –Whether to adjust dimensions to preserve aspect ratio.
-
blur
¶float | None
, default:None
) –Amount of blur to apply during scaling.
Returns:
-
VideoNode | ConstantFormatVideoNode
–Scaled clip, optionally aspect-corrected and linearized.
Source code
527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 |
|
supersample ¶
supersample(
clip: VideoNodeT,
rfactor: float = 2.0,
shift: tuple[TopShift, LeftShift] = (0, 0),
**kwargs: Any
) -> VideoNodeT
Supersample a clip by a given scaling factor.
Parameters:
-
clip
¶VideoNodeT
) –The source clip.
-
rfactor
¶float
, default:2.0
) –Scaling factor for supersampling.
-
shift
¶tuple[TopShift, LeftShift]
, default:(0, 0)
) –Subpixel shift (top, left) applied during scaling.
-
**kwargs
¶Any
, default:{}
) –Additional arguments forwarded to the scale function.
Raises:
-
CustomValueError
–If resulting resolution is non-positive.
Returns:
-
VideoNodeT
–The supersampled clip.
Source code
480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 |
|
EwaRobidoux ¶
Bases: Placebo
Ewa Robidoux resizer.
Initialize the kernel with optional keyword arguments.
These keyword arguments are automatically forwarded to the _implemented_funcs
methods but only if the method explicitly accepts them as named parameters. If the same keyword is passed to both __init__
and one of the _implemented_funcs
, the one passed to func
takes precedence.
Parameters:
Classes:
-
cached_property
–Read only version of functools.cached_property.
Methods:
-
ensure_obj
–Ensure that the input is a scaler instance, resolving it if necessary.
-
from_param
–Resolve and return a scaler type from a given input (string, type, or instance).
-
get_scale_args
– -
kernel_radius
– -
multi
–Deprecated alias for
supersample
. -
pretty_string
–Cached property returning a user-friendly string representation.
-
scale
–Scale a clip to the given resolution, with aspect ratio and linear light support.
-
supersample
–Supersample a clip by a given scaling factor.
Attributes:
-
antiring
– -
b
– -
blur
– -
c
– -
clamp
– -
kwargs
(dict[str, Any]
) –Arguments passed to the implemented funcs or internal scale function.
-
radius
– -
scale_function
– -
taper
–
Source code
302 303 304 305 306 307 308 309 310 311 312 313 314 |
|
kwargs instance-attribute
¶
Arguments passed to the implemented funcs or internal scale function.
cached_property ¶
cached_property(func: Callable[Concatenate[_BaseScalerT, P], T_co])
Bases: cached_property[T_co]
Read only version of functools.cached_property.
Source code
291 |
|
ensure_obj classmethod
¶
ensure_obj(
scaler: str | type[Self] | Self | None = None,
/,
func_except: FuncExceptT | None = None,
) -> Self
Ensure that the input is a scaler instance, resolving it if necessary.
Parameters:
-
scaler
¶str | type[Self] | Self | None
, default:None
) –Scaler identifier (string, class, or instance).
-
func_except
¶FuncExceptT | None
, default:None
) –Function returned for custom error handling.
Returns:
-
Self
–Scaler instance.
Source code
371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 |
|
from_param classmethod
¶
from_param(
scaler: str | type[Self] | Self | None = None,
/,
func_except: FuncExceptT | None = None,
) -> type[Self]
Resolve and return a scaler type from a given input (string, type, or instance).
Parameters:
-
scaler
¶str | type[Self] | Self | None
, default:None
) –Scaler identifier (string, class, or instance).
-
func_except
¶FuncExceptT | None
, default:None
) –Function returned for custom error handling.
Returns:
-
type[Self]
–Resolved scaler type.
Source code
352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 |
|
get_scale_args ¶
get_scale_args(
clip: VideoNode,
shift: tuple[TopShift, LeftShift] = (0, 0),
width: int | None = None,
height: int | None = None,
**kwargs: Any
) -> dict[str, Any]
Source code
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 |
|
kernel_radius ¶
kernel_radius() -> int
Source code
106 107 108 109 110 111 112 113 114 115 116 117 |
|
multi ¶
multi(
clip: VideoNodeT,
multi: float = 2.0,
shift: tuple[TopShift, LeftShift] = (0, 0),
**kwargs: Any
) -> VideoNodeT
Deprecated alias for supersample
.
Parameters:
-
clip
¶VideoNodeT
) –The source clip.
-
multi
¶float
, default:2.0
) –Supersampling factor.
-
shift
¶tuple[TopShift, LeftShift]
, default:(0, 0)
) –Subpixel shift (top, left) applied during scaling.
-
**kwargs
¶Any
, default:{}
) –Additional arguments forwarded to the scale function.
Returns:
-
VideoNodeT
–The supersampled clip.
Source code
511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 |
|
pretty_string ¶
pretty_string() -> str
Cached property returning a user-friendly string representation.
Returns:
-
str
–Pretty-printed string with arguments.
Source code
419 420 421 422 423 424 425 426 427 |
|
scale ¶
scale(
clip: VideoNode,
width: int | None = None,
height: int | None = None,
shift: tuple[TopShift | list[TopShift], LeftShift | list[LeftShift]] = (
0,
0,
),
*,
linear: bool | None = None,
sigmoid: bool | tuple[Slope, Center] = False,
border_handling: BorderHandling = MIRROR,
sample_grid_model: SampleGridModel = MATCH_EDGES,
sar: Sar | float | bool | None = None,
dar: Dar | float | bool | None = None,
dar_in: Dar | bool | float | None = None,
keep_ar: bool | None = None,
blur: float | None = None,
**kwargs: Any
) -> VideoNode | ConstantFormatVideoNode
Scale a clip to the given resolution, with aspect ratio and linear light support.
Keyword arguments passed during initialization are automatically injected here, unless explicitly overridden by the arguments provided at call time. Only arguments that match named parameters in this method are injected.
Parameters:
-
clip
¶VideoNode
) –The source clip.
-
width
¶int | None
, default:None
) –Target width (defaults to clip width if None).
-
height
¶int | None
, default:None
) –Target height (defaults to clip height if None).
-
shift
¶tuple[TopShift | list[TopShift], LeftShift | list[LeftShift]]
, default:(0, 0)
) –Subpixel shift (top, left) applied during scaling. If a tuple is provided, it is used uniformly. If a list is given, the shift is applied per plane.
-
linear
¶bool | None
, default:None
) –Whether to linearize the input before descaling. If None, inferred from sigmoid.
-
sigmoid
¶bool | tuple[Slope, Center]
, default:False
) –Whether to use sigmoid transfer curve. Can be True, False, or a tuple of (slope, center).
True
applies the defaults values (6.5, 0.75). Keep in mind sigmoid slope has to be in range 1.0-20.0 (inclusive) and sigmoid center has to be in range 0.0-1.0 (inclusive). -
border_handling
¶BorderHandling
, default:MIRROR
) –Method for handling image borders during sampling.
-
sample_grid_model
¶SampleGridModel
, default:MATCH_EDGES
) –Model used to align sampling grid.
-
sar
¶Sar | float | bool | None
, default:None
) –Sample aspect ratio to assume or convert to.
-
dar
¶Dar | float | bool | None
, default:None
) –Desired display aspect ratio.
-
dar_in
¶Dar | bool | float | None
, default:None
) –Input display aspect ratio, if different from clip's.
-
keep_ar
¶bool | None
, default:None
) –Whether to adjust dimensions to preserve aspect ratio.
-
blur
¶float | None
, default:None
) –Amount of blur to apply during scaling.
Returns:
-
VideoNode | ConstantFormatVideoNode
–Scaled clip, optionally aspect-corrected and linearized.
Source code
527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 |
|
supersample ¶
supersample(
clip: VideoNodeT,
rfactor: float = 2.0,
shift: tuple[TopShift, LeftShift] = (0, 0),
**kwargs: Any
) -> VideoNodeT
Supersample a clip by a given scaling factor.
Parameters:
-
clip
¶VideoNodeT
) –The source clip.
-
rfactor
¶float
, default:2.0
) –Scaling factor for supersampling.
-
shift
¶tuple[TopShift, LeftShift]
, default:(0, 0)
) –Subpixel shift (top, left) applied during scaling.
-
**kwargs
¶Any
, default:{}
) –Additional arguments forwarded to the scale function.
Raises:
-
CustomValueError
–If resulting resolution is non-positive.
Returns:
-
VideoNodeT
–The supersampled clip.
Source code
480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 |
|
EwaRobidouxSharp ¶
Bases: Placebo
Ewa Robidoux Sharp resizer.
Initialize the kernel with optional keyword arguments.
These keyword arguments are automatically forwarded to the _implemented_funcs
methods but only if the method explicitly accepts them as named parameters. If the same keyword is passed to both __init__
and one of the _implemented_funcs
, the one passed to func
takes precedence.
Parameters:
Classes:
-
cached_property
–Read only version of functools.cached_property.
Methods:
-
ensure_obj
–Ensure that the input is a scaler instance, resolving it if necessary.
-
from_param
–Resolve and return a scaler type from a given input (string, type, or instance).
-
get_scale_args
– -
kernel_radius
– -
multi
–Deprecated alias for
supersample
. -
pretty_string
–Cached property returning a user-friendly string representation.
-
scale
–Scale a clip to the given resolution, with aspect ratio and linear light support.
-
supersample
–Supersample a clip by a given scaling factor.
Attributes:
-
antiring
– -
b
– -
blur
– -
c
– -
clamp
– -
kwargs
(dict[str, Any]
) –Arguments passed to the implemented funcs or internal scale function.
-
radius
– -
scale_function
– -
taper
–
Source code
324 325 326 327 328 329 330 331 332 333 334 335 336 |
|
kwargs instance-attribute
¶
Arguments passed to the implemented funcs or internal scale function.
cached_property ¶
cached_property(func: Callable[Concatenate[_BaseScalerT, P], T_co])
Bases: cached_property[T_co]
Read only version of functools.cached_property.
Source code
291 |
|
ensure_obj classmethod
¶
ensure_obj(
scaler: str | type[Self] | Self | None = None,
/,
func_except: FuncExceptT | None = None,
) -> Self
Ensure that the input is a scaler instance, resolving it if necessary.
Parameters:
-
scaler
¶str | type[Self] | Self | None
, default:None
) –Scaler identifier (string, class, or instance).
-
func_except
¶FuncExceptT | None
, default:None
) –Function returned for custom error handling.
Returns:
-
Self
–Scaler instance.
Source code
371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 |
|
from_param classmethod
¶
from_param(
scaler: str | type[Self] | Self | None = None,
/,
func_except: FuncExceptT | None = None,
) -> type[Self]
Resolve and return a scaler type from a given input (string, type, or instance).
Parameters:
-
scaler
¶str | type[Self] | Self | None
, default:None
) –Scaler identifier (string, class, or instance).
-
func_except
¶FuncExceptT | None
, default:None
) –Function returned for custom error handling.
Returns:
-
type[Self]
–Resolved scaler type.
Source code
352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 |
|
get_scale_args ¶
get_scale_args(
clip: VideoNode,
shift: tuple[TopShift, LeftShift] = (0, 0),
width: int | None = None,
height: int | None = None,
**kwargs: Any
) -> dict[str, Any]
Source code
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 |
|
kernel_radius ¶
kernel_radius() -> int
Source code
106 107 108 109 110 111 112 113 114 115 116 117 |
|
multi ¶
multi(
clip: VideoNodeT,
multi: float = 2.0,
shift: tuple[TopShift, LeftShift] = (0, 0),
**kwargs: Any
) -> VideoNodeT
Deprecated alias for supersample
.
Parameters:
-
clip
¶VideoNodeT
) –The source clip.
-
multi
¶float
, default:2.0
) –Supersampling factor.
-
shift
¶tuple[TopShift, LeftShift]
, default:(0, 0)
) –Subpixel shift (top, left) applied during scaling.
-
**kwargs
¶Any
, default:{}
) –Additional arguments forwarded to the scale function.
Returns:
-
VideoNodeT
–The supersampled clip.
Source code
511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 |
|
pretty_string ¶
pretty_string() -> str
Cached property returning a user-friendly string representation.
Returns:
-
str
–Pretty-printed string with arguments.
Source code
419 420 421 422 423 424 425 426 427 |
|
scale ¶
scale(
clip: VideoNode,
width: int | None = None,
height: int | None = None,
shift: tuple[TopShift | list[TopShift], LeftShift | list[LeftShift]] = (
0,
0,
),
*,
linear: bool | None = None,
sigmoid: bool | tuple[Slope, Center] = False,
border_handling: BorderHandling = MIRROR,
sample_grid_model: SampleGridModel = MATCH_EDGES,
sar: Sar | float | bool | None = None,
dar: Dar | float | bool | None = None,
dar_in: Dar | bool | float | None = None,
keep_ar: bool | None = None,
blur: float | None = None,
**kwargs: Any
) -> VideoNode | ConstantFormatVideoNode
Scale a clip to the given resolution, with aspect ratio and linear light support.
Keyword arguments passed during initialization are automatically injected here, unless explicitly overridden by the arguments provided at call time. Only arguments that match named parameters in this method are injected.
Parameters:
-
clip
¶VideoNode
) –The source clip.
-
width
¶int | None
, default:None
) –Target width (defaults to clip width if None).
-
height
¶int | None
, default:None
) –Target height (defaults to clip height if None).
-
shift
¶tuple[TopShift | list[TopShift], LeftShift | list[LeftShift]]
, default:(0, 0)
) –Subpixel shift (top, left) applied during scaling. If a tuple is provided, it is used uniformly. If a list is given, the shift is applied per plane.
-
linear
¶bool | None
, default:None
) –Whether to linearize the input before descaling. If None, inferred from sigmoid.
-
sigmoid
¶bool | tuple[Slope, Center]
, default:False
) –Whether to use sigmoid transfer curve. Can be True, False, or a tuple of (slope, center).
True
applies the defaults values (6.5, 0.75). Keep in mind sigmoid slope has to be in range 1.0-20.0 (inclusive) and sigmoid center has to be in range 0.0-1.0 (inclusive). -
border_handling
¶BorderHandling
, default:MIRROR
) –Method for handling image borders during sampling.
-
sample_grid_model
¶SampleGridModel
, default:MATCH_EDGES
) –Model used to align sampling grid.
-
sar
¶Sar | float | bool | None
, default:None
) –Sample aspect ratio to assume or convert to.
-
dar
¶Dar | float | bool | None
, default:None
) –Desired display aspect ratio.
-
dar_in
¶Dar | bool | float | None
, default:None
) –Input display aspect ratio, if different from clip's.
-
keep_ar
¶bool | None
, default:None
) –Whether to adjust dimensions to preserve aspect ratio.
-
blur
¶float | None
, default:None
) –Amount of blur to apply during scaling.
Returns:
-
VideoNode | ConstantFormatVideoNode
–Scaled clip, optionally aspect-corrected and linearized.
Source code
527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 |
|
supersample ¶
supersample(
clip: VideoNodeT,
rfactor: float = 2.0,
shift: tuple[TopShift, LeftShift] = (0, 0),
**kwargs: Any
) -> VideoNodeT
Supersample a clip by a given scaling factor.
Parameters:
-
clip
¶VideoNodeT
) –The source clip.
-
rfactor
¶float
, default:2.0
) –Scaling factor for supersampling.
-
shift
¶tuple[TopShift, LeftShift]
, default:(0, 0)
) –Subpixel shift (top, left) applied during scaling.
-
**kwargs
¶Any
, default:{}
) –Additional arguments forwarded to the scale function.
Raises:
-
CustomValueError
–If resulting resolution is non-positive.
Returns:
-
VideoNodeT
–The supersampled clip.
Source code
480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 |
|
Placebo ¶
Placebo(
radius: float | None = None,
b: float | None = None,
c: float | None = None,
clamp: float = 0.0,
blur: float = 0.0,
taper: float = 0.0,
antiring: float = 0.0,
**kwargs: Any
)
Bases: ComplexScaler
Abstract Placebo scaler class.
This class and its subclasses depend on vs-placebo
Initialize the scaler with optional arguments.
Keyword arguments passed during initialization are automatically injected here, unless explicitly overridden by the arguments provided at call time. Only arguments that match named parameters in this method are injected.
Parameters:
-
radius
¶float | None
, default:None
) –Overrides the filter kernel radius. Has no effect if the filter kernel is not resizeable.
-
b
¶float | None
, default:None
) –The 'b' parameter for bicubic interpolation.
-
c
¶float | None
, default:None
) –The 'c' parameter for bicubic interpolation.
-
clamp
¶float
, default:0.0
) –Represents an extra weighting/clamping coefficient for negative weights. A value of 0.0 represents no clamping. A value of 1.0 represents full clamping, i.e. all negative lobes will be removed.
-
blur
¶float
, default:0.0
) –Additional blur coefficient. This effectively stretches the kernel, without changing the effective radius of the filter radius.
-
taper
¶float
, default:0.0
) –Additional taper coefficient. This essentially flattens the function's center.
-
antiring
¶float
, default:0.0
) –Antiringing strength.
-
**kwargs
¶Any
, default:{}
) –Keyword arguments that configure the internal scaling behavior.
Classes:
-
cached_property
–Read only version of functools.cached_property.
Methods:
-
ensure_obj
–Ensure that the input is a scaler instance, resolving it if necessary.
-
from_param
–Resolve and return a scaler type from a given input (string, type, or instance).
-
get_scale_args
– -
kernel_radius
– -
multi
–Deprecated alias for
supersample
. -
pretty_string
–Cached property returning a user-friendly string representation.
-
scale
–Scale a clip to the given resolution, with aspect ratio and linear light support.
-
supersample
–Supersample a clip by a given scaling factor.
Attributes:
-
antiring
– -
b
– -
blur
– -
c
– -
clamp
– -
kwargs
(dict[str, Any]
) –Arguments passed to the implemented funcs or internal scale function.
-
radius
– -
scale_function
– -
taper
–
Source code
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
|
kwargs instance-attribute
¶
Arguments passed to the implemented funcs or internal scale function.
cached_property ¶
cached_property(func: Callable[Concatenate[_BaseScalerT, P], T_co])
Bases: cached_property[T_co]
Read only version of functools.cached_property.
Source code
291 |
|
ensure_obj classmethod
¶
ensure_obj(
scaler: str | type[Self] | Self | None = None,
/,
func_except: FuncExceptT | None = None,
) -> Self
Ensure that the input is a scaler instance, resolving it if necessary.
Parameters:
-
scaler
¶str | type[Self] | Self | None
, default:None
) –Scaler identifier (string, class, or instance).
-
func_except
¶FuncExceptT | None
, default:None
) –Function returned for custom error handling.
Returns:
-
Self
–Scaler instance.
Source code
371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 |
|
from_param classmethod
¶
from_param(
scaler: str | type[Self] | Self | None = None,
/,
func_except: FuncExceptT | None = None,
) -> type[Self]
Resolve and return a scaler type from a given input (string, type, or instance).
Parameters:
-
scaler
¶str | type[Self] | Self | None
, default:None
) –Scaler identifier (string, class, or instance).
-
func_except
¶FuncExceptT | None
, default:None
) –Function returned for custom error handling.
Returns:
-
type[Self]
–Resolved scaler type.
Source code
352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 |
|
get_scale_args ¶
get_scale_args(
clip: VideoNode,
shift: tuple[TopShift, LeftShift] = (0, 0),
width: int | None = None,
height: int | None = None,
**kwargs: Any
) -> dict[str, Any]
Source code
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 |
|
kernel_radius ¶
kernel_radius() -> int
Source code
106 107 108 109 110 111 112 113 114 115 116 117 |
|
multi ¶
multi(
clip: VideoNodeT,
multi: float = 2.0,
shift: tuple[TopShift, LeftShift] = (0, 0),
**kwargs: Any
) -> VideoNodeT
Deprecated alias for supersample
.
Parameters:
-
clip
¶VideoNodeT
) –The source clip.
-
multi
¶float
, default:2.0
) –Supersampling factor.
-
shift
¶tuple[TopShift, LeftShift]
, default:(0, 0)
) –Subpixel shift (top, left) applied during scaling.
-
**kwargs
¶Any
, default:{}
) –Additional arguments forwarded to the scale function.
Returns:
-
VideoNodeT
–The supersampled clip.
Source code
511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 |
|
pretty_string ¶
pretty_string() -> str
Cached property returning a user-friendly string representation.
Returns:
-
str
–Pretty-printed string with arguments.
Source code
419 420 421 422 423 424 425 426 427 |
|
scale ¶
scale(
clip: VideoNode,
width: int | None = None,
height: int | None = None,
shift: tuple[TopShift | list[TopShift], LeftShift | list[LeftShift]] = (
0,
0,
),
*,
linear: bool | None = None,
sigmoid: bool | tuple[Slope, Center] = False,
border_handling: BorderHandling = MIRROR,
sample_grid_model: SampleGridModel = MATCH_EDGES,
sar: Sar | float | bool | None = None,
dar: Dar | float | bool | None = None,
dar_in: Dar | bool | float | None = None,
keep_ar: bool | None = None,
blur: float | None = None,
**kwargs: Any
) -> VideoNode | ConstantFormatVideoNode
Scale a clip to the given resolution, with aspect ratio and linear light support.
Keyword arguments passed during initialization are automatically injected here, unless explicitly overridden by the arguments provided at call time. Only arguments that match named parameters in this method are injected.
Parameters:
-
clip
¶VideoNode
) –The source clip.
-
width
¶int | None
, default:None
) –Target width (defaults to clip width if None).
-
height
¶int | None
, default:None
) –Target height (defaults to clip height if None).
-
shift
¶tuple[TopShift | list[TopShift], LeftShift | list[LeftShift]]
, default:(0, 0)
) –Subpixel shift (top, left) applied during scaling. If a tuple is provided, it is used uniformly. If a list is given, the shift is applied per plane.
-
linear
¶bool | None
, default:None
) –Whether to linearize the input before descaling. If None, inferred from sigmoid.
-
sigmoid
¶bool | tuple[Slope, Center]
, default:False
) –Whether to use sigmoid transfer curve. Can be True, False, or a tuple of (slope, center).
True
applies the defaults values (6.5, 0.75). Keep in mind sigmoid slope has to be in range 1.0-20.0 (inclusive) and sigmoid center has to be in range 0.0-1.0 (inclusive). -
border_handling
¶BorderHandling
, default:MIRROR
) –Method for handling image borders during sampling.
-
sample_grid_model
¶SampleGridModel
, default:MATCH_EDGES
) –Model used to align sampling grid.
-
sar
¶Sar | float | bool | None
, default:None
) –Sample aspect ratio to assume or convert to.
-
dar
¶Dar | float | bool | None
, default:None
) –Desired display aspect ratio.
-
dar_in
¶Dar | bool | float | None
, default:None
) –Input display aspect ratio, if different from clip's.
-
keep_ar
¶bool | None
, default:None
) –Whether to adjust dimensions to preserve aspect ratio.
-
blur
¶float | None
, default:None
) –Amount of blur to apply during scaling.
Returns:
-
VideoNode | ConstantFormatVideoNode
–Scaled clip, optionally aspect-corrected and linearized.
Source code
527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 |
|
supersample ¶
supersample(
clip: VideoNodeT,
rfactor: float = 2.0,
shift: tuple[TopShift, LeftShift] = (0, 0),
**kwargs: Any
) -> VideoNodeT
Supersample a clip by a given scaling factor.
Parameters:
-
clip
¶VideoNodeT
) –The source clip.
-
rfactor
¶float
, default:2.0
) –Scaling factor for supersampling.
-
shift
¶tuple[TopShift, LeftShift]
, default:(0, 0)
) –Subpixel shift (top, left) applied during scaling.
-
**kwargs
¶Any
, default:{}
) –Additional arguments forwarded to the scale function.
Raises:
-
CustomValueError
–If resulting resolution is non-positive.
Returns:
-
VideoNodeT
–The supersampled clip.
Source code
480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 |
|