Debian Codegraph @

samples/tests/spec/filters/filterRegions.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 <!-- This tests validates the filter region processing for the top level -->
25 <!-- filter nodes and filter primitives. For each test, a filter is invoked -->
26 <!-- to render in a region specified by the filter region. In addition, a -->
27 <!-- control rectangle, bounding the expected filter region is rendered on top -->
28 <!-- of the filter. -->
29 <!-- -->
30 <!-- @author [email protected] -->
31 <!-- @version $Id$ -->
32 <!-- ========================================================================= -->
33
34 <?xml-stylesheet type="text/css" href="../../resources/style/test.css" ?>
35
36 <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">
37 <title>FilterRegions test</title>
38
39 <text x="225" y="40" class="title">
40 Filter Regions
41 </text>
42
43 <style type="text/css">
44 <![CDATA[
45 .filterRegionControl {
46 fill: none;
47 stroke: black;
48 stroke-opacity: .5;
49 stroke-width: 1;
50
51 }
52
53 .filterRegionControlLabel {
54 fill: black;
55 font-family: Verdana;
56 font-size: 10;
57 text-anchor: middle;
58 }
59 ]]>
60 </style>
61
62 <defs>
63 <!-- ======================================================== -->
64 <!-- ======================================================== -->
65 <!-- userSpaceOnUser for filter chain and for filterPrimitive -->
66 <!-- ======================================================== -->
67 <!-- ======================================================== -->
68
69 <!-- ======================================================== -->
70 <!-- filterRegion_0 -->
71 <!-- chain region: [objectBoundingBox], undefined -->
72 <!-- flood region: [userSpaceOnUse], undefined -->
73 <!-- -->
74 <!-- Expected fill region: (0, 0, 450, 450) in user space -->
75 <!-- ======================================================== -->
76 <filter id="filterRegion_0" >
77 <feFlood style="flood-color:red;" />
78 </filter>
79
80 <!-- ======================================================== -->
81 <!-- filterRegion_1 -->
82 <!-- chain region: userSpaceOnUse, (20, 30, 50, 40) -->
83 <!-- flood region: userSpaceOnUse, undefined -->
84 <!-- -->
85 <!-- Expected fill region: (20, 30, 50, 40) in user space -->
86 <!-- ======================================================== -->
87 <filter id="filterRegion_1" filterUnits="userSpaceOnUse"
88 primitiveUnits="userSpaceOnUse"
89 x="20" y="30" width="50" height="40">
90 <feFlood style="flood-color:red" />
91 </filter>
92
93 <!-- ======================================================== -->
94 <!-- filterRegion_2 -->
95 <!-- chain region: userSpaceOnUse, (20, 30, 50, 40) -->
96 <!-- flood region: userSpaceOnUse, (25, 35, 50, 40) -->
97 <!-- -->
98 <!-- Expected fill region: (25, 35, 45, 35) in user space -->
99 <!-- ======================================================== -->
100 <filter id="filterRegion_2" filterUnits="userSpaceOnUse"
101 primitiveUnits="userSpaceOnUse"
102 x="20" y="30" width="50" height="40">
103 <feFlood style="flood-color:red" x="25" y="35" width="50" height="40"/>
104 </filter>
105
106 <!-- ======================================================== -->
107 <!-- filterRegion_3 -->
108 <!-- chain region: userSpaceOnUse, (20, 30, 50, 40) -->
109 <!-- flood region: userSpaceOnUse, (XX, XX, XX, 20) -->
110 <!-- -->
111 <!-- Expected fill region: (20, 30, 50, 20) in user space -->
112 <!-- ======================================================== -->
113 <filter id="filterRegion_3" filterUnits="userSpaceOnUse"
114 primitiveUnits="userSpaceOnUse"
115 x="20" y="30" width="50" height="40">
116 <feFlood style="flood-color:red" height="20"/>
117 </filter>
118
119 <!-- ======================================================== -->
120 <!-- filterRegion_4 -->
121 <!-- chain region: userSpaceOnUse, (20, 30, 50, 40) -->
122 <!-- flood region: userSpaceOnUse, (XX, XX, 25, XX) -->
123 <!-- -->
124 <!-- Expected fill region: (20, 30, 25, 40) in user space -->
125 <!-- ======================================================== -->
126 <filter id="filterRegion_4" filterUnits="userSpaceOnUse"
127 primitiveUnits="userSpaceOnUse"
128 x="20" y="30" width="50" height="40">
129 <feFlood style="flood-color:red" width="25"/>
130 </filter>
131
132 <!-- ======================================================== -->
133 <!-- filterRegion_5 -->
134 <!-- chain region: userSpaceOnUse, (20, 30, 50, 40) -->
135 <!-- flood region: userSpaceOnUse, (XX, 10, XX, XX) -->
136 <!-- -->
137 <!-- Expected fill region: (20, 30, 50, 20) in user space -->
138 <!-- ======================================================== -->
139 <filter id="filterRegion_5" filterUnits="userSpaceOnUse"
140 primitiveUnits="userSpaceOnUse"
141 x="20" y="30" width="50" height="40">
142 <feFlood style="flood-color:red" y="10"/>
143 </filter>
144
145 <!-- ======================================================== -->
146 <!-- filterRegion_6 -->
147 <!-- chain region: userSpaceOnUse, (20, 30, 50, 40) -->
148 <!-- flood region: userSpaceOnUse, (10, XX, XX, XX) -->
149 <!-- -->
150 <!-- Expected fill region: (20, 30, 40, 40) in user space -->
151 <!-- ======================================================== -->
152 <filter id="filterRegion_6" filterUnits="userSpaceOnUse"
153 primitiveUnits="userSpaceOnUse"
154 x="20" y="30" width="50" height="40">
155 <feFlood style="flood-color:red" x="10"/>
156 </filter>
157
158
159 <!-- ======================================================== -->
160 <!-- ======================================================== -->
161 <!-- userSpaceOnUse for filter chain and object bounding box -->
162 <!-- for filter primitive -->
163 <!-- ======================================================== -->
164 <!-- ======================================================== -->
165
166 <!-- ======================================================== -->
167 <!-- filterRegion_2_0 -->
168 <!-- chain region: [objectBoundingBox], undefined -->
169 <!-- flood region: undefined -->
170 <!-- -->
171 <!-- Expected fill region: (-10%, -10%, 120%, 120%) in user -->
172 <!-- space -->
173 <!-- ======================================================== -->
174 <filter id="filterRegion_2_0" primitiveUnits="objectBoundingBox">
175 <feFlood style="flood-color:red;" />
176 </filter>
177
178 <!-- ======================================================== -->
179 <!-- filterRegion_2_1 -->
180 <!-- chain region: userSpaceOnUse, undefined -->
181 <!-- flood region: objectBoundingBox, (0, 0, 1, 1) -->
182 <!-- -->
183 <!-- Expected fill region: (0, 0, 1, 1) in object bbox space -->
184 <!-- ======================================================== -->
185 <filter id="filterRegion_2_1" filterUnits="userSpaceOnUse"
186 primitiveUnits="objectBoundingBox">
187 <feFlood style="flood-color:red;" x="0" y="0" width="1" height="1"/>
188 </filter>
189
190 <!-- ======================================================== -->
191 <!-- filterRegion_2_2 -->
192 <!-- chain region: userSpaceOnUse, undefined -->
193 <!-- flood region: objectBoundingBox, (0%, 0%, 100%, 100%) -->
194 <!-- -->
195 <!-- Expected fill region: (0, 0, 1, 1) in object bbox space -->
196 <!-- ======================================================== -->
197 <filter id="filterRegion_2_2" filterUnits="userSpaceOnUse"
198 primitiveUnits="objectBoundingBox">
199 <feFlood style="flood-color:red" x="0%" y="0%" width="100%" height="100%"/>
200 </filter>
201
202 <!-- ======================================================== -->
203 <!-- filterRegion_2_3 -->
204 <!-- chain region: userSpaceOnUse, undefined -->
205 <!-- flood region: objectBoundingBox, (.25, 50%, .5, 25%) -->
206 <!-- -->
207 <!-- Expected fill region: (.25, .5, .5, .25) in object bbox -->
208 <!-- space -->
209 <!-- ======================================================== -->
210 <filter id="filterRegion_2_3" filterUnits="userSpaceOnUse"
211 primitiveUnits="objectBoundingBox">
212 <feFlood style="flood-color:red" x=".25" y="50%" width=".5" height="25%"/>
213 </filter>
214
215 <!-- ======================================================== -->
216 <!-- filterRegion_2_4 -->
217 <!-- chain region: userSpaceOnUse, undefined -->
218 <!-- flood region: objectBoundingBox, (25%, .5, 50%, .25) -->
219 <!-- -->
220 <!-- Expected fill region: (.25, .5, .5, .25) in object bbox -->
221 <!-- space -->
222 <!-- ======================================================== -->
223 <filter id="filterRegion_2_4" filterUnits="userSpaceOnUse"
224 primitiveUnits="objectBoundingBox">
225 <feFlood style="flood-color:red" x="25%" y=".5" width="50%" height=".25"/>
226 </filter>
227
228 <!-- ======================================================== -->
229 <!-- filterRegion_2_5 -->
230 <!-- chain region: userSpaceOnUse, (20, 30, 50, 40) -->
231 <!-- flood region: objectBoundingBox, (XX, .5, XX, .25) -->
232 <!-- -->
233 <!-- Expected fill region: (XX, .5, XX, .25) in object bbox -->
234 <!-- (20, XX, 50, XX) in user space -->
235 <!-- ======================================================== -->
236 <filter id="filterRegion_2_5" filterUnits="userSpaceOnUse"
237 primitiveUnits="objectBoundingBox"
238 x="20" y="30" width="50" height="40">
239 <feFlood style="flood-color:red" y=".5" height=".25"/>
240 </filter>
241
242 <!-- ======================================================== -->
243 <!-- ======================================================== -->
244 <!-- userSpaceOnUse for primitive, objectBoundingBox for -->
245 <!-- filter chain. -->
246 <!-- ======================================================== -->
247 <!-- ======================================================== -->
248
249 <!-- ======================================================== -->
250 <!-- filterRegion_3_0 -->
251 <!-- chain region: objectBoundingBox, region undefined -->
252 <!-- flood region: unspecified, region undefined -->
253 <!-- -->
254 <!-- Expected fill region: (0, 0, 1, 1) in object bbox space -->
255 <!-- ======================================================== -->
256 <filter id="filterRegion_3_0" filterUnits="objectBoundingBox" >
257 <feFlood style="flood-color:red;" />
258 </filter>
259
260 <!-- ======================================================== -->
261 <!-- filterRegion_3_1 -->
262 <!-- chain region: objectBoundingBox, region undefined -->
263 <!-- flood region: userSpaceOnUse (20, 30, 20, 25) -->
264 <!-- -->
265 <!-- Expected fill region: intersection of (0, 0, 1, 1) in -->
266 <!-- bbox space and (20, 30, 20, 25) in -->
267 <!-- user space. -->
268 <!-- ======================================================== -->
269 <filter id="filterRegion_3_1" filterUnits="objectBoundingBox"
270 primitiveUnits="userSpaceOnUse">
271 <feFlood style="flood-color:red" x="20" y="30" width="20" height="25"/>
272 </filter>
273
274 <!-- ======================================================== -->
275 <!-- filterRegion_3_2 -->
276 <!-- chain region: objectBoundingBox (-1, -1, 2, 2) -->
277 <!-- flood region: userSpaceOnUse undefined -->
278 <!-- -->
279 <!-- Expected fill region:(-1, -1, 2, 2) in -->
280 <!-- bbox space -->
281 <!-- ======================================================== -->
282 <filter id="filterRegion_3_2" filterUnits="objectBoundingBox"
283 primitiveUnits="userSpaceOnUse"
284 x="-1" y="-1" width="2" height="2">
285 <feFlood style="flood-color:red" />
286 </filter>
287
288 <!-- ======================================================== -->
289 <!-- filterRegion_3_3 -->
290 <!-- chain region: objectBoundingBox (-50%, -50%, 75%, 75% -->
291 <!-- flood region: userSpaceOnUse undefined -->
292 <!-- -->
293 <!-- Expected fill region:(-.5, -.5, .75, .75) in -->
294 <!-- bbox space -->
295 <!-- ======================================================== -->
296 <filter id="filterRegion_3_3" filterUnits="objectBoundingBox"
297 primitiveUnits="userSpaceOnUse"
298 x="-50%" y="-50%" width="75%" height="75%">
299 <feFlood style="flood-color:red" />
300 </filter>
301
302 </defs>
303
304 <g transform="translate(30, 50)">
305
306 <!-- ============================ -->
307 <!-- filterRegion_0 -->
308 <!-- ============================ -->
309 <g transform="translate(240, 95)">
310 <rect x="0" y="0" width="100" height="50" style="filter:url(#filterRegion_0);" />
311 <rect class="filterRegionControl" x="-10" y="-5" width="120" height="60" />
312 <text x="45" y="-10" class="filterRegionControlLabel">filterRegion_0</text>
313 </g>
314
315 <!-- ============================ -->
316 <!-- filterRegion_1 -->
317 <!-- ============================ -->
318 <rect x="0" y="3000" width="20000000" height="25" style="filter:url(#filterRegion_1);" />
319 <rect class="filterRegionControl" x="20" y="30" width="50" height="40" />
320 <text x="45" y="25" class="filterRegionControlLabel">filterRegion_1</text>
321 <!-- ============================ -->
322 <!-- filterRegion_2 -->
323 <!-- ============================ -->
324 <g transform="translate(100, 0)">
325 <rect x="0" y="3000" width="20000000" height="25" style="filter:url(#filterRegion_2);" />
326 <rect class="filterRegionControl" x="25" y="35" width="45" height="35" />
327 <text x="45" y="25" class="filterRegionControlLabel">filterRegion_2</text>
328 </g>
329
330 <!-- ============================ -->
331 <!-- filterRegion_3 -->
332 <!-- ============================ -->
333 <g transform="translate(200, 0)">
334 <rect x="0" y="3000" width="20000000" height="25" style="filter:url(#filterRegion_3);" />
335 <rect class="filterRegionControl" x="20" y="30" width="50" height="20" />
336 <text x="45" y="25" class="filterRegionControlLabel">filterRegion_3</text>
337 </g>
338
339 <!-- ============================ -->
340 <!-- filterRegion_4 -->
341 <!-- ============================ -->
342 <g transform="translate(300, 0)">
343 <rect x="0" y="3000" width="20000000" height="25" style="filter:url(#filterRegion_4);" />
344 <rect class="filterRegionControl" x="20" y="30" width="25" height="40" />
345 <text x="45" y="25" class="filterRegionControlLabel">filterRegion_4</text>
346 </g>
347
348 <!-- ============================ -->
349 <!-- filterRegion_5 -->
350 <!-- ============================ -->
351 <g transform="translate(0, 75)">
352 <rect x="0" y="3000" width="20000000" height="25" style="filter:url(#filterRegion_5);" />
353 <rect class="filterRegionControl" x="20" y="30" width="50" height="20" />
354 <text x="45" y="25" class="filterRegionControlLabel">filterRegion_5</text>
355 </g>
356
357 <!-- ============================ -->
358 <!-- filterRegion_6 -->
359 <!-- ============================ -->
360 <g transform="translate(100, 75)" style="filter:url(#filterRegion_6);">
361 <rect x="0" y="3000" width="20000000" height="25"/>
362 </g>
363 <g transform="translate(100, 75)" >
364 <rect class="filterRegionControl" x="20" y="30" width="40" height="40" />
365 <text x="45" y="25" class="filterRegionControlLabel">filterRegion_6</text>
366 </g>
367
368 <!-- ============================ -->
369 <!-- filterRegion_2_0 -->
370 <!-- ============================ -->
371 <g transform="translate(120, 280)">
372 <rect x="0" y="0" width="50" height="25" style="filter:url(#filterRegion_2_0);" />
373 <rect class="filterRegionControl" x="-5" y="-2.5" width="60" height="30" />
374 <text x="25" y="-20" class="filterRegionControlLabel">filterRegion_2_0</text>
375 </g>
376
377 <!-- ============================ -->
378 <!-- filterRegion_2_1 -->
379 <!-- ============================ -->
380 <g transform="translate(0, 160)" style="filter:url(#filterRegion_2_1);">
381 <rect x="20" y="30" width="50" height="40" />
382 </g>
383 <g transform="translate(0, 160)">
384 <rect class="filterRegionControl" x="20" y="30" width="50" height="40" />
385 <text x="45" y="25" class="filterRegionControlLabel">filterRegion_2_1</text>
386 </g>
387
388 <!-- ============================ -->
389 <!-- filterRegion_2_2 -->
390 <!-- ============================ -->
391 <g transform="translate(100, 160)" >
392 <rect x="20" y="30" width="50" height="40" style="filter:url(#filterRegion_2_2);"/>
393 </g>
394 <g transform="translate(100, 160)">
395 <rect class="filterRegionControl" x="20" y="30" width="50" height="40" />
396 <text x="45" y="25" class="filterRegionControlLabel">filterRegion_2_2</text>
397 </g>
398
399 <!-- ============================ -->
400 <!-- filterRegion_2_3 -->
401 <!-- ============================ -->
402 <g transform="translate(200, 160)" style="filter:url(#filterRegion_2_3);">
403 <rect x="20" y="30" width="50" height="40" />
404 </g>
405 <g transform="translate(200, 160)">
406 <rect class="filterRegionControl" x="32.5" y="50" width="25" height="10" />
407 <text x="45" y="25" class="filterRegionControlLabel">filterRegion_2_3</text>
408 </g>
409
410 <!-- ============================ -->
411 <!-- filterRegion_2_4 -->
412 <!-- ============================ -->
413 <g transform="translate(300, 160)" style="filter:url(#filterRegion_2_4);">
414 <rect x="20" y="30" width="50" height="40" />
415 </g>
416 <g transform="translate(300, 160)">
417 <rect class="filterRegionControl" x="32.5" y="50" width="25" height="10" />
418 <text x="45" y="25" class="filterRegionControlLabel">filterRegion_2_4</text>
419 </g>
420
421 <!-- ============================ -->
422 <!-- filterRegion_2_5 -->
423 <!-- ============================ -->
424 <g transform="translate(0, 245)" style="filter:url(#filterRegion_2_5);">
425 <rect x="20" y="30" width="50" height="40" />
426 </g>
427 <g transform="translate(0, 245)">
428 <rect class="filterRegionControl" x="20" y="50" width="50" height="10" />
429 <text x="45" y="25" class="filterRegionControlLabel">filterRegion_2_5</text>
430 </g>
431
432 <!-- ============================ -->
433 <!-- filterRegion_3_1 -->
434 <!-- ============================ -->
435 <g transform="translate(0, 330)" style="filter:url(#filterRegion_3_1);">
436 <rect x="0" y="0" width="450" height="450" />
437 </g>
438 <g transform="translate(0, 330)">
439 <rect class="filterRegionControl" x="20" y="30" width="20" height="25" />
440 <text x="45" y="25" class="filterRegionControlLabel">filterRegion_3_1</text>
441 </g>
442
443 <!-- ============================ -->
444 <!-- filterRegion_3_0 -->
445 <!-- ============================ -->
446 <g transform="translate(320, 330)" style="filter:url(#filterRegion_3_0);">
447 <rect x="0" y="0" width="40" height="50" />
448 </g>
449 <g transform="translate(320, 330)">
450 <rect class="filterRegionControl" x="-4" y="-5" width="48" height="60" />
451 <text x="45" y="25" class="filterRegionControlLabel">filterRegion_3_0</text>
452 </g>
453
454 <!-- ============================ -->
455 <!-- filterRegion_3_2 -->
456 <!-- ============================ -->
457 <g transform="translate(100, 330)" style="filter:url(#filterRegion_3_2);">
458 <rect x="50" y="40" width="50" height="40" />
459 </g>
460 <g transform="translate(100, 330)">
461 <rect class="filterRegionControl" x="0" y="0" width="100" height="80" />
462 <text x="45" y="25" class="filterRegionControlLabel">filterRegion_3_2</text>
463 </g>
464
465 <!-- ============================ -->
466 <!-- filterRegion_3_3 -->
467 <!-- ============================ -->
468 <g transform="translate(200, 330)" style="filter:url(#filterRegion_3_3);">
469 <rect x="50" y="40" width="50" height="40" />
470 </g>
471 <g transform="translate(200, 330)">
472 <rect class="filterRegionControl" x="25" y="20" width="37.5" height="30" />
473 <text x="45" y="25" class="filterRegionControlLabel">filterRegion_3_3</text>
474 </g>
475 </g>
476
477 <!-- ============================================================= -->
478 <!-- Batik sample mark -->
479 <!-- ============================================================= -->
480 <use xlink:href="../../../batikLogo.svg#Batik_Tag_Box" />
481
482 </svg>