feFuncB element | SVGFEFuncBElement object
Specifies a transfer function for the blue component of an input graphic; typically used as a child element of an SVGFEComponentTransferElement element.
![]() ![]() |
Syntax
<feFuncR type="gamma" amplitude="2" exponent="5" offset="0"/> <feFuncG type="linear" slope=".5" intercept="0"/> <feFuncB type="table" tableValues="0 1 1 0"/> <feFuncA type="identity"/>
DOM Information
Inheritance Hierarchy
Members
The SVGFEFuncBElement object has these types of members:
Properties
The SVGFEFuncBElement object has these properties.
| Property | Access type | Description |
|---|---|---|
| Read-only |
Indicates the amplitude of the gamma function. | |
| Read-only |
Indicates the exponent of the gamma function. | |
| Read-only |
Indicates the intercept of the linear function. | |
| Read-only |
Indicates the slope of the linear function. | |
| Read-only |
Define the lookup table. | |
| Read-only |
The type of component transfer function. The function type determines the applicability of the other attributes. |
Standards information
- Scalable Vector Graphics: Filter Effects, Section 15.25.9
Remarks
This topic describes the feFuncR, feFuncG, feFuncB, and feFuncA elements. These four elements are typically children of feComponentTransferelement and specify the transfer functions for the four channels, as follows:
feFuncR— transfer function for the red component of the input graphicfeFuncG— transfer function for the green component of the input graphicfeFuncB— transfer function for the blue component of the input graphicfeFuncA— transfer function for the alpha component of the input graphic
The following rules apply to the processing of the feComponentTransferelement element:
- If more than one transfer function element of the same kind is specified, the last occurrence is used.
- If any of the transfer function elements are unspecified, the feComponentTransferelement must be processed as if those transfer function elements were specified with their
typeattributes set toidentity(see below).
In addition to core attributes (id, xml:base, xml:lang, and xml:space), the following seven attributes are applicable to the feFuncR, feFuncG, feFuncB and feFuncA elements:
-
typeThe
typeattribute can be one of five values:identity,table,discrete,linear, orgamma(see below). These five values indicate the type of component transfer function. The value oftypedetermines the applicability of the other attributes (as discussed below).In the following, C is the initial component (such as
feFuncR), C' is the re-mapped component; both in the closed interval [0, 1]:-
For
identity:C' = C
-
For
table, the function is defined by linear interpolation between values given in the attributetableValues(see below). The table has n+1 values (that is, v₀ to vₙ) specifying the start and end values for n evenly sized interpolation regions. Interpolations use the following formula:For a value C < 1, find k such that k/n <= C < (k+1)/n
The result C' is given by C' = vₖ + (C - k/n)*n * (vₖ₊₁ - vₖ)
If C = 1 then C' = Vₙ
-
For
discrete, the function is defined by the step function given in the attributetableValues(see below), which provides a list of n values (that is, v₀ to vₙ₋₁) in order to identify a step function consisting of n steps. The step function is defined by the following formula:For a value C < 1 find k such that k/n <= C < (k+1)/n
The result C' is given by C' = vₖ
If C = 1 then C' = vₙ₋₁
-
For
linear, the function is defined by the following linear equation:C' =
slope* C +intercept(see below forslopeandintercept) -
For
gamma, the function is defined by the following exponential function:C' =
amplitude* pow(C,exponent) +offset(see below foramplitude,exponent, andoffset)
-
-
tableValuesWhen
type="table",tableValueis a list of numbers v₀, v₁, ..., vₙ separated by white space and/or a comma, which define the lookup table. An empty list results in an identity transfer function. If the attribute is not specified, then the effect is as if an empty list were provided. -
slopeWhen
type="linear",slopeindicates the slope of the linear function. If the attribute is not specified, then the effect is as if a value of 1 were specified. -
interceptWhen
type="linear",interceptindicates the intercept of the linear function. If the attribute is not specified, then the effect is as if a value of 0 were specified. -
amplitudeWhen
type="gamma",amplitudeindicates the amplitude of the gamma function. If the attribute is not specified, then the effect is as if a value of 1 were specified. -
exponentWhen
type="gamma",exponentindicates the exponent of the gamma function. If the attribute is not specified, then the effect is as if a value of 1 were specified. -
offsetWhen
type="gamma",offsetindicates the offset of the gamma function. If the attribute is not specified, then the effect is as if a value of 0 were specified
See also

