CameraServer

继承: Object

Server keeping track of different cameras accessible in Godot.

描述

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.

Note: 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 godot-ios-plugins is required.

方法


信号

camera_feed_added ( id: int )

Emitted when a CameraFeed is added (e.g. a webcam is plugged in).


camera_feed_removed ( id: int )

Emitted when a CameraFeed is removed (e.g. a webcam is unplugged).


枚举

enum FeedImage:

FeedImage FEED_RGBA_IMAGE = 0

The RGBA camera image.

FeedImage FEED_YCBCR_IMAGE = 0

The YCbCr camera image.

FeedImage FEED_Y_IMAGE = 0

The Y component camera image.

FeedImage FEED_CBCR_IMAGE = 1

The CbCr component camera image.


方法说明

void add_feed ( feed: CameraFeed )

Adds the camera feed to the camera server.


Array CameraFeed feeds ( )

Returns an array of CameraFeed s.


CameraFeed get_feed ( index: int )

Returns the CameraFeed corresponding to the camera with the given index.


int get_feed_count ( )

Returns the number of CameraFeed s registered.


void remove_feed ( feed: CameraFeed )

Removes the specified camera feed.

1

本方法通常需要用户覆盖才能生效。

2

本方法无副作用,不会修改该实例的任何成员变量。

3

本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。

4

本方法用于构造某个类型。

5

调用本方法无需实例,可直接使用类名进行调用。

6

本方法描述的是使用本类型作为左操作数的有效运算符。

7

这个值是由下列位标志构成位掩码的整数。

8

无返回值。