Date post: | 06-Aug-2015 |
Category: |
Devices & Hardware |
Upload: | hirakawa-akira |
View: | 116 times |
Download: | 0 times |
Agenda
1. Sony lens camera2. QXCamerakit3. Swift4. Demo
* images in this slides are from sony’s website
About me
● Akira Hirakawa● VP Engineering at Burpple● recently Ruby,iOS,SEO,etc● https://github.com/akirahrkw● http://www.akirahrkw.com
Sony lens camera
● released in 2013● QX series (QX10, QX100, QX30, etc)● for smartphone (ios,android)● controllable and attachable to smartphone● Sony has an official camera app for this
camera https://playmemoriesonline.com/
Overview
● server-client model● camera is used as a server● smartphone is a client● communication via HTTP,JSON● phone connects to camera through Wi-Fi● each action(ex:zoom-in,focus) has an API
QXCameraKit
● https://github.com/akirahrkw/QXCameraKit ● http://cocoadocs.
org/docsets/QXCameraKit/0.1.0/● API library for lens camera● written by swift(80%) and objc(20%)● easy and simple to use:)
QXCameraKitvar manager = QXAPIManager()
// this method does Discovery Request and get Device Description
manager.openConnection({ [unowned self] (result:Bool, error:NSError?) -> () in
if(result) {
// this method gets live image to display on your device
manager.startLiveImage({ [unowned self] (image:UIImage, error:NSError?) -> () in
…
...
self.liveViewImage.image = croppedImage
})
} else {
….
}
})
QXCameraKitfunc didTapLongPressedZoomIn(gesture:UILongPressGestureRecognizer) {
switch(gesture.state) {
case .Began:
manager.api?.startZoomIn({ [unowned self] (json:NSDictionary, isSucceeded:Bool) -> () in
...
}
break
case .Ended:
manager.api?.stopZoomIn({ [unowned self] (json:NSDictionary, isSucceeded:Bool) -> () in
...
}
break
…
}
}
Swift
● currently swift doesn’t have a way to convert a swift function to a C function pointer
● this library uses CFSocketCreate which uses C function pointer. so it needs to use objc
Demo
● https://github.com/akirahrkw/SampleQXCameraKit
● http://instagram.com/p/txmivXPIm7/
Thanks
● [email protected]● http://www.akirahrkw.com● https://github.com/akirahrkw/QXCameraKit● http://www.slideshare.
net/akirahrkw/qxcamerakit
We need you
● looking for ios, ruby engineer, web designer● challenging projects at Burpple
○ apple watch○ swift○ ios / android / web app
● full-time / intern● [email protected]● http://www.burpple.com/jobs