Skip to content

Commit 6710c2a

Browse files
committed
first commit
0 parents  commit 6710c2a

22 files changed

+1979
-0
lines changed

.gitignore

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
build/
2+
*.pbxuser
3+
!default.pbxuser
4+
*.mode1v3
5+
!default.mode1v3
6+
*.mode2v3
7+
!default.mode2v3
8+
*.perspectivev3
9+
!default.perspectivev3
10+
xcuserdata
11+
*.xccheckout
12+
*.moved-aside
13+
DerivedData
14+
*.hmap
15+
*.ipa
16+
*.xcuserstate
17+
18+
# CocoaPod
19+
Pods/*
20+
Podfile.lock
21+
examples/Sample/Pods/*
22+
23+
24+
# others
25+
*.swp
26+
!.gitkeep
27+
.DS_Store

Podfile

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
source 'https://github.com/CocoaPods/Specs.git'
2+
platform :ios, '8'
3+
4+
pod 'pop'

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# STPCamera
2+
Camera for continuous shooting
3+

STPCamera.xcodeproj/project.pbxproj

+411
Large diffs are not rendered by default.

STPCamera.xcodeproj/project.xcworkspace/contents.xcworkspacedata

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

STPCamera.xcworkspace/contents.xcworkspacedata

+10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

STPCamera/AppDelegate.h

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//
2+
// AppDelegate.h
3+
// STPCamera
4+
//
5+
// Created by Norikazu on 2015/07/13.
6+
// Copyright © 2015年 Stamp inc. All rights reserved.
7+
//
8+
9+
#import <UIKit/UIKit.h>
10+
#import "STPCameraViewController.h"
11+
12+
@interface AppDelegate : UIResponder <UIApplicationDelegate>
13+
14+
@property (strong, nonatomic) UIWindow *window;
15+
16+
17+
@end
18+

STPCamera/AppDelegate.m

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
//
2+
// AppDelegate.m
3+
// STPCamera
4+
//
5+
// Created by Norikazu on 2015/07/13.
6+
// Copyright © 2015年 Stamp inc. All rights reserved.
7+
//
8+
9+
#import "AppDelegate.h"
10+
11+
@interface AppDelegate ()
12+
13+
@end
14+
15+
@implementation AppDelegate
16+
17+
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
18+
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
19+
self.window.rootViewController = [STPCameraViewController new];
20+
[self.window makeKeyAndVisible];
21+
return YES;
22+
}
23+
24+
25+
@end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "iphone",
5+
"size" : "29x29",
6+
"scale" : "2x"
7+
},
8+
{
9+
"idiom" : "iphone",
10+
"size" : "29x29",
11+
"scale" : "3x"
12+
},
13+
{
14+
"idiom" : "iphone",
15+
"size" : "40x40",
16+
"scale" : "2x"
17+
},
18+
{
19+
"idiom" : "iphone",
20+
"size" : "40x40",
21+
"scale" : "3x"
22+
},
23+
{
24+
"idiom" : "iphone",
25+
"size" : "60x60",
26+
"scale" : "2x"
27+
},
28+
{
29+
"idiom" : "iphone",
30+
"size" : "60x60",
31+
"scale" : "3x"
32+
}
33+
],
34+
"info" : {
35+
"version" : 1,
36+
"author" : "xcode"
37+
}
38+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8150" systemVersion="15A204g" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
3+
<dependencies>
4+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8122"/>
5+
</dependencies>
6+
<scenes>
7+
<!--View Controller-->
8+
<scene sceneID="EHf-IW-A2E">
9+
<objects>
10+
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
11+
<layoutGuides>
12+
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
13+
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
14+
</layoutGuides>
15+
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
16+
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
17+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
18+
<animations/>
19+
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
20+
</view>
21+
</viewController>
22+
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
23+
</objects>
24+
<point key="canvasLocation" x="53" y="375"/>
25+
</scene>
26+
</scenes>
27+
</document>

STPCamera/Info.plist

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>en</string>
7+
<key>CFBundleExecutable</key>
8+
<string>$(EXECUTABLE_NAME)</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundleName</key>
14+
<string>$(PRODUCT_NAME)</string>
15+
<key>CFBundlePackageType</key>
16+
<string>APPL</string>
17+
<key>CFBundleShortVersionString</key>
18+
<string>1.0</string>
19+
<key>CFBundleSignature</key>
20+
<string>????</string>
21+
<key>CFBundleVersion</key>
22+
<string>1</string>
23+
<key>LSRequiresIPhoneOS</key>
24+
<true/>
25+
<key>UILaunchStoryboardName</key>
26+
<string>LaunchScreen</string>
27+
<key>UIRequiredDeviceCapabilities</key>
28+
<array>
29+
<string>armv7</string>
30+
</array>
31+
<key>UISupportedInterfaceOrientations</key>
32+
<array>
33+
<string>UIInterfaceOrientationPortrait</string>
34+
<string>UIInterfaceOrientationLandscapeRight</string>
35+
<string>UIInterfaceOrientationLandscapeLeft</string>
36+
</array>
37+
</dict>
38+
</plist>

STPCamera/NSDateFormatter+Exif.h

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//
2+
// NSDateFormatter+Exif.h
3+
// STPCamera
4+
//
5+
// Created by 1amageek on 2015/10/31.
6+
// Copyright © 2015年 Stamp inc. All rights reserved.
7+
//
8+
9+
#import <Foundation/Foundation.h>
10+
11+
@interface NSDateFormatter (Exif)
12+
13+
+ (NSDateFormatter *)exifDateFormatter;
14+
+ (NSDateFormatter *)GPSDateFormatter;
15+
+ (NSDateFormatter *)GPSTimeFormatter;
16+
+ (NSDateFormatter *)fileNameDateFormatter;
17+
18+
@end

STPCamera/NSDateFormatter+Exif.m

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
//
2+
// NSDateFormatter+Exif.m
3+
// STPCamera
4+
//
5+
// Created by 1amageek on 2015/10/31.
6+
// Copyright © 2015年 Stamp inc. All rights reserved.
7+
//
8+
9+
#import "NSDateFormatter+Exif.h"
10+
11+
@implementation NSDateFormatter (Exif)
12+
13+
+ (NSDateFormatter *)exifDateFormatter
14+
{
15+
static NSDateFormatter *dateFormatter;
16+
17+
if (!dateFormatter) {
18+
dateFormatter = [[NSDateFormatter alloc] init];
19+
dateFormatter.dateFormat = @"yyyy:MM:dd HH:mm:ss";
20+
}
21+
22+
return dateFormatter;
23+
}
24+
25+
+ (NSDateFormatter *)GPSDateFormatter
26+
{
27+
static NSDateFormatter *dateFormatter;
28+
29+
if (!dateFormatter) {
30+
dateFormatter = [[NSDateFormatter alloc] init];
31+
dateFormatter.dateFormat = @"yyyy:MM:dd";
32+
dateFormatter.timeZone = [NSTimeZone timeZoneWithAbbreviation:@"UTC"];
33+
}
34+
35+
return dateFormatter;
36+
}
37+
38+
+ (NSDateFormatter *)GPSTimeFormatter
39+
{
40+
static NSDateFormatter *dateFormatter;
41+
42+
if (!dateFormatter) {
43+
dateFormatter = [[NSDateFormatter alloc] init];
44+
dateFormatter.dateFormat = @"HH:mm:ss.SSSSSS";
45+
dateFormatter.timeZone = [NSTimeZone timeZoneWithAbbreviation:@"UTC"];
46+
}
47+
48+
return dateFormatter;
49+
}
50+
51+
+ (NSDateFormatter *)fileNameDateFormatter
52+
{
53+
static NSDateFormatter *dateFormatter;
54+
55+
if (!dateFormatter) {
56+
dateFormatter = [[NSDateFormatter alloc] init];
57+
dateFormatter.dateFormat = @"yyyyMMddHHmmss";
58+
}
59+
60+
return dateFormatter;
61+
}
62+
63+
@end

STPCamera/STPCameraManager.h

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
//
2+
// STPCameraManager.h
3+
// STPCamera
4+
//
5+
// Created by 1amageek on 2015/10/30.
6+
// Copyright © 2015年 Stamp inc. All rights reserved.
7+
//
8+
9+
@import UIKit;
10+
@import AVFoundation;
11+
@import CoreMotion;
12+
@import CoreLocation;
13+
@import ImageIO;
14+
15+
@protocol STPCameraManagerDelegate;
16+
@interface STPCameraManager : NSObject <CLLocationManagerDelegate>
17+
18+
@property (nonatomic, weak) id <STPCameraManagerDelegate> delegate;
19+
20+
@property (nonatomic) AVCaptureSession *captureSession;
21+
@property (nonatomic) AVCaptureDeviceInput *deviceInput;
22+
@property (nonatomic) AVCaptureStillImageOutput *stillImageOut;
23+
@property (nonatomic, readonly) UIDeviceOrientation deviceOrientation;
24+
@property (nonatomic, readonly) UIInterfaceOrientation interfaceOrientation;
25+
26+
@property (nonatomic, readonly) BOOL hasMultipleCameras;
27+
@property (nonatomic, readonly) BOOL hasFlash;
28+
@property (nonatomic, readonly) BOOL isTraking;
29+
30+
@property (nonatomic, readonly) CMMotionManager* motionManager;
31+
@property (nonatomic, readonly) CLLocationManager *locationManager;
32+
33+
34+
+ (instancetype)sharedManager;
35+
- (void)start;
36+
37+
- (void)changeCamara;
38+
- (void)setFlashMode:(AVCaptureFlashMode)flashMode;
39+
40+
41+
- (void)captureImageWithCompletionHandler:(void (^)(UIImage *image, CLLocation *location, NSDictionary *metaData, NSError *error))handler;
42+
- (CGPoint)convertToPointOfInterestFrom:(CGRect)frame coordinates:(CGPoint)viewCoordinates layer:(AVCaptureVideoPreviewLayer *)layer;
43+
44+
45+
- (void)optimizeAtPoint:(CGPoint)point;
46+
- (void)focusAtPoint:(CGPoint)point;
47+
- (void)exposureAtPoint:(CGPoint)point;
48+
49+
- (void)terminate;
50+
51+
@end
52+
53+
@protocol STPCameraManagerDelegate <NSObject>
54+
55+
- (void)cameraManager:(STPCameraManager *)manager readyForLocationManager:(CLLocationManager *)locationManager;
56+
- (void)cameraManager:(STPCameraManager *)manager error:(NSError *)error;
57+
58+
@end

0 commit comments

Comments
 (0)