| Package | metaio.camera |
| Class | public class ARCamera |
| Inheritance | ARCamera flash.display.Sprite |
| Method | Defined By | ||
|---|---|---|---|
ARCamera(trackWidth:int, trackHeight:int, videoWidth:int, videoHeight:int, fps:Number)
First camera setup
| ARCamera | ||
activateCamera():void
Activates the first camera found. | ARCamera | ||
activateCameraByIndex(cameraIdx:int = 0):void
Activates the camera. | ARCamera | ||
activateCameraByName(cameraName:String = null):void
Activates the camera. | ARCamera | ||
getCameraHeight():int
Get camera resolution. | ARCamera | ||
getCameraList():Array
Retrieve the list of available cameras
| ARCamera | ||
getCameraWidth():int
Get camera resolution. | ARCamera | ||
getChannels():int
Get the number of channels of frame as returned by getCurrentFrame() methods. | ARCamera | ||
getCurrentCamera():Camera
Get current Camera object
| ARCamera | ||
getCurrentFrame(flip:Boolean = false):ByteArray
Grab current frame from the camera
This function is usually used for tracking. | ARCamera | ||
getTrackingHeight():int
Get the vertical resolution of images passed to tracking system. | ARCamera | ||
getTrackingWidth():int
Get the horizontal resolution of images passed to tracking system. | ARCamera | ||
getVideo():Video
Get the video object of the camera
| ARCamera | ||
isInitialized():Boolean
Get current initialization state of the camera. | ARCamera | ||
setMirrorMode(mirrored:Boolean):void
Sets the mirror-mode of the camera image on the stage. | ARCamera | ||
setVideoSmoothing(smooth:Boolean):void
Enable video smoothing when displaying the camera video stream. | ARCamera | ||
| ARCamera | () | Constructor |
public function ARCamera(trackWidth:int, trackHeight:int, videoWidth:int, videoHeight:int, fps:Number)First camera setup
ParameterstrackWidth:int — is the width of frame which will be passed to tracking
| |
trackHeight:int — is the height of frame which will be passed to tracking
| |
videoWidth:int — is the horizontal resolution of the camera stream
| |
videoHeight:int — is the vertical resolution of the camera stream
| |
fps:Number — Application Framerate
|
| activateCamera | () | method |
public function activateCamera():voidActivates the first camera found. This can not be done automatically in the Constructor or an error can't be properly reported to the main application (through events).
| activateCameraByIndex | () | method |
public function activateCameraByIndex(cameraIdx:int = 0):voidActivates the camera. This can not be done automatically in the Constructor or an error can't be properly reported to the main application (through events).
Parameters
cameraIdx:int (default = 0) — is the index of the camera in the camera list (as String) as returned by getCameraList(). If not set then the camera will be choosen automatically
|
| activateCameraByName | () | method |
public function activateCameraByName(cameraName:String = null):voidActivates the camera. This can not be done automatically in the Constructor or an error can't be properly reported to the main application (through events).
Parameters
cameraName:String (default = null) — cameraName Name of the camera as given by getCameraList. If not set the camera will be choosen automatically.
|
| getCameraHeight | () | method |
public function getCameraHeight():intGet camera resolution.
Returnsint — The height of the camera stream.
|
| getCameraList | () | method |
public function getCameraList():ArrayRetrieve the list of available cameras
ReturnsArray — Array whith names of available cameras
|
| getCameraWidth | () | method |
public function getCameraWidth():intGet camera resolution.
Returnsint — The width of the camera stream.
|
| getChannels | () | method |
public function getChannels():intGet the number of channels of frame as returned by getCurrentFrame() methods.
Returnsint — Number of channels.
|
| getCurrentCamera | () | method |
public function getCurrentCamera():CameraGet current Camera object
ReturnsCamera — Current camera object is camera is choosen, null otherwise
|
| getCurrentFrame | () | method |
public function getCurrentFrame(flip:Boolean = false):ByteArrayGrab current frame from the camera This function is usually used for tracking. The function returns the actual frame in camera's native resolution (not scaled or filtered). The flip-paramter works independently of the mirror-mode. The flipping relates to the raw camera image.
Parameters
flip:Boolean (default = false) — if set to true returned frame will be horizontally flipped, independently of the mirror-mode.
|
ByteArray — Current camera frame as bytearray
|
| getTrackingHeight | () | method |
public function getTrackingHeight():intGet the vertical resolution of images passed to tracking system. Usually it is lower than the camera resolution.
Returnsint — The vertical resolution.
|
| getTrackingWidth | () | method |
public function getTrackingWidth():intGet the horizontal resolution of images passed to tracking system. Usually it is lower than the camera resolution.
Returnsint — The horizontal resolution.
|
| getVideo | () | method |
public function getVideo():VideoGet the video object of the camera
ReturnsVideo |
| isInitialized | () | method |
public function isInitialized():BooleanGet current initialization state of the camera.
ReturnsBoolean — True if camera is initialized, otherwise false
|
| setMirrorMode | () | method |
public function setMirrorMode(mirrored:Boolean):voidSets the mirror-mode of the camera image on the stage. - true: The visual camera image is flipped, so that one would look into a mirror, if the camera is mounted on top of the screen. - false: The camera image is not flipped. Good for see-through applications.
Parameters
mirrored:Boolean — True, the camera image is mirrored, otherwise not.
|
| setVideoSmoothing | () | method |
public function setVideoSmoothing(smooth:Boolean):voidEnable video smoothing when displaying the camera video stream.
Parameters
smooth:Boolean — set to true in order to enable smoothing.
|