All Functions Modules Pages
cam

Functions

NUMBER cam.init ()
 We load and start the module. More...
 
NUMBER cam.begin ()
 Configures and starts the camera for making video. More...
 
BOOLEAN cam.state ()
 It allows to know the status of the cam module. More...
 
BOOLEAN cam.available ()
 It allows to know the status of the connection of the camera into the USB port. More...
 
NIL cam.render (NUMBER x, NUMBER y)
 Displays the current image the camera sees. More...
 
NIL cam.render (NUMBER x, NUMBER y, NUMBER w, NUMBER h)
 Muestra en pantalla la imágen actual que vé la cámara, aplicando un escalado. More...
 
NUMBER cam.shot (STRING path)
 Take a snapshot of the current image the camera sees and stores on the route and with the specified name. More...
 
IMAGE cam.toimage ()
 Create a copy of the current image the camera sees. More...
 
NUMBER cam.direction ()
 It allows to know the direction of the camera lens. More...
 
NUMBER cam.brightness ()
 It allows to know the current brightness of the camera. More...
 
NIL cam.brightness (NUMBER value)
 It allows setting the brightness of the camera. More...
 
NUMBER cam.contrast ()
 It allows to know the current contrast of the camera. More...
 
NIL cam.contrast (NUMBER value)
 It allows setting the contrast of the camera. More...
 
NUMBER cam.sharpness ()
 It allows to know the current sharpness of the camera. More...
 
NIL cam.sharpness (NUMBER value)
 It allows setting the sharpness of the camera. More...
 
NUMBER cam.saturation ()
 It allows to know the current saturation of the camera. More...
 
NIL cam.saturation (NUMBER value)
 It allows setting the saturation of the camera. More...
 
NUMBER cam.zoom ()
 It allows to know the current zoom of the camera. More...
 
NIL cam.zoom (NUMBER value)
 It allows setting the zoom of the camera. More...
 
NUMBER cam.evlevel ()
 It allows to know the current evlevel of the camera. More...
 
NIL cam.evlevel (NUMBER value)
 It allows setting the evlevel of the camera. More...
 
NUMBER cam.effect ()
 It allows to know the current effect of the camera. More...
 
NIL cam.effect (NUMBER value)
 It allows setting the effect of the camera. More...
 
NUMBER cam.autoreverse ()
 It allows to know the current autoreverse state of the camera. More...
 
NIL cam.autoreverse (NUMBER mode)
 It allows setting the autoreverse of the camera. More...
 
NUMBER cam.mirror ()
 It allows to know the current mirror of the camera. More...
 
NIL cam.mirror (NUMBER value)
 It allows setting the mirror of the camera. More...
 
NUMBER cam.term ()
 Unloaded and finish the module. More...
 

Detailed Description

Management USB camera (GO! CAM).

Function Documentation

NUMBER cam.init ( )

We load and start the module.

Note
Once started the cam module, you can not use the USB module.
Returns
1/0 It will be 1 if successful, otherwise 0.
NUMBER cam.begin ( )

Configures and starts the camera for making video.

Note
The cam module requires this previously initiated.
Returns
1/0 It will be 1 if successful, otherwise 0.
BOOLEAN cam.state ( )

It allows to know the status of the cam module.

Returns
true/false Depending on whether the cam module is started.
BOOLEAN cam.available ( )

It allows to know the status of the connection of the camera into the USB port.

Returns
true/false Depending on whether the camera is connected.
NIL cam.render ( NUMBER  x,
NUMBER  y 
)

Displays the current image the camera sees.

Parameters
xcoordinate X where the image is displayed.
ycoordinate Y where the image is displayed.
Returns
Nothing.
NIL cam.render ( NUMBER  x,
NUMBER  y,
NUMBER  w,
NUMBER  h 
)

Muestra en pantalla la imágen actual que vé la cámara, aplicando un escalado.

Parameters
xcoordinate X where the image is displayed.
ycoordinate Y where the image is displayed.
wThe new image width (in pixels).
hThe new image height (in pixels).
Returns
Nothing.
NUMBER cam.shot ( STRING  path)

Take a snapshot of the current image the camera sees and stores on the route and with the specified name.

