mirror of
https://github.com/defold/extension-camera
synced 2025-09-27 17:02:19 +02:00
Added LOW/MEDIUM/HIGH settings
This commit is contained in:
@@ -8,15 +8,21 @@ function init(self)
|
||||
|
||||
go.set("#sprite", "scale", vmath.vector3(scale_width, scale_height, 1) )
|
||||
|
||||
if camera ~= nil and camera.start_capture(camera.CAMERA_TYPE_FRONT) then
|
||||
self.cameraframe = camera.get_frame()
|
||||
self.camerainfo = camera.get_info()
|
||||
|
||||
self.cameratextureheader = {width=self.camerainfo.width,
|
||||
height=self.camerainfo.height,
|
||||
type=resource.TEXTURE_TYPE_2D,
|
||||
format=resource.TEXTURE_FORMAT_RGB,
|
||||
num_mip_maps=1 }
|
||||
if camera ~= nil then
|
||||
|
||||
--if camera.start_capture(camera.CAMERA_TYPE_FRONT, camera.CAPTURE_QUALITY_MEDIUM) then
|
||||
if camera.start_capture(camera.CAMERA_TYPE_BACK, camera.CAPTURE_QUALITY_MEDIUM) then
|
||||
self.cameraframe = camera.get_frame()
|
||||
self.camerainfo = camera.get_info()
|
||||
print("Initialized camera")
|
||||
pprint(self.camerainfo)
|
||||
|
||||
self.cameratextureheader = {width=self.camerainfo.width,
|
||||
height=self.camerainfo.height,
|
||||
type=resource.TEXTURE_TYPE_2D,
|
||||
format=resource.TEXTURE_FORMAT_RGB,
|
||||
num_mip_maps=1 }
|
||||
end
|
||||
else
|
||||
print("could not start camera capture")
|
||||
end
|
||||
|
Reference in New Issue
Block a user