static internal bool UnityARKit_cameraImage_tryGetConfiguration( int index, out CameraConfiguration configuration) { configuration = default(CameraConfiguration); return(false); }
/// <summary> /// Gets the list of camera output settings the camera supports, along with the current setting. /// </summary> /// <returns>The camera's supported camera output settings and the current one</returns> public (IReadOnlyList <string> Options, string Current) GetCameraOutputSettings() { CameraConfiguration config = ActiveCamera.Configuration; SelectionSetting setting = FindSetting <SelectionSetting>(CameraOutputTitle, config); return(setting.Options, setting.Value); }
void Start() { Debug.Assert(InputController != null); Subscribe(InputController); cameraConfiguration = (cameraConfiguration == null) ? GetComponent <CameraConfiguration>() : cameraConfiguration; Debug.Assert(cameraConfiguration != null); }
public IServiceProvider ConfigureServices(IServiceCollection services) { services.AddSerilog(); services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); services.AddSignalR(); // In production, the Angular files will be served from this directory services.AddSpaStaticFiles(configuration => { configuration.RootPath = "ClientApp/dist"; }); // Create the container builder. var builder = new ContainerBuilder(); builder.Populate(services); builder.RegisterType <DataHubBusAdapter>().AsImplementedInterfaces(); var coreConfiguration = new CoreConfiguration(); Configuration.Bind("CoreConfiguration", coreConfiguration); Core.Bootstrap.Configure(builder, new ConfigurationProgramAssemblyProvider(Configuration), coreConfiguration); var cameraConfiguration = new CameraConfiguration(); Configuration.Bind("CameraConfiguration", cameraConfiguration); builder.Register(x => cameraConfiguration).AsImplementedInterfaces(); Container = builder.Build(); return(new AutofacServiceProvider(Container)); }
void Update () { if (this.isLocalPlayer) { if (Input.GetButtonDown("Fire2")) { // Next camera. this.CycleCamera(1); } CameraConfiguration conf = this.camTargets[this.currentCamera]; Transform cam = Camera.main.transform; Vector3 diff = conf.target.position - cam.position; Debug.Log(diff.magnitude); if (diff.sqrMagnitude <= Mathf.Pow(this.jumpDistance, 2)) { Vector3 delta = Vector3.Lerp(cam.position, conf.target.position, conf.moveSpeed * Time.deltaTime) - cam.position; cam.GetComponent<CharacterController>().Move(delta); cam.rotation = Quaternion.Slerp(cam.rotation, conf.target.rotation, conf.rotateSpeed * Time.deltaTime); } else { cam.position = conf.target.position; } } }
public Crop(Vector2 position, Vector2 size) { cameraConfiguration = Engine.GetConfiguration <CameraConfiguration>(); referenceResolution = cameraConfiguration.ReferenceResolution; this.position = position; this.size = size == Vector2.zero ? referenceResolution : size; }
/// <summary> /// Sets the ISO setting on the camera. /// </summary> /// <param name="Iso">The new ISO setting</param> public void SetIso(string Iso) { CameraConfiguration config = ActiveCamera.Configuration; SelectionSetting setting = FindSetting <SelectionSetting>(IsoTitle, config); setting.Value = Iso; ActiveCamera.UpdateConfiguration(); }
/// <summary> /// Sets the exposure setting on the camera. /// </summary> /// <param name="Exposure">The new exposure setting</param> public void SetExposure(string Exposure) { CameraConfiguration config = ActiveCamera.Configuration; SelectionSetting setting = FindSetting <SelectionSetting>(ExposureTitle, config); setting.Value = Exposure; ActiveCamera.UpdateConfiguration(); }
/// <summary> /// Sets the image format setting on the camera. /// </summary> /// <param name="ImageFormat">The new image format setting</param> public void SetImageFormat(string ImageFormat) { CameraConfiguration config = ActiveCamera.Configuration; SelectionSetting setting = FindSetting <SelectionSetting>(ImageFormatTitle, config); setting.Value = ImageFormat; ActiveCamera.UpdateConfiguration(); }
/// <summary> /// Sets the camera output setting on the camera. /// </summary> /// <param name="CameraOutput">The new camera output setting</param> public void SetCameraOutput(string CameraOutput) { CameraConfiguration config = ActiveCamera.Configuration; SelectionSetting setting = FindSetting <SelectionSetting>(CameraOutputTitle, config); setting.Value = CameraOutput; ActiveCamera.UpdateConfiguration(); }
public void SetCameraConfiguration(CameraConfiguration configuration) { if (configuration == CameraConfiguration.Default) { m_YOffset = 2f; LerpSpeedY = 10f; } else if (configuration == CameraConfiguration.SlideSteep) { m_YOffset = -2f; LerpSpeedY = 3f; } }
public string jsonString() { if (m_camera == null) { printError(); return(""); } CameraConfiguration cc = CameraConfigurationFromCamera(m_camera); string json = cc.json(); return(json); }
public IActionResult UpdateCameraConfiguration(int deviceId, [FromBody] CameraConfiguration config) { try { _logger.LogInformation($"POST /v1/Device/{deviceId}/CameraConfiguration called"); var aquariumDevice = _aquariumService.UpdateDeviceCameraConfiguration(config); return(new OkObjectResult(aquariumDevice)); } catch (Exception ex) { _logger.LogError($"POST /v1/Device/{deviceId}/CameraConfiguration endpoint caught exception: { ex.Message } Details: { ex.ToString() }"); return(NotFound()); } }
/// <summary> /// Finds the setting in the given config with the provided title. /// </summary> /// <typeparam name="TSetting">The type of setting to find</typeparam> /// <param name="Title">The title of the desired setting</param> /// <param name="Configuration">The configuration to search</param> /// <returns>The setting if it was found, or null if it wasn't.</returns> private static TSetting FindSetting <TSetting>(string Title, CameraConfiguration Configuration) where TSetting : Setting { foreach (ConfigurationSection section in Configuration.Sections) { foreach (Setting setting in section.Settings) { if (setting.Title == Title) { return((TSetting)setting); } } } return(null); }
public byte[] TakePhoto(CameraConfiguration config) { config.Output = "temp.jpg"; if (_hostingEnvironment.IsDevelopment()) { return(System.IO.File.ReadAllBytes(config.Output)); } //Path.GetDirectoryName(config.Output); if (File.Exists(config.Output)) { File.Delete(config.Output); } _logger.LogInformation($"Taking Photo..."); $"/usr/bin/raspistill {config}".Bash(); return(System.IO.File.ReadAllBytes(config.Output)); }
public MainWindow() { InitializeComponent(); if (File.Exists(_bindingsFilename)) { try { _configuration = JsonConvert.DeserializeObject <CameraConfiguration>(File.ReadAllText(_bindingsFilename)); } catch (Exception e) { Debug.WriteLine(e); } } InitAsync(); }
public IActionResult TakePhoto([FromBody] CameraConfiguration configuration) { try { _logger.LogWarning($"POST /v1/TakePhoto called"); configuration.Output = "temp.jpg"; var photo = _deviceService.TakePhoto(configuration); _logger.LogWarning("Photo successfully taken"); return(File(photo, "image/jpeg")); } catch (Exception ex) { _logger.LogError($"POST /v1/TakePhoto endpoint caught exception: {ex.Message} Details: {ex.ToString()}"); _logger.LogError(ex.StackTrace); return(NotFound()); } }
public AquariumDevice UpdateDeviceCameraConfiguration(CameraConfiguration config) { var deviceToUpdate = _aquariumDao.GetAquariumDeviceById(0); deviceToUpdate.CameraConfiguration = config; var device = _aquariumDao.UpdateAquariumDevice(deviceToUpdate); //tell the pi try { ApplyUpdatedDevice(device.Id); } catch { _logger.LogError("Could not send update to devices."); } return(device); }
//[Test] public void CameraThreadConnectionTest() { Thread camServer = new Thread(new Listener().StartListening); camServer.Name = "CameraServer"; camServer.Start(); CameraConfiguration testConfig = new CameraConfiguration { #pragma warning disable 618 Address = NetworkHelpers.GrabIpv4(Dns.GetHostEntry(Dns.GetHostName())).Address, #pragma warning restore 618 Port = 11003, CamFileIdentity = "testCam", Id = -1 }; CameraSocket testSocket = new CameraSocket { DataSocket = new WSocket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp), Config = testConfig }; //start initialising the camera thread Assert.IsTrue(testSocket.Setup()); CameraThread threadTask = new CameraThread(testSocket); Thread camThread = new Thread(threadTask.Start); camThread.Name = "CameraThread"; camThread.Start(); //Tell the camera to send a test image threadTask.Request = CameraRequest.SendTestImage; Thread.Sleep(32); while (threadTask.Request != CameraRequest.Alive) { Thread.Sleep(10); } camThread.Join(); camServer.Join(); }
private SaveContainer.Data CreateDummyData(int entryAmount) { SaveContainer.Data data = new SaveContainer.Data(); List <CameraConfiguration> camConfigs = new List <CameraConfiguration>(); Random rand = new Random(); for (int i = 0; i < 12; i++) { CameraConfiguration newConfig = new CameraConfiguration(); newConfig.Address = (long)rand.Next(200000, int.MaxValue) * rand.Next(200000, int.MaxValue); newConfig.Id = rand.Next(); newConfig.Port = rand.Next(); newConfig.CamFileIdentity = "testCam" + i; camConfigs.Add(newConfig); } data.Cameras = camConfigs.ToArray(); return(data); }
public void GetterSetterTest() { CameraSocket testCameraSocket = new CameraSocket(); #region socket Assert.IsNull(testCameraSocket.DataSocket); WSocket testSocket = new WSocket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); testCameraSocket.DataSocket = testSocket; Assert.IsTrue(testCameraSocket.DataSocket != null); Assert.IsTrue(testCameraSocket.DataSocket.Equals(testSocket)); ISocket testSocketget = testCameraSocket.DataSocket; Assert.IsTrue(testSocket.Equals(testSocketget)); #endregion #region config CameraConfiguration camConfigTest = new CameraConfiguration { Id = 233, CamFileIdentity = "superTest string" }; Assert.IsNull(testCameraSocket.Config); testCameraSocket.Config = camConfigTest; Assert.IsTrue(testCameraSocket.Config.Id == 233); Assert.IsTrue(testCameraSocket.Config.CamFileIdentity == "superTest string"); #endregion }
public FirstResponseTask(Response response, CameraConfiguration configuration, int delay) { _response = response; _configuration = configuration; _delay = delay; }
public PedCameraActivity(CameraConfiguration cameraConfiguration) { _cameraConfiguration = cameraConfiguration; }
private void camera_config_Click(object sender, EventArgs e) { Camera c = GetCurrentCamera(); using (CameraConfiguration camConfig = new CameraConfiguration(c.FilePath, c.StartFrame, c.EndFrame, c.MinimumThresholds, c.MaximumThresholds, c.Iterations)) { camConfig.ShowDialog(); GetCurrentCamera().MinimumThresholds = camConfig.Minimum; GetCurrentCamera().MaximumThresholds = camConfig.Maximum; GetCurrentCamera().Iterations = camConfig.Iterations; GetCurrentCamera().FilePath = camConfig.FileName; GetCurrentCamera().StartFrame = camConfig.StartFrame; GetCurrentCamera().EndFrame = camConfig.EndFrame; UpdateGroupBox(GetCurrentFocusIndex()); } }
protected virtual void SelectCameraConfiguration(Window callingWindow) { CameraConfiguration cameraConfiguration = (CameraConfiguration)(((ComboBox)callingWindow).SelectedObject); switch (cameraConfiguration) { case CameraConfiguration.Default2D: SelectedObject.Orthogonal = true; SelectedObject.OrthogonalWidth = 800; SelectedObject.OrthogonalHeight = 600; break; case CameraConfiguration.Silverlight: SelectedObject.Orthogonal = true; SelectedObject.OrthogonalWidth = 800; SelectedObject.OrthogonalHeight = 600; break; case CameraConfiguration.Android2D_320X480: // 320 x 480 SelectedObject.Orthogonal = true; SelectedObject.OrthogonalWidth = 480; SelectedObject.OrthogonalHeight = 320; break; case CameraConfiguration.Android2D800: // 480 x 800 SelectedObject.Orthogonal = true; SelectedObject.OrthogonalWidth = 800; SelectedObject.OrthogonalHeight = 480; break; case CameraConfiguration.Android2D854: // 480 x 854 SelectedObject.Orthogonal = true; SelectedObject.OrthogonalWidth = 854; SelectedObject.OrthogonalHeight = 480; break; case CameraConfiguration.WindowsPhoneWVGA2DTall: //WVGA display 480 × 800 resolution SelectedObject.Orthogonal = true; SelectedObject.OrthogonalWidth = 480; SelectedObject.OrthogonalHeight = 800; break; case CameraConfiguration.WindowsPhoneWVGA2DWide: //WVGA display 480 × 800 resolution SelectedObject.Orthogonal = true; SelectedObject.OrthogonalWidth = 800; SelectedObject.OrthogonalHeight = 480; break; case CameraConfiguration.WindowsPhone3D: SelectedObject.Orthogonal = false; SelectedObject.FieldOfView = (float)System.Math.PI / 4.0f; SelectedObject.AspectRatio = 480 / 800.0f; break; } }
public WebcamController(IWebcamService webcamService, CameraConfiguration cameraConfiguration) { _webcamService = webcamService; _cameraConfiguration = cameraConfiguration; }
static internal bool UnityARKit_cameraImage_trySetConfiguration( CameraConfiguration configuration) { return(false); }
static internal extern bool UnityARKit_cameraImage_tryGetCurrentConfiguration( out CameraConfiguration configuration);
static internal extern bool UnityARKit_cameraImage_trySetConfiguration( CameraConfiguration configuration);
static internal extern bool UnityARKit_cameraImage_tryGetConfiguration( int index, out CameraConfiguration configuration);
public WebcamService(CameraConfiguration cameraConfiguration) { _cameraConfiguration = cameraConfiguration; }