mirror of
https://github.com/publiclab/image-sequencer.git
synced 2025-12-12 19:30:00 +01:00
Updated CONTRIBUTING.md
This commit is contained in:
@@ -66,21 +66,19 @@ constant definitions must be done **outside** the `draw()` method's definition.
|
|||||||
step has been "drawn".
|
step has been "drawn".
|
||||||
|
|
||||||
When you have done your calculations and produced an image output, you are required
|
When you have done your calculations and produced an image output, you are required
|
||||||
to set `this.output` to an object similar to what the input object was, and call
|
to set `this.output` to an object similar to what the input object was, call
|
||||||
`callback()`.
|
`callback()`, and set `options.step.output` equal to the output DataURL
|
||||||
|
|
||||||
### UI Methods
|
### UI Methods
|
||||||
|
|
||||||
The module is responsible to emit various events for the UI to capture. There are
|
The module is responsible to emit various events for the UI to capture. There are
|
||||||
four events in all:
|
four events in all:
|
||||||
|
|
||||||
* `UI.onSetup()` must be emitted when the module is added. So it must be emitted
|
* `UI.onSetup(options.step)` must be emitted when the module is added. So it must be emitted outside the draw method's definition as shown above.
|
||||||
outside the draw method's definition as shown above.
|
* `UI.onDraw(options.step)` must be emitted whenever the `draw()` method is called. So it should ideally be the first line of the definition of the `draw` method.
|
||||||
* `UI.onDraw()` must be emitted whenever the `draw()` method is called. So it should
|
* `UI.onComplete(options.step)` must be emitted whenever the output of a draw call
|
||||||
ideally be the first line of the definition of the `draw` method.
|
|
||||||
* `UI.onComplete(output_src)` must be emitted whenever the output of a draw call
|
|
||||||
is ready. An argument, that is the DataURL of the output image must be passed in.
|
is ready. An argument, that is the DataURL of the output image must be passed in.
|
||||||
* `UI.onRemove()` is emitted automatically and the module should not emit it.
|
* `UI.onRemove(options.step)` is emitted automatically and the module should not emit it.
|
||||||
|
|
||||||
To add a module to Image Sequencer, it must have the following method; you can wrap an existing module to add them:
|
To add a module to Image Sequencer, it must have the following method; you can wrap an existing module to add them:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user