Debian Codegraph @

samples/tests/spec/paints/radialGradient2.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
29 <?xml-stylesheet type="text/css" href="../../resources/style/test.css" ?>
30
31 <svg id="body" width="450" height="500" viewBox="0 0 450 500"
32 xmlns="http://www.w3.org/2000/svg"
33 xmlns:xlink="http://www.w3.org/1999/xlink" >
34
35 <title>&lt;radialGradient&gt; Test 2 (Discontinuity)</title>
36 <text class="title" x="50%" y="40">
37 &lt;radialGradient&gt; Test 2 (Discontinuity)
38 </text>
39
40 <style type="text/css"><![CDATA[
41 .speed { clip-path:url(#speedClip); color-rendering:optimizeSpeed; }
42 .default { clip-path:url(#defaultClip); }
43 .quality { clip-path:url(#qualityClip);
44 color-rendering:optimizeQuality; }
45
46 .saqLabel { font-family: Verdana, Helvetica;
47 font-size: 5;
48 text-anchor: middle;
49 fill:black; stroke:none;}
50 .line { fill:none; stroke:black; stroke-width:0.25; }
51 ]]></style>
52
53
54 <defs>
55 <!-- Shape filled by radial gradients -->
56 <g id="testShape">
57 <rect x="-25" y="-20" width="50" height="40"
58 class="quality" />
59 <rect x="-25" y="-20" width="50" height="40"
60 class="default" />
61 <rect x="-25" y="-20" width="50" height="40"
62 class="speed" />
63
64 <text x="-16.5" y="24" class="saqLabel">Q</text>
65 <line x1="-8" x2="-8" y1="20" y2="25" class="line" />
66 <text x="0" y="24" class="saqLabel">A</text>
67 <line x1="8" x2="8" y1="20" y2="25" class="line" />
68 <text x="16.5" y="24" class="saqLabel">S</text>
69 </g>
70
71 <!-- Clip paths for the various color-rendering settings... -->
72 <clipPath id="qualityClip">
73 <rect x="-25" y="-20" width="17" height="40"/>
74 </clipPath>
75
76 <clipPath id="defaultClip">
77 <rect x="-8" y="-20" width="16" height="40"/>
78 </clipPath>
79
80 <clipPath id="speedClip">
81 <rect x="8" y="-20" width="17" height="40"/>
82 </clipPath>
83
84 <!-- ========================================== -->
85 <!-- Two gradients, one with no values defined -->
86 <!-- and one with the default values specified -->
87 <!-- They should create the same pattern -->
88 <!-- ========================================== -->
89 <radialGradient id="rgDefaults">
90 <stop offset=".0" stop-color="gold" />
91 <stop offset=".5" stop-color="crimson" />
92 <stop offset=".5" stop-color="gold" />
93 <stop offset="1." stop-color="crimson" />
94 </radialGradient>
95
96 <radialGradient id="rgSpecifiedDefaults"
97 gradientUnits="objectBoundingBox"
98 cx="50%" cy="50%"
99 r="50%"
100 fx="50%" fy="50%"
101 spreadMethod="pad" xlink:href="#rgDefaults" />
102
103 <!-- ========================================== -->
104 <!-- gradientUnits. The following gradients -->
105 <!-- is defined so as to produce the same -->
106 <!-- result as with the default settings -->
107 <!-- For example, cx default is 50% in object -->
108 <!-- bounding box, which is .5*50 = 25 -->
109 <!-- r = sqrt(50*50 + 40*40) = 22.63846284534354156643452041746 -->
110 <!-- ========================================== -->
111 <radialGradient id="rgUserSpaceOnUse"
112 cx="0" cy="0" r="22.63846284534354156643452041746"
113 fx="0" fy="0" xlink:href="#rdDefaults" />
114
115 <radialGradient id="rgCxCyA" xlink:href="#rgDefaults"
116 cx="0%" cy="100%">
117 </radialGradient>
118
119 <radialGradient id="rgCxCyB" xlink:href="#rgDefaults"
120 cx="75%" cy="25%">
121 </radialGradient>
122
123 <radialGradient id="rgFxFyA" xlink:href="#rgCxCyA"
124 fx="0%" fy="100%">
125 </radialGradient>
126
127 <radialGradient id="rgFxFyB" xlink:href="#rgDefaults"
128 fx="60%" fy="40%">
129 </radialGradient>
130
131 <radialGradient id="rgFxFyC" xlink:href="#rgDefaults"
132 fx="0%" fy="50%">
133 </radialGradient>
134
135 <radialGradient id="rgFxFyD" xlink:href="#rgDefaults"
136 fx="0%" fy="0%">
137 </radialGradient>
138
139 <radialGradient id="rgSpreadA" xlink:href="#rgDefaults"
140 r=".125">
141 </radialGradient>
142
143 <radialGradient id="rgSpreadB" xlink:href="#rgDefaults"
144 r=".125" spreadMethod="reflect">
145 </radialGradient>
146
147 <radialGradient id="rgSpreadC" xlink:href="#rgDefaults"
148 r=".125" spreadMethod="repeat">
149 </radialGradient>
150
151 <radialGradient id="rgTxfA" xlink:href="#rgDefaults"
152 gradientTransform="translate(.5, .5)" />
153
154 <radialGradient id="rgTxfB" xlink:href="#rgDefaults"
155 cx="0%" cy="0%" gradientTransform="translate(.5, .5)" />
156
157 <radialGradient id="rgTxfC" xlink:href="#rgDefaults"
158 cx="0%" cy="0%" gradientTransform="translate(.5, .5) scale(1.5, .25)" />
159
160 <radialGradient id="rgTxfD" xlink:href="#rgFxFyD"
161 gradientTransform="scale(.5, .5)" />
162
163 </defs>
164
165 <g class="legend">
166
167 <g transform="translate(70, 0)">
168
169 <g transform="translate(0, 100)">
170 <use xlink:href="#testShape" fill="url(#rgDefaults)" />
171 <text y="-30">Defaults</text>
172 </g>
173
174 <g transform="translate(0, 170)">
175 <use xlink:href="#testShape" fill="url(#rgSpecifiedDefaults)" />
176 <text y="-30">Forced Defaults</text>
177 </g>
178
179 <g transform="translate(0, 240)">
180 <use xlink:href="#testShape" fill="url(#rgSpecifiedDefaults)" />
181 <text y="-30">userSpaceOnUse</text>
182 </g>
183
184 <g transform="translate(0, 310)">
185 <use xlink:href="#testShape" fill="url(#rgCxCyA)" />
186 <text y="-30">(cx,cy) = (0%, 100%)</text>
187 </g>
188
189 <g transform="translate(0, 380)">
190 <use xlink:href="#testShape" fill="url(#rgCxCyB)" />
191 <text y="-30">(cx,cy) = (75%, 25%)</text>
192 </g>
193
194 </g>
195
196 <g transform="translate(200, 0)">
197
198 <g transform="translate(0, 100)">
199 <use xlink:href="#testShape" fill="url(#rgFxFyB)" />
200 <text y="-30">(fx,fy)=(60%,40%)</text>
201 </g>
202
203 <g transform="translate(0, 170)">
204 <use xlink:href="#testShape" fill="url(#rgFxFyC)" />
205 <text y="-30">(fx,fy)=(0%,50%)</text>
206 </g>
207
208 <g transform="translate(0, 240)">
209 <use xlink:href="#testShape" fill="url(#rgFxFyD)" />
210 <text y="-30">(fx,fy)=(0%,0%)</text>
211 </g>
212
213 <g transform="translate(0, 310)">
214 <use xlink:href="#testShape" fill="url(#rgSpreadA)" />
215 <text y="-30">r=.125, spread=default</text>
216 </g>
217
218 <g transform="translate(0, 380)">
219 <use xlink:href="#testShape" fill="url(#rgSpreadB)" />
220 <text y="-30">r=.125, spread=reflect</text>
221 </g>
222
223 <g transform="translate(0, 450)">
224 <use xlink:href="#testShape" fill="url(#rgSpreadC)" />
225 <text y="-30">r=.125, spread=repeat</text>
226 </g>
227
228 </g>
229
230
231 <g transform="translate(330, 0)">
232
233 <g transform="translate(0, 100)">
234 <use xlink:href="#testShape" fill="url(#rgTxfA)" />
235 <text y="-30">translate(.5,.5)</text>
236 </g>
237
238 <g transform="translate(0, 170)">
239 <use xlink:href="#testShape" fill="url(#rgTxfB)" />
240 <text y="-30">(cx,cy)=(0%,0%) translate(.5,.5)</text>
241 </g>
242
243 <g transform="translate(0, 240)">
244 <use xlink:href="#testShape" fill="url(#rgTxfC)" />
245 <text y="-30">scale(1.5,.25)</text>
246 </g>
247
248 <g transform="translate(0, 310)">
249 <use xlink:href="#testShape" fill="url(#rgTxfD)" />
250 <text y="-30">(fx,fy)=(0,0) scale(.5, .5)</text>
251 </g>
252
253 <g transform="translate(0, 380)">
254 <use xlink:href="#testShape" fill="url(#rgFxFyA)" />
255 <text y="-30">(fx,fy)=(cx, cy)=(0%, 100%)</text>
256 </g>
257
258
259 </g>
260
261 </g>
262 </svg>