@@ -17,14 +17,18 @@ class Input(ABC):
1717
1818 You cannot create an `Input` from the base class.
1919
20+ Basic `Inputs`:
2021 .. code-block:: python
2122 def image(filepath: str) -> Input: ...
2223 def video(filepath: str) -> Input: ...
2324 def text(string: str) -> Input: ...
24- def shape( ) -> Input: ...
25+ def circle(radius: int ) -> Input: ...
2526 """
2627
2728 index : int
29+ """
30+ Index of the `Input`.
31+ """
2832
2933 def __new__ (cls , * args , ** kwargs ) -> Self :
3034 instance = super ().__new__ (cls )
@@ -75,23 +79,25 @@ def copy(self) -> Input:
7579 )
7680 return cp
7781
78- def __getitem__ (self , i : int | slice [int , int , None ]) -> Slice :
82+ def __getitem__ (self , i : int | slice [int | None , int | None , None ]) -> Slice :
7983 """
80- Creates a `reference` of the `frames` `s `.
84+ Creates a `reference` of the `frames` `i `.
8185
8286 Usefull if you want to apply a `Transformation` to a part of a video.
8387
84- Examples
85- --------
88+ ---
89+ ### Example
8690 >>> v = video("test.mp4")
87- >>> v[0:20].fade() # Fade-in during the first 20 frames.
88- >>> v.add()
91+ >>> v[0:20].fade() # fade in during the first 20 frames.
92+ >>> v.add() # adds it to the timeline
93+
8994 """
9095 if isinstance (i , int ):
9196 s = slice (i , i )
9297 else :
93- s = i
98+ s = slice ( i . start or 0 , i . stop or - 1 )
9499
100+ # `Slice` of `Slice`
95101 if isinstance (self , Slice ):
96102 start = - 1 if s .start == - 1 or self .s .start == - 1 else self .s .start + s .start
97103 stop = - 1 if s .stop == - 1 else self .s .start + s .stop
0 commit comments