Debian Codegraph @

rsvg/tests/fixtures/reftests/svg1.1/filters-conv-03-f.svg

raw symbols SCIP
1 <svg id="svg-root" width="100%" height="100%"
2 viewBox="0 0 480 360" xmlns="http://www.w3.org/2000/svg"
3 xmlns:xlink="http://www.w3.org/1999/xlink">
4 <!--======================================================================-->
5 <!--= Copyright 2008 World Wide Web Consortium, (Massachusetts =-->
6 <!--= Institute of Technology, European Research Consortium for =-->
7 <!--= Informatics and Mathematics (ERCIM), Keio University). =-->
8 <!--= All Rights Reserved. =-->
9 <!--= See http://www.w3.org/Consortium/Legal/. =-->
10 <!--======================================================================-->
11 <d:SVGTestCase xmlns:d="http://www.w3.org/2000/02/svg/testsuite/description/"
12 template-version="1.3" reviewer="CM" owner="ED" status="accepted"
13 version="$Revision: 1.8 $" testname="$RCSfile: filters-conv-03-f.svg,v $">
14 <d:testDescription xmlns="http://www.w3.org/1999/xhtml" href="http://www.w3.org/TR/SVG11/#feConvolveMatrixElementOrderAttribute">
15 <p>
16 Tests the 'in1' DOM attribute on 'feConvolveMatrix'.
17 </p>
18 <p>
19 Load the testcase, you should see three nearly identical images that say "FAIL".
20 After 3 seconds all three images should be replaced by the same image of a bird.
21 The two images to the right have filters applied, while the one on the left is always unfiltered.
22 </p>
23 </d:testDescription>
24 <d:operatorScript xmlns="http://www.w3.org/1999/xhtml">
25 <p>
26 Run the test. No interaction required.
27 </p>
28 </d:operatorScript>
29 <d:passCriteria xmlns="http://www.w3.org/1999/xhtml">
30 <p>
31 The test has passed if:
32 </p>
33 <ul>
34 <li>the two images inside the blue rects look exactly the same</li>
35 <li>the same base image is used in all three rects</li>
36 <li>the purple image that says "FAIL" is replaced after 3 seconds by an image of a bird</li>
37 </ul>
38 </d:passCriteria>
39 </d:SVGTestCase>
40 <title id="test-title">$RCSfile: filters-conv-03-f.svg,v $</title>
41 <defs>
42 <font-face
43 font-family="SVGFreeSansASCII"
44 unicode-range="U+0-7F">
45 <font-face-src>
46 <font-face-uri xlink:href="../resources/SVGFreeSans.svg#ascii"/>
47 </font-face-src>
48 </font-face>
49 </defs>
50 <g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18">
51 <!-- librsvg note: we don't support animation, but let's not miss out on a test image.
52 Animation replaced with just final values. -->
53 <defs>
54 <filter id="sharpenAnim" x="0" y="0" width="100%" height="100%">
55 <feImage xlink:href="images/stefan_252_tRNS_opti.png" result="passimg"/>
56 <feConvolveMatrix in="passimg" order="3" kernelMatrix="0 -1 0
57 -1 5 -1
58 0 -1 0" preserveAlpha="true">
59 <set attributeName="in" to="passimg" begin="3s" fill="freeze" onbegin="runtest()"/>
60 </feConvolveMatrix>
61 </filter>
62 <filter id="sharpenScript" x="0" y="0" width="100%" height="100%">
63 <feImage xlink:href="images/stefan_252_tRNS_opti.png" result="passimg"/>
64 <feConvolveMatrix id="prim" in="passimg" order="3" kernelMatrix="0 -1 0
65 -1 5 -1
66 0 -1 0" preserveAlpha="true"/>
67 </filter>
68
69 <text id="pass" x="240" y="150" text-anchor="middle" font-size="30px">PASS</text>
70 </defs>
71
72 <script type="application/ecmascript">
73 function runtest()
74 {
75 var img = document.getElementById("img");
76 img.href.baseVal = "images/stefan_252_tRNS_opti.png";
77 var prim = document.getElementById("prim");
78 prim.in1.baseVal = "passimg";
79 }
80 </script>
81
82 <text x="50%" y="3em" style="font-size:18px; text-anchor:middle">feConvolveMatrix 'in1' DOM</text>
83 <image id="img" xlink:href="images/stefan_252_tRNS_opti.png" x="80" y="100" width="100" height="100"/>
84 <image xlink:href="images/purplesquidj.png" x="190" y="100" width="100" height="100" filter="url(#sharpenAnim)"/>
85 <image xlink:href="images/purplesquidj.png" x="300" y="100" width="100" height="100" filter="url(#sharpenScript)"/>
86 <rect x="80" y="100" width="100" height="100" stroke="black" fill="none"/>
87 <rect x="190" y="100" width="100" height="100" stroke="blue" fill="none"/>
88 <rect x="300" y="100" width="100" height="100" stroke="blue" fill="none"/>
89 <text x="130" y="220" style="font-size:9px; text-anchor:middle">Original image</text>
90 <text x="240" y="220" style="font-size:9px; text-anchor:middle">Animated filter</text>
91 <text x="350" y="220" style="font-size:9px; text-anchor:middle">Scripted filter</text>
92 </g>
93 <g font-family="SVGFreeSansASCII,sans-serif" font-size="32">
94 <text id="revision" x="10" y="340" stroke="none"
95 fill="black">$Revision: 1.8 $</text>
96 </g>
97 <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000"/>
98 <!-- comment out this watermark once the test is approved --><!--
99 <g id="draft-watermark">
100 <rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/>
101 <text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240"
102 text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text>
103 </g>-->
104 </svg>