public ImageProcessor(Size ImageSize) { try { Factory = new DirectCanvasFactory(); thresholdEffect = new ThresholdEffect(Factory); edgeEffect = new EdgeDetectEffect(Factory); unpackEffect = new UnpackDepthEffect(Factory); colorMapEffect = new ColorMapDepthEffect(Factory); InitLayers(ImageSize); } catch (Exception ex) { System.Diagnostics.Trace.WriteLine("Exception initializing ImageProcessor: " + ex.ToString()); } }
protected override bool VerifyInitOverride() { if (DepthFrame == null) { return false; } if (effectLayer == null) { effectLayer = Factory.CreateDrawingLayer(DepthFrame.Width, DepthFrame.Height); } if (effectLayer2 == null) { effectLayer2 = Factory.CreateDrawingLayer(DepthFrame.Width, DepthFrame.Height); } if (unpackEffect == null) { unpackEffect = new UnpackDepthEffect(Factory); } if (colorMapEffect == null) { colorMapEffect = new ColorMapDepthEffect(Factory); } if (rectBrushForeground == null) { rectBrushForeground = Factory.CreateSolidColorBrush(new Color4(1, 1, 1, 1)); } if (rectBrushBackground == null) { rectBrushBackground = Factory.CreateSolidColorBrush(new Color4(1, 0, 0, 0)); } return base.VerifyInitOverride(); }