2017-08-20 14:17:24 +00:00
<?xml version="1.0" encoding="UTF-8" ?>
2023-07-06 08:08:05 +00:00
<class name= "CameraServer" inherits= "Object" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "../class.xsd" >
2017-08-20 14:17:24 +00:00
<brief_description >
2020-01-23 10:14:14 +00:00
Server keeping track of different cameras accessible in Godot.
2017-08-20 14:17:24 +00:00
</brief_description>
<description >
2020-01-23 10:14:14 +00:00
The [CameraServer] keeps track of different cameras accessible in Godot. These are external cameras such as webcams or the cameras on your phone.
It is notably used to provide AR modules with a video feed from the camera.
2023-06-05 16:56:34 +00:00
[b]Note:[/b] This class is currently only implemented on Linux, macOS, and iOS, on other platforms no [CameraFeed]s will be available. To get a [CameraFeed] on iOS, the camera plugin from [url=https://github.com/godotengine/godot-ios-plugins]godot-ios-plugins[/url] is required.
2017-08-20 14:17:24 +00:00
</description>
<tutorials >
</tutorials>
<methods >
<method name= "add_feed" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "feed" type= "CameraFeed" />
2017-08-20 14:17:24 +00:00
<description >
2022-08-12 17:13:27 +00:00
Adds the camera [param feed] to the camera server.
2017-08-20 14:17:24 +00:00
</description>
</method>
<method name= "feeds" >
2022-08-05 01:41:48 +00:00
<return type= "CameraFeed[]" />
2017-08-20 14:17:24 +00:00
<description >
Returns an array of [CameraFeed]s.
</description>
</method>
<method name= "get_feed" >
2021-07-30 13:28:05 +00:00
<return type= "CameraFeed" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "index" type= "int" />
2017-08-20 14:17:24 +00:00
<description >
2022-08-12 17:13:27 +00:00
Returns the [CameraFeed] corresponding to the camera with the given [param index].
2017-08-20 14:17:24 +00:00
</description>
</method>
<method name= "get_feed_count" >
2021-07-30 13:28:05 +00:00
<return type= "int" />
2017-08-20 14:17:24 +00:00
<description >
Returns the number of [CameraFeed]s registered.
</description>
</method>
<method name= "remove_feed" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "feed" type= "CameraFeed" />
2017-08-20 14:17:24 +00:00
<description >
2022-08-12 17:13:27 +00:00
Removes the specified camera [param feed].
2017-08-20 14:17:24 +00:00
</description>
</method>
</methods>
<signals >
<signal name= "camera_feed_added" >
2022-08-06 18:11:48 +00:00
<param index= "0" name= "id" type= "int" />
2017-08-20 14:17:24 +00:00
<description >
2020-04-08 12:26:21 +00:00
Emitted when a [CameraFeed] is added (e.g. a webcam is plugged in).
2017-08-20 14:17:24 +00:00
</description>
</signal>
<signal name= "camera_feed_removed" >
2022-08-06 18:11:48 +00:00
<param index= "0" name= "id" type= "int" />
2017-08-20 14:17:24 +00:00
<description >
2020-04-08 12:26:21 +00:00
Emitted when a [CameraFeed] is removed (e.g. a webcam is unplugged).
2017-08-20 14:17:24 +00:00
</description>
</signal>
</signals>
<constants >
<constant name= "FEED_RGBA_IMAGE" value= "0" enum= "FeedImage" >
The RGBA camera image.
</constant>
2019-06-19 12:21:13 +00:00
<constant name= "FEED_YCBCR_IMAGE" value= "0" enum= "FeedImage" >
2020-04-08 12:26:21 +00:00
The [url=https://en.wikipedia.org/wiki/YCbCr]YCbCr[/url] camera image.
2017-08-20 14:17:24 +00:00
</constant>
<constant name= "FEED_Y_IMAGE" value= "0" enum= "FeedImage" >
2019-06-16 09:22:38 +00:00
The Y component camera image.
2017-08-20 14:17:24 +00:00
</constant>
2019-06-19 12:21:13 +00:00
<constant name= "FEED_CBCR_IMAGE" value= "1" enum= "FeedImage" >
2017-08-20 14:17:24 +00:00
The CbCr component camera image.
</constant>
</constants>
</class>