File: fe_component_transfer.rst

package info (click to toggle)
svgwrite 1.4.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 2,304 kB
  • sloc: python: 12,524; makefile: 116; sh: 5
file content (82 lines) | stat: -rw-r--r-- 2,523 bytes parent folder | download | duplicates (3)
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
.. _feComponentTransfer:

feComponentTransfer Filter Element
==================================

.. seealso:: http://www.w3.org/TR/SVG11/filters.html#feComponentTransferElement

This filter primitive performs component-wise remapping of data::

  R' = feFuncR( R )
  G' = feFuncG( G )
  B' = feFuncB( B )
  A' = feFuncA( A )

for every pixel. It allows operations like brightness adjustment, contrast
adjustment, color balance or thresholding.

The calculations are performed on non-premultiplied color values. If the
input graphics consists of premultiplied color values, those values are
automatically converted into non-premultiplied color values for this operation.
(Note that the undoing and redoing of the premultiplication can be avoided if
feFuncA is the identity transform and all alpha values on the source graphic
are set to 1.)

For common properties see: :ref:`filter_primitive`

SVG Attributes
--------------

* **in** -- (see :ref:`in <in_attr>` attribute)

Methods
-------

.. method:: feFuncR(type_, \*\*extra)

   create and add a transfer function for the **red** component of the input graphic

.. method:: feFuncG(type_, \*\*extra)

   create and add a transfer function for the **green** component of the input graphic

.. method:: feFuncB(type_, \*\*extra)

   create and add a transfer function for the **blue** component of the input graphic

.. method:: feFuncA(type_, \*\*extra)

   create and add a transfer function for the **alpha** component of the input graphic

Parameters for feFuncX() Methods
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

* **type** -- ``'identity | table | discrete | linear | gamma'``

  see: http://www.w3.org/TR/SVG11/filters.html#feComponentTransferTypeAttribute

* **tableValues** -- `(list of <number>s)`

  When **type** = ``'table'``, the list of `<number>s` 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.

* **slope** -- `<number>`

  When **type** = ``'linear'``, the slope of the linear function.

* **intercept** -- `<number>`

  When **type** = ``'linear'``, the intercept of the linear function.

* **amplitude** -- `<number>`

  When **type** = ``'gamma'``, the amplitude of the gamma function.

* **exponent** -- `<number>`

  When **type** = ``'gamma'``, the exponent of the gamma function.

* **offset** -- `<number>`

  When **type** = ``'gamma'``, the offset of the gamma function.