Package | com.distriqt.extension.camera.device |
Interface | public interface CameraDevice extends flash.events.IEventDispatcher |
This class represents the main interface to the camera device.
Property | Defined By | ||
---|---|---|---|
capturingImage : Boolean [read-only]
Whether a capture image process is currently taking
place. | CameraDevice | ||
height : Number [read-only]
The current capture height, in pixels. | CameraDevice | ||
info : CameraDeviceInfo [read-only]
Information about this camera device
| CameraDevice | ||
isRecordingVideo : Boolean [read-only]
Returns true if there is a current video recording session in
progress. | CameraDevice | ||
isRecordingVideoSupported : Boolean [read-only]
Whether the current camera device supports video recording. | CameraDevice | ||
receivedFrames : Number [read-only]
The current frame count received. | CameraDevice | ||
width : Number [read-only]
The current capture width, in pixels. | CameraDevice |
Method | Defined By | ||
---|---|---|---|
captureImage(request:CaptureImageRequest = null):Boolean | CameraDevice | ||
CameraDevice | |||
disconnect():Boolean
Releases any access to the camera the application may hold. | CameraDevice | ||
getCameraModes():Array
Get the available modes of operation for the camera, i.e. | CameraDevice | ||
getFrameBuffer(destination:ByteArray):int
Copies the latest frame captured by the camera to the
supplied byte array. | CameraDevice | ||
getPreviewModes():Array
Get the available preview modes of operation for the camera,
i.e. | CameraDevice | ||
isCameraModeSupported(mode:CameraMode):Boolean
Whether the specified mode is supported on the current
device. | CameraDevice | ||
isExposureSupported(mode:String):Boolean
Whether the exposure mode is supported on the specified camera device
| CameraDevice | ||
isFlashSupported():Boolean
Whether the flash mode is supported on the specified camera device
| CameraDevice | ||
isFocusSupported(mode:String):Boolean
Whether the focus mode is supported on the specified camera device
| CameraDevice | ||
isPreviewModeSupported(mode:CameraMode):Boolean
Whether the specified preview mode is supported on the current device. | CameraDevice | ||
isTorchSupported():Boolean
Whether the torch mode is supported on the specified camera device
| CameraDevice | ||
isWhiteBalanceSupported(mode:String):Boolean
Whether the White balance mode is supported on the specified camera device
| CameraDevice | ||
setCameraMode(mode:CameraMode):Boolean
Allows you to control the capture mode of the camera. | CameraDevice | ||
setExposureMode(mode:String):Boolean
Sets the exposure mode from one of the available modes. | CameraDevice | ||
setExposurePointOfInterest(point:Point):Boolean
This function sets the point of interest for the camera use for exposure settings. | CameraDevice | ||
setFlashMode(mode:String):Boolean
Sets the mode for the flash on the camera
| CameraDevice | ||
setFocusMode(mode:String):Boolean
Sets the focus mode from one of the available focus modes. | CameraDevice | ||
setFocusPointOfInterest(point:Point):Boolean
This function sets the point of interest for the camera to focus on. | CameraDevice | ||
setPreviewMode(mode:CameraMode):Boolean
Allows you to control the mode of operation of the camera. | CameraDevice | ||
setWhiteBalanceMode(mode:String):Boolean
Sets the white balance mode from one of the available modes. | CameraDevice | ||
startRecordingVideo(path:String, options:VideoOptions = null):Boolean
Starts recording video (and audio) to the specified file
location. | CameraDevice | ||
stopRecordingVideo():Boolean
Stops any video recording session that is currently in progress. | CameraDevice |
capturingImage | property |
capturingImage:Boolean
[read-only]
Whether a capture image process is currently taking place. If this is true then any calls to captureImage will fail.
public function get capturingImage():Boolean
See also
height | property |
height:Number
[read-only] The current capture height, in pixels.
public function get height():Number
info | property |
info:CameraDeviceInfo
[read-only]
Information about this camera device
public function get info():CameraDeviceInfo
isRecordingVideo | property |
isRecordingVideo:Boolean
[read-only]
Returns true if there is a current video recording session in progress.
public function get isRecordingVideo():Boolean
isRecordingVideoSupported | property |
isRecordingVideoSupported:Boolean
[read-only]
Whether the current camera device supports video recording.
You must initialise the camera before calling this.
public function get isRecordingVideoSupported():Boolean
receivedFrames | property |
receivedFrames:Number
[read-only]
The current frame count received. This starts from 0 when the initialise function is called for the first time and then increments with each frame received by the camera.
public function get receivedFrames():Number
width | property |
width:Number
[read-only] The current capture width, in pixels.
public function get width():Number
captureImage | () | method |
public function captureImage(request:CaptureImageRequest = null):Boolean
Parameters
request:CaptureImageRequest (default = null ) — Defines the parameters of the capture image such as saving to camera roll etc
|
Boolean — true if the capture process was started successfully. This may fail if there is
already a capture in progress or if the camera is not initialised or if the
device doesn't support this functionality.
|
See also
captureImageResult | () | method |
disconnect | () | method |
public function disconnect():Boolean
Releases any access to the camera the application may hold.
This will force any recording or other activities to stop so you should finalise any active operations before calling this function.
Any calls to this device after calling this function will be invalid.
ReturnsBoolean |
getCameraModes | () | method |
public function getCameraModes():Array
Get the available modes of operation for the camera, i.e. the list of resolutions that the camera can support when capturing images.
ReturnsArray |
getFrameBuffer | () | method |
public function getFrameBuffer(destination:ByteArray):int
Copies the latest frame captured by the camera to the supplied byte array.
The returned data will be in little endian format which we set on the ByteArray instance. Additionally we reset the position to the start of the ByteArray so it will be ready for use immediately after a call to this function.
Parameters
destination:ByteArray — A valid ByteArray instance to write the frame data into
|
int — The index of the received frame data, -1 if there was an error, eg the ByteArray was invalid
|
See also
var videoDataByteArray:ByteArray = new ByteArray(); Camera.instance.getFrameBuffer( videoDataByteArray ); bitmapData.setPixels( new Rectangle( 0, 0, Camera.instance.width, Camera.instance.height ), videoDataByteArray );
getPreviewModes | () | method |
public function getPreviewModes():Array
Get the available preview modes of operation for the camera, i.e. the list of resolutions that the camera can support for preview frames.
ReturnsArray |
isCameraModeSupported | () | method |
public function isCameraModeSupported(mode:CameraMode):Boolean
Whether the specified mode is supported on the current device. See the list of modes in the CameraModes class.
Parameters
mode:CameraMode — The camera mode to check support for
|
Boolean — true if the mode is supported on the device
|
See also
isExposureSupported | () | method |
public function isExposureSupported(mode:String):Boolean
Whether the exposure mode is supported on the specified camera device
Parameters
mode:String — The exposure mode to check support for
|
Boolean — true if the mode is supported on the device
|
isFlashSupported | () | method |
public function isFlashSupported():Boolean
Whether the flash mode is supported on the specified camera device
ReturnsBoolean — true if it is supported
|
isFocusSupported | () | method |
public function isFocusSupported(mode:String):Boolean
Whether the focus mode is supported on the specified camera device
Parameters
mode:String — The focus mode to check support for
|
Boolean — true if the mode is supported on the device
|
isPreviewModeSupported | () | method |
public function isPreviewModeSupported(mode:CameraMode):Boolean
Whether the specified preview mode is supported on the current device.
Parameters
mode:CameraMode — The camera mode to check support for
|
Boolean — true if the mode is supported on the device
|
See also
isTorchSupported | () | method |
public function isTorchSupported():Boolean
Whether the torch mode is supported on the specified camera device
ReturnsBoolean — true if it is supported
|
isWhiteBalanceSupported | () | method |
public function isWhiteBalanceSupported(mode:String):Boolean
Whether the White balance mode is supported on the specified camera device
Parameters
mode:String — The white balance mode to check support for
|
Boolean — true if the mode is supported on the device
|
setCameraMode | () | method |
public function setCameraMode(mode:CameraMode):Boolean
Allows you to control the capture mode of the camera.
You must have called initialise
before using
this function. You can set the initial mode by passing the options into
the initialise function.
Parameters
mode:CameraMode |
Boolean —
|
setExposureMode | () | method |
public function setExposureMode(mode:String):Boolean
Sets the exposure mode from one of the available modes.
Parameters
mode:String — The exposure mode to set
|
Boolean — true if the mode was set correctly
|
See also
setExposurePointOfInterest | () | method |
public function setExposurePointOfInterest(point:Point):Boolean
This function sets the point of interest for the camera use for exposure settings.
This property represents a point where {0,0} corresponds to the top left of the picture area, and {1,1} corresponds to the bottom right in landscape mode with the home button on the right—this applies even if the device is in portrait mode.
Parameters
point:Point — The coordinates of the point of interest to set
|
Boolean |
setFlashMode | () | method |
public function setFlashMode(mode:String):Boolean
Sets the mode for the flash on the camera
Parameters
mode:String — The flash mode to set from the available modes in CameraParameters.
|
Boolean |
Error — If there was a problem creating or accessing the extension, or if the key is invalid
|
See also
setFocusMode | () | method |
public function setFocusMode(mode:String):Boolean
Sets the focus mode from one of the available focus modes.
Parameters
mode:String — The focus mode to set
|
Boolean — true if the mode was set correctly
|
See also
setFocusPointOfInterest | () | method |
public function setFocusPointOfInterest(point:Point):Boolean
This function sets the point of interest for the camera to focus on.
This property represents a point where {0,0} corresponds to the top left of the picture area, and {1,1} corresponds to the bottom right in landscape mode with the home button on the right—this applies even if the device is in portrait mode.
Parameters
point:Point — The coordinates of the point of interest to set
|
Boolean |
setPreviewMode | () | method |
public function setPreviewMode(mode:CameraMode):Boolean
Allows you to control the mode of operation of the camera.
Parameters
mode:CameraMode |
Boolean —
|
setWhiteBalanceMode | () | method |
public function setWhiteBalanceMode(mode:String):Boolean
Sets the white balance mode from one of the available modes.
Parameters
mode:String — The white balance mode to set
|
Boolean — true if the mode was set correctly
|
See also
startRecordingVideo | () | method |
public function startRecordingVideo(path:String, options:VideoOptions = null):Boolean
Starts recording video (and audio) to the specified file location.
Parameters
path:String | |
options:VideoOptions (default = null )
|
Boolean — true if video recording was started successfully.
false if the path was invalid or
if a file already exists at that location or
if there is already a recording in progress.
|
stopRecordingVideo | () | method |
public function stopRecordingVideo():Boolean
Stops any video recording session that is currently in progress.
ReturnsBoolean |