Parameters
pathPath and name of the snapshot (.PNG format).
Returns
1/0 It will be 1 if successful, otherwise 0.
IMAGE cam.toimage ( )

Create a copy of the current image the camera sees.

Returns
One object type image, ready for use, or nil if there was an error.
NUMBER cam.direction ( )

It allows to know the direction of the camera lens.

Returns
1/0 It will be 1 in this case towards the user, otherwise 0.
NUMBER cam.brightness ( )

It allows to know the current brightness of the camera.

Returns
The current brightness, a value between 0 and 255, -1 on error.
NIL cam.brightness ( NUMBER  value)

It allows setting the brightness of the camera.

Parameters
valueThe new value for setting the brightness of the camera, values between 0 and 255, the common value is 128.
Returns
Nothing.
NUMBER cam.contrast ( )

It allows to know the current contrast of the camera.

Returns
The current contrast, a value between 0 and 255, -1 on error.
NIL cam.contrast ( NUMBER  value)

It allows setting the contrast of the camera.

Parameters
valueThe new value for setting the contrast of the camera, values between 0 and 255, the common value is 64.
Returns
Nothing.
NUMBER cam.sharpness ( )

It allows to know the current sharpness of the camera.

Returns
The current sharpness, a value between 0 and 255, -1 on error.
NIL cam.sharpness ( NUMBER  value)

It allows setting the sharpness of the camera.

Parameters
valueThe new value for setting the sharpness of the camera, values between 0 and 255, the common value is 0.
Returns
Nothing.
NUMBER cam.saturation ( )

It allows to know the current saturation of the camera.

Returns
The current saturation, a value between 0 and 255, -1 on error.
NIL cam.saturation ( NUMBER  value)

It allows setting the saturation of the camera.

Parameters
valueThe new value for setting the saturation of the camera, values between 0 and 255, the common value is 125.
Returns
Nothing.
NUMBER cam.zoom ( )

It allows to know the current zoom of the camera.

Returns
The current zoom, a value between 1 and 5, -1 on error.
NIL cam.zoom ( NUMBER  value)

It allows setting the zoom of the camera.

Parameters
valueThe new value for setting the zoom of the camera, values between 1 and 5.
Returns
Nothing.
NUMBER cam.evlevel ( )

It allows to know the current evlevel of the camera.

Returns
The current evlevel, a value between 1 and 17, -1 on error.
NIL cam.evlevel ( NUMBER  value)

It allows setting the evlevel of the camera.

Parameters
valueThe new value for setting the evlevel of the camera, values between 1 and 17, the common value is 8.
Returns
Nothing.
NUMBER cam.effect ( )

It allows to know the current effect of the camera.

Returns
The current effect, a value between 1 and 7, -1 on error.
NIL cam.effect ( NUMBER  value)

It allows setting the effect of the camera.

Parameters
valueSome of these constants(in parentheses their numeric values):
  • __CAM_FX_NORMAL (1)
  • __CAM_FX_NEGATIVE (2)
  • __CAM_FX_BLACKWHITE (3)
  • __CAM_FX_SEPIA (4)
  • __CAM_FX_BLUE (5)
  • __CAM_FX_RED (6)
  • __CAM_FX_GREEN (7)
Returns
Nothing.
NUMBER cam.autoreverse ( )

It allows to know the current autoreverse state of the camera.

Returns
1/0 It will be 1 if enabled, otherwise 0.
NIL cam.autoreverse ( NUMBER  mode)

It allows setting the autoreverse of the camera.

Parameters
modeAny of the following values:
  • 1: Activate.
  • 0: Deactivate.
Note
By default it is enabled to start the camera.
Returns
Nothing.
NUMBER cam.mirror ( )

It allows to know the current mirror of the camera.

Returns
The current mirror, -1 on error.
NIL cam.mirror ( NUMBER  value)

It allows setting the mirror of the camera.

Parameters
valueThe new value for setting the mirror of the camera, values between 1 and 0.
Returns
Nothing.
NUMBER cam.term ( )

Unloaded and finish the module.

Note
Once finished the cam module, you can use the USB module.
Returns
1/0 It will be 1 if successful, otherwise 0.