shaders ¶
Classes:
-
PlaceboShader
–Placebo shader class.
PlaceboShader ¶
PlaceboShader(
shader: str | SPathLike,
*,
kernel: KernelLike = Catrom,
scaler: ScalerLike | None = None,
shifter: KernelLike | None = None,
**kwargs: Any
)
Bases: BaseGenericScaler
Placebo shader class.
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
–Generate the keyword arguments used for scaling.
-
kernel_radius
–Return the effective kernel radius for the scaler.
-
multi
–Deprecated alias for
supersample
. -
pretty_string
–Cached property returning a user-friendly string representation.
-
scale
– -
supersample
–Supersample a clip by a given scaling factor.
Attributes:
-
kernel
– -
kwargs
(dict[str, Any]
) –Arguments passed to the implemented funcs or internal scale function.
-
scale_function
(Callable[..., VideoNode]
) –Scale function called internally when performing scaling operations.
-
scaler
– -
shader
– -
shifter
–
Source code
23 24 25 26 27 28 29 30 31 32 33 34 |
|
kwargs instance-attribute
¶
Arguments passed to the implemented funcs or internal scale function.
scale_function instance-attribute
¶
scale_function: Callable[..., VideoNode]
Scale function called internally when performing scaling operations.
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
265 |
|
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
330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 |
|
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
314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 |
|
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]
Generate the keyword arguments used for scaling.
Parameters:
-
clip
¶VideoNode
) –The source clip.
-
shift
¶tuple[TopShift, LeftShift]
, default:(0, 0)
) –Subpixel shift (top, left).
-
width
¶int | None
, default:None
) –Target width.
-
height
¶int | None
, default:None
) –Target height.
-
kwargs
¶Any
, default:{}
) –Extra parameters to merge.
Returns:
Source code
466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 |
|
kernel_radius ¶
kernel_radius() -> int
Return the effective kernel radius for the scaler.
Returns:
-
int
–Kernel radius.
Raises:
-
CustomNotImplementedError
–If no kernel radius is defined.
Source code
347 348 349 350 351 352 353 354 355 |
|
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
451 452 453 454 455 456 457 458 459 460 461 462 463 464 |
|
pretty_string ¶
pretty_string() -> str
Cached property returning a user-friendly string representation.
Returns:
-
str
–Pretty-printed string with arguments.
Source code
368 369 370 371 372 373 374 375 |
|
scale ¶
scale(
clip: VideoNode,
width: int | None = None,
height: int | None = None,
shift: tuple[float, float] = (0, 0),
**kwargs: Any
) -> ConstantFormatVideoNode
Source code
36 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 75 76 77 78 |
|
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.
Returns:
-
VideoNodeT
–The supersampled clip.
Raises:
-
CustomValueError
–If resulting resolution is non-positive.
Source code
425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 |
|