Permalink
Browse files

Added a fix for a compilation error and a quick check to reduce redun…

…dant context setting calls.
  • Loading branch information...
1 parent 68cf745 commit 615dc5dc9f3223e23073b23f4d94ad827cc4394c @BradLarson committed May 28, 2012
View
2 examples/RawDataTest/RawDataTest/RawDataTestAppDelegate.m
@@ -44,6 +44,8 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
}];
[rawDataInput processData];
+
+ free(rawDataBytes);
return YES;
}
View
11 framework/Source/GPUImageHarrisCornerDetectionFilter.m
@@ -89,8 +89,6 @@ - (id)initWithCornerDetectionFragmentShader:(NSString *)cornerDetectionFragmentS
// First pass: reduce to luminance and take the derivative of the luminance texture
derivativeFilter = [[GPUImageXYDerivativeFilter alloc] init];
-// derivativeFilter.imageWidthFactor = 256.0;
-// derivativeFilter.imageHeightFactor = 256.0;
[self addFilter:derivativeFilter];
#ifdef DEBUGFEATUREDETECTION
@@ -103,7 +101,6 @@ - (id)initWithCornerDetectionFragmentShader:(NSString *)cornerDetectionFragmentS
#endif
// Second pass: blur the derivative
-// blurFilter = [[GPUImageGaussianBlurFilter alloc] init];
blurFilter = [[GPUImageFastBlurFilter alloc] init];
[self addFilter:blurFilter];
@@ -162,8 +159,6 @@ - (id)initWithCornerDetectionFragmentShader:(NSString *)cornerDetectionFragmentS
[nonMaximumSuppressionFilter addTarget:simpleThresholdFilter];
self.initialFilters = [NSArray arrayWithObjects:derivativeFilter, nil];
-// self.terminalFilter = harrisCornerDetectionFilter;
-// self.terminalFilter = nonMaximumSuppressionFilter;
self.terminalFilter = simpleThresholdFilter;
self.blurSize = 1.0;
@@ -196,7 +191,7 @@ - (void)extractCornerLocationsFromImageAtFrameTime:(CMTime)frameTime;
glReadPixels(0, 0, (int)imageSize.width, (int)imageSize.height, GL_RGBA, GL_UNSIGNED_BYTE, rawImagePixels);
- CFAbsoluteTime startTime = CFAbsoluteTimeGetCurrent();
+// CFAbsoluteTime startTime = CFAbsoluteTimeGetCurrent();
for (unsigned int yCoordinate = 0; yCoordinate < imageSize.height; yCoordinate++)
{
@@ -216,8 +211,8 @@ - (void)extractCornerLocationsFromImageAtFrameTime:(CMTime)frameTime;
}
}
- CFAbsoluteTime currentFrameTime = (CFAbsoluteTimeGetCurrent() - startTime);
- NSLog(@"Processing time : %f ms", 1000.0 * currentFrameTime);
+// CFAbsoluteTime currentFrameTime = (CFAbsoluteTimeGetCurrent() - startTime);
+// NSLog(@"Processing time : %f ms", 1000.0 * currentFrameTime);
if (cornersDetectedBlock != NULL)
{
View
6 framework/Source/GPUImageOpenGLESContext.m
@@ -20,7 +20,11 @@ + (GPUImageOpenGLESContext *)sharedImageProcessingOpenGLESContext;
+ (void)useImageProcessingContext;
{
- [EAGLContext setCurrentContext:[[GPUImageOpenGLESContext sharedImageProcessingOpenGLESContext] context]];
+ EAGLContext *imageProcessingContext = [[GPUImageOpenGLESContext sharedImageProcessingOpenGLESContext] context];
+ if ([EAGLContext currentContext] != imageProcessingContext)
+ {
+ [EAGLContext setCurrentContext:imageProcessingContext];
+ }
}
+ (GLint)maximumTextureSizeForThisDevice;
View
1 framework/Source/GPUImageRawDataInput.h
@@ -15,5 +15,6 @@
// Image rendering
- (void)updateDataFromBytes:(GLubyte *)bytesToUpload size:(CGSize)imageSize;
- (void)processData;
+- (CGSize)outputImageSize;
@end

0 comments on commit 615dc5d

Please sign in to comment.