CameraParameters.cs 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /****************************************************************************
  2. * Copyright 2019 Nreal Techonology Limited. All rights reserved.
  3. *
  4. * This file is part of NRSDK.
  5. *
  6. * https://www.nreal.ai/
  7. *
  8. *****************************************************************************/
  9. namespace NRKernal.Record
  10. {
  11. /// <summary> A camera parameters. </summary>
  12. public struct CameraParameters
  13. {
  14. /// <summary> Constructor. </summary>
  15. /// <param name="webCamMode"> The web camera mode.</param>
  16. /// <param name="mode"> The mode.</param>
  17. public CameraParameters(CamMode webCamMode, BlendMode mode)
  18. {
  19. this.camMode = webCamMode;
  20. this.hologramOpacity = 1f;
  21. this.frameRate = NativeConstants.RECORD_FPS_DEFAULT;
  22. this.cameraResolutionWidth = 1280;
  23. this.cameraResolutionHeight = 720;
  24. this.pixelFormat = CapturePixelFormat.BGRA32;
  25. this.blendMode = mode;
  26. this.audioState = NRVideoCapture.AudioState.ApplicationAndMicAudio;
  27. this.mediaProjection = null;
  28. }
  29. /// <summary> The opacity of captured holograms. </summary>
  30. /// <value> The hologram opacity. </value>
  31. public float hologramOpacity { get; set; }
  32. /// <summary>
  33. /// The framerate at which to capture video. This is only for use with VideoCapture. </summary>
  34. /// <value> The frame rate. </value>
  35. public int frameRate { get; set; }
  36. /// <summary> A valid width resolution for use with the web camera. </summary>
  37. public int cameraResolutionWidth { get; set; }
  38. /// <summary> A valid height resolution for use with the web camera. </summary>
  39. /// <value> The height of the camera resolution. </value>
  40. public int cameraResolutionHeight { get; set; }
  41. /// <summary> The pixel format used to capture and record your image data. </summary>
  42. public CapturePixelFormat pixelFormat { get; set; }
  43. /// <summary> The camera mode of capture. </summary>
  44. /// <value> The camera mode. </value>
  45. public CamMode camMode { get; set; }
  46. /// <summary> The audio state of capture. </summary>
  47. public NRVideoCapture.AudioState audioState { get; set; }
  48. public bool CaptureAudioMic { get { return audioState == NRVideoCapture.AudioState.MicAudio || audioState == NRVideoCapture.AudioState.ApplicationAndMicAudio; }}
  49. public bool CaptureAudioApplication { get { return audioState == NRVideoCapture.AudioState.ApplicationAudio || audioState == NRVideoCapture.AudioState.ApplicationAndMicAudio; }}
  50. /// <summary> The android MediaProjection object. </summary>
  51. public UnityEngine.AndroidJavaObject mediaProjection { get; set; }
  52. /// <summary> The blend mode of camera output. </summary>
  53. public BlendMode blendMode { get; set; }
  54. }
  55. }