Skip to content
This repository was archived by the owner on Jun 12, 2019. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions ALCameraViewController.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@
objects = {

/* Begin PBXBuildFile section */
B2357AB11FA50D51003F9ACF /* FilterViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = B2357AAF1FA50D51003F9ACF /* FilterViewController.xib */; };
B2357AB21FA50D51003F9ACF /* FilterViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2357AB01FA50D51003F9ACF /* FilterViewController.swift */; };
B2357AB31FA50E13003F9ACF /* FilterViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2357AB01FA50D51003F9ACF /* FilterViewController.swift */; };
B2357AB41FA50E13003F9ACF /* FilterViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = B2357AAF1FA50D51003F9ACF /* FilterViewController.xib */; };
B2357AB91FA51156003F9ACF /* UIImageView+Filter.m in Sources */ = {isa = PBXBuildFile; fileRef = B2357AB61FA51155003F9ACF /* UIImageView+Filter.m */; };
B2357ABA1FA51156003F9ACF /* UIImage+Filter.m in Sources */ = {isa = PBXBuildFile; fileRef = B2357AB71FA51156003F9ACF /* UIImage+Filter.m */; };
B2357ABB1FA5115C003F9ACF /* UIImage+Filter.h in Headers */ = {isa = PBXBuildFile; fileRef = B2357AB81FA51156003F9ACF /* UIImage+Filter.h */; };
B2357ABC1FA5115C003F9ACF /* UIImage+Filter.m in Sources */ = {isa = PBXBuildFile; fileRef = B2357AB71FA51156003F9ACF /* UIImage+Filter.m */; };
B2357ABD1FA5115C003F9ACF /* UIImageView+Filter.h in Headers */ = {isa = PBXBuildFile; fileRef = B2357AB51FA51155003F9ACF /* UIImageView+Filter.h */; };
B2357ABE1FA5115C003F9ACF /* UIImageView+Filter.m in Sources */ = {isa = PBXBuildFile; fileRef = B2357AB61FA51155003F9ACF /* UIImageView+Filter.m */; };
B2357ABF1FA511DC003F9ACF /* CameraViewController-Bridging-Header.h in Headers */ = {isa = PBXBuildFile; fileRef = E33BE72F1F54955E005842DC /* CameraViewController-Bridging-Header.h */; };
BF5861F31F613FB800B406F6 /* CropViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = BF5861F61F613FB800B406F6 /* CropViewController.xib */; };
BF5861F41F613FB800B406F6 /* CropViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = BF5861F61F613FB800B406F6 /* CropViewController.xib */; };
BF5861F81F61404C00B406F6 /* ConfirmViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = BF5861FB1F61404C00B406F6 /* ConfirmViewController.xib */; };
Expand Down Expand Up @@ -74,6 +85,12 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
B2357AAF1FA50D51003F9ACF /* FilterViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = FilterViewController.xib; sourceTree = "<group>"; };
B2357AB01FA50D51003F9ACF /* FilterViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FilterViewController.swift; sourceTree = "<group>"; };
B2357AB51FA51155003F9ACF /* UIImageView+Filter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImageView+Filter.h"; sourceTree = "<group>"; };
B2357AB61FA51155003F9ACF /* UIImageView+Filter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImageView+Filter.m"; sourceTree = "<group>"; };
B2357AB71FA51156003F9ACF /* UIImage+Filter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+Filter.m"; sourceTree = "<group>"; };
B2357AB81FA51156003F9ACF /* UIImage+Filter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+Filter.h"; sourceTree = "<group>"; };
BF5862001F625D0F00B406F6 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/CameraView.strings; sourceTree = "<group>"; };
BF5862021F625D1200B406F6 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/CameraView.strings"; sourceTree = "<group>"; };
C40665431C73A47C00EB9751 /* SingleImageSaver.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SingleImageSaver.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -157,6 +174,8 @@
E3669CC41F96848D00CCDD01 /* CameraViewController.xib */,
FA7E6B9A1B429012000E1B14 /* CropViewController.swift */,
BF5861F61F613FB800B406F6 /* CropViewController.xib */,
B2357AB01FA50D51003F9ACF /* FilterViewController.swift */,
B2357AAF1FA50D51003F9ACF /* FilterViewController.xib */,
E35A240E1F50B49A001047FD /* ConfirmViewController.swift */,
BF5861FB1F61404C00B406F6 /* ConfirmViewController.xib */,
);
Expand All @@ -180,6 +199,10 @@
children = (
E33BE71B1F5134C1005842DC /* CIImage+Utilities.m */,
E33BE71C1F5134C1005842DC /* CIImage+Utilities.h */,
B2357AB81FA51156003F9ACF /* UIImage+Filter.h */,
B2357AB71FA51156003F9ACF /* UIImage+Filter.m */,
B2357AB51FA51155003F9ACF /* UIImageView+Filter.h */,
B2357AB61FA51155003F9ACF /* UIImageView+Filter.m */,
FAB50BF01B413E8C009905B9 /* ImageFetcher.swift */,
C40665431C73A47C00EB9751 /* SingleImageSaver.swift */,
C40665471C73B72D00EB9751 /* SingleImageFetcher.swift */,
Expand Down Expand Up @@ -257,9 +280,12 @@
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
B2357ABB1FA5115C003F9ACF /* UIImage+Filter.h in Headers */,
E33BE7271F546920005842DC /* IRLRectangleFeature+Extensions.h in Headers */,
E33BE71F1F5134C1005842DC /* CIImage+Utilities.h in Headers */,
B2357ABF1FA511DC003F9ACF /* CameraViewController-Bridging-Header.h in Headers */,
E33BE72E1F5494EC005842DC /* CameraViewController.h in Headers */,
B2357ABD1FA5115C003F9ACF /* UIImageView+Filter.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -353,6 +379,7 @@
E3669CC21F96848D00CCDD01 /* CameraViewController.xib in Resources */,
BF5861F91F61404C00B406F6 /* ConfirmViewController.xib in Resources */,
C482A0151CAEB1B100541D08 /* CameraViewAssets.xcassets in Resources */,
B2357AB41FA50E13003F9ACF /* FilterViewController.xib in Resources */,
BF5861F41F613FB800B406F6 /* CropViewController.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -368,6 +395,7 @@
FAF0584C1B31618D008E5592 /* Images.xcassets in Resources */,
FA778A411B8319D8005807E7 /* image.jpg in Resources */,
BF5861F31F613FB800B406F6 /* CropViewController.xib in Resources */,
B2357AB11FA50D51003F9ACF /* FilterViewController.xib in Resources */,
BF5861F81F61404C00B406F6 /* ConfirmViewController.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -390,15 +418,18 @@
E35A240A1F509FBD001047FD /* CGRectExtensions.swift in Sources */,
E33BE7291F546920005842DC /* IRLRectangleFeature+Extensions.m in Sources */,
C482A0081CAEB18D00541D08 /* CameraGlobals.swift in Sources */,
B2357ABC1FA5115C003F9ACF /* UIImage+Filter.m in Sources */,
C482A0091CAEB18D00541D08 /* VolumeControl.swift in Sources */,
C482A00A1CAEB18D00541D08 /* PhotoLibraryAuthorizer.swift in Sources */,
E35A24071F509CDC001047FD /* OverlayView.swift in Sources */,
E35A24101F50B49A001047FD /* ConfirmViewController.swift in Sources */,
C482A00B1CAEB18D00541D08 /* UIButtonExtensions.swift in Sources */,
C482A00C1CAEB18D00541D08 /* PhotoLibraryViewController.swift in Sources */,
C482A00D1CAEB18D00541D08 /* CameraViewController.swift in Sources */,
B2357AB31FA50E13003F9ACF /* FilterViewController.swift in Sources */,
C482A00E1CAEB18D00541D08 /* CropViewController.swift in Sources */,
C482A00F1CAEB18D00541D08 /* ImageCell.swift in Sources */,
B2357ABE1FA5115C003F9ACF /* UIImageView+Filter.m in Sources */,
C482A0101CAEB18D00541D08 /* PermissionsView.swift in Sources */,
C482A0111CAEB18D00541D08 /* CameraView.swift in Sources */,
C482A0121CAEB18D00541D08 /* CropOverlay.swift in Sources */,
Expand All @@ -414,10 +445,12 @@
E35A240F1F50B49A001047FD /* ConfirmViewController.swift in Sources */,
FA5FA3431B3AFA2B00497C62 /* PermissionsView.swift in Sources */,
FAB50BFC1B413E8C009905B9 /* ImageFetcher.swift in Sources */,
B2357ABA1FA51156003F9ACF /* UIImage+Filter.m in Sources */,
E35A24091F509FBD001047FD /* CGRectExtensions.swift in Sources */,
FA82313A1B3C296C00A837BE /* Utilities.swift in Sources */,
FAB50C001B413E8C009905B9 /* PhotoLibraryViewController.swift in Sources */,
E33BE7281F546920005842DC /* IRLRectangleFeature+Extensions.m in Sources */,
B2357AB91FA51156003F9ACF /* UIImageView+Filter.m in Sources */,
FAF0586A1B317894008E5592 /* CameraShot.swift in Sources */,
E35A240C1F509FFC001047FD /* CGPointExtensions.swift in Sources */,
FAF058661B316695008E5592 /* CameraViewController.swift in Sources */,
Expand All @@ -429,6 +462,7 @@
FAF058471B31618D008E5592 /* ViewController.swift in Sources */,
FAF058681B3175C5008E5592 /* CameraView.swift in Sources */,
C4D9BA471CA73163004F70F7 /* UIButtonExtensions.swift in Sources */,
B2357AB21FA50D51003F9ACF /* FilterViewController.swift in Sources */,
C40665461C73A94100EB9751 /* CameraGlobals.swift in Sources */,
FAF058451B31618D008E5592 /* AppDelegate.swift in Sources */,
C40665441C73A47C00EB9751 /* SingleImageSaver.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "Line.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "bwFilterHighlight.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "bwFilterNormal.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "colorFilterHighlight.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "colorFilterNormal.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "exposureFilterHighlight.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "exposureFilterNormal.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "grayFilterHighlight.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "grayFilterNormal.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "originalFilterHighlight.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "originalFilterNormal.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.
45 changes: 45 additions & 0 deletions ALCameraViewController/Utilities/UIImage+Filter.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
//
// UIImage+Filter.h
// Updates
//
// Created by Nebojsa Petrovic on 4/16/13.
// Copyright (c) 2013 Nebojsa Petrovic. All rights reserved.
//

#import <UIKit/UIKit.h>

typedef enum {
ImageFilterPresetOriginal = 0,
ImageFilterPresetBlackAndWhite,
ImageFilterPresetEnhanceColor,
ImageFilterPresetEnhanceExposure,
ImageFilterPresetGrayScale
} ImageFilterPreset;

@interface UIImage (Filter)

/*
Asynchronously applies 'filter' to the target image and
returns the filtered image in the block.
The target image remains unchanged.
*/
- (void)applyFilter:(CIFilter *)filter
completion:(void (^)(UIImage *filteredImage))completionBlock;

/*
Returns a UIImage from the filter.
*/
- (UIImage *)imageWithFilter:(CIFilter *)filter;

/*
Returns a UIImage from a filter preset
*/
- (UIImage *)imageWithFilterPreset:(ImageFilterPreset)preset intensity:(float)intensity;

/*
Returns a filter using a common preset, and intensity value, ranging from 0 to 1
*/
- (CIFilter *)filterWithPreset:(ImageFilterPreset)preset;
- (CIFilter *)filterWithPreset:(ImageFilterPreset)preset intensity:(float)intensity;

@end
Loading