diff examples/svg2code_ex/svg2code_ex.svg @ 1129:eca737d33a18

Improve performance of function to compute center of an arc. It is improved by using integer instead of floating point when computing. Some complicate computations are replaced by pre-computed table.
author Thinker K.F. Li <thinker@codemud.net>
date Sat, 18 Dec 2010 15:41:45 +0800
parents c8b6ca46950b
children
line wrap: on
line diff
--- a/examples/svg2code_ex/svg2code_ex.svg	Sat Dec 18 09:00:55 2010 +0800
+++ b/examples/svg2code_ex/svg2code_ex.svg	Sat Dec 18 15:41:45 2010 +0800
@@ -1,5 +1,6 @@
 <?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#"
@@ -13,9 +14,8 @@
    height="600"
    id="svg2"
    sodipodi:version="0.32"
-   inkscape:version="0.46"
+   inkscape:version="0.47 r22583"
    version="1.0"
-   sodipodi:docbase="/usr/home/thinker/progm/MadButterfly/examples/svg2code_ex"
    sodipodi:docname="svg2code_ex.svg"
    inkscape:output_extension="org.inkscape.output.svg.inkscape">
   <defs
@@ -322,7 +322,7 @@
      inkscape:pageshadow="2"
      inkscape:zoom="0.63166667"
      inkscape:cx="400"
-     inkscape:cy="176.10388"
+     inkscape:cy="239.42842"
      inkscape:document-units="px"
      inkscape:current-layer="layer1"
      width="800px"
@@ -331,7 +331,8 @@
      inkscape:window-width="822"
      inkscape:window-height="721"
      inkscape:window-x="130"
-     inkscape:window-y="120" />
+     inkscape:window-y="120"
+     inkscape:window-maximized="0" />
   <metadata
      id="metadata7">
     <rdf:RDF>
@@ -347,127 +348,140 @@
      inkscape:label="Layer 1"
      inkscape:groupmode="layer"
      id="layer1"
