public double Cat02_CLM() { PixelDouble p = ReadPixs(Illuminant.L50, Register.Full, FileType.Ave, Area.Full); return(p.Ave()); }
static void Main(string[] args) { //PixelDouble p = new PixelDouble(new double[] { 1, 2, 3, 4 }, 2, 2); PixelDouble p = new PixelDouble(10000, 10000); System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch(); PixelScripting.hostObject_ obj = new PixelScripting.hostObject_() { pixel = p }; Console.WriteLine($"{p[0]}"); Console.WriteLine($"{p[1]}"); Console.WriteLine($"{p[2]}"); Console.WriteLine($"{p[3]}"); Console.WriteLine($"{p.Ave()}"); Vector4[] a = new Vector4[10000 * 10000 / 4]; for (int i = 0; i < 10000 * 10000 / 4; i++) { a[i] = new Vector4(0, 1, 2, 3); } sw.Start(); //for (int i = 0; i < 3; i++) //{ // p = p - p; //} for (int j = 0; j < 3; j++) { for (int i = 0; i < a.Length; i++) { a[i] = a[i] + a[i]; //234はやい } } sw.Stop(); Console.WriteLine(sw.Elapsed.TotalMilliseconds); Console.WriteLine("Scripting : "); for (;;) { Console.Write("> "); var str = Console.ReadLine(); if (str == "quit") { break; } try { var result = PixelScripting.Run(str, obj); } catch { Console.WriteLine("Script Err."); } } }