Camera

From GiderosMobile

Supported platforms: Platform android.pngPlatform ios.pngPlatform mac.pngPlatform pc.png
Available since: Gideros 2017.8

Description

Renders live camera stream into a Texture.

require "camera"

Example

require "camera"

-- Probe camera size (use a dummy 512x512 surface)
Camera.texture=RenderTargert.new(512,512)
cw,ch=Camera.start(Camera.texture)
Camera.stop()

-- Restart camera with a full sized texture
Camera.texture=RenderTarget.new(cw,ch,true)
cw,ch=Camera.start(Camera.texture)

application:setLogicalDimensions(ch,cw)

local b=Bitmap.new(Camera.texture) 
stage:addChild(b)

Methods

camera.availableDevices returns a list of available devices
camera.isAvailable checks if camera can be accessed
camera.queryCamera gets information about the given camera
camera.setFlash selects the flash mode to use
camera.setOrientation selects the camera orientation
camera.start starts streaming camera pictures to a Texture
camera.stop stops camera streaming
camera.takePicture takes a picture

Events

Constants