void OnCapturedPhotoToMemory(PhotoCaptureResult result, PhotoCaptureFrame photoCaptureFrame) { Debug.Log("2. TakePhotoAsync completed"); if (!result.success) { Debug.LogError("VerifyPhotoResult is incorrect"); return; } Debug.Log("3. Photo result verified"); try { Debug.Log("4. Uploaded ImageDataToTexture"); photoCaptureFrame.UploadImageDataToTexture(_targetTexture); Debug.Log("5. Set Pixels to UI Texture"); toShow.SetPixels(_targetTexture.GetPixels()); toShow.Apply(); Debug.Log("6. Sending texture to UI"); PhotoResultMethodHandler(toShow); _isPhotoBeingProcessed = false; } catch (Exception e) { Debug.LogError($"EXCEPTION: OnCapturedPhotoToMemory, {e.Message}"); } }
static private PhotoCaptureResult MakeCaptureResult(CaptureResultType resultType, long hResult) { PhotoCaptureResult result = new PhotoCaptureResult(); result.resultType = resultType; result.hResult = hResult; return(result); }
public void OnPhotoCaptureStart(PhotoCaptureResult result) { if (!result.success) { Debug.Log("Photo Capture Object Failed to initialize"); return; } Debug.Log("Photo Capture Object Started"); _canStartPhotoCapture = true; }
public void StopPhotoModeAsync(OnPhotoModeStoppedCallback onPhotoModeStoppedCallback) { CaptureBehaviour.Stop(); PhotoCaptureResult result = new PhotoCaptureResult(); result.resultType = CaptureResultType.Success; if (onPhotoModeStoppedCallback != null) { onPhotoModeStoppedCallback(result); } }
public void StartPhotoModeAsync(CameraParameters setupParams, OnPhotoModeStartedCallback onPhotoModeStartedCallback) { CaptureBehaviour.SetConfig(setupParams); CaptureBehaviour.Play(); PhotoCaptureResult result = new PhotoCaptureResult(); result.resultType = CaptureResultType.Success; if (onPhotoModeStartedCallback != null) { onPhotoModeStartedCallback(result); } }
public void StopPhotoModeAsync(OnPhotoModeStoppedCallback onPhotoModeStoppedCallback) { PhotoCaptureResult result = new PhotoCaptureResult(); try { m_CaptureContext.StopCaptureMode(); result.resultType = CaptureResultType.Success; onPhotoModeStoppedCallback?.Invoke(result); } catch (Exception) { result.resultType = CaptureResultType.UnknownError; onPhotoModeStoppedCallback?.Invoke(result); throw; } }
private static PhotoCaptureResult MakeCaptureResult(long hResult) { CaptureResultType success; PhotoCaptureResult result = new PhotoCaptureResult(); if (hResult == HR_SUCCESS) { success = CaptureResultType.Success; } else { success = CaptureResultType.UnknownError; } result.resultType = success; result.hResult = hResult; return(result); }
public void StartPhotoModeAsync(CameraParameters setupParams, OnPhotoModeStartedCallback onPhotoModeStartedCallback) { PhotoCaptureResult result = new PhotoCaptureResult(); try { setupParams.camMode = CamMode.PhotoMode; m_CaptureContext.StartCaptureMode(setupParams); m_CaptureContext.StartCapture(); result.resultType = CaptureResultType.Success; onPhotoModeStartedCallback?.Invoke(result); } catch (Exception) { result.resultType = CaptureResultType.UnknownError; onPhotoModeStartedCallback?.Invoke(result); throw; } }
static private PhotoCaptureResult MakeCaptureResult(long hResult) { PhotoCaptureResult result = new PhotoCaptureResult(); CaptureResultType resultType; if (hResult == HR_SUCCESS) { resultType = CaptureResultType.Success; } else { resultType = CaptureResultType.UnknownError; } result.resultType = resultType; result.hResult = hResult; return(result); }
private static PhotoCaptureResult MakeCaptureResult(long hResult) { CaptureResultType success; PhotoCaptureResult result = new PhotoCaptureResult(); if (hResult == HR_SUCCESS) { success = CaptureResultType.Success; } else { success = CaptureResultType.UnknownError; } result.resultType = success; result.hResult = hResult; return result; }
public TakePhotoResult(PhotoCaptureResult captureResult, PhotoCaptureFrame frame) { CaptureResult = captureResult; Frame = frame; }