예제 #1
0
        private void Render()
        {
            //WriteableBitmap x;

            //x.WritePixels()

            //Set image
            if (this.channel == 0)
            {
                this.Dispatcher.BeginInvoke(DispatcherPriority.Background, new Action(() =>
                {
                    RendererBitmapSourceDefault <float> renderer = new RendererBitmapSourceDefault <float>(new FunctionFloat32ToColorParula(0, 2));
                    BitmapSource result = renderer.Render(image);
                    //application.Channel0Image = result;
                }));
            }
            else
            {
                //this.Dispatcher.BeginInvoke(DispatcherPriority.Background, new Action(() =>
                //  { RendererBitmapSourceDefault<float> renderer = new RendererBitmapSourceDefault<float>(new FunctionFloat32ToColorASIST(0, 2));
                //      BitmapSource result = renderer.Render(image);
                //      application.Channel1Image = result;
                //  }));
            }
        }
예제 #2
0
        //SpectralAnaliser SpectralAnaliser1;

        public ModelApplication()
        {
            this.CommandStart = ReactiveCommand.Create(ExecuteStart);
            this.CommandStop  = ReactiveCommand.Create(ExecuteStop);

            RendererBitmapSourceDefault <float> renderer = new RendererBitmapSourceDefault <float>(new FunctionFloat32ToColorJet(0, 1));
            int block_size   = 4096; //4096 * 8;
            int block_stride = 4096; //4096 * 8;
            int size_x       = 256;
            int size_y       = 256;

            Channel0Image = renderer.Render(new ImageRaster2D <float>(256, 256));
            //Channel1Image = renderer.Render(new ImageRaster2D<float>(256, 256));

            TaskScheduler ui_context = TaskScheduler.FromCurrentSynchronizationContext();

            this.SpectralAnaliser0 = new SpectralAnaliser(this, 0, block_size, block_stride, size_x, size_y);
            this.SpectralAnaliser0.ExecuteStart();
        }