Skip to content

types

Classes:

Attributes:

  • GenericMaskT

    Deprecated alias of MaskLike

  • MaskLike

    Type alias for anything that can resolve to a mask.

GenericMaskT module-attribute

GenericMaskT = MaskLike

Deprecated alias of MaskLike

MaskLike module-attribute

MaskLike = Union[
    VideoNode,
    Callable[[VideoNode, VideoNode], VideoNode],
    EdgeDetectLike,
    RidgeDetectLike,
    GeneralMask,
    str,
]

Type alias for anything that can resolve to a mask.

Coordinates

Bases: tuple[int, ...], CustomEnum

Methods:

Attributes:

CORNERS class-attribute instance-attribute

CORNERS = (1, 0, 1, 0, 0, 1, 0, 1)

DIAMOND class-attribute instance-attribute

DIAMOND = (0, 1, 0, 1, 1, 0, 1, 0)

HORIZONTAL class-attribute instance-attribute

HORIZONTAL = (0, 0, 0, 1, 1, 0, 0, 0)

RECTANGLE class-attribute instance-attribute

RECTANGLE = (1, 1, 1, 1, 1, 1, 1, 1)

VERTICAL class-attribute instance-attribute

VERTICAL = (0, 1, 0, 0, 0, 0, 1, 0)

from_iter classmethod

from_iter(iter: int) -> Coordinates
Source code in vsmasktools/types.py
41
42
43
@classmethod
def from_iter(cls, iter: int) -> Coordinates:
    return cls.DIAMOND if (iter % 3) != 1 else cls.RECTANGLE

from_xxpand_mode classmethod

from_xxpand_mode(xxpand_mode: XxpandMode, iter: int = 1) -> Coordinates
Source code in vsmasktools/types.py
45
46
47
48
49
50
@classmethod
def from_xxpand_mode(cls, xxpand_mode: XxpandMode, iter: int = 1) -> Coordinates:
    if xxpand_mode == XxpandMode.LOSANGE or (xxpand_mode is XxpandMode.ELLIPSE and iter % 3 != 1):
        return cls.DIAMOND

    return cls.RECTANGLE

XxpandMode

Bases: CustomEnum

Expand/inpand mode

Attributes:

ELLIPSE class-attribute instance-attribute

ELLIPSE = object()

Elliptical shape

LOSANGE class-attribute instance-attribute

LOSANGE = object()

Diamond shape

RECTANGLE class-attribute instance-attribute

RECTANGLE = object()

Rectangular shape