class_cameraserver.rst 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the CameraServer.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_CameraServer:
  6. CameraServer
  7. ============
  8. **Inherits:** :ref:`Object<class_Object>`
  9. Server keeping track of different cameras accessible in Godot.
  10. Description
  11. -----------
  12. The ``CameraServer`` keeps track of different cameras accessible in Godot. These are external cameras such as webcams or the cameras on your phone.
  13. It is notably used to provide AR modules with a video feed from the camera.
  14. **Note:** This class is currently only implemented on macOS and iOS. On other platforms, no :ref:`CameraFeed<class_CameraFeed>`\ s will be available.
  15. Methods
  16. -------
  17. +-------------------------------------+----------------------------------------------------------------------------------------------------------------+
  18. | void | :ref:`add_feed<class_CameraServer_method_add_feed>` **(** :ref:`CameraFeed<class_CameraFeed>` feed **)** |
  19. +-------------------------------------+----------------------------------------------------------------------------------------------------------------+
  20. | :ref:`Array<class_Array>` | :ref:`feeds<class_CameraServer_method_feeds>` **(** **)** |
  21. +-------------------------------------+----------------------------------------------------------------------------------------------------------------+
  22. | :ref:`CameraFeed<class_CameraFeed>` | :ref:`get_feed<class_CameraServer_method_get_feed>` **(** :ref:`int<class_int>` index **)** |
  23. +-------------------------------------+----------------------------------------------------------------------------------------------------------------+
  24. | :ref:`int<class_int>` | :ref:`get_feed_count<class_CameraServer_method_get_feed_count>` **(** **)** |
  25. +-------------------------------------+----------------------------------------------------------------------------------------------------------------+
  26. | void | :ref:`remove_feed<class_CameraServer_method_remove_feed>` **(** :ref:`CameraFeed<class_CameraFeed>` feed **)** |
  27. +-------------------------------------+----------------------------------------------------------------------------------------------------------------+
  28. Signals
  29. -------
  30. .. _class_CameraServer_signal_camera_feed_added:
  31. - **camera_feed_added** **(** :ref:`int<class_int>` id **)**
  32. Emitted when a :ref:`CameraFeed<class_CameraFeed>` is added (e.g. a webcam is plugged in).
  33. ----
  34. .. _class_CameraServer_signal_camera_feed_removed:
  35. - **camera_feed_removed** **(** :ref:`int<class_int>` id **)**
  36. Emitted when a :ref:`CameraFeed<class_CameraFeed>` is removed (e.g. a webcam is unplugged).
  37. Enumerations
  38. ------------
  39. .. _enum_CameraServer_FeedImage:
  40. .. _class_CameraServer_constant_FEED_RGBA_IMAGE:
  41. .. _class_CameraServer_constant_FEED_YCBCR_IMAGE:
  42. .. _class_CameraServer_constant_FEED_Y_IMAGE:
  43. .. _class_CameraServer_constant_FEED_CBCR_IMAGE:
  44. enum **FeedImage**:
  45. - **FEED_RGBA_IMAGE** = **0** --- The RGBA camera image.
  46. - **FEED_YCBCR_IMAGE** = **0** --- The `YCbCr <https://en.wikipedia.org/wiki/YCbCr>`__ camera image.
  47. - **FEED_Y_IMAGE** = **0** --- The Y component camera image.
  48. - **FEED_CBCR_IMAGE** = **1** --- The CbCr component camera image.
  49. Method Descriptions
  50. -------------------
  51. .. _class_CameraServer_method_add_feed:
  52. - void **add_feed** **(** :ref:`CameraFeed<class_CameraFeed>` feed **)**
  53. Adds the camera ``feed`` to the camera server.
  54. ----
  55. .. _class_CameraServer_method_feeds:
  56. - :ref:`Array<class_Array>` **feeds** **(** **)**
  57. Returns an array of :ref:`CameraFeed<class_CameraFeed>`\ s.
  58. ----
  59. .. _class_CameraServer_method_get_feed:
  60. - :ref:`CameraFeed<class_CameraFeed>` **get_feed** **(** :ref:`int<class_int>` index **)**
  61. Returns the :ref:`CameraFeed<class_CameraFeed>` corresponding to the camera with the given ``index``.
  62. ----
  63. .. _class_CameraServer_method_get_feed_count:
  64. - :ref:`int<class_int>` **get_feed_count** **(** **)**
  65. Returns the number of :ref:`CameraFeed<class_CameraFeed>`\ s registered.
  66. ----
  67. .. _class_CameraServer_method_remove_feed:
  68. - void **remove_feed** **(** :ref:`CameraFeed<class_CameraFeed>` feed **)**
  69. Removes the specified camera ``feed``.
  70. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  71. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  72. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`