Debian Codegraph @

samples/tests/spec/paints/radialGradient3.svg

raw
1 <?xml version="1.0" standalone="no"?>
2 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
3 "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
4
5 <!--
6
7 Licensed to the Apache Software Foundation (ASF) under one or more
8 contributor license agreements. See the NOTICE file distributed with
9 this work for additional information regarding copyright ownership.
10 The ASF licenses this file to You under the Apache License, Version 2.0
11 (the "License"); you may not use this file except in compliance with
12 the License. You may obtain a copy of the License at
13
14 http://www.apache.org/licenses/LICENSE-2.0
15
16 Unless required by applicable law or agreed to in writing, software
17 distributed under the License is distributed on an "AS IS" BASIS,
18 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 See the License for the specific language governing permissions and
20 limitations under the License.
21
22 -->
23 <!-- ====================================================================== -->
24 <!-- @author [email protected] -->
25 <!-- @author [email protected] -->
26 <!-- @version $Id$ -->
27 <!-- ====================================================================== -->
28 <?xml-stylesheet type="text/css" href="../../resources/style/test.css" ?>
29
30 <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="body" width="450" height="500" viewBox="0 0 450 500">
31
32 <title>&lt;radialGradient&gt; Test 3 (Complex lookup)</title>
33 <text class="title" x="50%" y="40">
34 &lt;radialGradient&gt; Test 3 (Complex lookup)
35 </text>
36
37 <style type="text/css"><![CDATA[
38 .speed { clip-path:url(#speedClip); color-rendering:optimizeSpeed; }
39 .default { clip-path:url(#defaultClip); color-rendering:auto; }
40 .quality { clip-path:url(#qualityClip);
41 color-rendering:optimizeQuality; }
42 .saqLabel { font-family: Verdana, Helvetica;
43 font-size: 5;
44 text-anchor: middle;
45 fill:black; stroke:none;}
46 .line { fill:none; stroke:black; stroke-width:0.25; }
47 ]]></style>
48
49 <defs>
50 <!-- Shape filled by radial gradients -->
51 <g id="testShape">
52 <rect x="-25" y="-20" width="50" height="40"
53 class="quality" />
54 <rect x="-25" y="-20" width="50" height="40"
55 class="default" />
56 <rect x="-25" y="-20" width="50" height="40"
57 class="speed" />
58
59 <text x="-16.5" y="24" class="saqLabel">Q</text>
60 <line x1="-8" x2="-8" y1="20" y2="25" class="line" />
61 <text x="0" y="24" class="saqLabel">A</text>
62 <line x1="8" x2="8" y1="20" y2="25" class="line" />
63 <text x="16.5" y="24" class="saqLabel">S</text>
64 </g>
65
66 <!-- Clip paths for the various color-rendering settings... -->
67 <clipPath id="qualityClip">
68 <rect x="-25" y="-20" width="17" height="40"/>
69 </clipPath>
70
71 <clipPath id="defaultClip">
72 <rect x="-8" y="-20" width="16" height="40"/>
73 </clipPath>
74
75 <clipPath id="speedClip">
76 <rect x="8" y="-20" width="17" height="40"/>
77 </clipPath>
78
79
80 <!-- ========================================== -->
81 <!-- Two gradients, one with no values defined -->
82 <!-- and one with the default values specified -->
83 <!-- They should create the same pattern -->
84 <!-- ========================================== -->
85 <radialGradient id="rgDefaults">
86 <stop offset=".0" stop-color="gold" />
87 <stop offset=".49" stop-color="crimson" />
88 <stop offset=".51" stop-color="gold" />
89 <stop offset="1." stop-color="crimson" />
90 </radialGradient>
91
92 <radialGradient id="rgSpecifiedDefaults"
93 gradientUnits="objectBoundingBox"
94 cx="50%" cy="50%"
95 r="50%"
96 fx="50%" fy="50%"
97 spreadMethod="pad" xlink:href="#rgDefaults" />
98
99 <!-- ========================================== -->
100 <!-- gradientUnits. The following gradients -->
101 <!-- is defined so as to produce the same -->
102 <!-- result as with the default settings -->
103 <!-- For example, cx default is 50% in object -->
104 <!-- bounding box, which is .5*50 = 25 -->
105 <!-- r = sqrt(50*50 + 40*40) = 22.63846284534354156643452041746 -->
106 <!-- ========================================== -->
107 <radialGradient id="rgUserSpaceOnUse"
108 cx="0" cy="0" r="22.63846284534354156643452041746"
109 fx="0" fy="0" xlink:href="#rdDefaults" />
110
111 <radialGradient id="rgCxCyA" xlink:href="#rgDefaults"
112 cx="0%" cy="100%">
113 </radialGradient>
114
115 <radialGradient id="rgCxCyB" xlink:href="#rgDefaults"
116 cx="75%" cy="25%">
117 </radialGradient>
118
119 <radialGradient id="rgFxFyA" xlink:href="#rgCxCyA"
120 fx="0%" fy="100%">
121 </radialGradient>
122
123 <radialGradient id="rgFxFyB" xlink:href="#rgDefaults"
124 fx="60%" fy="40%">
125 </radialGradient>
126
127 <radialGradient id="rgFxFyC" xlink:href="#rgDefaults"
128 fx="0%" fy="50%">
129 </radialGradient>
130
131 <radialGradient id="rgFxFyD" xlink:href="#rgDefaults"
132 fx="0%" fy="0%">
133 </radialGradient>
134
135 <radialGradient id="rgSpreadA" xlink:href="#rgDefaults"
136 r=".125">
137 </radialGradient>
138
139 <radialGradient id="rgSpreadB" xlink:href="#rgDefaults"
140 r=".125" spreadMethod="reflect">
141 </radialGradient>
142
143 <radialGradient id="rgSpreadC" xlink:href="#rgDefaults"
144 r=".125" spreadMethod="repeat">
145 </radialGradient>
146
147 <radialGradient id="rgTxfA" xlink:href="#rgDefaults"
148 gradientTransform="translate(.5, .5)" />
149
150 <radialGradient id="rgTxfB" xlink:href="#rgDefaults"
151 cx="0%" cy="0%" gradientTransform="translate(.5, .5)" />
152
153 <radialGradient id="rgTxfC" xlink:href="#rgDefaults"
154 cx="0%" cy="0%" gradientTransform="translate(.5, .5) scale(1.5,.25)" />
155
156 <radialGradient id="rgTxfD" xlink:href="#rgFxFyD"
157 gradientTransform="scale(.5, .5)" />
158 </defs>
159
160 <g class="legend">
161
162 <g transform="translate(70, 0)">
163
164 <g transform="translate(0, 100)">
165 <use xlink:href="#testShape" fill="url(#rgDefaults)" />
166 <text y="-30">Defaults</text>
167 </g>
168
169 <g transform="translate(0, 170)">
170 <use xlink:href="#testShape" fill="url(#rgSpecifiedDefaults)" />
171 <text y="-30">Forced Defaults</text>
172 </g>
173
174 <g transform="translate(0, 240)">
175 <use xlink:href="#testShape" fill="url(#rgSpecifiedDefaults)" />
176 <text y="-30">userSpaceOnUse</text>
177 </g>
178
179 <g transform="translate(0, 310)">
180 <use xlink:href="#testShape" fill="url(#rgCxCyA)" />
181 <text y="-30">(cx,cy) = (0%, 100%)</text>
182 </g>
183
184 <g transform="translate(0, 380)">
185 <use xlink:href="#testShape" fill="url(#rgCxCyB)" />
186 <text y="-30">(cx,cy) = (75%, 25%)</text>
187 </g>
188
189 </g>
190
191 <g transform="translate(200, 0)">
192
193 <g transform="translate(0, 100)">
194 <use xlink:href="#testShape" fill="url(#rgFxFyB)" />
195 <text y="-30">(fx,fy)=(60%,40%)</text>
196 </g>
197
198 <g transform="translate(0, 170)">
199 <use xlink:href="#testShape" fill="url(#rgFxFyC)" />
200 <text y="-30">(fx,fy)=(0%,50%)</text>
201 </g>
202
203 <g transform="translate(0, 240)">
204 <use xlink:href="#testShape" fill="url(#rgFxFyD)" />
205 <text y="-30">(fx,fy)=(0%,0%)</text>
206 </g>
207
208 <g transform="translate(0, 310)">
209 <use xlink:href="#testShape" fill="url(#rgSpreadA)" />
210 <text y="-30">r=.125, spread=default</text>
211 </g>
212
213 <g transform="translate(0, 380)">
214 <use xlink:href="#testShape" fill="url(#rgSpreadB)" />
215 <text y="-30">r=.125, spread=reflect</text>
216 </g>
217
218 <g transform="translate(0, 450)">
219 <use xlink:href="#testShape" fill="url(#rgSpreadC)" />
220 <text y="-30">r=.125, spread=repeat</text>
221 </g>
222
223 </g>
224
225
226 <g transform="translate(330, 0)">
227
228 <g transform="translate(0, 100)">
229 <use xlink:href="#testShape" fill="url(#rgTxfA)" />
230 <text y="-30">translate(.5,.5)</text>
231 </g>
232
233 <g transform="translate(0, 170)">
234 <use xlink:href="#testShape" fill="url(#rgTxfB)" />
235 <text y="-30">(cx,cy)=(0%,0%) translate(.5,.5)</text>
236 </g>
237
238 <g transform="translate(0, 240)">
239 <use xlink:href="#testShape" fill="url(#rgTxfC)" />
240 <text y="-30">scale(1.5,.25)</text>
241 </g>
242
243 <g transform="translate(0, 310)">
244 <use xlink:href="#testShape" fill="url(#rgTxfD)" />
245 <text y="-30">(fx,fy)=(0,0) scale(.5, .5)</text>
246 </g>
247
248 <g transform="translate(0, 380)">
249 <use xlink:href="#testShape" fill="url(#rgFxFyA)" />
250 <text y="-30">(fx,fy)=(cx, cy)=(0%, 100%)</text>
251 </g>
252
253
254 </g>
255
256 </g>
257 </svg>