Name

camera

Synopsis

LZX: camera
JavaScript: lz.camera
Type: Class
Access: public
Topic: Extensions.Audio-Video
Declared in: lps/components/extensions/av/camera.lzx

Superclass Chain

node (LzNode) » mediadevice » camera

Known Subclasses

Details

Properties (7)

bandwidth
<attribute name="bandwidth" value="16384" />
public var bandwidth;
Camera bandwidth (in bytes per second).
favorsize
<attribute name="favorsize" value="false" />
public var favorsize;
Often several capture modes are available per camera device. These modes will allow capturing at a specific size (width/height) and framerate. If you specify both fps and width and height for this camera, this attribute will control which capturing mode for the camera device will be used.
fps
<attribute name="fps" value="null" />
public var fps;
The number of frames per second that will be captured by the camera.
height
<attribute name="height" value="null" />
public var height;
The height (resolution) that will be captured by the camera.
picturequality
<attribute name="picturequality" value="0" />
public var picturequality;
Camera picture quality: a value between 0 and 1, where 1 represents the highest quality (no compression). When 0 is passed, this indicates to use highest quality that fits into the available bandwidth
show
<attribute name="show" value="false" />
private var show;
If true, show camera on immediateparent videoview.
width
<attribute name="width" value="null" />
public var width;
The width (resolution) that will be captured by the camera.

Methods (9)

destroy()
<method name="destroy" />
public function destroy();
getCameraNames()
<method name="getCameraNames" />
public function getCameraNames();
Get the names of the cameras. Returns an array of strings. This might take a while to run, since it has to scan the devices.
_makeDevice()
<method name="_makeDevice" />
private function _makeDevice();
Make the camera.
setMode()
<method name="setMode" args="width, height, fps, favorsize" />
public function setMode(width, height, fps, favorsize);
setMode(width, height, fps, favorsize) width, height, fps: number favorsize: A Boolean value that specifies how to manipulate the width, height, and frame rate if the camera does not have a native mode that meets the specified requirements. The default is true, which means that maintaining capture size is favored; using this parameter selects the mode that most closely matches width and height values, even if doing so adversely affects performance by reducing the frame rate. To maximize frame rate at the expense of camera height and width, pass false for the favorSize parameter. This parameter is optional. The parameters are cached in the attributes width, height, fps and favorsize. TODO: If those attributes are not null, then call setMode automatically after initializing camera. Otherwise read values from camera and set attributes.
setQuality()
<method name="setQuality" args="bandwidth, picturequality" />
public function setQuality(bandwidth, picturequality);
setQuality(bandwidth, picturequality"); bandwidth: in byte per second, default value: 16384 picturequality: number from 0 to 1, default value: 0 0 means also that picturequality will be changed if bandwidth is concerned. The parameters are cached in the attributes bandwidth and picturequality. TODO: If those attributes are set, then call setQuality automatically after initializing camera. Otherwise read values from camera and set attributes.
_setShow()
<method name="_setShow" args="show" />
private function _setShow(show);
Show or hide the camera image on the videoview. If the show parameter is true, then the camera is shown, otherwise it's not shown. Of course the camera will really only be shown if it's also allowed by the user.
_setupDevice()
<method name="_setupDevice" />
private function _setupDevice();
Set up the camera.
startDevice()
<method name="startDevice" />
public function startDevice();
Start the camera.
_updateAllowed()
<method name="_updateAllowed" />
private function _updateAllowed();
Called when the allowed flag changes.

Events (1)

onshow
<attribute name="onshow" />
private event onshow;
Event sent when show flag changes.

LZX Synopsis

<class name="lz.camera" extends=" lz.mediadevice ">
  <attribute name=" bandwidth " value="16384" />
  <attribute name=" favorsize " value="false" />
  <attribute name=" fps " value="null" />
  <attribute name=" height " value="null" />
  <attribute name=" picturequality " value="0" />
  <attribute name=" show " value="false" />
  <attribute name=" width " value="null" />
  <method name=" destroy " />
  <method name=" getCameraNames " />
  <method name=" _makeDevice " />
  <event name=" onshow " />
  <method name=" setMode " args="width, height, fps, favorsize" />
  <method name=" setQuality " args="bandwidth, picturequality" />
  <method name=" _setShow " args="show" />
  <method name=" _setupDevice " />
  <method name=" startDevice " />
  <method name=" _updateAllowed " />
</class>

JavaScript Synopsis

public lz.camera extends  lz.mediadevice  {
  public var bandwidth ;
  public var favorsize ;
  public var fps ;
  public var height ;
  public var picturequality ;
  private var show ;
  public var width ;
  prototype public function destroy ();
  prototype public function getCameraNames ();
  prototype private function _makeDevice ();
  prototype private event onshow ;
  prototype public function setMode (width, height, fps, favorsize);
  prototype public function setQuality (bandwidth, picturequality);
  prototype private function _setShow (show);
  prototype private function _setupDevice ();
  prototype public function startDevice ();
  prototype private function _updateAllowed ();
}