CameraFeed.xml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="CameraFeed" inherits="RefCounted" version="4.0">
  3. <brief_description>
  4. A camera feed gives you access to a single physical camera attached to your device.
  5. </brief_description>
  6. <description>
  7. 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 [CameraServer].
  8. [b]Note:[/b] 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.
  9. </description>
  10. <tutorials>
  11. </tutorials>
  12. <methods>
  13. <method name="get_datatype" qualifiers="const">
  14. <return type="int" enum="CameraFeed.FeedDataType" />
  15. <description>
  16. Returns feed image data type.
  17. </description>
  18. </method>
  19. <method name="get_id" qualifiers="const">
  20. <return type="int" />
  21. <description>
  22. Returns the unique ID for this feed.
  23. </description>
  24. </method>
  25. <method name="get_name" qualifiers="const">
  26. <return type="String" />
  27. <description>
  28. Returns the camera's name.
  29. </description>
  30. </method>
  31. <method name="get_position" qualifiers="const">
  32. <return type="int" enum="CameraFeed.FeedPosition" />
  33. <description>
  34. Returns the position of camera on the device.
  35. </description>
  36. </method>
  37. </methods>
  38. <members>
  39. <member name="feed_is_active" type="bool" setter="set_active" getter="is_active" default="false">
  40. If [code]true[/code], the feed is active.
  41. </member>
  42. <member name="feed_transform" type="Transform2D" setter="set_transform" getter="get_transform" default="Transform2D(1, 0, 0, -1, 0, 1)">
  43. The transform applied to the camera's image.
  44. </member>
  45. </members>
  46. <constants>
  47. <constant name="FEED_NOIMAGE" value="0" enum="FeedDataType">
  48. No image set for the feed.
  49. </constant>
  50. <constant name="FEED_RGB" value="1" enum="FeedDataType">
  51. Feed supplies RGB images.
  52. </constant>
  53. <constant name="FEED_YCBCR" value="2" enum="FeedDataType">
  54. Feed supplies YCbCr images that need to be converted to RGB.
  55. </constant>
  56. <constant name="FEED_YCBCR_SEP" value="3" enum="FeedDataType">
  57. Feed supplies separate Y and CbCr images that need to be combined and converted to RGB.
  58. </constant>
  59. <constant name="FEED_UNSPECIFIED" value="0" enum="FeedPosition">
  60. Unspecified position.
  61. </constant>
  62. <constant name="FEED_FRONT" value="1" enum="FeedPosition">
  63. Camera is mounted at the front of the device.
  64. </constant>
  65. <constant name="FEED_BACK" value="2" enum="FeedPosition">
  66. Camera is mounted at the back of the device.
  67. </constant>
  68. </constants>
  69. </class>