class_camerafeed.rst 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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. Description
  12. -----------
  13. 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>`.
  14. \ **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.
  15. Properties
  16. ----------
  17. +---------------------------------------+-----------------------------------------------------------------+------------------------------------+
  18. | :ref:`bool<class_bool>` | :ref:`feed_is_active<class_CameraFeed_property_feed_is_active>` | ``false`` |
  19. +---------------------------------------+-----------------------------------------------------------------+------------------------------------+
  20. | :ref:`Transform2D<class_Transform2D>` | :ref:`feed_transform<class_CameraFeed_property_feed_transform>` | ``Transform2D(1, 0, 0, -1, 0, 1)`` |
  21. +---------------------------------------+-----------------------------------------------------------------+------------------------------------+
  22. Methods
  23. -------
  24. +---------------------------------------------------+-------------------------------------------------------------------------------+
  25. | :ref:`FeedDataType<enum_CameraFeed_FeedDataType>` | :ref:`get_datatype<class_CameraFeed_method_get_datatype>` **(** **)** |const| |
  26. +---------------------------------------------------+-------------------------------------------------------------------------------+
  27. | :ref:`int<class_int>` | :ref:`get_id<class_CameraFeed_method_get_id>` **(** **)** |const| |
  28. +---------------------------------------------------+-------------------------------------------------------------------------------+
  29. | :ref:`String<class_String>` | :ref:`get_name<class_CameraFeed_method_get_name>` **(** **)** |const| |
  30. +---------------------------------------------------+-------------------------------------------------------------------------------+
  31. | :ref:`FeedPosition<enum_CameraFeed_FeedPosition>` | :ref:`get_position<class_CameraFeed_method_get_position>` **(** **)** |const| |
  32. +---------------------------------------------------+-------------------------------------------------------------------------------+
  33. Enumerations
  34. ------------
  35. .. _enum_CameraFeed_FeedDataType:
  36. .. _class_CameraFeed_constant_FEED_NOIMAGE:
  37. .. _class_CameraFeed_constant_FEED_RGB:
  38. .. _class_CameraFeed_constant_FEED_YCBCR:
  39. .. _class_CameraFeed_constant_FEED_YCBCR_SEP:
  40. enum **FeedDataType**:
  41. - **FEED_NOIMAGE** = **0** --- No image set for the feed.
  42. - **FEED_RGB** = **1** --- Feed supplies RGB images.
  43. - **FEED_YCBCR** = **2** --- Feed supplies YCbCr images that need to be converted to RGB.
  44. - **FEED_YCBCR_SEP** = **3** --- Feed supplies separate Y and CbCr images that need to be combined and converted to RGB.
  45. ----
  46. .. _enum_CameraFeed_FeedPosition:
  47. .. _class_CameraFeed_constant_FEED_UNSPECIFIED:
  48. .. _class_CameraFeed_constant_FEED_FRONT:
  49. .. _class_CameraFeed_constant_FEED_BACK:
  50. enum **FeedPosition**:
  51. - **FEED_UNSPECIFIED** = **0** --- Unspecified position.
  52. - **FEED_FRONT** = **1** --- Camera is mounted at the front of the device.
  53. - **FEED_BACK** = **2** --- Camera is mounted at the back of the device.
  54. Property Descriptions
  55. ---------------------
  56. .. _class_CameraFeed_property_feed_is_active:
  57. - :ref:`bool<class_bool>` **feed_is_active**
  58. +-----------+-------------------+
  59. | *Default* | ``false`` |
  60. +-----------+-------------------+
  61. | *Setter* | set_active(value) |
  62. +-----------+-------------------+
  63. | *Getter* | is_active() |
  64. +-----------+-------------------+
  65. If ``true``, the feed is active.
  66. ----
  67. .. _class_CameraFeed_property_feed_transform:
  68. - :ref:`Transform2D<class_Transform2D>` **feed_transform**
  69. +-----------+------------------------------------+
  70. | *Default* | ``Transform2D(1, 0, 0, -1, 0, 1)`` |
  71. +-----------+------------------------------------+
  72. | *Setter* | set_transform(value) |
  73. +-----------+------------------------------------+
  74. | *Getter* | get_transform() |
  75. +-----------+------------------------------------+
  76. The transform applied to the camera's image.
  77. Method Descriptions
  78. -------------------
  79. .. _class_CameraFeed_method_get_datatype:
  80. - :ref:`FeedDataType<enum_CameraFeed_FeedDataType>` **get_datatype** **(** **)** |const|
  81. Returns feed image data type.
  82. ----
  83. .. _class_CameraFeed_method_get_id:
  84. - :ref:`int<class_int>` **get_id** **(** **)** |const|
  85. Returns the unique ID for this feed.
  86. ----
  87. .. _class_CameraFeed_method_get_name:
  88. - :ref:`String<class_String>` **get_name** **(** **)** |const|
  89. Returns the camera's name.
  90. ----
  91. .. _class_CameraFeed_method_get_position:
  92. - :ref:`FeedPosition<enum_CameraFeed_FeedPosition>` **get_position** **(** **)** |const|
  93. Returns the position of camera on the device.
  94. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  95. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  96. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  97. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  98. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  99. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`