mozilla

Revision 311579 of kernelUnitLength

  • Revision slug: SVG/Attribute/kernelUnitLength
  • Revision title: kernelUnitLength
  • Revision id: 311579
  • Created:
  • Creator: Jeremie
  • Is current revision? No
  • Comment

Revision Content

« SVG Attribute reference home

The kernelUnitLength attribute has two meaning based on the context it's used.

The first number is the <dx> value. The second number is the <dy> value. If the <dy> value is not specified, it defaults to the same value as <dx>.

  • For lighting filter primitives, it Indicates the intended distance in current filter units (i.e., units as determined by the value of attribute {{SVGAttr("primitiveUnits")}}) for dx and dy, respectively, in the surface normal calculation formulas.
  • For the {{SVGElement("feConvolveMatrix")}} primitive, it indicates the intended distance in current filter units (i.e., units as determined by the value of attribute {{SVGAttr("primitiveUnits")}}) 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 kernelUnitLength is not specified, in many cases it is define as one pixel in the intermediate image offscreen bitmap, which is a pixel-based coordinate system, and thus potentially not scalable which can have serious visual impact on SVG content.

Usage context

Categories None
Value <number-optional-number>
Animatable Yes
Normative document SVG 1.1 (2nd Edition) : feConvolveMatrix
SVG 1.1 (2nd Edition) : feDiffuseLighting
SVG 1.1 (2nd Edition) : feSpecularLighting

Example

Elements

The following elements can use the kernelUnitLength attribute

  • {{ SVGElement("feConvolveMatrix") }}
  • {{ SVGElement("feDiffuseLighting") }}
  • {{ SVGElement("feSpecularLighting") }}

Revision Source

<p>« <a href="/en/SVG/Attribute" title="en/SVG/Attribute">SVG Attribute reference home</a></p>
<p>The <code>kernelUnitLength</code> attribute has two meaning based on the context it's used.</p>
<p>The first number is the &lt;dx&gt; value. The second number is the &lt;dy&gt; value. If the &lt;dy&gt; value is not specified, it defaults to the same value as &lt;dx&gt;.</p>
<ul>
  <li>For lighting filter primitives, it Indicates the intended distance in current filter units (i.e., units as determined by the value of attribute {{SVGAttr("primitiveUnits")}}) for dx and dy, respectively, in the surface normal calculation formulas.</li>
  <li>For the {{SVGElement("feConvolveMatrix")}} primitive, it indicates the intended distance in current filter units (i.e., units as determined by the value of attribute {{SVGAttr("primitiveUnits")}}) between successive columns and rows, respectively, in the {{SVGAttr("kernelMatrix")}}.</li>
</ul>
<p>By specifying value(s) for kernelUnitLength, the kernel becomes defined in a scalable, abstract coordinate system.</p>
<p>If kernelUnitLength is not specified, in many cases it is define as one pixel in the intermediate image offscreen bitmap, which is a pixel-based coordinate system, and thus potentially not scalable which can have serious visual impact on SVG content.</p>
<h2 id="Usage_context">Usage context</h2>
<table class="standard-table">
  <tbody>
    <tr>
      <th scope="row">Categories</th>
      <td><em>None</em></td>
    </tr>
    <tr>
      <th scope="row">Value</th>
      <td><a href="/en/SVG/Content_type#Number-optional-number" title="en/SVG/Content_type#Paint">&lt;number-optional-number&gt;</a></td>
    </tr>
    <tr>
      <th scope="row">Animatable</th>
      <td>Yes</td>
    </tr>
    <tr>
      <th scope="row">Normative document</th>
      <td><a href="http://www.w3.org/TR/SVG11/filters.html#feConvolveMatrixElementKernelUnitLengthAttribute" rel="external" title="http://www.w3.org/TR/SVG11/filters.html#feConvolveMatrixElementKernelUnitLengthAttribute">SVG 1.1 (2nd Edition) : feConvolveMatrix</a><br />
        <a class="external" href="http://www.w3.org/TR/SVG11/filters.html#feDiffuseLightingKernelUnitLengthAttribute" title="http://www.w3.org/TR/SVG11/filters.html#feDiffuseLightingKernelUnitLengthAttribute">SVG 1.1 (2nd Edition) : feDiffuseLighting</a><br />
        <a href="http://www.w3.org/TR/SVG11/filters.html#feSpecularLightingKernelUnitLengthAttribute" rel="external" title="http://www.w3.org/TR/SVG11/filters.html#feSpecularLightingKernelUnitLengthAttribute">SVG 1.1 (2nd Edition) : feSpecularLighting</a></td>
    </tr>
  </tbody>
</table>
<h2 id="Example">Example</h2>
<h2 id="Elements">Elements</h2>
<p>The following elements can use the <code>kernelUnitLength</code> attribute</p>
<ul>
  <li>{{ SVGElement("feConvolveMatrix") }}</li>
  <li>{{ SVGElement("feDiffuseLighting") }}</li>
  <li>{{ SVGElement("feSpecularLighting") }}</li>
</ul>
Revert to this revision