OSDN Git Service

12
authorunknown <hskwk@.(none)>
Fri, 12 Mar 2010 11:05:52 +0000 (20:05 +0900)
committerunknown <hskwk@.(none)>
Fri, 12 Mar 2010 11:05:52 +0000 (20:05 +0900)
22 files changed:
dev3/Properties/AssemblyInfo.cs [new file with mode: 0644]
dev3/PsychlopsSilverlight3.csproj [new file with mode: 0644]
dev3/WriteableBitmapEx/License.txt [new file with mode: 0644]
dev3/WriteableBitmapEx/Readme.txt [new file with mode: 0644]
dev3/WriteableBitmapEx/WriteableBitmapEx.XML [new file with mode: 0644]
dev3/WriteableBitmapEx/WriteableBitmapEx.dll [new file with mode: 0644]
dev3/WriteableBitmapEx/WriteableBitmapEx.pdb [new file with mode: 0644]
dev3/psychlops/core/app/Class1.cs [new file with mode: 0644]
dev3/psychlops/core/device/hid.cs [new file with mode: 0644]
dev3/psychlops/core/graphic/canvas.cs [new file with mode: 0644]
dev3/psychlops/core/graphic/module.cs [new file with mode: 0644]
dev3/psychlops/core/graphic/shape.cs [new file with mode: 0644]
dev3/psychlops/core/math/util.cs [new file with mode: 0644]
dev3/psychlops/extention/standard/widget.cs [new file with mode: 0644]
dev3/psychlops/psychlops.cs [new file with mode: 0644]
test3/App.xaml [new file with mode: 0644]
test3/App.xaml.cs [new file with mode: 0644]
test3/MainPage.xaml [new file with mode: 0644]
test3/MainPage.xaml.cs [new file with mode: 0644]
test3/Properties/AppManifest.xml [new file with mode: 0644]
test3/Properties/AssemblyInfo.cs [new file with mode: 0644]
test3/PsychlopsSilverlight3test.csproj [new file with mode: 0644]

