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
queue
The queue to dispatch event (default: main)
listener
The event listener
-
Removes the specified event listener from the camera device.
Declaration
Swift
func removeEventListener(listener: CameraEventListener)
Parameters
listener
The 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() -> Response
Return Value
The operation response
-
Connects the camera device with a specified device interface.
Declaration
Swift
func connect(deviceInterface: DeviceInterface) -> Response
Parameters
deviceInterface
The interface for connection
Return Value
The operation response
-
Disconnects the camera device with a specified device interface.
Declaration
Swift
func disconnect(deviceInterface: DeviceInterface) -> Response
Parameters
deviceInterface
The interface for connection
Return Value
The operation response
-
Returns
true
if the camera device is connected by the interface.Declaration
Swift
func isConnected(deviceInterface: DeviceInterface) -> Bool
Parameters
deviceInterface
The interface for connection
Return Value
The operation response
-
Starts liveview. LiveViewFrames are received by CameraEventListener class.
Declaration
Swift
func startLiveView() -> Response
Return Value
The operation response
-
Stops liveview.
Declaration
Swift
func stopLiveView() -> Response
Return Value
The operation response
-
Does auto-focus.
Throws
CameraSDKError.unsupportedOperation
If the camera device is not supportedDeclaration
Swift
func focus() throws -> Response
Return 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 bystopCapture
method.Throws
CameraSDKError.unsupportedOperation
If the camera device is not supportedDefault Implementation
Declaration
Swift
func startCapture(withFocus: Bool) throws -> StartCaptureResponse
Parameters
withFocus
true
If 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.unsupportedOperation
If the camera device is not supportedDeclaration
Swift
func stopCapture() throws -> Response
Return Value
The operation response
-
Gets settings for capture
Declaration
Swift
func getCaptureSettings(settings: [CaptureSetting]) -> Response
Parameters
settings
The settings
Return Value
The operation response
-
Sets settings for capture
Declaration
Swift
func setCaptureSettings(settings: [CaptureSetting]) -> Response
Parameters
settings
The settings
Return Value
The operation response
-
Gets settings for camera device
Declaration
Swift
func getCameraDeviceSettings(settings: [CameraDeviceSetting]) -> Response
Parameters
settings
The settings
Return Value
The operation response
-
Sets settings for camera device
Declaration
Swift
func setCameraDeviceSettings(settings: [CameraDeviceSetting]) -> Response
Parameters
settings
The settings
Return Value
The operation response