| 1 |
<?xml version="1.0"?> |
| 2 |
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" |
| 3 |
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> |
| 4 |
<svg width="8cm" height="4cm" viewBox="0 0 800 400" |
| 5 |
xmlns="http://www.w3.org/2000/svg" version="1.1"> |
| 6 |
<title>Example feComponentTransfer - Examples of feComponentTransfer operations</title> |
| 7 |
<desc>Four text strings showing the effects of feComponentTransfer: |
| 8 |
an identity function acting as a reference, |
| 9 |
use of the feComponentTransfer table option, |
| 10 |
use of the feComponentTransfer linear option, |
| 11 |
and use of the feComponentTransfer gamma option.</desc> |
| 12 |
<defs> |
| 13 |
<linearGradient id="MyGradient" gradientUnits="userSpaceOnUse" |
| 14 |
x1="100" y1="0" x2="600" y2="0"> |
| 15 |
<stop offset="0" stop-color="#ff0000" /> |
| 16 |
<stop offset=".33" stop-color="#00ff00" /> |
| 17 |
<stop offset=".67" stop-color="#0000ff" /> |
| 18 |
<stop offset="1" stop-color="#000000" /> |
| 19 |
</linearGradient> |
| 20 |
<filter id="Identity" filterUnits="objectBoundingBox" |
| 21 |
x="0%" y="0%" width="100%" height="100%"> |
| 22 |
<feComponentTransfer> |
| 23 |
<feFuncR type="identity"/> |
| 24 |
<feFuncG type="identity"/> |
| 25 |
<feFuncB type="identity"/> |
| 26 |
<feFuncA type="identity"/> |
| 27 |
</feComponentTransfer> |
| 28 |
</filter> |
| 29 |
<filter id="Table" filterUnits="objectBoundingBox" |
| 30 |
x="0%" y="0%" width="100%" height="100%"> |
| 31 |
<feComponentTransfer> |
| 32 |
<feFuncR type="table" tableValues="0 0 1 1"/> |
| 33 |
<feFuncG type="table" tableValues="1 1 0 0"/> |
| 34 |
<feFuncB type="table" tableValues="0 1 1 0"/> |
| 35 |
</feComponentTransfer> |
| 36 |
</filter> |
| 37 |
<filter id="Linear" filterUnits="objectBoundingBox" |
| 38 |
x="0%" y="0%" width="100%" height="100%"> |
| 39 |
<feComponentTransfer> |
| 40 |
<feFuncR type="linear" slope=".5" intercept=".25"/> |
| 41 |
<feFuncG type="linear" slope=".5" intercept="0"/> |
| 42 |
<feFuncB type="linear" slope=".5" intercept=".5"/> |
| 43 |
</feComponentTransfer> |
| 44 |
</filter> |
| 45 |
<filter id="Gamma" filterUnits="objectBoundingBox" |
| 46 |
x="0%" y="0%" width="100%" height="100%"> |
| 47 |
<feComponentTransfer> |
| 48 |
<feFuncR type="gamma" amplitude="2" exponent="5" offset="0"/> |
| 49 |
<feFuncG type="gamma" amplitude="2" exponent="3" offset="0"/> |
| 50 |
<feFuncB type="gamma" amplitude="2" exponent="1" offset="0"/> |
| 51 |
</feComponentTransfer> |
| 52 |
</filter> |
| 53 |
</defs> |
| 54 |
<rect fill="none" stroke="blue" |
| 55 |
x="1" y="1" width="798" height="398"/> |
| 56 |
<g font-family="Verdana" font-size="75" |
| 57 |
font-weight="bold" fill="url(#MyGradient)" > |
| 58 |
<rect x="100" y="0" width="600" height="20" /> |
| 59 |
<text x="100" y="90">Identity</text> |
| 60 |
<text x="100" y="190" filter="url(#Table)" >TableLookup</text> |
| 61 |
<text x="100" y="290" filter="url(#Linear)" >LinearFunc</text> |
| 62 |
<text x="100" y="390" filter="url(#Gamma)" >GammaFunc</text> |
| 63 |
</g> |
| 64 |
</svg> |
| 65 |
|