diff --git a/dev3/Properties/AssemblyInfo.cs b/dev3/Properties/AssemblyInfo.cs
new file mode 100644 (file)
index 0000000..212e1f5
--- /dev/null
@@ -0,0 +1,35 @@
+using System.Reflection;\r
+using System.Runtime.CompilerServices;\r
+using System.Runtime.InteropServices;\r
+\r
+// アセンブリに関する一般情報は以下の属性セットをとおして制御されます。\r
+// アセンブリに関連付けられている情報を変更するには、\r
+// これらの属性値を変更してください。\r
+[assembly: AssemblyTitle("PsychlopsSilverlight3")]\r
+[assembly: AssemblyDescription("")]\r
+[assembly: AssemblyConfiguration("")]\r
+[assembly: AssemblyCompany("")]\r
+[assembly: AssemblyProduct("PsychlopsSilverlight3")]\r
+[assembly: AssemblyCopyright("Copyright ©  2010")]\r
+[assembly: AssemblyTrademark("")]\r
+[assembly: AssemblyCulture("")]\r
+\r
+// ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから\r
+// 見えなくなります。このアセンブリ内で COM から型にアクセスする必要がある場合は、\r
+// その型の ComVisible 属性を true に設定してください。\r
+[assembly: ComVisible(false)]\r
+\r
+// このプロジェクトが COM に公開される場合、次の GUID がタイプ ライブラリの ID になります。\r
+[assembly: Guid("a37cfddf-f475-42fb-804c-66fa131de7fb")]\r
+\r
+// アセンブリのバージョン情報は、以下の 4 つの値で構成されています。\r
+//\r
+//      Major Version\r
+//      Minor Version \r
+//      Build Number\r
+//      Revision\r
+//\r
+// すべての値を指定するか、下のように '*' を使ってリビジョンおよびビルド番号を\r
+// 既定値にすることができます。\r
+[assembly: AssemblyVersion("1.0.0.0")]\r
+[assembly: AssemblyFileVersion("1.0.0.0")]\r
diff --git a/dev3/PsychlopsSilverlight3.csproj b/dev3/PsychlopsSilverlight3.csproj
new file mode 100644 (file)
index 0000000..7d45238
--- /dev/null
@@ -0,0 +1,78 @@
+<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <PropertyGroup>\r
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
+    <ProductVersion>9.0.30729</ProductVersion>\r
+    <SchemaVersion>2.0</SchemaVersion>\r
+    <ProjectGuid>{58F3CEF1-8123-4105-9525-B7E2C7F188AC}</ProjectGuid>\r
+    <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>\r
+    <OutputType>Library</OutputType>\r
+    <AppDesignerFolder>Properties</AppDesignerFolder>\r
+    <RootNamespace>PsychlopsSilverlight3</RootNamespace>\r
+    <AssemblyName>PsychlopsSilverlight3</AssemblyName>\r
+    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>\r
+    <SilverlightApplication>false</SilverlightApplication>\r
+    <ValidateXaml>true</ValidateXaml>\r
+    <ThrowErrorsInValidation>true</ThrowErrorsInValidation>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
+    <DebugSymbols>true</DebugSymbols>\r
+    <DebugType>full</DebugType>\r
+    <Optimize>false</Optimize>\r
+    <OutputPath>Bin\Debug</OutputPath>\r
+    <DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants>\r
+    <NoStdLib>true</NoStdLib>\r
+    <NoConfig>true</NoConfig>\r
+    <ErrorReport>prompt</ErrorReport>\r
+    <WarningLevel>4</WarningLevel>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
+    <DebugType>pdbonly</DebugType>\r
+    <Optimize>true</Optimize>\r
+    <OutputPath>Bin\Release</OutputPath>\r
+    <DefineConstants>TRACE;SILVERLIGHT</DefineConstants>\r
+    <NoStdLib>true</NoStdLib>\r
+    <NoConfig>true</NoConfig>\r
+    <ErrorReport>prompt</ErrorReport>\r
+    <WarningLevel>4</WarningLevel>\r
+  </PropertyGroup>\r
+  <ItemGroup>\r
+    <Reference Include="System.Windows" />\r
+    <Reference Include="mscorlib" />\r
+    <Reference Include="system" />\r
+    <Reference Include="System.Core" />\r
+    <Reference Include="System.Xml" />\r
+    <Reference Include="System.Net" />\r
+    <Reference Include="System.Windows.Browser" />\r
+    <Reference Include="WriteableBitmapEx, Version=0.9.0.0, Culture=neutral, processorArchitecture=MSIL">\r
+      <SpecificVersion>False</SpecificVersion>\r
+      <HintPath>WriteableBitmapEx\WriteableBitmapEx.dll</HintPath>\r
+    </Reference>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <Compile Include="Properties\AssemblyInfo.cs" />\r
+    <Compile Include="psychlops\core\app\Class1.cs" />\r
+    <Compile Include="psychlops\core\device\hid.cs" />\r
+    <Compile Include="psychlops\core\graphic\canvas.cs" />\r
+    <Compile Include="psychlops\core\graphic\module.cs" />\r
+    <Compile Include="psychlops\core\math\util.cs" />\r
+    <Compile Include="psychlops\extention\standard\widget.cs" />\r
+    <Compile Include="psychlops\psychlops.cs" />\r
+    <Compile Include="psychlops\core\graphic\shape.cs" />\r
+  </ItemGroup>\r
+  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\v3.0\Microsoft.Silverlight.CSharp.targets" />\r
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
+       Other similar extension points exist, see Microsoft.Common.targets.\r
+  <Target Name="BeforeBuild">\r
+  </Target>\r
+  <Target Name="AfterBuild">\r
+  </Target>\r
+  -->\r
+  <ProjectExtensions>\r
+    <VisualStudio>\r
+      <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">\r
+        <SilverlightProjectProperties />\r
+      </FlavorProperties>\r
+    </VisualStudio>\r
+  </ProjectExtensions>\r
+</Project>
\ No newline at end of file
diff --git a/dev3/WriteableBitmapEx/License.txt b/dev3/WriteableBitmapEx/License.txt
new file mode 100644 (file)
index 0000000..87bcae8
--- /dev/null
@@ -0,0 +1,23 @@
+Microsoft Public License (Ms-PL)\r
+[OSI Approved License]\r
+\r
+This license governs use of the accompanying software. If you use the software, you\r
+accept this license. If you do not accept the license, do not use the software.\r
+\r
+1. Definitions\r
+The terms "reproduce," "reproduction," "derivative works," and "distribution" have the\r
+same meaning here as under U.S. copyright law.\r
+A "contribution" is the original software, or any additions or changes to the software.\r
+A "contributor" is any person that distributes its contribution under this license.\r
+"Licensed patents" are a contributor's patent claims that read directly on its contribution.\r
+\r
+2. Grant of Rights\r
+(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.\r
+(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.\r
+\r
+3. Conditions and Limitations\r
+(A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.\r
+(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically.\r
+(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software.\r
+(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.\r
+(E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.
\ No newline at end of file
diff --git a/dev3/WriteableBitmapEx/Readme.txt b/dev3/WriteableBitmapEx/Readme.txt
new file mode 100644 (file)
index 0000000..d271870
--- /dev/null
@@ -0,0 +1,22 @@
+Description\r
+°°°°°°°°°°°\r
+\r
+The WriteableBitmapEx library is a collection of extension methods for Silverlight's WriteableBitmap. The WriteableBitmap class was added in Silverlight 3. It allows the direct manipulation of a bitmap and could be used to generate fast procedural images by drawing directly to a bitmap. The WriteableBitmap API is very minimalistic and there's only the raw Pixels array for such operations. The WriteableBitmapEx library tries to compensate that with extensions methods that are easy to use like built in methods. The library extends the WriteableBitmap class with elementary (2D drawing) functionality, supporting common shapes like point, line, ellipse, polyline, quad, rectangle, triangle, cubic Beziér and Cardinal spline. Conversion methods and functions to combine WriteableBitmaps (Blitting) are part of it too. \r
+It is possible to use the built assembly that contains all extension methods or just specific methods by using the source CS files directly. The extension methods are grouped into multiple CS files.\r
+\r
+See http://writeablebitmapex.codeplex.com\r
+\r
+\r
+Project structure\r
+°°°°°°°°°°°°°°°°°\r
+\r
+It is possible to use the built assembly that contains all extension methods or just specific methods by using the CS files directly. The extension methods are grouped into multiple CS files.\r
+\r
+Solution: The Visual Studio solutions for the library itself and the samples.\r
+Source:   The Visual Studio projects for the samples and the library (WriteableBitmapEx) with the WriteableBitmap*Extensions.cs files.\r
+\r
+\r
+License\r
+°°°°°°°\r
+\r
+The library is released under the Microsoft Public License (Ms-PL). Please read the License.txt for details.
\ No newline at end of file
diff --git a/dev3/WriteableBitmapEx/WriteableBitmapEx.XML b/dev3/WriteableBitmapEx/WriteableBitmapEx.XML
new file mode 100644 (file)
index 0000000..5d8eaeb
--- /dev/null
@@ -0,0 +1,600 @@
+<?xml version="1.0"?>\r
+<doc>\r
+    <assembly>\r
+        <name>WriteableBitmapEx</name>\r
+    </assembly>\r
+    <members>\r
+        <member name="T:System.Windows.Media.Imaging.WriteableBitmapExtensions">\r
+            <summary>\r
+            Collection of blit (copy) extension methods for the Silverlight WriteableBitmap class.\r
+            </summary>\r
+            <summary>\r
+            Collection of interchange extension methods for the Silverlight WriteableBitmap class.\r
+            </summary>\r
+            <summary>\r
+            Collection of draw extension methods for the Silverlight WriteableBitmap class.\r
+            </summary>\r
+            <summary>\r
+            Collection of draw extension methods for the Silverlight WriteableBitmap class.\r
+            </summary>\r
+            <summary>\r
+            Collection of draw spline extension methods for the Silverlight WriteableBitmap class.\r
+            </summary>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.Blit(System.Windows.Media.Imaging.WriteableBitmap,System.Windows.Rect,System.Windows.Media.Imaging.WriteableBitmap,System.Windows.Rect,System.Windows.Media.Imaging.WriteableBitmapExtensions.BlendMode)">\r
+            <summary>\r
+            Copies (blits) the pixels from the WriteableBitmap source to the destination WriteableBitmap (this).\r
+            </summary>\r
+            <param name="bmp">The destination WriteableBitmap.</param>\r
+            <param name="destRect">The rectangle that defines the destination region.</param>\r
+            <param name="source">The source WriteableBitmap.</param>\r
+            <param name="sourceRect">The rectangle that will be copied from the source to the destination.</param>\r
+            <param name="BlendMode">The blending mode <see cref="T:System.Windows.Media.Imaging.WriteableBitmapExtensions.BlendMode"/>.</param>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.Blit(System.Windows.Media.Imaging.WriteableBitmap,System.Windows.Rect,System.Windows.Media.Imaging.WriteableBitmap,System.Windows.Rect)">\r
+            <summary>\r
+            Copies (blits) the pixels from the WriteableBitmap source to the destination WriteableBitmap (this).\r
+            </summary>\r
+            <param name="bmp">The destination WriteableBitmap.</param>\r
+            <param name="destRect">The rectangle that defines the destination region.</param>\r
+            <param name="source">The source WriteableBitmap.</param>\r
+            <param name="sourceRect">The rectangle that will be copied from the source to the destination.</param>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.Blit(System.Windows.Media.Imaging.WriteableBitmap,System.Windows.Point,System.Windows.Media.Imaging.WriteableBitmap,System.Windows.Rect,System.Windows.Media.Color,System.Windows.Media.Imaging.WriteableBitmapExtensions.BlendMode)">\r
+            <summary>\r
+            Copies (blits) the pixels from the WriteableBitmap source to the destination WriteableBitmap (this).\r
+            </summary>\r
+            <param name="bmp">The destination WriteableBitmap.</param>\r
+            <param name="destPosition">The destination position in the destination bitmap.</param>\r
+            <param name="source">The source WriteableBitmap.</param>\r
+            <param name="sourceRect">The rectangle that will be copied from the source to the destination.</param>\r
+            <param name="color">If not Colors.White, will tint the source image. A partially transparent color and the image will be drawn partially transparent.</param>\r
+            <param name="BlendMode">The blending mode <see cref="T:System.Windows.Media.Imaging.WriteableBitmapExtensions.BlendMode"/>.</param>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.Blit(System.Windows.Media.Imaging.WriteableBitmap,System.Windows.Rect,System.Windows.Media.Imaging.WriteableBitmap,System.Windows.Rect,System.Windows.Media.Color,System.Windows.Media.Imaging.WriteableBitmapExtensions.BlendMode)">\r
+            <summary>\r
+            Copies (blits) the pixels from the WriteableBitmap source to the destination WriteableBitmap (this).\r
+            </summary>\r
+            <param name="bmp">The destination WriteableBitmap.</param>\r
+            <param name="destRect">The rectangle that defines the destination region.</param>\r
+            <param name="source">The source WriteableBitmap.</param>\r
+            <param name="sourceRect">The rectangle that will be copied from the source to the destination.</param>\r
+            <param name="color">If not Colors.White, will tint the source image. A partially transparent color and the image will be drawn partially transparent.</param>\r
+            <param name="BlendMode">The blending mode <see cref="T:System.Windows.Media.Imaging.WriteableBitmapExtensions.BlendMode"/>.</param>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.ToByteArray(System.Windows.Media.Imaging.WriteableBitmap,System.Int32,System.Int32)">\r
+            <summary>\r
+            Copies the Pixels from the WriteableBitmap into a ARGB byte array starting at a specific Pixels index.\r
+            </summary>\r
+            <param name="bmp">The WriteableBitmap.</param>\r
+            <param name="offset">The starting Pixels index.</param>\r
+            <param name="count">The number of Pixels to copy.</param>\r
+            <returns>The color buffer as byte ARGB values.</returns>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.ToByteArray(System.Windows.Media.Imaging.WriteableBitmap,System.Int32)">\r
+            <summary>\r
+            Copies the Pixels from the WriteableBitmap into a ARGB byte array.\r
+            </summary>\r
+            <param name="bmp">The WriteableBitmap.</param>\r
+            <param name="count">The number of pixels to copy.</param>\r
+            <returns>The color buffer as byte ARGB values.</returns>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.ToByteArray(System.Windows.Media.Imaging.WriteableBitmap)">\r
+            <summary>\r
+            Copies all the Pixels from the WriteableBitmap into a ARGB byte array.\r
+            </summary>\r
+            <param name="bmp">The WriteableBitmap.</param>\r
+            <returns>The color buffer as byte ARGB values.</returns>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.FromByteArray(System.Windows.Media.Imaging.WriteableBitmap,System.Byte[],System.Int32,System.Int32)">\r
+            <summary>\r
+            Copies color information from an ARGB byte array into the WriteableBitmap starting at a specific buffer index.\r
+            </summary>\r
+            <param name="bmp">The WriteableBitmap.</param>\r
+            <param name="offset">The starting index in the buffer.</param>\r
+            <param name="count">The number of bytes to copy from the buffer.</param>\r
+            <param name="buffer">The color buffer as byte ARGB values.</param>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.FromByteArray(System.Windows.Media.Imaging.WriteableBitmap,System.Byte[],System.Int32)">\r
+            <summary>\r
+            Copies color information from an ARGB byte array into the WriteableBitmap.\r
+            </summary>\r
+            <param name="bmp">The WriteableBitmap.</param>\r
+            <param name="count">The number of bytes to copy from the buffer.</param>\r
+            <param name="buffer">The color buffer as byte ARGB values.</param>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.FromByteArray(System.Windows.Media.Imaging.WriteableBitmap,System.Byte[])">\r
+            <summary>\r
+            Copies all the color information from an ARGB byte array into the WriteableBitmap.\r
+            </summary>\r
+            <param name="bmp">The WriteableBitmap.</param>\r
+            <param name="buffer">The color buffer as byte ARGB values.</param>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.WriteTga(System.Windows.Media.Imaging.WriteableBitmap,System.IO.Stream)">\r
+            <summary>\r
+            Writes the WriteableBitmap as a TGA image to a stream. \r
+            Used with permission from Nokola: http://nokola.com/blog/post/2010/01/21/Quick-and-Dirty-Output-of-WriteableBitmap-as-TGA-Image.aspx\r
+            </summary>\r
+            <param name="bmp">The WriteableBitmap.</param>\r
+            <param name="destination">The destination stream.</param>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.DrawLineBresenham(System.Windows.Media.Imaging.WriteableBitmap,System.Int32,System.Int32,System.Int32,System.Int32,System.Windows.Media.Color)">\r
+            <summary>\r
+            Draws a colored line by connecting two points using the Bresenham algorithm.\r
+            </summary>\r
+            <param name="bmp">The WriteableBitmap.</param>\r
+            <param name="x1">The x-coordinate of the start point.</param>\r
+            <param name="y1">The y-coordinate of the start point.</param>\r
+            <param name="x2">The x-coordinate of the end point.</param>\r
+            <param name="y2">The y-coordinate of the end point.</param>\r
+            <param name="color">The color for the line.</param>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.DrawLineBresenham(System.Windows.Media.Imaging.WriteableBitmap,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32)">\r
+            <summary>\r
+            Draws a colored line by connecting two points using the Bresenham algorithm.\r
+            </summary>\r
+            <param name="bmp">The WriteableBitmap.</param>\r
+            <param name="x1">The x-coordinate of the start point.</param>\r
+            <param name="y1">The y-coordinate of the start point.</param>\r
+            <param name="x2">The x-coordinate of the end point.</param>\r
+            <param name="y2">The y-coordinate of the end point.</param>\r
+            <param name="color">The color for the line.</param>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.DrawLineDDA(System.Windows.Media.Imaging.WriteableBitmap,System.Int32,System.Int32,System.Int32,System.Int32,System.Windows.Media.Color)">\r
+            <summary>\r
+            Draws a colored line by connecting two points using a DDA algorithm (Digital Differential Analyzer).\r
+            </summary>\r
+            <param name="bmp">The WriteableBitmap.</param>\r
+            <param name="x1">The x-coordinate of the start point.</param>\r
+            <param name="y1">The y-coordinate of the start point.</param>\r
+            <param name="x2">The x-coordinate of the end point.</param>\r
+            <param name="y2">The y-coordinate of the end point.</param>\r
+            <param name="color">The color for the line.</param>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.DrawLineDDA(System.Windows.Media.Imaging.WriteableBitmap,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32)">\r
+            <summary>\r
+            Draws a colored line by connecting two points using a DDA algorithm (Digital Differential Analyzer).\r
+            </summary>\r
+            <param name="bmp">The WriteableBitmap.</param>\r
+            <param name="x1">The x-coordinate of the start point.</param>\r
+            <param name="y1">The y-coordinate of the start point.</param>\r
+            <param name="x2">The x-coordinate of the end point.</param>\r
+            <param name="y2">The y-coordinate of the end point.</param>\r
+            <param name="color">The color for the line.</param>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.DrawLine(System.Windows.Media.Imaging.WriteableBitmap,System.Int32,System.Int32,System.Int32,System.Int32,System.Windows.Media.Color)">\r
+            <summary>\r
+            Draws a colored line by connecting two points using an optimized DDA.\r
+            </summary>\r
+            <param name="bmp">The WriteableBitmap.</param>\r
+            <param name="x1">The x-coordinate of the start point.</param>\r
+            <param name="y1">The y-coordinate of the start point.</param>\r
+            <param name="x2">The x-coordinate of the end point.</param>\r
+            <param name="y2">The y-coordinate of the end point.</param>\r
+            <param name="color">The color for the line.</param>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.DrawLine(System.Windows.Media.Imaging.WriteableBitmap,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32)">\r
+            <summary>\r
+            Draws a colored line by connecting two points using an optimized DDA.\r
+            </summary>\r
+            <param name="bmp">The WriteableBitmap.</param>\r
+            <param name="x1">The x-coordinate of the start point.</param>\r
+            <param name="y1">The y-coordinate of the start point.</param>\r
+            <param name="x2">The x-coordinate of the end point.</param>\r
+            <param name="y2">The y-coordinate of the end point.</param>\r
+            <param name="color">The color for the line.</param>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.DrawLine(System.Int32[],System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32)">\r
+            <summary>\r
+            Draws a colored line by connecting two points using an optimized DDA. \r
+            Uses the pixels array and the width directly for best performance.\r
+            </summary>\r
+            <param name="pixels">An array containing the pixels as int RGBA value.</param>\r
+            <param name="pixelWidth">The width of one scanline in the pixels array.</param>\r
+            <param name="pixelHeight">The height of the bitmap.</param>\r
+            <param name="x1">The x-coordinate of the start point.</param>\r
+            <param name="y1">The y-coordinate of the start point.</param>\r
+            <param name="x2">The x-coordinate of the end point.</param>\r
+            <param name="y2">The y-coordinate of the end point.</param>\r
+            <param name="color">The color for the line.</param>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.DrawPolyline(System.Windows.Media.Imaging.WriteableBitmap,System.Int32[],System.Windows.Media.Color)">\r
+            <summary>\r
+            Draws a polyline. Add the first point also at the end of the array if the line should be closed.\r
+            </summary>\r
+            <param name="bmp">The WriteableBitmap.</param>\r
+            <param name="points">The points of the polyline in x and y pairs, therefore the array is interpreted as (x1, y1, x2, y2, ..., xn, yn).</param>\r
+            <param name="color">The color for the line.</param>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.DrawPolyline(System.Windows.Media.Imaging.WriteableBitmap,System.Int32[],System.Int32)">\r
+            <summary>\r
+            Draws a polyline. Add the first point also at the end of the array if the line should be closed.\r
+            </summary>\r
+            <param name="bmp">The WriteableBitmap.</param>\r
+            <param name="points">The points of the polyline in x and y pairs, therefore the array is interpreted as (x1, y1, x2, y2, ..., xn, yn).</param>\r
+            <param name="color">The color for the line.</param>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.DrawTriangle(System.Windows.Media.Imaging.WriteableBitmap,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Windows.Media.Color)">\r
+            <summary>\r
+            Draws a triangle.\r
+            </summary>\r
+            <param name="bmp">The WriteableBitmap.</param>\r
+            <param name="x1">The x-coordinate of the 1st point.</param>\r
+            <param name="y1">The y-coordinate of the 1st point.</param>\r
+            <param name="x2">The x-coordinate of the 2nd point.</param>\r
+            <param name="y2">The y-coordinate of the 2nd point.</param>\r
+            <param name="x3">The x-coordinate of the 3rd point.</param>\r
+            <param name="y3">The y-coordinate of the 3rd point.</param>\r
+            <param name="color">The color.</param>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.DrawTriangle(System.Windows.Media.Imaging.WriteableBitmap,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32)">\r
+            <summary>\r
+            Draws a triangle.\r
+            </summary>\r
+            <param name="bmp">The WriteableBitmap.</param>\r
+            <param name="x1">The x-coordinate of the 1st point.</param>\r
+            <param name="y1">The y-coordinate of the 1st point.</param>\r
+            <param name="x2">The x-coordinate of the 2nd point.</param>\r
+            <param name="y2">The y-coordinate of the 2nd point.</param>\r
+            <param name="x3">The x-coordinate of the 3rd point.</param>\r
+            <param name="y3">The y-coordinate of the 3rd point.</param>\r
+            <param name="color">The color.</param>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.DrawQuad(System.Windows.Media.Imaging.WriteableBitmap,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Windows.Media.Color)">\r
+            <summary>\r
+            Draws a quad.\r
+            </summary>\r
+            <param name="bmp">The WriteableBitmap.</param>\r
+            <param name="x1">The x-coordinate of the 1st point.</param>\r
+            <param name="y1">The y-coordinate of the 1st point.</param>\r
+            <param name="x2">The x-coordinate of the 2nd point.</param>\r
+            <param name="y2">The y-coordinate of the 2nd point.</param>\r
+            <param name="x3">The x-coordinate of the 3rd point.</param>\r
+            <param name="y3">The y-coordinate of the 3rd point.</param>\r
+            <param name="x4">The x-coordinate of the 4th point.</param>\r
+            <param name="y4">The y-coordinate of the 4th point.</param>\r
+            <param name="color">The color.</param>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.DrawQuad(System.Windows.Media.Imaging.WriteableBitmap,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32)">\r
+            <summary>\r
+            Draws a quad.\r
+            </summary>\r
+            <param name="bmp">The WriteableBitmap.</param>\r
+            <param name="x1">The x-coordinate of the 1st point.</param>\r
+            <param name="y1">The y-coordinate of the 1st point.</param>\r
+            <param name="x2">The x-coordinate of the 2nd point.</param>\r
+            <param name="y2">The y-coordinate of the 2nd point.</param>\r
+            <param name="x3">The x-coordinate of the 3rd point.</param>\r
+            <param name="y3">The y-coordinate of the 3rd point.</param>\r
+            <param name="x4">The x-coordinate of the 4th point.</param>\r
+            <param name="y4">The y-coordinate of the 4th point.</param>\r
+            <param name="color">The color.</param>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.DrawRectangle(System.Windows.Media.Imaging.WriteableBitmap,System.Int32,System.Int32,System.Int32,System.Int32,System.Windows.Media.Color)">\r
+            <summary>\r
+            Draws a rectangle.\r
+            x2 has to be greater than x1 and y2 has to be greater than y1.\r
+            </summary>\r
+            <param name="bmp">The WriteableBitmap.</param>\r
+            <param name="x1">The x-coordinate of the bounding rectangle's left side.</param>\r
+            <param name="y1">The y-coordinate of the bounding rectangle's top side.</param>\r
+            <param name="x2">The x-coordinate of the bounding rectangle's right side.</param>\r
+            <param name="y2">The y-coordinate of the bounding rectangle's bottom side.</param>\r
+            <param name="color">The color.</param>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.DrawRectangle(System.Windows.Media.Imaging.WriteableBitmap,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32)">\r
+            <summary>\r
+            Draws a rectangle.\r
+            x2 has to be greater than x1 and y2 has to be greater than y1.\r
+            </summary>\r
+            <param name="bmp">The WriteableBitmap.</param>\r
+            <param name="x1">The x-coordinate of the bounding rectangle's left side.</param>\r
+            <param name="y1">The y-coordinate of the bounding rectangle's top side.</param>\r
+            <param name="x2">The x-coordinate of the bounding rectangle's right side.</param>\r
+            <param name="y2">The y-coordinate of the bounding rectangle's bottom side.</param>\r
+            <param name="color">The color.</param>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.DrawEllipse(System.Windows.Media.Imaging.WriteableBitmap,System.Int32,System.Int32,System.Int32,System.Int32,System.Windows.Media.Color)">\r
+            <summary>\r
+            A Fast Bresenham Type Algorithm For Drawing Ellipses http://homepage.smc.edu/kennedy_john/belipse.pdf \r
+            x2 has to be greater than x1 and y2 has to be greater than y1.\r
+            </summary>\r
+            <param name="bmp">The WriteableBitmap.</param>\r
+            <param name="x1">The x-coordinate of the bounding rectangle's left side.</param>\r
+            <param name="y1">The y-coordinate of the bounding rectangle's top side.</param>\r
+            <param name="x2">The x-coordinate of the bounding rectangle's right side.</param>\r
+            <param name="y2">The y-coordinate of the bounding rectangle's bottom side.</param>\r
+            <param name="color">The color for the line.</param>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.DrawEllipse(System.Windows.Media.Imaging.WriteableBitmap,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32)">\r
+            <summary>\r
+            A Fast Bresenham Type Algorithm For Drawing Ellipses http://homepage.smc.edu/kennedy_john/belipse.pdf \r
+            x2 has to be greater than x1 and y2 has to be greater than y1.\r
+            </summary>\r
+            <param name="bmp">The WriteableBitmap.</param>\r
+            <param name="x1">The x-coordinate of the bounding rectangle's left side.</param>\r
+            <param name="y1">The y-coordinate of the bounding rectangle's top side.</param>\r
+            <param name="x2">The x-coordinate of the bounding rectangle's right side.</param>\r
+            <param name="y2">The y-coordinate of the bounding rectangle's bottom side.</param>\r
+            <param name="color">The color for the line.</param>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.DrawEllipseCentered(System.Windows.Media.Imaging.WriteableBitmap,System.Int32,System.Int32,System.Int32,System.Int32,System.Windows.Media.Color)">\r
+            <summary>\r
+            A Fast Bresenham Type Algorithm For Drawing Ellipses http://homepage.smc.edu/kennedy_john/belipse.pdf\r
+            Uses a different parameter representation than DrawEllipse().\r
+            </summary>\r
+            <param name="bmp">The WriteableBitmap.</param>\r
+            <param name="xc">The x-coordinate of the ellipses center.</param>\r
+            <param name="yc">The y-coordinate of the ellipses center.</param>\r
+            <param name="xr">The radius of the ellipse in x-direction.</param>\r
+            <param name="yr">The radius of the ellipse in y-direction.</param>\r
+            <param name="color">The color for the line.</param>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.DrawEllipseCentered(System.Windows.Media.Imaging.WriteableBitmap,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32)">\r
+            <summary>\r
+            A Fast Bresenham Type Algorithm For Drawing Ellipses http://homepage.smc.edu/kennedy_john/belipse.pdf \r
+            Uses a different parameter representation than DrawEllipse().\r
+            </summary>\r
+            <param name="bmp">The WriteableBitmap.</param>\r
+            <param name="xc">The x-coordinate of the ellipses center.</param>\r
+            <param name="yc">The y-coordinate of the ellipses center.</param>\r
+            <param name="xr">The radius of the ellipse in x-direction.</param>\r
+            <param name="yr">The radius of the ellipse in y-direction.</param>\r
+            <param name="color">The color for the line.</param>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.Clear(System.Windows.Media.Imaging.WriteableBitmap,System.Windows.Media.Color)">\r
+            <summary>\r
+            Fills the whole WriteableBitmap with a color.\r
+            </summary>\r
+            <param name="bmp">The WriteableBitmap.</param>\r
+            <param name="color">The color used for filling.</param>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.Clear(System.Windows.Media.Imaging.WriteableBitmap)">\r
+            <summary>\r
+            Fills the whole WriteableBitmap with an empty color (0).\r
+            </summary>\r
+            <param name="bmp">The WriteableBitmap.</param>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.Clone(System.Windows.Media.Imaging.WriteableBitmap)">\r
+            <summary>\r
+            Clones the specified WriteableBitmap.\r
+            </summary>\r
+            <param name="bmp">The WriteableBitmap.</param>\r
+            <returns>A copy of the WriteableBitmap.</returns>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.ForEach(System.Windows.Media.Imaging.WriteableBitmap,System.Func{System.Int32,System.Int32,System.Windows.Media.Color})">\r
+            <summary>\r
+            Applies the given function to all the pixels of the bitmap in \r
+            order to set their color.\r
+            </summary>\r
+            <param name="bmp">The WriteableBitmap.</param>\r
+            <param name="func">The function to apply. With parameters x, y and a color as a result</param>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.ForEach(System.Windows.Media.Imaging.WriteableBitmap,System.Func{System.Int32,System.Int32,System.Windows.Media.Color,System.Windows.Media.Color})">\r
+            <summary>\r
+            Applies the given function to all the pixels of the bitmap in \r
+            order to set their color.\r
+            </summary>\r
+            <param name="bmp">The WriteableBitmap.</param>\r
+            <param name="func">The function to apply. With parameters x, y, source color and a color as a result</param>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.SetPixeli(System.Windows.Media.Imaging.WriteableBitmap,System.Int32,System.Byte,System.Byte,System.Byte)">\r
+            <summary>\r
+            Sets the color of the pixel using a precalculated index (faster).\r
+            </summary>\r
+            <param name="bmp">The WriteableBitmap.</param>\r
+            <param name="index">The coordinate index.</param>\r
+            <param name="r">The red value of the color.</param>\r
+            <param name="g">The green value of the color.</param>\r
+            <param name="b">The blue value of the color.</param>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.SetPixel(System.Windows.Media.Imaging.WriteableBitmap,System.Int32,System.Int32,System.Byte,System.Byte,System.Byte)">\r
+            <summary>\r
+            Sets the color of the pixel.\r
+            </summary>\r
+            <param name="bmp">The WriteableBitmap.</param>\r
+            <param name="x">The x coordinate (row).</param>\r
+            <param name="y">The y coordinate (column).</param>\r
+            <param name="r">The red value of the color.</param>\r
+            <param name="g">The green value of the color.</param>\r
+            <param name="b">The blue value of the color.</param>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.SetPixeli(System.Windows.Media.Imaging.WriteableBitmap,System.Int32,System.Byte,System.Byte,System.Byte,System.Byte)">\r
+            <summary>\r
+            Sets the color of the pixel including the alpha value and using a precalculated index (faster).\r
+            </summary>\r
+            <param name="bmp">The WriteableBitmap.</param>\r
+            <param name="index">The coordinate index.</param>\r
+            <param name="a">The alpha value of the color.</param>\r
+            <param name="r">The red value of the color.</param>\r
+            <param name="g">The green value of the color.</param>\r
+            <param name="b">The blue value of the color.</param>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.SetPixel(System.Windows.Media.Imaging.WriteableBitmap,System.Int32,System.Int32,System.Byte,System.Byte,System.Byte,System.Byte)">\r
+            <summary>\r
+            Sets the color of the pixel including the alpha value.\r
+            </summary>\r
+            <param name="bmp">The WriteableBitmap.</param>\r
+            <param name="x">The x coordinate (row).</param>\r
+            <param name="y">The y coordinate (column).</param>\r
+            <param name="a">The alpha value of the color.</param>\r
+            <param name="r">The red value of the color.</param>\r
+            <param name="g">The green value of the color.</param>\r
+            <param name="b">The blue value of the color.</param>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.SetPixeli(System.Windows.Media.Imaging.WriteableBitmap,System.Int32,System.Windows.Media.Color)">\r
+            <summary>\r
+            Sets the color of the pixel using a precalculated index (faster).\r
+            </summary>\r
+            <param name="bmp">The WriteableBitmap.</param>\r
+            <param name="index">The coordinate index.</param>\r
+            <param name="color">The color.</param>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.SetPixel(System.Windows.Media.Imaging.WriteableBitmap,System.Int32,System.Int32,System.Windows.Media.Color)">\r
+            <summary>\r
+            Sets the color of the pixel.\r
+            </summary>\r
+            <param name="bmp">The WriteableBitmap.</param>\r
+            <param name="x">The x coordinate (row).</param>\r
+            <param name="y">The y coordinate (column).</param>\r
+            <param name="color">The color.</param>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.SetPixeli(System.Windows.Media.Imaging.WriteableBitmap,System.Int32,System.Byte,System.Windows.Media.Color)">\r
+            <summary>\r
+            Sets the color of the pixel using an extra alpha value and a precalculated index (faster).\r
+            </summary>\r
+            <param name="bmp">The WriteableBitmap.</param>\r
+            <param name="index">The coordinate index.</param>\r
+            <param name="a">The alpha value of the color.</param>\r
+            <param name="color">The color.</param>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.SetPixel(System.Windows.Media.Imaging.WriteableBitmap,System.Int32,System.Int32,System.Byte,System.Windows.Media.Color)">\r
+            <summary>\r
+            Sets the color of the pixel using an extra alpha value.\r
+            </summary>\r
+            <param name="bmp">The WriteableBitmap.</param>\r
+            <param name="x">The x coordinate (row).</param>\r
+            <param name="y">The y coordinate (column).</param>\r
+            <param name="a">The alpha value of the color.</param>\r
+            <param name="color">The color.</param>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.SetPixeli(System.Windows.Media.Imaging.WriteableBitmap,System.Int32,System.Int32)">\r
+            <summary>\r
+            Sets the color of the pixel using a precalculated index (faster).\r
+            </summary>\r
+            <param name="bmp">The WriteableBitmap.</param>\r
+            <param name="index">The coordinate index.</param>\r
+            <param name="color">The color.</param>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.SetPixel(System.Windows.Media.Imaging.WriteableBitmap,System.Int32,System.Int32,System.Int32)">\r
+            <summary>\r
+            Sets the color of the pixel.\r
+            </summary>\r
+            <param name="bmp">The WriteableBitmap.</param>\r
+            <param name="x">The x coordinate (row).</param>\r
+            <param name="y">The y coordinate (column).</param>\r
+            <param name="color">The color.</param>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.DrawBezier(System.Windows.Media.Imaging.WriteableBitmap,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Windows.Media.Color)">\r
+            <summary>\r
+            Draws a cubic Beziér spline defined by start, end and two control points.\r
+            </summary>\r
+            <param name="bmp">The WriteableBitmap.</param>\r
+            <param name="x1">The x-coordinate of the start point.</param>\r
+            <param name="y1">The y-coordinate of the start point.</param>\r
+            <param name="cx1">The x-coordinate of the 1st control point.</param>\r
+            <param name="cy1">The y-coordinate of the 1st control point.</param>\r
+            <param name="cx2">The x-coordinate of the 2nd control point.</param>\r
+            <param name="cy2">The y-coordinate of the 2nd control point.</param>\r
+            <param name="x2">The x-coordinate of the end point.</param>\r
+            <param name="y2">The y-coordinate of the end point.</param>\r
+            <param name="color">The color.</param>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.DrawBezier(System.Windows.Media.Imaging.WriteableBitmap,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32)">\r
+            <summary>\r
+            Draws a cubic Beziér spline defined by start, end and two control points.\r
+            </summary>\r
+            <param name="bmp">The WriteableBitmap.</param>\r
+            <param name="x1">The x-coordinate of the start point.</param>\r
+            <param name="y1">The y-coordinate of the start point.</param>\r
+            <param name="cx1">The x-coordinate of the 1st control point.</param>\r
+            <param name="cy1">The y-coordinate of the 1st control point.</param>\r
+            <param name="cx2">The x-coordinate of the 2nd control point.</param>\r
+            <param name="cy2">The y-coordinate of the 2nd control point.</param>\r
+            <param name="x2">The x-coordinate of the end point.</param>\r
+            <param name="y2">The y-coordinate of the end point.</param>\r
+            <param name="color">The color.</param>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.DrawBeziers(System.Windows.Media.Imaging.WriteableBitmap,System.Int32[],System.Windows.Media.Color)">\r
+            <summary>\r
+            Draws a series of cubic Beziér splines each defined by start, end and two control points. \r
+            The ending point of the previous curve is used as starting point for the next. \r
+            Therfore the inital curve needs four points and the subsequent 3 (2 control and 1 end point).\r
+            </summary>\r
+            <param name="bmp">The WriteableBitmap.</param>\r
+            <param name="points">The points for the curve in x and y pairs, therefore the array is interpreted as (x1, y1, cx1, cy1, cx2, cy2, x2, y2, cx3, cx4 ..., xn, yn).</param>\r
+            <param name="color">The color for the spline.</param>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.DrawBeziers(System.Windows.Media.Imaging.WriteableBitmap,System.Int32[],System.Int32)">\r
+            <summary>\r
+            Draws a series of cubic Beziér splines each defined by start, end and two control points. \r
+            The ending point of the previous curve is used as starting point for the next. \r
+            Therfore the inital curve needs four points and the subsequent 3 (2 control and 1 end point).\r
+            </summary>\r
+            <param name="bmp">The WriteableBitmap.</param>\r
+            <param name="points">The points for the curve in x and y pairs, therefore the array is interpreted as (x1, y1, cx1, cy1, cx2, cy2, x2, y2, cx3, cx4 ..., xn, yn).</param>\r
+            <param name="color">The color for the spline.</param>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.DrawCurve(System.Windows.Media.Imaging.WriteableBitmap,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Single,System.Int32)">\r
+            <summary>\r
+            Draws a Cardinal spline (cubic) defined by four control points.\r
+            </summary>\r
+            <param name="bmp">The WriteableBitmap.</param>\r
+            <param name="x1">The x-coordinate of the 1st control point.</param>\r
+            <param name="y1">The y-coordinate of the 1st control point.</param>\r
+            <param name="x2">The x-coordinate of the 2nd control point.</param>\r
+            <param name="y2">The y-coordinate of the 2nd control point.</param>\r
+            <param name="x3">The x-coordinate of the 3rd control point.</param>\r
+            <param name="y3">The y-coordinate of the 3rd control point.</param>\r
+            <param name="x4">The x-coordinate of the 4th control point.</param>\r
+            <param name="y4">The y-coordinate of the 4th control point.</param>\r
+            <param name="tension">The tension of the curve defines the shape. Usually between 0 and 1. 0 would be a straight line.</param>\r
+            <param name="color">The color.</param>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.DrawCurve(System.Windows.Media.Imaging.WriteableBitmap,System.Int32[],System.Single,System.Windows.Media.Color)">\r
+            <summary>\r
+            Draws a Cardinal spline (cubic) defined by a point collection. \r
+            The cardinal spline passes through each point in the collection.\r
+            </summary>\r
+            <param name="bmp">The WriteableBitmap.</param>\r
+            <param name="points">The points for the curve in x and y pairs, therefore the array is interpreted as (x1, y1, x2, y2, x3, y3, x4, y4, x1, x2 ..., xn, yn).</param>\r
+            <param name="tension">The tension of the curve defines the shape. Usually between 0 and 1. 0 would be a straight line.</param>\r
+            <param name="color">The color for the spline.</param>\r
+        </member>\r
+        <member name="M:System.Windows.Media.Imaging.WriteableBitmapExtensions.DrawCurve(System.Windows.Media.Imaging.WriteableBitmap,System.Int32[],System.Single,System.Int32)">\r
+            <summary>\r
+            Draws a Cardinal spline (cubic) defined by a point collection. \r
+            The cardinal spline passes through each point in the collection.\r
+            </summary>\r
+            <param name="bmp">The WriteableBitmap.</param>\r
+            <param name="points">The points for the curve in x and y pairs, therefore the array is interpreted as (x1, y1, x2, y2, x3, y3, x4, y4, x1, x2 ..., xn, yn).</param>\r
+            <param name="tension">The tension of the curve defines the shape. Usually between 0 and 1. 0 would be a straight line.</param>\r
+            <param name="color">The color for the spline.</param>\r
+        </member>\r
+        <member name="T:System.Windows.Media.Imaging.WriteableBitmapExtensions.BlendMode">\r
+            <summary>\r
+            The blending mode.\r
+            </summary>\r
+        </member>\r
+        <member name="F:System.Windows.Media.Imaging.WriteableBitmapExtensions.BlendMode.AlphaBlend">\r
+            <summary>\r
+            Alpha blendiing uses the alpha channel to combine the source and destination. \r
+            </summary>\r
+        </member>\r
+        <member name="F:System.Windows.Media.Imaging.WriteableBitmapExtensions.BlendMode.Additive">\r
+            <summary>\r
+            Additive blending adds the colors of the source and the destination.\r
+            </summary>\r
+        </member>\r
+        <member name="F:System.Windows.Media.Imaging.WriteableBitmapExtensions.BlendMode.Subtractive">\r
+            <summary>\r
+            Subtractive blending subtracts the source color from the destination.\r
+            </summary>\r
+        </member>\r
+        <member name="F:System.Windows.Media.Imaging.WriteableBitmapExtensions.BlendMode.Mask">\r
+            <summary>\r
+            Uses the source color as a mask.\r
+            </summary>\r
+        </member>\r
+        <member name="F:System.Windows.Media.Imaging.WriteableBitmapExtensions.BlendMode.Multiply">\r
+            <summary>\r
+            Multiplies the source color with the destination color.\r
+            </summary>\r
+        </member>\r
+        <member name="F:System.Windows.Media.Imaging.WriteableBitmapExtensions.BlendMode.None">\r
+            <summary>\r
+            No blending just copies the pixels from the source.\r
+            </summary>\r
+        </member>\r
+    </members>\r
+</doc>\r
diff --git a/dev3/WriteableBitmapEx/WriteableBitmapEx.dll b/dev3/WriteableBitmapEx/WriteableBitmapEx.dll
new file mode 100644 (file)
index 0000000..498272f
Binary files /dev/null and b/dev3/WriteableBitmapEx/WriteableBitmapEx.dll differ
diff --git a/dev3/WriteableBitmapEx/WriteableBitmapEx.pdb b/dev3/WriteableBitmapEx/WriteableBitmapEx.pdb
new file mode 100644 (file)
index 0000000..8ab76d3
Binary files /dev/null and b/dev3/WriteableBitmapEx/WriteableBitmapEx.pdb differ
diff --git a/dev3/psychlops/core/app/Class1.cs b/dev3/psychlops/core/app/Class1.cs
new file mode 100644 (file)
index 0000000..d0069f7
--- /dev/null
@@ -0,0 +1,14 @@
+\r
+\r
+namespace Psychlops\r
+{\r
+\r
+\r
+       public static class Main\r
+       {\r
+               public delegate void func();\r
+               public static Drawable drawable;\r
+       }\r
+\r
+\r
+}\r
diff --git a/dev3/psychlops/core/device/hid.cs b/dev3/psychlops/core/device/hid.cs
new file mode 100644 (file)
index 0000000..ff671b5
--- /dev/null
@@ -0,0 +1,88 @@
+using System;\r
+using System.Windows;\r
+using System.Windows.Controls;\r
+using System.Windows.Documents;\r
+using System.Windows.Input;\r
+\r
+\r
+namespace Psychlops\r
+{\r
+       public class HID\r
+       {\r
+               public struct Button\r
+               {\r
+                       private bool pushed_, released_, pressed_;\r
+                       public void down()\r
+                       {\r
+                               pushed_ = true;\r
+                               pressed_ = true;\r
+                       }\r
+                       public void up()\r
+                       {\r
+                               released_ = true;\r
+                               pressed_ = false;\r
+                       }\r
+                       public bool pushed() { bool tmp = pushed_; pushed_ = false;  return tmp; }\r
+                       public bool released() { bool tmp = released_; released_ = false; return tmp; }\r
+                       public bool pressed() { return pressed_; }\r
+               }\r
+       }\r
+\r
+       public class Keyboard\r
+       {\r
+               static public HID.Button\r
+                       esc, spc, rtn,\r
+                       left, right, up, down,\r
+                       comma, period,\r
+                       q,w,e,r,t,y,u,i,o,p,\r
+                       a,s,d,f,g,h,j,k,l,\r
+                       z,x,c,v,b,n,m,\r
+                       one, two, three, four, five, six, seven, eight, nine, zero,\r
+                       pad0, pad1, pad2, pad3, pad4, pad5, pad6, pad7, pad8, pad9;\r
+               static private System.Collections.Generic.Dictionary<System.Windows.Input.Key, HID.Button> map;\r
+               static public void Canvas_KeyUp(object sender, KeyEventArgs e)\r
+               {\r
+               }\r
+               static public void Canvas_KeyDown(object sender, KeyEventArgs e)\r
+               {\r
+               }\r
+       }\r
+\r
+       public class Mouse\r
+       {\r
+               static protected Point position_;\r
+               static internal System.Windows.UIElement _prime;\r
+               static public HID.Button left, right, middle;\r
+               static protected Point wheelDelta_;\r
+\r
+               static public Point position { get { return position_; } }\r
+               static public int x { get { return (int)position_.x; } }\r
+               static public int y { get { return (int)position_.y; } }\r
+               static public Point wheelDelta { get { return wheelDelta_; } }\r
+\r
+               static public void Canvas_MousePos(object sender, MouseEventArgs e)\r
+               {\r
+                       System.Windows.Point p = e.GetPosition(_prime);\r
+                       position_.set(p.X, p.Y);\r
+               }\r
+               static public void Canvas_LDown(object sender, MouseEventArgs e)\r
+               {\r
+                       left.down();\r
+                       System.Windows.Point p = e.GetPosition(_prime);\r
+                       position_.set(p.X, p.Y);\r
+               }\r
+               static public void Canvas_LUp(object sender, MouseEventArgs e)\r
+               {\r
+                       left.up();\r
+                       System.Windows.Point p = e.GetPosition(_prime);\r
+                       position_.set(p.X, p.Y);\r
+               }\r
+               static public void Canvas_MouseWheel(object sender, MouseWheelEventArgs e)\r
+               {\r
+                       wheelDelta_.y += e.Delta;\r
+                       System.Windows.Point p = e.GetPosition(_prime);\r
+                       position_.set(p.X, p.Y);\r
+               }\r
+       }\r
+\r
+}
\ No newline at end of file
diff --git a/dev3/psychlops/core/graphic/canvas.cs b/dev3/psychlops/core/graphic/canvas.cs
new file mode 100644 (file)
index 0000000..8dd4753
--- /dev/null
@@ -0,0 +1,113 @@
+using System;\r
+using System.Windows;\r
+using System.Windows.Controls;\r
+using System.Windows.Documents;\r
+using System.Windows.Input;\r
+using System.Windows.Media;\r
+using System.Windows.Media.Animation;\r
+using System.Windows.Media.Imaging;\r
+using System.Windows.Shapes;\r
+\r
+\r
+\r
+namespace Psychlops\r
+{\r
+\r
+       public class Canvas : Drawable\r
+       {\r
+               public static System.Windows.Controls.Image default_instance;\r
+               public static System.Windows.Controls.UserControl default_panel;\r
+               public static WriteableBitmap default_buffer; \r
+               System.Windows.Controls.Image instance;\r
+               System.Windows.Controls.UserControl panel; \r
+               WriteableBitmap buffer;\r
+\r
+               public Canvas(int wid, int hei)\r
+               {\r
+                       panel = default_panel;\r
+                       instance = default_instance;\r
+                       instance.Width = wid;\r
+                       instance.Height = hei;\r
+                       buffer = new WriteableBitmap((int)instance.Width, (int)instance.Height);\r
+                       instance.Source = buffer;\r
+                       instance.MouseMove += Mouse.Canvas_MousePos;\r
+                       instance.MouseLeftButtonDown += Mouse.Canvas_LDown;\r
+                       instance.MouseLeftButtonUp += Mouse.Canvas_LUp;\r
+                       instance.MouseWheel += Mouse.Canvas_MouseWheel;\r
+                       Mouse._prime = instance;\r
+                       Main.drawable = this;\r
+                       default_buffer = buffer;\r
+               }\r
+               public Canvas(int wid, int hei, System.Windows.Controls.Image target, System.Windows.Controls.UserControl system)\r
+               {\r
+                       panel = system;\r
+                       instance = target;\r
+                       instance.Width = wid;\r
+                       instance.Height = hei;\r
+                       buffer = new WriteableBitmap((int)instance.Width, (int)instance.Height);\r
+                       instance = target;\r
+                       instance.Source = buffer;\r
+                       instance.MouseMove += Mouse.Canvas_MousePos;\r
+                       instance.MouseLeftButtonDown += Mouse.Canvas_LDown;\r
+                       instance.MouseLeftButtonUp += Mouse.Canvas_LUp;\r
+                       instance.MouseWheel += Mouse.Canvas_MouseWheel;\r
+                       Mouse._prime = instance;\r
+                       Main.drawable = this;\r
+               }\r
+               public Point getCenter()\r
+               {\r
+                       return new Point(instance.Width/2.0, instance.Height/2.0, 0);\r
+               }\r
+\r
+               public void clear()\r
+               {\r
+                       buffer.Clear(Color.black);\r
+               }\r
+               public void clear(Color col)\r
+               {\r
+                       buffer.Clear(col);\r
+               }\r
+\r
+               public void pix(int x, int y, Color col)\r
+               {\r
+                       buffer.SetPixel(x, y, col);\r
+               }\r
+\r
+\r
+               public void line(Line drawee, Color col)\r
+               {\r
+                       buffer.DrawLine((int)drawee.begin.x, (int)drawee.begin.y, (int)drawee.end.x, (int)drawee.end.y, col);\r
+               }\r
+               public void rect(Rectangle drawee, Color col)\r
+               {\r
+                       buffer.DrawRectangle((int)drawee.v1.x, (int)drawee.v1.y, (int)drawee.v2.x, (int)drawee.v2.y, col);\r
+               }\r
+               public void ellipse(Ellipse drawee, Color col)\r
+               {\r
+                       buffer.DrawEllipse((int)(drawee.datum.x - drawee.xdiameter / 2), (int)(drawee.datum.y - drawee.ydiameter / 2), (int)(drawee.datum.x + drawee.xdiameter / 2), (int)(drawee.datum.y + drawee.ydiameter / 2), col);\r
+               }\r
+               public void polygon(Polygon drawee, Color col)\r
+               {\r
+                       int[] ps = new int[drawee.vertices.Count];\r
+                       int i=0;\r
+                       foreach (Point p in drawee.vertices)\r
+                       {\r
+                               ps[i] = (int)p.x; i++;\r
+                               ps[i] = (int)p.y; i++;\r
+                       }\r
+                       buffer.DrawPolyline(ps, col);\r
+               }\r
+               public void image(Image drawee)\r
+               {\r
+                       buffer.Blit(drawee.datum, drawee.buffer, drawee.self_rect, Colors.White, WriteableBitmapExtensions.BlendMode.None);\r
+               }\r
+\r
+\r
+               public void flip()\r
+               {\r
+                       buffer.Invalidate();\r
+               }\r
+       }\r
+\r
+\r
+}
\ No newline at end of file
diff --git a/dev3/psychlops/core/graphic/module.cs b/dev3/psychlops/core/graphic/module.cs
new file mode 100644 (file)
index 0000000..b21784c
--- /dev/null
@@ -0,0 +1,184 @@
+using System;\r
+using System.Windows;\r
+using System.Windows.Controls;\r
+using System.Windows.Documents;\r
+using System.Windows.Input;\r
+using System.Windows.Media;\r
+using System.Windows.Media.Animation;\r
+using System.Windows.Media.Imaging;\r
+using System.Windows.Shapes;\r
+\r
+\r
+\r
+namespace Psychlops\r
+{\r
+\r
+       public struct Point\r
+       {\r
+               public double x, y, z;\r
+               public Point(double dx, double dy, double dz)\r
+               {\r
+                       x = dx;\r
+                       y = dy;\r
+                       z = dz;\r
+               }\r
+               public Point(double dx, double dy)\r
+               {\r
+                       x = dx;\r
+                       y = dy;\r
+                       z = 0.0;\r
+               }\r
+               public Point set(double dx, double dy, double dz)\r
+               {\r
+                       x = dx;\r
+                       y = dy;\r
+                       z = dz;\r
+                       return this;\r
+               }\r
+               public Point set(double dx, double dy)\r
+               {\r
+                       x = dx;\r
+                       y = dy;\r
+                       z = 0.0;\r
+                       return this;\r
+               }\r
+\r
+               public static Point operator +(Point lhs, Point rhs)\r
+               {\r
+                       return new Point(lhs.x + rhs.x, lhs.y + rhs.y, lhs.z + rhs.z);\r
+               }\r
+               public static Point operator -(Point lhs, Point rhs)\r
+               {\r
+                       return new Point(lhs.x - rhs.x, lhs.y - rhs.y, lhs.z - rhs.z);\r
+               }\r
+               public static implicit operator System.Windows.Point(Point d)\r
+               {\r
+                       return new System.Windows.Point(d.x, d.y);\r
+               }\r
+       }\r
+\r
+\r
+       public struct Color\r
+       {\r
+               public double r, g, b, a;\r
+               public Color(double lum)\r
+               {\r
+                       r = g = b = lum;\r
+                       a = 1.0;\r
+               }\r
+               public Color(double red, double green, double blue, double alpha)\r
+               {\r
+                       r = red;\r
+                       g = green;\r
+                       b = blue;\r
+                       a = alpha;\r
+               }\r
+               public static implicit operator System.Windows.Media.Color(Color d)\r
+               {\r
+                       return System.Windows.Media.Color.FromArgb((byte)(d.a * 255), (byte)(d.r * 255), (byte)(d.g * 255), (byte)(d.b * 255));\r
+               }\r
+\r
+               public static readonly Color\r
+                       black = new Color(0, 0, 0, 1),\r
+                       red = new Color(1, 0, 0, 1),\r
+                       green = new Color(0, 1, 0, 1),\r
+                       blue = new Color(0, 0, 1, 1),\r
+                       yellow = new Color(1, 1, 0, 1),\r
+                       magenta = new Color(1, 0, 1, 1),\r
+                       cyan = new Color(0, 1, 1, 1),\r
+                       white = new Color(1, 1, 1, 1),\r
+                       gray = new Color(.5, .5, .5, 1);\r
+\r
+       }\r
+\r
+\r
+       public interface Drawable\r
+       {\r
+               Point getCenter();\r
+               void clear(Color col);\r
+               void pix(int x, int y, Color col);\r
+               void line(Line drawee, Color col);\r
+               void rect(Rectangle drawee, Color col);\r
+               void ellipse(Ellipse drawee, Color col);\r
+               void image(Image drawee);\r
+               void polygon(Polygon drawee, Color col);\r
+       }\r
+\r
+\r
+\r
+       public interface Figure\r
+       {\r
+               Figure shift(Point p);\r
+               Figure centering(Point p);\r
+               void draw();\r
+       }\r
+       public static class FigureExtention\r
+       {\r
+               public static Figure shift(this Figure target, double x, double y)\r
+               {\r
+                       return target.shift(new Point(x, y));\r
+               }\r
+               public static Figure centering(this Figure target)\r
+               {\r
+                       return target.centering(Main.drawable.getCenter());\r
+               }\r
+       }\r
+\r
+\r
+\r
+       public class Image : Figure\r
+       {\r
+               public WriteableBitmap buffer;\r
+               public Point datum;\r
+               public Rectangle self_rect;\r
+\r
+               public Image(int wid, int hei)\r
+               {\r
+                       buffer = new WriteableBitmap(wid, hei);\r
+                       self_rect = new Rectangle(wid, hei);\r
+               }\r
+\r
+               /*public Image shift(double x, double y)\r
+               {\r
+                       datum.x += x;\r
+                       datum.y += y;\r
+                       return this;\r
+               }*/\r
+               public Figure shift(Point p)\r
+               {\r
+                       datum += p;\r
+                       return this;\r
+               }\r
+               public Figure centering(Point p)\r
+               {\r
+                       datum.x = p.x - width / 2.0;\r
+                       datum.y = p.y - height / 2.0;\r
+                       return this;\r
+               }\r
+\r
+               public void pix(int x, int y, Color col)\r
+               {\r
+                       buffer.SetPixel(x, y, col);\r
+               }\r
+\r
+\r
+               public void field(System.Func<int,int,System.Windows.Media.Color> func)\r
+               {\r
+                       buffer.ForEach(func);\r
+               }\r
+               public void field(System.Func<int, int, System.Windows.Media.Color, System.Windows.Media.Color> func)\r
+               {\r
+                       buffer.ForEach(func);\r
+               }\r
+\r
+               public void draw()\r
+               {\r
+                       Main.drawable.image(this);\r
+               }\r
+\r
+               public double width  { get { return self_rect.width; } }\r
+               public double height { get { return self_rect.height; } }\r
+\r
+       }\r
+\r
+}
\ No newline at end of file
diff --git a/dev3/psychlops/core/graphic/shape.cs b/dev3/psychlops/core/graphic/shape.cs
new file mode 100644 (file)
index 0000000..71f33cb
--- /dev/null
@@ -0,0 +1,198 @@
+using System;\r
+using System.Windows;\r
+using System.Windows.Controls;\r
+using System.Windows.Documents;\r
+using System.Windows.Input;\r
+using System.Windows.Media;\r
+using System.Windows.Media.Animation;\r
+using System.Windows.Media.Imaging;\r
+using System.Windows.Shapes;\r
+\r
+\r
+\r
+namespace Psychlops{\r
+\r
+       public interface Shape : Figure\r
+       {\r
+       }\r
+       public static class ShapeExtention\r
+       {\r
+               /*\r
+               public static void draw(this Shape drawee)\r
+               {\r
+                       drawee.draw(Color.white);\r
+               }\r
+               */\r
+       }\r
+\r
+\r
+       public class Line : Shape\r
+       {\r
+               public Point begin, end;\r
+\r
+               public Line(Point v1, Point v2)\r
+               {\r
+                       begin = v1;\r
+                       end   = v2;\r
+               }\r
+\r
+               public Figure shift(Point p)\r
+               {\r
+                       begin += p;\r
+                       end   += p;\r
+                       return this;\r
+               }\r
+               public Figure centering(Point p)\r
+               {\r
+                       double h = width, v = height;\r
+                       begin.x = p.x - h / 2.0;\r
+                       begin.y = p.y - v / 2.0;\r
+                       end.x = begin.x + h;\r
+                       end.y = begin.y + v;\r
+                       return this;\r
+               }\r
+\r
+               public void draw(Color c)\r
+               {\r
+                       Main.drawable.line(this, c);\r
+               }\r
+               public void draw()\r
+               {\r
+                       Main.drawable.line(this, Color.white);\r
+               }\r
+\r
+               public double width { get { return Math.abs(begin.x - end.x); } }\r
+               public double height { get { return Math.abs(begin.y - end.y); } }\r
+\r
+               public static implicit operator System.Windows.Shapes.Line(Line d)\r
+               {\r
+                       var tmp = new System.Windows.Shapes.Line();\r
+                       tmp.X1 = d.begin.x;\r
+                       tmp.Y1 = d.begin.y;\r
+                       tmp.X2 = d.end.x;\r
+                       tmp.Y2 = d.end.y;\r
+                       return tmp;\r
+               }\r
+       }\r
+\r
+\r
+       public class Rectangle : Shape\r
+       {\r
+               public Point v1, v2;\r
+\r
+               public Rectangle()\r
+               {\r
+                       set(0,0);\r
+               }\r
+               public Rectangle(double wid, double hei)\r
+               {\r
+                       set(wid, hei);\r
+               }\r
+               \r
+               public Rectangle set(double wid, double hei)\r
+               {\r
+                       v1.set(0, 0, 0);\r
+                       v2.set(wid, hei, 0);\r
+                       return this;\r
+               }\r
+\r
+               public Figure shift(Point p)\r
+               {\r
+                       v1 += p;\r
+                       v2 += p;\r
+                       return this;\r
+               }\r
+               public Figure centering(Point p)\r
+               {\r
+                       double h = width, v = height;\r
+                       v1.x = p.x - h / 2.0;\r
+                       v1.y = p.y - v / 2.0;\r
+                       v2.x = v1.x + h;\r
+                       v2.y = v1.y + v;\r
+                       return this;\r
+               }\r
+\r
+               public void draw(Color c)\r
+               {\r
+                       Main.drawable.rect(this, c);\r
+               }\r
+               public void draw()\r
+               {\r
+                       Main.drawable.rect(this, Color.white);\r
+               }\r
+\r
+               public double width { get { return Math.abs(v1.x - v2.x); } }\r
+               public double height { get { return Math.abs(v1.y - v2.y); } }\r
+\r
+\r
+               public static implicit operator System.Windows.Rect(Rectangle d)\r
+               {\r
+                       return new System.Windows.Rect(d.v1.x, d.v1.y, d.v2.x, d.v2.y);\r
+               }\r
+\r
+       }\r
+\r
+\r
+       public class Ellipse : Shape\r
+       {\r
+               public Point datum;\r
+               public double xdiameter, ydiameter;\r
+\r
+               public Figure shift(Point p)\r
+               {\r
+                       datum += p;\r
+                       return this;\r
+               }\r
+               public Figure centering(Point p)\r
+               {\r
+                       datum = p;\r
+                       return this;\r
+               }\r
+\r
+               public void draw(Color c)\r
+               {\r
+                       Main.drawable.ellipse(this, c);\r
+               }\r
+               public void draw()\r
+               {\r
+                       Main.drawable.ellipse(this, Color.white);\r
+               }\r
+       }\r
+\r
+\r
+       public class Polygon : Shape\r
+       {\r
+               public Point datum;\r
+               public System.Collections.Generic.List<Point> vertices;\r
+\r
+               public Polygon()\r
+               {\r
+                       vertices = new System.Collections.Generic.List<Point>();\r
+               }\r
+               public Polygon append(Point p) { vertices.Add(p); return this; }\r
+               public Polygon append(double x, double y) { return append(new Point(x, y, 0.0)); }\r
+               public Polygon append(double x, double y, double z) { return append(new Point(x, y, z)); }\r
+\r
+\r
+               public Figure shift(Point p)\r
+               {\r
+                       datum += p;\r
+                       return this;\r
+               }\r
+               public Figure centering(Point p)\r
+               {\r
+                       datum = p;\r
+                       return this;\r
+               }\r
+\r
+               public void draw(Color c)\r
+               {\r
+                       Main.drawable.polygon(this, c);\r
+               }\r
+               public void draw()\r
+               {\r
+                       Main.drawable.polygon(this, Color.white);\r
+               }\r
+       }\r
+\r
+}
\ No newline at end of file
diff --git a/dev3/psychlops/core/math/util.cs b/dev3/psychlops/core/math/util.cs
new file mode 100644 (file)
index 0000000..3d451a8
--- /dev/null
@@ -0,0 +1,49 @@
+using System;\r
+\r
+namespace Psychlops\r
+{\r
+\r
+       public static class Math\r
+       {\r
+               public static readonly double PI = 3.14159265, E = 2.718281828459045;\r
+               public static double abs(double x)\r
+               {\r
+                       return System.Math.Abs(x);\r
+               }\r
+               public static double sin(double x)\r
+               {\r
+                       return System.Math.Sin(x);\r
+               }\r
+               public static double cos(double x)\r
+               {\r
+                       return System.Math.Cos(x);\r
+               }\r
+               public static double tan(double x)\r
+               {\r
+                       return System.Math.Tan(x);\r
+               }\r
+               public static double sqrt(double x)\r
+               {\r
+                       return System.Math.Sqrt(x);\r
+               }\r
+               public static double exp(double x)\r
+               {\r
+                       return System.Math.Exp(x);\r
+               }\r
+               public static double log(double x)\r
+               {\r
+                       return System.Math.Log(x);\r
+               }\r
+               public static double radius(double x, double y)\r
+               {\r
+                       return System.Math.Sqrt(x * x + y * y);\r
+               }\r
+\r
+\r
+               public static double gaussian(double x, double sigma)\r
+               {\r
+                       return exp(- (x*x) / (2*sigma*sigma));\r
+               }\r
+       }\r
+\r
+}
\ No newline at end of file
diff --git a/dev3/psychlops/extention/standard/widget.cs b/dev3/psychlops/extention/standard/widget.cs
new file mode 100644 (file)
index 0000000..21229f4
--- /dev/null
@@ -0,0 +1,17 @@
+using System;\r
+using System.Windows;\r
+using System.Windows.Controls;\r
+using System.Windows.Documents;\r
+using System.Windows.Input;\r
+using System.Windows.Media;\r
+using System.Windows.Media.Animation;\r
+using System.Windows.Media.Imaging;\r
+using System.Windows.Shapes;\r
+\r
+\r
+\r
+namespace Psychlops\r
+{\r
+\r
+\r
+}
\ No newline at end of file
diff --git a/dev3/psychlops/psychlops.cs b/dev3/psychlops/psychlops.cs
new file mode 100644 (file)
index 0000000..5f28270
--- /dev/null
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/test3/App.xaml b/test3/App.xaml
new file mode 100644 (file)
index 0000000..203356e
--- /dev/null
@@ -0,0 +1,8 @@
+<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"\r
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" \r
+             x:Class="PsychlopsSilverlight3test.App"\r
+             >\r
+    <Application.Resources>\r
+        \r
+    </Application.Resources>\r
+</Application>\r
diff --git a/test3/App.xaml.cs b/test3/App.xaml.cs
new file mode 100644 (file)
index 0000000..51613a1
--- /dev/null
@@ -0,0 +1,66 @@
+using System;\r
+using System.Collections.Generic;\r
+using System.Linq;\r
+using System.Net;\r
+using System.Windows;\r
+using System.Windows.Controls;\r
+using System.Windows.Documents;\r
+using System.Windows.Input;\r
+using System.Windows.Media;\r
+using System.Windows.Media.Animation;\r
+using System.Windows.Shapes;\r
+\r
+namespace PsychlopsSilverlight3test\r
+{\r
+       public partial class App : Application\r
+       {\r
+\r
+               public App()\r
+               {\r
+                       this.Startup += this.Application_Startup;\r
+                       this.Exit += this.Application_Exit;\r
+                       this.UnhandledException += this.Application_UnhandledException;\r
+\r
+                       InitializeComponent();\r
+               }\r
+\r
+               private void Application_Startup(object sender, StartupEventArgs e)\r
+               {\r
+                       this.RootVisual = new MainPage();\r
+               }\r
+\r
+               private void Application_Exit(object sender, EventArgs e)\r
+               {\r
+\r
+               }\r
+               private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)\r
+               {\r
+                       // アプリケーションがデバッガーの外側で実行されている場合、ブラウザーの\r
+                       // 例外メカニズムによって例外が報告されます。これにより、IE ではステータス バーに\r
+                       // 黄色の通知アイコンが表示され、Firefox にはスクリプト エラーが表示されます。\r
+                       if (!System.Diagnostics.Debugger.IsAttached)\r
+                       {\r
+\r
+                               // メモ : これにより、アプリケーションは例外がスローされた後も実行され続け、例外は\r
+                               // ハンドルされません。 \r
+                               // 実稼動アプリケーションでは、このエラー処理は、Web サイトにエラーを報告し、\r
+                               // アプリケーションを停止させるものに置換される必要があります。\r
+                               e.Handled = true;\r
+                               Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); });\r
+                       }\r
+               }\r
+               private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e)\r
+               {\r
+                       try\r
+                       {\r
+                               string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace;\r
+                               errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n");\r
+\r
+                               System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");");\r
+                       }\r
+                       catch (Exception)\r
+                       {\r
+                       }\r
+               }\r
+       }\r
+}\r
diff --git a/test3/MainPage.xaml b/test3/MainPage.xaml
new file mode 100644 (file)
index 0000000..1f1bbde
--- /dev/null
@@ -0,0 +1,9 @@
+<UserControl x:Class="PsychlopsSilverlight3test.MainPage"\r
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" \r
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"\r
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" \r
+    mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480">\r
+  <Grid x:Name="LayoutRoot">\r
+    <Image x:Name="image" Width="640" Height="480"/>\r
+  </Grid>\r
+</UserControl>\r
diff --git a/test3/MainPage.xaml.cs b/test3/MainPage.xaml.cs
new file mode 100644 (file)
index 0000000..d06eb7a
--- /dev/null
@@ -0,0 +1,83 @@
+using Psychlops;\r
+\r
+namespace PsychlopsSilverlight3test\r
+{\r
+       public partial class MainPage : System.Windows.Controls.UserControl\r
+       {\r
+               public System.ComponentModel.BackgroundWorker main_routine;\r
+               public System.Windows.Controls.Image master;\r
+               public MainPage()\r
+               {\r
+                       InitializeComponent();\r
+                       initialize();\r
+                       // Show fps counter\r
+                       Canvas.default_instance = image;\r
+                       System.Windows.Application.Current.Host.Settings.MaxFrameRate = 60;\r
+                       System.Windows.Application.Current.Host.Settings.EnableFrameRateCounter = true;\r
+                       System.Windows.Application.Current.Host.Settings.EnableCacheVisualization = true;\r
+                       System.Windows.Media.CompositionTarget.Rendering += new System.EventHandler(CompositionTarget_Rendering);\r
+                       //main_routine =  new System.ComponentModel.BackgroundWorker();\r
+                       //main_routine.DoWork += new System.ComponentModel.DoWorkEventHandler(psychlops_main);\r
+                       //main_routine.RunWorkerAsync();\r
+               }\r
+               int background;\r
+               private void backgroundWorker_DoWork(object sender, System.ComponentModel.DoWorkEventArgs args)\r
+               {\r
+                       while (true)\r
+                       {\r
+                               System.Threading.Thread.Sleep(10);\r
+                               background++;\r
+                       }\r
+               }\r
+\r
+               int frame;\r
+               private void CompositionTarget_Rendering(object sender, System.EventArgs e)\r
+               {\r
+                       frame++;\r
+                       //Canvas.default_buffer.Invalidate();\r
+                       trial();\r
+               }\r
+\r
+               Canvas cnvs;\r
+               Image img;\r
+               int isize = 100;\r
+               double tfreq = 1;\r
+               public void initialize()\r
+               {\r
+                       cnvs = new Canvas(500, 500, image, this);\r
+                       img = new Image(isize*2, isize*2);\r
+                       cnvs.clear(Color.gray);\r
+               }\r
+               public void trial()\r
+               {\r
+                       cnvs.clear(new Color(Mouse.left.pressed() ? 1.0 : 0.5));\r
+                       img.field(\r
+                               (x, y) => new Color(.5 + Math.gaussian(Math.radius(x - isize, y - isize), isize / 8.0) * .5 * Math.sin(frame*2*Math.PI/tfreq/60 + x / 3.0))\r
+                                       );\r
+                       img.centering(Mouse.position);\r
+                       //img.shift(1,0);\r
+                       img.draw();\r
+                       cnvs.flip();\r
+               }\r
+               /*\r
+               Canvas cnvs;\r
+               Rectangle[] rects;\r
+               double tfreq = 1;\r
+\r
+               public void initialize()\r
+               {\r
+                       cnvs = new Canvas(500, 500, image, this);\r
+                       rects = new Rectangle[100];\r
+                       for (int i = 0; i < rects.Length; i++) { rects[i] = new Rectangle(10,10); }\r
+                       cnvs.clear(Color.gray);\r
+               }\r
+               public void trial()\r
+               {\r
+                       cnvs.clear(new Color(Mouse.left.pressed() ? 1.0 : 0.5));\r
+                       foreach (Rectangle rect in rects) { rect.centering().shift(background,0).draw(); }\r
+                       cnvs.flip();\r
+               }\r
+               */\r
+       }\r
+}\r
+\r
diff --git a/test3/Properties/AppManifest.xml b/test3/Properties/AppManifest.xml
new file mode 100644 (file)
index 0000000..151cfa5
--- /dev/null
@@ -0,0 +1,7 @@
+<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment"\r
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"\r
+>\r
+    <Deployment.Parts>\r
+    </Deployment.Parts>\r
+    \r
+</Deployment>\r
diff --git a/test3/Properties/AssemblyInfo.cs b/test3/Properties/AssemblyInfo.cs
new file mode 100644 (file)
index 0000000..074953b
--- /dev/null
@@ -0,0 +1,35 @@
+using System.Reflection;\r
+using System.Runtime.CompilerServices;\r
+using System.Runtime.InteropServices;\r
+\r
+// アセンブリに関する一般情報は以下の属性セットをとおして制御されます。\r
+// アセンブリに関連付けられている情報を変更するには、\r
+// これらの属性値を変更してください。\r
+[assembly: AssemblyTitle("PsychlopsSilverlight3test")]\r
+[assembly: AssemblyDescription("")]\r
+[assembly: AssemblyConfiguration("")]\r
+[assembly: AssemblyCompany("")]\r
+[assembly: AssemblyProduct("PsychlopsSilverlight3test")]\r
+[assembly: AssemblyCopyright("Copyright ©  2010")]\r
+[assembly: AssemblyTrademark("")]\r
+[assembly: AssemblyCulture("")]\r
+\r
+// ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから\r
+// 見えなくなります。このアセンブリ内で COM から型にアクセスする必要がある場合は、\r
+// その型の ComVisible 属性を true に設定してください。\r
+[assembly: ComVisible(false)]\r
+\r
+// このプロジェクトが COM に公開される場合、次の GUID がタイプ ライブラリの ID になります。\r
+[assembly: Guid("631fa262-58de-42ab-ba9d-79cb7cf7e289")]\r
+\r
+// アセンブリのバージョン情報は、以下の 4 つの値で構成されています。\r
+//\r
+//      Major Version\r
+//      Minor Version \r
+//      Build Number\r
+//      Revision\r
+//\r
+// すべての値を指定するか、下のように '*' を使ってリビジョンおよびビルド番号を\r
+// 既定値にすることができます。\r
+[assembly: AssemblyVersion("1.0.0.0")]\r
+[assembly: AssemblyFileVersion("1.0.0.0")]\r
diff --git a/test3/PsychlopsSilverlight3test.csproj b/test3/PsychlopsSilverlight3test.csproj
new file mode 100644 (file)
index 0000000..d56b2aa
--- /dev/null
@@ -0,0 +1,102 @@
+<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <PropertyGroup>\r
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
+    <ProductVersion>9.0.30729</ProductVersion>\r
+    <SchemaVersion>2.0</SchemaVersion>\r
+    <ProjectGuid>{23080448-E8EF-4766-9ACE-4448C61931DB}</ProjectGuid>\r
+    <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>\r
+    <OutputType>Library</OutputType>\r
+    <AppDesignerFolder>Properties</AppDesignerFolder>\r
+    <RootNamespace>PsychlopsSilverlight3test</RootNamespace>\r
+    <AssemblyName>PsychlopsSilverlight3test</AssemblyName>\r
+    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>\r
+    <SilverlightApplication>true</SilverlightApplication>\r
+    <SupportedCultures>ja</SupportedCultures>\r
+    <XapOutputs>true</XapOutputs>\r
+    <GenerateSilverlightManifest>true</GenerateSilverlightManifest>\r
+    <XapFilename>PsychlopsSilverlight3test.xap</XapFilename>\r
+    <SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>\r
+    <SilverlightAppEntry>PsychlopsSilverlight3test.App</SilverlightAppEntry>\r
+    <TestPageFileName>TestPage.html</TestPageFileName>\r
+    <CreateTestPage>true</CreateTestPage>\r
+    <ValidateXaml>true</ValidateXaml>\r
+    <EnableOutOfBrowser>false</EnableOutOfBrowser>\r
+    <OutOfBrowserSettingsFile>Properties\OutOfBrowserSettings.xml</OutOfBrowserSettingsFile>\r
+    <UsePlatformExtensions>false</UsePlatformExtensions>\r
+    <ThrowErrorsInValidation>true</ThrowErrorsInValidation>\r
+    <LinkedServerProject>\r
+    </LinkedServerProject>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
+    <DebugSymbols>true</DebugSymbols>\r
+    <DebugType>full</DebugType>\r
+    <Optimize>false</Optimize>\r
+    <OutputPath>Bin\Debug</OutputPath>\r
+    <DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants>\r
+    <NoStdLib>true</NoStdLib>\r
+    <NoConfig>true</NoConfig>\r
+    <ErrorReport>prompt</ErrorReport>\r
+    <WarningLevel>4</WarningLevel>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
+    <DebugType>pdbonly</DebugType>\r
+    <Optimize>true</Optimize>\r
+    <OutputPath>Bin\Release</OutputPath>\r
+    <DefineConstants>TRACE;SILVERLIGHT</DefineConstants>\r
+    <NoStdLib>true</NoStdLib>\r
+    <NoConfig>true</NoConfig>\r
+    <ErrorReport>prompt</ErrorReport>\r
+    <WarningLevel>4</WarningLevel>\r
+  </PropertyGroup>\r
+  <ItemGroup>\r
+    <Reference Include="PsychlopsSilverlight3, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">\r
+      <SpecificVersion>False</SpecificVersion>\r
+      <HintPath>..\dev3\PsychlopsSilverlight3\Bin\Debug\PsychlopsSilverlight3.dll</HintPath>\r
+    </Reference>\r
+    <Reference Include="System.Windows" />\r
+    <Reference Include="mscorlib" />\r
+    <Reference Include="system" />\r
+    <Reference Include="System.Core" />\r
+    <Reference Include="System.Net" />\r
+    <Reference Include="System.Xml" />\r
+    <Reference Include="System.Windows.Browser" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <Compile Include="App.xaml.cs">\r
+      <DependentUpon>App.xaml</DependentUpon>\r
+    </Compile>\r
+    <Compile Include="MainPage.xaml.cs">\r
+      <DependentUpon>MainPage.xaml</DependentUpon>\r
+    </Compile>\r
+    <Compile Include="Properties\AssemblyInfo.cs" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ApplicationDefinition Include="App.xaml">\r
+      <SubType>Designer</SubType>\r
+      <Generator>MSBuild:MarkupCompilePass1</Generator>\r
+    </ApplicationDefinition>\r
+    <Page Include="MainPage.xaml">\r
+      <SubType>Designer</SubType>\r
+      <Generator>MSBuild:MarkupCompilePass1</Generator>\r
+    </Page>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <None Include="Properties\AppManifest.xml" />\r
+  </ItemGroup>\r
+  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\v3.0\Microsoft.Silverlight.CSharp.targets" />\r
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
+       Other similar extension points exist, see Microsoft.Common.targets.\r
+  <Target Name="BeforeBuild">\r
+  </Target>\r
+  <Target Name="AfterBuild">\r
+  </Target>\r
+  -->\r
+  <ProjectExtensions>\r
+    <VisualStudio>\r
+      <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">\r
+        <SilverlightProjectProperties />\r
+      </FlavorProperties>\r
+    </VisualStudio>\r
+  </ProjectExtensions>\r
+</Project>
\ No newline at end of file