ashketchupppp / veff

2 stars 1 forks source link

Refactor effects.py to make sense #8

Open ashketchupppp opened 2 years ago

ashketchupppp commented 2 years ago

Currently, effects.py contains all the video effects and a dictionary controlling how each effect should be run (batch_apply or multi_input_batch_apply for example). This isn't very good, this way of doing things was okay on a small scale but with an increasing number of effects it is getting annoying to maintain and should be refactored.

We should probably create an Effect abstract base class that implements the batch_apply method (renamed to apply). Each effect would inherit from this new class. The effects needing multi_input_batch_apply can be turned into a different effect class, inheriting from Effect, whose apply method is overriden and contains the functionality in multi_input_batch_apply.

These new effect classes can also have a schema function which defines what options they need so that the options needed for an effect are stored with the effect itself, meaning that the option schemas for each effect in config_schema.py can be replaced with a function that loads each of the schemas in an automatic loop.

ashketchupppp commented 2 years ago

Once this is done, https://github.com/ashketchupppp/veff/issues/3 will be much easier to do