CameraDevice
public protocol CameraDevice
This protocol for information and operations on a camera device.
While connecting, Storages, Status, Images, CameraDeviceSettings and CaptureSettings are cached and updated in the background.
Note
There are cases that Images is not updated (ex: when an image was deleted). In this case, Images can be updated by updateImages method.-
The manufacturer of the camera device.
Declaration
Swift
var manufacturer: String -
The model of the camera device.
Declaration
Swift
var model: String -
The firmware version of the camera device.
Declaration
Swift
var firmwareVersion: String -
The serial number of the camera device.
Declaration
Swift
var serialNumber: String -
The event listeners of the camera device.
Declaration
Swift
var eventListeners: [CameraEventListener] -
addEventListener(queue:listener:)Default implementationAdds the specified event listener to the camera device.
Default Implementation
Declaration
Swift
func addEventListener(queue: DispatchQueue?, listener: CameraEventListener)Parameters
queueThe queue to dispatch event (default: main)
listenerThe event listener
-
Removes the specified event listener from the camera device.
Declaration
Swift
func removeEventListener(listener: CameraEventListener)Parameters
listenerThe event listener
-
The storages of the camera device.
Declaration
Swift
var storages: [CameraStorage] -
The status of the camera device.
Declaration
Swift
var status: CameraStatus -
Latest cached image list retrieved from the camera device.
Declaration
Swift
var images: [CameraImage] -
Updates a cache of image list with retrieving from the camera device.
Declaration
Swift
func updateImages() -> ResponseReturn Value
The operation response
-
Connects the camera device with a specified device interface.
Declaration
Swift
func connect(deviceInterface: DeviceInterface) -> ResponseParameters
deviceInterfaceThe interface for connection
Return Value
The operation response
-
Disconnects the camera device with a specified device interface.
Declaration
Swift
func disconnect(deviceInterface: DeviceInterface) -> ResponseParameters
deviceInterfaceThe interface for connection
Return Value
The operation response
-
Returns
trueif the camera device is connected by the interface.Declaration
Swift
func isConnected(deviceInterface: DeviceInterface) -> BoolParameters
deviceInterfaceThe interface for connection
Return Value
The operation response
-
Starts liveview. LiveViewFrames are received by CameraEventListener class.
Declaration
Swift
func startLiveView() -> ResponseReturn Value
The operation response
-
Stops liveview.
Declaration
Swift
func stopLiveView() -> ResponseReturn Value
The operation response
-
Does auto-focus.
Throws
CameraSDKError.unsupportedOperationIf the camera device is not supportedDeclaration
Swift
func focus() throws -> ResponseReturn Value
The operation response
-
startCapture(withFocus:)Default implementationStarts a capture. This behavior is different depends on the
CaptureMethod. If a capture has been started withCaptureMethod.movie, the capture is stopped bystopCapturemethod.Throws
CameraSDKError.unsupportedOperationIf the camera device is not supportedDefault Implementation
Declaration
Swift
func startCapture(withFocus: Bool) throws -> StartCaptureResponseParameters
withFocustrueIf capturing with doing auto-focus (Only valid forCaptureMethod.stillImage)Return Value
The operation response having the capture
-
Stops the capture. If a capture has been started with
CaptureMethod.movie, the capture is stopped by this method.Throws
CameraSDKError.unsupportedOperationIf the camera device is not supportedDeclaration
Swift
func stopCapture() throws -> ResponseReturn Value
The operation response
-
Gets settings for capture
Declaration
Swift
func getCaptureSettings(settings: [CaptureSetting]) -> ResponseParameters
settingsThe settings
Return Value
The operation response
-
Sets settings for capture
Declaration
Swift
func setCaptureSettings(settings: [CaptureSetting]) -> ResponseParameters
settingsThe settings
Return Value
The operation response
-
Gets settings for camera device
Declaration
Swift
func getCameraDeviceSettings(settings: [CameraDeviceSetting]) -> ResponseParameters
settingsThe settings
Return Value
The operation response
-
Sets settings for camera device
Declaration
Swift
func setCameraDeviceSettings(settings: [CameraDeviceSetting]) -> ResponseParameters
settingsThe settings
Return Value
The operation response
CameraDevice Protocol Reference