Package | com.transmote.flar.source |
Class | public class FLARCameraSource |
Inheritance | FLARCameraSource flash.display.Sprite |
Implements | IFLARSource |
See also
Property | Defined by | ||
---|---|---|---|
cameraIndex : int
the index, in Camera.names, of the active camera.
| FLARCameraSource | ||
inited : Boolean [read-only]
returns true if initialization is complete.
| FLARCameraSource | ||
mirrored : Boolean
set to true to flip the camera image horizontally.
| FLARCameraSource | ||
resultsToDisplayRatio : Number [read-only]
ratio of area of reported results to display size.
| FLARCameraSource | ||
source : BitmapData [read-only]
retrieve the BitmapData source used for analysis.
| FLARCameraSource | ||
sourceSize : Rectangle [read-only]
size of BitmapData source used for analysis.
| FLARCameraSource |
Method | Defined by | ||
---|---|---|---|
constructor.
| FLARCameraSource | ||
dispose():void
halts all processes and frees this instance for garbage collection.
| FLARCameraSource | ||
init(captureWidth:int = 320, captureHeight:int = 240, fps:Number = 30, mirrored:Boolean = true, displayWidth:int = -1, displayHeight:int = -1, downsampleRatio:Number = 0.5):void
Initialize this FLARCameraSource.
| FLARCameraSource | ||
update():void
update the BitmapData source.
| FLARCameraSource | ||
validateCamera(bSuppressReinit:Boolean = false):Boolean
validate that the selected Camera is active,
by checking Camera.activityLevel.
| FLARCameraSource |
cameraIndex | property |
cameraIndex:int
[read-write]the index, in Camera.names, of the active camera. if no camera is currently active, returns -1. setting this value will destroy any active camera, and reinitialize with the camera at the specified index.
Implementation public function get cameraIndex():int
public function set cameraIndex(value:int):void
inited | property |
inited:Boolean
[read-only]returns true if initialization is complete.
Implementation public function get inited():Boolean
mirrored | property |
mirrored:Boolean
[read-write]set to true to flip the camera image horizontally.
Implementation public function get mirrored():Boolean
public function set mirrored(value:Boolean):void
resultsToDisplayRatio | property |
resultsToDisplayRatio:Number
[read-only]ratio of area of reported results to display size. use to scale (multiply) results of FLARToolkit analysis to correctly fit display area.
Implementation public function get resultsToDisplayRatio():Number
source | property |
source:BitmapData
[read-only]retrieve the BitmapData source used for analysis. NOTE: returns the actual BitmapData object, not a clone.
Implementation public function get source():BitmapData
sourceSize | property |
sourceSize:Rectangle
[read-only]size of BitmapData source used for analysis.
Implementation public function get sourceSize():Rectangle
FLARCameraSource | () | constructor |
public function FLARCameraSource()
constructor.
dispose | () | method |
public function dispose():void
halts all processes and frees this instance for garbage collection.
init | () | method |
public function init(captureWidth:int = 320, captureHeight:int = 240, fps:Number = 30, mirrored:Boolean = true, displayWidth:int = -1, displayHeight:int = -1, downsampleRatio:Number = 0.5):void
Initialize this FLARCameraSource.
ParameterscaptureWidth:int (default = 320 ) — width at which to capture video.
|
|
captureHeight:int (default = 240 ) — height at which to capture video.
|
|
fps:Number (default = 30 ) — framerate of camera capture.
|
|
mirrored:Boolean (default = true ) — if true, video is flipped horizontally.
|
|
displayWidth:int (default = -1 ) — width at which to display video.
|
|
displayHeight:int (default = -1 ) — height at which to display video.
|
|
downsampleRatio:Number (default = 0.5 ) — amount to downsample camera input.
The captured video is scaled down by this value
before being sent to FLARToolkit for analysis.
FLARToolkit runs faster with more downsampling,
but also has more difficulty recognizing marker patterns.
a value of 1.0 results in no downsampling;
a value of 0.5 (the default) downsamples the camera input by half.
|
— if no camera is found.
(thrown by this.initCamera, called from this method.)
|
update | () | method |
public function update():void
update the BitmapData source.
validateCamera | () | method |
public function validateCamera(bSuppressReinit:Boolean = false):Boolean
validate that the selected Camera is active, by checking Camera.activityLevel. if camera is not active, FLARCameraSource attempts to reinitialize with next available camera.
ParametersbSuppressReinit:Boolean (default = false ) — if false (default), this method will reinitialize the camera with the next available camera.
|
Boolean — true if selected Camera is active (activityLevel != -1).
|