class_camerafeed.rst 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  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/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/CameraFeed.xml.
  6. .. _class_CameraFeed:
  7. CameraFeed
  8. ==========
  9. **Inherits:** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. A camera feed gives you access to a single physical camera attached to your device.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. A camera feed gives you access to a single physical camera attached to your device. When enabled, Godot will start capturing frames from the camera which can then be used. See also :ref:`CameraServer<class_CameraServer>`.
  15. \ **Note:** Many cameras will return YCbCr images which are split into two textures and need to be combined in a shader. Godot does this automatically for you if you set the environment to show the camera image in the background.
  16. .. rst-class:: classref-reftable-group
  17. Properties
  18. ----------
  19. .. table::
  20. :widths: auto
  21. +---------------------------------------+-----------------------------------------------------------------+------------------------------------+
  22. | :ref:`bool<class_bool>` | :ref:`feed_is_active<class_CameraFeed_property_feed_is_active>` | ``false`` |
  23. +---------------------------------------+-----------------------------------------------------------------+------------------------------------+
  24. | :ref:`Transform2D<class_Transform2D>` | :ref:`feed_transform<class_CameraFeed_property_feed_transform>` | ``Transform2D(1, 0, 0, -1, 0, 1)`` |
  25. +---------------------------------------+-----------------------------------------------------------------+------------------------------------+
  26. | :ref:`Array<class_Array>` | :ref:`formats<class_CameraFeed_property_formats>` | ``[]`` |
  27. +---------------------------------------+-----------------------------------------------------------------+------------------------------------+
  28. .. rst-class:: classref-reftable-group
  29. Methods
  30. -------
  31. .. table::
  32. :widths: auto
  33. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
  34. | :ref:`FeedDataType<enum_CameraFeed_FeedDataType>` | :ref:`get_datatype<class_CameraFeed_method_get_datatype>`\ (\ ) |const| |
  35. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
  36. | :ref:`int<class_int>` | :ref:`get_id<class_CameraFeed_method_get_id>`\ (\ ) |const| |
  37. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
  38. | :ref:`String<class_String>` | :ref:`get_name<class_CameraFeed_method_get_name>`\ (\ ) |const| |
  39. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
  40. | :ref:`FeedPosition<enum_CameraFeed_FeedPosition>` | :ref:`get_position<class_CameraFeed_method_get_position>`\ (\ ) |const| |
  41. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
  42. | :ref:`bool<class_bool>` | :ref:`set_format<class_CameraFeed_method_set_format>`\ (\ index\: :ref:`int<class_int>`, parameters\: :ref:`Dictionary<class_Dictionary>`\ ) |
  43. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
  44. .. rst-class:: classref-section-separator
  45. ----
  46. .. rst-class:: classref-descriptions-group
  47. Signals
  48. -------
  49. .. _class_CameraFeed_signal_format_changed:
  50. .. rst-class:: classref-signal
  51. **format_changed**\ (\ ) :ref:`🔗<class_CameraFeed_signal_format_changed>`
  52. Emitted when the format has changed.
  53. .. rst-class:: classref-item-separator
  54. ----
  55. .. _class_CameraFeed_signal_frame_changed:
  56. .. rst-class:: classref-signal
  57. **frame_changed**\ (\ ) :ref:`🔗<class_CameraFeed_signal_frame_changed>`
  58. Emitted when a new frame is available.
  59. .. rst-class:: classref-section-separator
  60. ----
  61. .. rst-class:: classref-descriptions-group
  62. Enumerations
  63. ------------
  64. .. _enum_CameraFeed_FeedDataType:
  65. .. rst-class:: classref-enumeration
  66. enum **FeedDataType**: :ref:`🔗<enum_CameraFeed_FeedDataType>`
  67. .. _class_CameraFeed_constant_FEED_NOIMAGE:
  68. .. rst-class:: classref-enumeration-constant
  69. :ref:`FeedDataType<enum_CameraFeed_FeedDataType>` **FEED_NOIMAGE** = ``0``
  70. No image set for the feed.
  71. .. _class_CameraFeed_constant_FEED_RGB:
  72. .. rst-class:: classref-enumeration-constant
  73. :ref:`FeedDataType<enum_CameraFeed_FeedDataType>` **FEED_RGB** = ``1``
  74. Feed supplies RGB images.
  75. .. _class_CameraFeed_constant_FEED_YCBCR:
  76. .. rst-class:: classref-enumeration-constant
  77. :ref:`FeedDataType<enum_CameraFeed_FeedDataType>` **FEED_YCBCR** = ``2``
  78. Feed supplies YCbCr images that need to be converted to RGB.
  79. .. _class_CameraFeed_constant_FEED_YCBCR_SEP:
  80. .. rst-class:: classref-enumeration-constant
  81. :ref:`FeedDataType<enum_CameraFeed_FeedDataType>` **FEED_YCBCR_SEP** = ``3``
  82. Feed supplies separate Y and CbCr images that need to be combined and converted to RGB.
  83. .. rst-class:: classref-item-separator
  84. ----
  85. .. _enum_CameraFeed_FeedPosition:
  86. .. rst-class:: classref-enumeration
  87. enum **FeedPosition**: :ref:`🔗<enum_CameraFeed_FeedPosition>`
  88. .. _class_CameraFeed_constant_FEED_UNSPECIFIED:
  89. .. rst-class:: classref-enumeration-constant
  90. :ref:`FeedPosition<enum_CameraFeed_FeedPosition>` **FEED_UNSPECIFIED** = ``0``
  91. Unspecified position.
  92. .. _class_CameraFeed_constant_FEED_FRONT:
  93. .. rst-class:: classref-enumeration-constant
  94. :ref:`FeedPosition<enum_CameraFeed_FeedPosition>` **FEED_FRONT** = ``1``
  95. Camera is mounted at the front of the device.
  96. .. _class_CameraFeed_constant_FEED_BACK:
  97. .. rst-class:: classref-enumeration-constant
  98. :ref:`FeedPosition<enum_CameraFeed_FeedPosition>` **FEED_BACK** = ``2``
  99. Camera is mounted at the back of the device.
  100. .. rst-class:: classref-section-separator
  101. ----
  102. .. rst-class:: classref-descriptions-group
  103. Property Descriptions
  104. ---------------------
  105. .. _class_CameraFeed_property_feed_is_active:
  106. .. rst-class:: classref-property
  107. :ref:`bool<class_bool>` **feed_is_active** = ``false`` :ref:`🔗<class_CameraFeed_property_feed_is_active>`
  108. .. rst-class:: classref-property-setget
  109. - |void| **set_active**\ (\ value\: :ref:`bool<class_bool>`\ )
  110. - :ref:`bool<class_bool>` **is_active**\ (\ )
  111. If ``true``, the feed is active.
  112. .. rst-class:: classref-item-separator
  113. ----
  114. .. _class_CameraFeed_property_feed_transform:
  115. .. rst-class:: classref-property
  116. :ref:`Transform2D<class_Transform2D>` **feed_transform** = ``Transform2D(1, 0, 0, -1, 0, 1)`` :ref:`🔗<class_CameraFeed_property_feed_transform>`
  117. .. rst-class:: classref-property-setget
  118. - |void| **set_transform**\ (\ value\: :ref:`Transform2D<class_Transform2D>`\ )
  119. - :ref:`Transform2D<class_Transform2D>` **get_transform**\ (\ )
  120. The transform applied to the camera's image.
  121. .. rst-class:: classref-item-separator
  122. ----
  123. .. _class_CameraFeed_property_formats:
  124. .. rst-class:: classref-property
  125. :ref:`Array<class_Array>` **formats** = ``[]`` :ref:`🔗<class_CameraFeed_property_formats>`
  126. .. rst-class:: classref-property-setget
  127. - :ref:`Array<class_Array>` **get_formats**\ (\ )
  128. Formats supported by the feed. Each entry is a :ref:`Dictionary<class_Dictionary>` describing format parameters.
  129. .. rst-class:: classref-section-separator
  130. ----
  131. .. rst-class:: classref-descriptions-group
  132. Method Descriptions
  133. -------------------
  134. .. _class_CameraFeed_method_get_datatype:
  135. .. rst-class:: classref-method
  136. :ref:`FeedDataType<enum_CameraFeed_FeedDataType>` **get_datatype**\ (\ ) |const| :ref:`🔗<class_CameraFeed_method_get_datatype>`
  137. Returns feed image data type.
  138. .. rst-class:: classref-item-separator
  139. ----
  140. .. _class_CameraFeed_method_get_id:
  141. .. rst-class:: classref-method
  142. :ref:`int<class_int>` **get_id**\ (\ ) |const| :ref:`🔗<class_CameraFeed_method_get_id>`
  143. Returns the unique ID for this feed.
  144. .. rst-class:: classref-item-separator
  145. ----
  146. .. _class_CameraFeed_method_get_name:
  147. .. rst-class:: classref-method
  148. :ref:`String<class_String>` **get_name**\ (\ ) |const| :ref:`🔗<class_CameraFeed_method_get_name>`
  149. Returns the camera's name.
  150. .. rst-class:: classref-item-separator
  151. ----
  152. .. _class_CameraFeed_method_get_position:
  153. .. rst-class:: classref-method
  154. :ref:`FeedPosition<enum_CameraFeed_FeedPosition>` **get_position**\ (\ ) |const| :ref:`🔗<class_CameraFeed_method_get_position>`
  155. Returns the position of camera on the device.
  156. .. rst-class:: classref-item-separator
  157. ----
  158. .. _class_CameraFeed_method_set_format:
  159. .. rst-class:: classref-method
  160. :ref:`bool<class_bool>` **set_format**\ (\ index\: :ref:`int<class_int>`, parameters\: :ref:`Dictionary<class_Dictionary>`\ ) :ref:`🔗<class_CameraFeed_method_set_format>`
  161. Sets the feed format parameters for the given index in the :ref:`formats<class_CameraFeed_property_formats>` array. Returns ``true`` on success. By default YUYV encoded stream is transformed to FEED_RGB. YUYV encoded stream output format can be changed with ``parameters``.output value:
  162. \ ``separate`` will result in FEED_YCBCR_SEP
  163. \ ``grayscale`` will result in desaturated FEED_RGB
  164. \ ``copy`` will result in FEED_YCBCR
  165. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  166. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  167. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  168. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  169. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  170. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  171. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  172. .. |void| replace:: :abbr:`void (No return value.)`