Commit d5c659a5 authored by Eric Domke's avatar Eric Domke
Browse files

Refactoring while working through W3C tests

- Adding W3C test cases and a test fixture
- Fixed support for CSS stylesheets (particularly when class names are
referenced)
- Refactoring unit calculations so that percentages and fractions
calculate more accurately
- SvgImage:
- Support PreserveAspectRatio attribute
- Support for referencing svg images
- Refactored text rendering to use the AttributeCollection inheritance
scheme
- Initial attempt at 'ex' unit support
- Added support for system color names
- Changed parsing of entities to support XML entities
- Supporting loading of a svg document directly from a XmlDocument with
requiring serializing the document as a string first.
- ...
parent 3aedd8e8
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<!--======================================================================-->
<!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =-->
<!--= Institute of Technology, Institut National de Recherche en =-->
<!--= Informatique et en Automatique, Keio University). All Rights =-->
<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
<!--======================================================================-->
<!--======================================================================-->
<!-- -->
<!-- filters-transfer-BE-04.svg -->
<!-- renamed for 1.1 suite to filters-comptran-01-f.svg -->
<!-- -->
<!-- Test which verifies the basic facilities of feComponentTransfer. -->
<!-- -->
<!-- Author : Jon Ferraiolo 03-Apr-2000 -->
<!-- Revised for 1.1 : Mike Bultrowicz, 4 February 2002 -->
<!-- -->
<!-- History: -->
<!-- 04-Apr-2000, JF: Serial#1 created. -->
<!-- 03-Aug-2000, LH=" update DOCTYPE for CR DTD, 20000802" ser# . -->
<!-- 16-Aug-2000, LH="rename" ser#2. -->
<!-- -->
<!--======================================================================-->
<!--======================================================================-->
<!--= Note. After October 2000, revision history is kept as CVS 'commit' =-->
<!--= log messages, and therefore is no longer in the preceding preamble.=-->
<!--======================================================================-->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" width="480" height="360">
<SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/">
<OperatorScript>
<Paragraph>
Test which verifies the basic facilities of
feComponentTransfer.
</Paragraph>
<Paragraph>
This test uses the following elements : a nested &lt;svg&gt;
with a viewBox attribute, &lt;linearGradient&gt;, &lt;filter&gt;,
&lt;feComponentTransfer&gt;
</Paragraph>
<Paragraph>
The test case shows four rectangles filled with a
gradient showing the effects of feComponentTransfer: an
identity function acting as a reference, use of the
feComponentTransfer table option, use of the
feComponentTransfer linear option, and use of the
feComponentTransfer gamma option.
</Paragraph>
<Paragraph>
The test is somewhat self-explanatory as the strings
document the type of feComponentTransfer operation that
is being used.
</Paragraph>
</OperatorScript>
</SVGTestCase>
<title id="test-title">filters-comptran-01-f</title>
<desc id="test-desc">Test which verifies the basic facilities of feComponentTransfer.</desc>
<!--======================================================================-->
<!--Content of Test Case follows... =====================-->
<!--======================================================================-->
<g id="test-body-content">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="35" y="50" width="400" height="200" viewBox="0 0 800 400">
<title>Example feComponentTransfer - Examples of feComponentTransfer operations</title>
<desc>Four rectangles filled with a gradient showing the effects of feComponentTransfer: an identity function acting as a reference, use of the feComponentTransfer table option, use of the feComponentTransfer linear option, and use of the feComponentTransfer gamma option.</desc>
<defs>
<linearGradient id="MyGradient" gradientUnits="userSpaceOnUse" x1="100" y1="0" x2="600" y2="0">
<stop offset="0" stop-color="#ff0000" />
<stop offset=".33" stop-color="#00ff00" />
<stop offset=".67" stop-color="#0000ff" />
<stop offset="1" stop-color="#000000" />
</linearGradient>
<filter id="Identity" filterUnits="objectBoundingBox" x="0%" y="0%" width="100%" height="100%">
<feComponentTransfer>
<feFuncR type="identity"/>
<feFuncG type="identity"/>
<feFuncB type="identity"/>
<feFuncA type="identity"/>
</feComponentTransfer>
</filter>
<filter id="Table" filterUnits="objectBoundingBox" x="0%" y="0%" width="100%" height="100%">
<feComponentTransfer>
<feFuncR type="table" tableValues="0 0 1 1"/>
<feFuncG type="table" tableValues="1 1 0 0"/>
<feFuncB type="table" tableValues="0 1 1 0"/>
</feComponentTransfer>
</filter>
<filter id="Linear" filterUnits="objectBoundingBox" x="0%" y="0%" width="100%" height="100%">
<feComponentTransfer>
<feFuncR type="linear" slope=".5" intercept=".25"/>
<feFuncG type="linear" slope=".5" intercept="0"/>
<feFuncB type="linear" slope=".5" intercept=".5"/>
</feComponentTransfer>
</filter>
<filter id="Gamma" filterUnits="objectBoundingBox" x="0%" y="0%" width="100%" height="100%">
<feComponentTransfer>
<feFuncR type="gamma" amplitude="2" exponent="5" offset="0"/>
<feFuncG type="gamma" amplitude="2" exponent="3" offset="0"/>
<feFuncB type="gamma" amplitude="2" exponent="1" offset="0"/>
</feComponentTransfer>
</filter>
</defs>
<rect fill="none" stroke="blue" x="1" y="1" width="798" height="398"/>
<g font-size="25" font-family="Verdana" >
<rect fill="none" stroke="blue" x="1" y="1" width="798" height="398"/>
<rect x="100" y="20" width="500" height="40" fill="url(#MyGradient)" filter="url(#Identity)" />
<text x="100" y="85">type="identity"</text>
<rect x="100" y="120" width="500" height="40" fill="url(#MyGradient)" filter="url(#Table)" />
<text x="100" y="185">type="table"</text>
<rect x="100" y="220" width="500" height="40" fill="url(#MyGradient)" filter="url(#Linear)" />
<text x="100" y="285">type="linear" slope=".5" intercepts:.25/0/.5</text>
<rect x="100" y="320" width="500" height="40" fill="url(#MyGradient)" filter="url(#Gamma)" />
<text x="100" y="385">type="gamma" amplitude="2" exponents:5/3/1</text>
</g>
</svg>
</g>
<!--======================================================================-->
<!--Legend and frame: Title, suite and SVG document serialization====-->
<!--======================================================================-->
<g id="test-legend" fill="black" font-family="Helvetica" font-size="10">
<rect x="10" y="300" width="275" height="50" fill="none" stroke="#000000"/>
<path fill="none" stroke="#000000" d="M10 315 h275 M205 315 v35 M10 336 h195 M205 332 h80"/>
<text x="25" y="311">Scalable Vector Graphics (SVG) v1.1 Conformance Suite</text>
<a xlink:href="copyright-documents-19990405.html">
<text x="12" y="347" fill="blue" >Copyright 2002 W3C. All Rights Reserved.</text>
</a>
<text font-size="12" x="35" y="330">filters-comptran-01</text>
<text font-size="10" x="210" y="327">$Revision: 1.1 $</text>
<text font-size="10" x="210" y="345">Release 1.0</text>
<rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
</g>
</svg>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<!--======================================================================-->
<!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =-->
<!--= Institute of Technology, Institut National de Recherche en =-->
<!--= Informatique et en Automatique, Keio University). All Rights =-->
<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
<!--======================================================================-->
<!--======================================================================-->
<!-- -->
<!-- filters-convolve-BE-06.svg -->
<!-- renamed for 1.1 suite to filters-conv-01-f.svg -->
<!-- -->
<!-- Test which verifies the basic facilities of feConvolveMatrix. -->
<!-- -->
<!-- Author : Vincent Hardy 24-Apr-2000 -->
<!-- Revised for 1.1 : Mike Bultrowicz, 4 February 2002 -->
<!-- -->
<!-- History: -->
<!-- 24-Apr-2000, VH: Serial#1 created. -->
<!-- 03-Aug-2000, LH=" update DOCTYPE for CR DTD, 20000802" ser# . -->
<!-- 16-Aug-2000, LH="rename" ser#2. -->
<!-- 17-Aug-2000, JF: Fix validation error. edgemode->edgeMode. -->
<!-- 21-Aug-2000, VH: Added filterUnits and filter effect region to each -->
<!-- filter definition. ser#3 -->
<!-- -->
<!--======================================================================-->
<!--======================================================================-->
<!--= Note. After October 2000, revision history is kept as CVS 'commit' =-->
<!--= log messages, and therefore is no longer in the preceding preamble.=-->
<!--======================================================================-->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" width="480" height="360">
<SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/">
<OperatorScript>
<Paragraph>
Test which verifies the basic facilities of
feConvolveMatrix.
</Paragraph>
<Paragraph>
This test defines six filters that exercise traditional
convolutions: uniform blur, vertical and horizontal
blurs, edge detection, embossing and sharpening. Note
that the edge detection filter produces a fully
transparent image because the alpha chanel is convolved
and produces 0 values.
</Paragraph>
</OperatorScript>
</SVGTestCase>
<title id="test-title">filters-conv-01-f</title>
<desc id="test-desc">Test which verifies the basic facilities of feConvolveMatrix.</desc>
<!--======================================================================-->
<!--Content of Test Case follows... =====================-->
<!--======================================================================-->
<g id="test-body-content">
<!--Generated by the Java 2D API Graphics2D SVG Generator, Sun Microsystems Inc.-->
<g transform="translate(20, 40)">
<defs id="defs1">
<filter id="convolve1" filterUnits="objectBoundingBox" x="0%" y="0%" width="100%" height="100%">
<feConvolveMatrix order="3 3" kernelMatrix="0.1111 0.1111 0.1111 0.1111 0.1111 0.1111 0.1111 0.1111 0.1111" edgeMode="none"/>
</filter>
<filter id="convolve2" filterUnits="objectBoundingBox" x="0%" y="0%" width="100%" height="100%">
<feConvolveMatrix order="3 3" kernelMatrix="-1 -1 -1 -1 8 -1 -1 -1 -1" edgeMode="none"/>
</filter>
<filter id="convolve3" filterUnits="objectBoundingBox" x="0%" y="0%" width="100%" height="100%">
<feConvolveMatrix order="3 3" kernelMatrix="-1 -1 -1 -1 9 -1 -1 -1 -1" edgeMode="none"/>
</filter>
<filter id="convolve4" filterUnits="objectBoundingBox" x="0%" y="0%" width="100%" height="100%">
<feConvolveMatrix order="3 3" kernelMatrix="-2 0 0 0 1 0 0 0 2" edgeMode="none"/>
</filter>
<filter id="convolve5" filterUnits="objectBoundingBox" x="0%" y="0%" width="100%" height="100%">
<feConvolveMatrix order="3 1" kernelMatrix="0.3333 0.3333 0.3333" edgeMode="none"/>
</filter>
<filter id="convolve6" filterUnits="objectBoundingBox" x="0%" y="0%" width="100%" height="100%">
<feConvolveMatrix order="1 3" kernelMatrix="0.3333 0.3333 0.3333" edgeMode="none"/>
</filter>
</defs>
<g shape-rendering="geometricPrecision" text-rendering="geometricPrecision" >
<text x="10" y="20" stroke="none" opacity="1" filter="none" >Blur (3x3)</text>
<g opacity="1" filter="none" >
<image width="50" height="63" xlink:href="filters-conv-01-f.includeimage.png" x="10" y="30" filter="url(#convolve1)" />
</g>
<text x="10" y="20" transform="translate(150,0)" stroke="none" opacity="1" filter="none" >Edge Detection (3x3)</text>
<g transform="translate(150,0)" opacity="1" filter="none" >
<image width="50" height="63" xlink:href="filters-conv-01-f.includeimage.png" x="10" y="30" filter="url(#convolve2)" />
</g>
<text x="10" y="20" transform="translate(300,0)" stroke="none" opacity="1" filter="none" >Sharpening (3x3)</text>
<g transform="translate(300,0)" opacity="1" filter="none" >
<image width="50" height="63" xlink:href="filters-conv-01-f.includeimage.png" x="10" y="30" filter="url(#convolve3)" />
</g>
<text x="10" y="20" transform="translate(0,93)" stroke="none" opacity="1" filter="none" >Embossing (3x3)</text>
<g transform="translate(0,93)" opacity="1" filter="none" >
<image width="50" height="63" xlink:href="filters-conv-01-f.includeimage.png" x="10" y="30" filter="url(#convolve4)" />
</g>
<text x="10" y="20" transform="translate(150,93)" stroke="none" opacity="1" filter="none" >Horizontal blur (3x1)</text>
<g transform="translate(150,93)" opacity="1" filter="none" >
<image width="50" height="63" xlink:href="filters-conv-01-f.includeimage.png" x="10" y="30" filter="url(#convolve5)" />
</g>
<text x="10" y="20" transform="translate(300,93)" stroke="none" opacity="1" filter="none" >Vertical blur (1x3)</text>
<g transform="translate(300,93)" opacity="1" filter="none" >
<image width="50" height="63" xlink:href="filters-conv-01-f.includeimage.png" x="10" y="30" filter="url(#convolve6)" />
</g>
</g>
</g>
</g>
<!--======================================================================-->
<!--Legend and frame: Title, suite and SVG document serialization====-->
<!--======================================================================-->
<g id="test-legend" fill="black" font-family="Helvetica" font-size="10">
<rect x="10" y="300" width="275" height="50" fill="none" stroke="#000000"/>
<path fill="none" stroke="#000000" d="M10 315 h275 M205 315 v35 M10 336 h195 M205 332 h80"/>
<text x="25" y="311">Scalable Vector Graphics (SVG) v1.1 Conformance Suite</text>
<a xlink:href="copyright-documents-19990405.html">
<text x="12" y="347" fill="blue" >Copyright 2002 W3C. All Rights Reserved.</text>
</a>
<text font-size="12" x="35" y="330">filters-conv-01</text>
<text font-size="10" x="210" y="327">$Revision: 1.1 $</text>
<text font-size="10" x="210" y="345">Release 1.0</text>
<rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
</g>
</svg>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<!--======================================================================-->
<!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =-->
<!--= Institute of Technology, Institut National de Recherche en =-->
<!--= Informatique et en Automatique, Keio University). All Rights =-->
<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
<!--======================================================================-->
<!--======================================================================-->
<!-- -->
<!-- filters-diffuseLt-BE-07.svg -->
<!-- renamed for 1.1 suite to filters-diffuse-01-f.svg -->
<!-- -->
<!-- Tests operation of the feDiffuseLighting filter. -->
<!-- -->
<!-- Author : Vincent Hardy 06-08-2000 -->
<!-- Revised for 1.1 : Mike Bultrowicz, 4 February 2002 -->
<!-- -->
<!-- History: -->
<!-- 06 08 2000, VH, created -->
<!-- 09-aug-2000, LH, minor edits for integration; ser#2. -->
<!-- 16-Aug-2000, LH="rename" ser#3. -->
<!-- -->
<!--======================================================================-->
<!--======================================================================-->
<!--= Note. After October 2000, revision history is kept as CVS 'commit' =-->
<!--= log messages, and therefore is no longer in the preceding preamble.=-->
<!--======================================================================-->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" width="480" height="360">
<SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/">
<OperatorScript>
<Paragraph>
Verify the basic operation of the feDiffuseLighting
element. The test shows three rows of 3 images. Each
rows tests a different aspect of the filter and shows
the result of the filtering operation.
</Paragraph>
<Paragraph>
The first row shows the result of varying the
surfaceScale attribute. The second row shows the result
of varying the diffuse constant (kd) attribute. The last
row shows the result of varying the lighting-color
property.
</Paragraph>
<Paragraph>
The rendered picture should match the reference image.
</Paragraph>
</OperatorScript>
</SVGTestCase>
<title id="test-title">filters-diffuse-01-f</title>
<desc id="test-desc">Validates operation of the feDiffuseLighting filter</desc>
<!--======================================================================-->
<!--Content of Test Case follows... =====================-->
<!--======================================================================-->
<g id="test-body-content">
<!-- Title -->
<text x="145" y="30" fill="black" font-size="12" font-family="Helvetica" font-weight="bold">Filters: feDiffuseLighting</text>
<!-- ===================================================================== -->
<!-- Filter definitions -->
<!-- ===================================================================== -->
<defs>
<!-- ================================================= -->
<!-- Surface scale -->
<!-- ================================================= -->
<filter id="surfaceScaleA" filterUnits="objectBoundingBox"
x="0%" y="0%" width="100%" height="100%">
<feDiffuseLighting in="SourceGraphic" diffuseConstant="1" surfaceScale="1">
<feDistantLight azimuth="45" elevation="45"/>
</feDiffuseLighting>
</filter>
<filter id="surfaceScaleB" filterUnits="objectBoundingBox"
x="0%" y="0%" width="100%" height="100%">
<feDiffuseLighting in="SourceGraphic" diffuseConstant="1" surfaceScale="10">
<feDistantLight azimuth="45" elevation="45"/>
</feDiffuseLighting>
</filter>
<filter id="surfaceScaleC" filterUnits="objectBoundingBox"
x="0%" y="0%" width="100%" height="100%">
<feDiffuseLighting in="SourceGraphic" diffuseConstant="1" surfaceScale="-10">
<feDistantLight azimuth="45" elevation="45"/>
</feDiffuseLighting>
</filter>
<!-- ================================================= -->
<!-- Diffuse Constants -->
<!-- ================================================= -->
<filter id="diffuseConstantA" filterUnits="objectBoundingBox"
x="0%" y="0%" width="100%" height="100%">
<feDiffuseLighting in="SourceGraphic" diffuseConstant="0" surfaceScale="10">
<feDistantLight azimuth="45" elevation="45"/>
</feDiffuseLighting>
</filter>
<filter id="diffuseConstantB" filterUnits="objectBoundingBox"
x="0%" y="0%" width="100%" height="100%">
<feDiffuseLighting in="SourceGraphic" diffuseConstant="1" surfaceScale="10">
<feDistantLight azimuth="45" elevation="45"/>
</feDiffuseLighting>
</filter>
<filter id="diffuseConstantC" filterUnits="objectBoundingBox"
x="0%" y="0%" width="100%" height="100%">
<feDiffuseLighting in="SourceGraphic" diffuseConstant="2" surfaceScale="10">
<feDistantLight azimuth="45" elevation="45"/>
</feDiffuseLighting>
</filter>
<!-- ================================================= -->
<!-- Lighting colors -->
<!-- ================================================= -->
<filter id="lightingColorA" filterUnits="objectBoundingBox"
x="0%" y="0%" width="100%" height="100%">
<feDiffuseLighting in="SourceGraphic" diffuseConstant="1" surfaceScale="10" lighting-color="red" >
<feDistantLight azimuth="45" elevation="45"/>
</feDiffuseLighting>
</filter>
<filter id="lightingColorB" filterUnits="objectBoundingBox"
x="0%" y="0%" width="100%" height="100%">
<feDiffuseLighting in="SourceGraphic" diffuseConstant="1" surfaceScale="10" lighting-color="yellow" >
<feDistantLight azimuth="45" elevation="45"/>
</feDiffuseLighting>
</filter>
<filter id="lightingColorC" filterUnits="objectBoundingBox"
x="0%" y="0%" width="100%" height="100%">
<feDiffuseLighting in="SourceGraphic" diffuseConstant="1" surfaceScale="10" lighting-color="blue" >
<feDistantLight azimuth="45" elevation="45"/>
</feDiffuseLighting>
</filter>
</defs>
<!-- ==================================================== -->
<!-- The same image is rendered multiple times with using -->
<!-- different filters. -->
<!-- ==================================================== -->
<!-- Various Surface Scales -->
<g transform="translate(0, 50)">
<text x="90" y="25">Various values for surfaceScale: 1, 10 and -10</text>
<image xlink:href="bumpMap2.png" x="90" y="30" width="50" height="30" filter="url(#surfaceScaleA)" />
<image xlink:href="bumpMap2.png" x="160" y="30" width="50" height="30" filter="url(#surfaceScaleB)" />
<image xlink:href="bumpMap2.png" x="230" y="30" width="50" height="30" filter="url(#surfaceScaleC)" />
</g>
<!-- Various Diffuse Constants -->
<g transform="translate(0, 120)">
<text x="90" y="25">Various values for diffuseConstants: 0, 1 and 2</text>
<image xlink:href="bumpMap2.png" x="90" y="30" width="50" height="30" filter="url(#diffuseConstantA)" />
<image xlink:href="bumpMap2.png" x="160" y="30" width="50" height="30" filter="url(#diffuseConstantB)" />
<image xlink:href="bumpMap2.png" x="230" y="30" width="50" height="30" filter="url(#diffuseConstantC)" />
</g>
<!-- Various Light Colors -->
<g transform="translate(0, 190)">
<text x="90" y="25">Various values for lighting color: red, yellow and blue</text>
<image xlink:href="bumpMap2.png" x="90" y="30" width="50" height="30" filter="url(#lightingColorA)" />
<image xlink:href="bumpMap2.png" x="160" y="30" width="50" height="30" filter="url(#lightingColorB)" />
<image xlink:href="bumpMap2.png" x="230" y="30" width="50" height="30" filter="url(#lightingColorC)" />
</g>
<!-- ===================================================== -->
<!-- Legends -->
<!-- ===================================================== -->
<!-- Surface Scale -->
</g>
<!--======================================================================-->
<!--Legend and frame: Title, suite and SVG document serialization====-->
<!--======================================================================-->
<g id="test-legend" fill="black" font-family="Helvetica" font-size="10">
<rect x="10" y="300" width="275" height="50" fill="none" stroke="#000000"/>
<path fill="none" stroke="#000000" d="M10 315 h275 M205 315 v35 M10 336 h195 M205 332 h80"/>
<text x="25" y="311">Scalable Vector Graphics (SVG) v1.1 Conformance Suite</text>
<a xlink:href="copyright-documents-19990405.html">
<text x="12" y="347" fill="blue" >Copyright 2002 W3C. All Rights Reserved.</text>
</a>
<text font-size="12" x="35" y="330">filters-diffuse-01</text>
<text font-size="10" x="210" y="327">$Revision: 1.1 $</text>
<text font-size="10" x="210" y="345">Release 1.0</text>
<rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
</g>
</svg>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<!--======================================================================-->
<!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =-->
<!--= Institute of Technology, Institut National de Recherche en =-->
<!--= Informatique et en Automatique, Keio University). All Rights =-->
<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
<!--======================================================================-->
<!--======================================================================-->
<!-- -->
<!-- filters-many-BE-01.svg -->
<!-- renamed for 1.1 suite to filters-example-01-f.svg -->
<!-- -->
<!-- Overall filter effects test case. Extracted from example filters00 -->
<!-- in the March 3, 2000 spec. Uses many filter effects in one image. -->
<!-- -->
<!-- Author : Jon Ferraiolo, 15 March 2000 -->
<!-- Revised for 1.1 : Mike Bultrowicz, 4 February 2002 -->
<!-- -->
<!-- History: -->
<!-- 15-Mar-2000, JF: Serial#1 created. Matches 20000303 SVG spec. -->
<!-- 16-Mar-2000, LH="editorials" fix name (-02); fix Legend, ser#2. -->
<!-- 03-Aug-2000, LH=" update DOCTYPE for CR DTD, 20000802" ser# . -->
<!-- 16-Aug-2000, LH="rename" ser#3. -->
<!-- 28-oct-2000, JF, change attr 'lightColor' to prop 'lighting-color' -->
<!-- new version: #4. -->
<!-- 10-Dec-2000, JF, fixed previous version merge problems, adjusted -->
<!-- specular lighting parameters to make linearRGB -->
<!-- result approximate previous reference image, which -->
<!-- was done using sRGB. -->
<!-- -->
<!--======================================================================-->
<!--======================================================================-->
<!--= Note. After October 2000, revision history is kept as CVS 'commit' =-->
<!--= log messages, and therefore is no longer in the preceding preamble.=-->
<!--======================================================================-->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" width="480" height="360">
<SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/">
<OperatorScript>
<Paragraph>
Verify that a typical usage of filtering is operation.
This test case creates a 3D lightiing effect and requires
that several filters are working: feGaussianBlur, feOffset,
feSpecularLighting, feComposite and feMerge. The graphic
consisting of the string "SVG" sitting on top of oval
filled in red and surrounded by an oval outlined in red.
</Paragraph>
<Paragraph>
The rendered picture should match the reference image
exactly, except for possible variations in the labelling
text (per CSS2 rules).
</Paragraph>
<Paragraph>
The test uses a nested 'svg' element, 'rect' element,
'path' element, as well as basic fill (solid primary
colors), stroke (solid primary colors with stroke-width
lines), font-family (Helvetica) and font-size properties.
</Paragraph>
</OperatorScript>
</SVGTestCase>
<title id="test-title">filters-example-01-f</title>
<desc id="test-desc">Overall filter effects test case. Extracted from example filters00 in the March 3, 2000 spec.</desc>
<!--======================================================================-->
<!--Content of Test Case follows... =====================-->
<!--======================================================================-->
<g id="test-body-content">
<g font-size="12" font-family="Verdana" >
<text x="20" y="30">A single filter that uses a combination of filter primitives. You should see</text>
<text x="20" y="45">a gray rectangle. Inside, there is an outer ring and an inner button with </text>
<text x="20" y="60">"SVG" on it, both in red with a 3D appearance and a lighting effect.</text>
<text x="20" y="75"></text>
</g>
<!-- Here is the test case -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="80" y="80" width="300" height="180" viewBox="0 0 200 120">
<title>Example filters01.svg - introducing filter effects</title>
<desc>An example which combines multiple filter primitives to produce a 3D lighting effect on a graphic consisting of the string "SVG" sitting on top of oval filled in red and surrounded by an oval outlined in red.</desc>
<defs>
<filter id="MyFilter" filterUnits="userSpaceOnUse" x="0" y="0" width="450" height="450">
<feGaussianBlur in="SourceAlpha" stdDeviation="4" result="blur"/>
<feOffset in="blur" dx="4" dy="4" result="offsetBlur"/>
<feSpecularLighting in="blur" surfaceScale="5" specularConstant=".75" specularExponent="20" lighting-color="white" result="specOut">
<fePointLight x="-5000" y="-10000" z="20000"/>
</feSpecularLighting>
<feComposite in="specOut" in2="SourceAlpha" operator="in" result="specOut"/>
<feComposite in="SourceGraphic" in2="specOut" operator="arithmetic" k1="0" k2="1" k3="1" k4="0" result="litPaint"/>
<feMerge>
<feMergeNode in="offsetBlur"/>
<feMergeNode in="litPaint"/>
</feMerge>
</filter>
</defs>
<rect x="1" y="1" width="198" height="118" fill="#888888" stroke="blue" />
<g filter="url(#MyFilter)" >
<g>
<path fill="none" stroke="#D90000" stroke-width="10" d="M50,90 C0,90 0,30 50,30 L150,30 C200,30 200,90 150,90 z"/>
<path fill="#D90000" d="M60,80 C30,80 30,40 60,40 L140,40 C170,40 170,80 140,80 z"/>
<g fill="#FFFFFF" stroke="black" font-size="45" font-family="Verdana" >
<text x="52" y="76">SVG</text>
</g>
</g>
</g>
</svg>
</g>
<!--======================================================================-->
<!--Legend and frame: Title, suite and SVG document serialization====-->
<!--======================================================================-->
<g id="test-legend" fill="black" font-family="Helvetica" font-size="10">
<rect x="10" y="300" width="275" height="50" fill="none" stroke="#000000"/>
<path fill="none" stroke="#000000" d="M10 315 h275 M205 315 v35 M10 336 h195 M205 332 h80"/>
<text x="25" y="311">Scalable Vector Graphics (SVG) v1.1 Conformance Suite</text>
<a xlink:href="copyright-documents-19990405.html">
<text x="12" y="347" fill="blue" >Copyright 2002 W3C. All Rights Reserved.</text>
</a>
<text font-size="12" x="35" y="330">filters-example-01</text>
<text font-size="10" x="210" y="327">$Revision: 1.1 $</text>
<text font-size="10" x="210" y="345">Release 1.0</text>
<rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
</g>
</svg>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment