| 1 |
<svg id="svg-root" width="100%" height="100%" |
| 2 |
viewBox="0 0 480 360" xmlns="http://www.w3.org/2000/svg" |
| 3 |
xmlns:xlink="http://www.w3.org/1999/xlink"> |
| 4 |
<!--======================================================================--> |
| 5 |
<!--= SVG 1.1 2nd Edition Test Case =--> |
| 6 |
<!--======================================================================--> |
| 7 |
<!--= Copyright 2011 World Wide Web Consortium, (Massachusetts =--> |
| 8 |
<!--= Institute of Technology, European Research Consortium for =--> |
| 9 |
<!--= Informatics and Mathematics (ERCIM), Keio University). =--> |
| 10 |
<!--= All Rights Reserved. =--> |
| 11 |
<!--= See http://www.w3.org/Consortium/Legal/. =--> |
| 12 |
<!--======================================================================--> |
| 13 |
<d:SVGTestCase xmlns:d="http://www.w3.org/2000/02/svg/testsuite/description/" |
| 14 |
template-version="1.4" reviewer="ED" author="Tavmjong Bah" status="accepted" |
| 15 |
version="$Revision: 1.3 $" testname="$RCSfile: filters-image-05-f.svg,v $"> |
| 16 |
<d:testDescription xmlns="http://www.w3.org/1999/xhtml" href="http://www.w3.org/TR/SVG11/filters.html#feImageElement"> |
| 17 |
<p> |
| 18 |
This test verifies the implementation of the preserveAspectRatio attribute on <feImage> |
| 19 |
referencing raster content. |
| 20 |
</p> |
| 21 |
</d:testDescription> |
| 22 |
<d:operatorScript xmlns="http://www.w3.org/1999/xhtml"> |
| 23 |
<p> |
| 24 |
This test copies coords-viewattr-02-b, substituting feImage for image. |
| 25 |
It exercises the various preserveAspectRatio values. An external bitmap |
| 26 |
is referenced. |
| 27 |
</p> |
| 28 |
</d:operatorScript> |
| 29 |
<d:passCriteria xmlns="http://www.w3.org/1999/xhtml"> |
| 30 |
<p> |
| 31 |
The rendered picture should match the reference image exactly except for variations in the labeling text. |
| 32 |
</p> |
| 33 |
</d:passCriteria> |
| 34 |
</d:SVGTestCase> |
| 35 |
<title id="test-title">$RCSfile: filters-image-05-f.svg,v $</title> |
| 36 |
<defs> |
| 37 |
<font-face font-family="SVGFreeSansASCII" unicode-range="U+0-7F"> |
| 38 |
<font-face-src> |
| 39 |
<font-face-uri xlink:href="../resources/SVGFreeSans.svg#ascii"/> |
| 40 |
</font-face-src> |
| 41 |
</font-face> |
| 42 |
</defs> |
| 43 |
<g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18"> |
| 44 |
<defs> |
| 45 |
<filter id="default" x="0" y="0" width="1" height="1"> |
| 46 |
<feImage xlink:href="../images/smiley.png"/> |
| 47 |
</filter> |
| 48 |
<!-- Meet --> |
| 49 |
<filter id="xMinYMinMeet" x="0" y="0" width="1" height="1"> |
| 50 |
<feImage xlink:href="../images/smiley.png" preserveAspectRatio="xMinYMin meet"/> |
| 51 |
</filter> |
| 52 |
<filter id="xMidYMinMeet" x="0" y="0" width="1" height="1"> |
| 53 |
<feImage xlink:href="../images/smiley.png" preserveAspectRatio="xMidYMin meet"/> |
| 54 |
</filter> |
| 55 |
<filter id="xMaxYMinMeet" x="0" y="0" width="1" height="1"> |
| 56 |
<feImage xlink:href="../images/smiley.png" preserveAspectRatio="xMaxYMin meet"/> |
| 57 |
</filter> |
| 58 |
<filter id="xMinYMidMeet" x="0" y="0" width="1" height="1"> |
| 59 |
<feImage xlink:href="../images/smiley.png" preserveAspectRatio="xMinYMid meet"/> |
| 60 |
</filter> |
| 61 |
<filter id="xMidYMidMeet" x="0" y="0" width="1" height="1"> |
| 62 |
<feImage xlink:href="../images/smiley.png" preserveAspectRatio="xMidYMid meet"/> |
| 63 |
</filter> |
| 64 |
<filter id="xMaxYMidMeet" x="0" y="0" width="1" height="1"> |
| 65 |
<feImage xlink:href="../images/smiley.png" preserveAspectRatio="xMaxYMid meet"/> |
| 66 |
</filter> |
| 67 |
<filter id="xMinYMaxMeet" x="0" y="0" width="1" height="1"> |
| 68 |
<feImage xlink:href="../images/smiley.png" preserveAspectRatio="xMinYMax meet"/> |
| 69 |
</filter> |
| 70 |
<filter id="xMidYMaxMeet" x="0" y="0" width="1" height="1"> |
| 71 |
<feImage xlink:href="../images/smiley.png" preserveAspectRatio="xMidYMax meet"/> |
| 72 |
</filter> |
| 73 |
<filter id="xMaxYMaxMeet" x="0" y="0" width="1" height="1"> |
| 74 |
<feImage xlink:href="../images/smiley.png" preserveAspectRatio="xMaxYMax meet"/> |
| 75 |
</filter> |
| 76 |
<!-- Slice --> |
| 77 |
<filter id="xMinYMinSlice" x="0" y="0" width="1" height="1"> |
| 78 |
<feImage xlink:href="../images/smiley.png" preserveAspectRatio="xMinYMin slice"/> |
| 79 |
</filter> |
| 80 |
<filter id="xMidYMinSlice" x="0" y="0" width="1" height="1"> |
| 81 |
<feImage xlink:href="../images/smiley.png" preserveAspectRatio="xMidYMin slice"/> |
| 82 |
</filter> |
| 83 |
<filter id="xMaxYMinSlice" x="0" y="0" width="1" height="1"> |
| 84 |
<feImage xlink:href="../images/smiley.png" preserveAspectRatio="xMaxYMin slice"/> |
| 85 |
</filter> |
| 86 |
<filter id="xMinYMidSlice" x="0" y="0" width="1" height="1"> |
| 87 |
<feImage xlink:href="../images/smiley.png" preserveAspectRatio="xMinYMid slice"/> |
| 88 |
</filter> |
| 89 |
<filter id="xMidYMidSlice" x="0" y="0" width="1" height="1"> |
| 90 |
<feImage xlink:href="../images/smiley.png" preserveAspectRatio="xMidYMid slice"/> |
| 91 |
</filter> |
| 92 |
<filter id="xMaxYMidSlice" x="0" y="0" width="1" height="1"> |
| 93 |
<feImage xlink:href="../images/smiley.png" preserveAspectRatio="xMaxYMid slice"/> |
| 94 |
</filter> |
| 95 |
<filter id="xMinYMaxSlice" x="0" y="0" width="1" height="1"> |
| 96 |
<feImage xlink:href="../images/smiley.png" preserveAspectRatio="xMinYMax slice"/> |
| 97 |
</filter> |
| 98 |
<filter id="xMidYMaxSlice" x="0" y="0" width="1" height="1"> |
| 99 |
<feImage xlink:href="../images/smiley.png" preserveAspectRatio="xMidYMax slice"/> |
| 100 |
</filter> |
| 101 |
<filter id="xMaxYMaxSlice" x="0" y="0" width="1" height="1"> |
| 102 |
<feImage xlink:href="../images/smiley.png" preserveAspectRatio="xMaxYMax slice"/> |
| 103 |
</filter> |
| 104 |
</defs> |
| 105 |
<g font-size="9" transform="translate(0, 30)"> |
| 106 |
<desc>Example PreserveAspectRatio - demonstrate available options</desc> |
| 107 |
<text text-anchor="middle" x="240" font-size="16">Test preserveAspectRatio on an feImage element.</text> |
| 108 |
<text x="40" y="30" text-anchor="middle">Raster to fit</text> |
| 109 |
<g transform="translate(20,40)"> |
| 110 |
<rect fill="red" width="40" height="40" filter="url(#default)"/> |
| 111 |
</g> |
| 112 |
<text x="35.5" y="110" text-anchor="middle">Viewport 1</text> |
| 113 |
<g transform="translate(10,120)"><rect x='.5' y='.5' width='49' height='29' fill='none' stroke='blue'/></g> |
| 114 |
<text x="35.5" y="180" text-anchor="middle">Viewport 2</text> |
| 115 |
<g transform="translate(20,190)"><rect x='.5' y='.5' width='29' height='59' fill='none' stroke='blue'/></g> |
| 116 |
<g id="meet-group-1" transform="translate(120, 50)"> |
| 117 |
<text x="0" y="-20">---------- meet --------------------</text> |
| 118 |
<g> |
| 119 |
<text y="-5">xMin*</text> |
| 120 |
<rect x='.5' y='.5' width='49' height='29' fill='none' stroke='blue'/> |
| 121 |
<rect fill="red" width="50" height="30" filter="url(#xMinYMinMeet)"/> |
| 122 |
</g> |
| 123 |
<g transform="translate(70,0)"> |
| 124 |
<text y="-5">xMid*</text> |
| 125 |
<rect x='.5' y='.5' width='49' height='29' fill='none' stroke='blue'/> |
| 126 |
<rect fill="red" width="50" height="30" filter="url(#xMidYMidMeet)"/> |
| 127 |
</g> |
| 128 |
<g transform="translate(0,50)"> |
| 129 |
<text y="-5">xMax*</text> |
| 130 |
<rect x='.5' y='.5' width='49' height='29' fill='none' stroke='blue'/> |
| 131 |
<rect fill="red" width="50" height="30" filter="url(#xMaxYMaxMeet)"/> |
| 132 |
</g> |
| 133 |
</g> |
| 134 |
<g id="meet-group-2" transform="translate(300, 50)"> |
| 135 |
<text x="0" y="-20">---------- meet ------------------------</text> |
| 136 |
<g> |
| 137 |
<text y="-5">*YMin</text><rect x='.5' y='.5' width='29' height='59' fill='none' stroke='blue'/> |
| 138 |
<rect fill="red" width="30" height="60" filter="url(#xMinYMinMeet)"/> |
| 139 |
</g> |
| 140 |
<g transform="translate(50, 0)"> |
| 141 |
<text y="-5">*YMid</text><rect x='.5' y='.5' width='29' height='59' fill='none' stroke='blue'/> |
| 142 |
<rect fill="red" width="30" height="60" filter="url(#xMidYMidMeet)"/> |
| 143 |
</g> |
| 144 |
<g transform="translate(100, 0)"> |
| 145 |
<text y="-5">*YMax</text><rect x='.5' y='.5' width='29' height='59' fill='none' stroke='blue'/> |
| 146 |
<rect fill="red" width="30" height="60" filter="url(#xMaxYMaxMeet)"/> |
| 147 |
</g> |
| 148 |
</g> |
| 149 |
<g id="slice-group-1" transform="translate(120, 185)"> |
| 150 |
<text x="0" y="-20">---------- slice -------------------------</text> |
| 151 |
<g> |
| 152 |
<text y="-5">xMin*</text><rect x='.5' y='.5' width='29' height='59' fill='none' stroke='blue'/> |
| 153 |
<rect fill="red" width="30" height="60" filter="url(#xMinYMinSlice)"/> |
| 154 |
</g> |
| 155 |
<g transform="translate(50,0)"> |
| 156 |
<text y="-5">xMid*</text><rect x='.5' y='.5' width='29' height='59' fill='none' stroke='blue'/> |
| 157 |
<rect fill="red" width="30" height="60" filter="url(#xMidYMidSlice)"/> |
| 158 |
</g> |
| 159 |
<g transform="translate(100,0)"> |
| 160 |
<text y="-5">xMax*</text><rect x='.5' y='.5' width='29' height='59' fill='none' stroke='blue'/> |
| 161 |
<rect fill="red" width="30" height="60" filter="url(#xMaxYMaxSlice)"/> |
| 162 |
</g> |
| 163 |
</g> |
| 164 |
<g id="slide-group-2" transform="translate(300, 155) translate(0, 30)"> |
| 165 |
<text x="0" y="-20">---------- slice ---------------------</text> |
| 166 |
<g> |
| 167 |
<text y="-5">*YMin</text> |
| 168 |
<rect x='.5' y='.5' width='49' height='29' fill='none' stroke='blue'/> |
| 169 |
<rect fill="red" width="50" height="30" filter="url(#xMinYMinSlice)"/> |
| 170 |
</g> |
| 171 |
<g transform="translate(70,0)"> |
| 172 |
<text y="-5">*YMid</text> |
| 173 |
<rect x='.5' y='.5' width='49' height='29' fill='none' stroke='blue'/> |
| 174 |
<rect fill="red" width="50" height="30" filter="url(#xMidYMidSlice)"/> |
| 175 |
</g> |
| 176 |
<g transform="translate(0,50)"> |
| 177 |
<text y="-5">*YMax</text> |
| 178 |
<rect x='.5' y='.5' width='49' height='29' fill='none' stroke='blue'/> |
| 179 |
<rect fill="red" width="50" height="30" filter="url(#xMaxYMaxSlice)"/> |
| 180 |
</g> |
| 181 |
</g> |
| 182 |
</g> |
| 183 |
</g> |
| 184 |
<g font-family="SVGFreeSansASCII,sans-serif" font-size="32"> |
| 185 |
<text id="revision" x="10" y="340" stroke="none" |
| 186 |
fill="black">$Revision: 1.3 $</text> |
| 187 |
</g> |
| 188 |
<rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000"/> |
| 189 |
<!-- comment out this watermark once the test is approved |
| 190 |
<g id="draft-watermark"> |
| 191 |
<rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/> |
| 192 |
<text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240" |
| 193 |
text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text> |
| 194 |
</g>--> |
| 195 |
</svg> |