Generates an instance of the Composition class.
Composition width.
Composition height.
Border width.
Adds an element to the composition.
Element to add.
Element X position.
Element Y position.
Element width.
Element height.
Element scale.
Value indicating whether to mirror the image.
// example
const composition = new Composition(width, height, borderWidth);
composition.addElement(webcam, 0, 0, webcam.videoWidth, webcam.videoHeight, 1, false);
composition.addElement(image, 0, 0, image.width, image.height, 1, false);
Clears the composition.
Gets the resulting composition.
A promise with a blob containing the composition.
// example
composition.get().then(blob => {
image.src = URL.createObjectURL(blob);
)};
Generated using TypeDoc
Generates images composition based on different elements.