import * as scrawl from '../source/scrawl.js';
import { reportSpeed, addImageDragAndDrop } from './utilities.js';import * as scrawl from '../source/scrawl.js';
import { reportSpeed, addImageDragAndDrop } from './utilities.js';const canvas = scrawl.findCanvas('mycanvas');Namespacing boilerplate
const namespace = canvas.name;
const name = (n) => `${namespace}-${n}`;Import the initial image used by the Picture entity
scrawl.importDomImage('.flowers');Create the filter
const myFilter = scrawl.makeFilter({
    name: name('channels'),
    method: 'channels',
    red: 1.45,
    green: 1.1,
    blue: 0,
});Create the target entity
const piccy = scrawl.makePicture({
    name: name('image'),
    asset: 'iris',
    dimensions: ['100%', '100%'],
    copyDimensions: ['100%', '100%'],
    filters: [name('channels')],
});Function to display frames-per-second data, and other information relevant to the demo
const report = reportSpeed('#reportmessage', function () {
    return `
    Red: ${dom.red.value}
    Green: ${dom.green.value}
    Blue: ${dom.blue.value}
    Alpha: ${dom.alpha.value}
    Opacity: ${dom.opacity.value}`;
});Create the Display cycle animation
scrawl.makeRender({
    name: "demo-animation",
    target: canvas,
    afterShow: report,
});const dom = scrawl.initializeDomInputs([
    ['input', 'red', '1.45'],
    ['input', 'green', '1.1'],
    ['input', 'blue', '0'],
    ['input', 'alpha', '1'],
    ['input', 'opacity', '1'],
]);Setup form observer functionality
scrawl.makeUpdater({
    event: ['input', 'change'],
    origin: '.controlItem',
    target: myFilter,
    useNativeListener: true,
    preventDefault: true,
    updates: {
        red: ['red', 'float'],
        green: ['green', 'float'],
        blue: ['blue', 'float'],
        alpha: ['alpha', 'float'],
        opacity: ['opacity', 'float'],
    },
});addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy);console.log(scrawl.library);