class_camerafeed.rst 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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 CameraFeed.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_CameraFeed:
  6. CameraFeed
  7. ==========
  8. **Inherits:** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  9. A camera feed gives you access to a single physical camera attached to your device.
  10. Description
  11. -----------
  12. 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>`.
  13. **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.
  14. Properties
  15. ----------
  16. +---------------------------------------+-----------------------------------------------------------------+--------------------------------------+
  17. | :ref:`bool<class_bool>` | :ref:`feed_is_active<class_CameraFeed_property_feed_is_active>` | ``false`` |
  18. +---------------------------------------+-----------------------------------------------------------------+--------------------------------------+
  19. | :ref:`Transform2D<class_Transform2D>` | :ref:`feed_transform<class_CameraFeed_property_feed_transform>` | ``Transform2D( 1, 0, 0, -1, 0, 1 )`` |
  20. +---------------------------------------+-----------------------------------------------------------------+--------------------------------------+
  21. Methods
  22. -------
  23. +---------------------------------------------------+-------------------------------------------------------------------------------+
  24. | :ref:`int<class_int>` | :ref:`get_id<class_CameraFeed_method_get_id>` **(** **)** |const| |
  25. +---------------------------------------------------+-------------------------------------------------------------------------------+
  26. | :ref:`String<class_String>` | :ref:`get_name<class_CameraFeed_method_get_name>` **(** **)** |const| |
  27. +---------------------------------------------------+-------------------------------------------------------------------------------+
  28. | :ref:`FeedPosition<enum_CameraFeed_FeedPosition>` | :ref:`get_position<class_CameraFeed_method_get_position>` **(** **)** |const| |
  29. +---------------------------------------------------+-------------------------------------------------------------------------------+
  30. Enumerations
  31. ------------
  32. .. _enum_CameraFeed_FeedDataType:
  33. .. _class_CameraFeed_constant_FEED_NOIMAGE:
  34. .. _class_CameraFeed_constant_FEED_RGB:
  35. .. _class_CameraFeed_constant_FEED_YCBCR:
  36. .. _class_CameraFeed_constant_FEED_YCBCR_SEP:
  37. enum **FeedDataType**:
  38. - **FEED_NOIMAGE** = **0** --- No image set for the feed.
  39. - **FEED_RGB** = **1** --- Feed supplies RGB images.
  40. - **FEED_YCBCR** = **2** --- Feed supplies YCbCr images that need to be converted to RGB.
  41. - **FEED_YCBCR_SEP** = **3** --- Feed supplies separate Y and CbCr images that need to be combined and converted to RGB.
  42. ----
  43. .. _enum_CameraFeed_FeedPosition:
  44. .. _class_CameraFeed_constant_FEED_UNSPECIFIED:
  45. .. _class_CameraFeed_constant_FEED_FRONT:
  46. .. _class_CameraFeed_constant_FEED_BACK:
  47. enum **FeedPosition**:
  48. - **FEED_UNSPECIFIED** = **0** --- Unspecified position.
  49. - **FEED_FRONT** = **1** --- Camera is mounted at the front of the device.
  50. - **FEED_BACK** = **2** --- Camera is mounted at the back of the device.
  51. Property Descriptions
  52. ---------------------
  53. .. _class_CameraFeed_property_feed_is_active:
  54. - :ref:`bool<class_bool>` **feed_is_active**
  55. +-----------+-------------------+
  56. | *Default* | ``false`` |
  57. +-----------+-------------------+
  58. | *Setter* | set_active(value) |
  59. +-----------+-------------------+
  60. | *Getter* | is_active() |
  61. +-----------+-------------------+
  62. If ``true``, the feed is active.
  63. ----
  64. .. _class_CameraFeed_property_feed_transform:
  65. - :ref:`Transform2D<class_Transform2D>` **feed_transform**
  66. +-----------+--------------------------------------+
  67. | *Default* | ``Transform2D( 1, 0, 0, -1, 0, 1 )`` |
  68. +-----------+--------------------------------------+
  69. | *Setter* | set_transform(value) |
  70. +-----------+--------------------------------------+
  71. | *Getter* | get_transform() |
  72. +-----------+--------------------------------------+
  73. The transform applied to the camera's image.
  74. Method Descriptions
  75. -------------------
  76. .. _class_CameraFeed_method_get_id:
  77. - :ref:`int<class_int>` **get_id** **(** **)** |const|
  78. Returns the unique ID for this feed.
  79. ----
  80. .. _class_CameraFeed_method_get_name:
  81. - :ref:`String<class_String>` **get_name** **(** **)** |const|
  82. Returns the camera's name.
  83. ----
  84. .. _class_CameraFeed_method_get_position:
  85. - :ref:`FeedPosition<enum_CameraFeed_FeedPosition>` **get_position** **(** **)** |const|
  86. Returns the position of camera on the device.
  87. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  88. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  89. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`