+ All Categories

QXCameraKit

Date post: 06-Aug-2015
Category:
Upload: hirakawa-akira
View: 116 times
Download: 0 times
Share this document with a friend
22
QXCameraKit by akira hirakawa
Transcript

QXCameraKitby akira hirakawa

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

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/

Sony lens camera

● the API is open to developers● https://developer.sony.com/develop/cameras

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

Overview

Device Discovery

1. discovery request is sent to reserved address2. access to device description

Discovery Request

Device Description

API Call

APIs

● zoom● white balance● exposure● take picture● ISO speed● liveviewetc...

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

Next

● make camera app utilizing this library

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

Questions?