generated from thinkode/modelRepository
initial commit and version 1.0
This commit is contained in:
16
moviepy/video/fx/MirrorX.py
Normal file
16
moviepy/video/fx/MirrorX.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from dataclasses import dataclass
|
||||
from typing import List, Union
|
||||
|
||||
from moviepy.Clip import Clip
|
||||
from moviepy.Effect import Effect
|
||||
|
||||
|
||||
@dataclass
|
||||
class MirrorX(Effect):
|
||||
"""Flips the clip horizontally (and its mask too, by default)."""
|
||||
|
||||
apply_to: Union[List, str] = "mask"
|
||||
|
||||
def apply(self, clip: Clip) -> Clip:
|
||||
"""Apply the effect to the clip."""
|
||||
return clip.image_transform(lambda img: img[:, ::-1], apply_to=self.apply_to)
|
||||
Reference in New Issue
Block a user