Skip to content

Commit

Permalink
added tests with selective blur
Browse files Browse the repository at this point in the history
  • Loading branch information
zapsleep committed Jan 17, 2013
1 parent 6721dac commit 6e3b025
Show file tree
Hide file tree
Showing 10 changed files with 222 additions and 13 deletions.
14 changes: 14 additions & 0 deletions BlurTest.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
743D60B316A552420083427A /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 743D60B216A552420083427A /* AVFoundation.framework */; };
743D60B516A552470083427A /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 743D60B416A552470083427A /* OpenGLES.framework */; };
743D60BA16A558140083427A /* CoreImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 743D60B916A558140083427A /* CoreImage.framework */; };
74D247F016A7D6050059019B /* DVSelectiveTestViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 74D247EE16A7D6050059019B /* DVSelectiveTestViewController.m */; };
74D247F116A7D6050059019B /* DVSelectiveTestViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 74D247EF16A7D6050059019B /* DVSelectiveTestViewController.xib */; };
74D247FE16A7DCFF0059019B /* apollo.png in Resources */ = {isa = PBXBuildFile; fileRef = 74D247FD16A7DCFF0059019B /* apollo.png */; };
E37228C816A5B47400B02D5F /* Icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = E37228C716A5B47400B02D5F /* Icon-72.png */; };
E37228CA16A5B47700B02D5F /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = E37228C916A5B47700B02D5F /* [email protected] */; };
E3D585C416A5AD880094D01E /* libGPUImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E3D585BF16A5AD3C0094D01E /* libGPUImage.a */; };
Expand Down Expand Up @@ -80,6 +83,10 @@
743D60B216A552420083427A /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
743D60B416A552470083427A /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; };
743D60B916A558140083427A /* CoreImage.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreImage.framework; path = System/Library/Frameworks/CoreImage.framework; sourceTree = SDKROOT; };
74D247ED16A7D6050059019B /* DVSelectiveTestViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVSelectiveTestViewController.h; sourceTree = "<group>"; };
74D247EE16A7D6050059019B /* DVSelectiveTestViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DVSelectiveTestViewController.m; sourceTree = "<group>"; };
74D247EF16A7D6050059019B /* DVSelectiveTestViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = DVSelectiveTestViewController.xib; sourceTree = "<group>"; };
74D247FD16A7DCFF0059019B /* apollo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = apollo.png; sourceTree = "<group>"; };
E37228C716A5B47400B02D5F /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-72.png"; sourceTree = "<group>"; };
E37228C916A5B47700B02D5F /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
E3D585B516A5AD3C0094D01E /* GPUImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = GPUImage.xcodeproj; path = GPUImage/framework/GPUImage.xcodeproj; sourceTree = "<group>"; };
Expand Down Expand Up @@ -115,6 +122,7 @@
743D605B16A53D060083427A = {
isa = PBXGroup;
children = (
74D247FD16A7DCFF0059019B /* apollo.png */,
E37228C916A5B47700B02D5F /* [email protected] */,
E37228C716A5B47400B02D5F /* Icon-72.png */,
E3D585CB16A5B45D0094D01E /* [email protected] */,
Expand Down Expand Up @@ -162,6 +170,9 @@
743D609216A53FCE0083427A /* DVTestViewController.h */,
743D609316A53FCE0083427A /* DVTestViewController.m */,
743D609416A53FCE0083427A /* DVTestViewController.xib */,
74D247ED16A7D6050059019B /* DVSelectiveTestViewController.h */,
74D247EE16A7D6050059019B /* DVSelectiveTestViewController.m */,
74D247EF16A7D6050059019B /* DVSelectiveTestViewController.xib */,
743D607116A53D060083427A /* Supporting Files */,
);
path = BlurTest;
Expand Down Expand Up @@ -282,6 +293,8 @@
E3D585CC16A5B45D0094D01E /* [email protected] in Resources */,
E37228C816A5B47400B02D5F /* Icon-72.png in Resources */,
E37228CA16A5B47700B02D5F /* [email protected] in Resources */,
74D247F116A7D6050059019B /* DVSelectiveTestViewController.xib in Resources */,
74D247FE16A7DCFF0059019B /* apollo.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -296,6 +309,7 @@
743D607B16A53D060083427A /* DVAppDelegate.m in Sources */,
743D609516A53FCE0083427A /* DVTestViewController.m in Sources */,
E3D585C816A5B37A0094D01E /* DVFrameworkChooseController.m in Sources */,
74D247F016A7D6050059019B /* DVSelectiveTestViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
Binary file not shown.
10 changes: 10 additions & 0 deletions BlurTest/DVFrameworkChooseController.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,15 @@

#import <UIKit/UIKit.h>

typedef enum {
DVCoreImage = 0,
DVAccelerate = 1,
DVGPUImage = 2,
DVCoreImageSelection = 3,
DVAccelerateSelection = 4,
DVGPUImageSelection = 5

} DVFrameworks;

@interface DVFrameworkChooseController : UITableViewController
@end
23 changes: 20 additions & 3 deletions BlurTest/DVFrameworkChooseController.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@

#import "DVFrameworkChooseController.h"
#import "DVTestViewController.h"
#import "DVSelectiveTestViewController.h"

@implementation DVFrameworkChooseController

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
// Return the number of rows in the section.
return 3;
return 6;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
Expand All @@ -38,6 +39,18 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
cell.textLabel.text = @"GPUImage";
break;

case DVCoreImageSelection:
cell.textLabel.text = @"Core Image selection test";
break;

case DVAccelerateSelection:
cell.textLabel.text = @"Accelerate vImage selection test";
break;

case DVGPUImageSelection:
cell.textLabel.text = @"GPUImage selection test";
break;

default:
break;
}
Expand All @@ -47,8 +60,12 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[self.navigationController pushViewController:[[DVTestViewController alloc] initWithFramework:indexPath.row]
animated:YES];
if (indexPath.row < 3)
[self.navigationController pushViewController:[[DVTestViewController alloc] initWithFramework:indexPath.row]
animated:YES];
else
[self.navigationController pushViewController:[[DVSelectiveTestViewController alloc] initWithFramework:indexPath.row]
animated:YES];
}

@end
13 changes: 13 additions & 0 deletions BlurTest/DVSelectiveTestViewController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// DVSelectiveTestViewController.h
// BlurTest
//
// Created by Mikhail Grushin on 17.01.13.
// Copyright (c) 2013 Mikhail Grushin. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface DVSelectiveTestViewController : UIViewController

@end
38 changes: 38 additions & 0 deletions BlurTest/DVSelectiveTestViewController.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
//
// DVSelectiveTestViewController.m
// BlurTest
//
// Created by Mikhail Grushin on 17.01.13.
// Copyright (c) 2013 Mikhail Grushin. All rights reserved.
//

#import "DVSelectiveTestViewController.h"

@interface DVSelectiveTestViewController ()

@end

@implementation DVSelectiveTestViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}

- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
}

- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}

@end
122 changes: 122 additions & 0 deletions BlurTest/DVSelectiveTestViewController.xib
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="8.00">
<data>
<int key="IBDocument.SystemTarget">1536</int>
<string key="IBDocument.SystemVersion">12A206j</string>
<string key="IBDocument.InterfaceBuilderVersion">2519</string>
<string key="IBDocument.AppKitVersion">1172.1</string>
<string key="IBDocument.HIToolboxVersion">613.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="NS.object.0">1856</string>
</object>
<array key="IBDocument.IntegratedClassDependencies">
<string>IBProxyObject</string>
<string>IBUIView</string>
</array>
<array key="IBDocument.PluginDependencies">
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</array>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
<integer value="1" key="NS.object.0"/>
</object>
<array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
<object class="IBProxyObject" id="841351856">
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
</object>
<object class="IBProxyObject" id="606714003">
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
</object>
<object class="IBUIView" id="766721923">
<reference key="NSNextResponder"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{0, 20}, {768, 1004}}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
<object class="NSColorSpace" key="NSCustomColorSpace">
<int key="NSID">2</int>
</object>
</object>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics">
<int key="IBUIStatusBarStyle">2</int>
</object>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
</object>
</array>
<object class="IBObjectContainer" key="IBDocument.Objects">
<array class="NSMutableArray" key="connectionRecords">
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">view</string>
<reference key="source" ref="841351856"/>
<reference key="destination" ref="766721923"/>
</object>
<int key="connectionID">3</int>
</object>
</array>
<object class="IBMutableOrderedSet" key="objectRecords">
<array key="orderedObjects">
<object class="IBObjectRecord">
<int key="objectID">0</int>
<array key="object" id="0"/>
<reference key="children" ref="1000"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="841351856"/>
<reference key="parent" ref="0"/>
<string key="objectName">File's Owner</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="606714003"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">2</int>
<reference key="object" ref="766721923"/>
<reference key="parent" ref="0"/>
</object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
<string key="-1.CustomClassName">DVSelectiveTestViewController</string>
<string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="-2.CustomClassName">UIResponder</string>
<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">3</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
<object class="IBPartialClassDescription">
<string key="className">DVSelectiveTestViewController</string>
<string key="superclassName">UIViewController</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/DVSelectiveTestViewController.h</string>
</object>
</object>
</array>
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBIPadFramework</string>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<bool key="IBDocument.UseAutolayout">YES</bool>
<string key="IBCocoaTouchPluginVersion">1856</string>
</data>
</archive>
7 changes: 1 addition & 6 deletions BlurTest/DVTestViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@
//

#import <UIKit/UIKit.h>

typedef enum {
DVCoreImage = 0,
DVAccelerate = 1,
DVGPUImage = 2
} DVFrameworks;
#import "DVFrameworkChooseController.h"

@interface DVTestViewController : UIViewController
- (id)initWithFramework:(DVFrameworks)framework;
Expand Down
8 changes: 4 additions & 4 deletions BlurTest/DVTestViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -263,12 +263,12 @@ - (void)snapshot
UIImage *image;
switch (self.testingFramework) {
case DVCoreImage:
image = [self renderBackingView];
image = [self renderBackingViewWithRect:CGRectNull];
image = [self ciBlurWithImage:image];
break;

case DVAccelerate:
image = [self renderBackingView];
image = [self renderBackingViewWithRect:CGRectNull];
image = [self accelerateBlurWithImage:image];
break;

Expand All @@ -285,7 +285,7 @@ - (void)snapshot
}
}

- (UIImage *)renderBackingView
- (UIImage *)renderBackingViewWithRect:(CGRect)imageRect
{
UIView *view = self.backingView;
CGSize imageSize = view.bounds.size;
Expand Down Expand Up @@ -314,7 +314,7 @@ - (UIImage *)renderBackingView
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();

UIGraphicsEndImageContext();

return image;
}

Expand Down
Binary file added apollo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6e3b025

Please sign in to comment.