Code

Added example file for feTurbulence effect
authorkiirala <kiirala@users.sourceforge.net>
Fri, 11 Jan 2008 16:04:16 +0000 (16:04 +0000)
committerkiirala <kiirala@users.sourceforge.net>
Fri, 11 Jan 2008 16:04:16 +0000 (16:04 +0000)
share/examples/Makefile.am
share/examples/turbulence_effects.svg [new file with mode: 0644]

index bc645fc97fcc9685c56d29bde3ac27fa3a17367f..870439578cd783bed2f313ec70b1a275f571c4dc 100644 (file)
@@ -25,6 +25,7 @@ example_DATA = \
        blend_modes.svg \
        flow-go.svg \
        lighting_effects.svg \
+       turbulence_effects.svg \
        live-path-effects-curvestitch.svg \
        live-path-effects-gears.svg \
        live-path-effects-pathalongpath.svg
diff --git a/share/examples/turbulence_effects.svg b/share/examples/turbulence_effects.svg
new file mode 100644 (file)
index 0000000..e8c8a5f
--- /dev/null
@@ -0,0 +1,512 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="210mm"
+   height="297mm"
+   id="svg1901"
+   sodipodi:version="0.32"
+   inkscape:version="0.45+devel"
+   sodipodi:docname="turbulence_effects.svg"
+   sodipodi:docbase="/home/tsoots/ohj/translations/po"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape">
+  <defs
+     id="defs1903">
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       id="perspective2445"
+       inkscape:vp_x="-50 : 600 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="700 : 600 : 1"
+       inkscape:persp3d-origin="300 : 400 : 1" />
+    <linearGradient
+       inkscape:collect="always"
+       id="linearGradient2393">
+      <stop
+         style="stop-color:#ff00ff;stop-opacity:1;"
+         offset="0"
+         id="stop2395" />
+      <stop
+         id="stop2401"
+         offset="0.51618499"
+         style="stop-color:#7b85ff;stop-opacity:1" />
+      <stop
+         style="stop-color:#00ff78;stop-opacity:1"
+         offset="1"
+         id="stop2397" />
+    </linearGradient>
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       id="perspective7"
+       inkscape:vp_x="-50 : 600 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="700 : 600 : 1"
+       inkscape:persp3d-origin="300 : 400 : 1" />
+    <filter
+       id="filter2387"
+       inkscape:label="smudge">
+      <feTurbulence
+         id="feTurbulence2389"
+         type="fractalNoise"
+         baseFrequency="0.10000000000000001"
+         numOctaves="1"
+         seed="363"
+         in="SourceAlpha" />
+      <feDisplacementMap
+         id="feDisplacementMap2391"
+         yChannelSelector="G"
+         xChannelSelector="R"
+         scale="52.334152334152343"
+         in="SourceGraphic" />
+    </filter>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2393"
+       id="linearGradient2399"
+       x1="189"
+       y1="564.36218"
+       x2="281"
+       y2="470.36218"
+       gradientUnits="userSpaceOnUse" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2393"
+       id="linearGradient2405"
+       gradientUnits="userSpaceOnUse"
+       x1="189"
+       y1="564.36218"
+       x2="281"
+       y2="470.36218" />
+    <filter
+       id="filter2407"
+       inkscape:label="camo_holes">
+      <feTurbulence
+         id="feTurbulence2409"
+         in="SourceAlpha"
+         type="fractalNoise"
+         baseFrequency="0.10000000000000001"
+         numOctaves="1"
+         seed="338" />
+      <feColorMatrix
+         id="feColorMatrix2411"
+         type="matrix"
+         values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 10 -5 "
+         result="result0" />
+      <feComposite
+         id="feComposite2413"
+         in="SourceGraphic"
+         operator="in"
+         in2="result0" />
+    </filter>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2393"
+       id="linearGradient2421"
+       gradientUnits="userSpaceOnUse"
+       x1="189"
+       y1="564.36218"
+       x2="281"
+       y2="470.36218" />
+    <filter
+       id="filter2423"
+       inkscape:label="add_noise">
+      <feTurbulence
+         id="feTurbulence2425"
+         type="fractalNoise"
+         baseFrequency="0.10000000000000001"
+         numOctaves="2"
+         seed="363"
+         in="SourceAlpha" />
+      <feComposite
+         id="feComposite2429"
+         in2="SourceGraphic"
+         operator="atop" />
+    </filter>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2393"
+       id="linearGradient2433"
+       gradientUnits="userSpaceOnUse"
+       x1="189"
+       y1="564.36218"
+       x2="281"
+       y2="470.36218" />
+    <filter
+       inkscape:label="cloudy"
+       id="filter2435">
+      <feTurbulence
+         in="SourceAlpha"
+         seed="363"
+         numOctaves="5"
+         baseFrequency="0.029999999999999999"
+         type="fractalNoise"
+         id="feTurbulence2437" />
+      <feColorMatrix
+         id="feColorMatrix2441"
+         type="matrix"
+         values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 4 -2 " />
+      <feComposite
+         operator="atop"
+         in2="SourceGraphic"
+         id="feComposite2439"
+         k1="0"
+         k2="1"
+         k3="1"
+         k4="0" />
+    </filter>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2393"
+       id="linearGradient2449"
+       gradientUnits="userSpaceOnUse"
+       x1="189"
+       y1="564.36218"
+       x2="281"
+       y2="470.36218" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2393"
+       id="linearGradient2451"
+       gradientUnits="userSpaceOnUse"
+       x1="189"
+       y1="564.36218"
+       x2="281"
+       y2="470.36218" />
+    <filter
+       inkscape:label="black_white_speckles"
+       id="filter2457">
+      <feTurbulence
+         in="SourceAlpha"
+         seed="363"
+         numOctaves="2"
+         baseFrequency="0.20000000000000004"
+         type="turbulence"
+         id="feTurbulence2459" />
+      <feColorMatrix
+         values="0.42 1.44 0.14 0 0 0.42 1.44 0.14 0 0 0.42 1.44 0.14 0 0 0 0 0 6 -2 "
+         id="feColorMatrix2461" />
+      <feComposite
+         operator="atop"
+         in2="SourceGraphic"
+         id="feComposite2463" />
+    </filter>
+    <filter
+       id="filter2465"
+       inkscape:label="crumbled_tin_foil">
+      <feTurbulence
+         id="feTurbulence2467"
+         type="fractalNoise"
+         numOctaves="5"
+         baseFrequency="0.050000000000000003"
+         seed="364"
+         result="result0" />
+      <feDiffuseLighting
+         id="feDiffuseLighting2469"
+         surfaceScale="5"
+         diffuseConstant="1"
+         kernelUnitLength="1"
+         result="result1">
+        <feDistantLight
+           id="feDistantLight2471"
+           azimuth="210"
+           elevation="150" />
+      </feDiffuseLighting>
+      <feSpecularLighting
+         id="feSpecularLighting2475"
+         in="result0"
+         surfaceScale="5"
+         specularConstant="1"
+         specularExponent="13.83879781420765"
+         kernelUnitLength="1"
+         result="result3">
+        <feDistantLight
+           id="feDistantLight2477"
+           azimuth="210"
+           elevation="150" />
+      </feSpecularLighting>
+      <feComposite
+         id="feComposite2479"
+         in="result1"
+         in2="SourceGraphic"
+         operator="arithmetic"
+         k1="1"
+         k2="0"
+         k3="0"
+         result="result2" />
+      <feComposite
+         id="feComposite2481"
+         in="result2"
+         in2="result3"
+         operator="arithmetic"
+         k1="0"
+         k2="1"
+         k3="1"
+         k4="0" />
+      <feComposite
+         id="feComposite2449"
+         in2="SourceAlpha"
+         operator="in" />
+    </filter>
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="0.35355339"
+     inkscape:cx="331.61621"
+     inkscape:cy="522.31014"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     gridtolerance="10000"
+     inkscape:window-width="614"
+     inkscape:window-height="688"
+     inkscape:window-x="85"
+     inkscape:window-y="20"
+     showgrid="false"
+     showguides="true"
+     inkscape:guide-bbox="true"
+     objecttolerance="1"
+     guidetolerance="4"
+     inkscape:snap-bbox="true" />
+  <metadata
+     id="metadata1906">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title>feTurbulence usage examples</dc:title>
+        <dc:date>2008-01-11</dc:date>
+        <dc:creator>
+          <cc:Agent>
+            <dc:title>Niko Kiirala &lt;niko@kiirala.com&gt;</dc:title>
+          </cc:Agent>
+        </dc:creator>
+        <dc:rights>
+          <cc:Agent>
+            <dc:title>Under cc-by-sa-3.0 license. Filter effect definitions may be freely used.</dc:title>
+          </cc:Agent>
+        </dc:rights>
+        <dc:publisher>
+          <cc:Agent>
+            <dc:title>Inkscape (http://inkscape.org)</dc:title>
+          </cc:Agent>
+        </dc:publisher>
+        <dc:identifier></dc:identifier>
+        <dc:source></dc:source>
+        <dc:relation></dc:relation>
+        <dc:language>en</dc:language>
+        <dc:subject>
+          <rdf:Bag>
+            <rdf:li>feTurbulence</rdf:li>
+            <rdf:li>filter effects</rdf:li>
+            <rdf:li>example</rdf:li>
+          </rdf:Bag>
+        </dc:subject>
+        <dc:coverage></dc:coverage>
+        <dc:description>These are examples of effects attainable with feTurbulence filter primitive.</dc:description>
+        <dc:contributor>
+          <cc:Agent>
+            <dc:title></dc:title>
+          </cc:Agent>
+        </dc:contributor>
+        <cc:license
+           rdf:resource="http://creativecommons.org/licenses/by-sa/3.0/" />
+      </cc:Work>
+      <cc:License
+         rdf:about="http://creativecommons.org/licenses/by-sa/3.0/">
+        <cc:permits
+           rdf:resource="http://creativecommons.org/ns#Reproduction" />
+        <cc:permits
+           rdf:resource="http://creativecommons.org/ns#Distribution" />
+        <cc:requires
+           rdf:resource="http://creativecommons.org/ns#Notice" />
+        <cc:requires
+           rdf:resource="http://creativecommons.org/ns#Attribution" />
+        <cc:permits
+           rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
+        <cc:requires
+           rdf:resource="http://creativecommons.org/ns#ShareAlike" />
+      </cc:License>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Taso 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     style="opacity:1">
+    <path
+       sodipodi:type="star"
+       style="opacity:1;fill:url(#linearGradient2399);fill-opacity:1;fill-rule:evenodd;marker:none;marker-start:none;marker-mid:none;marker-end:none;visibility:visible;display:inline;overflow:visible;filter:url(#filter2387);enable-background:accumulate"
+       id="path2385"
+       sodipodi:sides="5"
+       sodipodi:cx="239"
+       sodipodi:cy="505.36218"
+       sodipodi:r1="155.55385"
+       sodipodi:r2="71.064049"
+       sodipodi:arg1="1.0380944"
+       sodipodi:arg2="1.666413"
+       inkscape:flatsided="false"
+       inkscape:rounded="0"
+       inkscape:randomized="0"
+       d="M 318,639.36218 L 232.21544,576.10163 L 135.97077,621.90393 L 169.62625,520.76937 L 96.324433,443.38894 L 202.90922,444.14491 L 253.85088,350.51887 L 286.06842,452.12063 L 390.85391,471.63699 L 304.18066,533.67437 L 318,639.36218 z"
+       transform="translate(-47.698485,-297.91378)" />
+    <path
+       transform="translate(292.30151,-297.91378)"
+       d="M 318,639.36218 L 232.21544,576.10163 L 135.97077,621.90393 L 169.62625,520.76937 L 96.324433,443.38894 L 202.90922,444.14491 L 253.85088,350.51887 L 286.06842,452.12063 L 390.85391,471.63699 L 304.18066,533.67437 L 318,639.36218 z"
+       inkscape:randomized="0"
+       inkscape:rounded="0"
+       inkscape:flatsided="false"
+       sodipodi:arg2="1.666413"
+       sodipodi:arg1="1.0380944"
+       sodipodi:r2="71.064049"
+       sodipodi:r1="155.55385"
+       sodipodi:cy="505.36218"
+       sodipodi:cx="239"
+       sodipodi:sides="5"
+       id="path2403"
+       style="opacity:1;fill:url(#linearGradient2405);fill-opacity:1;fill-rule:evenodd;marker:none;marker-start:none;marker-mid:none;marker-end:none;visibility:visible;display:inline;overflow:visible;filter:url(#filter2407);enable-background:accumulate"
+       sodipodi:type="star" />
+    <path
+       transform="translate(-47.698485,22.08622)"
+       d="M 318,639.36218 L 232.21544,576.10163 L 135.97077,621.90393 L 169.62625,520.76937 L 96.324433,443.38894 L 202.90922,444.14491 L 253.85088,350.51887 L 286.06842,452.12063 L 390.85391,471.63699 L 304.18066,533.67437 L 318,639.36218 z"
+       inkscape:randomized="0"
+       inkscape:rounded="0"
+       inkscape:flatsided="false"
+       sodipodi:arg2="1.666413"
+       sodipodi:arg1="1.0380944"
+       sodipodi:r2="71.064049"
+       sodipodi:r1="155.55385"
+       sodipodi:cy="505.36218"
+       sodipodi:cx="239"
+       sodipodi:sides="5"
+       id="path2419"
+       style="opacity:1;fill:url(#linearGradient2421);fill-opacity:1;fill-rule:evenodd;marker:none;marker-start:none;marker-mid:none;marker-end:none;visibility:visible;display:inline;overflow:visible;filter:url(#filter2423);enable-background:accumulate"
+       sodipodi:type="star" />
+    <path
+       sodipodi:type="star"
+       style="opacity:1;fill:url(#linearGradient2433);fill-opacity:1;fill-rule:evenodd;marker:none;marker-start:none;marker-mid:none;marker-end:none;visibility:visible;display:inline;overflow:visible;filter:url(#filter2435);enable-background:accumulate"
+       id="path2431"
+       sodipodi:sides="5"
+       sodipodi:cx="239"
+       sodipodi:cy="505.36218"
+       sodipodi:r1="155.55385"
+       sodipodi:r2="71.064049"
+       sodipodi:arg1="1.0380944"
+       sodipodi:arg2="1.666413"
+       inkscape:flatsided="false"
+       inkscape:rounded="0"
+       inkscape:randomized="0"
+       d="M 318,639.36218 L 232.21544,576.10163 L 135.97077,621.90393 L 169.62625,520.76937 L 96.324433,443.38894 L 202.90922,444.14491 L 253.85088,350.51887 L 286.06842,452.12063 L 390.85391,471.63699 L 304.18066,533.67437 L 318,639.36218 z"
+       transform="translate(292.30151,22.08622)" />
+    <path
+       sodipodi:type="star"
+       style="opacity:1;fill:url(#linearGradient2449);fill-opacity:1;fill-rule:evenodd;marker:none;marker-start:none;marker-mid:none;marker-end:none;visibility:visible;display:inline;overflow:visible;filter:url(#filter2457);enable-background:accumulate"
+       id="path2445"
+       sodipodi:sides="5"
+       sodipodi:cx="239"
+       sodipodi:cy="505.36218"
+       sodipodi:r1="155.55385"
+       sodipodi:r2="71.064049"
+       sodipodi:arg1="1.0380944"
+       sodipodi:arg2="1.666413"
+       inkscape:flatsided="false"
+       inkscape:rounded="0"
+       inkscape:randomized="0"
+       d="M 318,639.36218 L 232.21544,576.10163 L 135.97077,621.90393 L 169.62625,520.76937 L 96.324433,443.38894 L 202.90922,444.14491 L 253.85088,350.51887 L 286.06842,452.12063 L 390.85391,471.63699 L 304.18066,533.67437 L 318,639.36218 z"
+       transform="translate(-47.698485,342.08622)" />
+    <path
+       transform="translate(292.30151,342.08622)"
+       d="M 318,639.36218 L 232.21544,576.10163 L 135.97077,621.90393 L 169.62625,520.76937 L 96.324433,443.38894 L 202.90922,444.14491 L 253.85088,350.51887 L 286.06842,452.12063 L 390.85391,471.63699 L 304.18066,533.67437 L 318,639.36218 z"
+       inkscape:randomized="0"
+       inkscape:rounded="0"
+       inkscape:flatsided="false"
+       sodipodi:arg2="1.666413"
+       sodipodi:arg1="1.0380944"
+       sodipodi:r2="71.064049"
+       sodipodi:r1="155.55385"
+       sodipodi:cy="505.36218"
+       sodipodi:cx="239"
+       sodipodi:sides="5"
+       id="path2447"
+       style="opacity:1;fill:url(#linearGradient2451);fill-opacity:1;fill-rule:evenodd;marker:none;marker-start:none;marker-mid:none;marker-end:none;visibility:visible;display:inline;overflow:visible;filter:url(#filter2465);enable-background:accumulate"
+       sodipodi:type="star" />
+    <text
+       xml:space="preserve"
+       style="font-size:36px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:end;line-height:125%;writing-mode:lr-tb;text-anchor:end;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans"
+       x="-15.626862"
+       y="105.72363"
+       id="text2483"
+       sodipodi:linespacing="125%"><tspan
+         sodipodi:role="line"
+         id="tspan2485"
+         x="-15.626862"
+         y="105.72363">smudge</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:36px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans"
+       x="762.43829"
+       y="104.72168"
+       id="text2487"
+       sodipodi:linespacing="125%"><tspan
+         sodipodi:role="line"
+         id="tspan2489"
+         x="762.43829"
+         y="104.72168">camo_holes</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:36px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:end;line-height:125%;writing-mode:lr-tb;text-anchor:end;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans"
+       x="-15.62686"
+       y="438.88446"
+       id="text2491"
+       sodipodi:linespacing="125%"><tspan
+         sodipodi:role="line"
+         id="tspan2493"
+         x="-15.62686"
+         y="438.88446">add_noise</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:36px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans"
+       x="762.43829"
+       y="439.88641"
+       id="text2495"
+       sodipodi:linespacing="125%"><tspan
+         sodipodi:role="line"
+         id="tspan2497"
+         x="762.43829"
+         y="439.88641">cloudy</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:36px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:end;line-height:125%;writing-mode:lr-tb;text-anchor:end;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans"
+       x="-15.697172"
+       y="759.94281"
+       id="text2499"
+       sodipodi:linespacing="125%"><tspan
+         sodipodi:role="line"
+         id="tspan2501"
+         x="-15.697172"
+         y="759.94281">black_white_speckles</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:36px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans"
+       x="764.42462"
+       y="759.69672"
+       id="text2503"
+       sodipodi:linespacing="125%"><tspan
+         sodipodi:role="line"
+         id="tspan2505"
+         x="764.42462"
+         y="759.69672">crumbled_tin_foil</tspan></text>
+  </g>
+</svg>