Permalink
Browse files

Merge remote-tracking branch 'upstream/master'

Conflicts:
	framework/GPUImage.xcodeproj/project.pbxproj
  • Loading branch information...
2 parents 621d5da + fa31df5 commit b10f83f5d9a28f3f171a0817d5f3a8edf526c007 @fattjake fattjake committed May 14, 2012
Showing with 2,240 additions and 831 deletions.
  1. +6 −1 .gitignore
  2. +32 −23 README.md
  3. +2 −3 examples/BenchmarkSuite/BenchmarkSuite/VideoFilteringDisplayController.m
  4. +1 −1 examples/ColorObjectTracking/ColorObjectTracking/ColorTrackingViewController.h
  5. +10 −14 examples/ColorObjectTracking/ColorObjectTracking/ColorTrackingViewController.m
  6. +2 −3 examples/CubeExample/Classes/ES2Renderer.m
  7. +7 −4 examples/FilterShowcase/FilterShowcase/ShowcaseFilterListController.m
  8. +3 −0 examples/FilterShowcase/FilterShowcase/ShowcaseFilterViewController.h
  9. +77 −18 examples/FilterShowcase/FilterShowcase/ShowcaseFilterViewController.m
  10. +6 −9 examples/MultiViewFilterExample/MultiViewFilterExample/MultiViewViewController.m
  11. +6 −7 examples/SimpleImageFilter/SimpleImageFilter/SimpleImageViewController.m
  12. +11 −26 examples/SimplePhotoFilter/SimplePhotoFilter/PhotoViewController.m
  13. +1 −3 examples/SimpleVideoFileFilter/SimpleVideoFileFilter/SimpleVideoFileFilterViewController.m
  14. +3 −5 examples/SimpleVideoFilter/SimpleVideoFilter/SimpleVideoFilterViewController.m
  15. +8 −8 examples/SimpleVideoFilter/SimpleVideoFilter/SimpleVideoFilterViewController.xib
  16. +95 −26 framework/GPUImage.xcodeproj/project.pbxproj
  17. +4 −1 framework/Source/GPUImage.h
  18. +2 −7 framework/Source/GPUImage3x3ConvolutionFilter.h
  19. +1 −59 framework/Source/GPUImage3x3ConvolutionFilter.m
  20. +18 −0 framework/Source/GPUImage3x3TextureSamplingFilter.h
  21. +107 −0 framework/Source/GPUImage3x3TextureSamplingFilter.m
  22. +8 −5 framework/Source/GPUImageAdaptiveThresholdFilter.m
  23. +2 −2 framework/Source/GPUImageAlphaBlendFilter.h
  24. +3 −2 framework/Source/GPUImageAlphaBlendFilter.m
  25. +5 −0 framework/Source/GPUImageBilateralFilter.h
  26. +87 −0 framework/Source/GPUImageBilateralFilter.m
  27. +10 −2 framework/Source/GPUImageBoxBlurFilter.m
  28. +4 −3 framework/Source/GPUImageBulgeDistortionFilter.h
  29. +10 −2 framework/Source/GPUImageBulgeDistortionFilter.m
  30. +3 −3 framework/Source/GPUImageCannyEdgeDetectionFilter.h
  31. +10 −10 framework/Source/GPUImageCannyEdgeDetectionFilter.m
  32. +2 −2 framework/Source/GPUImageChromaKeyBlendFilter.h
  33. +3 −2 framework/Source/GPUImageChromaKeyBlendFilter.m
  34. +2 −2 framework/Source/GPUImageColorBurnBlendFilter.h
  35. +3 −2 framework/Source/GPUImageColorBurnBlendFilter.m
  36. +2 −2 framework/Source/GPUImageColorDodgeBlendFilter.h
  37. +2 −1 framework/Source/GPUImageColorDodgeBlendFilter.m
  38. +1 −0 framework/Source/GPUImageCropFilter.h
  39. +119 −7 framework/Source/GPUImageCropFilter.m
  40. +8 −0 framework/Source/GPUImageCrosshatchFilter.h
  41. +88 −29 framework/Source/GPUImageCrosshatchFilter.m
  42. +2 −2 framework/Source/GPUImageDarkenBlendFilter.h
  43. +3 −2 framework/Source/GPUImageDarkenBlendFilter.m
  44. +2 −2 framework/Source/GPUImageDifferenceBlendFilter.h
  45. +3 −2 framework/Source/GPUImageDifferenceBlendFilter.m
  46. +2 −2 framework/Source/GPUImageDissolveBlendFilter.h
  47. +4 −3 framework/Source/GPUImageDissolveBlendFilter.m
  48. +2 −2 framework/Source/GPUImageExclusionBlendFilter.h
  49. +3 −2 framework/Source/GPUImageExclusionBlendFilter.m
  50. +3 −2 framework/Source/GPUImageFastBlurFilter.h
  51. +11 −3 framework/Source/GPUImageFastBlurFilter.m
  52. +38 −6 framework/Source/GPUImageFilter.h
  53. +142 −49 framework/Source/GPUImageFilter.m
  54. +10 −2 framework/Source/GPUImageFilterGroup.m
  55. +1 −3 framework/Source/GPUImageGaussianBlurFilter.h
  56. +13 −17 framework/Source/GPUImageGaussianBlurFilter.m
  57. +9 −8 framework/Source/GPUImageGaussianSelectiveBlurFilter.h
  58. +56 −69 framework/Source/GPUImageGaussianSelectiveBlurFilter.m
  59. +2 −0 framework/Source/GPUImageGrayscaleFilter.h
  60. +2 −2 framework/Source/GPUImageHardLightBlendFilter.h
  61. +3 −2 framework/Source/GPUImageHardLightBlendFilter.m
  62. +15 −0 framework/Source/GPUImageHistogramFilter.m
  63. +3 −1 framework/Source/GPUImageKuwaharaFilter.h
  64. +3 −2 framework/Source/GPUImageLightenBlendFilter.h
  65. +3 −2 framework/Source/GPUImageLightenBlendFilter.m
  66. +5 −0 framework/Source/GPUImageMedianFilter.h
  67. +119 −0 framework/Source/GPUImageMedianFilter.m
  68. +9 −5 framework/Source/GPUImageMovie.m
  69. +1 −0 framework/Source/GPUImageMovieWriter.h
  70. +8 −2 framework/Source/GPUImageMovieWriter.m
  71. +2 −2 framework/Source/GPUImageMultiplyBlendFilter.h
  72. +3 −2 framework/Source/GPUImageMultiplyBlendFilter.m
  73. +10 −2 framework/Source/GPUImageNonMaximumSuppressionFilter.m
  74. +7 −1 framework/Source/GPUImageOpenGLESContext.h
  75. +23 −0 framework/Source/GPUImageOpenGLESContext.m
  76. +55 −3 framework/Source/GPUImageOutput.h
  77. +38 −4 framework/Source/GPUImageOutput.m
  78. +2 −2 framework/Source/GPUImageOverlayBlendFilter.h
  79. +3 −2 framework/Source/GPUImageOverlayBlendFilter.m
  80. +17 −3 framework/Source/GPUImagePicture.m
  81. +11 −3 framework/Source/GPUImagePinchDistortionFilter.m
  82. +9 −2 framework/Source/GPUImagePolarPixellateFilter.m
  83. +14 −0 framework/Source/GPUImageRGBFilter.h
  84. +77 −0 framework/Source/GPUImageRGBFilter.m
  85. +1 −0 framework/Source/GPUImageRawData.h
  86. +7 −1 framework/Source/GPUImageRawData.m
  87. +0 −13 framework/Source/GPUImageRotationFilter.h
  88. +0 −105 framework/Source/GPUImageRotationFilter.m
  89. +2 −2 framework/Source/GPUImageScreenBlendFilter.h
  90. +3 −2 framework/Source/GPUImageScreenBlendFilter.m
  91. +1 −0 framework/Source/GPUImageSepiaFilter.h
  92. +4 −0 framework/Source/GPUImageSketchFilter.h
  93. +9 −6 framework/Source/GPUImageSmoothToonFilter.h
  94. +10 −10 framework/Source/GPUImageSmoothToonFilter.m
  95. +4 −4 framework/Source/GPUImageSobelEdgeDetectionFilter.h
  96. +14 −14 framework/Source/GPUImageSobelEdgeDetectionFilter.m
  97. +2 −2 framework/Source/GPUImageSoftLightBlendFilter.h
  98. +3 −2 framework/Source/GPUImageSoftLightBlendFilter.m
  99. +5 −1 framework/Source/GPUImageStillCamera.h
  100. +153 −5 framework/Source/GPUImageStillCamera.m
  101. +9 −4 framework/Source/GPUImageStretchDistortionFilter.m
  102. +2 −2 framework/Source/GPUImageSubtractBlendFilter.h
  103. +3 −2 framework/Source/GPUImageSubtractBlendFilter.m
  104. +5 −3 framework/Source/GPUImageSwirlFilter.h
  105. +11 −3 framework/Source/GPUImageSwirlFilter.m
  106. +4 −1 framework/Source/GPUImageTextureInput.m
  107. +5 −1 framework/Source/GPUImageTextureOutput.m
  108. +5 −4 framework/Source/GPUImageTiltShiftFilter.h
  109. +6 −4 framework/Source/GPUImageTiltShiftFilter.m
  110. +2 −8 framework/Source/GPUImageToonFilter.h
  111. +1 −53 framework/Source/GPUImageToonFilter.m
  112. +2 −9 framework/Source/GPUImageTransformFilter.m
  113. +15 −0 framework/Source/GPUImageTwoInputFilter.h
  114. +158 −0 framework/Source/GPUImageTwoInputFilter.m
  115. +1 −9 framework/Source/GPUImageTwoPassFilter.m
  116. +4 −2 framework/Source/GPUImageUnsharpMaskFilter.m
  117. +55 −11 framework/Source/GPUImageVideoCamera.h
  118. +76 −18 framework/Source/GPUImageVideoCamera.m
  119. +15 −3 framework/Source/GPUImageView.h
  120. +88 −11 framework/Source/GPUImageView.m
  121. +33 −4 framework/Source/GPUImageVignetteFilter.m
