Exemplo n.º 1
0
        //-----------------------------------------------------------------
        public void StartPhotoModeAsync(CameraParameters setupParams,
                                        OnPhotoModeStartedCallback onPhotoModeStartedCallback)
        {
            if (m_NativePtr == IntPtr.Zero)
            {
                throw new InvalidOperationException("You must create a Photo Capture Object before starting its photo mode.");
            }

            if (onPhotoModeStartedCallback == null)
            {
                throw new ArgumentException("onPhotoModeStartedCallback");
            }

            if (setupParams.cameraResolutionWidth == default(int) || setupParams.cameraResolutionHeight == default(int))
            {
                throw new ArgumentOutOfRangeException("setupParams", "The camera resolution must be set to a supported resolution.");
            }

            StartPhotoMode_Internal(m_NativePtr,
                                    onPhotoModeStartedCallback,
                                    setupParams.hologramOpacity,
                                    setupParams.frameRate,
                                    setupParams.cameraResolutionWidth,
                                    setupParams.cameraResolutionHeight,
                                    (int)setupParams.pixelFormat);
        }
Exemplo n.º 2
0
        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);
            }
        }
Exemplo n.º 3
0
        //-----------------------------------------------------------------
        public void StartPhotoModeAsync(CameraParameters setupParams,
                                        OnPhotoModeStartedCallback onPhotoModeStartedCallback)
        {
            if (onPhotoModeStartedCallback == null)
            {
                throw new ArgumentException("onPhotoModeStartedCallback");
            }

            if (setupParams.cameraResolutionWidth == default(int) || setupParams.cameraResolutionHeight == default(int))
            {
                throw new ArgumentOutOfRangeException("setupParams", "The camera resolution must be set to a supported resolution.");
            }

            StartPhotoMode_Internal(setupParams, onPhotoModeStartedCallback);
        }
        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;
            }
        }
Exemplo n.º 5
0
 public void StartPhotoModeAsync(CameraParameters setupParams, OnPhotoModeStartedCallback onPhotoModeStartedCallback)
 {
     if (this.m_NativePtr == IntPtr.Zero)
     {
         throw new InvalidOperationException("You must create a Photo Capture Object before starting its photo mode.");
     }
     if (onPhotoModeStartedCallback == null)
     {
         throw new ArgumentException("onPhotoModeStartedCallback");
     }
     if ((setupParams.cameraResolutionWidth == 0) || (setupParams.cameraResolutionHeight == 0))
     {
         throw new ArgumentOutOfRangeException("setupParams", "The camera resolution must be set to a supported resolution.");
     }
     this.StartPhotoMode_Internal(this.m_NativePtr, onPhotoModeStartedCallback, setupParams.hologramOpacity, setupParams.frameRate, setupParams.cameraResolutionWidth, setupParams.cameraResolutionHeight, (int) setupParams.pixelFormat);
 }
Exemplo n.º 6
0
 private extern void StartPhotoMode_Internal(IntPtr photoCaptureObj, OnPhotoModeStartedCallback onPhotoModeStartedCallback, float hologramOpacity, float frameRate, int cameraResolutionWidth, int cameraResolutionHeight, int pixelFormat);
Exemplo n.º 7
0
 private static void InvokeOnPhotoModeStartedDelegate(OnPhotoModeStartedCallback callback, long hResult)
 {
     callback(MakeCaptureResult(hResult));
 }
Exemplo n.º 8
0
 private extern void StartPhotoMode_Internal(IntPtr photoCaptureObj, OnPhotoModeStartedCallback onPhotoModeStartedCallback, float hologramOpacity, float frameRate, int cameraResolutionWidth, int cameraResolutionHeight, int pixelFormat);
Exemplo n.º 9
0
 private static void InvokeOnPhotoModeStartedDelegate(OnPhotoModeStartedCallback callback, long hResult)
 {
     callback(MakeCaptureResult(hResult));
 }
Exemplo n.º 10
0
 private extern void StartPhotoMode_Internal(CameraParameters setupParams, OnPhotoModeStartedCallback onPhotoModeStartedCallback);