Debian Codegraph @

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