View
@@ -1,5 +1,6 @@
# Exclude the build directory
build/*
+examples/FilterShowcase/build*
# Exclude temp nibs and swap files
*~.nib
@@ -16,4 +17,8 @@ build/*
*.perspectivev3
*.pbxuser
*.xcworkspace
-xcuserdata
+xcuserdata
+
+# Documentation
+documentation/*
+
View
@@ -46,6 +46,10 @@ For example, an application that takes in live video from the camera, converts t
GPUImageVideoCamera -> GPUImageSepiaFilter -> GPUImageView
+## Documentation ##
+
+Documentation is generated from header comments using appledoc. To build the documentation, switch to the "Documentation" scheme in Xcode. You should ensure that "APPLEDOC_PATH" (a User-Defined build setting) points to an appledoc binary, available on <a href="https://github.com/tomaz/appledoc">Github</a> or through <a href="https://github.com/mxcl/homebrew">Homebrew</a>. It will also build and install a .docset file, which you can view with your favorite documentation tool.
+
## Built-in filters ##
### Color adjustments ###
@@ -88,8 +92,6 @@ For example, an application that takes in live video from the camera, converts t
### Image processing ###
-- **GPUImageRotationFilter**: This lets you rotate an image left or right by 90 degrees, or flip it horizontally or vertically
-
- **GPUImageTransformFilter**: This applies an arbitrary 2-D or 3-D transformation to an image
- *affineTransform*: This takes in a CGAffineTransform to adjust an image in 2-D
- *transform3D*: This takes in a CATransform3D to manipulate an image in 3-D
@@ -174,30 +176,34 @@ For example, an application that takes in live video from the camera, converts t
- *center*: The center about which to apply the pixellation, defaulting to (0.5, 0.5)
- *pixelSize*: The fractional pixel size, split into width and height components. The default is (0.05, 0.05)
+- **GPUImageCrosshatchFilter**: This converts an image into a black-and-white crosshatch pattern
+ - *crossHatchSpacing*: The fractional width of the image to use as the spacing for the crosshatch. The default is 0.03.
+ - *lineWidth*: A relative width for the crosshatch lines. The default is 0.003.
+
- **GPUImageSobelEdgeDetectionFilter**: Sobel edge detection, with edges highlighted in white
- - *imageWidthFactor*:
- - *imageHeightFactor*: These parameters affect the visibility of the detected edges
+ - *texelWidth*:
+ - *texelHeight*: These parameters affect the visibility of the detected edges
- **GPUImageCannyEdgeDetectionFilter**: This uses a Gaussian blur before applying a Sobel operator to highlight edges
- - *imageWidthFactor*:
- - *imageHeightFactor*: These parameters affect the visibility of the detected edges
+ - *texelWidth*:
+ - *texelHeight*: These parameters affect the visibility of the detected edges
- *blurSize*: A multiplier for the prepass blur size, ranging from 0.0 on up, with a default of 1.0
- *threshold*: Any edge above this threshold will be black, and anything below white. Ranges from 0.0 to 1.0, with 0.5 as the default
- **GPUImageSketchFilter**: Converts video to look like a sketch. This is just the Sobel edge detection filter with the colors inverted
- *intensity*: The degree to which the original image colors are replaced by the detected edges (0.0 - 1.0, with 1.0 as the default)
- - *imageWidthFactor*:
- - *imageHeightFactor*: These parameters affect the visibility of the detected edges
+ - *texelWidth*:
+ - *texelHeight*: These parameters affect the visibility of the detected edges
- **GPUImageToonFilter**: This uses Sobel edge detection to place a black border around objects, and then it quantizes the colors present in the image to give a cartoon-like quality to the image.
- - *imageWidthFactor*:
- - *imageHeightFactor*: These parameters affect the visibility of the detected edges
+ - *texelWidth*:
+ - *texelHeight*: These parameters affect the visibility of the detected edges
- *threshold*: The sensitivity of the edge detection, with lower values being more sensitive. Ranges from 0.0 to 1.0, with 0.2 as the default
- *quantizationLevels*: The number of color levels to represent in the final image. Default is 10.0
- **GPUImageSmoothToonFilter**: This uses a similar process as the GPUImageToonFilter, only it precedes the toon effect with a Gaussian blur to smooth out noise.
- - *imageWidthFactor*:
- - *imageHeightFactor*: These parameters affect the visibility of the detected edges
+ - *texelWidth*:
+ - *texelHeight*: These parameters affect the visibility of the detected edges
- *blurSize*: A multiplier for the prepass blur size, ranging from 0.0 on up, with a default of 0.5
- *threshold*: The sensitivity of the edge detection, with lower values being more sensitive. Ranges from 0.0 to 1.0, with 0.2 as the default
- *quantizationLevels*: The number of color levels to represent in the final image. Default is 10.0
@@ -225,7 +231,7 @@ For example, an application that takes in live video from the camera, converts t
- **GPUImageVignetteFilter**: Performs a vignetting effect, fading out the image at the edges
- *x*:
- - *y*: The directional intensity of the vignetting, with a default of x = 0.5, y = 0.75
+ - *y*: The directional intensity of the vignetting, with a default of x = 0.75, y = 0.5
- **GPUImageKuwaharaFilter**: Kuwahara image abstraction, drawn from the work of Kyprianidis, et. al. in their publication "Anisotropic Kuwahara Filtering on the GPU" within the GPU Pro collection. This produces an oil-painting-like image, but it is extremely computationally expensive, so it can take seconds to render a frame on an iPad 2. This might be best used for still images.
- *radius*: In integer specifying the number of pixels out from the center pixel to test when applying the filter, with a default of 4. A higher value creates a more abstracted image, but at the cost of much greater processing time.
@@ -264,6 +270,8 @@ Additionally, this is an ARC-enabled framework, so if you want to use this withi
To filter live video from an iOS device's camera, you can use code like the following:
GPUImageVideoCamera *videoCamera = [[GPUImageVideoCamera alloc] initWithSessionPreset:AVCaptureSessionPreset640x480 cameraPosition:AVCaptureDevicePositionBack];
+ videoCamera.outputImageOrientation = UIInterfaceOrientationPortrait;
+
GPUImageFilter *customFilter = [[GPUImageFilter alloc] initWithFragmentShaderFromFile:@"CustomShader"];
GPUImageView *filteredVideoView = [[GPUImageView alloc] initWithFrame:CGRectMake(0.0, 0.0, viewWidth, viewHeight)];
@@ -274,7 +282,7 @@ To filter live video from an iOS device's camera, you can use code like the foll
[videoCamera startCameraCapture];
-This sets up a video source coming from the iOS device's back-facing camera, using a preset that tries to capture at 640x480. A custom filter, using code from the file CustomShader.fsh, is then set as the target for the video frames from the camera. These filtered video frames are finally displayed onscreen with the help of a UIView subclass that can present the filtered OpenGL ES texture that results from this pipeline.
+This sets up a video source coming from the iOS device's back-facing camera, using a preset that tries to capture at 640x480. This video is captured with the interface being in portrait mode, where the landscape-left-mounted camera needs to have its video frames rotated before display. A custom filter, using code from the file CustomShader.fsh, is then set as the target for the video frames from the camera. These filtered video frames are finally displayed onscreen with the help of a UIView subclass that can present the filtered OpenGL ES texture that results from this pipeline.
The fill mode of the GPUImageView can be altered by setting its fillMode property, so that if the aspect ratio of the source video is different from that of the view, the video will either be stretched, centered with black bars, or zoomed to fill.
@@ -290,11 +298,10 @@ Also, if you wish to enable microphone audio capture for recording to a movie, y
To capture and filter still photos, you can use a process similar to the one for filtering video. Instead of a GPUImageVideoCamera, you use a GPUImageStillCamera:
stillCamera = [[GPUImageStillCamera alloc] init];
+ stillCamera.outputImageOrientation = UIInterfaceOrientationPortrait;
+
filter = [[GPUImageGammaFilter alloc] init];
- GPUImageRotationFilter *rotationFilter = [[GPUImageRotationFilter alloc] initWithRotation:kGPUImageRotateRight];
-
- [stillCamera addTarget:rotationFilter];
- [rotationFilter addTarget:filter];
+ [stillCamera addTarget:filter];
GPUImageView *filterView = (GPUImageView *)self.view;
[filter addTarget:filterView];
@@ -380,14 +387,12 @@ One thing to note when adding fragment shaders to your Xcode project is that Xco
Movies can be loaded into the framework via the GPUImageMovie class, filtered, and then written out using a GPUImageMovieWriter. GPUImageMovieWriter is also fast enough to record video in realtime from an iPhone 4's camera at 640x480, so a direct filtered video source can be fed into it.
-The following is an example of how you would load a sample movie, pass it through a pixellation and rotation filter, then record the result to disk as a 480 x 640 h.264 movie:
+The following is an example of how you would load a sample movie, pass it through a pixellation filter, then record the result to disk as a 480 x 640 h.264 movie:
movieFile = [[GPUImageMovie alloc] initWithURL:sampleURL];
pixellateFilter = [[GPUImagePixellateFilter alloc] init];
- GPUImageRotationFilter *rotationFilter = [[GPUImageRotationFilter alloc] initWithRotation:kGPUImageRotateRight];
- [movieFile addTarget:rotationFilter];
- [rotationFilter addTarget:pixellateFilter];
+ [movieFile addTarget:pixellateFilter];
NSString *pathToMovie = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/Movie.m4v"];
unlink([pathToMovie UTF8String]);
@@ -428,6 +433,10 @@ A bundled JPEG image is loaded into the application at launch, a filter is appli
A pixellate filter is applied to a live video stream, with a UISlider control that lets you adjust the pixel size on the live video.
+### SimpleVideoFileFilter ###
+
+A movie file is loaded from disk, an unsharp mask filter is applied to it, and the filtered result is re-encoded as another movie.
+
### MultiViewFilterExample ###
From a single camera feed, four views are populated with realtime filters applied to camera. One is just the straight camera video, one is a preprogrammed sepia tone, and two are custom filters based on shader programs.
@@ -450,4 +459,4 @@ In other words, the path of this application is camera -> sepia tone filter -> c
A version of my ColorTracking example from http://www.sunsetlakesoftware.com/2010/10/22/gpu-accelerated-video-processing-mac-and-ios ported across to use GPUImage, this application uses color in a scene to track objects from a live camera feed. The four views you can switch between include the raw camera feed, the camera feed with pixels matching the color threshold in white, the processed video where positions are encoded as colors within the pixels passing the threshold test, and finally the live video feed with a dot that tracks the selected color. Tapping the screen changes the color to track to match the color of the pixels under your finger. Tapping and dragging on the screen makes the color threshold more or less forgiving. This is most obvious on the second, color thresholding view.
-Currently, all processing for the color averaging in the last step is done on the CPU, so this is part is extremely slow.
+Currently, all processing for the color averaging in the last step is done on the CPU, so this is part is extremely slow.
@@ -170,12 +170,11 @@ - (void)displayVideoForGPUImage;
NSLog(@"Start GPU Image");
videoCamera = [[GPUImageVideoCamera alloc] initWithSessionPreset:AVCaptureSessionPreset640x480 cameraPosition:AVCaptureDevicePositionBack];
videoCamera.runBenchmark = YES;
+ videoCamera.outputImageOrientation = UIInterfaceOrientationPortrait;
sepiaFilter = [[GPUImageSepiaFilter alloc] init];
- GPUImageRotationFilter *rotationFilter = [[GPUImageRotationFilter alloc] initWithRotation:kGPUImageRotateRight];
- [videoCamera addTarget:rotationFilter];
- [rotationFilter addTarget:sepiaFilter];
+ [videoCamera addTarget:sepiaFilter];
filterView = [[GPUImageView alloc] initWithFrame:self.view.bounds];
[self.view addSubview:filterView];
[sepiaFilter addTarget:filterView];
@@ -8,7 +8,7 @@ typedef enum { PASSTHROUGH_VIDEO, SIMPLE_THRESHOLDING, POSITION_THRESHOLDING, OB
CALayer *trackingDot;
GPUImageVideoCamera *videoCamera;
- GPUImageFilter *rotationFilter, *thresholdFilter, *positionFilter;
+ GPUImageFilter *thresholdFilter, *positionFilter;
GPUImageRawData *positionRawData, *videoRawData;
GPUImageView *filteredVideoView;
@@ -49,6 +49,7 @@ - (void)configureVideoFiltering;
{
CGRect mainScreenFrame = [[UIScreen mainScreen] applicationFrame];
videoCamera = [[GPUImageVideoCamera alloc] initWithSessionPreset:AVCaptureSessionPreset640x480 cameraPosition:AVCaptureDevicePositionBack];
+ videoCamera.outputImageOrientation = UIInterfaceOrientationPortrait;
filteredVideoView = [[GPUImageView alloc] initWithFrame:CGRectMake(0.0, 0.0, mainScreenFrame.size.width, mainScreenFrame.size.height)];
[self.view addSubview:filteredVideoView];
@@ -58,7 +59,6 @@ - (void)configureVideoFiltering;
positionFilter = [[GPUImageFilter alloc] initWithFragmentShaderFromFile:@"PositionColor"];
[positionFilter setFloat:thresholdSensitivity forUniform:@"threshold"];
[positionFilter setFloatVec3:thresholdColor forUniform:@"inputColor"];
- rotationFilter = [[GPUImageRotationFilter alloc] initWithRotation:kGPUImageRotateRight];
// CGSize videoPixelSize = filteredVideoView.bounds.size;
// videoPixelSize.width *= [filteredVideoView contentScaleFactor];
@@ -72,12 +72,8 @@ - (void)configureVideoFiltering;
videoRawData = [[GPUImageRawData alloc] initWithImageSize:videoPixelSize];
videoRawData.delegate = self;
- [videoCamera addTarget:rotationFilter];
- [rotationFilter addTarget:filteredVideoView];
- [rotationFilter addTarget:videoRawData];
-// [rotationFilter addTarget:positionFilter];
-// [positionFilter addTarget:filteredVideoView];
-// [positionFilter addTarget:videoRawData];
+ [videoCamera addTarget:filteredVideoView];
+ [videoCamera addTarget:videoRawData];
[videoCamera startCameraCapture];
}
@@ -147,31 +143,31 @@ - (void)handleSwitchOfDisplayMode:(id)sender;
trackingDot.opacity = 0.0f;
}
- [rotationFilter removeAllTargets];
+ [videoCamera removeAllTargets];
[positionFilter removeAllTargets];
[thresholdFilter removeAllTargets];
- [rotationFilter addTarget:videoRawData];
+ [videoCamera addTarget:videoRawData];
switch(displayMode)
{
case PASSTHROUGH_VIDEO:
{
- [rotationFilter addTarget:filteredVideoView];
+ [videoCamera addTarget:filteredVideoView];
}; break;
case SIMPLE_THRESHOLDING:
{
- [rotationFilter addTarget:thresholdFilter];
+ [videoCamera addTarget:thresholdFilter];
[thresholdFilter addTarget:filteredVideoView];
}; break;
case POSITION_THRESHOLDING:
{
- [rotationFilter addTarget:positionFilter];
+ [videoCamera addTarget:positionFilter];
[positionFilter addTarget:filteredVideoView];
}; break;
case OBJECT_TRACKING:
{
- [rotationFilter addTarget:filteredVideoView];
- [rotationFilter addTarget:positionFilter];
+ [videoCamera addTarget:filteredVideoView];
+ [videoCamera addTarget:positionFilter];
[positionFilter addTarget:positionRawData];
}; break;
}
@@ -72,13 +72,12 @@ - (id)initWithSize:(CGSize)newSize;
videoCamera = [[GPUImageVideoCamera alloc] initWithSessionPreset:AVCaptureSessionPreset640x480 cameraPosition:AVCaptureDevicePositionBack];
+ videoCamera.outputImageOrientation = UIInterfaceOrientationPortrait;
inputFilter = [[GPUImageSepiaFilter alloc] init];
- GPUImageRotationFilter *rotationFilter = [[GPUImageRotationFilter alloc] initWithRotation:kGPUImageRotateRight];
textureOutput = [[GPUImageTextureOutput alloc] init];
textureOutput.delegate = self;
- [videoCamera addTarget:rotationFilter];
- [rotationFilter addTarget:inputFilter];
+ [videoCamera addTarget:inputFilter];
[inputFilter addTarget:textureOutput];
[videoCamera startCameraCapture];
@@ -65,6 +65,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
case GPUIMAGE_CONTRAST: cell.textLabel.text = @"Contrast"; break;
case GPUIMAGE_BRIGHTNESS: cell.textLabel.text = @"Brightness"; break;
case GPUIMAGE_EXPOSURE: cell.textLabel.text = @"Exposure"; break;
+ case GPUIMAGE_RGB: cell.textLabel.text = @"RGB"; break;
case GPUIMAGE_SHARPEN: cell.textLabel.text = @"Sharpen"; break;
case GPUIMAGE_UNSHARPMASK: cell.textLabel.text = @"Unsharp mask"; break;
case GPUIMAGE_GAMMA: cell.textLabel.text = @"Gamma"; break;
@@ -115,10 +116,12 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
case GPUIMAGE_SOFTLIGHTBLEND: cell.textLabel.text = @"Soft light blend"; break;
case GPUIMAGE_KUWAHARA: cell.textLabel.text = @"Kuwahara"; break;
case GPUIMAGE_VIGNETTE: cell.textLabel.text = @"Vignette"; break;
- case GPUIMAGE_GAUSSIAN: cell.textLabel.text = @"Gaussian Blur"; break;
- case GPUIMAGE_FASTBLUR: cell.textLabel.text = @"Fast Blur"; break;
- case GPUIMAGE_BOXBLUR: cell.textLabel.text = @"Box Blur"; break;
- case GPUIMAGE_GAUSSIAN_SELECTIVE: cell.textLabel.text = @"Gaussian Selective Blur"; break;
+ case GPUIMAGE_GAUSSIAN: cell.textLabel.text = @"Gaussian blur"; break;
+ case GPUIMAGE_FASTBLUR: cell.textLabel.text = @"Fast blur"; break;
+ case GPUIMAGE_MEDIAN: cell.textLabel.text = @"Median (3x3)"; break;
+ case GPUIMAGE_BILATERAL: cell.textLabel.text = @"Bilateral blur"; break;
+ case GPUIMAGE_BOXBLUR: cell.textLabel.text = @"Box blur"; break;
+ case GPUIMAGE_GAUSSIAN_SELECTIVE: cell.textLabel.text = @"Gaussian selective blur"; break;
case GPUIMAGE_CUSTOM: cell.textLabel.text = @"Custom"; break;
case GPUIMAGE_FILECONFIG: cell.textLabel.text = @"Filter Chain"; break;
case GPUIMAGE_FILTERGROUP: cell.textLabel.text = @"Filter Group"; break;
@@ -6,6 +6,7 @@ typedef enum {
GPUIMAGE_CONTRAST,
GPUIMAGE_BRIGHTNESS,
GPUIMAGE_EXPOSURE,
+ GPUIMAGE_RGB,
GPUIMAGE_SHARPEN,
GPUIMAGE_UNSHARPMASK,
GPUIMAGE_TRANSFORM,
@@ -42,6 +43,8 @@ typedef enum {
GPUIMAGE_GAUSSIAN_SELECTIVE,
GPUIMAGE_FASTBLUR,
GPUIMAGE_BOXBLUR,
+ GPUIMAGE_MEDIAN,
+ GPUIMAGE_BILATERAL,
GPUIMAGE_SWIRL,
GPUIMAGE_BULGE,
GPUIMAGE_PINCH,
Oops, something went wrong.

0 comments on commit b10f83f

Please sign in to comment.