CameraFeed

Hereda: RefCounted < Object

La alimentación de la cámara le da acceso a una única cámara física conectada a tu dispositivo.

Descripción

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.

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.

Note: This class is currently only implemented on Linux, Android, macOS, and iOS. On other platforms no CameraFeeds will be available. To get a CameraFeed on iOS, the camera plugin from godot-ios-plugins is required.

Propiedades

bool

feed_is_active

false

Transform2D

feed_transform

Transform2D(1, 0, 0, -1, 0, 1)

Array

formats

[]

Métodos

bool

_activate_feed() virtual

void

_deactivate_feed() virtual

FeedDataType

get_datatype() const

int

get_id() const

String

get_name() const

FeedPosition

get_position() const

int

get_texture_tex_id(feed_image_type: FeedImage)

void

set_external(width: int, height: int)

bool

set_format(index: int, parameters: Dictionary)

void

set_name(name: String)

void

set_position(position: FeedPosition)

void

set_rgb_image(rgb_image: Image)

void

set_ycbcr_image(ycbcr_image: Image)

void

set_ycbcr_images(y_image: Image, cbcr_image: Image)


Señales

format_changed() 🔗

Emitida cuando el formato ha cambiado.


frame_changed() 🔗

Emitted when a new frame is available.


Enumeraciones

enum FeedDataType: 🔗

FeedDataType FEED_NOIMAGE = 0

No hay ninguna imagen establecida para el feed.

FeedDataType FEED_RGB = 1

Proporciona imágenes RGB.

FeedDataType FEED_YCBCR = 2

Proporciona imágenes YCbCr que necesitan ser convertidas a RGB.

FeedDataType FEED_YCBCR_SEP = 3

Feed supplies separate Y and CbCr images that need to be combined and converted to RGB.

FeedDataType FEED_EXTERNAL = 4

Feed supplies external image.


enum FeedPosition: 🔗

FeedPosition FEED_UNSPECIFIED = 0

Posición no especificada.

FeedPosition FEED_FRONT = 1

La cámara está montada en la parte frontal del dispositivo.

FeedPosition FEED_BACK = 2

La cámara está montada en la parte trasera del dispositivo.


Descripciones de Propiedades

bool feed_is_active = false 🔗

  • void set_active(value: bool)

  • bool is_active()

Si es true, el feed está activo.


Transform2D feed_transform = Transform2D(1, 0, 0, -1, 0, 1) 🔗

The transform applied to the camera's image.


Array formats = [] 🔗

Formats supported by the feed. Each entry is a Dictionary describing format parameters.


Descripciones de Métodos

bool _activate_feed() virtual 🔗

Se llama cuando se activa la transmisión de la cámara.


void _deactivate_feed() virtual 🔗

Se llama cuando la transmisión de la cámara está desactivada.


FeedDataType get_datatype() const 🔗

Returns feed image data type.


int get_id() const 🔗

Returns the unique ID for this feed.


String get_name() const 🔗

Devuelve el nombre de la cámara.


FeedPosition get_position() const 🔗

Devuelve la posición de la cámara en el dispositivo.


int get_texture_tex_id(feed_image_type: FeedImage) 🔗

Returns the texture backend ID (usable by some external libraries that need a handle to a texture to write data).


void set_external(width: int, height: int) 🔗

Sets the feed as external feed provided by another library.


bool set_format(index: int, parameters: Dictionary) 🔗

Sets the feed format parameters for the given index in the formats array. Returns true on success. By default, the YUYV encoded stream is transformed to FEED_RGB. The YUYV encoded stream output format can be changed by setting parameters's output entry to one of the following:


void set_name(name: String) 🔗

Establece el nombre de la cámara.


void set_position(position: FeedPosition) 🔗

Establece la posición de esta cámara.


void set_rgb_image(rgb_image: Image) 🔗

Sets RGB image for this feed.


void set_ycbcr_image(ycbcr_image: Image) 🔗

Sets YCbCr image for this feed.


void set_ycbcr_images(y_image: Image, cbcr_image: Image) 🔗

Sets Y and CbCr images for this feed.