kernelunitlength

kernelunitlength

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 primitiveUnits) for dx and dy, respectively, in the surface normal calculation formulas.
  • For the <feconvolvematrix> primitive, it indicates the intended distance in current filter units (i.e., units as determined by the value of attribute primitiveUnits) between successive columns and rows, respectively, in the 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

© 2005–2017 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/kernelUnitLength

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部