Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /html/canvas/element/manual/filters/tentative/canvas-filter-object-turbulence.html - WPT Dashboard Interop Dashboard
<head>
<link rel="match" href="canvas-filter-object-blur-expected.html">
</head>
<body>
</body>
<script>
const testCases = [
{baseFrequency: 0.03125},
{baseFrequency: [0.03125, 0.125]},
{baseFrequency: 0.0625},
{baseFrequency: 0.03125, seed: 100},
{baseFrequency: 0.03125, numOctaves: 2},
{},
{baseFrequency: 0.03125, type: "fractalNoise"},
{baseFrequency: 0.03125, stitchTiles: "stitch"},
]
for (tc of testCases) {
const canvas = document.createElement("canvas");
document.body.appendChild(canvas);
const ctx = canvas.getContext("2d");
const filterOptions = {...{name: "turbulence"}, ...tc};
ctx.filter = new CanvasFilter(filterOptions);
ctx.fillRect(0, 0, 1, 1);
}
</script>