OLD | NEW |
(Empty) | |
| 1 <!doctype html> |
| 2 <!-- |
| 3 This test determines whether the feTurbulence algorithm allows zero length vecto
rs on some particular seeds. These zero length |
| 4 vectors result in large rectangular holes in the generated image. |
| 5 Seed 514 is the first seed value that demonstrates the error. |
| 6 Others are: 1977,2337,4777,8032,9615,14783,14862,14921,18607,19537,19852,19955,2
2456,23056,26678,27351,29383,29560,29929, ... |
| 7 The feTurbulence algorithm in the specification uses rejection sampling to avoid
generating zero length vectors and so in a |
| 8 correct implementation we should not see any large holes in the image. |
| 9 --> |
| 10 <html> |
| 11 <body> |
| 12 <svg viewbox="0 0 512 256"> |
| 13 <desc>Test passes if there are no red squares.</desc> |
| 14 <defs> |
| 15 <filter id="turb1" filterUnits="objectBoundingBox" x="0" y="0" width="10
0%" height="100%"> |
| 16 <feTurbulence x="0" y="0" width="100%" height="100%" baseFrequency="
0.02 0.1" numOctaves="5" seed="514" result="a" /> |
| 17 <feComponentTransfer in="a"> |
| 18 <!-- set colour to black everywhere and set opacity to full if a
lpha > 0 --> |
| 19 <feFuncR type="linear" slope="-10000" intercept="0"/><feFuncG ty
pe="linear" slope="-10000" intercept="0"/><feFuncB type="linear" slope="-10000"
intercept="0"/> |
| 20 <feFuncA type="linear" slope="10000" intercept="0"/> |
| 21 </feComponentTransfer> |
| 22 </filter> |
| 23 <filter id="turb2" filterUnits="objectBoundingBox" x="0" y="0" width="10
0%" height="100%"> |
| 24 <feTurbulence x="0" y="0" width="100%" height="100%" baseFrequency="
0.02 0.1" numOctaves="5" seed="14783" result="a" /> |
| 25 <feComponentTransfer in="a"> |
| 26 <feFuncR type="linear" slope="-10000" intercept="0"/><feFuncG ty
pe="linear" slope="-10000" intercept="0"/><feFuncB type="linear" slope="-10000"
intercept="0"/> |
| 27 <feFuncA type="linear" slope="10000" intercept="0"/> |
| 28 </feComponentTransfer> |
| 29 </filter> |
| 30 <filter id="turb3" filterUnits="objectBoundingBox" x="0" y="0" width="10
0%" height="100%"> |
| 31 <feTurbulence x="0" y="0" width="100%" height="100%" baseFrequency="
0.02 0.1" numOctaves="5" seed="23056" result="a" /> |
| 32 <feComponentTransfer in="a"> |
| 33 <feFuncR type="linear" slope="-10000" intercept="0"/><feFuncG ty
pe="linear" slope="-10000" intercept="0"/><feFuncB type="linear" slope="-10000"
intercept="0"/> |
| 34 <feFuncA type="linear" slope="10000" intercept="0"/> |
| 35 </feComponentTransfer> |
| 36 </filter> |
| 37 <filter id="turb4" filterUnits="objectBoundingBox" x="0" y="0" width="10
0%" height="100%"> |
| 38 <feTurbulence x="0" y="0" width="100%" height="100%" baseFrequency="
0.02 0.1" numOctaves="5" seed="9615" result="a" /> |
| 39 <feComponentTransfer in="a"> |
| 40 <feFuncR type="linear" slope="-10000" intercept="0"/><feFuncG ty
pe="linear" slope="-10000" intercept="0"/><feFuncB type="linear" slope="-10000"
intercept="0"/> |
| 41 <feFuncA type="linear" slope="10000" intercept="0"/> |
| 42 </feComponentTransfer> |
| 43 </filter> |
| 44 </defs> |
| 45 <rect x="0" y="0" width="256" height="128" fill="red" /> |
| 46 <rect x="0" y="0" width="64" height="128" fill="black" filter="url(#turb1)"/
> |
| 47 <rect x="64" y="0" width="64" height="128" fill="blue" filter="url(#turb2)"/
> |
| 48 <rect x="128" y="0" width="64" height="128" fill="black" filter="url(#turb3)
"/> |
| 49 <rect x="192" y="0" width="64" height="128" fill="blue" filter="url(#turb4)"
/> |
| 50 </svg> |
| 51 </body> |
| 52 </html> |
OLD | NEW |