class_cameraserver.rst 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/4.2/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.2/doc/classes/CameraServer.xml.
  6. .. _class_CameraServer:
  7. CameraServer
  8. ============
  9. **Inherits:** :ref:`Object<class_Object>`
  10. Server keeping track of different cameras accessible in Godot.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. The **CameraServer** keeps track of different cameras accessible in Godot. These are external cameras such as webcams or the cameras on your phone.
  15. It is notably used to provide AR modules with a video feed from the camera.
  16. \ **Note:** This class is currently only implemented on macOS and iOS. On other platforms, no :ref:`CameraFeed<class_CameraFeed>`\ s will be available.
  17. .. rst-class:: classref-reftable-group
  18. Methods
  19. -------
  20. .. table::
  21. :widths: auto
  22. +---------------------------------------+----------------------------------------------------------------------------------------------------------------+
  23. | void | :ref:`add_feed<class_CameraServer_method_add_feed>` **(** :ref:`CameraFeed<class_CameraFeed>` feed **)** |
  24. +---------------------------------------+----------------------------------------------------------------------------------------------------------------+
  25. | :ref:`CameraFeed[]<class_CameraFeed>` | :ref:`feeds<class_CameraServer_method_feeds>` **(** **)** |
  26. +---------------------------------------+----------------------------------------------------------------------------------------------------------------+
  27. | :ref:`CameraFeed<class_CameraFeed>` | :ref:`get_feed<class_CameraServer_method_get_feed>` **(** :ref:`int<class_int>` index **)** |
  28. +---------------------------------------+----------------------------------------------------------------------------------------------------------------+
  29. | :ref:`int<class_int>` | :ref:`get_feed_count<class_CameraServer_method_get_feed_count>` **(** **)** |
  30. +---------------------------------------+----------------------------------------------------------------------------------------------------------------+
  31. | void | :ref:`remove_feed<class_CameraServer_method_remove_feed>` **(** :ref:`CameraFeed<class_CameraFeed>` feed **)** |
  32. +---------------------------------------+----------------------------------------------------------------------------------------------------------------+
  33. .. rst-class:: classref-section-separator
  34. ----
  35. .. rst-class:: classref-descriptions-group
  36. Signals
  37. -------
  38. .. _class_CameraServer_signal_camera_feed_added:
  39. .. rst-class:: classref-signal
  40. **camera_feed_added** **(** :ref:`int<class_int>` id **)**
  41. Emitted when a :ref:`CameraFeed<class_CameraFeed>` is added (e.g. a webcam is plugged in).
  42. .. rst-class:: classref-item-separator
  43. ----
  44. .. _class_CameraServer_signal_camera_feed_removed:
  45. .. rst-class:: classref-signal
  46. **camera_feed_removed** **(** :ref:`int<class_int>` id **)**
  47. Emitted when a :ref:`CameraFeed<class_CameraFeed>` is removed (e.g. a webcam is unplugged).
  48. .. rst-class:: classref-section-separator
  49. ----
  50. .. rst-class:: classref-descriptions-group
  51. Enumerations
  52. ------------
  53. .. _enum_CameraServer_FeedImage:
  54. .. rst-class:: classref-enumeration
  55. enum **FeedImage**:
  56. .. _class_CameraServer_constant_FEED_RGBA_IMAGE:
  57. .. rst-class:: classref-enumeration-constant
  58. :ref:`FeedImage<enum_CameraServer_FeedImage>` **FEED_RGBA_IMAGE** = ``0``
  59. The RGBA camera image.
  60. .. _class_CameraServer_constant_FEED_YCBCR_IMAGE:
  61. .. rst-class:: classref-enumeration-constant
  62. :ref:`FeedImage<enum_CameraServer_FeedImage>` **FEED_YCBCR_IMAGE** = ``0``
  63. The `YCbCr <https://en.wikipedia.org/wiki/YCbCr>`__ camera image.
  64. .. _class_CameraServer_constant_FEED_Y_IMAGE:
  65. .. rst-class:: classref-enumeration-constant
  66. :ref:`FeedImage<enum_CameraServer_FeedImage>` **FEED_Y_IMAGE** = ``0``
  67. The Y component camera image.
  68. .. _class_CameraServer_constant_FEED_CBCR_IMAGE:
  69. .. rst-class:: classref-enumeration-constant
  70. :ref:`FeedImage<enum_CameraServer_FeedImage>` **FEED_CBCR_IMAGE** = ``1``
  71. The CbCr component camera image.
  72. .. rst-class:: classref-section-separator
  73. ----
  74. .. rst-class:: classref-descriptions-group
  75. Method Descriptions
  76. -------------------
  77. .. _class_CameraServer_method_add_feed:
  78. .. rst-class:: classref-method
  79. void **add_feed** **(** :ref:`CameraFeed<class_CameraFeed>` feed **)**
  80. Adds the camera ``feed`` to the camera server.
  81. .. rst-class:: classref-item-separator
  82. ----
  83. .. _class_CameraServer_method_feeds:
  84. .. rst-class:: classref-method
  85. :ref:`CameraFeed[]<class_CameraFeed>` **feeds** **(** **)**
  86. Returns an array of :ref:`CameraFeed<class_CameraFeed>`\ s.
  87. .. rst-class:: classref-item-separator
  88. ----
  89. .. _class_CameraServer_method_get_feed:
  90. .. rst-class:: classref-method
  91. :ref:`CameraFeed<class_CameraFeed>` **get_feed** **(** :ref:`int<class_int>` index **)**
  92. Returns the :ref:`CameraFeed<class_CameraFeed>` corresponding to the camera with the given ``index``.
  93. .. rst-class:: classref-item-separator
  94. ----
  95. .. _class_CameraServer_method_get_feed_count:
  96. .. rst-class:: classref-method
  97. :ref:`int<class_int>` **get_feed_count** **(** **)**
  98. Returns the number of :ref:`CameraFeed<class_CameraFeed>`\ s registered.
  99. .. rst-class:: classref-item-separator
  100. ----
  101. .. _class_CameraServer_method_remove_feed:
  102. .. rst-class:: classref-method
  103. void **remove_feed** **(** :ref:`CameraFeed<class_CameraFeed>` feed **)**
  104. Removes the specified camera ``feed``.
  105. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  106. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  107. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  108. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  109. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  110. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  111. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`