public SunlitLTree(Game game, ICameraProvider cameraProvider, SunlightParameters sky, Vector3 position) : base(game) { _cameraProvider = cameraProvider; _sky = sky; _position = position; Content = game.Content; }
public TakePictureViewModel(ICameraProvider cameraProvider) { if (cameraProvider == null) { throw new ArgumentNullException("cameraProvider"); } TakePicture = new Command(async () => await TakePictureAsync()); this.cameraProvider = cameraProvider; }
async void proofButton_Clicked(object sender, System.EventArgs e) { try { ICameraProvider cameraProvider = DependencyService.Get <ICameraProvider>(); var myImage = await cameraProvider.AcquirePicture(); StreamImageSource streamImageSource = (StreamImageSource)myImage; System.Threading.CancellationToken cancellationToken = System.Threading.CancellationToken.None; Task <Stream> task = streamImageSource.Stream(cancellationToken); Stream stream = task.Result; var memoryStream = new MemoryStream(); stream.CopyTo(memoryStream); Console.WriteLine("Wrote The Stream" + memoryStream.ToArray().Length); base64String = DependencyService.Get <MyImageCompressor>().ImageCompressor(memoryStream.ToArray()); Console.WriteLine("base64 String : " + base64String); } catch (Exception CameraException) { //No camera presenet or no access provided.So, instead of crashing, let's not get the data. Console.WriteLine("Exception CameraException : " + CameraException); await DisplayAlert("No Camera Found!", "I could not get access to your camera.", "Ok"); } }
/// <summary> /// Initializes a new instance of the <see cref="MainPageViewModel"/> class. /// </summary> /// <param name="navigationService">Navigation service.</param> /// <param name="cameraProvider">Camera provider.</param> /// <param name="storageService">Phone storage service.</param> /// <param name="settingsProvider">Settings provider.</param> /// <exception cref="ArgumentNullException"> /// <paramref name="navigationService"/> is <see langword="null"/>. /// <para>-or-</para> /// <paramref name="cameraProvider"/> is <see langword="null"/>. /// <para>-or-</para> /// <paramref name="storageService"/> is <see langword="null"/>. /// <para>-or-</para> /// <paramref name="settingsProvider"/> is <see langword="null"/>. /// </exception> public MainPageViewModel(INavigationService navigationService, ICameraProvider cameraProvider, IStorageService storageService, ISettingsProvider settingsProvider) { if (navigationService == null) { throw new ArgumentNullException("navigationService"); } if (cameraProvider == null) { throw new ArgumentNullException("cameraProvider"); } if (storageService == null) { throw new ArgumentNullException("storageService"); } if (settingsProvider == null) { throw new ArgumentNullException("settingsProvider"); } this.navigationService = navigationService; this.cameraProvider = cameraProvider; this.storageService = storageService; this.settingsProvider = settingsProvider; this.items = new ObservableCollection <object>(); this.state = MainPageViewModelState.Unloaded; this.applicationSettings = settingsProvider.GetApplicationSettings(); this.cameraSettings = settingsProvider.GetCameraSettings(this.applicationSettings.CameraType); }
public ClickToMoveMovementController( IInputController inputController, ICameraProvider cameraProvider) { _inputController = inputController; _cameraProvider = cameraProvider; }
public IntroCarousel() { InitializeComponent(); this.cameraProvider = DependencyService.Get <ICameraProvider>(); TourButton.Clicked += (object sender, EventArgs e) => { this.CurrentPage = this.Children [1]; }; TweetButton.Clicked += async(object sender, EventArgs e) => { if (Device.OS == TargetPlatform.iOS) { await TakePictureAsync(); } var tweetText = "Just completed the @bitrise Mini Hack at #XamarinEvolve!"; DependencyService.Get <ISocialController> ().TweetWithItem(tweetText, this.PicturePath); }; this.CurrentPageChanged += (object sender, EventArgs e) => { if (this.CurrentPage == this.Children[0]) { DependencyService.Get <IAppearance> ().UpdateBackground(0.231, 0.764, 0.639); } else { DependencyService.Get <IAppearance> ().UpdateBackground(0.505, 0.317, 0.658); } }; }
/// <summary> /// Default constructor /// </summary> /// <param name="game"></param> /// <param name="cameraProvider"></param> /// <param name="heightmap"></param> /// <param name="world"></param> public TerrainMesh(Game game, ICameraProvider cameraProvider, Heightmap heightmap, Matrix world) : base(game) { Patches = new List<TerrainPatch>(); Heightmap = heightmap; _cameraProvider = cameraProvider; World = world; }
protected CategoryBuildProvider(ICameraProvider <TCamera, TCard> cameraProvider, ICameraModelProvider modelProvider, ICameraPlatformProvider platformProvider, ICameraValidator cameraValidator) { CameraProvider = cameraProvider; ModelProvider = modelProvider; PlatformProvider = platformProvider; CameraValidator = cameraValidator; }
public SunlitLTree(Game game, ICameraProvider cameraProvider, SunlightParameters sky, Vector3 position) : base(game) { _cameraProvider = cameraProvider; _sky = sky; _position = position; Content = game.Content; }
public WaypointMesh(Game game, ICameraProvider cameraProvider) : base("Models/waypoint", game, cameraProvider) { IsTwoSided = true; IsTransparent = true; IsSelfLit = true; Scale = Matrix.CreateScale(0.3f); }
/// <summary> /// Default constructor /// </summary> /// <param name="game"></param> /// <param name="cameraProvider"></param> /// <param name="heightmap"></param> /// <param name="world"></param> public TerrainMesh(Game game, ICameraProvider cameraProvider, Heightmap heightmap, Matrix world) : base(game) { Patches = new List <TerrainPatch>(); Heightmap = heightmap; _cameraProvider = cameraProvider; World = world; }
void RegisterCommands() { OnShowHidePassword = new Command(ShowHidePassword); OnRegisterUser = new Command(RegisterUser); cameraProvider = DependencyService.Get <ICameraProvider>(); TakePicture = new Command(async() => await TakePictureAsync()); this.cameraProvider = cameraProvider; }
public WaypointMesh(Game game, ICameraProvider cameraProvider) : base("Models/waypoint", game, cameraProvider) { IsTwoSided = true; IsTransparent = true; IsSelfLit = true; Scale = Matrix.CreateScale(0.3f); }
public CameraController(ICameraModelDetector cameraModelDetector, IFileCameraModelDetector fileCameraModelDetector, ICameraProvider cameraProvider, IDialogService dialogService, MainViewModel mainViewModel, IStepProvider stepProvider, string stepName, ILoggerFactory loggerFactory) : base(mainViewModel, stepProvider, stepName, loggerFactory) { CameraModelDetector = cameraModelDetector; FileCameraModelDetector = fileCameraModelDetector; CameraProvider = cameraProvider; DialogService = dialogService; }
public SkydomeComponent(Game game, ICameraProvider cameraProvider) : base(game) { _cameraProvider = cameraProvider; _game = game; _realTime = false; _parameters = new SunlightParameters(); _parameters.FogDensity = 0.0058f; }
public TerrainCollision(Game game, ICameraProvider cameraProvider) : base(game) { if (game == null || cameraProvider == null) throw new ArgumentNullException(); _cameraProvider = cameraProvider; World = new World(new CollisionSystemSAP()); }
public InstallActionProvider(MainViewModel mainViewModel, ISourceProvider sourceProvider, ICameraProvider cameraProvider, IServiceActivator serviceActivator) : base(mainViewModel, serviceActivator) { SourceProvider = sourceProvider; CameraProvider = cameraProvider; CategoryName = CameraViewModel.Info.Canon.FirmwareRevision > 0 ? "PS" : "EOS"; }
public SkydomeComponent(Game game, ICameraProvider cameraProvider) : base(game) { _cameraProvider = cameraProvider; _game = game; _realTime = false; _parameters = new SunlightParameters(); _parameters.FogDensity = 0.0058f; }
public Scene(ICameraProvider cameraProvider, IRayProvider rayProvider, ISceneConfigProvider configProvider, IObjectContainer container, IImageWriter writer, ILightningSourceProvider lightningProvider) { _cameraProvider = cameraProvider; _configProvider = configProvider; _rayProvider = rayProvider; _objContainer = container; _imageWriter = writer; _lightningProvider = lightningProvider; }
public TakePictureViewModel(ICameraProvider cameraProvider) { if (cameraProvider == null) { throw new ArgumentNullException("cameraProvider"); } TakePicture = new Command(async() => await TakePictureAsync()); this.cameraProvider = cameraProvider; }
protected BinarySoftwareDetectorBase(IEnumerable <IProductBinarySoftwareDetector> softwareDetectors, IBinaryDecoder binaryDecoder, IBootProvider bootProvider, ICameraProvider cameraProvider, ISoftwareHashProvider hashProvider, IOptions <SoftwareDetectorSettings> settings, ILogger logger) { Settings = settings.Value; Logger = logger; SoftwareDetectors = softwareDetectors; BinaryDecoder = binaryDecoder; BootProvider = bootProvider; CameraProvider = cameraProvider; HashProvider = hashProvider; }
public Forest(Game game, ICameraProvider cameraProvider, TerrainMesh terrain, SunlightParameters sky) : base(game) { if (game == null || cameraProvider == null || terrain == null) throw new ArgumentNullException(); _game = game; _cameraProvider = cameraProvider; _terrain = terrain; _sky = sky; _treePositions = new List<Vector3>(); }
public TerrainCollision(Game game, ICameraProvider cameraProvider) : base(game) { if (game == null || cameraProvider == null) { throw new ArgumentNullException(); } _cameraProvider = cameraProvider; World = new World(new CollisionSystemSAP()); }
protected InstallActionBase(MainViewModel mainViewModel, ICameraProvider cameraProvider, IDownloaderProvider downloaderProvider, ProductSource productSource) : base(mainViewModel) { CameraProvider = cameraProvider; DownloaderProvider = downloaderProvider; ProductSource = productSource; var distroName = string.Format("Distro_{0}", SourceName); var distroDisplayName = Resources.ResourceManager.GetString(distroName); DisplayName = string.Format(ActionFormat, distroDisplayName); }
public Forest(Game game, ICameraProvider cameraProvider, TerrainMesh terrain, SunlightParameters sky) : base(game) { if (game == null || cameraProvider == null || terrain == null) { throw new ArgumentNullException(); } _game = game; _cameraProvider = cameraProvider; _terrain = terrain; _sky = sky; _treePositions = new List <Vector3>(); }
//, Vector3 position) public TerrainComponent(Game game, ICameraProvider cameraProvider, SunlightParameters sunParams) : base(game) { if (game == null) throw new ArgumentNullException("game"); if (sunParams == null) throw new ArgumentNullException("sunParams"); if (cameraProvider == null) throw new ArgumentNullException("cameraProvider"); _cameraProvider = cameraProvider; _sunParams = sunParams; _content = new ContentManager(Game.Services); // Position = position; position does not have a function at the moment // TerrainMeshes = new List<TerrainMesh>(); }
public HelicopterBase(Game game, TestConfiguration testConfiguration, TerrainCollision collision, ICameraProvider cameraProvider, BasicEffect effect, SunlightParameters skyParams, HelicopterScenario scenario, bool playEngineSound, bool isPlayerControlled, bool drawText) : base(game) { if (game == null || cameraProvider == null || effect == null || skyParams == null) { throw new ArgumentNullException("", @"One or several of the necessary arguments were null!"); } _game = game; _testConfiguration = testConfiguration; _sensorSpecifications = testConfiguration.Sensors; _collision = collision; _flyBySensors = testConfiguration.FlyBySensors; if (_collision != null) { _collision.CollidedWithTerrain += gameTime => Crashed(gameTime); } _basicEffect = effect; _skyParams = skyParams; _scenario = scenario; _drawText = drawText; _cameraProvider = cameraProvider; IsPlayerControlled = isPlayerControlled; _playEngineSound = playEngineSound; _estimatedState = new HeliState(); PIDSetup pidSetup = SimulatorResources.GetPIDSetups()[0]; Autopilot = new Autopilot(_scenario.Task, pidSetup); Log = new List <HelicopterLogSnapshot>(); }
public SimpleModel(string modelName, Game game, ICameraProvider cameraProvider, SunlightParameters skyParams) : base(game) { _modelName = modelName; _cameraProvider = cameraProvider; _skyParams = skyParams; _fbxImportScale = Matrix.CreateScale(0.01f); // TODO Apply transformations to these later if they become needed CameraUp = Vector3.Up; CameraForward = Vector3.Forward; // Initial render transformation Position = Vector3.Zero; Rotation = Matrix.Identity; Scale = Matrix.Identity; IsTransparent = false; IsTwoSided = false; IsSelfLit = false; }
public SimpleModel(string modelName, Game game, ICameraProvider cameraProvider, SunlightParameters skyParams) : base(game) { _modelName = modelName; _cameraProvider = cameraProvider; _skyParams = skyParams; _fbxImportScale = Matrix.CreateScale(0.01f); // TODO Apply transformations to these later if they become needed CameraUp = Vector3.Up; CameraForward = Vector3.Forward; // Initial render transformation Position = Vector3.Zero; Rotation = Matrix.Identity; Scale = Matrix.Identity; IsTransparent = false; IsTwoSided = false; IsSelfLit = false; }
public static void SetupContextForRenderingCamToBuffer(OperatorPartContext context, Operator op, DefaultRenderer renderer, Matrix worldToCamera, float nearClipping = 0.01f, float farClipping = 10000) { context.D3DDevice.ImmediateContext.OutputMerger.SetTargets(context.DepthStencilView, context.RenderTargetView); context.D3DDevice.ImmediateContext.Rasterizer.SetViewport(context.Viewport); if (context.DepthStencilView != null) { context.D3DDevice.ImmediateContext.ClearDepthStencilView(context.DepthStencilView, DepthStencilClearFlags.Depth | DepthStencilClearFlags.Stencil, 1.0f, 0); } context.D3DDevice.ImmediateContext.ClearRenderTargetView(context.RenderTargetView, new Color4(0.4f, 0.4f, 0.4f, 1.0f)); context.D3DDevice.ImmediateContext.InputAssembler.InputLayout = context.InputLayout; if (op == null) { return; } ICameraProvider camOp = null; if (op.InternalParts.Count > 0) { camOp = op.InternalParts[0].Func as ICameraProvider; } if (camOp == null) { context.WorldToCamera = worldToCamera; float aspect = context.Viewport.Width / context.Viewport.Height; context.CameraProjection = Matrix.PerspectiveFovLH(3.1415f / 4.0f, aspect, nearClipping, farClipping); } else { context.WorldToCamera = camOp.GetLastWorldToCamera(); context.CameraProjection = camOp.GetLastCameraToView(); } }
public TerrainComponent(Game game, ICameraProvider cameraProvider, SunlightParameters sunParams)//, Vector3 position) : base(game) { if (game == null) { throw new ArgumentNullException("game"); } if (sunParams == null) { throw new ArgumentNullException("sunParams"); } if (cameraProvider == null) { throw new ArgumentNullException("cameraProvider"); } _cameraProvider = cameraProvider; _sunParams = sunParams; _content = new ContentManager(Game.Services); // Position = position; position does not have a function at the moment // TerrainMeshes = new List<TerrainMesh>(); }
public HelicopterBase(Game game, TestConfiguration testConfiguration, TerrainCollision collision, ICameraProvider cameraProvider, BasicEffect effect, SunlightParameters skyParams, HelicopterScenario scenario, bool playEngineSound, bool isPlayerControlled, bool drawText) : base(game) { if (game == null || cameraProvider == null || effect == null || skyParams == null) throw new ArgumentNullException("", @"One or several of the necessary arguments were null!"); _game = game; _testConfiguration = testConfiguration; _sensorSpecifications = testConfiguration.Sensors; _collision = collision; _flyBySensors = testConfiguration.FlyBySensors; if (_collision != null) _collision.CollidedWithTerrain += gameTime => Crashed(gameTime); _basicEffect = effect; _skyParams = skyParams; _scenario = scenario; _drawText = drawText; _cameraProvider = cameraProvider; IsPlayerControlled = isPlayerControlled; _playEngineSound = playEngineSound; _estimatedState = new HeliState(); PIDSetup pidSetup = SimulatorResources.GetPIDSetups()[0]; Autopilot = new Autopilot(_scenario.Task, pidSetup); Log = new List<HelicopterLogSnapshot>(); }
//------------------------------------------------------------------------------------------------------- #region PUBLIC METHODS //------------------------------------------------------------------------------------------------------- public CameraService(ILogService logService, ICameraProvider cameraProvider, IApplication application) { _logService = logService; _application = application; _cameraProvider = cameraProvider; }
public SceneProvider(ICameraProvider cameraProvider, ILightProvider lightProvider) { _cameraProvider = cameraProvider; _lightProvider = lightProvider; }
public UpdateAction(MainViewModel mainViewModel, ICameraProvider cameraProvider, IDownloaderProvider downloaderProvider, ProductSource productSource) : base(mainViewModel, cameraProvider, downloaderProvider, productSource) { }
/// <summary> /// Initializes a new instance of the <see cref="MainPageViewModel"/> class. /// </summary> /// <param name="navigationService">Navigation service.</param> /// <param name="cameraProvider">Camera provider.</param> /// <param name="storageService">Phone storage service.</param> /// <param name="settingsProvider">Settings provider.</param> /// <exception cref="ArgumentNullException"> /// <paramref name="navigationService"/> is <see langword="null"/>. /// <para>-or-</para> /// <paramref name="cameraProvider"/> is <see langword="null"/>. /// <para>-or-</para> /// <paramref name="storageService"/> is <see langword="null"/>. /// <para>-or-</para> /// <paramref name="settingsProvider"/> is <see langword="null"/>. /// </exception> public MainPageViewModel(INavigationService navigationService, ICameraProvider cameraProvider, IStorageService storageService, ISettingsProvider settingsProvider) { if (navigationService == null) { throw new ArgumentNullException("navigationService"); } if (cameraProvider == null) { throw new ArgumentNullException("cameraProvider"); } if (storageService == null) { throw new ArgumentNullException("storageService"); } if (settingsProvider == null) { throw new ArgumentNullException("settingsProvider"); } this.navigationService = navigationService; this.cameraProvider = cameraProvider; this.storageService = storageService; this.settingsProvider = settingsProvider; this.items = new ObservableCollection<object>(); this.state = MainPageViewModelState.Unloaded; this.applicationSettings = settingsProvider.GetApplicationSettings(); this.cameraSettings = settingsProvider.GetCameraSettings(this.applicationSettings.CameraType); }
public PsHashSoftwareDetector(IEnumerable <IProductBinarySoftwareDetector> softwareDetectors, IBinaryDecoder binaryDecoder, IBootProvider bootProvider, ICameraProvider cameraProvider, ISoftwareHashProvider hashProvider, IOptions <SoftwareDetectorSettings> settings, ILoggerFactory loggerFactory) : base(softwareDetectors, binaryDecoder, bootProvider, cameraProvider, hashProvider, settings, loggerFactory.CreateLogger <PsHashSoftwareDetector>()) { }
public KnownPsBinarySoftwareDetector(IEnumerable <IProductBinarySoftwareDetector> softwareDetectors, IBinaryDecoder binaryDecoder, IBootProvider bootProvider, ICameraProvider cameraProvider, ISoftwareHashProvider hashProvider, IOptions <SoftwareDetectorSettings> settings, ILoggerFactory loggerFactory) : base(softwareDetectors, binaryDecoder, bootProvider, cameraProvider, hashProvider, settings, loggerFactory.CreateLogger <KnownPsBinarySoftwareDetector>()) { Offsets = bootProvider.GetOffsets(CategoryName); }
public SimpleModel(string modelName, Game game, ICameraProvider cameraProvider) : this(modelName, game, cameraProvider, null) { }
public FlatTexturedGround(Game game, ICameraProvider cameraProvider) : base("Models/FlatTexturedGround", game, cameraProvider) { }
public CameraController(ICameraProvider provider) { this.provider = provider; }
public SimpleModel(string modelName, Game game, ICameraProvider cameraProvider) : this(modelName, game, cameraProvider, null) { }
public EosBuildProvider(ICameraProvider <EosCameraData, EosCardData> cameraProvider, ICameraModelProvider modelProvider, ICameraPlatformProvider platformProvider, ICameraValidator cameraValidator) : base(cameraProvider, modelProvider, platformProvider, cameraValidator) { }
protected PsBinarySoftwareDetector(IEnumerable <IProductBinarySoftwareDetector> softwareDetectors, IBinaryDecoder binaryDecoder, IBootProvider bootProvider, ICameraProvider cameraProvider, ISoftwareHashProvider hashProvider, IOptions <SoftwareDetectorSettings> settings, ILogger logger) : base(softwareDetectors, binaryDecoder, bootProvider, cameraProvider, hashProvider, settings, logger) { }
public KdTreeObjectContainer(IObjReader reader, ICameraProvider cameraProvider) { _reader = reader; _cameraProvider = cameraProvider; }