Difference between revisions of "Camera.queryCamera"
m (Text replacement - "<source" to "<syntaxhighlight") |
|||
Line 5: | Line 5: | ||
=== Description === | === Description === | ||
Returns the capabilities of a camera. | Returns the capabilities of a camera. | ||
− | < | + | <syntaxhighlight lang="lua"> |
(table) = camera.queryCamera(device) | (table) = camera.queryCamera(device) | ||
</source> | </source> | ||
Line 21: | Line 21: | ||
=== Example === | === Example === | ||
− | < | + | <syntaxhighlight lang="lua"> |
require "camera" | require "camera" | ||
--Camera Info | --Camera Info |
Revision as of 14:26, 13 July 2023
Available since: Gideros 2021.8
Class: camera
Description
Returns the capabilities of a camera. <syntaxhighlight lang="lua"> (table) = camera.queryCamera(device) </source>
The table contains the following fields:
- "previewSizes": an array of integers listing the supported preview dimensions (two integers, width and height, per dimension)
- "pictureSizes": same as above but for full picture dimensions
- "flashModes": an array of integers listing the supported flash modes
Parameters
device (string) the camera device name, or nil to query the default one
Return values
Returns (table) the camera capabilities
Example
<syntaxhighlight lang="lua"> require "camera" --Camera Info local caminfo=Camera.queryCamera() print("Preview Sizes") for i=1,#caminfo.previewSizes,2 do print("-",caminfo.previewSizes[i],caminfo.previewSizes[i+1]) end print("Picture Sizes") for i=1,#caminfo.pictureSizes,2 do print("-",caminfo.pictureSizes[i],caminfo.pictureSizes[i+1]) end print("Flash Modes") for i=1,#caminfo.flashModes do print("-",caminfo.flashModes[i]) end </source>