You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
currently, effects are functions that receive the clip as the first argument, and the rest are arguments for the fx itself. If we refactor them as classes where the init receive the arguments of the fx and __call__ receives the clip instances, the fx function
wich, in my opinion is more explicit and readable, and allow better code reuse.
In addition, making them instances allow us to implement further niceties like pipe effects (see #1076 )
clip | volumex(0.5) | resize(0.3) | mirrorx()
Lastly, we could do it just defining a decorator that convert functions to classes dynamically, and adding some type checking to fx to make it backward compatible.
The text was updated successfully, but these errors were encountered:
This would definitely be an improvement than the current syntax that you demonstrated, but I think that the method that editor.py uses is even better, which is just clip = clip.volumex(0.5).resize(0.3).mirrorx().
However, not all effects and transitions are currently available for use this way because they are not added as methods to VideoClip in editor.py. I propose just updating this list in preference to making them classes like you suggest. (I'll start working on this now).
This is just a raw proposal
currently, effects are functions that receive the clip as the first argument, and the rest are arguments for the fx itself. If we refactor them as classes where the init receive the arguments of the fx and
__call__
receives the clip instances, the fx functioncould be something like
wich, in my opinion is more explicit and readable, and allow better code reuse.
In addition, making them instances allow us to implement further niceties like pipe effects (see #1076 )
Lastly, we could do it just defining a decorator that convert functions to classes dynamically, and adding some type checking to
fx
to make it backward compatible.The text was updated successfully, but these errors were encountered: