summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/svg/import/filters-light-05-f-manual.svg
blob: 339837efe445150ae71fe7dcefc5361d2b7dc966 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
<svg id="svg-root" width="100%" height="100%"
  viewBox="0 0 480 360" xmlns="http://www.w3.org/2000/svg"
  xmlns:xlink="http://www.w3.org/1999/xlink">
  <!--======================================================================-->
  <!--=  Copyright 2008 World Wide Web Consortium, (Massachusetts          =-->
  <!--=  Institute of Technology, European Research Consortium for         =-->
  <!--=  Informatics and Mathematics (ERCIM), Keio University).            =-->
  <!--=  All Rights Reserved.                                              =-->
  <!--=  See http://www.w3.org/Consortium/Legal/.                          =-->
  <!--======================================================================-->
  <d:SVGTestCase xmlns:d="http://www.w3.org/2000/02/svg/testsuite/description/"
    template-version="1.3" reviewer="ED" author="AG" status="reviewed"
    version="$Revision: 1.3 $" testname="$RCSfile: filters-light-05-f.svg,v $">
    <d:testDescription xmlns="http://www.w3.org/1999/xhtml" href="http://www.w3.org/TR/SVG11/filters.html#feDistantLightElevationAttribute">
        <p>
          This test verifies that the <a>'elevation'</a> attribute is interpreted as a
          complementary value to the z-axis in degrees.
        </p>
        <p>
          The test shows four different elevation angles that can be used for feDistantLight source.
          The four different feDistantLight light sources are used in three different filter cases; feDiffuseLight, feSpecularLight
          and feMerge which merges both feDiffuseLight and feSpecularLight to form a single filter. Using four different elevation values
          in three different filter cases gives twelve different filters. All twelve filter cases are applied to a vector graphic and
          then to a raster graphic. The vector graphic results are shown to the left and the raster graphic results are shown to the right.
        </p>
    </d:testDescription>
    <d:operatorScript xmlns="http://www.w3.org/1999/xhtml">
      <p>
        Run the test. No interaction required.
      </p>
    </d:operatorScript>
    <d:passCriteria xmlns="http://www.w3.org/1999/xhtml">
      <p>
        The test has passed if
      </p>
      <ul>
        <li>The top row has from left to right for a single graphic set:
          <ul>
            <li>A green square with a black circle inside of it</li>
            <li>A black square</li>
            <li>A black square with a green semicircle inside the lefthand side of the rect</li>
            <li>A black square with a green semicircle inside the righthand side of the rect</li>
          </ul>
        </li>
        <li>The middle row has from left to right for a single graphic set:
          <ul>
            <li>A green square with a white circle inside of it</li>
            <li>A green semicircle pointing to the right on top of a white background</li>
            <li>A green square with a white crest inside pointing to the right</li>
            <li>A green square with a white crest inside pointing to the left</li>
          </ul>
        </li>
        <li>The bottom row has from left to right for a single graphic set:
          <ul>
            <li>A green square with a black circle inside of it</li>
            <li>A black square with a green semicircle inside pointing to the right</li>
            <li>A green square with a circle inside that has a shadow on the righthand side and a reflection on the lefthand side</li>
            <li>A green square with a circle inside that has a shadow on the lefthand side and a reflection on the righthand side</li>
          </ul>
        </li>
      </ul>
      <p>
        If the test shows any red, the test has failed.
      </p>
    </d:passCriteria>
  </d:SVGTestCase>
  <title id="test-title">$RCSfile: filters-light-05-f.svg,v $</title>
  <defs>
    <font-face
      font-family="SVGFreeSansASCII"
      unicode-range="U+0-7F">
      <font-face-src>
        <font-face-uri xlink:href="../resources/SVGFreeSans.svg#ascii"/>
      </font-face-src>
    </font-face>
  </defs>
  <g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18">
    <defs color="#00FF00">
      <filter id="distantLightUp">
        <feDiffuseLighting in="SourceGraphic" surfaceScale="10" diffuseConstant="1" lighting-color="currentColor">
          <feDistantLight azimuth="0" elevation="90"/>
        </feDiffuseLighting>
      </filter>
      <filter id="distantLightDown">
        <feDiffuseLighting in="SourceGraphic" surfaceScale="10" diffuseConstant="1" lighting-color="currentColor">
          <feDistantLight azimuth="0" elevation="270"/>
        </feDiffuseLighting>
      </filter>
      <filter id="distantLightLeft">
        <feDiffuseLighting in="SourceGraphic" surfaceScale="10" diffuseConstant="1" lighting-color="currentColor">
          <feDistantLight azimuth="0" elevation="180"/>
        </feDiffuseLighting>
      </filter>
      <filter id="distantLightRight">
        <feDiffuseLighting in="SourceGraphic" surfaceScale="10" diffuseConstant="1" lighting-color="currentColor">
          <feDistantLight azimuth="0" elevation="0"/>
        </feDiffuseLighting>
      </filter>

      <filter id="specularLightUp">
        <feSpecularLighting in="SourceGraphic" surfaceScale="10" specularConstant="1" specularExponent="1" lighting-color="currentColor">
          <feDistantLight azimuth="0" elevation="90"/>
        </feSpecularLighting>
      </filter>
      <filter id="specularLightDown">
        <feSpecularLighting in="SourceGraphic" surfaceScale="10" specularConstant="1" specularExponent="1" lighting-color="currentColor">
          <feDistantLight azimuth="0" elevation="270"/>
        </feSpecularLighting>
      </filter>
      <filter id="specularLightLeft">
        <feSpecularLighting in="SourceGraphic" surfaceScale="10" specularConstant="1" specularExponent="1" lighting-color="currentColor">
          <feDistantLight azimuth="0" elevation="180"/>
        </feSpecularLighting>
      </filter>
      <filter id="specularLightRight">
        <feSpecularLighting in="SourceGraphic" surfaceScale="10" specularConstant="1" specularExponent="1" lighting-color="currentColor">
          <feDistantLight azimuth="0" elevation="0"/>
        </feSpecularLighting>
      </filter>

      <filter id="combinedUp">
        <feDiffuseLighting in="SourceGraphic" surfaceScale="10" diffuseConstant="1" lighting-color="currentColor" result="res_a">
          <feDistantLight azimuth="0" elevation="90"/>
        </feDiffuseLighting>
        <feSpecularLighting in="SourceGraphic" surfaceScale="10" specularConstant="1" specularExponent="1" lighting-color="currentColor" result="res_b">
          <feDistantLight azimuth="0" elevation="90"/>
        </feSpecularLighting>
        <feMerge>
          <feMergeNode in="res_a"/>
          <feMergeNode in="res_b"/>
        </feMerge>
      </filter>
      <filter id="combinedDown">
        <feDiffuseLighting in="SourceGraphic" surfaceScale="10" diffuseConstant="1" lighting-color="currentColor" result="res_a">
          <feDistantLight azimuth="0" elevation="270"/>
        </feDiffuseLighting>
        <feSpecularLighting in="SourceGraphic" surfaceScale="10" specularConstant="1" specularExponent="1" lighting-color="currentColor" result="res_b">
          <feDistantLight azimuth="0" elevation="270"/>
        </feSpecularLighting>
        <feMerge>
          <feMergeNode in="res_a"/>
          <feMergeNode in="res_b"/>
        </feMerge>
      </filter>
      <filter id="combinedLeft">
        <feDiffuseLighting in="SourceGraphic" surfaceScale="10" diffuseConstant="1" lighting-color="currentColor" result="res_a">
          <feDistantLight azimuth="0" elevation="180"/>
        </feDiffuseLighting>
        <feSpecularLighting in="SourceGraphic" surfaceScale="10" specularConstant="1" specularExponent="1" lighting-color="currentColor" result="res_b">
          <feDistantLight azimuth="0" elevation="180"/>
        </feSpecularLighting>
        <feMerge>
          <feMergeNode in="res_a"/>
          <feMergeNode in="res_b"/>
        </feMerge>
      </filter>
      <filter id="combinedRight">
        <feDiffuseLighting in="SourceGraphic" surfaceScale="10" diffuseConstant="1" lighting-color="currentColor" result="res_a">
          <feDistantLight azimuth="0" elevation="0"/>
        </feDiffuseLighting>
        <feSpecularLighting in="SourceGraphic" surfaceScale="10" specularConstant="1" specularExponent="1" lighting-color="currentColor" result="res_b">
          <feDistantLight azimuth="0" elevation="0"/>
        </feSpecularLighting>
        <feMerge>
          <feMergeNode in="res_a"/>
          <feMergeNode in="res_b"/>
        </feMerge>
      </filter>
    </defs>

    <text x="70" y="40" stroke="none" fill="black">feDiffuseLight using feDistantLight source</text>
    <g transform="scale(1.5) translate(5 45)">
      <circle id="c1" r="10" fill="red" filter="url(#distantLightUp)" transform="translate(20 0)"/>
      <circle id="c2" r="10" fill="red" filter="url(#distantLightDown)" transform="translate(50 0)"/>
      <circle id="c3" r="10" fill="red" filter="url(#distantLightLeft)" transform="translate(80 0)"/>
      <circle id="c4" r="10" fill="red" filter="url(#distantLightRight)" transform="translate(110 0)"/>
    </g>
    <text x="20" y="100" font-size="10" stroke="none" fill="black">90 deg</text>
    <text x="65" y="100" font-size="10" stroke="none" fill="black">270 deg</text>
    <text x="110" y="100" font-size="10" stroke="none" fill="black">180 deg</text>
    <text x="160" y="100" font-size="10" stroke="none" fill="black">0 deg</text>

    <text x="70" y="135" stroke="none" fill="black">feSpecularLight using feDistantLight source</text>
    <g transform="scale(1.5) translate(5 110)">
      <circle id="c1" r="10" fill="red" filter="url(#specularLightUp)" transform="translate(20 0)"/>
      <circle id="c2" r="10" fill="red" filter="url(#specularLightDown)" transform="translate(50 0)"/>
      <circle id="c3" r="10" fill="red" filter="url(#specularLightLeft)" transform="translate(80 0)"/>
      <circle id="c4" r="10" fill="red" filter="url(#specularLightRight)" transform="translate(110 0)"/>
    </g>
    <text x="20" y="195" font-size="10" stroke="none" fill="black">90 deg</text>
    <text x="65" y="195" font-size="10" stroke="none" fill="black">270 deg</text>
    <text x="110" y="195" font-size="10" stroke="none" fill="black">180 deg</text>
    <text x="160" y="195" font-size="10" stroke="none" fill="black">0 deg</text>

    <text x="30" y="230" stroke="none" fill="black">feDiffuseLight and feSpecularLight using feDistantLight</text>
    <g transform="scale(1.5) translate(5 170)">
      <circle id="c1" r="10" fill="red" filter="url(#combinedUp)" transform="translate(20 0)"/>
      <circle id="c2" r="10" fill="red" filter="url(#combinedDown)" transform="translate(50 0)"/>
      <circle id="c3" r="10" fill="red" filter="url(#combinedLeft)" transform="translate(80 0)"/>
      <circle id="c4" r="10" fill="red" filter="url(#combinedRight)" transform="translate(110 0)"/>
    </g>
    <text x="20" y="290" font-size="10" stroke="none" fill="black">90 deg</text>
    <text x="65" y="290" font-size="10" stroke="none" fill="black">270 deg</text>
    <text x="110" y="290" font-size="10" stroke="none" fill="black">180 deg</text>
    <text x="160" y="290" font-size="10" stroke="none" fill="black">0 deg</text>

    <g transform="translate(0, 55)">
      <image xlink:href="../images/bumpMap3.png" x="240" y="0" width="40" height="30" filter="url(#distantLightUp)"/>
      <image xlink:href="../images/bumpMap3.png" x="300" y="0" width="40" height="30" filter="url(#distantLightDown)"/>
      <image xlink:href="../images/bumpMap3.png" x="360" y="0" width="40" height="30" filter="url(#distantLightLeft)"/>
      <image xlink:href="../images/bumpMap3.png" x="420" y="0" width="40" height="30" filter="url(#distantLightRight)"/>
    </g>
    <text x="245" y="100" font-size="10" stroke="none" fill="black">90 deg</text>
    <text x="305" y="100" font-size="10" stroke="none" fill="black">270 deg</text>
    <text x="365" y="100" font-size="10" stroke="none" fill="black">180 deg</text>
    <text x="430" y="100" font-size="10" stroke="none" fill="black">0 deg</text>

    <g transform="translate(0, 150)">
      <image xlink:href="../images/bumpMap3.png" x="240" y="0" width="40" height="30" filter="url(#specularLightUp)"/>
      <image xlink:href="../images/bumpMap3.png" x="300" y="0" width="40" height="30" filter="url(#specularLightDown)"/>
      <image xlink:href="../images/bumpMap3.png" x="360" y="0" width="40" height="30" filter="url(#specularLightLeft)"/>
      <image xlink:href="../images/bumpMap3.png" x="420" y="0" width="40" height="30" filter="url(#specularLightRight)"/>
    </g>
    <text x="245" y="195" font-size="10" stroke="none" fill="black">90 deg</text>
    <text x="305" y="195" font-size="10" stroke="none" fill="black">270 deg</text>
    <text x="365" y="195" font-size="10" stroke="none" fill="black">180 deg</text>
    <text x="430" y="195" font-size="10" stroke="none" fill="black">0 deg</text>

    <g transform="translate(0, 240)">
      <image xlink:href="../images/bumpMap3.png" x="240" y="0" width="40" height="30" filter="url(#combinedUp)"/>
      <image xlink:href="../images/bumpMap3.png" x="300" y="0" width="40" height="30" filter="url(#combinedDown)"/>
      <image xlink:href="../images/bumpMap3.png" x="360" y="0" width="40" height="30" filter="url(#combinedLeft)"/>
      <image xlink:href="../images/bumpMap3.png" x="420" y="0" width="40" height="30" filter="url(#combinedRight)"/>
    </g>
    <text x="245" y="290" font-size="10" stroke="none" fill="black">90 deg</text>
    <text x="305" y="290" font-size="10" stroke="none" fill="black">270 deg</text>
    <text x="365" y="290" font-size="10" stroke="none" fill="black">180 deg</text>
    <text x="430" y="290" font-size="10" stroke="none" fill="black">0 deg</text>
    
  </g>
  <g font-family="SVGFreeSansASCII,sans-serif" font-size="32">
    <text id="revision" x="10" y="340" stroke="none"
      fill="black">$Revision: 1.3 $</text>
  </g>
  <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000"/>
  <!-- comment out this watermark once the test is approved -->
  <g id="draft-watermark">
    <rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/>
    <text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240"
      text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text>
  </g>
</svg>