CameraFeed

Inherits: Reference < Object

A camera feed gives you access to a single physical camera attached to your device.

Description

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.

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.

Properties

boolfeed_is_activefalse
Transform2Dfeed_transformTransform2D( 1, 0, 0, -1, 0, 1 )

Methods

intget_id ( ) const
Stringget_name ( ) const
FeedPositionget_position ( ) const

Enumerations

enum FeedDataType:

  • FEED_NOIMAGE = 0 — No image set for the feed.
  • FEED_RGB = 1 — Feed supplies RGB images.
  • FEED_YCBCR = 2 — Feed supplies YCbCr images that need to be converted to RGB.
  • FEED_YCBCR_SEP = 3 — Feed supplies separate Y and CbCr images that need to be combined and converted to RGB.

enum FeedPosition:

  • FEED_UNSPECIFIED = 0 — Unspecified position.
  • FEED_FRONT = 1 — Camera is mounted at the front of the device.
  • FEED_BACK = 2 — Camera is mounted at the back of the device.

Property Descriptions

Defaultfalse
Setterset_active(value)
Getteris_active()

If true, the feed is active.


DefaultTransform2D( 1, 0, 0, -1, 0, 1 )
Setterset_transform(value)
Getterget_transform()

The transform applied to the camera’s image.

Method Descriptions

  • int get_id ( ) const

Returns the unique ID for this feed.


Returns the camera’s name.


Returns the position of camera on the device.

doradoro's advice! Getters and Setters will be deprecated! Avoid their use!

Disclaimer: This page has been automaticaly and directly extracted from the official Godot Docs website, the 2020-03-07 at 01:29:53. It's the English Stable version because it's what most Godot users should use. The Copyright owners are Juan Linietsky, Ariel Manzur and the Godot community. CC-BY 3.0. Thanks for your patience and generosity.