Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the FastBlurFilter on iOs #2

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
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
3 changes: 1 addition & 2 deletions iphone/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
tmp
bin
build
*.zip
build
11 changes: 8 additions & 3 deletions iphone/Classes/ComBongoleTiGpuimageGPUImageView.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,18 @@
#import "GPUImageSepiaFilter.h"
#import "GPUImageMonochromeFilter.h"
#import "GPUImageGrayscaleFilter.h"
#import "GPUImageFastBlurFilter.h"
#import <objc/runtime.h>

@implementation ComBongoleTiGpuimageGPUImageView

-(void)setFilter_:(id)args
{
ENSURE_TYPE_OR_NIL(args, NSString);

// ENSURE_TYPE_OR_NIL(args, NSString);
ENSURE_SINGLE_ARG_OR_NIL(args, NSDictionary);
//ENSURE_UI_THREAD_1_ARG(args);

NSString *filterType = args;
NSString *filterType = [args objectForKey:@"filtertype"];

UIImageView *imageview;
object_getInstanceVariable(self, "imageView", (void *)&imageview);
Expand All @@ -43,6 +44,10 @@ -(void)setFilter_:(id)args
else if( [kGrayscaleFilter isEqualToString:filterType] ){
stillImageFilter = [[GPUImageGrayscaleFilter alloc] init];
}
else if( [kFastBlurFilter isEqualToString:filterType] ){
stillImageFilter = [[GPUImageFastBlurFilter alloc] init];
[stillImageFilter setBlurSize:[TiUtils floatValue:[args objectForKey:@"blursize"]]];
}
else{
[imageview setImage:original_image];
return;
Expand Down
1 change: 1 addition & 0 deletions iphone/Classes/ComBongoleTiGpuimageModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,6 @@ -(void)_listenerRemoved:(NSString *)type count:(int)count
MAKE_SYSTEM_STR(SEPIA_FILTER, kSepiaFilter);
MAKE_SYSTEM_STR(MONOCHROME_FILTER, kMonochromeFilter);
MAKE_SYSTEM_STR(GRAYSCALE_FILTER, kGrayscaleFilter);
MAKE_SYSTEM_STR(FASTBLUR_FILTER, kFastBlurFilter);

@end
1 change: 1 addition & 0 deletions iphone/Classes/Constants.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
extern NSString * const kSepiaFilter;
extern NSString * const kMonochromeFilter;
extern NSString * const kGrayscaleFilter;
extern NSString * const kFastBlurFilter;
1 change: 1 addition & 0 deletions iphone/Classes/Constants.m
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
NSString * const kSepiaFilter = @"sepia";
NSString * const kMonochromeFilter = @"monochrome";
NSString * const kGrayscaleFilter = @"grayscale";
NSString * const kFastBlurFilter = @"fastblur";
Binary file not shown.
4 changes: 2 additions & 2 deletions iphone/manifest
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# this is your module manifest and used by Titanium
# during compilation, packaging, distribution, etc.
#
version: 0.1
version: 0.2
apiversion: 2
description: My module
author: Your Name
Expand All @@ -15,4 +15,4 @@ name: TiGPUImageiPhone
moduleid: com.bongole.ti.gpuimage
guid: 43955728-0142-4b7b-ab87-e46883335d1a
platform: iphone
minsdk: 3.0.2.GA
minsdk: 3.1.3.GA
4 changes: 2 additions & 2 deletions iphone/titanium.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
// OF YOUR TITANIUM SDK YOU'RE BUILDING FOR
//
//
TITANIUM_SDK_VERSION = 3.0.2.GA
TITANIUM_SDK_VERSION = 3.1.3.GA


//
// THESE SHOULD BE OK GENERALLY AS-IS
//
TITANIUM_SDK = ~/Library/Application Support/Titanium/mobilesdk/osx/$(TITANIUM_SDK_VERSION)
TITANIUM_SDK = /Volumes/SSD/titaniumsdks/Titanium/mobilesdk/osx/$(TITANIUM_SDK_VERSION)
TITANIUM_BASE_SDK = "$(TITANIUM_SDK)/iphone/include"
TITANIUM_BASE_SDK2 = "$(TITANIUM_SDK)/iphone/include/TiCore"
HEADER_SEARCH_PATHS= $(TITANIUM_BASE_SDK) $(TITANIUM_BASE_SDK2)
Expand Down