-     style="display:inline">
-    <rect
-       style="opacity:1;fill:url(#linearGradient5140);fill-opacity:1;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:none"
-       id="rect5132"
-       width="802.63855"
-       height="601.58313"
-       x="0"
-       y="0" />
-    <rect
-       style="opacity:0.5;fill:url(#radialGradient4155);fill-opacity:1.0;stroke:#000000;stroke-width:0.81232697;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
-       id="rect3174"
-       width="801.2431"
-       height="39.687672"
-       x="-0.093836516"
-       y="-0.093836516" />
-    <rect
-       style="opacity:1;fill:#f9f9f9;fill-opacity:1;stroke:#000000;stroke-width:1.2880522;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
-       id="rect5128"
-       width="458.71194"
-       height="418.71198"
-       x="20.644026"
-       y="60.644024"
-       rx="4.0216751"
-       ry="5.0559778" />
-    <rect
-       style="opacity:1;fill:#f9f9f9;fill-opacity:1;stroke:#000000;stroke-width:0.93608844;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
-       id="rect5130"
-       width="259.5639"
-       height="419.56393"
-       x="519.96802"
-       y="59.96804"
-       rx="5.0424933" />
-    <rect
-       style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.97354287;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
-       id="rect5144"
-       width="459.52646"
-       height="79.526451"
-       x="19.986771"
-       y="499.98679" />
-    <path
-       style="fill:#00ffff;fill-rule:evenodd;stroke:url(#linearGradient6123);stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none;fill-opacity:1.0"
-       d="M 20.580475,489.18206 L 471.76781,490.76517"
-       id="path5146" />
-    <g
-       id="file_button"
-       transform="translate(6.3324538,1.5831135)">
-      <rect
-         ry="3.0364513"
-         rx="1.1221098"
-         y="1.3907586"
-         x="18.805006"
-         height="32.046982"
-         width="81.123505"
-         id="rect6129"
-         style="opacity:0.9;fill:url(#radialGradient8096);fill-opacity:1;stroke:#000000;stroke-width:0.61528957;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
-      <text
-         id="text8071"
-         y="22.163589"
-         x="44.327179"
-         style="font-size:16px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans Mono"
-         xml:space="preserve"><tspan
-           y="22.163589"
-           x="44.327179"
-           id="tspan8073"
-           sodipodi:role="line">檔案</tspan></text>
-    </g>
-    <g
-       id="file_menu"
-       display="none"
-       style="display:none">
-      <rect
-         y="41.991447"
-         x="20.458471"
-         height="237.55008"
-         width="232.80074"
-         id="rect3157"
-         style="opacity:0.5;fill:url(#radialGradient7686);fill-opacity:1;stroke:#000000;stroke-width:0.91694379;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
-      <rect
-         y="46.864952"
-         x="26.915098"
-         height="219.88747"
-         width="215.13812"
-         id="rect2160"
-         style="opacity:0.5;fill:url(#linearGradient7683);fill-opacity:1;stroke:#000000;stroke-width:1.16530466;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
-      <text
-         sodipodi:linespacing="125%"
-         style="font-size:16px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-opacity:1;font-family:Bitstream Vera Sans"
-         id="text3134"
-         y="86.360161"
-         x="52.16227"
-         xml:space="preserve"><tspan
-           y="86.360161"
-           x="52.16227"
-           id="tspan3136"
-           sodipodi:role="line">test</tspan><tspan
-           id="tspan3138"
-           y="118.32115"
-           x="52.16227"
-           sodipodi:role="line"
-           style="font-size:28px">test</tspan></text>
-    </g>
-    <path
-       sodipodi:type="arc"
-       style="opacity:1;fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.39700007;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
-       id="path2451"
-       sodipodi:cx="648.28497"
-       sodipodi:cy="541.4248"
-       sodipodi:rx="98.944588"
-       sodipodi:ry="37.994728"
-       d="M 723.62808,516.79651 A 98.944588,37.994728 0 1 1 549.36227,542.22385"
-       sodipodi:start="5.5779634"
-       sodipodi:end="9.4037459"
-       sodipodi:open="true"/>
-    <image
-       y="87.316605"
-       x="605.409"
-       id="image2497"
-       height="130.90765"
-       width="100"
-       sodipodi:absref="/usr/home/thinker/progm/MadButterfly/examples/svg2code_ex/dsc_3241.png"
-       xlink:href="dsc_3241.png" />
-        transform="translate(0,-17.414248)" />
+     style="display:inline"><rect
+   style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:4"
+   id="rect2885"
+   width="804.22162"
+   height="606.33246"
+   x="-1.5831134"
+   y="-1.5831103"
+   inkscape:transform-center-x="0"
+   inkscape:transform-center-y="0"
+   inkscape:bbox-x="-3.5831134"
+   inkscape:bbox-y="-6.7493482"
+   inkscape:bbox-width="808.22162"
+   inkscape:bbox-height="610.33246" />
+<rect
+   style="opacity:1;fill:url(#linearGradient5140);fill-opacity:1;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:none"
+   id="rect5132"
+   width="802.63855"
+   height="601.58313"
+   x="0"
+   y="0" />
+<rect
+   style="opacity:0.5;fill:url(#radialGradient4155);fill-opacity:1.0;stroke:#000000;stroke-width:0.81232697;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+   id="rect3174"
+   width="801.2431"
+   height="39.687672"
+   x="-0.093836516"
+   y="-0.093836516" />
+<rect
+   style="opacity:1;fill:#f9f9f9;fill-opacity:1;stroke:#000000;stroke-width:1.2880522;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+   id="rect5128"
+   width="458.71194"
+   height="418.71198"
+   x="20.644026"
+   y="60.644024"
+   rx="4.0216751"
+   ry="5.0559778" />
+<rect
+   style="opacity:1;fill:#f9f9f9;fill-opacity:1;stroke:#000000;stroke-width:0.93608844;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+   id="rect5130"
+   width="259.5639"
+   height="419.56393"
+   x="519.96802"
+   y="59.96804"
+   rx="5.0424933" />
+<rect
+   style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.97354287;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+   id="rect5144"
+   width="459.52646"
+   height="79.526451"
+   x="19.986771"
+   y="499.98679" />
+<path
+   style="fill:#00ffff;fill-rule:evenodd;stroke:url(#linearGradient6123);stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none;fill-opacity:1.0"
+   d="M 20.580475,489.18206 L 471.76781,490.76517"
+   id="path5146" />
+<g
+   id="file_button"
+   transform="translate(6.3324538,1.5831135)">
+  <rect
+     ry="3.0364513"
+     rx="1.1221098"
+     y="1.3907586"
+     x="18.805006"
+     height="32.046982"
+     width="81.123505"
+     id="rect6129"
+     style="opacity:0.9;fill:url(#radialGradient8096);fill-opacity:1;stroke:#000000;stroke-width:0.61528957;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+  <text
+     id="text8071"
+     y="22.163589"
+     x="44.327179"
+     style="font-size:16px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans Mono"
+     xml:space="preserve"><tspan
+       y="22.163589"
+       x="44.327179"
+       id="tspan8073"
+       sodipodi:role="line">檔案</tspan></text>
+</g>
+<g
+   id="file_menu"
+   display="none"
+   style="display:none">
+  <rect
+     y="41.991447"
+     x="20.458471"
+     height="237.55008"
+     width="232.80074"
+     id="rect3157"
+     style="opacity:0.5;fill:url(#radialGradient7686);fill-opacity:1;stroke:#000000;stroke-width:0.91694379;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+  <rect
+     y="46.864952"
+     x="26.915098"
+     height="219.88747"
+     width="215.13812"
+     id="rect2160"
+     style="opacity:0.5;fill:url(#linearGradient7683);fill-opacity:1;stroke:#000000;stroke-width:1.16530466;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+  <text
+     sodipodi:linespacing="125%"
+     style="font-size:16px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-opacity:1;font-family:Bitstream Vera Sans"
+     id="text3134"
+     y="86.360161"
+     x="52.16227"
+     xml:space="preserve"><tspan
+       y="86.360161"
+       x="52.16227"
+       id="tspan3136"
+       sodipodi:role="line">test</tspan><tspan
+       id="tspan3138"
+       y="118.32115"
+       x="52.16227"
+       sodipodi:role="line"
+       style="font-size:28px">test</tspan></text>
+</g>
+<path
+   sodipodi:type="arc"
+   style="opacity:1;fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.39700007;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+   id="path2451"
+   sodipodi:cx="648.28497"
+   sodipodi:cy="541.4248"
+   sodipodi:rx="98.944588"
+   sodipodi:ry="37.994728"
+   d="M 723.62808,516.79651 A 98.944588,37.994728 0 1 1 549.36227,542.22385"
+   sodipodi:start="5.5779634"
+   sodipodi:end="9.4037459"
+   sodipodi:open="true" />
+<image
+   sodipodi:absref="/usr/home/thinker/progm/MadButterfly/examples/svg2code_ex/dsc_3241.png"
+   xlink:href="dsc_3241.png"
+   width="100"
+   height="130.90765"
+   id="image2497"
+   x="605.409"
+   y="87.316605" />
+
+        transform=&quot;translate(0,-17.414248)&quot; /&gt;
   </g>
 </svg>