-
Notifications
You must be signed in to change notification settings - Fork 22.4k
/
index.md
117 lines (96 loc) · 5.02 KB
/
index.md
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
---
title: kernelUnitLength
slug: Web/SVG/Attribute/kernelUnitLength
page-type: svg-attribute
spec-urls:
- https://drafts.fxtf.org/filter-effects/#element-attrdef-fespecularlighting-kernelunitlength
- https://drafts.fxtf.org/filter-effects/#element-attrdef-fediffuselighting-kernelunitlength
- https://drafts.fxtf.org/filter-effects/#element-attrdef-feconvolvematrix-kernelunitlength
---
{{SVGRef}}{{Deprecated_Header}}
The **`kernelUnitLength`** attribute has two meanings based on the context it's used in. For lighting filter primitives, it indicates the intended distance for the x and y coordinates, for {{SVGElement("feConvolveMatrix")}}, it indicates the intended distance between successive columns and rows in the kernel matrix.
You can use this attribute with the following SVG elements:
- {{SVGElement("feConvolveMatrix")}}
- {{SVGElement("feDiffuseLighting")}}
- {{SVGElement("feSpecularLighting")}}
## feConvolveMatrix
For the {{SVGElement("feConvolveMatrix")}}, `kernelUnitLength` indicates the intended distance in current filter units (i.e., units as determined by the value of {{SVGAttr("primitiveUnits")}} attribute) between successive columns and rows, respectively, in the {{SVGAttr("kernelMatrix")}}. By specifying value(s) for `kernelUnitLength`, the kernel becomes defined in a scalable, abstract coordinate system. If the attribute is not specified, the default value is one pixel in the offscreen bitmap, which is a pixel-based coordinate system, and thus potentially not scalable.
If a negative or zero value is specified the default value will be used instead.
<table class="properties">
<tbody>
<tr>
<th scope="row">Value</th>
<td>
<code
><a href="/en-US/docs/Web/SVG/Content_type#number-optional-number"
><number-optional-number></a
></code
>
</td>
</tr>
<tr>
<th scope="row">Default value</th>
<td><em>Pixel in offscreen bitmap</em></td>
</tr>
<tr>
<th scope="row">Animatable</th>
<td>Yes</td>
</tr>
</tbody>
</table>
- `<number-optional-number>`
- : The first number is the x value. The second number is the y value. If the x value is not specified, it defaults to the same value as x.
## feDiffuseLighting
For the {{SVGElement("feDiffuseLighting")}}, `kernelUnitLength` indicates the intended distance in current filter units (i.e., units as determined by the value of attribute {{SVGAttr("primitiveUnits")}}) for the x and y coordinate, respectively, in the surface normal calculation formulas.
The first number is the x value. The second number is the y value. If the y value is not specified, it defaults to the same value as x. By specifying value(s) for `kernelUnitLength`, the kernel becomes defined in a scalable, abstract coordinate system. If the attribute is not specified, the x and y values represent very small deltas relative to a given position, which might be implemented in some cases as one pixel in the intermediate image offscreen bitmap, which is a pixel-based coordinate system, and thus potentially not scalable.
If a negative or zero value is specified the default value will be used instead.
<table class="properties">
<tbody>
<tr>
<th scope="row">Value</th>
<td>
<code
><a href="/en-US/docs/Web/SVG/Content_type#number-optional-number"
><number-optional-number></a
></code
>
</td>
</tr>
<tr>
<th scope="row">Default value</th>
<td><em>Pixel in offscreen bitmap</em></td>
</tr>
<tr>
<th scope="row">Animatable</th>
<td>Yes</td>
</tr>
</tbody>
</table>
## feSpecularLighting
For the {{SVGElement("feSpecularLighting")}}, `kernelUnitLength` indicates the intended distance in current filter units (i.e., units as determined by the value of attribute {{SVGAttr("primitiveUnits")}}) for the x and y coordinate, respectively, in the surface normal calculation formulas.
The first number is the x value. The second number is the y value. If the y value is not specified, it defaults to the same value as x. By specifying value(s) for `kernelUnitLength`, the kernel becomes defined in a scalable, abstract coordinate system. If the attribute is not specified, the x and y values represent very small deltas relative to a given position, which might be implemented in some cases as one pixel in the intermediate image offscreen bitmap, which is a pixel-based coordinate system, and thus potentially not scalable.
If a negative or zero value is specified the default value will be used instead.
<table class="properties">
<tbody>
<tr>
<th scope="row">Value</th>
<td>
<code
><a href="/en-US/docs/Web/SVG/Content_type#number-optional-number"
><number-optional-number></a
></code
>
</td>
</tr>
<tr>
<th scope="row">Default value</th>
<td><em>Pixel in offscreen bitmap</em></td>
</tr>
<tr>
<th scope="row">Animatable</th>
<td>Yes</td>
</tr>
</tbody>
</table>
## Specifications
{{Specifications}}