Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

# feFuncG

DOM Interface
SVGElement

## Notes

### 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 graphic
• feFuncG — transfer function for the green component of the input graphic
• feFuncB — transfer function for the blue component of the input graphic
• feFuncA — 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 type attributes set to identity (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:

• type

The type attribute can be one of five values: identity, table, discrete, linear, or gamma (see below). These five values indicate the type of component transfer function. The value of type determines 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 attribute tableValues (see below). The table has n+1 values (that is, v0 to vn) 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’ = vk + (C - k/n)*n * (vk+1 - vk)

If C = 1 then C’ = Vn

• For discrete, the function is defined by the step function given in the attribute tableValues (see below), which provides a list of n values (that is, v0 to vn-1) 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’ = vk

If C = 1 then C’ = vn-1

• For linear, the function is defined by the following linear equation:

C’ = slope * C + intercept (see below for slope and intercept)

• For gamma, the function is defined by the following exponential function:

C’ = amplitude * pow(C, exponent) + offset (see below for amplitude, exponent, and offset)

• tableValues

When type="table", tableValue is a list of numbers v0, v1, …, vn 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.

• slope

When type="linear", slope indicates the slope of the linear function. If the attribute is not specified, then the effect is as if a value of 1 were specified.

• intercept

When type="linear", intercept indicates the intercept of the linear function. If the attribute is not specified, then the effect is as if a value of 0 were specified.

• amplitude

When type="gamma", amplitude indicates the amplitude of the gamma function. If the attribute is not specified, then the effect is as if a value of 1 were specified.

• exponent

When type="gamma", exponent indicates the exponent of the gamma function. If the attribute is not specified, then the effect is as if a value of 1 were specified.

• offset

When type="gamma", offset indicates the offset of the gamma function. If the attribute is not specified, then the effect is as if a value of 0 were specified

### Members

#### Properties

The SVGFEFuncGElement object has these properties.

• amplitude: Indicates the amplitude of the gamma function.
• exponent: Indicates the exponent of the gamma function.
• intercept: Indicates the intercept of the linear function.
• slope: Indicates the slope of the linear function.
• tableValues: Define the lookup table.
• type: The type of component transfer function. The function type determines the applicability of the other attributes.