Björn Ritzl 7258633994 WIP
2020-07-13 01:08:54 +02:00
WIP
2020-07-13 01:08:54 +02:00
WIP
2020-07-13 01:08:54 +02:00
2017-02-22 21:12:10 +00:00
WIP
2020-07-13 01:08:54 +02:00
WIP
2020-07-13 01:08:54 +02:00
2019-08-28 13:30:13 +02:00
2017-02-24 14:52:40 +01:00

extension-camera

Example of interacting with the camera through native extensions.

Disclaimer

Although we aim to provide good example functionality in this example, we cannot guarantee the quality/stability at all times. Please regard it as just that, an example, and don't rely on this as a dependency for your production code.

Known issues

The currently supported platforms are: OSX + iOS

FAQ

How do I use this extension?

Add the package link (https://github.com/defold/extension-camera/archive/master.zip) to the project setting project.dependencies, and you should be good to go.

See the manual for further info.

Lua API

Type constants

Describes what camera should be used

camera.CAMERA_TYPE_FRONT -- Selfie
camera.CAMERA_TYPE_BACK

Quality constants

camera.CAPTURE_QUALITY_HIGH
camera.CAPTURE_QUALITY_MEDIUM
camera.CAPTURE_QUALITY_LOW

camera.start_capture(type, quality)

Returns true if the capture starts well

if camera.start_capture(camera.CAMERA_TYPE_BACK, camera.CAPTURE_QUALITY_HIGH) then
    -- do stuff
end

camera.stop_capture()

Stops a previously started capture session

camera.get_info()

Gets the info from the current capture session

local info = camera.get_info()
print("width", info.width)
print("height", info.height)

camera.get_frame()

Retrieves the camera pixel buffer This buffer has one stream named "rgb", and is of type buffer.VALUE_TYPE_UINT8 and has the value count of 1

self.cameraframe = camera.get_frame()
Description
No description provided
Readme 247 KiB
Languages
Objective-C++ 43.6%
C++ 33.2%
Java 21%
C 2.2%