public override void Activate(bool instancePreserved) { if (!instancePreserved) { videoCapture = ScreenManager.Game.Services.GetService(typeof(IVideoCaptureService)) as IVideoCaptureService; if (null == videoCapture) { throw new Exception("IVideoCaptureService is not available"); } config = ScreenManager.Game.Services.GetService(typeof(IConfigurationService)) as IConfigurationService; if (null == config) { throw new Exception("IConfigurationService is not available"); } spriteBatch = ScreenManager.SpriteBatch; swapRBEffect = ScreenManager.Game.Content.Load <Effect>("Effects/SwapRB"); fullscreenRectangle = new Rectangle(0, 0, videoCapture.Width, videoCapture.Height); if (config.GetBool("CameraSetup", "Mirror")) { spriteEffects = SpriteEffects.FlipVertically | SpriteEffects.FlipHorizontally; } else { spriteEffects = SpriteEffects.FlipVertically; } } }
protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); videoCapture = (IVideoCaptureService)Services.GetService(typeof(IVideoCaptureService)); fullscreen = new Rectangle(0, 0, GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height); swapRBEffect = Content.Load <Effect>("SwapRB"); }
public ApplicationCommands(IVideoCaptureService videoCaptureService, IFaceDetector faceDetector, IMediator mediator) { _videoCaptureService = videoCaptureService; _faceDetector = faceDetector; _mediator = mediator; }
public override void Initialize() { videoCapture = Game.Services.GetService(typeof(IVideoCaptureService)) as IVideoCaptureService; if (null == videoCapture) throw new Exception("IVideoCaptureService is not available"); config = Game.Services.GetService(typeof(IConfigurationService)) as IConfigurationService; if (null == config) throw new Exception("IConfigurationService is not available"); InitializeAR(videoCapture.GrayWidth, videoCapture.GrayHeight); videoCapture.NewFrame += videoCapture_NewFrame; base.Initialize(); }
public override void Initialize() { videoCapture = Game.Services.GetService(typeof(IVideoCaptureService)) as IVideoCaptureService; if (null == videoCapture) { throw new Exception("IVideoCaptureService is not available"); } config = Game.Services.GetService(typeof(IConfigurationService)) as IConfigurationService; if (null == config) { throw new Exception("IConfigurationService is not available"); } InitializeAR(videoCapture.GrayWidth, videoCapture.GrayHeight); videoCapture.NewFrame += videoCapture_NewFrame; base.Initialize(); }
public override void Activate(bool instancePreserved) { if (!instancePreserved) { videoCapture = ScreenManager.Game.Services.GetService(typeof(IVideoCaptureService)) as IVideoCaptureService; if (null == videoCapture) throw new Exception("IVideoCaptureService is not available"); config = ScreenManager.Game.Services.GetService(typeof(IConfigurationService)) as IConfigurationService; if (null == config) throw new Exception("IConfigurationService is not available"); spriteBatch = ScreenManager.SpriteBatch; swapRBEffect = ScreenManager.Game.Content.Load<Effect>("Effects/SwapRB"); fullscreenRectangle = new Rectangle(0, 0, videoCapture.Width, videoCapture.Height); if (config.GetBool("CameraSetup", "Mirror")) spriteEffects = SpriteEffects.FlipVertically | SpriteEffects.FlipHorizontally; else spriteEffects = SpriteEffects.FlipVertically; } }
public MainWindowViewModel(IVideoCaptureService videoCaptureService) { _videoCaptureService = videoCaptureService; }
public ApplicationCommands(IVideoCaptureService videoCaptureService) { _videoCaptureService = videoCaptureService; }