EditorCameraDataProvider.cs 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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
  10. {
  11. using System;
  12. /// <summary> An editor camera data provider. </summary>
  13. public class EditorCameraDataProvider : ICameraDataProvider
  14. {
  15. /// <summary> Creates a new bool. </summary>
  16. /// <returns> True if it succeeds, false if it fails. </returns>
  17. public bool Create()
  18. {
  19. return true;
  20. }
  21. /// <summary> Destroys the image described by imageHandle. </summary>
  22. /// <param name="imageHandle"> Handle of the image.</param>
  23. /// <returns> True if it succeeds, false if it fails. </returns>
  24. public bool DestroyImage(ulong imageHandle)
  25. {
  26. return true;
  27. }
  28. /// <summary> Gets hmd time nanos. </summary>
  29. /// <param name="imageHandle"> Handle of the image.</param>
  30. /// <param name="eye"> The eye.</param>
  31. /// <returns> The hmd time nanos. </returns>
  32. public ulong GetHMDTimeNanos(ulong imageHandle, int eye)
  33. {
  34. return 0;
  35. }
  36. /// <summary> Get exposure time. </summary>
  37. /// <param name="imageHandle"> Handle of the image. </param>
  38. /// <param name="eye"> The eye. </param>
  39. /// <returns> Exposure time of the image. </returns>
  40. public UInt32 GetExposureTime(UInt64 imageHandle, int eye)
  41. {
  42. UInt32 exposureTime = 0;
  43. return exposureTime;
  44. }
  45. /// <summary> Get Gain. </summary>
  46. /// <param name="imageHandle"> Handle of the image. </param>
  47. /// <param name="eye"> The eye. </param>
  48. /// <returns> Gain of the image. </returns>
  49. public UInt32 GetGain(UInt64 imageHandle, int eye)
  50. {
  51. UInt32 gain = 0;
  52. return gain;
  53. }
  54. /// <summary> Gets raw data. </summary>
  55. /// <param name="imageHandle"> Handle of the image.</param>
  56. /// <param name="eye"> The eye.</param>
  57. /// <param name="ptr"> [in,out] The pointer.</param>
  58. /// <param name="size"> [in,out] The size.</param>
  59. /// <returns> True if it succeeds, false if it fails. </returns>
  60. public bool GetRawData(ulong imageHandle, int eye, ref IntPtr ptr, ref int size)
  61. {
  62. return true;
  63. }
  64. /// <summary> Gets a resolution. </summary>
  65. /// <param name="imageHandle"> Handle of the image.</param>
  66. /// <param name="eye"> The eye.</param>
  67. /// <returns> The resolution. </returns>
  68. public NativeResolution GetResolution(ulong imageHandle, int eye)
  69. {
  70. return new NativeResolution(1280, 720);
  71. }
  72. /// <summary> Releases this object. </summary>
  73. /// <returns> True if it succeeds, false if it fails. </returns>
  74. public bool Release()
  75. {
  76. return true;
  77. }
  78. /// <summary> Callback, called when the set capture. </summary>
  79. /// <param name="callback"> The callback.</param>
  80. /// <param name="userdata"> (Optional) The userdata.</param>
  81. /// <returns> True if it succeeds, false if it fails. </returns>
  82. public bool SetCaptureCallback(CameraImageCallback callback, ulong userdata = 0)
  83. {
  84. return true;
  85. }
  86. /// <summary> Sets image format. </summary>
  87. /// <param name="format"> Describes the format to use.</param>
  88. /// <returns> True if it succeeds, false if it fails. </returns>
  89. public bool SetImageFormat(CameraImageFormat format)
  90. {
  91. return true;
  92. }
  93. /// <summary> Starts a capture. </summary>
  94. /// <returns> True if it succeeds, false if it fails. </returns>
  95. public bool StartCapture()
  96. {
  97. return true;
  98. }
  99. /// <summary> Stops a capture. </summary>
  100. /// <returns> True if it succeeds, false if it fails. </returns>
  101. public bool StopCapture()
  102. {
  103. return true;
  104. }
  105. }
  106. }