Repository: BradLarson/GPUImage Branch: master Commit: 167b0389bc6e Files: 616 Total size: 3.4 MB Directory structure: gitextract_fkk0nnpa/ ├── .gitignore ├── .travis.yml ├── GPUImage.podspec ├── License.txt ├── README.md ├── build.sh ├── examples/ │ ├── Mac/ │ │ ├── FilterShowcase/ │ │ │ ├── FilterShowcase/ │ │ │ │ ├── FilterShowcase-Info.plist │ │ │ │ ├── FilterShowcase-Prefix.pch │ │ │ │ ├── SLSAppDelegate.h │ │ │ │ ├── SLSAppDelegate.m │ │ │ │ ├── en.lproj/ │ │ │ │ │ ├── Credits.rtf │ │ │ │ │ ├── InfoPlist.strings │ │ │ │ │ └── MainMenu.xib │ │ │ │ └── main.m │ │ │ ├── FilterShowcase.xcodeproj/ │ │ │ │ ├── project.pbxproj │ │ │ │ └── xcshareddata/ │ │ │ │ └── xcschemes/ │ │ │ │ └── FilterShowcase.xcscheme │ │ │ ├── SLSFilterShowcaseWindowController.h │ │ │ ├── SLSFilterShowcaseWindowController.m │ │ │ └── SLSFilterShowcaseWindowController.xib │ │ ├── FilterShowcaseSwift/ │ │ │ ├── FilterShowcaseSwift/ │ │ │ │ ├── AppDelegate.swift │ │ │ │ ├── Base.lproj/ │ │ │ │ │ └── MainMenu.xib │ │ │ │ ├── FilterShowcaseWindowController.swift │ │ │ │ ├── FilterShowcaseWindowController.xib │ │ │ │ ├── Images.xcassets/ │ │ │ │ │ └── AppIcon.appiconset/ │ │ │ │ │ └── Contents.json │ │ │ │ ├── Info.plist │ │ │ │ └── main.swift │ │ │ ├── FilterShowcaseSwift.xcodeproj/ │ │ │ │ └── project.pbxproj │ │ │ └── FilterShowcaseSwiftTests/ │ │ │ ├── FilterShowcaseSwiftTests.swift │ │ │ └── Info.plist │ │ ├── MultiViewFilterExample/ │ │ │ ├── MultiViewFilterExample/ │ │ │ │ ├── MultiViewFilterExample-Info.plist │ │ │ │ ├── MultiViewFilterExample-Prefix.pch │ │ │ │ ├── SLSAppDelegate.h │ │ │ │ ├── SLSAppDelegate.m │ │ │ │ ├── SLSMultiViewWindowController.h │ │ │ │ ├── SLSMultiViewWindowController.m │ │ │ │ ├── SLSMultiViewWindowController.xib │ │ │ │ ├── Shader1.fsh │ │ │ │ ├── Shader2.fsh │ │ │ │ ├── en.lproj/ │ │ │ │ │ ├── Credits.rtf │ │ │ │ │ ├── InfoPlist.strings │ │ │ │ │ └── MainMenu.xib │ │ │ │ └── main.m │ │ │ └── MultiViewFilterExample.xcodeproj/ │ │ │ ├── project.pbxproj │ │ │ └── xcshareddata/ │ │ │ └── xcschemes/ │ │ │ └── MultiViewFilterExample.xcscheme │ │ ├── PlaygroundExample/ │ │ │ ├── PlaygroundExample/ │ │ │ │ ├── GPUImagePlayground.playground/ │ │ │ │ │ ├── Resources/ │ │ │ │ │ │ └── CustomFilter.fsh │ │ │ │ │ ├── contents.xcplayground │ │ │ │ │ ├── section-1.swift │ │ │ │ │ └── timeline.xctimeline │ │ │ │ └── main.swift │ │ │ └── PlaygroundExample.xcodeproj/ │ │ │ └── project.pbxproj │ │ ├── ShaderDesigner/ │ │ │ ├── ShaderDesigner/ │ │ │ │ ├── AppDelegate.h │ │ │ │ ├── AppDelegate.m │ │ │ │ ├── Base.lproj/ │ │ │ │ │ └── MainMenu.xib │ │ │ │ ├── Images.xcassets/ │ │ │ │ │ └── AppIcon.appiconset/ │ │ │ │ │ └── Contents.json │ │ │ │ ├── Info.plist │ │ │ │ ├── ShaderDesignerWindowController.h │ │ │ │ ├── ShaderDesignerWindowController.m │ │ │ │ ├── ShaderDesignerWindowController.xib │ │ │ │ └── main.m │ │ │ └── ShaderDesigner.xcodeproj/ │ │ │ └── project.pbxproj │ │ ├── SimplePhotoFilter/ │ │ │ ├── SimplePhotoFilter/ │ │ │ │ ├── SLSDocument.h │ │ │ │ ├── SLSDocument.m │ │ │ │ ├── SimplePhotoFilter-Info.plist │ │ │ │ ├── SimplePhotoFilter-Prefix.pch │ │ │ │ ├── en.lproj/ │ │ │ │ │ ├── Credits.rtf │ │ │ │ │ ├── InfoPlist.strings │ │ │ │ │ ├── MainMenu.xib │ │ │ │ │ └── SLSDocument.xib │ │ │ │ └── main.m │ │ │ └── SimplePhotoFilter.xcodeproj/ │ │ │ ├── project.pbxproj │ │ │ └── xcshareddata/ │ │ │ └── xcschemes/ │ │ │ └── SimplePhotoFilter.xcscheme │ │ ├── SimpleVideoFileFilter/ │ │ │ ├── SimpleVideoFileFilter.xcodeproj/ │ │ │ │ └── project.pbxproj │ │ │ ├── SimpleVideoFilter/ │ │ │ │ ├── AppDelegate.h │ │ │ │ ├── AppDelegate.m │ │ │ │ ├── Base.lproj/ │ │ │ │ │ └── MainMenu.xib │ │ │ │ ├── Images.xcassets/ │ │ │ │ │ └── AppIcon.appiconset/ │ │ │ │ │ └── Contents.json │ │ │ │ ├── Info.plist │ │ │ │ ├── SLSSimpleVideoFileFilterWindowController.h │ │ │ │ ├── SLSSimpleVideoFileFilterWindowController.m │ │ │ │ ├── SLSSimpleVideoFileFilterWindowController.xib │ │ │ │ ├── main.m │ │ │ │ └── sample_iPod.m4v │ │ │ └── SimpleVideoFilterTests/ │ │ │ ├── Info.plist │ │ │ └── SimpleVideoFilterTests.m │ │ └── SimpleVideoFilter/ │ │ ├── SimpleVideoFilter/ │ │ │ ├── AppDelegate.h │ │ │ ├── AppDelegate.m │ │ │ ├── Base.lproj/ │ │ │ │ └── MainMenu.xib │ │ │ ├── Images.xcassets/ │ │ │ │ └── AppIcon.appiconset/ │ │ │ │ └── Contents.json │ │ │ ├── Info.plist │ │ │ ├── SLSSimpleVideoFilterWindowController.h │ │ │ ├── SLSSimpleVideoFilterWindowController.m │ │ │ ├── SLSSimpleVideoFilterWindowController.xib │ │ │ └── main.m │ │ ├── SimpleVideoFilter.xcodeproj/ │ │ │ └── project.pbxproj │ │ └── SimpleVideoFilterTests/ │ │ ├── Info.plist │ │ └── SimpleVideoFilterTests.m │ └── iOS/ │ ├── BenchmarkSuite/ │ │ ├── BenchmarkSuite/ │ │ │ ├── BenchmarkAppDelegate.h │ │ │ ├── BenchmarkAppDelegate.m │ │ │ ├── BenchmarkSuite-Info.plist │ │ │ ├── BenchmarkSuite-Prefix.pch │ │ │ ├── BenchmarkTableViewController.h │ │ │ ├── BenchmarkTableViewController.m │ │ │ ├── BenchmarkTableViewController.xib │ │ │ ├── ImageFilteringBenchmarkController.h │ │ │ ├── ImageFilteringBenchmarkController.m │ │ │ ├── VideoFilteringBenchmarkController.h │ │ │ ├── VideoFilteringBenchmarkController.m │ │ │ ├── VideoFilteringDisplayController.h │ │ │ ├── VideoFilteringDisplayController.m │ │ │ ├── VideoFilteringDisplayController.xib │ │ │ ├── en.lproj/ │ │ │ │ └── InfoPlist.strings │ │ │ └── main.m │ │ ├── BenchmarkSuite.xcodeproj/ │ │ │ ├── project.pbxproj │ │ │ └── xcshareddata/ │ │ │ └── xcschemes/ │ │ │ └── BenchmarkSuite.xcscheme │ │ └── GlyphishIconLicense.txt │ ├── ColorObjectTracking/ │ │ ├── ColorObjectTracking/ │ │ │ ├── ColorObjectTracking-Info.plist │ │ │ ├── ColorObjectTracking-Prefix.pch │ │ │ ├── ColorTrackingAppDelegate.h │ │ │ ├── ColorTrackingAppDelegate.m │ │ │ ├── ColorTrackingViewController.h │ │ │ ├── ColorTrackingViewController.m │ │ │ ├── PositionColor.fsh │ │ │ ├── Threshold.fsh │ │ │ ├── en.lproj/ │ │ │ │ └── InfoPlist.strings │ │ │ └── main.m │ │ └── ColorObjectTracking.xcodeproj/ │ │ ├── project.pbxproj │ │ └── xcshareddata/ │ │ └── xcschemes/ │ │ └── ColorObjectTracking.xcscheme │ ├── CubeExample/ │ │ ├── Classes/ │ │ │ ├── CubeExampleAppDelegate.h │ │ │ ├── CubeExampleAppDelegate.m │ │ │ ├── DisplayViewController.h │ │ │ ├── DisplayViewController.m │ │ │ ├── ES2Renderer.h │ │ │ ├── ES2Renderer.m │ │ │ └── ESRenderer.h │ │ ├── CubeExample-Info.plist │ │ ├── CubeExample.xcodeproj/ │ │ │ ├── project.pbxproj │ │ │ └── xcshareddata/ │ │ │ └── xcschemes/ │ │ │ └── CubeExample.xcscheme │ │ ├── CubeExample_Prefix.pch │ │ ├── Shaders/ │ │ │ ├── Shader.fsh │ │ │ └── Shader.vsh │ │ └── main.m │ ├── FeatureExtractionTest/ │ │ ├── FeatureExtractionTest/ │ │ │ ├── FeatureExtractionAppDelegate.h │ │ │ ├── FeatureExtractionAppDelegate.m │ │ │ ├── FeatureExtractionTest-Info.plist │ │ │ ├── FeatureExtractionTest-Prefix.pch │ │ │ ├── en.lproj/ │ │ │ │ └── InfoPlist.strings │ │ │ └── main.m │ │ └── FeatureExtractionTest.xcodeproj/ │ │ ├── project.pbxproj │ │ └── xcshareddata/ │ │ └── xcschemes/ │ │ └── FeatureExtractionTest.xcscheme │ ├── FilterShowcase/ │ │ ├── FilterShowcase/ │ │ │ ├── CustomFilter.fsh │ │ │ ├── FilterShowcase-Info.plist │ │ │ ├── FilterShowcase-Prefix.pch │ │ │ ├── SampleConfiguration.plist │ │ │ ├── ShowcaseAppDelegate.h │ │ │ ├── ShowcaseAppDelegate.m │ │ │ ├── ShowcaseFilterListController.h │ │ │ ├── ShowcaseFilterListController.m │ │ │ ├── ShowcaseFilterViewController.h │ │ │ ├── ShowcaseFilterViewController.m │ │ │ ├── ShowcaseFilterViewController.xib │ │ │ ├── en.lproj/ │ │ │ │ └── InfoPlist.strings │ │ │ └── main.m │ │ └── FilterShowcase.xcodeproj/ │ │ ├── project.pbxproj │ │ └── xcshareddata/ │ │ └── xcschemes/ │ │ └── FilterShowcase.xcscheme │ ├── FilterShowcaseSwift/ │ │ ├── FilterShowcaseSwift/ │ │ │ ├── AppDelegate.swift │ │ │ ├── Base.lproj/ │ │ │ │ └── Main.storyboard │ │ │ ├── FilterDisplayViewController.swift │ │ │ ├── FilterListViewController.swift │ │ │ ├── FilterOperationTypes.swift │ │ │ ├── FilterOperations.swift │ │ │ ├── Images.xcassets/ │ │ │ │ ├── AppIcon.appiconset/ │ │ │ │ │ └── Contents.json │ │ │ │ └── LaunchImage.launchimage/ │ │ │ │ └── Contents.json │ │ │ └── Info.plist │ │ └── FilterShowcaseSwift.xcodeproj/ │ │ └── project.pbxproj │ ├── MultiViewFilterExample/ │ │ ├── MultiViewFilterExample/ │ │ │ ├── MultiViewAppDelegate.h │ │ │ ├── MultiViewAppDelegate.m │ │ │ ├── MultiViewFilterExample-Info.plist │ │ │ ├── MultiViewFilterExample-Prefix.pch │ │ │ ├── MultiViewViewController.h │ │ │ ├── MultiViewViewController.m │ │ │ ├── Shader1.fsh │ │ │ ├── Shader2.fsh │ │ │ ├── en.lproj/ │ │ │ │ └── InfoPlist.strings │ │ │ └── main.m │ │ └── MultiViewFilterExample.xcodeproj/ │ │ ├── project.pbxproj │ │ └── xcshareddata/ │ │ └── xcschemes/ │ │ └── MultiViewFilterExample.xcscheme │ ├── RawDataTest/ │ │ ├── RawDataTest/ │ │ │ ├── CalculationShader.fsh │ │ │ ├── RawDataTest-Info.plist │ │ │ ├── RawDataTest-Prefix.pch │ │ │ ├── RawDataTestAppDelegate.h │ │ │ ├── RawDataTestAppDelegate.m │ │ │ ├── en.lproj/ │ │ │ │ └── InfoPlist.strings │ │ │ └── main.m │ │ └── RawDataTest.xcodeproj/ │ │ ├── project.pbxproj │ │ └── xcshareddata/ │ │ └── xcschemes/ │ │ └── RawDataTest.xcscheme │ ├── SimpleImageFilter/ │ │ ├── SimpleImageFilter/ │ │ │ ├── SimpleImageAppDelegate.h │ │ │ ├── SimpleImageAppDelegate.m │ │ │ ├── SimpleImageFilter-Info.plist │ │ │ ├── SimpleImageFilter-Prefix.pch │ │ │ ├── SimpleImageViewController.h │ │ │ ├── SimpleImageViewController.m │ │ │ ├── en.lproj/ │ │ │ │ └── InfoPlist.strings │ │ │ └── main.m │ │ └── SimpleImageFilter.xcodeproj/ │ │ ├── project.pbxproj │ │ └── xcshareddata/ │ │ └── xcschemes/ │ │ └── SimpleImageFilter.xcscheme │ ├── SimplePhotoFilter/ │ │ ├── SimplePhotoFilter/ │ │ │ ├── PhotoAppDelegate.h │ │ │ ├── PhotoAppDelegate.m │ │ │ ├── PhotoViewController.h │ │ │ ├── PhotoViewController.m │ │ │ ├── SimplePhotoFilter-Info.plist │ │ │ ├── SimplePhotoFilter-Prefix.pch │ │ │ ├── en.lproj/ │ │ │ │ └── InfoPlist.strings │ │ │ └── main.m │ │ └── SimplePhotoFilter.xcodeproj/ │ │ ├── project.pbxproj │ │ └── xcshareddata/ │ │ └── xcschemes/ │ │ └── SimplePhotoFilter.xcscheme │ ├── SimpleSwiftVideoFilterExample/ │ │ ├── SimpleSwiftVideoFilterExample/ │ │ │ ├── AppDelegate.swift │ │ │ ├── Base.lproj/ │ │ │ │ └── Main.storyboard │ │ │ ├── Images.xcassets/ │ │ │ │ ├── AppIcon.appiconset/ │ │ │ │ │ └── Contents.json │ │ │ │ └── LaunchImage.launchimage/ │ │ │ │ └── Contents.json │ │ │ ├── Info.plist │ │ │ └── ViewController.swift │ │ └── SimpleSwiftVideoFilterExample.xcodeproj/ │ │ └── project.pbxproj │ ├── SimpleVideoFileFilter/ │ │ ├── SimpleVideoFileFilter/ │ │ │ ├── SimpleVideoFileFilter-Info.plist │ │ │ ├── SimpleVideoFileFilter-Prefix.pch │ │ │ ├── SimpleVideoFileFilterAppDelegate.h │ │ │ ├── SimpleVideoFileFilterAppDelegate.m │ │ │ ├── SimpleVideoFileFilterViewController.h │ │ │ ├── SimpleVideoFileFilterViewController.m │ │ │ ├── SimpleVideoFileFilterViewController.xib │ │ │ ├── en.lproj/ │ │ │ │ └── InfoPlist.strings │ │ │ ├── main.m │ │ │ └── sample_iPod.m4v │ │ └── SimpleVideoFileFilter.xcodeproj/ │ │ ├── project.pbxproj │ │ └── xcshareddata/ │ │ └── xcschemes/ │ │ └── SimpleVideoFileFilter.xcscheme │ └── SimpleVideoFilter/ │ ├── SimpleVideoFilter/ │ │ ├── SimpleVideoFilter-Info.plist │ │ ├── SimpleVideoFilter-Prefix.pch │ │ ├── SimpleVideoFilterAppDelegate.h │ │ ├── SimpleVideoFilterAppDelegate.m │ │ ├── SimpleVideoFilterViewController.h │ │ ├── SimpleVideoFilterViewController.m │ │ ├── SimpleVideoFilterViewController.xib │ │ ├── en.lproj/ │ │ │ └── InfoPlist.strings │ │ └── main.m │ └── SimpleVideoFilter.xcodeproj/ │ ├── project.pbxproj │ └── xcshareddata/ │ └── xcschemes/ │ └── SimpleVideoFilter.xcscheme └── framework/ ├── GPUImage.xcodeproj/ │ ├── project.pbxproj │ └── xcshareddata/ │ └── xcschemes/ │ ├── Documentation.xcscheme │ ├── GPUImage.xcscheme │ └── GPUImageFramework.xcscheme ├── GPUImageMac.xcodeproj/ │ ├── project.pbxproj │ └── xcshareddata/ │ └── xcschemes/ │ └── GPUImage.xcscheme └── Source/ ├── GLProgram.h ├── GLProgram.m ├── GPUImage.h ├── GPUImage3x3ConvolutionFilter.h ├── GPUImage3x3ConvolutionFilter.m ├── GPUImage3x3TextureSamplingFilter.h ├── GPUImage3x3TextureSamplingFilter.m ├── GPUImageAdaptiveThresholdFilter.h ├── GPUImageAdaptiveThresholdFilter.m ├── GPUImageAddBlendFilter.h ├── GPUImageAddBlendFilter.m ├── GPUImageAlphaBlendFilter.h ├── GPUImageAlphaBlendFilter.m ├── GPUImageAmatorkaFilter.h ├── GPUImageAmatorkaFilter.m ├── GPUImageAverageColor.h ├── GPUImageAverageColor.m ├── GPUImageAverageLuminanceThresholdFilter.h ├── GPUImageAverageLuminanceThresholdFilter.m ├── GPUImageBilateralFilter.h ├── GPUImageBilateralFilter.m ├── GPUImageBoxBlurFilter.h ├── GPUImageBoxBlurFilter.m ├── GPUImageBrightnessFilter.h ├── GPUImageBrightnessFilter.m ├── GPUImageBuffer.h ├── GPUImageBuffer.m ├── GPUImageBulgeDistortionFilter.h ├── GPUImageBulgeDistortionFilter.m ├── GPUImageCGAColorspaceFilter.h ├── GPUImageCGAColorspaceFilter.m ├── GPUImageCannyEdgeDetectionFilter.h ├── GPUImageCannyEdgeDetectionFilter.m ├── GPUImageChromaKeyBlendFilter.h ├── GPUImageChromaKeyBlendFilter.m ├── GPUImageChromaKeyFilter.h ├── GPUImageChromaKeyFilter.m ├── GPUImageClosingFilter.h ├── GPUImageClosingFilter.m ├── GPUImageColorBlendFilter.h ├── GPUImageColorBlendFilter.m ├── GPUImageColorBurnBlendFilter.h ├── GPUImageColorBurnBlendFilter.m ├── GPUImageColorConversion.h ├── GPUImageColorConversion.m ├── GPUImageColorDodgeBlendFilter.h ├── GPUImageColorDodgeBlendFilter.m ├── GPUImageColorInvertFilter.h ├── GPUImageColorInvertFilter.m ├── GPUImageColorLocalBinaryPatternFilter.h ├── GPUImageColorLocalBinaryPatternFilter.m ├── GPUImageColorMatrixFilter.h ├── GPUImageColorMatrixFilter.m ├── GPUImageColorPackingFilter.h ├── GPUImageColorPackingFilter.m ├── GPUImageColourFASTFeatureDetector.h ├── GPUImageColourFASTFeatureDetector.m ├── GPUImageColourFASTSamplingOperation.h ├── GPUImageColourFASTSamplingOperation.m ├── GPUImageContrastFilter.h ├── GPUImageContrastFilter.m ├── GPUImageCropFilter.h ├── GPUImageCropFilter.m ├── GPUImageCrosshairGenerator.h ├── GPUImageCrosshairGenerator.m ├── GPUImageCrosshatchFilter.h ├── GPUImageCrosshatchFilter.m ├── GPUImageDarkenBlendFilter.h ├── GPUImageDarkenBlendFilter.m ├── GPUImageDifferenceBlendFilter.h ├── GPUImageDifferenceBlendFilter.m ├── GPUImageDilationFilter.h ├── GPUImageDilationFilter.m ├── GPUImageDirectionalNonMaximumSuppressionFilter.h ├── GPUImageDirectionalNonMaximumSuppressionFilter.m ├── GPUImageDirectionalSobelEdgeDetectionFilter.h ├── GPUImageDirectionalSobelEdgeDetectionFilter.m ├── GPUImageDissolveBlendFilter.h ├── GPUImageDissolveBlendFilter.m ├── GPUImageDivideBlendFilter.h ├── GPUImageDivideBlendFilter.m ├── GPUImageEmbossFilter.h ├── GPUImageEmbossFilter.m ├── GPUImageErosionFilter.h ├── GPUImageErosionFilter.m ├── GPUImageExclusionBlendFilter.h ├── GPUImageExclusionBlendFilter.m ├── GPUImageExposureFilter.h ├── GPUImageExposureFilter.m ├── GPUImageFASTCornerDetectionFilter.h ├── GPUImageFASTCornerDetectionFilter.m ├── GPUImageFalseColorFilter.h ├── GPUImageFalseColorFilter.m ├── GPUImageFilter.h ├── GPUImageFilter.m ├── GPUImageFilterGroup.h ├── GPUImageFilterGroup.m ├── GPUImageFilterPipeline.h ├── GPUImageFilterPipeline.m ├── GPUImageFourInputFilter.h ├── GPUImageFourInputFilter.m ├── GPUImageFramebuffer.h ├── GPUImageFramebuffer.m ├── GPUImageFramebufferCache.h ├── GPUImageFramebufferCache.m ├── GPUImageGammaFilter.h ├── GPUImageGammaFilter.m ├── GPUImageGaussianBlurFilter.h ├── GPUImageGaussianBlurFilter.m ├── GPUImageGaussianBlurPositionFilter.h ├── GPUImageGaussianBlurPositionFilter.m ├── GPUImageGaussianSelectiveBlurFilter.h ├── GPUImageGaussianSelectiveBlurFilter.m ├── GPUImageGlassSphereFilter.h ├── GPUImageGlassSphereFilter.m ├── GPUImageGrayscaleFilter.h ├── GPUImageGrayscaleFilter.m ├── GPUImageHSBFilter.h ├── GPUImageHSBFilter.m ├── GPUImageHalftoneFilter.h ├── GPUImageHalftoneFilter.m ├── GPUImageHardLightBlendFilter.h ├── GPUImageHardLightBlendFilter.m ├── GPUImageHarrisCornerDetectionFilter.h ├── GPUImageHarrisCornerDetectionFilter.m ├── GPUImageHazeFilter.h ├── GPUImageHazeFilter.m ├── GPUImageHighPassFilter.h ├── GPUImageHighPassFilter.m ├── GPUImageHighlightShadowFilter.h ├── GPUImageHighlightShadowFilter.m ├── GPUImageHighlightShadowTintFilter.h ├── GPUImageHighlightShadowTintFilter.m ├── GPUImageHistogramEqualizationFilter.h ├── GPUImageHistogramEqualizationFilter.m ├── GPUImageHistogramFilter.h ├── GPUImageHistogramFilter.m ├── GPUImageHistogramGenerator.h ├── GPUImageHistogramGenerator.m ├── GPUImageHoughTransformLineDetector.h ├── GPUImageHoughTransformLineDetector.m ├── GPUImageHueBlendFilter.h ├── GPUImageHueBlendFilter.m ├── GPUImageHueFilter.h ├── GPUImageHueFilter.m ├── GPUImageJFAVoronoiFilter.h ├── GPUImageJFAVoronoiFilter.m ├── GPUImageKuwaharaFilter.h ├── GPUImageKuwaharaFilter.m ├── GPUImageKuwaharaRadius3Filter.h ├── GPUImageKuwaharaRadius3Filter.m ├── GPUImageLanczosResamplingFilter.h ├── GPUImageLanczosResamplingFilter.m ├── GPUImageLaplacianFilter.h ├── GPUImageLaplacianFilter.m ├── GPUImageLevelsFilter.h ├── GPUImageLevelsFilter.m ├── GPUImageLightenBlendFilter.h ├── GPUImageLightenBlendFilter.m ├── GPUImageLineGenerator.h ├── GPUImageLineGenerator.m ├── GPUImageLinearBurnBlendFilter.h ├── GPUImageLinearBurnBlendFilter.m ├── GPUImageLocalBinaryPatternFilter.h ├── GPUImageLocalBinaryPatternFilter.m ├── GPUImageLookupFilter.h ├── GPUImageLookupFilter.m ├── GPUImageLowPassFilter.h ├── GPUImageLowPassFilter.m ├── GPUImageLuminanceRangeFilter.h ├── GPUImageLuminanceRangeFilter.m ├── GPUImageLuminanceThresholdFilter.h ├── GPUImageLuminanceThresholdFilter.m ├── GPUImageLuminosity.h ├── GPUImageLuminosity.m ├── GPUImageLuminosityBlendFilter.h ├── GPUImageLuminosityBlendFilter.m ├── GPUImageMaskFilter.h ├── GPUImageMaskFilter.m ├── GPUImageMedianFilter.h ├── GPUImageMedianFilter.m ├── GPUImageMissEtikateFilter.h ├── GPUImageMissEtikateFilter.m ├── GPUImageMonochromeFilter.h ├── GPUImageMonochromeFilter.m ├── GPUImageMosaicFilter.h ├── GPUImageMosaicFilter.m ├── GPUImageMotionBlurFilter.h ├── GPUImageMotionBlurFilter.m ├── GPUImageMotionDetector.h ├── GPUImageMotionDetector.m ├── GPUImageMovie.h ├── GPUImageMovie.m ├── GPUImageMovieComposition.h ├── GPUImageMovieComposition.m ├── GPUImageMultiplyBlendFilter.h ├── GPUImageMultiplyBlendFilter.m ├── GPUImageNobleCornerDetectionFilter.h ├── GPUImageNobleCornerDetectionFilter.m ├── GPUImageNonMaximumSuppressionFilter.h ├── GPUImageNonMaximumSuppressionFilter.m ├── GPUImageNormalBlendFilter.h ├── GPUImageNormalBlendFilter.m ├── GPUImageOpacityFilter.h ├── GPUImageOpacityFilter.m ├── GPUImageOpeningFilter.h ├── GPUImageOpeningFilter.m ├── GPUImageOutput.h ├── GPUImageOutput.m ├── GPUImageOverlayBlendFilter.h ├── GPUImageOverlayBlendFilter.m ├── GPUImageParallelCoordinateLineTransformFilter.h ├── GPUImageParallelCoordinateLineTransformFilter.m ├── GPUImagePerlinNoiseFilter.h ├── GPUImagePerlinNoiseFilter.m ├── GPUImagePinchDistortionFilter.h ├── GPUImagePinchDistortionFilter.m ├── GPUImagePixellateFilter.h ├── GPUImagePixellateFilter.m ├── GPUImagePixellatePositionFilter.h ├── GPUImagePixellatePositionFilter.m ├── GPUImagePoissonBlendFilter.h ├── GPUImagePoissonBlendFilter.m ├── GPUImagePolarPixellateFilter.h ├── GPUImagePolarPixellateFilter.m ├── GPUImagePolkaDotFilter.h ├── GPUImagePolkaDotFilter.m ├── GPUImagePosterizeFilter.h ├── GPUImagePosterizeFilter.m ├── GPUImagePrewittEdgeDetectionFilter.h ├── GPUImagePrewittEdgeDetectionFilter.m ├── GPUImageRGBClosingFilter.h ├── GPUImageRGBClosingFilter.m ├── GPUImageRGBDilationFilter.h ├── GPUImageRGBDilationFilter.m ├── GPUImageRGBErosionFilter.h ├── GPUImageRGBErosionFilter.m ├── GPUImageRGBFilter.h ├── GPUImageRGBFilter.m ├── GPUImageRGBOpeningFilter.h ├── GPUImageRGBOpeningFilter.m ├── GPUImageRawDataInput.h ├── GPUImageRawDataInput.m ├── GPUImageRawDataOutput.h ├── GPUImageRawDataOutput.m ├── GPUImageSaturationBlendFilter.h ├── GPUImageSaturationBlendFilter.m ├── GPUImageSaturationFilter.h ├── GPUImageSaturationFilter.m ├── GPUImageScreenBlendFilter.h ├── GPUImageScreenBlendFilter.m ├── GPUImageSepiaFilter.h ├── GPUImageSepiaFilter.m ├── GPUImageSharpenFilter.h ├── GPUImageSharpenFilter.m ├── GPUImageShiTomasiFeatureDetectionFilter.h ├── GPUImageShiTomasiFeatureDetectionFilter.m ├── GPUImageSingleComponentGaussianBlurFilter.h ├── GPUImageSingleComponentGaussianBlurFilter.m ├── GPUImageSketchFilter.h ├── GPUImageSketchFilter.m ├── GPUImageSkinToneFilter.h ├── GPUImageSkinToneFilter.m ├── GPUImageSmoothToonFilter.h ├── GPUImageSmoothToonFilter.m ├── GPUImageSobelEdgeDetectionFilter.h ├── GPUImageSobelEdgeDetectionFilter.m ├── GPUImageSoftEleganceFilter.h ├── GPUImageSoftEleganceFilter.m ├── GPUImageSoftLightBlendFilter.h ├── GPUImageSoftLightBlendFilter.m ├── GPUImageSolarizeFilter.h ├── GPUImageSolarizeFilter.m ├── GPUImageSolidColorGenerator.h ├── GPUImageSolidColorGenerator.m ├── GPUImageSourceOverBlendFilter.h ├── GPUImageSourceOverBlendFilter.m ├── GPUImageSphereRefractionFilter.h ├── GPUImageSphereRefractionFilter.m ├── GPUImageStillCamera.h ├── GPUImageStillCamera.m ├── GPUImageStretchDistortionFilter.h ├── GPUImageStretchDistortionFilter.m ├── GPUImageSubtractBlendFilter.h ├── GPUImageSubtractBlendFilter.m ├── GPUImageSwirlFilter.h ├── GPUImageSwirlFilter.m ├── GPUImageTextureInput.h ├── GPUImageTextureInput.m ├── GPUImageTextureOutput.h ├── GPUImageTextureOutput.m ├── GPUImageThreeInputFilter.h ├── GPUImageThreeInputFilter.m ├── GPUImageThresholdEdgeDetectionFilter.h ├── GPUImageThresholdEdgeDetectionFilter.m ├── GPUImageThresholdSketchFilter.h ├── GPUImageThresholdSketchFilter.m ├── GPUImageThresholdedNonMaximumSuppressionFilter.h ├── GPUImageThresholdedNonMaximumSuppressionFilter.m ├── GPUImageTiltShiftFilter.h ├── GPUImageTiltShiftFilter.m ├── GPUImageToneCurveFilter.h ├── GPUImageToneCurveFilter.m ├── GPUImageToonFilter.h ├── GPUImageToonFilter.m ├── GPUImageTransformFilter.h ├── GPUImageTransformFilter.m ├── GPUImageTwoInputCrossTextureSamplingFilter.h ├── GPUImageTwoInputCrossTextureSamplingFilter.m ├── GPUImageTwoInputFilter.h ├── GPUImageTwoInputFilter.m ├── GPUImageTwoPassFilter.h ├── GPUImageTwoPassFilter.m ├── GPUImageTwoPassTextureSamplingFilter.h ├── GPUImageTwoPassTextureSamplingFilter.m ├── GPUImageUIElement.h ├── GPUImageUIElement.m ├── GPUImageUnsharpMaskFilter.h ├── GPUImageUnsharpMaskFilter.m ├── GPUImageVibranceFilter.h ├── GPUImageVibranceFilter.m ├── GPUImageVideoCamera.h ├── GPUImageVideoCamera.m ├── GPUImageVignetteFilter.h ├── GPUImageVignetteFilter.m ├── GPUImageVoronoiConsumerFilter.h ├── GPUImageVoronoiConsumerFilter.m ├── GPUImageWeakPixelInclusionFilter.h ├── GPUImageWeakPixelInclusionFilter.m ├── GPUImageWhiteBalanceFilter.h ├── GPUImageWhiteBalanceFilter.m ├── GPUImageXYDerivativeFilter.h ├── GPUImageXYDerivativeFilter.m ├── GPUImageZoomBlurFilter.h ├── GPUImageZoomBlurFilter.m ├── GPUImageiOSBlurFilter.h ├── GPUImageiOSBlurFilter.m ├── Mac/ │ ├── GPUImage.h │ ├── GPUImageAVCamera.h │ ├── GPUImageAVCamera.m │ ├── GPUImageContext.h │ ├── GPUImageContext.m │ ├── GPUImageMac-Info.plist │ ├── GPUImageMac-Prefix.pch │ ├── GPUImageMovieWriter.h │ ├── GPUImageMovieWriter.m │ ├── GPUImagePicture.h │ ├── GPUImagePicture.m │ ├── GPUImageView.h │ ├── GPUImageView.m │ └── en.lproj/ │ └── InfoPlist.strings └── iOS/ ├── Framework/ │ ├── GPUImageFramework.h │ ├── Info.plist │ └── module.modulemap ├── GPUImage-Prefix.pch ├── GPUImageContext.h ├── GPUImageContext.m ├── GPUImageMovieWriter.h ├── GPUImageMovieWriter.m ├── GPUImagePicture+TextureSubimage.h ├── GPUImagePicture+TextureSubimage.m ├── GPUImagePicture.h ├── GPUImagePicture.m ├── GPUImageView.h └── GPUImageView.m ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ # Exclude the build directory build/* examples/FilterShowcase/build* # Exclude temp nibs and swap files *~.nib *.swp # Exclude OS X folder attributes .DS_Store .svn # Exclude user-specific XCode 3 and 4 files *.mode1 *.mode1v3 *.mode2v3 *.perspective *.perspectivev3 *.pbxuser *.xcworkspace xcuserdata # Documentation documentation/* ================================================ FILE: .travis.yml ================================================ language: objective-c before_install: - pod --version - pod setup --silent - pod repo update --silent script: - pod lib lint - xctool -project framework/GPUImage.xcodeproj -scheme 'GPUImage' -configuration Release -sdk iphonesimulator -arch i386 build - xctool -project framework/GPUImageMac.xcodeproj -scheme 'GPUImage' - xctool -project examples/Mac/FilterShowcase/FilterShowcase.xcodeproj -scheme 'FilterShowcase' - xctool -project examples/Mac/MultiViewFilterExample/MultiViewFilterExample.xcodeproj -scheme 'MultiViewFilterExample' - xctool -project examples/Mac/SimplePhotoFilter/SimplePhotoFilter.xcodeproj -scheme 'SimplePhotoFilter' - xctool -project examples/iOS/BenchmarkSuite/BenchmarkSuite.xcodeproj -scheme 'BenchmarkSuite' -configuration Release -sdk iphonesimulator -arch i386 build - xctool -project examples/iOS/ColorObjectTracking/ColorObjectTracking.xcodeproj -scheme 'ColorObjectTracking' -configuration Release -sdk iphonesimulator -arch i386 build - xctool -project examples/iOS/CubeExample/CubeExample.xcodeproj -scheme 'CubeExample' -configuration Release -sdk iphonesimulator -arch i386 build - xctool -project examples/iOS/FeatureExtractionTest/FeatureExtractionTest.xcodeproj -scheme 'FeatureExtractionTest' -configuration Release -sdk iphonesimulator -arch i386 build - xctool -project examples/iOS/FilterShowcase/FilterShowcase.xcodeproj -scheme 'FilterShowcase' -configuration Release -sdk iphonesimulator -arch i386 build - xctool -project examples/iOS/MultiViewFilterExample/MultiViewFilterExample.xcodeproj -scheme 'MultiViewFilterExample' -configuration Release -sdk iphonesimulator -arch i386 build - xctool -project examples/iOS/RawDataTest/RawDataTest.xcodeproj -scheme 'RawDataTest' -configuration Release -sdk iphonesimulator -arch i386 build - xctool -project examples/iOS/SimpleImageFilter/SimpleImageFilter.xcodeproj -scheme 'SimpleImageFilter' -configuration Release -sdk iphonesimulator -arch i386 build - xctool -project examples/iOS/SimplePhotoFilter/SimplePhotoFilter.xcodeproj -scheme 'SimplePhotoFilter' -configuration Release -sdk iphonesimulator -arch i386 build - xctool -project examples/iOS/SimpleVideoFileFilter/SimpleVideoFileFilter.xcodeproj -scheme 'SimpleVideoFileFilter' -configuration Release -sdk iphonesimulator -arch i386 build - xctool -project examples/iOS/SimpleVideoFilter/SimpleVideoFilter.xcodeproj -scheme 'SimpleVideoFilter' -configuration Release -sdk iphonesimulator -arch i386 build ================================================ FILE: GPUImage.podspec ================================================ Pod::Spec.new do |s| s.name = 'GPUImage' s.version = '0.1.7' s.license = 'BSD' s.summary = 'An open source iOS framework for GPU-based image and video processing.' s.homepage = 'https://github.com/BradLarson/GPUImage' s.author = { 'Brad Larson' => 'contact@sunsetlakesoftware.com' } s.source = { :git => 'https://github.com/BradLarson/GPUImage.git', :tag => "#{s.version}" } s.source_files = 'framework/Source/**/*.{h,m}' s.resources = 'framework/Resources/*.png' s.requires_arc = true s.xcconfig = { 'CLANG_MODULES_AUTOLINK' => 'YES' } s.ios.deployment_target = '5.0' s.ios.exclude_files = 'framework/Source/Mac' s.ios.frameworks = ['OpenGLES', 'CoreMedia', 'QuartzCore', 'AVFoundation'] s.osx.deployment_target = '10.6' s.osx.exclude_files = 'framework/Source/iOS', 'framework/Source/GPUImageFilterPipeline.*', 'framework/Source/GPUImageMovieComposition.*', 'framework/Source/GPUImageVideoCamera.*', 'framework/Source/GPUImageStillCamera.*', 'framework/Source/GPUImageUIElement.*' s.osx.xcconfig = { 'GCC_WARN_ABOUT_RETURN_TYPE' => 'YES' } end ================================================ FILE: License.txt ================================================ Copyright (c) 2012, Brad Larson, Ben Cochran, Hugues Lismonde, Keitaroh Kobayashi, Alaric Cole, Matthew Clark, Jacob Gundersen, Chris Williams. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of the GPUImage framework nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================ FILE: README.md ================================================ # GPUImage #
Brad Larson http://www.sunsetlakesoftware.com [@bradlarson](https://twitter.com/bradlarson) contact@sunsetlakesoftware.com ## Overview ## The GPUImage framework is a BSD-licensed iOS library that lets you apply GPU-accelerated filters and other effects to images, live camera video, and movies. In comparison to Core Image (part of iOS 5.0), GPUImage allows you to write your own custom filters, supports deployment to iOS 4.0, and has a simpler interface. However, it currently lacks some of the more advanced features of Core Image, such as facial detection. For massively parallel operations like processing images or live video frames, GPUs have some significant performance advantages over CPUs. On an iPhone 4, a simple image filter can be over 100 times faster to perform on the GPU than an equivalent CPU-based filter. However, running custom filters on the GPU requires a lot of code to set up and maintain an OpenGL ES 2.0 rendering target for these filters. I created a sample project to do this: http://www.sunsetlakesoftware.com/2010/10/22/gpu-accelerated-video-processing-mac-and-ios and found that there was a lot of boilerplate code I had to write in its creation. Therefore, I put together this framework that encapsulates a lot of the common tasks you'll encounter when processing images and video and made it so that you don't need to care about the OpenGL ES 2.0 underpinnings. This framework compares favorably to Core Image when handling video, taking only 2.5 ms on an iPhone 4 to upload a frame from the camera, apply a gamma filter, and display, versus 106 ms for the same operation using Core Image. CPU-based processing takes 460 ms, making GPUImage 40X faster than Core Image for this operation on this hardware, and 184X faster than CPU-bound processing. On an iPhone 4S, GPUImage is only 4X faster than Core Image for this case, and 102X faster than CPU-bound processing. However, for more complex operations like Gaussian blurs at larger radii, Core Image currently outpaces GPUImage. ## License ## BSD-style, with the full license available with the framework in License.txt. ## Technical requirements ## - OpenGL ES 2.0: Applications using this will not run on the original iPhone, iPhone 3G, and 1st and 2nd generation iPod touches - iOS 4.1 as a deployment target (4.0 didn't have some extensions needed for movie reading). iOS 4.3 is needed as a deployment target if you wish to show live video previews when taking a still photo. - iOS 5.0 SDK to build - Devices must have a camera to use camera-related functionality (obviously) - The framework uses automatic reference counting (ARC), but should support projects using both ARC and manual reference counting if added as a subproject as explained below. For manual reference counting applications targeting iOS 4.x, you'll need add -fobjc-arc to the Other Linker Flags for your application project. ## General architecture ## GPUImage uses OpenGL ES 2.0 shaders to perform image and video manipulation much faster than could be done in CPU-bound routines. However, it hides the complexity of interacting with the OpenGL ES API in a simplified Objective-C interface. This interface lets you define input sources for images and video, attach filters in a chain, and send the resulting processed image or video to the screen, to a UIImage, or to a movie on disk. Images or frames of video are uploaded from source objects, which are subclasses of GPUImageOutput. These include GPUImageVideoCamera (for live video from an iOS camera), GPUImageStillCamera (for taking photos with the camera), GPUImagePicture (for still images), and GPUImageMovie (for movies). Source objects upload still image frames to OpenGL ES as textures, then hand those textures off to the next objects in the processing chain. Filters and other subsequent elements in the chain conform to the GPUImageInput protocol, which lets them take in the supplied or processed texture from the previous link in the chain and do something with it. Objects one step further down the chain are considered targets, and processing can be branched by adding multiple targets to a single output or filter. For example, an application that takes in live video from the camera, converts that video to a sepia tone, then displays the video onscreen would set up a chain looking something like the following: GPUImageVideoCamera -> GPUImageSepiaFilter -> GPUImageView ## Adding the static library to your iOS project ## Note: if you want to use this in a Swift project, you need to use the steps in the "Adding this as a framework" section instead of the following. Swift needs modules for third-party code. Once you have the latest source code for the framework, it's fairly straightforward to add it to your application. Start by dragging the GPUImage.xcodeproj file into your application's Xcode project to embed the framework in your project. Next, go to your application's target and add GPUImage as a Target Dependency. Finally, you'll want to drag the libGPUImage.a library from the GPUImage framework's Products folder to the Link Binary With Libraries build phase in your application's target. GPUImage needs a few other frameworks to be linked into your application, so you'll need to add the following as linked libraries in your application target: - CoreMedia - CoreVideo - OpenGLES - AVFoundation - QuartzCore You'll also need to find the framework headers, so within your project's build settings set the Header Search Paths to the relative path from your application to the framework/ subdirectory within the GPUImage source directory. Make this header search path recursive. To use the GPUImage classes within your application, simply include the core framework header using the following: #import "GPUImage.h" As a note: if you run into the error "Unknown class GPUImageView in Interface Builder" or the like when trying to build an interface with Interface Builder, you may need to add -ObjC to your Other Linker Flags in your project's build settings. Also, if you need to deploy this to iOS 4.x, it appears that the current version of Xcode (4.3) requires that you weak-link the Core Video framework in your final application or you see crashes with the message "Symbol not found: _CVOpenGLESTextureCacheCreate" when you create an archive for upload to the App Store or for ad hoc distribution. To do this, go to your project's Build Phases tab, expand the Link Binary With Libraries group, and find CoreVideo.framework in the list. Change the setting for it in the far right of the list from Required to Optional. Additionally, this is an ARC-enabled framework, so if you want to use this within a manual reference counted application targeting iOS 4.x, you'll need to add -fobjc-arc to your Other Linker Flags as well. ### Building a static library at the command line ### If you don't want to include the project as a dependency in your application's Xcode project, you can build a universal static library for the iOS Simulator or device. To do this, run `build.sh` at the command line. The resulting library and header files will be located at `build/Release-iphone`. You may also change the version of the iOS SDK by changing the `IOSSDK_VER` variable in `build.sh` (all available versions can be found using `xcodebuild -showsdks`). ## Adding this as a framework (module) to your Mac or iOS project ## Xcode 6 and iOS 8 support the use of full frameworks, as does the Mac, which simplifies the process of adding this to your application. To add this to your application, I recommend dragging the .xcodeproj project file into your application's project (as you would in the static library target). For your application, go to its target build settings and choose the Build Phases tab. Under the Target Dependencies grouping, add GPUImageFramework on iOS (not GPUImage, which builds the static library) or GPUImage on the Mac. Under the Link Binary With Libraries section, add GPUImage.framework. This should cause GPUImage to build as a framework. Under Xcode 6, this will also build as a module, which will allow you to use this in Swift projects. When set up as above, you should just need to use import GPUImage to pull it in. You then need to add a new Copy Files build phase, set the Destination to Frameworks, and add the GPUImage.framework build product to that. This will allow the framework to be bundled with your application (otherwise, you'll see cryptic "dyld: Library not loaded: @rpath/GPUImage.framework/GPUImage" errors on execution). ### 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 Github or through Homebrew. It will also build and install a .docset file, which you can view with your favorite documentation tool. ## Performing common tasks ## ### Filtering live video ### 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)]; // Add the view somewhere so it's visible [videoCamera addTarget:customFilter]; [customFilter addTarget:filteredVideoView]; [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. 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. For blending filters and others that take in more than one image, you can create multiple outputs and add a single filter as a target for both of these outputs. The order with which the outputs are added as targets will affect the order in which the input images are blended or otherwise processed. Also, if you wish to enable microphone audio capture for recording to a movie, you'll need to set the audioEncodingTarget of the camera to be your movie writer, like for the following: videoCamera.audioEncodingTarget = movieWriter; ### Capturing and filtering a still photo ### 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]; [stillCamera addTarget:filter]; GPUImageView *filterView = (GPUImageView *)self.view; [filter addTarget:filterView]; [stillCamera startCameraCapture]; This will give you a live, filtered feed of the still camera's preview video. Note that this preview video is only provided on iOS 4.3 and higher, so you may need to set that as your deployment target if you wish to have this functionality. Once you want to capture a photo, you use a callback block like the following: [stillCamera capturePhotoProcessedUpToFilter:filter withCompletionHandler:^(UIImage *processedImage, NSError *error){ NSData *dataForJPEGFile = UIImageJPEGRepresentation(processedImage, 0.8); NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSError *error2 = nil; if (![dataForJPEGFile writeToFile:[documentsDirectory stringByAppendingPathComponent:@"FilteredPhoto.jpg"] options:NSAtomicWrite error:&error2]) { return; } }]; The above code captures a full-size photo processed by the same filter chain used in the preview view and saves that photo to disk as a JPEG in the application's documents directory. Note that the framework currently can't handle images larger than 2048 pixels wide or high on older devices (those before the iPhone 4S, iPad 2, or Retina iPad) due to texture size limitations. This means that the iPhone 4, whose camera outputs still photos larger than this, won't be able to capture photos like this. A tiling mechanism is being implemented to work around this. All other devices should be able to capture and filter photos using this method. ### Processing a still image ### There are a couple of ways to process a still image and create a result. The first way you can do this is by creating a still image source object and manually creating a filter chain: UIImage *inputImage = [UIImage imageNamed:@"Lambeau.jpg"]; GPUImagePicture *stillImageSource = [[GPUImagePicture alloc] initWithImage:inputImage]; GPUImageSepiaFilter *stillImageFilter = [[GPUImageSepiaFilter alloc] init]; [stillImageSource addTarget:stillImageFilter]; [stillImageFilter useNextFrameForImageCapture]; [stillImageSource processImage]; UIImage *currentFilteredVideoFrame = [stillImageFilter imageFromCurrentFramebuffer]; Note that for a manual capture of an image from a filter, you need to set -useNextFrameForImageCapture in order to tell the filter that you'll be needing to capture from it later. By default, GPUImage reuses framebuffers within filters to conserve memory, so if you need to hold on to a filter's framebuffer for manual image capture, you need to let it know ahead of time. For single filters that you wish to apply to an image, you can simply do the following: GPUImageSepiaFilter *stillImageFilter2 = [[GPUImageSepiaFilter alloc] init]; UIImage *quickFilteredImage = [stillImageFilter2 imageByFilteringImage:inputImage]; ### Writing a custom filter ### One significant advantage of this framework over Core Image on iOS (as of iOS 5.0) is the ability to write your own custom image and video processing filters. These filters are supplied as OpenGL ES 2.0 fragment shaders, written in the C-like OpenGL Shading Language. A custom filter is initialized with code like GPUImageFilter *customFilter = [[GPUImageFilter alloc] initWithFragmentShaderFromFile:@"CustomShader"]; where the extension used for the fragment shader is .fsh. Additionally, you can use the -initWithFragmentShaderFromString: initializer to provide the fragment shader as a string, if you would not like to ship your fragment shaders in your application bundle. Fragment shaders perform their calculations for each pixel to be rendered at that filter stage. They do this using the OpenGL Shading Language (GLSL), a C-like language with additions specific to 2-D and 3-D graphics. An example of a fragment shader is the following sepia-tone filter: varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; void main() { lowp vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); lowp vec4 outputColor; outputColor.r = (textureColor.r * 0.393) + (textureColor.g * 0.769) + (textureColor.b * 0.189); outputColor.g = (textureColor.r * 0.349) + (textureColor.g * 0.686) + (textureColor.b * 0.168); outputColor.b = (textureColor.r * 0.272) + (textureColor.g * 0.534) + (textureColor.b * 0.131); outputColor.a = 1.0; gl_FragColor = outputColor; } For an image filter to be usable within the GPUImage framework, the first two lines that take in the textureCoordinate varying (for the current coordinate within the texture, normalized to 1.0) and the inputImageTexture uniform (for the actual input image frame texture) are required. The remainder of the shader grabs the color of the pixel at this location in the passed-in texture, manipulates it in such a way as to produce a sepia tone, and writes that pixel color out to be used in the next stage of the processing pipeline. One thing to note when adding fragment shaders to your Xcode project is that Xcode thinks they are source code files. To work around this, you'll need to manually move your shader from the Compile Sources build phase to the Copy Bundle Resources one in order to get the shader to be included in your application bundle. ### Filtering and re-encoding a movie ### 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. Currently, GPUImageMovieWriter is fast enough to record live 720p video at up to 20 FPS on the iPhone 4, and both 720p and 1080p video at 30 FPS on the iPhone 4S (as well as on the new iPad). 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]; [movieFile addTarget:pixellateFilter]; NSString *pathToMovie = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/Movie.m4v"]; unlink([pathToMovie UTF8String]); NSURL *movieURL = [NSURL fileURLWithPath:pathToMovie]; movieWriter = [[GPUImageMovieWriter alloc] initWithMovieURL:movieURL size:CGSizeMake(480.0, 640.0)]; [pixellateFilter addTarget:movieWriter]; movieWriter.shouldPassthroughAudio = YES; movieFile.audioEncodingTarget = movieWriter; [movieFile enableSynchronizedEncodingUsingMovieWriter:movieWriter]; [movieWriter startRecording]; [movieFile startProcessing]; Once recording is finished, you need to remove the movie recorder from the filter chain and close off the recording using code like the following: [pixellateFilter removeTarget:movieWriter]; [movieWriter finishRecording]; A movie won't be usable until it has been finished off, so if this is interrupted before this point, the recording will be lost. ### Interacting with OpenGL ES ### GPUImage can both export and import textures from OpenGL ES through the use of its GPUImageTextureOutput and GPUImageTextureInput classes, respectively. This lets you record a movie from an OpenGL ES scene that is rendered to a framebuffer object with a bound texture, or filter video or images and then feed them into OpenGL ES as a texture to be displayed in the scene. The one caution with this approach is that the textures used in these processes must be shared between GPUImage's OpenGL ES context and any other context via a share group or something similar. ## Built-in filters ## There are currently 125 built-in filters, divided into the following categories: ### Color adjustments ### - **GPUImageBrightnessFilter**: Adjusts the brightness of the image - *brightness*: The adjusted brightness (-1.0 - 1.0, with 0.0 as the default) - **GPUImageExposureFilter**: Adjusts the exposure of the image - *exposure*: The adjusted exposure (-10.0 - 10.0, with 0.0 as the default) - **GPUImageContrastFilter**: Adjusts the contrast of the image - *contrast*: The adjusted contrast (0.0 - 4.0, with 1.0 as the default) - **GPUImageSaturationFilter**: Adjusts the saturation of an image - *saturation*: The degree of saturation or desaturation to apply to the image (0.0 - 2.0, with 1.0 as the default) - **GPUImageGammaFilter**: Adjusts the gamma of an image - *gamma*: The gamma adjustment to apply (0.0 - 3.0, with 1.0 as the default) - **GPUImageLevelsFilter**: Photoshop-like levels adjustment. The min, max, minOut and maxOut parameters are floats in the range [0, 1]. If you have parameters from Photoshop in the range [0, 255] you must first convert them to be [0, 1]. The gamma/mid parameter is a float >= 0. This matches the value from Photoshop. If you want to apply levels to RGB as well as individual channels you need to use this filter twice - first for the individual channels and then for all channels. - **GPUImageColorMatrixFilter**: Transforms the colors of an image by applying a matrix to them - *colorMatrix*: A 4x4 matrix used to transform each color in an image - *intensity*: The degree to which the new transformed color replaces the original color for each pixel - **GPUImageRGBFilter**: Adjusts the individual RGB channels of an image - *red*: Normalized values by which each color channel is multiplied. The range is from 0.0 up, with 1.0 as the default. - *green*: - *blue*: - **GPUImageHueFilter**: Adjusts the hue of an image - *hue*: The hue angle, in degrees. 90 degrees by default - **GPUImageVibranceFilter**: Adjusts the vibrance of an image - *vibrance*: The vibrance adjustment to apply, using 0.0 as the default, and a suggested min/max of around -1.2 and 1.2, respectively. - **GPUImageWhiteBalanceFilter**: Adjusts the white balance of an image. - *temperature*: The temperature to adjust the image by, in ºK. A value of 4000 is very cool and 7000 very warm. The default value is 5000. Note that the scale between 4000 and 5000 is nearly as visually significant as that between 5000 and 7000. - *tint*: The tint to adjust the image by. A value of -200 is *very* green and 200 is *very* pink. The default value is 0. - **GPUImageToneCurveFilter**: Adjusts the colors of an image based on spline curves for each color channel. - *redControlPoints*: - *greenControlPoints*: - *blueControlPoints*: - *rgbCompositeControlPoints*: The tone curve takes in a series of control points that define the spline curve for each color component, or for all three in the composite. These are stored as NSValue-wrapped CGPoints in an NSArray, with normalized X and Y coordinates from 0 - 1. The defaults are (0,0), (0.5,0.5), (1,1). - **GPUImageHighlightShadowFilter**: Adjusts the shadows and highlights of an image - *shadows*: Increase to lighten shadows, from 0.0 to 1.0, with 0.0 as the default. - *highlights*: Decrease to darken highlights, from 1.0 to 0.0, with 1.0 as the default. - **GPUImageHighlightShadowTintFilter**: Allows you to tint the shadows and highlights of an image independently using a color and intensity - *shadowTintColor*: Shadow tint RGB color (GPUVector4). Default: `{1.0f, 0.0f, 0.0f, 1.0f}` (red). - *highlightTintColor*: Highlight tint RGB color (GPUVector4). Default: `{0.0f, 0.0f, 1.0f, 1.0f}` (blue). - *shadowTintIntensity*: Shadow tint intensity, from 0.0 to 1.0. Default: 0.0 - *highlightTintIntensity*: Highlight tint intensity, from 0.0 to 1.0, with 0.0 as the default. - **GPUImageLookupFilter**: Uses an RGB color lookup image to remap the colors in an image. First, use your favourite photo editing application to apply a filter to lookup.png from GPUImage/framework/Resources. For this to work properly each pixel color must not depend on other pixels (e.g. blur will not work). If you need a more complex filter you can create as many lookup tables as required. Once ready, use your new lookup.png file as a second input for GPUImageLookupFilter. - **GPUImageAmatorkaFilter**: A photo filter based on a Photoshop action by Amatorka: http://amatorka.deviantart.com/art/Amatorka-Action-2-121069631 . If you want to use this effect you have to add lookup_amatorka.png from the GPUImage Resources folder to your application bundle. - **GPUImageMissEtikateFilter**: A photo filter based on a Photoshop action by Miss Etikate: http://miss-etikate.deviantart.com/art/Photoshop-Action-15-120151961 . If you want to use this effect you have to add lookup_miss_etikate.png from the GPUImage Resources folder to your application bundle. - **GPUImageSoftEleganceFilter**: Another lookup-based color remapping filter. If you want to use this effect you have to add lookup_soft_elegance_1.png and lookup_soft_elegance_2.png from the GPUImage Resources folder to your application bundle. - **GPUImageSkinToneFilter**: A skin-tone adjustment filter that affects a unique range of light skin-tone colors and adjusts the pink/green or pink/orange range accordingly. Default values are targetted at fair caucasian skin, but can be adjusted as required. - *skinToneAdjust*: Amount to adjust skin tone. Default: 0.0, suggested min/max: -0.3 and 0.3 respectively. - *skinHue*: Skin hue to be detected. Default: 0.05 (fair caucasian to reddish skin). - *skinHueThreshold*: Amount of variance in skin hue. Default: 40.0. - *maxHueShift*: Maximum amount of hue shifting allowed. Default: 0.25. - *maxSaturationShift* = Maximum amount of saturation to be shifted (when using orange). Default: 0.4. - *upperSkinToneColor* = `GPUImageSkinToneUpperColorGreen` or `GPUImageSkinToneUpperColorOrange` - **GPUImageColorInvertFilter**: Inverts the colors of an image - **GPUImageGrayscaleFilter**: Converts an image to grayscale (a slightly faster implementation of the saturation filter, without the ability to vary the color contribution) - **GPUImageMonochromeFilter**: Converts the image to a single-color version, based on the luminance of each pixel - *intensity*: The degree to which the specific color replaces the normal image color (0.0 - 1.0, with 1.0 as the default) - *color*: The color to use as the basis for the effect, with (0.6, 0.45, 0.3, 1.0) as the default. - **GPUImageFalseColorFilter**: Uses the luminance of the image to mix between two user-specified colors - *firstColor*: The first and second colors specify what colors replace the dark and light areas of the image, respectively. The defaults are (0.0, 0.0, 0.5) amd (1.0, 0.0, 0.0). - *secondColor*: - **GPUImageHazeFilter**: Used to add or remove haze (similar to a UV filter) - *distance*: Strength of the color applied. Default 0. Values between -.3 and .3 are best. - *slope*: Amount of color change. Default 0. Values between -.3 and .3 are best. - **GPUImageSepiaFilter**: Simple sepia tone filter - *intensity*: The degree to which the sepia tone replaces the normal image color (0.0 - 1.0, with 1.0 as the default) - **GPUImageOpacityFilter**: Adjusts the alpha channel of the incoming image - *opacity*: The value to multiply the incoming alpha channel for each pixel by (0.0 - 1.0, with 1.0 as the default) - **GPUImageSolidColorGenerator**: This outputs a generated image with a solid color. You need to define the image size using -forceProcessingAtSize: - *color*: The color, in a four component format, that is used to fill the image. - **GPUImageLuminanceThresholdFilter**: Pixels with a luminance above the threshold will appear white, and those below will be black - *threshold*: The luminance threshold, from 0.0 to 1.0, with a default of 0.5 - **GPUImageAdaptiveThresholdFilter**: Determines the local luminance around a pixel, then turns the pixel black if it is below that local luminance and white if above. This can be useful for picking out text under varying lighting conditions. - *blurRadiusInPixels*: A multiplier for the background averaging blur radius in pixels, with a default of 4. - **GPUImageAverageLuminanceThresholdFilter**: This applies a thresholding operation where the threshold is continually adjusted based on the average luminance of the scene. - *thresholdMultiplier*: This is a factor that the average luminance will be multiplied by in order to arrive at the final threshold to use. By default, this is 1.0. - **GPUImageHistogramFilter**: This analyzes the incoming image and creates an output histogram with the frequency at which each color value occurs. The output of this filter is a 3-pixel-high, 256-pixel-wide image with the center (vertical) pixels containing pixels that correspond to the frequency at which various color values occurred. Each color value occupies one of the 256 width positions, from 0 on the left to 255 on the right. This histogram can be generated for individual color channels (kGPUImageHistogramRed, kGPUImageHistogramGreen, kGPUImageHistogramBlue), the luminance of the image (kGPUImageHistogramLuminance), or for all three color channels at once (kGPUImageHistogramRGB). - *downsamplingFactor*: Rather than sampling every pixel, this dictates what fraction of the image is sampled. By default, this is 16 with a minimum of 1. This is needed to keep from saturating the histogram, which can only record 256 pixels for each color value before it becomes overloaded. - **GPUImageHistogramGenerator**: This is a special filter, in that it's primarily intended to work with the GPUImageHistogramFilter. It generates an output representation of the color histograms generated by GPUImageHistogramFilter, but it could be repurposed to display other kinds of values. It takes in an image and looks at the center (vertical) pixels. It then plots the numerical values of the RGB components in separate colored graphs in an output texture. You may need to force a size for this filter in order to make its output visible. - **GPUImageAverageColor**: This processes an input image and determines the average color of the scene, by averaging the RGBA components for each pixel in the image. A reduction process is used to progressively downsample the source image on the GPU, followed by a short averaging calculation on the CPU. The output from this filter is meaningless, but you need to set the colorAverageProcessingFinishedBlock property to a block that takes in four color components and a frame time and does something with them. - **GPUImageLuminosity**: Like the GPUImageAverageColor, this reduces an image to its average luminosity. You need to set the luminosityProcessingFinishedBlock to handle the output of this filter, which just returns a luminosity value and a frame time. - **GPUImageChromaKeyFilter**: For a given color in the image, sets the alpha channel to 0. This is similar to the GPUImageChromaKeyBlendFilter, only instead of blending in a second image for a matching color this doesn't take in a second image and just turns a given color transparent. - *thresholdSensitivity*: How close a color match needs to exist to the target color to be replaced (default of 0.4) - *smoothing*: How smoothly to blend for the color match (default of 0.1) ### Image processing ### - **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 - *ignoreAspectRatio*: By default, the aspect ratio of the transformed image is maintained, but this can be set to YES to make the transformation independent of aspect ratio - **GPUImageCropFilter**: This crops an image to a specific region, then passes only that region on to the next stage in the filter - *cropRegion*: A rectangular area to crop out of the image, normalized to coordinates from 0.0 - 1.0. The (0.0, 0.0) position is in the upper left of the image. - **GPUImageLanczosResamplingFilter**: This lets you up- or downsample an image using Lanczos resampling, which results in noticeably better quality than the standard linear or trilinear interpolation. Simply use -forceProcessingAtSize: to set the target output resolution for the filter, and the image will be resampled for that new size. - **GPUImageSharpenFilter**: Sharpens the image - *sharpness*: The sharpness adjustment to apply (-4.0 - 4.0, with 0.0 as the default) - **GPUImageUnsharpMaskFilter**: Applies an unsharp mask - *blurRadiusInPixels*: The blur radius of the underlying Gaussian blur. The default is 4.0. - *intensity*: The strength of the sharpening, from 0.0 on up, with a default of 1.0 - **GPUImageGaussianBlurFilter**: A hardware-optimized, variable-radius Gaussian blur - *texelSpacingMultiplier*: A multiplier for the spacing between texels, ranging from 0.0 on up, with a default of 1.0. Adjusting this may slightly increase the blur strength, but will introduce artifacts in the result. Highly recommend using other parameters first, before touching this one. - *blurRadiusInPixels*: A radius in pixels to use for the blur, with a default of 2.0. This adjusts the sigma variable in the Gaussian distribution function. - *blurRadiusAsFractionOfImageWidth*: - *blurRadiusAsFractionOfImageHeight*: Setting these properties will allow the blur radius to scale with the size of the image - *blurPasses*: The number of times to sequentially blur the incoming image. The more passes, the slower the filter. - **GPUImageBoxBlurFilter**: A hardware-optimized, variable-radius box blur - *texelSpacingMultiplier*: A multiplier for the spacing between texels, ranging from 0.0 on up, with a default of 1.0. Adjusting this may slightly increase the blur strength, but will introduce artifacts in the result. Highly recommend using other parameters first, before touching this one. - *blurRadiusInPixels*: A radius in pixels to use for the blur, with a default of 2.0. This adjusts the sigma variable in the Gaussian distribution function. - *blurRadiusAsFractionOfImageWidth*: - *blurRadiusAsFractionOfImageHeight*: Setting these properties will allow the blur radius to scale with the size of the image - *blurPasses*: The number of times to sequentially blur the incoming image. The more passes, the slower the filter. - **GPUImageSingleComponentGaussianBlurFilter**: A modification of the GPUImageGaussianBlurFilter that operates only on the red component - *texelSpacingMultiplier*: A multiplier for the spacing between texels, ranging from 0.0 on up, with a default of 1.0. Adjusting this may slightly increase the blur strength, but will introduce artifacts in the result. Highly recommend using other parameters first, before touching this one. - *blurRadiusInPixels*: A radius in pixels to use for the blur, with a default of 2.0. This adjusts the sigma variable in the Gaussian distribution function. - *blurRadiusAsFractionOfImageWidth*: - *blurRadiusAsFractionOfImageHeight*: Setting these properties will allow the blur radius to scale with the size of the image - *blurPasses*: The number of times to sequentially blur the incoming image. The more passes, the slower the filter. - **GPUImageGaussianSelectiveBlurFilter**: A Gaussian blur that preserves focus within a circular region - *blurRadiusInPixels*: A radius in pixels to use for the blur, with a default of 5.0. This adjusts the sigma variable in the Gaussian distribution function. - *excludeCircleRadius*: The radius of the circular area being excluded from the blur - *excludeCirclePoint*: The center of the circular area being excluded from the blur - *excludeBlurSize*: The size of the area between the blurred portion and the clear circle - *aspectRatio*: The aspect ratio of the image, used to adjust the circularity of the in-focus region. By default, this matches the image aspect ratio, but you can override this value. - **GPUImageGaussianBlurPositionFilter**: The inverse of the GPUImageGaussianSelectiveBlurFilter, applying the blur only within a certain circle - *blurSize*: A multiplier for the size of the blur, ranging from 0.0 on up, with a default of 1.0 - *blurCenter*: Center for the blur, defaults to 0.5, 0.5 - *blurRadius*: Radius for the blur, defaults to 1.0 - **GPUImageiOSBlurFilter**: An attempt to replicate the background blur used on iOS 7 in places like the control center. - *blurRadiusInPixels*: A radius in pixels to use for the blur, with a default of 12.0. This adjusts the sigma variable in the Gaussian distribution function. - *saturation*: Saturation ranges from 0.0 (fully desaturated) to 2.0 (max saturation), with 0.8 as the normal level - *downsampling*: The degree to which to downsample, then upsample the incoming image to minimize computations within the Gaussian blur, with a default of 4.0. - **GPUImageMedianFilter**: Takes the median value of the three color components, over a 3x3 area - **GPUImageBilateralFilter**: A bilateral blur, which tries to blur similar color values while preserving sharp edges - *texelSpacingMultiplier*: A multiplier for the spacing between texel reads, ranging from 0.0 on up, with a default of 4.0 - *distanceNormalizationFactor*: A normalization factor for the distance between central color and sample color, with a default of 8.0. - **GPUImageTiltShiftFilter**: A simulated tilt shift lens effect - *blurRadiusInPixels*: The radius of the underlying blur, in pixels. This is 7.0 by default. - *topFocusLevel*: The normalized location of the top of the in-focus area in the image, this value should be lower than bottomFocusLevel, default 0.4 - *bottomFocusLevel*: The normalized location of the bottom of the in-focus area in the image, this value should be higher than topFocusLevel, default 0.6 - *focusFallOffRate*: The rate at which the image gets blurry away from the in-focus region, default 0.2 - **GPUImage3x3ConvolutionFilter**: Runs a 3x3 convolution kernel against the image - *convolutionKernel*: The convolution kernel is a 3x3 matrix of values to apply to the pixel and its 8 surrounding pixels. The matrix is specified in row-major order, with the top left pixel being one.one and the bottom right three.three. If the values in the matrix don't add up to 1.0, the image could be brightened or darkened. - **GPUImageSobelEdgeDetectionFilter**: Sobel edge detection, with edges highlighted in white - *texelWidth*: - *texelHeight*: These parameters affect the visibility of the detected edges - *edgeStrength*: Adjusts the dynamic range of the filter. Higher values lead to stronger edges, but can saturate the intensity colorspace. Default is 1.0. - **GPUImagePrewittEdgeDetectionFilter**: Prewitt edge detection, with edges highlighted in white - *texelWidth*: - *texelHeight*: These parameters affect the visibility of the detected edges - *edgeStrength*: Adjusts the dynamic range of the filter. Higher values lead to stronger edges, but can saturate the intensity colorspace. Default is 1.0. - **GPUImageThresholdEdgeDetectionFilter**: Performs Sobel edge detection, but applies a threshold instead of giving gradual strength values - *texelWidth*: - *texelHeight*: These parameters affect the visibility of the detected edges - *edgeStrength*: Adjusts the dynamic range of the filter. Higher values lead to stronger edges, but can saturate the intensity colorspace. Default is 1.0. - *threshold*: Any edge above this threshold will be black, and anything below white. Ranges from 0.0 to 1.0, with 0.8 as the default - **GPUImageCannyEdgeDetectionFilter**: This uses the full Canny process to highlight one-pixel-wide edges - *texelWidth*: - *texelHeight*: These parameters affect the visibility of the detected edges - *blurRadiusInPixels*: The underlying blur radius for the Gaussian blur. Default is 2.0. - *blurTexelSpacingMultiplier*: The underlying blur texel spacing multiplier. Default is 1.0. - *upperThreshold*: Any edge with a gradient magnitude above this threshold will pass and show up in the final result. Default is 0.4. - *lowerThreshold*: Any edge with a gradient magnitude below this threshold will fail and be removed from the final result. Default is 0.1. - **GPUImageHarrisCornerDetectionFilter**: Runs the Harris corner detection algorithm on an input image, and produces an image with those corner points as white pixels and everything else black. The cornersDetectedBlock can be set, and you will be provided with a list of corners (in normalized 0..1 X, Y coordinates) within that callback for whatever additional operations you want to perform. - *blurRadiusInPixels*: The radius of the underlying Gaussian blur. The default is 2.0. - *sensitivity*: An internal scaling factor applied to adjust the dynamic range of the cornerness maps generated in the filter. The default is 5.0. - *threshold*: The threshold at which a point is detected as a corner. This can vary significantly based on the size, lighting conditions, and iOS device camera type, so it might take a little experimentation to get right for your cases. Default is 0.20. - **GPUImageNobleCornerDetectionFilter**: Runs the Noble variant on the Harris corner detector. It behaves as described above for the Harris detector. - *blurRadiusInPixels*: The radius of the underlying Gaussian blur. The default is 2.0. - *sensitivity*: An internal scaling factor applied to adjust the dynamic range of the cornerness maps generated in the filter. The default is 5.0. - *threshold*: The threshold at which a point is detected as a corner. This can vary significantly based on the size, lighting conditions, and iOS device camera type, so it might take a little experimentation to get right for your cases. Default is 0.2. - **GPUImageShiTomasiCornerDetectionFilter**: Runs the Shi-Tomasi feature detector. It behaves as described above for the Harris detector. - *blurRadiusInPixels*: The radius of the underlying Gaussian blur. The default is 2.0. - *sensitivity*: An internal scaling factor applied to adjust the dynamic range of the cornerness maps generated in the filter. The default is 1.5. - *threshold*: The threshold at which a point is detected as a corner. This can vary significantly based on the size, lighting conditions, and iOS device camera type, so it might take a little experimentation to get right for your cases. Default is 0.2. - **GPUImageNonMaximumSuppressionFilter**: Currently used only as part of the Harris corner detection filter, this will sample a 1-pixel box around each pixel and determine if the center pixel's red channel is the maximum in that area. If it is, it stays. If not, it is set to 0 for all color components. - **GPUImageXYDerivativeFilter**: An internal component within the Harris corner detection filter, this calculates the squared difference between the pixels to the left and right of this one, the squared difference of the pixels above and below this one, and the product of those two differences. - **GPUImageCrosshairGenerator**: This draws a series of crosshairs on an image, most often used for identifying machine vision features. It does not take in a standard image like other filters, but a series of points in its -renderCrosshairsFromArray:count: method, which does the actual drawing. You will need to force this filter to render at the particular output size you need. - *crosshairWidth*: The width, in pixels, of the crosshairs to be drawn onscreen. - **GPUImageDilationFilter**: This performs an image dilation operation, where the maximum intensity of the red channel in a rectangular neighborhood is used for the intensity of this pixel. The radius of the rectangular area to sample over is specified on initialization, with a range of 1-4 pixels. This is intended for use with grayscale images, and it expands bright regions. - **GPUImageRGBDilationFilter**: This is the same as the GPUImageDilationFilter, except that this acts on all color channels, not just the red channel. - **GPUImageErosionFilter**: This performs an image erosion operation, where the minimum intensity of the red channel in a rectangular neighborhood is used for the intensity of this pixel. The radius of the rectangular area to sample over is specified on initialization, with a range of 1-4 pixels. This is intended for use with grayscale images, and it expands dark regions. - **GPUImageRGBErosionFilter**: This is the same as the GPUImageErosionFilter, except that this acts on all color channels, not just the red channel. - **GPUImageOpeningFilter**: This performs an erosion on the red channel of an image, followed by a dilation of the same radius. The radius is set on initialization, with a range of 1-4 pixels. This filters out smaller bright regions. - **GPUImageRGBOpeningFilter**: This is the same as the GPUImageOpeningFilter, except that this acts on all color channels, not just the red channel. - **GPUImageClosingFilter**: This performs a dilation on the red channel of an image, followed by an erosion of the same radius. The radius is set on initialization, with a range of 1-4 pixels. This filters out smaller dark regions. - **GPUImageRGBClosingFilter**: This is the same as the GPUImageClosingFilter, except that this acts on all color channels, not just the red channel. - **GPUImageLocalBinaryPatternFilter**: This performs a comparison of intensity of the red channel of the 8 surrounding pixels and that of the central one, encoding the comparison results in a bit string that becomes this pixel intensity. The least-significant bit is the top-right comparison, going counterclockwise to end at the right comparison as the most significant bit. - **GPUImageLowPassFilter**: This applies a low pass filter to incoming video frames. This basically accumulates a weighted rolling average of previous frames with the current ones as they come in. This can be used to denoise video, add motion blur, or be used to create a high pass filter. - *filterStrength*: This controls the degree by which the previous accumulated frames are blended with the current one. This ranges from 0.0 to 1.0, with a default of 0.5. - **GPUImageHighPassFilter**: This applies a high pass filter to incoming video frames. This is the inverse of the low pass filter, showing the difference between the current frame and the weighted rolling average of previous ones. This is most useful for motion detection. - *filterStrength*: This controls the degree by which the previous accumulated frames are blended and then subtracted from the current one. This ranges from 0.0 to 1.0, with a default of 0.5. - **GPUImageMotionDetector**: This is a motion detector based on a high-pass filter. You set the motionDetectionBlock and on every incoming frame it will give you the centroid of any detected movement in the scene (in normalized X,Y coordinates) as well as an intensity of motion for the scene. - *lowPassFilterStrength*: This controls the strength of the low pass filter used behind the scenes to establish the baseline that incoming frames are compared with. This ranges from 0.0 to 1.0, with a default of 0.5. - **GPUImageHoughTransformLineDetector**: Detects lines in the image using a Hough transform into parallel coordinate space. This approach is based entirely on the PC lines process developed by the Graph@FIT research group at the Brno University of Technology and described in their publications: M. Dubská, J. Havel, and A. Herout. Real-Time Detection of Lines using Parallel Coordinates and OpenGL. Proceedings of SCCG 2011, Bratislava, SK, p. 7 (http://medusa.fit.vutbr.cz/public/data/papers/2011-SCCG-Dubska-Real-Time-Line-Detection-Using-PC-and-OpenGL.pdf) and M. Dubská, J. Havel, and A. Herout. PClines — Line detection using parallel coordinates. 2011 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), p. 1489- 1494 (http://medusa.fit.vutbr.cz/public/data/papers/2011-CVPR-Dubska-PClines.pdf). - *edgeThreshold*: A threshold value for which a point is detected as belonging to an edge for determining lines. Default is 0.9. - *lineDetectionThreshold*: A threshold value for which a local maximum is detected as belonging to a line in parallel coordinate space. Default is 0.20. - *linesDetectedBlock*: This block is called on the detection of lines, usually on every processed frame. A C array containing normalized slopes and intercepts in m, b pairs (y=mx+b) is passed in, along with a count of the number of lines detected and the current timestamp of the video frame. - **GPUImageLineGenerator**: A helper class that generates lines which can overlay the scene. The color of these lines can be adjusted using -setLineColorRed:green:blue: - *lineWidth*: The width of the lines, in pixels, with a default of 1.0. - **GPUImageMotionBlurFilter**: Applies a directional motion blur to an image - *blurSize*: A multiplier for the blur size, ranging from 0.0 on up, with a default of 1.0 - *blurAngle*: The angular direction of the blur, in degrees. 0 degrees by default. - **GPUImageZoomBlurFilter**: Applies a directional motion blur to an image - *blurSize*: A multiplier for the blur size, ranging from 0.0 on up, with a default of 1.0 - *blurCenter*: The normalized center of the blur. (0.5, 0.5) by default ### Blending modes ### - **GPUImageChromaKeyBlendFilter**: Selectively replaces a color in the first image with the second image - *thresholdSensitivity*: How close a color match needs to exist to the target color to be replaced (default of 0.4) - *smoothing*: How smoothly to blend for the color match (default of 0.1) - **GPUImageDissolveBlendFilter**: Applies a dissolve blend of two images - *mix*: The degree with which the second image overrides the first (0.0 - 1.0, with 0.5 as the default) - **GPUImageMultiplyBlendFilter**: Applies a multiply blend of two images - **GPUImageAddBlendFilter**: Applies an additive blend of two images - **GPUImageSubtractBlendFilter**: Applies a subtractive blend of two images - **GPUImageDivideBlendFilter**: Applies a division blend of two images - **GPUImageOverlayBlendFilter**: Applies an overlay blend of two images - **GPUImageDarkenBlendFilter**: Blends two images by taking the minimum value of each color component between the images - **GPUImageLightenBlendFilter**: Blends two images by taking the maximum value of each color component between the images - **GPUImageColorBurnBlendFilter**: Applies a color burn blend of two images - **GPUImageColorDodgeBlendFilter**: Applies a color dodge blend of two images - **GPUImageScreenBlendFilter**: Applies a screen blend of two images - **GPUImageExclusionBlendFilter**: Applies an exclusion blend of two images - **GPUImageDifferenceBlendFilter**: Applies a difference blend of two images - **GPUImageHardLightBlendFilter**: Applies a hard light blend of two images - **GPUImageSoftLightBlendFilter**: Applies a soft light blend of two images - **GPUImageAlphaBlendFilter**: Blends the second image over the first, based on the second's alpha channel - *mix*: The degree with which the second image overrides the first (0.0 - 1.0, with 1.0 as the default) - **GPUImageSourceOverBlendFilter**: Applies a source over blend of two images - **GPUImageColorBurnBlendFilter**: Applies a color burn blend of two images - **GPUImageColorDodgeBlendFilter**: Applies a color dodge blend of two images - **GPUImageNormalBlendFilter**: Applies a normal blend of two images - **GPUImageColorBlendFilter**: Applies a color blend of two images - **GPUImageHueBlendFilter**: Applies a hue blend of two images - **GPUImageSaturationBlendFilter**: Applies a saturation blend of two images - **GPUImageLuminosityBlendFilter**: Applies a luminosity blend of two images - **GPUImageLinearBurnBlendFilter**: Applies a linear burn blend of two images - **GPUImagePoissonBlendFilter**: Applies a Poisson blend of two images - *mix*: Mix ranges from 0.0 (only image 1) to 1.0 (only image 2 gradients), with 1.0 as the normal level - *numIterations*: The number of times to propagate the gradients. Crank this up to 100 or even 1000 if you want to get anywhere near convergence. Yes, this will be slow. - **GPUImageMaskFilter**: Masks one image using another ### Visual effects ### - **GPUImagePixellateFilter**: Applies a pixellation effect on an image or video - *fractionalWidthOfAPixel*: How large the pixels are, as a fraction of the width and height of the image (0.0 - 1.0, default 0.05) - **GPUImagePolarPixellateFilter**: Applies a pixellation effect on an image or video, based on polar coordinates instead of Cartesian ones - *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) - **GPUImagePolkaDotFilter**: Breaks an image up into colored dots within a regular grid - *fractionalWidthOfAPixel*: How large the dots are, as a fraction of the width and height of the image (0.0 - 1.0, default 0.05) - *dotScaling*: What fraction of each grid space is taken up by a dot, from 0.0 to 1.0 with a default of 0.9. - **GPUImageHalftoneFilter**: Applies a halftone effect to an image, like news print - *fractionalWidthOfAPixel*: How large the halftone dots are, as a fraction of the width and height of the image (0.0 - 1.0, default 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. - **GPUImageSketchFilter**: Converts video to look like a sketch. This is just the Sobel edge detection filter with the colors inverted - *texelWidth*: - *texelHeight*: These parameters affect the visibility of the detected edges - *edgeStrength*: Adjusts the dynamic range of the filter. Higher values lead to stronger edges, but can saturate the intensity colorspace. Default is 1.0. - **GPUImageThresholdSketchFilter**: Same as the sketch filter, only the edges are thresholded instead of being grayscale - *texelWidth*: - *texelHeight*: These parameters affect the visibility of the detected edges - *edgeStrength*: Adjusts the dynamic range of the filter. Higher values lead to stronger edges, but can saturate the intensity colorspace. Default is 1.0. - *threshold*: Any edge above this threshold will be black, and anything below white. Ranges from 0.0 to 1.0, with 0.8 as the default - **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. - *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. - *texelWidth*: - *texelHeight*: These parameters affect the visibility of the detected edges - *blurRadiusInPixels*: The radius of the underlying Gaussian blur. The default is 2.0. - *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 - **GPUImageEmbossFilter**: Applies an embossing effect on the image - *intensity*: The strength of the embossing, from 0.0 to 4.0, with 1.0 as the normal level - **GPUImagePosterizeFilter**: This reduces the color dynamic range into the number of steps specified, leading to a cartoon-like simple shading of the image. - *colorLevels*: The number of color levels to reduce the image space to. This ranges from 1 to 256, with a default of 10. - **GPUImageSwirlFilter**: Creates a swirl distortion on the image - *radius*: The radius from the center to apply the distortion, with a default of 0.5 - *center*: The center of the image (in normalized coordinates from 0 - 1.0) about which to twist, with a default of (0.5, 0.5) - *angle*: The amount of twist to apply to the image, with a default of 1.0 - **GPUImageBulgeDistortionFilter**: Creates a bulge distortion on the image - *radius*: The radius from the center to apply the distortion, with a default of 0.25 - *center*: The center of the image (in normalized coordinates from 0 - 1.0) about which to distort, with a default of (0.5, 0.5) - *scale*: The amount of distortion to apply, from -1.0 to 1.0, with a default of 0.5 - **GPUImagePinchDistortionFilter**: Creates a pinch distortion of the image - *radius*: The radius from the center to apply the distortion, with a default of 1.0 - *center*: The center of the image (in normalized coordinates from 0 - 1.0) about which to distort, with a default of (0.5, 0.5) - *scale*: The amount of distortion to apply, from -2.0 to 2.0, with a default of 1.0 - **GPUImageStretchDistortionFilter**: Creates a stretch distortion of the image - *center*: The center of the image (in normalized coordinates from 0 - 1.0) about which to distort, with a default of (0.5, 0.5) - **GPUImageSphereRefractionFilter**: Simulates the refraction through a glass sphere - *center*: The center about which to apply the distortion, with a default of (0.5, 0.5) - *radius*: The radius of the distortion, ranging from 0.0 to 1.0, with a default of 0.25 - *refractiveIndex*: The index of refraction for the sphere, with a default of 0.71 - **GPUImageGlassSphereFilter**: Same as the GPUImageSphereRefractionFilter, only the image is not inverted and there's a little bit of frosting at the edges of the glass - *center*: The center about which to apply the distortion, with a default of (0.5, 0.5) - *radius*: The radius of the distortion, ranging from 0.0 to 1.0, with a default of 0.25 - *refractiveIndex*: The index of refraction for the sphere, with a default of 0.71 - **GPUImageVignetteFilter**: Performs a vignetting effect, fading out the image at the edges - *vignetteCenter*: The center for the vignette in tex coords (CGPoint), with a default of 0.5, 0.5 - *vignetteColor*: The color to use for the vignette (GPUVector3), with a default of black - *vignetteStart*: The normalized distance from the center where the vignette effect starts, with a default of 0.5 - *vignetteEnd*: The normalized distance from the center where the vignette effect ends, with a default of 0.75 - **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. - **GPUImageKuwaharaRadius3Filter**: A modified version of the Kuwahara filter, optimized to work over just a radius of three pixels - **GPUImagePerlinNoiseFilter**: Generates an image full of Perlin noise - *colorStart*: - *colorFinish*: The color range for the noise being generated - *scale*: The scaling of the noise being generated - **GPUImageCGAColorspaceFilter**: Simulates the colorspace of a CGA monitor - **GPUImageMosaicFilter**: This filter takes an input tileset, the tiles must ascend in luminance. It looks at the input image and replaces each display tile with an input tile according to the luminance of that tile. The idea was to replicate the ASCII video filters seen in other apps, but the tileset can be anything. - *inputTileSize*: - *numTiles*: - *displayTileSize*: - *colorOn*: - **GPUImageJFAVoronoiFilter**: Generates a Voronoi map, for use in a later stage. - *sizeInPixels*: Size of the individual elements - **GPUImageVoronoiConsumerFilter**: Takes in the Voronoi map, and uses that to filter an incoming image. - *sizeInPixels*: Size of the individual elements You can also easily write your own custom filters using the C-like OpenGL Shading Language, as described above. ## Sample applications ## Several sample applications are bundled with the framework source. Most are compatible with both iPhone and iPad-class devices. They attempt to show off various aspects of the framework and should be used as the best examples of the API while the framework is under development. These include: ### SimpleImageFilter ### A bundled JPEG image is loaded into the application at launch, a filter is applied to it, and the result rendered to the screen. Additionally, this sample shows two ways of taking in an image, filtering it, and saving it to disk. ### SimpleVideoFilter ### 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. ### FilterShowcase ### This demonstrates every filter supplied with GPUImage. ### BenchmarkSuite ### This is used to test the performance of the overall framework by testing it against CPU-bound routines and Core Image. Benchmarks involving still images and video are run against all three, with results displayed in-application. ### CubeExample ### This demonstrates the ability of GPUImage to interact with OpenGL ES rendering. Frames are captured from the camera, a sepia filter applied to them, and then they are fed into a texture to be applied to the face of a cube you can rotate with your finger. This cube in turn is rendered to a texture-backed framebuffer object, and that texture is fed back into GPUImage to have a pixellation filter applied to it before rendering to screen. In other words, the path of this application is camera -> sepia tone filter -> cube -> pixellation filter -> display. ### ColorObjectTracking ### 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. ================================================ FILE: build.sh ================================================ #!/bin/bash set -e IOSSDK_VER="9.0" # xcodebuild -showsdks cd framework xcodebuild -project GPUImage.xcodeproj -target GPUImage -configuration Release -sdk iphoneos${IOSSDK_VER} build xcodebuild -project GPUImage.xcodeproj -target GPUImage -configuration Release -sdk iphonesimulator${IOSSDK_VER} build cd .. cd build # for the fat lib file mkdir -p Release-iphone/lib xcrun -sdk iphoneos lipo -create Release-iphoneos/libGPUImage.a Release-iphonesimulator/libGPUImage.a -output Release-iphone/lib/libGPUImage.a xcrun -sdk iphoneos lipo -info Release-iphone/lib/libGPUImage.a # for header files mkdir -p Release-iphone/include cp ../framework/Source/*.h Release-iphone/include cp ../framework/Source/iOS/*.h Release-iphone/include # Build static framework mkdir -p GPUImage.framework/Versions/A cp Release-iphone/lib/libGPUImage.a GPUImage.framework/Versions/A/GPUImage mkdir -p GPUImage.framework/Versions/A/Headers cp Release-iphone/include/*.h GPUImage.framework/Versions/A/Headers ln -sfh A GPUImage.framework/Versions/Current ln -sfh Versions/Current/GPUImage GPUImage.framework/GPUImage ln -sfh Versions/Current/Headers GPUImage.framework/Headers ================================================ FILE: examples/Mac/FilterShowcase/FilterShowcase/FilterShowcase-Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIconFile CFBundleIdentifier com.sunsetlakesoftware.${PRODUCT_NAME:rfc1034identifier} CFBundleInfoDictionaryVersion 6.0 CFBundleName ${PRODUCT_NAME} CFBundlePackageType APPL CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion 1 LSMinimumSystemVersion ${MACOSX_DEPLOYMENT_TARGET} NSHumanReadableCopyright Copyright © 2013 Sunset Lake Software LLC. All rights reserved. NSMainNibFile MainMenu NSPrincipalClass NSApplication ================================================ FILE: examples/Mac/FilterShowcase/FilterShowcase/FilterShowcase-Prefix.pch ================================================ // // Prefix header for all source files of the 'FilterShowcase' target in the 'FilterShowcase' project // #ifdef __OBJC__ #import #endif ================================================ FILE: examples/Mac/FilterShowcase/FilterShowcase/SLSAppDelegate.h ================================================ #import #import "SLSFilterShowcaseWindowController.h" @interface SLSAppDelegate : NSObject { SLSFilterShowcaseWindowController *windowController; } @end ================================================ FILE: examples/Mac/FilterShowcase/FilterShowcase/SLSAppDelegate.m ================================================ #import "SLSAppDelegate.h" @implementation SLSAppDelegate - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { // Insert code here to initialize your application windowController = [[SLSFilterShowcaseWindowController alloc] initWithWindowNibName:@"SLSFilterShowcaseWindowController"]; [windowController showWindow:self]; } @end ================================================ FILE: examples/Mac/FilterShowcase/FilterShowcase/en.lproj/Credits.rtf ================================================ {\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;} {\colortbl;\red255\green255\blue255;} \paperw9840\paperh8400 \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural \f0\b\fs24 \cf0 Engineering: \b0 \ Some people\ \ \b Human Interface Design: \b0 \ Some other people\ \ \b Testing: \b0 \ Hopefully not nobody\ \ \b Documentation: \b0 \ Whoever\ \ \b With special thanks to: \b0 \ Mom\ } ================================================ FILE: examples/Mac/FilterShowcase/FilterShowcase/en.lproj/InfoPlist.strings ================================================ /* Localized versions of Info.plist keys */ ================================================ FILE: examples/Mac/FilterShowcase/FilterShowcase/en.lproj/MainMenu.xib ================================================ 1080 12D78 3084 1187.37 626.00 com.apple.InterfaceBuilder.CocoaPlugin 3084 NSCustomObject NSMenu NSMenuItem com.apple.InterfaceBuilder.CocoaPlugin PluginDependencyRecalculationVersion NSApplication FirstResponder NSApplication AMainMenu FilterShowcase 1048576 2147483647 NSImage NSMenuCheckmark NSImage NSMenuMixedState submenuAction: FilterShowcase About FilterShowcase 2147483647 YES YES 1048576 2147483647 Preferences… , 1048576 2147483647 YES YES 1048576 2147483647 Services 1048576 2147483647 submenuAction: Services _NSServicesMenu YES YES 1048576 2147483647 Hide FilterShowcase h 1048576 2147483647 Hide Others h 1572864 2147483647 Show All 1048576 2147483647 YES YES 1048576 2147483647 Quit FilterShowcase q 1048576 2147483647 _NSAppleMenu File 1048576 2147483647 submenuAction: File New n 1048576 2147483647 Open… o 1048576 2147483647 Open Recent 1048576 2147483647 submenuAction: Open Recent Clear Menu 1048576 2147483647 _NSRecentDocumentsMenu YES YES 1048576 2147483647 Close w 1048576 2147483647 Save… s 1048576 2147483647 Revert to Saved 2147483647 YES YES 1048576 2147483647 Page Setup... P 1179648 2147483647 Print… p 1048576 2147483647 Edit 1048576 2147483647 submenuAction: Edit Undo z 1048576 2147483647 Redo Z 1179648 2147483647 YES YES 1048576 2147483647 Cut x 1048576 2147483647 Copy c 1048576 2147483647 Paste v 1048576 2147483647 Paste and Match Style V 1572864 2147483647 Delete 1048576 2147483647 Select All a 1048576 2147483647 YES YES 1048576 2147483647 Find 1048576 2147483647 submenuAction: Find Find… f 1048576 2147483647 1 Find and Replace… f 1572864 2147483647 12 Find Next g 1048576 2147483647 2 Find Previous G 1179648 2147483647 3 Use Selection for Find e 1048576 2147483647 7 Jump to Selection j 1048576 2147483647 Spelling and Grammar 1048576 2147483647 submenuAction: Spelling and Grammar Show Spelling and Grammar : 1048576 2147483647 Check Document Now ; 1048576 2147483647 YES YES 2147483647 Check Spelling While Typing 1048576 2147483647 Check Grammar With Spelling 1048576 2147483647 Correct Spelling Automatically 2147483647 Substitutions 1048576 2147483647 submenuAction: Substitutions Show Substitutions 2147483647 YES YES 2147483647 Smart Copy/Paste f 1048576 2147483647 1 Smart Quotes g 1048576 2147483647 2 Smart Dashes 2147483647 Smart Links G 1179648 2147483647 3 Text Replacement 2147483647 Transformations 2147483647 submenuAction: Transformations Make Upper Case 2147483647 Make Lower Case 2147483647 Capitalize 2147483647 Speech 1048576 2147483647 submenuAction: Speech Start Speaking 1048576 2147483647 Stop Speaking 1048576 2147483647 Format 2147483647 submenuAction: Format Font 2147483647 submenuAction: Font Show Fonts t 1048576 2147483647 Bold b 1048576 2147483647 2 Italic i 1048576 2147483647 1 Underline u 1048576 2147483647 YES YES 2147483647 Bigger + 1048576 2147483647 3 Smaller - 1048576 2147483647 4 YES YES 2147483647 Kern 2147483647 submenuAction: Kern Use Default 2147483647 Use None 2147483647 Tighten 2147483647 Loosen 2147483647 Ligatures 2147483647 submenuAction: Ligatures Use Default 2147483647 Use None 2147483647 Use All 2147483647 Baseline 2147483647 submenuAction: Baseline Use Default 2147483647 Superscript 2147483647 Subscript 2147483647 Raise 2147483647 Lower 2147483647 YES YES 2147483647 Show Colors C 1048576 2147483647 YES YES 2147483647 Copy Style c 1572864 2147483647 Paste Style v 1572864 2147483647 _NSFontMenu Text 2147483647 submenuAction: Text Align Left { 1048576 2147483647 Center | 1048576 2147483647 Justify 2147483647 Align Right } 1048576 2147483647 YES YES 2147483647 Writing Direction 2147483647 submenuAction: Writing Direction YES Paragraph 2147483647 CURlZmF1bHQ 2147483647 CUxlZnQgdG8gUmlnaHQ 2147483647 CVJpZ2h0IHRvIExlZnQ 2147483647 YES YES 2147483647 YES Selection 2147483647 CURlZmF1bHQ 2147483647 CUxlZnQgdG8gUmlnaHQ 2147483647 CVJpZ2h0IHRvIExlZnQ 2147483647 YES YES 2147483647 Show Ruler 2147483647 Copy Ruler c 1310720 2147483647 Paste Ruler v 1310720 2147483647 View 1048576 2147483647 submenuAction: View Show Toolbar t 1572864 2147483647 Customize Toolbar… 1048576 2147483647 Window 1048576 2147483647 submenuAction: Window Minimize m 1048576 2147483647 Zoom 1048576 2147483647 YES YES 1048576 2147483647 Bring All to Front 1048576 2147483647 _NSWindowsMenu Help 2147483647 submenuAction: Help FilterShowcase Help ? 1048576 2147483647 _NSHelpMenu _NSMainMenu SLSAppDelegate NSFontManager terminate: 449 orderFrontStandardAboutPanel: 142 delegate 495 performMiniaturize: 37 arrangeInFront: 39 print: 86 runPageLayout: 87 clearRecentDocuments: 127 performClose: 193 toggleContinuousSpellChecking: 222 undo: 223 copy: 224 checkSpelling: 225 paste: 226 stopSpeaking: 227 cut: 228 showGuessPanel: 230 redo: 231 selectAll: 232 startSpeaking: 233 delete: 235 performZoom: 240 performFindPanelAction: 241 centerSelectionInVisibleArea: 245 toggleGrammarChecking: 347 toggleSmartInsertDelete: 355 toggleAutomaticQuoteSubstitution: 356 toggleAutomaticLinkDetection: 357 saveDocument: 362 revertDocumentToSaved: 364 runToolbarCustomizationPalette: 365 toggleToolbarShown: 366 hide: 367 hideOtherApplications: 368 unhideAllApplications: 370 newDocument: 373 openDocument: 374 raiseBaseline: 426 lowerBaseline: 427 copyFont: 428 subscript: 429 superscript: 430 tightenKerning: 431 underline: 432 orderFrontColorPanel: 433 useAllLigatures: 434 loosenKerning: 435 pasteFont: 436 unscript: 437 useStandardKerning: 438 useStandardLigatures: 439 turnOffLigatures: 440 turnOffKerning: 441 toggleAutomaticSpellingCorrection: 456 orderFrontSubstitutionsPanel: 458 toggleAutomaticDashSubstitution: 461 toggleAutomaticTextReplacement: 463 uppercaseWord: 464 capitalizeWord: 467 lowercaseWord: 468 pasteAsPlainText: 486 performFindPanelAction: 487 performFindPanelAction: 488 performFindPanelAction: 489 showHelp: 493 alignCenter: 518 pasteRuler: 519 toggleRuler: 520 alignRight: 521 copyRuler: 522 alignJustified: 523 alignLeft: 524 makeBaseWritingDirectionNatural: 525 makeBaseWritingDirectionLeftToRight: 526 makeBaseWritingDirectionRightToLeft: 527 makeTextWritingDirectionNatural: 528 makeTextWritingDirectionLeftToRight: 529 makeTextWritingDirectionRightToLeft: 530 performFindPanelAction: 535 addFontTrait: 421 addFontTrait: 422 modifyFont: 423 orderFrontFontPanel: 424 modifyFont: 425 0 -2 File's Owner -1 First Responder -3 Application 29 19 56 217 83 81 75 78 72 82 124 77 73 79 112 74 125 126 205 202 198 207 214 199 203 197 206 215 218 216 200 219 201 204 220 213 210 221 208 209 57 58 134 150 136 144 129 143 236 131 149 145 130 24 92 5 239 23 295 296 297 298 211 212 195 196 346 348 349 350 351 354 375 376 377 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 450 451 452 453 454 457 459 460 462 465 466 485 490 491 492 494 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 534 com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin 535 SLSAppDelegate NSObject IBProjectSource ./Classes/SLSAppDelegate.h 0 IBCocoaFramework YES 3 {11, 11} {10, 3} YES ================================================ FILE: examples/Mac/FilterShowcase/FilterShowcase/main.m ================================================ #import int main(int argc, char *argv[]) { return NSApplicationMain(argc, (const char **)argv); } ================================================ FILE: examples/Mac/FilterShowcase/FilterShowcase.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ BC78B702172DCC7F00342C6A /* lookup_amatorka.png in Resources */ = {isa = PBXBuildFile; fileRef = BC78B6FE172DCC7F00342C6A /* lookup_amatorka.png */; }; BC78B703172DCC7F00342C6A /* lookup_miss_etikate.png in Resources */ = {isa = PBXBuildFile; fileRef = BC78B6FF172DCC7F00342C6A /* lookup_miss_etikate.png */; }; BC78B704172DCC7F00342C6A /* lookup_soft_elegance_1.png in Resources */ = {isa = PBXBuildFile; fileRef = BC78B700172DCC7F00342C6A /* lookup_soft_elegance_1.png */; }; BC78B705172DCC7F00342C6A /* lookup_soft_elegance_2.png in Resources */ = {isa = PBXBuildFile; fileRef = BC78B701172DCC7F00342C6A /* lookup_soft_elegance_2.png */; }; BCA20BCD17471F5C0097C84A /* squares.png in Resources */ = {isa = PBXBuildFile; fileRef = BCA20BCB17471F5C0097C84A /* squares.png */; }; BCA20BCE17471F5C0097C84A /* voroni_points2.png in Resources */ = {isa = PBXBuildFile; fileRef = BCA20BCC17471F5C0097C84A /* voroni_points2.png */; }; BCB00A4C172B17F400DB804C /* GPUImage.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = BCF8678F17263F3500912E34 /* GPUImage.framework */; }; BCF8676E17263EAC00912E34 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCF8676D17263EAC00912E34 /* Cocoa.framework */; }; BCF8677817263EAC00912E34 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = BCF8677617263EAC00912E34 /* InfoPlist.strings */; }; BCF8677A17263EAC00912E34 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF8677917263EAC00912E34 /* main.m */; }; BCF8677E17263EAC00912E34 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = BCF8677C17263EAC00912E34 /* Credits.rtf */; }; BCF8678117263EAD00912E34 /* SLSAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF8678017263EAD00912E34 /* SLSAppDelegate.m */; }; BCF8678417263EAD00912E34 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = BCF8678217263EAD00912E34 /* MainMenu.xib */; }; BCF8679617263FCF00912E34 /* SLSFilterShowcaseWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF8679417263FCF00912E34 /* SLSFilterShowcaseWindowController.m */; }; BCF8679717263FCF00912E34 /* SLSFilterShowcaseWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = BCF8679517263FCF00912E34 /* SLSFilterShowcaseWindowController.xib */; }; BCF8679A1726410E00912E34 /* GPUImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCF8678F17263F3500912E34 /* GPUImage.framework */; }; BCF867A1172762B500912E34 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCF867A0172762B500912E34 /* AVFoundation.framework */; }; BCF8680B17284D6A00912E34 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCF8680A17284D6A00912E34 /* QuartzCore.framework */; }; BCF868881728790500912E34 /* Lambeau.jpg in Resources */ = {isa = PBXBuildFile; fileRef = BCF868871728790500912E34 /* Lambeau.jpg */; }; BCF8688A1728791300912E34 /* mask.png in Resources */ = {isa = PBXBuildFile; fileRef = BCF868891728791300912E34 /* mask.png */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ BCF8678E17263F3500912E34 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BCF8678A17263F3400912E34 /* GPUImageMac.xcodeproj */; proxyType = 2; remoteGlobalIDString = BCA3F31C17239B6500E28AEC; remoteInfo = GPUImage; }; BCF867981726410300912E34 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BCF8678A17263F3400912E34 /* GPUImageMac.xcodeproj */; proxyType = 1; remoteGlobalIDString = BCA3F31B17239B6500E28AEC; remoteInfo = GPUImage; }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ BCB00A4B172B17E900DB804C /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( BCB00A4C172B17F400DB804C /* GPUImage.framework in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ BC78B6FE172DCC7F00342C6A /* lookup_amatorka.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = lookup_amatorka.png; path = ../../../../framework/Resources/lookup_amatorka.png; sourceTree = ""; }; BC78B6FF172DCC7F00342C6A /* lookup_miss_etikate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = lookup_miss_etikate.png; path = ../../../../framework/Resources/lookup_miss_etikate.png; sourceTree = ""; }; BC78B700172DCC7F00342C6A /* lookup_soft_elegance_1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = lookup_soft_elegance_1.png; path = ../../../../framework/Resources/lookup_soft_elegance_1.png; sourceTree = ""; }; BC78B701172DCC7F00342C6A /* lookup_soft_elegance_2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = lookup_soft_elegance_2.png; path = ../../../../framework/Resources/lookup_soft_elegance_2.png; sourceTree = ""; }; BCA20BCB17471F5C0097C84A /* squares.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = squares.png; path = ../../../iOS/FilterShowcase/FilterShowcase/squares.png; sourceTree = ""; }; BCA20BCC17471F5C0097C84A /* voroni_points2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = voroni_points2.png; path = ../../../iOS/FilterShowcase/FilterShowcase/voroni_points2.png; sourceTree = ""; }; BCF8676A17263EAC00912E34 /* FilterShowcase.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FilterShowcase.app; sourceTree = BUILT_PRODUCTS_DIR; }; BCF8676D17263EAC00912E34 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; BCF8677017263EAC00912E34 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; BCF8677117263EAC00912E34 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; BCF8677217263EAC00912E34 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; BCF8677517263EAC00912E34 /* FilterShowcase-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "FilterShowcase-Info.plist"; sourceTree = ""; }; BCF8677717263EAC00912E34 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; BCF8677917263EAC00912E34 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; BCF8677B17263EAC00912E34 /* FilterShowcase-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "FilterShowcase-Prefix.pch"; sourceTree = ""; }; BCF8677D17263EAC00912E34 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/Credits.rtf; sourceTree = ""; }; BCF8677F17263EAC00912E34 /* SLSAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SLSAppDelegate.h; sourceTree = ""; }; BCF8678017263EAD00912E34 /* SLSAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SLSAppDelegate.m; sourceTree = ""; }; BCF8678317263EAD00912E34 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = ""; }; BCF8678A17263F3400912E34 /* GPUImageMac.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = GPUImageMac.xcodeproj; path = ../../../framework/GPUImageMac.xcodeproj; sourceTree = ""; }; BCF8679317263FCF00912E34 /* SLSFilterShowcaseWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SLSFilterShowcaseWindowController.h; path = ../SLSFilterShowcaseWindowController.h; sourceTree = ""; }; BCF8679417263FCF00912E34 /* SLSFilterShowcaseWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SLSFilterShowcaseWindowController.m; path = ../SLSFilterShowcaseWindowController.m; sourceTree = ""; }; BCF8679517263FCF00912E34 /* SLSFilterShowcaseWindowController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = SLSFilterShowcaseWindowController.xib; path = ../SLSFilterShowcaseWindowController.xib; sourceTree = ""; }; BCF867A0172762B500912E34 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; BCF8680A17284D6A00912E34 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; BCF868871728790500912E34 /* Lambeau.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; name = Lambeau.jpg; path = ../../../iOS/SimpleImageFilter/SimpleImageFilter/Lambeau.jpg; sourceTree = ""; }; BCF868891728791300912E34 /* mask.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = mask.png; path = ../../../iOS/FilterShowcase/FilterShowcase/mask.png; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ BCF8676717263EAC00912E34 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( BCF8680B17284D6A00912E34 /* QuartzCore.framework in Frameworks */, BCF867A1172762B500912E34 /* AVFoundation.framework in Frameworks */, BCF8679A1726410E00912E34 /* GPUImage.framework in Frameworks */, BCF8676E17263EAC00912E34 /* Cocoa.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ BCF8676117263EAC00912E34 = { isa = PBXGroup; children = ( BCF8677317263EAC00912E34 /* FilterShowcase */, BCF8676C17263EAC00912E34 /* Frameworks */, BCF8676B17263EAC00912E34 /* Products */, ); sourceTree = ""; }; BCF8676B17263EAC00912E34 /* Products */ = { isa = PBXGroup; children = ( BCF8676A17263EAC00912E34 /* FilterShowcase.app */, ); name = Products; sourceTree = ""; }; BCF8676C17263EAC00912E34 /* Frameworks */ = { isa = PBXGroup; children = ( BCF8678A17263F3400912E34 /* GPUImageMac.xcodeproj */, BCF8676D17263EAC00912E34 /* Cocoa.framework */, BCF8680A17284D6A00912E34 /* QuartzCore.framework */, BCF867A0172762B500912E34 /* AVFoundation.framework */, BCF8676F17263EAC00912E34 /* Other Frameworks */, ); name = Frameworks; sourceTree = ""; }; BCF8676F17263EAC00912E34 /* Other Frameworks */ = { isa = PBXGroup; children = ( BCF8677017263EAC00912E34 /* AppKit.framework */, BCF8677117263EAC00912E34 /* CoreData.framework */, BCF8677217263EAC00912E34 /* Foundation.framework */, ); name = "Other Frameworks"; sourceTree = ""; }; BCF8677317263EAC00912E34 /* FilterShowcase */ = { isa = PBXGroup; children = ( BCF8677F17263EAC00912E34 /* SLSAppDelegate.h */, BCF8678017263EAD00912E34 /* SLSAppDelegate.m */, BCF8678217263EAD00912E34 /* MainMenu.xib */, BCF8679317263FCF00912E34 /* SLSFilterShowcaseWindowController.h */, BCF8679417263FCF00912E34 /* SLSFilterShowcaseWindowController.m */, BCF8679517263FCF00912E34 /* SLSFilterShowcaseWindowController.xib */, BCF8677417263EAC00912E34 /* Supporting Files */, ); path = FilterShowcase; sourceTree = ""; }; BCF8677417263EAC00912E34 /* Supporting Files */ = { isa = PBXGroup; children = ( BCA20BCB17471F5C0097C84A /* squares.png */, BCA20BCC17471F5C0097C84A /* voroni_points2.png */, BC78B6FE172DCC7F00342C6A /* lookup_amatorka.png */, BC78B6FF172DCC7F00342C6A /* lookup_miss_etikate.png */, BC78B700172DCC7F00342C6A /* lookup_soft_elegance_1.png */, BC78B701172DCC7F00342C6A /* lookup_soft_elegance_2.png */, BCF868891728791300912E34 /* mask.png */, BCF868871728790500912E34 /* Lambeau.jpg */, BCF8677517263EAC00912E34 /* FilterShowcase-Info.plist */, BCF8677617263EAC00912E34 /* InfoPlist.strings */, BCF8677917263EAC00912E34 /* main.m */, BCF8677B17263EAC00912E34 /* FilterShowcase-Prefix.pch */, BCF8677C17263EAC00912E34 /* Credits.rtf */, ); name = "Supporting Files"; sourceTree = ""; }; BCF8678B17263F3400912E34 /* Products */ = { isa = PBXGroup; children = ( BCF8678F17263F3500912E34 /* GPUImage.framework */, ); name = Products; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ BCF8676917263EAC00912E34 /* FilterShowcase */ = { isa = PBXNativeTarget; buildConfigurationList = BCF8678717263EAD00912E34 /* Build configuration list for PBXNativeTarget "FilterShowcase" */; buildPhases = ( BCF8676617263EAC00912E34 /* Sources */, BCB00A4B172B17E900DB804C /* CopyFiles */, BCF8676717263EAC00912E34 /* Frameworks */, BCF8676817263EAC00912E34 /* Resources */, ); buildRules = ( ); dependencies = ( BCF867991726410300912E34 /* PBXTargetDependency */, ); name = FilterShowcase; productName = FilterShowcase; productReference = BCF8676A17263EAC00912E34 /* FilterShowcase.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ BCF8676217263EAC00912E34 /* Project object */ = { isa = PBXProject; attributes = { CLASSPREFIX = SLS; LastUpgradeCheck = 0500; ORGANIZATIONNAME = "Sunset Lake Software LLC"; }; buildConfigurationList = BCF8676517263EAC00912E34 /* Build configuration list for PBXProject "FilterShowcase" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, ); mainGroup = BCF8676117263EAC00912E34; productRefGroup = BCF8676B17263EAC00912E34 /* Products */; projectDirPath = ""; projectReferences = ( { ProductGroup = BCF8678B17263F3400912E34 /* Products */; ProjectRef = BCF8678A17263F3400912E34 /* GPUImageMac.xcodeproj */; }, ); projectRoot = ""; targets = ( BCF8676917263EAC00912E34 /* FilterShowcase */, ); }; /* End PBXProject section */ /* Begin PBXReferenceProxy section */ BCF8678F17263F3500912E34 /* GPUImage.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; path = GPUImage.framework; remoteRef = BCF8678E17263F3500912E34 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ BCF8676817263EAC00912E34 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( BCF8677817263EAC00912E34 /* InfoPlist.strings in Resources */, BCF8677E17263EAC00912E34 /* Credits.rtf in Resources */, BCF8678417263EAD00912E34 /* MainMenu.xib in Resources */, BCF8679717263FCF00912E34 /* SLSFilterShowcaseWindowController.xib in Resources */, BCF868881728790500912E34 /* Lambeau.jpg in Resources */, BCF8688A1728791300912E34 /* mask.png in Resources */, BC78B702172DCC7F00342C6A /* lookup_amatorka.png in Resources */, BC78B703172DCC7F00342C6A /* lookup_miss_etikate.png in Resources */, BC78B704172DCC7F00342C6A /* lookup_soft_elegance_1.png in Resources */, BC78B705172DCC7F00342C6A /* lookup_soft_elegance_2.png in Resources */, BCA20BCD17471F5C0097C84A /* squares.png in Resources */, BCA20BCE17471F5C0097C84A /* voroni_points2.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ BCF8676617263EAC00912E34 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( BCF8677A17263EAC00912E34 /* main.m in Sources */, BCF8678117263EAD00912E34 /* SLSAppDelegate.m in Sources */, BCF8679617263FCF00912E34 /* SLSFilterShowcaseWindowController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ BCF867991726410300912E34 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = GPUImage; targetProxy = BCF867981726410300912E34 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ BCF8677617263EAC00912E34 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( BCF8677717263EAC00912E34 /* en */, ); name = InfoPlist.strings; sourceTree = ""; }; BCF8677C17263EAC00912E34 /* Credits.rtf */ = { isa = PBXVariantGroup; children = ( BCF8677D17263EAC00912E34 /* en */, ); name = Credits.rtf; sourceTree = ""; }; BCF8678217263EAD00912E34 /* MainMenu.xib */ = { isa = PBXVariantGroup; children = ( BCF8678317263EAD00912E34 /* en */, ); name = MainMenu.xib; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ BCF8678517263EAD00912E34 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.8; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; }; name = Debug; }; BCF8678617263EAD00912E34 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.8; SDKROOT = macosx; }; name = Release; }; BCF8678817263EAD00912E34 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { COMBINE_HIDPI_IMAGES = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "FilterShowcase/FilterShowcase-Prefix.pch"; INFOPLIST_FILE = "FilterShowcase/FilterShowcase-Info.plist"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; name = Debug; }; BCF8678917263EAD00912E34 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { COMBINE_HIDPI_IMAGES = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "FilterShowcase/FilterShowcase-Prefix.pch"; INFOPLIST_FILE = "FilterShowcase/FilterShowcase-Info.plist"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ BCF8676517263EAC00912E34 /* Build configuration list for PBXProject "FilterShowcase" */ = { isa = XCConfigurationList; buildConfigurations = ( BCF8678517263EAD00912E34 /* Debug */, BCF8678617263EAD00912E34 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; BCF8678717263EAD00912E34 /* Build configuration list for PBXNativeTarget "FilterShowcase" */ = { isa = XCConfigurationList; buildConfigurations = ( BCF8678817263EAD00912E34 /* Debug */, BCF8678917263EAD00912E34 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = BCF8676217263EAC00912E34 /* Project object */; } ================================================ FILE: examples/Mac/FilterShowcase/FilterShowcase.xcodeproj/xcshareddata/xcschemes/FilterShowcase.xcscheme ================================================ ================================================ FILE: examples/Mac/FilterShowcase/SLSFilterShowcaseWindowController.h ================================================ #import #import typedef enum { GPUIMAGE_SATURATION, GPUIMAGE_CONTRAST, GPUIMAGE_BRIGHTNESS, GPUIMAGE_LEVELS, GPUIMAGE_EXPOSURE, GPUIMAGE_RGB, GPUIMAGE_HUE, GPUIMAGE_WHITEBALANCE, GPUIMAGE_MONOCHROME, GPUIMAGE_FALSECOLOR, GPUIMAGE_SHARPEN, GPUIMAGE_UNSHARPMASK, GPUIMAGE_TRANSFORM, GPUIMAGE_TRANSFORM3D, GPUIMAGE_CROP, GPUIMAGE_MASK, GPUIMAGE_GAMMA, GPUIMAGE_TONECURVE, GPUIMAGE_HIGHLIGHTSHADOW, GPUIMAGE_HAZE, GPUIMAGE_SEPIA, GPUIMAGE_AMATORKA, GPUIMAGE_MISSETIKATE, GPUIMAGE_SOFTELEGANCE, GPUIMAGE_COLORINVERT, GPUIMAGE_GRAYSCALE, GPUIMAGE_HISTOGRAM, GPUIMAGE_AVERAGECOLOR, GPUIMAGE_LUMINOSITY, GPUIMAGE_THRESHOLD, GPUIMAGE_ADAPTIVETHRESHOLD, GPUIMAGE_AVERAGELUMINANCETHRESHOLD, GPUIMAGE_PIXELLATE, GPUIMAGE_POLARPIXELLATE, GPUIMAGE_PIXELLATE_POSITION, GPUIMAGE_POLKADOT, GPUIMAGE_HALFTONE, GPUIMAGE_CROSSHATCH, GPUIMAGE_SOBELEDGEDETECTION, GPUIMAGE_PREWITTEDGEDETECTION, GPUIMAGE_CANNYEDGEDETECTION, GPUIMAGE_THRESHOLDEDGEDETECTION, GPUIMAGE_XYGRADIENT, GPUIMAGE_HARRISCORNERDETECTION, GPUIMAGE_NOBLECORNERDETECTION, GPUIMAGE_SHITOMASIFEATUREDETECTION, GPUIMAGE_HOUGHTRANSFORMLINEDETECTOR, GPUIMAGE_BUFFER, GPUIMAGE_LOWPASS, GPUIMAGE_HIGHPASS, GPUIMAGE_MOTIONDETECTOR, GPUIMAGE_SKETCH, GPUIMAGE_THRESHOLDSKETCH, GPUIMAGE_TOON, GPUIMAGE_SMOOTHTOON, GPUIMAGE_TILTSHIFT, GPUIMAGE_CGA, GPUIMAGE_POSTERIZE, GPUIMAGE_CONVOLUTION, GPUIMAGE_EMBOSS, GPUIMAGE_LAPLACIAN, GPUIMAGE_CHROMAKEYNONBLEND, GPUIMAGE_KUWAHARA, GPUIMAGE_KUWAHARARADIUS3, GPUIMAGE_VIGNETTE, GPUIMAGE_GAUSSIAN, GPUIMAGE_GAUSSIAN_SELECTIVE, GPUIMAGE_GAUSSIAN_POSITION, GPUIMAGE_BOXBLUR, GPUIMAGE_MEDIAN, GPUIMAGE_BILATERAL, GPUIMAGE_MOTIONBLUR, GPUIMAGE_ZOOMBLUR, GPUIMAGE_SWIRL, GPUIMAGE_BULGE, GPUIMAGE_PINCH, GPUIMAGE_SPHEREREFRACTION, GPUIMAGE_GLASSSPHERE, GPUIMAGE_STRETCH, GPUIMAGE_DILATION, GPUIMAGE_EROSION, GPUIMAGE_OPENING, GPUIMAGE_CLOSING, GPUIMAGE_DISSOLVE, GPUIMAGE_PERLINNOISE, GPUIMAGE_VORONOI, GPUIMAGE_MOSAIC, GPUIMAGE_LOCALBINARYPATTERN, GPUIMAGE_CHROMAKEY, GPUIMAGE_ADD, GPUIMAGE_DIVIDE, GPUIMAGE_MULTIPLY, GPUIMAGE_OVERLAY, GPUIMAGE_LIGHTEN, GPUIMAGE_DARKEN, GPUIMAGE_COLORBURN, GPUIMAGE_COLORDODGE, GPUIMAGE_LINEARBURN, GPUIMAGE_SCREENBLEND, GPUIMAGE_DIFFERENCEBLEND, GPUIMAGE_SUBTRACTBLEND, GPUIMAGE_EXCLUSIONBLEND, GPUIMAGE_HARDLIGHTBLEND, GPUIMAGE_SOFTLIGHTBLEND, GPUIMAGE_COLORBLEND, GPUIMAGE_HUEBLEND, GPUIMAGE_SATURATIONBLEND, GPUIMAGE_LUMINOSITYBLEND, GPUIMAGE_NORMALBLEND, GPUIMAGE_POISSONBLEND, GPUIMAGE_OPACITY, GPUIMAGE_NUMFILTERS } GPUImageShowcaseFilterType; @interface SLSFilterShowcaseWindowController : NSWindowController { GPUImageOutput *currentlySelectedFilter; GPUImageAVCamera *inputCamera; GPUImagePicture *imageForBlending; NSUInteger currentlySelectedRow; } @property(readwrite) IBOutlet GPUImageView *glView; @property(readwrite) BOOL enableSlider; @property(readwrite, nonatomic) CGFloat minimumSliderValue, maximumSliderValue, currentSliderValue; - (void)changeSelectedRow:(NSUInteger)newRowIndex; @end ================================================ FILE: examples/Mac/FilterShowcase/SLSFilterShowcaseWindowController.m ================================================ #import "SLSFilterShowcaseWindowController.h" @interface SLSFilterShowcaseWindowController () @end @implementation SLSFilterShowcaseWindowController @synthesize glView = _glView; @synthesize enableSlider = _enableSlider; @synthesize minimumSliderValue = _minimumSliderValue, maximumSliderValue = _maximumSliderValue, currentSliderValue = _currentSliderValue; #pragma mark - #pragma mark Initialization and teardown - (id)initWithWindow:(NSWindow *)window { self = [super initWithWindow:window]; if (self) { // Initialization code here. } return self; } - (void)windowDidLoad { [super windowDidLoad]; inputCamera = [[GPUImageAVCamera alloc] initWithSessionPreset:AVCaptureSessionPreset640x480 cameraDevice:nil]; inputCamera.runBenchmark = YES; currentlySelectedRow = 1; [self changeSelectedRow:0]; [inputCamera startCameraCapture]; } #pragma mark - #pragma mark Filter switching - (void)changeSelectedRow:(NSUInteger)newRowIndex; { if (newRowIndex == currentlySelectedRow) { return; } currentlySelectedRow = newRowIndex; BOOL needsSecondImage = NO; if (currentlySelectedFilter != nil) { [inputCamera removeAllTargets]; [imageForBlending removeAllTargets]; // Disconnect older filter before replacing with new one [currentlySelectedFilter removeAllTargets]; currentlySelectedFilter = nil; } switch(currentlySelectedRow) { case GPUIMAGE_SATURATION: { currentlySelectedFilter = [[GPUImageSaturationFilter alloc] init]; self.minimumSliderValue = 0.0; self.maximumSliderValue = 2.0; self.currentSliderValue = 1.0; self.enableSlider = YES; }; break; case GPUIMAGE_CONTRAST: { currentlySelectedFilter = [[GPUImageContrastFilter alloc] init]; self.minimumSliderValue = 0.0; self.maximumSliderValue = 4.0; self.currentSliderValue = 1.0; self.enableSlider = YES; }; break; case GPUIMAGE_BRIGHTNESS: { currentlySelectedFilter = [[GPUImageBrightnessFilter alloc] init]; self.minimumSliderValue = -1.0; self.maximumSliderValue = 1.0; self.currentSliderValue = 0.0; self.enableSlider = YES; }; break; case GPUIMAGE_LEVELS: { currentlySelectedFilter = [[GPUImageLevelsFilter alloc] init]; self.minimumSliderValue = 0.0; self.maximumSliderValue = 1.0; self.currentSliderValue = 0.0; self.enableSlider = YES; }; break; case GPUIMAGE_EXPOSURE: { currentlySelectedFilter = [[GPUImageExposureFilter alloc] init]; self.minimumSliderValue = -4.0; self.maximumSliderValue = 4.0; self.currentSliderValue = 0.0; self.enableSlider = YES; }; break; case GPUIMAGE_RGB: { currentlySelectedFilter = [[GPUImageRGBFilter alloc] init]; self.minimumSliderValue = 0.0; self.maximumSliderValue = 2.0; self.currentSliderValue = 1.0; self.enableSlider = YES; }; break; case GPUIMAGE_HUE: { currentlySelectedFilter = [[GPUImageHueFilter alloc] init]; self.minimumSliderValue = 0.0; self.maximumSliderValue = 360.0; self.currentSliderValue = 90.0; self.enableSlider = YES; }; break; case GPUIMAGE_WHITEBALANCE: { currentlySelectedFilter = [[GPUImageWhiteBalanceFilter alloc] init]; self.minimumSliderValue = 2500.0; self.maximumSliderValue = 7500.0; self.currentSliderValue = 5000.0; self.enableSlider = YES; }; break; case GPUIMAGE_MONOCHROME: { currentlySelectedFilter = [[GPUImageMonochromeFilter alloc] init]; [(GPUImageMonochromeFilter *)currentlySelectedFilter setColor:(GPUVector4){0.0f, 0.0f, 1.0f, 1.f}]; self.minimumSliderValue = 0.0; self.maximumSliderValue = 1.0; self.currentSliderValue = 1.0; self.enableSlider = YES; }; break; case GPUIMAGE_FALSECOLOR: { currentlySelectedFilter = [[GPUImageFalseColorFilter alloc] init]; self.enableSlider = NO; }; break; case GPUIMAGE_SHARPEN: { currentlySelectedFilter = [[GPUImageSharpenFilter alloc] init]; self.minimumSliderValue = -1.0; self.maximumSliderValue = 4.0; self.currentSliderValue = 0.0; self.enableSlider = YES; }; break; case GPUIMAGE_UNSHARPMASK: { currentlySelectedFilter = [[GPUImageUnsharpMaskFilter alloc] init]; self.minimumSliderValue = 0.0; self.maximumSliderValue = 5.0; self.currentSliderValue = 1.0; self.enableSlider = YES; }; break; case GPUIMAGE_TRANSFORM: { currentlySelectedFilter = [[GPUImageTransformFilter alloc] init]; [(GPUImageTransformFilter *)currentlySelectedFilter setAffineTransform:CGAffineTransformMakeRotation(2.0)]; self.minimumSliderValue = 0.0; self.maximumSliderValue = 6.28; self.currentSliderValue = 2.0; self.enableSlider = YES; }; break; case GPUIMAGE_TRANSFORM3D: { currentlySelectedFilter = [[GPUImageTransformFilter alloc] init]; CATransform3D perspectiveTransform = CATransform3DIdentity; perspectiveTransform.m34 = 0.4; perspectiveTransform.m33 = 0.4; perspectiveTransform = CATransform3DScale(perspectiveTransform, 0.75, 0.75, 0.75); perspectiveTransform = CATransform3DRotate(perspectiveTransform, 0.75, 0.0, 1.0, 0.0); [(GPUImageTransformFilter *)currentlySelectedFilter setTransform3D:perspectiveTransform]; self.minimumSliderValue = 0.0; self.maximumSliderValue = 6.28; self.currentSliderValue = 0.75; self.enableSlider = YES; }; break; case GPUIMAGE_CROP: { currentlySelectedFilter = [[GPUImageCropFilter alloc] initWithCropRegion:CGRectMake(0.0, 0.0, 1.0, 0.25)]; self.minimumSliderValue = 0.2; self.maximumSliderValue = 1.0; self.currentSliderValue = 0.5; self.enableSlider = YES; }; break; case GPUIMAGE_MASK: { currentlySelectedFilter = [[GPUImageMaskFilter alloc] init]; [(GPUImageFilter*)currentlySelectedFilter setBackgroundColorRed:0.0 green:1.0 blue:0.0 alpha:1.0]; self.enableSlider = NO; needsSecondImage = YES; }; break; case GPUIMAGE_GAMMA: { currentlySelectedFilter = [[GPUImageGammaFilter alloc] init]; self.minimumSliderValue = 0.0; self.maximumSliderValue = 3.0; self.currentSliderValue = 1.0; self.enableSlider = YES; }; break; case GPUIMAGE_TONECURVE: { currentlySelectedFilter = [[GPUImageToneCurveFilter alloc] init]; self.minimumSliderValue = 0.0; self.maximumSliderValue = 1.0; self.currentSliderValue = 0.5; self.enableSlider = YES; }; break; case GPUIMAGE_HIGHLIGHTSHADOW: { currentlySelectedFilter = [[GPUImageHighlightShadowFilter alloc] init]; self.minimumSliderValue = 0.0; self.maximumSliderValue = 1.0; self.currentSliderValue = 1.0; self.enableSlider = YES; }; break; case GPUIMAGE_HAZE: { currentlySelectedFilter = [[GPUImageHazeFilter alloc] init]; self.minimumSliderValue = -0.2; self.maximumSliderValue = 0.2; self.currentSliderValue = 0.2; self.enableSlider = YES; }; break; case GPUIMAGE_SEPIA: { currentlySelectedFilter = [[GPUImageSepiaFilter alloc] init]; self.minimumSliderValue = 0.0; self.maximumSliderValue = 1.0; self.currentSliderValue = 1.0; self.enableSlider = YES; }; break; case GPUIMAGE_AMATORKA: { currentlySelectedFilter = [[GPUImageAmatorkaFilter alloc] init]; self.enableSlider = NO; }; break; case GPUIMAGE_MISSETIKATE: { currentlySelectedFilter = [[GPUImageMissEtikateFilter alloc] init]; self.enableSlider = NO; }; break; case GPUIMAGE_SOFTELEGANCE: { currentlySelectedFilter = [[GPUImageSoftEleganceFilter alloc] init]; self.enableSlider = NO; }; break; case GPUIMAGE_COLORINVERT: { currentlySelectedFilter = [[GPUImageColorInvertFilter alloc] init]; self.enableSlider = NO; }; break; case GPUIMAGE_HISTOGRAM: { currentlySelectedFilter = [[GPUImageHistogramFilter alloc] init]; self.minimumSliderValue = 4.0; self.maximumSliderValue = 32.0; self.currentSliderValue = 16.0; self.enableSlider = YES; }; break; case GPUIMAGE_AVERAGECOLOR: { currentlySelectedFilter = [[GPUImageAverageColor alloc] init]; self.enableSlider = NO; }; break; case GPUIMAGE_LUMINOSITY: { currentlySelectedFilter = [[GPUImageLuminosity alloc] init]; self.enableSlider = NO; }; break; case GPUIMAGE_THRESHOLD: { currentlySelectedFilter = [[GPUImageLuminanceThresholdFilter alloc] init]; self.minimumSliderValue = 0.0; self.maximumSliderValue = 1.0; self.currentSliderValue = 0.5; self.enableSlider = YES; }; break; case GPUIMAGE_ADAPTIVETHRESHOLD: { currentlySelectedFilter = [[GPUImageAdaptiveThresholdFilter alloc] init]; self.minimumSliderValue = 1.0; self.maximumSliderValue = 20.0; self.currentSliderValue = 1.0; self.enableSlider = YES; }; break; case GPUIMAGE_AVERAGELUMINANCETHRESHOLD: { currentlySelectedFilter = [[GPUImageAverageLuminanceThresholdFilter alloc] init]; self.minimumSliderValue = 0.0; self.maximumSliderValue = 2.0; self.currentSliderValue = 1.0; self.enableSlider = YES; }; break; case GPUIMAGE_HARRISCORNERDETECTION: { currentlySelectedFilter = [[GPUImageHarrisCornerDetectionFilter alloc] init]; [(GPUImageHarrisCornerDetectionFilter *)currentlySelectedFilter setThreshold:0.20]; self.minimumSliderValue = 0.01; self.maximumSliderValue = 0.70; self.currentSliderValue = 0.20; self.enableSlider = YES; }; break; case GPUIMAGE_NOBLECORNERDETECTION: { currentlySelectedFilter = [[GPUImageNobleCornerDetectionFilter alloc] init]; [(GPUImageNobleCornerDetectionFilter *)currentlySelectedFilter setThreshold:0.20]; self.minimumSliderValue = 0.01; self.maximumSliderValue = 0.70; self.currentSliderValue = 0.20; self.enableSlider = YES; }; break; case GPUIMAGE_SHITOMASIFEATUREDETECTION: { currentlySelectedFilter = [[GPUImageShiTomasiFeatureDetectionFilter alloc] init]; [(GPUImageShiTomasiFeatureDetectionFilter *)currentlySelectedFilter setThreshold:0.20]; self.minimumSliderValue = 0.01; self.maximumSliderValue = 0.70; self.currentSliderValue = 0.20; self.enableSlider = YES; }; break; case GPUIMAGE_HOUGHTRANSFORMLINEDETECTOR: { currentlySelectedFilter = [[GPUImageHoughTransformLineDetector alloc] init]; [(GPUImageHoughTransformLineDetector *)currentlySelectedFilter setLineDetectionThreshold:0.60]; self.minimumSliderValue = 0.2; self.maximumSliderValue = 1.0; self.currentSliderValue = 0.6; self.enableSlider = YES; }; break; case GPUIMAGE_BUFFER: { currentlySelectedFilter = [[GPUImageBuffer alloc] init]; self.enableSlider = NO; }; break; case GPUIMAGE_LOWPASS: { currentlySelectedFilter = [[GPUImageLowPassFilter alloc] init]; self.minimumSliderValue = 0.0; self.maximumSliderValue = 1.0; self.currentSliderValue = 0.5; self.enableSlider = YES; }; break; case GPUIMAGE_HIGHPASS: { currentlySelectedFilter = [[GPUImageHighPassFilter alloc] init]; self.minimumSliderValue = 0.0; self.maximumSliderValue = 1.0; self.currentSliderValue = 0.5; self.enableSlider = YES; }; break; case GPUIMAGE_MOTIONDETECTOR: { currentlySelectedFilter = [[GPUImageMotionDetector alloc] init]; self.minimumSliderValue = 0.0; self.maximumSliderValue = 1.0; self.currentSliderValue = 0.5; self.enableSlider = YES; }; break; case GPUIMAGE_GRAYSCALE: { currentlySelectedFilter = [[GPUImageGrayscaleFilter alloc] init]; self.enableSlider = NO; }; break; case GPUIMAGE_PIXELLATE: { currentlySelectedFilter = [[GPUImagePixellateFilter alloc] init]; self.minimumSliderValue = 0.0; self.maximumSliderValue = 0.3; self.currentSliderValue = 0.05; self.enableSlider = YES; }; break; case GPUIMAGE_POLARPIXELLATE: { currentlySelectedFilter = [[GPUImagePolarPixellateFilter alloc] init]; self.minimumSliderValue = -0.1; self.maximumSliderValue = 0.1; self.currentSliderValue = 0.05; self.enableSlider = YES; }; break; case GPUIMAGE_PIXELLATE_POSITION: { currentlySelectedFilter = [[GPUImagePixellatePositionFilter alloc] init]; self.minimumSliderValue = 0.0; self.maximumSliderValue = 0.5; self.currentSliderValue = 0.25; self.enableSlider = YES; }; break; case GPUIMAGE_POLKADOT: { currentlySelectedFilter = [[GPUImagePolkaDotFilter alloc] init]; self.minimumSliderValue = 0.0; self.maximumSliderValue = 0.3; self.currentSliderValue = 0.05; self.enableSlider = YES; }; break; case GPUIMAGE_HALFTONE: { currentlySelectedFilter = [[GPUImageHalftoneFilter alloc] init]; self.minimumSliderValue = 0.0; self.maximumSliderValue = 0.05; self.currentSliderValue = 0.01; self.enableSlider = YES; }; break; case GPUIMAGE_CROSSHATCH: { currentlySelectedFilter = [[GPUImageCrosshatchFilter alloc] init]; self.minimumSliderValue = 0.01; self.maximumSliderValue = 0.06; self.currentSliderValue = 0.03; self.enableSlider = YES; }; break; case GPUIMAGE_SOBELEDGEDETECTION: { currentlySelectedFilter = [[GPUImageSobelEdgeDetectionFilter alloc] init]; self.minimumSliderValue = 0.0; self.maximumSliderValue = 2.0; self.currentSliderValue = 1.0; self.enableSlider = YES; }; break; case GPUIMAGE_PREWITTEDGEDETECTION: { currentlySelectedFilter = [[GPUImagePrewittEdgeDetectionFilter alloc] init]; self.minimumSliderValue = 0.0; self.maximumSliderValue = 2.0; self.currentSliderValue = 1.0; self.enableSlider = YES; }; break; case GPUIMAGE_CANNYEDGEDETECTION: { currentlySelectedFilter = [[GPUImageCannyEdgeDetectionFilter alloc] init]; self.minimumSliderValue = 0.0; self.maximumSliderValue = 1.0; self.currentSliderValue = 1.0; self.enableSlider = YES; }; break; case GPUIMAGE_THRESHOLDEDGEDETECTION: { currentlySelectedFilter = [[GPUImageThresholdEdgeDetectionFilter alloc] init]; self.minimumSliderValue = 0.0; self.maximumSliderValue = 1.0; self.currentSliderValue = 0.5; self.enableSlider = YES; }; break; case GPUIMAGE_XYGRADIENT: { currentlySelectedFilter = [[GPUImageXYDerivativeFilter alloc] init]; self.enableSlider = NO; }; break; case GPUIMAGE_SKETCH: { currentlySelectedFilter = [[GPUImageSketchFilter alloc] init]; self.minimumSliderValue = 0.0; self.maximumSliderValue = 2.0; self.currentSliderValue = 1.0; self.enableSlider = YES; }; break; case GPUIMAGE_THRESHOLDSKETCH: { currentlySelectedFilter = [[GPUImageThresholdSketchFilter alloc] init]; self.minimumSliderValue = 0.0; self.maximumSliderValue = 1.0; self.currentSliderValue = 0.25; self.enableSlider = YES; }; break; case GPUIMAGE_TOON: { currentlySelectedFilter = [[GPUImageToonFilter alloc] init]; self.enableSlider = NO; }; break; case GPUIMAGE_CONVOLUTION: { currentlySelectedFilter = [[GPUImage3x3ConvolutionFilter alloc] init]; [(GPUImage3x3ConvolutionFilter *)currentlySelectedFilter setConvolutionKernel:(GPUMatrix3x3){ {-1.0f, 0.0f, 1.0f}, {-2.0f, 0.0f, 2.0f}, {-1.0f, 0.0f, 1.0f} }]; self.enableSlider = NO; }; break; case GPUIMAGE_SMOOTHTOON: { currentlySelectedFilter = [[GPUImageSmoothToonFilter alloc] init]; self.minimumSliderValue = 1.0; self.maximumSliderValue = 6.0; self.currentSliderValue = 1.0; self.enableSlider = YES; }; break; case GPUIMAGE_TILTSHIFT: { currentlySelectedFilter = [[GPUImageTiltShiftFilter alloc] init]; [(GPUImageTiltShiftFilter *)currentlySelectedFilter setTopFocusLevel:0.4]; [(GPUImageTiltShiftFilter *)currentlySelectedFilter setBottomFocusLevel:0.6]; [(GPUImageTiltShiftFilter *)currentlySelectedFilter setFocusFallOffRate:0.2]; self.minimumSliderValue = 0.2; self.maximumSliderValue = 0.8; self.currentSliderValue = 0.5; self.enableSlider = YES; }; break; case GPUIMAGE_CGA: { currentlySelectedFilter = [[GPUImageCGAColorspaceFilter alloc] init]; self.enableSlider = NO; }; break; case GPUIMAGE_POSTERIZE: { currentlySelectedFilter = [[GPUImagePosterizeFilter alloc] init]; self.minimumSliderValue = 1.0; self.maximumSliderValue = 20.0; self.currentSliderValue = 10.0; self.enableSlider = YES; }; break; case GPUIMAGE_EMBOSS: { currentlySelectedFilter = [[GPUImageEmbossFilter alloc] init]; self.minimumSliderValue = 0.0; self.maximumSliderValue = 5.0; self.currentSliderValue = 1.0; self.enableSlider = YES; }; break; case GPUIMAGE_LAPLACIAN: { currentlySelectedFilter = [[GPUImageLaplacianFilter alloc] init]; self.enableSlider = NO; }; break; case GPUIMAGE_CHROMAKEYNONBLEND: { currentlySelectedFilter = [[GPUImageChromaKeyFilter alloc] init]; [(GPUImageChromaKeyFilter *)currentlySelectedFilter setColorToReplaceRed:0.0 green:1.0 blue:0.0]; needsSecondImage = YES; self.minimumSliderValue = 0.0; self.maximumSliderValue = 1.0; self.currentSliderValue = 0.4; self.enableSlider = YES; }; break; case GPUIMAGE_KUWAHARA: { currentlySelectedFilter = [[GPUImageKuwaharaFilter alloc] init]; self.minimumSliderValue = 3.0; self.maximumSliderValue = 8.0; self.currentSliderValue = 3.0; self.enableSlider = YES; }; break; case GPUIMAGE_KUWAHARARADIUS3: { currentlySelectedFilter = [[GPUImageKuwaharaRadius3Filter alloc] init]; self.enableSlider = NO; }; break; case GPUIMAGE_VIGNETTE: { currentlySelectedFilter = [[GPUImageVignetteFilter alloc] init]; self.minimumSliderValue = 0.5; self.maximumSliderValue = 0.9; self.currentSliderValue = 0.75; self.enableSlider = YES; }; break; case GPUIMAGE_GAUSSIAN: { currentlySelectedFilter = [[GPUImageGaussianBlurFilter alloc] init]; self.minimumSliderValue = 1.0; self.maximumSliderValue = 24.0; self.currentSliderValue = 2.0; self.enableSlider = YES; }; break; case GPUIMAGE_GAUSSIAN_SELECTIVE: { currentlySelectedFilter = [[GPUImageGaussianSelectiveBlurFilter alloc] init]; [(GPUImageGaussianSelectiveBlurFilter*)currentlySelectedFilter setExcludeCircleRadius:40.0/320.0]; self.minimumSliderValue = 0.0; self.maximumSliderValue = 0.75; self.currentSliderValue = 40.0/320.0; self.enableSlider = YES; }; break; case GPUIMAGE_GAUSSIAN_POSITION: { currentlySelectedFilter = [[GPUImageGaussianBlurPositionFilter alloc] init]; [(GPUImageGaussianBlurPositionFilter*)currentlySelectedFilter setBlurRadius:40.0/320.0]; self.minimumSliderValue = 0.0; self.maximumSliderValue = 0.75; self.currentSliderValue = 40.0/320.0; self.enableSlider = YES; }; break; case GPUIMAGE_BOXBLUR: { currentlySelectedFilter = [[GPUImageBoxBlurFilter alloc] init]; self.minimumSliderValue = 1.0; self.maximumSliderValue = 24.0; self.currentSliderValue = 2.0; self.enableSlider = YES; }; break; case GPUIMAGE_MEDIAN: { currentlySelectedFilter = [[GPUImageMedianFilter alloc] init]; self.enableSlider = NO; }; break; case GPUIMAGE_BILATERAL: { currentlySelectedFilter = [[GPUImageBilateralFilter alloc] init]; self.minimumSliderValue = 0.0; self.maximumSliderValue = 10.0; self.currentSliderValue = 1.0; self.enableSlider = YES; }; break; case GPUIMAGE_MOTIONBLUR: { currentlySelectedFilter = [[GPUImageMotionBlurFilter alloc] init]; self.minimumSliderValue = 0.0; self.maximumSliderValue = 180.0; self.currentSliderValue = 0.0; self.enableSlider = YES; }; break; case GPUIMAGE_ZOOMBLUR: { currentlySelectedFilter = [[GPUImageZoomBlurFilter alloc] init]; self.minimumSliderValue = 0.0; self.maximumSliderValue = 2.5; self.currentSliderValue = 1.0; self.enableSlider = YES; }; break; case GPUIMAGE_SWIRL: { currentlySelectedFilter = [[GPUImageSwirlFilter alloc] init]; self.minimumSliderValue = 0.0; self.maximumSliderValue = 2.0; self.currentSliderValue = 1.0; self.enableSlider = YES; }; break; case GPUIMAGE_BULGE: { currentlySelectedFilter = [[GPUImageBulgeDistortionFilter alloc] init]; self.minimumSliderValue = -1.0; self.maximumSliderValue = 1.0; self.currentSliderValue = 0.5; self.enableSlider = YES; }; break; case GPUIMAGE_PINCH: { currentlySelectedFilter = [[GPUImagePinchDistortionFilter alloc] init]; self.minimumSliderValue = -2.0; self.maximumSliderValue = 2.0; self.currentSliderValue = 0.5; self.enableSlider = YES; }; break; case GPUIMAGE_SPHEREREFRACTION: { currentlySelectedFilter = [[GPUImageSphereRefractionFilter alloc] init]; [(GPUImageSphereRefractionFilter *)currentlySelectedFilter setRadius:0.15]; self.minimumSliderValue = 0.0; self.maximumSliderValue = 1.0; self.currentSliderValue = 0.15; self.enableSlider = YES; }; break; case GPUIMAGE_GLASSSPHERE: { currentlySelectedFilter = [[GPUImageGlassSphereFilter alloc] init]; [(GPUImageGlassSphereFilter *)currentlySelectedFilter setRadius:0.15]; self.minimumSliderValue = 0.0; self.maximumSliderValue = 1.0; self.currentSliderValue = 0.15; self.enableSlider = YES; }; break; case GPUIMAGE_STRETCH: { currentlySelectedFilter = [[GPUImageStretchDistortionFilter alloc] init]; self.enableSlider = NO; }; break; case GPUIMAGE_DILATION: { currentlySelectedFilter = [[GPUImageRGBDilationFilter alloc] init]; self.enableSlider = NO; }; break; case GPUIMAGE_EROSION: { currentlySelectedFilter = [[GPUImageRGBErosionFilter alloc] init]; self.enableSlider = NO; }; break; case GPUIMAGE_OPENING: { currentlySelectedFilter = [[GPUImageRGBOpeningFilter alloc] init]; self.enableSlider = NO; }; break; case GPUIMAGE_CLOSING: { currentlySelectedFilter = [[GPUImageRGBClosingFilter alloc] init]; self.enableSlider = NO; }; break; case GPUIMAGE_PERLINNOISE: { currentlySelectedFilter = [[GPUImagePerlinNoiseFilter alloc] init]; self.minimumSliderValue = 1.0; self.maximumSliderValue = 30.0; self.currentSliderValue = 8.0; self.enableSlider = YES; }; break; case GPUIMAGE_VORONOI: { self.enableSlider = NO; GPUImageJFAVoronoiFilter *jfa = [[GPUImageJFAVoronoiFilter alloc] init]; [jfa setSizeInPixels:CGSizeMake(1024.0, 1024.0)]; NSImage *voronoiPoints = [NSImage imageNamed:@"voroni_points2.png"]; imageForBlending = [[GPUImagePicture alloc] initWithImage:voronoiPoints]; [imageForBlending addTarget:jfa]; currentlySelectedFilter = [[GPUImageVoronoiConsumerFilter alloc] init]; [jfa setSizeInPixels:CGSizeMake(1024.0, 1024.0)]; [(GPUImageVoronoiConsumerFilter *)currentlySelectedFilter setSizeInPixels:CGSizeMake(1024.0, 1024.0)]; [inputCamera addTarget:currentlySelectedFilter]; [jfa addTarget:currentlySelectedFilter]; [imageForBlending processImage]; }; break; case GPUIMAGE_MOSAIC: { currentlySelectedFilter = [[GPUImageMosaicFilter alloc] init]; [(GPUImageMosaicFilter *)currentlySelectedFilter setTileSet:@"squares.png"]; [(GPUImageMosaicFilter *)currentlySelectedFilter setColorOn:NO]; // [currentlySelectedFilter setInputRotation:kGPUImageRotateRight atIndex:0]; self.minimumSliderValue = 0.002; self.maximumSliderValue = 0.05; self.currentSliderValue = 0.025; self.enableSlider = YES; }; break; case GPUIMAGE_LOCALBINARYPATTERN: { currentlySelectedFilter = [[GPUImageLocalBinaryPatternFilter alloc] init]; self.minimumSliderValue = 1.0; self.maximumSliderValue = 5.0; self.currentSliderValue = 1.0; self.enableSlider = YES; }; break; case GPUIMAGE_DISSOLVE: { currentlySelectedFilter = [[GPUImageDissolveBlendFilter alloc] init]; needsSecondImage = YES; self.minimumSliderValue = 0.0; self.maximumSliderValue = 1.0; self.currentSliderValue = 0.5; self.enableSlider = YES; }; break; case GPUIMAGE_CHROMAKEY: { currentlySelectedFilter = [[GPUImageChromaKeyBlendFilter alloc] init]; [(GPUImageChromaKeyBlendFilter *)currentlySelectedFilter setColorToReplaceRed:0.0 green:1.0 blue:0.0]; needsSecondImage = YES; self.minimumSliderValue = 0.0; self.maximumSliderValue = 1.0; self.currentSliderValue = 0.4; self.enableSlider = YES; }; break; case GPUIMAGE_ADD: { currentlySelectedFilter = [[GPUImageAddBlendFilter alloc] init]; needsSecondImage = YES; self.enableSlider = NO; }; break; case GPUIMAGE_DIVIDE: { currentlySelectedFilter = [[GPUImageDivideBlendFilter alloc] init]; needsSecondImage = YES; self.enableSlider = NO; }; break; case GPUIMAGE_MULTIPLY: { currentlySelectedFilter = [[GPUImageMultiplyBlendFilter alloc] init]; needsSecondImage = YES; self.enableSlider = NO; }; break; case GPUIMAGE_OVERLAY: { currentlySelectedFilter = [[GPUImageOverlayBlendFilter alloc] init]; needsSecondImage = YES; self.enableSlider = NO; }; break; case GPUIMAGE_LIGHTEN: { currentlySelectedFilter = [[GPUImageLightenBlendFilter alloc] init]; needsSecondImage = YES; self.enableSlider = NO; }; break; case GPUIMAGE_DARKEN: { currentlySelectedFilter = [[GPUImageDarkenBlendFilter alloc] init]; needsSecondImage = YES; self.enableSlider = NO; }; break; case GPUIMAGE_COLORBURN: { currentlySelectedFilter = [[GPUImageColorBurnBlendFilter alloc] init]; needsSecondImage = YES; self.enableSlider = NO; }; break; case GPUIMAGE_COLORDODGE: { currentlySelectedFilter = [[GPUImageColorDodgeBlendFilter alloc] init]; needsSecondImage = YES; self.enableSlider = NO; }; break; case GPUIMAGE_LINEARBURN: { currentlySelectedFilter = [[GPUImageLinearBurnBlendFilter alloc] init]; needsSecondImage = YES; self.enableSlider = NO; }; break; case GPUIMAGE_SCREENBLEND: { currentlySelectedFilter = [[GPUImageScreenBlendFilter alloc] init]; needsSecondImage = YES; self.enableSlider = NO; }; break; case GPUIMAGE_DIFFERENCEBLEND: { currentlySelectedFilter = [[GPUImageDifferenceBlendFilter alloc] init]; needsSecondImage = YES; self.enableSlider = NO; }; break; case GPUIMAGE_SUBTRACTBLEND: { currentlySelectedFilter = [[GPUImageSubtractBlendFilter alloc] init]; needsSecondImage = YES; self.enableSlider = NO; }; break; case GPUIMAGE_EXCLUSIONBLEND: { currentlySelectedFilter = [[GPUImageExclusionBlendFilter alloc] init]; needsSecondImage = YES; self.enableSlider = NO; }; break; case GPUIMAGE_HARDLIGHTBLEND: { currentlySelectedFilter = [[GPUImageHardLightBlendFilter alloc] init]; needsSecondImage = YES; self.enableSlider = NO; }; break; case GPUIMAGE_SOFTLIGHTBLEND: { currentlySelectedFilter = [[GPUImageSoftLightBlendFilter alloc] init]; needsSecondImage = YES; self.enableSlider = NO; }; break; case GPUIMAGE_COLORBLEND: { currentlySelectedFilter = [[GPUImageColorBlendFilter alloc] init]; needsSecondImage = YES; self.enableSlider = NO; }; break; case GPUIMAGE_HUEBLEND: { currentlySelectedFilter = [[GPUImageHueBlendFilter alloc] init]; needsSecondImage = YES; self.enableSlider = NO; }; break; case GPUIMAGE_SATURATIONBLEND: { currentlySelectedFilter = [[GPUImageSaturationBlendFilter alloc] init]; needsSecondImage = YES; self.enableSlider = NO; }; break; case GPUIMAGE_LUMINOSITYBLEND: { currentlySelectedFilter = [[GPUImageLuminosityBlendFilter alloc] init]; needsSecondImage = YES; self.enableSlider = NO; }; break; case GPUIMAGE_NORMALBLEND: { currentlySelectedFilter = [[GPUImageNormalBlendFilter alloc] init]; needsSecondImage = YES; self.enableSlider = NO; }; break; case GPUIMAGE_POISSONBLEND: { currentlySelectedFilter = [[GPUImagePoissonBlendFilter alloc] init]; needsSecondImage = YES; self.minimumSliderValue = 0.0; self.maximumSliderValue = 1.0; self.currentSliderValue = 0.5; self.enableSlider = YES; }; break; case GPUIMAGE_OPACITY: { currentlySelectedFilter = [[GPUImageOpacityFilter alloc] init]; needsSecondImage = YES; self.minimumSliderValue = 0.0; self.maximumSliderValue = 1.0; self.currentSliderValue = 1.0; self.enableSlider = YES; }; break; } if (currentlySelectedRow != GPUIMAGE_VORONOI) { [inputCamera addTarget:currentlySelectedFilter]; } [currentlySelectedFilter addTarget:self.glView]; if (needsSecondImage) { if (imageForBlending == nil) { NSImage *inputImage; if (currentlySelectedRow == GPUIMAGE_MASK) { inputImage = [NSImage imageNamed:@"mask"]; } /* else if (filterType == GPUIMAGE_VORONOI) { inputImage = [UIImage imageNamed:@"voroni_points.png"]; }*/ else { // The picture is only used for two-image blend filters inputImage = [NSImage imageNamed:@"Lambeau.jpg"]; } imageForBlending = [[GPUImagePicture alloc] initWithImage:inputImage smoothlyScaleOutput:YES]; } [imageForBlending processImage]; [imageForBlending addTarget:currentlySelectedFilter]; } if ( (currentlySelectedRow == GPUIMAGE_OPACITY) || (currentlySelectedRow == GPUIMAGE_CHROMAKEYNONBLEND) ) { [currentlySelectedFilter removeTarget:self.glView]; [imageForBlending removeTarget:currentlySelectedFilter]; [inputCamera removeTarget:currentlySelectedFilter]; [inputCamera addTarget:currentlySelectedFilter]; GPUImageAlphaBlendFilter *blendFilter = [[GPUImageAlphaBlendFilter alloc] init]; blendFilter.mix = 1.0; [imageForBlending addTarget:blendFilter]; [currentlySelectedFilter addTarget:blendFilter]; [blendFilter addTarget:self.glView]; } else if (currentlySelectedRow == GPUIMAGE_BUFFER) { [currentlySelectedFilter removeTarget:self.glView]; GPUImageDifferenceBlendFilter *blendFilter = [[GPUImageDifferenceBlendFilter alloc] init]; [inputCamera removeTarget:currentlySelectedFilter]; GPUImageGammaFilter *gammaFilter = [[GPUImageGammaFilter alloc] init]; [inputCamera addTarget:gammaFilter]; [gammaFilter addTarget:blendFilter]; [inputCamera addTarget:currentlySelectedFilter]; [currentlySelectedFilter addTarget:blendFilter]; [blendFilter addTarget:self.glView]; } else if (currentlySelectedRow == GPUIMAGE_HISTOGRAM) { [currentlySelectedFilter removeTarget:self.glView]; // I'm adding an intermediary filter because glReadPixels() requires something to be rendered for its glReadPixels() operation to work [inputCamera removeTarget:currentlySelectedFilter]; GPUImageGammaFilter *gammaFilter = [[GPUImageGammaFilter alloc] init]; [inputCamera addTarget:gammaFilter]; [gammaFilter addTarget:currentlySelectedFilter]; GPUImageHistogramGenerator *histogramGraph = [[GPUImageHistogramGenerator alloc] init]; [histogramGraph forceProcessingAtSize:CGSizeMake(256.0, 144.0)]; [currentlySelectedFilter addTarget:histogramGraph]; GPUImageAlphaBlendFilter *blendFilter = [[GPUImageAlphaBlendFilter alloc] init]; blendFilter.mix = 0.75; [blendFilter forceProcessingAtSize:CGSizeMake(256.0, 144.0)]; [inputCamera addTarget:blendFilter]; [histogramGraph addTarget:blendFilter]; [blendFilter addTarget:self.glView]; } else if ( (currentlySelectedRow == GPUIMAGE_SPHEREREFRACTION) || (currentlySelectedRow == GPUIMAGE_GLASSSPHERE) ) { [currentlySelectedFilter removeTarget:self.glView]; // Provide a blurred image for a cool-looking background GPUImageGaussianBlurFilter *gaussianBlur = [[GPUImageGaussianBlurFilter alloc] init]; [inputCamera addTarget:gaussianBlur]; gaussianBlur.blurRadiusInPixels = 10.0; GPUImageAlphaBlendFilter *blendFilter = [[GPUImageAlphaBlendFilter alloc] init]; blendFilter.mix = 1.0; [gaussianBlur addTarget:blendFilter]; [currentlySelectedFilter addTarget:blendFilter]; [blendFilter addTarget:self.glView]; } else if (currentlySelectedRow == GPUIMAGE_AVERAGECOLOR) { [currentlySelectedFilter removeTarget:self.glView]; GPUImageSolidColorGenerator *colorGenerator = [[GPUImageSolidColorGenerator alloc] init]; [colorGenerator forceProcessingAtSize:[self.glView sizeInPixels]]; [(GPUImageAverageColor *)currentlySelectedFilter setColorAverageProcessingFinishedBlock:^(CGFloat redComponent, CGFloat greenComponent, CGFloat blueComponent, CGFloat alphaComponent, CMTime frameTime) { [colorGenerator setColorRed:redComponent green:greenComponent blue:blueComponent alpha:alphaComponent]; // NSLog(@"Average color: %f, %f, %f, %f", redComponent, greenComponent, blueComponent, alphaComponent); }]; [colorGenerator addTarget:self.glView]; } else if (currentlySelectedRow == GPUIMAGE_LUMINOSITY) { [currentlySelectedFilter removeTarget:self.glView]; GPUImageSolidColorGenerator *colorGenerator = [[GPUImageSolidColorGenerator alloc] init]; [colorGenerator forceProcessingAtSize:[self.glView sizeInPixels]]; [(GPUImageLuminosity *)currentlySelectedFilter setLuminosityProcessingFinishedBlock:^(CGFloat luminosity, CMTime frameTime) { [colorGenerator setColorRed:luminosity green:luminosity blue:luminosity alpha:1.0]; }]; [colorGenerator addTarget:self.glView]; } else if ( (currentlySelectedRow == GPUIMAGE_HARRISCORNERDETECTION) || (currentlySelectedRow == GPUIMAGE_NOBLECORNERDETECTION) || (currentlySelectedRow == GPUIMAGE_SHITOMASIFEATUREDETECTION) ) { [currentlySelectedFilter removeTarget:self.glView]; GPUImageCrosshairGenerator *crosshairGenerator = [[GPUImageCrosshairGenerator alloc] init]; crosshairGenerator.crosshairWidth = 15.0; [crosshairGenerator forceProcessingAtSize:[self.glView sizeInPixels]]; [(GPUImageHarrisCornerDetectionFilter *)currentlySelectedFilter setCornersDetectedBlock:^(GLfloat* cornerArray, NSUInteger cornersDetected, CMTime frameTime) { [crosshairGenerator renderCrosshairsFromArray:cornerArray count:cornersDetected frameTime:frameTime]; }]; GPUImageAlphaBlendFilter *blendFilter = [[GPUImageAlphaBlendFilter alloc] init]; [blendFilter forceProcessingAtSize:[self.glView sizeInPixels]]; GPUImageGammaFilter *gammaFilter = [[GPUImageGammaFilter alloc] init]; [inputCamera addTarget:gammaFilter]; [gammaFilter addTarget:blendFilter]; [crosshairGenerator addTarget:blendFilter]; [blendFilter addTarget:self.glView]; } else if (currentlySelectedRow == GPUIMAGE_HOUGHTRANSFORMLINEDETECTOR) { [currentlySelectedFilter removeTarget:self.glView]; GPUImageLineGenerator *lineGenerator = [[GPUImageLineGenerator alloc] init]; // lineGenerator.crosshairWidth = 15.0; [lineGenerator forceProcessingAtSize:CGSizeMake(480.0, 640.0)]; [lineGenerator setLineColorRed:1.0 green:0.0 blue:0.0]; [(GPUImageHoughTransformLineDetector *)currentlySelectedFilter setLinesDetectedBlock:^(GLfloat* lineArray, NSUInteger linesDetected, CMTime frameTime){ [lineGenerator renderLinesFromArray:lineArray count:linesDetected frameTime:frameTime]; }]; GPUImageAlphaBlendFilter *blendFilter = [[GPUImageAlphaBlendFilter alloc] init]; [blendFilter forceProcessingAtSize:[self.glView sizeInPixels]]; GPUImageGammaFilter *gammaFilter = [[GPUImageGammaFilter alloc] init]; [inputCamera addTarget:gammaFilter]; [gammaFilter addTarget:blendFilter]; [lineGenerator addTarget:blendFilter]; [blendFilter addTarget:self.glView]; } } #pragma mark - #pragma mark Filter settings - (void)setCurrentSliderValue:(CGFloat)newValue; { _currentSliderValue = newValue; switch(currentlySelectedRow) { case GPUIMAGE_SATURATION: [(GPUImageSaturationFilter *)currentlySelectedFilter setSaturation:_currentSliderValue]; break; case GPUIMAGE_CONTRAST: [(GPUImageContrastFilter *)currentlySelectedFilter setContrast:_currentSliderValue]; break; case GPUIMAGE_BRIGHTNESS: [(GPUImageBrightnessFilter *)currentlySelectedFilter setBrightness:_currentSliderValue]; break; case GPUIMAGE_LEVELS: { [(GPUImageLevelsFilter *)currentlySelectedFilter setRedMin:_currentSliderValue gamma:1.0 max:1.0 minOut:0.0 maxOut:1.0]; [(GPUImageLevelsFilter *)currentlySelectedFilter setGreenMin:_currentSliderValue gamma:1.0 max:1.0 minOut:0.0 maxOut:1.0]; [(GPUImageLevelsFilter *)currentlySelectedFilter setBlueMin:_currentSliderValue gamma:1.0 max:1.0 minOut:0.0 maxOut:1.0]; }; break; case GPUIMAGE_EXPOSURE: [(GPUImageExposureFilter *)currentlySelectedFilter setExposure:_currentSliderValue]; break; case GPUIMAGE_RGB: [(GPUImageRGBFilter *)currentlySelectedFilter setGreen:_currentSliderValue]; break; case GPUIMAGE_HUE: [(GPUImageHueFilter *)currentlySelectedFilter setHue:_currentSliderValue]; break; case GPUIMAGE_WHITEBALANCE: [(GPUImageWhiteBalanceFilter *)currentlySelectedFilter setTemperature:_currentSliderValue]; break; case GPUIMAGE_MONOCHROME: [(GPUImageMonochromeFilter *)currentlySelectedFilter setIntensity:_currentSliderValue]; break; case GPUIMAGE_GAMMA: [(GPUImageGammaFilter *)currentlySelectedFilter setGamma:_currentSliderValue]; break; case GPUIMAGE_TONECURVE: [(GPUImageToneCurveFilter *)currentlySelectedFilter setBlueControlPoints:[NSArray arrayWithObjects:[NSValue valueWithPoint:NSMakePoint(0.0, 0.0)], [NSValue valueWithPoint:NSMakePoint(0.5, _currentSliderValue)], [NSValue valueWithPoint:NSMakePoint(1.0, 0.75)], nil]]; break; case GPUIMAGE_HIGHLIGHTSHADOW: [(GPUImageHighlightShadowFilter *)currentlySelectedFilter setHighlights:_currentSliderValue]; break; case GPUIMAGE_HAZE: [(GPUImageHazeFilter *)currentlySelectedFilter setDistance:_currentSliderValue]; break; case GPUIMAGE_SEPIA: [(GPUImageSepiaFilter *)currentlySelectedFilter setIntensity:_currentSliderValue]; break; case GPUIMAGE_PIXELLATE: [(GPUImagePixellateFilter *)currentlySelectedFilter setFractionalWidthOfAPixel:_currentSliderValue]; break; case GPUIMAGE_POLARPIXELLATE: [(GPUImagePolarPixellateFilter *)currentlySelectedFilter setPixelSize:CGSizeMake(_currentSliderValue, _currentSliderValue)]; break; case GPUIMAGE_PIXELLATE_POSITION: [(GPUImagePixellatePositionFilter *)currentlySelectedFilter setRadius:_currentSliderValue]; break; case GPUIMAGE_POLKADOT: [(GPUImagePolkaDotFilter *)currentlySelectedFilter setFractionalWidthOfAPixel:_currentSliderValue]; break; case GPUIMAGE_HALFTONE: [(GPUImageHalftoneFilter *)currentlySelectedFilter setFractionalWidthOfAPixel:_currentSliderValue]; break; case GPUIMAGE_CROSSHATCH: [(GPUImageCrosshatchFilter *)currentlySelectedFilter setCrossHatchSpacing:_currentSliderValue]; break; case GPUIMAGE_SOBELEDGEDETECTION: [(GPUImageSobelEdgeDetectionFilter *)currentlySelectedFilter setEdgeStrength:_currentSliderValue]; break; case GPUIMAGE_PREWITTEDGEDETECTION: [(GPUImagePrewittEdgeDetectionFilter *)currentlySelectedFilter setEdgeStrength:_currentSliderValue]; break; case GPUIMAGE_HISTOGRAM: [(GPUImageHistogramFilter *)currentlySelectedFilter setDownsamplingFactor:round(_currentSliderValue)]; break; case GPUIMAGE_THRESHOLD: [(GPUImageLuminanceThresholdFilter *)currentlySelectedFilter setThreshold:_currentSliderValue]; break; case GPUIMAGE_ADAPTIVETHRESHOLD: [(GPUImageAdaptiveThresholdFilter *)currentlySelectedFilter setBlurRadiusInPixels:_currentSliderValue]; break; case GPUIMAGE_AVERAGELUMINANCETHRESHOLD: [(GPUImageAverageLuminanceThresholdFilter *)currentlySelectedFilter setThresholdMultiplier:_currentSliderValue]; break; case GPUIMAGE_CANNYEDGEDETECTION: [(GPUImageCannyEdgeDetectionFilter *)currentlySelectedFilter setBlurTexelSpacingMultiplier:_currentSliderValue]; break; case GPUIMAGE_THRESHOLDEDGEDETECTION: [(GPUImageThresholdEdgeDetectionFilter *)currentlySelectedFilter setThreshold:_currentSliderValue]; break; case GPUIMAGE_HARRISCORNERDETECTION: [(GPUImageHarrisCornerDetectionFilter *)currentlySelectedFilter setThreshold:_currentSliderValue]; break; case GPUIMAGE_NOBLECORNERDETECTION: [(GPUImageNobleCornerDetectionFilter *)currentlySelectedFilter setThreshold:_currentSliderValue]; break; case GPUIMAGE_SHITOMASIFEATUREDETECTION: [(GPUImageShiTomasiFeatureDetectionFilter *)currentlySelectedFilter setThreshold:_currentSliderValue]; break; case GPUIMAGE_HOUGHTRANSFORMLINEDETECTOR: [(GPUImageHoughTransformLineDetector *)currentlySelectedFilter setLineDetectionThreshold:_currentSliderValue]; break; case GPUIMAGE_LOWPASS: [(GPUImageLowPassFilter *)currentlySelectedFilter setFilterStrength:_currentSliderValue]; break; case GPUIMAGE_HIGHPASS: [(GPUImageHighPassFilter *)currentlySelectedFilter setFilterStrength:_currentSliderValue]; break; case GPUIMAGE_MOTIONDETECTOR: [(GPUImageMotionDetector *)currentlySelectedFilter setLowPassFilterStrength:_currentSliderValue]; break; case GPUIMAGE_SKETCH: [(GPUImageSketchFilter *)currentlySelectedFilter setEdgeStrength:_currentSliderValue]; break; case GPUIMAGE_THRESHOLDSKETCH: [(GPUImageThresholdSketchFilter *)currentlySelectedFilter setThreshold:_currentSliderValue]; break; case GPUIMAGE_SMOOTHTOON: [(GPUImageSmoothToonFilter *)currentlySelectedFilter setBlurRadiusInPixels:_currentSliderValue]; break; case GPUIMAGE_POSTERIZE: [(GPUImagePosterizeFilter *)currentlySelectedFilter setColorLevels:round(_currentSliderValue)]; break; case GPUIMAGE_TILTSHIFT: { CGFloat midpoint = _currentSliderValue; [(GPUImageTiltShiftFilter *)currentlySelectedFilter setTopFocusLevel:midpoint - 0.1]; [(GPUImageTiltShiftFilter *)currentlySelectedFilter setBottomFocusLevel:midpoint + 0.1]; }; break; case GPUIMAGE_EMBOSS: [(GPUImageEmbossFilter *)currentlySelectedFilter setIntensity:_currentSliderValue]; break; case GPUIMAGE_CHROMAKEYNONBLEND: [(GPUImageChromaKeyFilter *)currentlySelectedFilter setThresholdSensitivity:_currentSliderValue]; break; case GPUIMAGE_KUWAHARA: [(GPUImageKuwaharaFilter *)currentlySelectedFilter setRadius:round(_currentSliderValue)]; break; case GPUIMAGE_VIGNETTE: [(GPUImageVignetteFilter *)currentlySelectedFilter setVignetteEnd:_currentSliderValue]; break; case GPUIMAGE_SHARPEN: [(GPUImageSharpenFilter *)currentlySelectedFilter setSharpness:_currentSliderValue]; break; case GPUIMAGE_UNSHARPMASK: [(GPUImageUnsharpMaskFilter *)currentlySelectedFilter setIntensity:_currentSliderValue]; break; case GPUIMAGE_TRANSFORM: [(GPUImageTransformFilter *)currentlySelectedFilter setAffineTransform:CGAffineTransformMakeRotation(_currentSliderValue)]; break; case GPUIMAGE_TRANSFORM3D: { CATransform3D perspectiveTransform = CATransform3DIdentity; perspectiveTransform.m34 = 0.4; perspectiveTransform.m33 = 0.4; perspectiveTransform = CATransform3DScale(perspectiveTransform, 0.75, 0.75, 0.75); perspectiveTransform = CATransform3DRotate(perspectiveTransform, _currentSliderValue, 0.0, 1.0, 0.0); [(GPUImageTransformFilter *)currentlySelectedFilter setTransform3D:perspectiveTransform]; }; break; case GPUIMAGE_CROP: [(GPUImageCropFilter *)currentlySelectedFilter setCropRegion:CGRectMake(0.0, 0.0, 1.0, _currentSliderValue)]; break; case GPUIMAGE_GAUSSIAN: [(GPUImageGaussianBlurFilter *)currentlySelectedFilter setBlurRadiusInPixels:_currentSliderValue]; break; case GPUIMAGE_BOXBLUR: [(GPUImageBoxBlurFilter *)currentlySelectedFilter setBlurRadiusInPixels:_currentSliderValue]; break; case GPUIMAGE_GAUSSIAN_SELECTIVE: [(GPUImageGaussianSelectiveBlurFilter *)currentlySelectedFilter setExcludeCircleRadius:_currentSliderValue]; break; case GPUIMAGE_GAUSSIAN_POSITION: [(GPUImageGaussianBlurPositionFilter *)currentlySelectedFilter setBlurRadius:_currentSliderValue]; break; case GPUIMAGE_BILATERAL: [(GPUImageBilateralFilter *)currentlySelectedFilter setDistanceNormalizationFactor:_currentSliderValue]; break; case GPUIMAGE_MOTIONBLUR: [(GPUImageMotionBlurFilter *)currentlySelectedFilter setBlurAngle:_currentSliderValue]; break; case GPUIMAGE_ZOOMBLUR: [(GPUImageZoomBlurFilter *)currentlySelectedFilter setBlurSize:_currentSliderValue]; break; case GPUIMAGE_SWIRL: [(GPUImageSwirlFilter *)currentlySelectedFilter setAngle:_currentSliderValue]; break; case GPUIMAGE_BULGE: [(GPUImageBulgeDistortionFilter *)currentlySelectedFilter setScale:_currentSliderValue]; break; case GPUIMAGE_PINCH: [(GPUImagePinchDistortionFilter *)currentlySelectedFilter setScale:_currentSliderValue]; break; case GPUIMAGE_SPHEREREFRACTION: [(GPUImageSphereRefractionFilter *)currentlySelectedFilter setRadius:_currentSliderValue]; break; case GPUIMAGE_GLASSSPHERE: [(GPUImageGlassSphereFilter *)currentlySelectedFilter setRadius:_currentSliderValue]; break; case GPUIMAGE_PERLINNOISE: [(GPUImagePerlinNoiseFilter *)currentlySelectedFilter setScale:_currentSliderValue]; break; case GPUIMAGE_MOSAIC: [(GPUImageMosaicFilter *)currentlySelectedFilter setDisplayTileSize:CGSizeMake(_currentSliderValue, _currentSliderValue)]; break; case GPUIMAGE_LOCALBINARYPATTERN: { CGFloat multiplier = _currentSliderValue; [(GPUImageLocalBinaryPatternFilter *)currentlySelectedFilter setTexelWidth:(multiplier / self.glView.bounds.size.width)]; [(GPUImageLocalBinaryPatternFilter *)currentlySelectedFilter setTexelHeight:(multiplier / self.glView.bounds.size.height)]; }; break; case GPUIMAGE_DISSOLVE: [(GPUImageDissolveBlendFilter *)currentlySelectedFilter setMix:_currentSliderValue]; break; case GPUIMAGE_CHROMAKEY: [(GPUImageChromaKeyBlendFilter *)currentlySelectedFilter setThresholdSensitivity:_currentSliderValue]; break; case GPUIMAGE_POISSONBLEND: [(GPUImagePoissonBlendFilter *)currentlySelectedFilter setMix:_currentSliderValue]; break; case GPUIMAGE_OPACITY: [(GPUImageOpacityFilter *)currentlySelectedFilter setOpacity:_currentSliderValue]; break; } } #pragma mark - #pragma mark NSTableView delegate methods - (int)numberOfRowsInTableView:(NSTableView *)aTableView { return GPUIMAGE_NUMFILTERS; } - (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex { NSString *tableRowTitle = nil; switch(rowIndex) { case GPUIMAGE_SATURATION: tableRowTitle = @"Saturation"; break; case GPUIMAGE_CONTRAST: tableRowTitle = @"Contrast"; break; case GPUIMAGE_BRIGHTNESS: tableRowTitle = @"Brightness"; break; case GPUIMAGE_LEVELS: tableRowTitle = @"Levels"; break; case GPUIMAGE_EXPOSURE: tableRowTitle = @"Exposure"; break; case GPUIMAGE_RGB: tableRowTitle = @"RGB"; break; case GPUIMAGE_HUE: tableRowTitle = @"Hue"; break; case GPUIMAGE_WHITEBALANCE: tableRowTitle = @"White balance"; break; case GPUIMAGE_MONOCHROME: tableRowTitle = @"Monochrome"; break; case GPUIMAGE_GRAYSCALE: tableRowTitle = @"Grayscale"; break; case GPUIMAGE_HISTOGRAM: tableRowTitle = @"Histogram"; break; case GPUIMAGE_AVERAGECOLOR: tableRowTitle = @"Average color"; break; case GPUIMAGE_LUMINOSITY: tableRowTitle = @"Average luminosity"; break; case GPUIMAGE_THRESHOLD: tableRowTitle = @"Threshold"; break; case GPUIMAGE_ADAPTIVETHRESHOLD: tableRowTitle = @"Adaptive threshold"; break; case GPUIMAGE_AVERAGELUMINANCETHRESHOLD: tableRowTitle = @"Average luminance threshold"; break; case GPUIMAGE_PIXELLATE: tableRowTitle = @"Pixellate"; break; case GPUIMAGE_POLARPIXELLATE: tableRowTitle = @"Polar pixellation"; break; case GPUIMAGE_PIXELLATE_POSITION: tableRowTitle = @"Pixellate (position)"; break; case GPUIMAGE_POLKADOT: tableRowTitle = @"Polka dot"; break; case GPUIMAGE_HALFTONE: tableRowTitle = @"Halftone"; break; case GPUIMAGE_CROSSHATCH: tableRowTitle = @"Crosshatch"; break; case GPUIMAGE_SOBELEDGEDETECTION: tableRowTitle = @"Sobel edge detection"; break; case GPUIMAGE_PREWITTEDGEDETECTION: tableRowTitle = @"Prewitt edge detection"; break; case GPUIMAGE_CANNYEDGEDETECTION: tableRowTitle = @"Canny edge detection"; break; case GPUIMAGE_THRESHOLDEDGEDETECTION: tableRowTitle = @"Threshold edge detection"; break; case GPUIMAGE_HARRISCORNERDETECTION: tableRowTitle = @"Harris corner detector"; break; case GPUIMAGE_NOBLECORNERDETECTION: tableRowTitle = @"Noble corner detector"; break; case GPUIMAGE_SHITOMASIFEATUREDETECTION: tableRowTitle = @"Shi-Tomasi feature detector"; break; case GPUIMAGE_HOUGHTRANSFORMLINEDETECTOR: tableRowTitle = @"Hough transform line detector"; break; case GPUIMAGE_BUFFER: tableRowTitle = @"Image buffer"; break; case GPUIMAGE_LOWPASS: tableRowTitle = @"Low pass"; break; case GPUIMAGE_HIGHPASS: tableRowTitle = @"High pass"; break; case GPUIMAGE_MOTIONDETECTOR: tableRowTitle = @"Motion detector"; break; case GPUIMAGE_XYGRADIENT: tableRowTitle = @"X-Y gradient"; break; case GPUIMAGE_SKETCH: tableRowTitle = @"Sketch"; break; case GPUIMAGE_THRESHOLDSKETCH: tableRowTitle = @"Threshold sketch"; break; case GPUIMAGE_TOON: tableRowTitle = @"Toon"; break; case GPUIMAGE_SMOOTHTOON: tableRowTitle = @"Smooth toon"; break; case GPUIMAGE_TILTSHIFT: tableRowTitle = @"Tilt shift"; break; case GPUIMAGE_CGA: tableRowTitle = @"CGA colorspace"; break; case GPUIMAGE_POSTERIZE: tableRowTitle = @"Posterize"; break; case GPUIMAGE_CONVOLUTION: tableRowTitle = @"3x3 convolution"; break; case GPUIMAGE_EMBOSS: tableRowTitle = @"Emboss"; break; case GPUIMAGE_LAPLACIAN: tableRowTitle = @"Laplacian (3x3)"; break; case GPUIMAGE_CHROMAKEYNONBLEND: tableRowTitle = @"Chroma key"; break; case GPUIMAGE_KUWAHARA: tableRowTitle = @"Kuwahara"; break; case GPUIMAGE_KUWAHARARADIUS3: tableRowTitle = @"Kuwahara (radius 3)"; break; case GPUIMAGE_VIGNETTE: tableRowTitle = @"Vignette"; break; case GPUIMAGE_FALSECOLOR: tableRowTitle = @"False color"; break; case GPUIMAGE_SHARPEN: tableRowTitle = @"Sharpen"; break; case GPUIMAGE_UNSHARPMASK: tableRowTitle = @"Unsharp mask"; break; case GPUIMAGE_TRANSFORM: tableRowTitle = @"Transform (2-D)"; break; case GPUIMAGE_TRANSFORM3D: tableRowTitle = @"Transform (3-D)"; break; case GPUIMAGE_CROP: tableRowTitle = @"Crop"; break; case GPUIMAGE_MASK: tableRowTitle = @"Mask"; break; case GPUIMAGE_GAMMA: tableRowTitle = @"Gamma"; break; case GPUIMAGE_TONECURVE: tableRowTitle = @"Tone curve"; break; case GPUIMAGE_HIGHLIGHTSHADOW: tableRowTitle = @"Highlights and shadows"; break; case GPUIMAGE_HAZE: tableRowTitle = @"Haze"; break; case GPUIMAGE_SEPIA: tableRowTitle = @"Sepia tone"; break; case GPUIMAGE_AMATORKA: tableRowTitle = @"Amatorka (Lookup)"; break; case GPUIMAGE_MISSETIKATE: tableRowTitle = @"Miss Etikate (Lookup)"; break; case GPUIMAGE_SOFTELEGANCE: tableRowTitle = @"Soft elegance (Lookup)"; break; case GPUIMAGE_COLORINVERT: tableRowTitle = @"Color invert"; break; case GPUIMAGE_GAUSSIAN: tableRowTitle = @"Gaussian blur"; break; case GPUIMAGE_GAUSSIAN_SELECTIVE: tableRowTitle = @"Gaussian selective blur"; break; case GPUIMAGE_GAUSSIAN_POSITION: tableRowTitle = @"Gaussian (centered)"; break; case GPUIMAGE_BOXBLUR: tableRowTitle = @"Box blur"; break; case GPUIMAGE_MEDIAN: tableRowTitle = @"Median (3x3)"; break; case GPUIMAGE_BILATERAL: tableRowTitle = @"Bilateral blur"; break; case GPUIMAGE_MOTIONBLUR: tableRowTitle = @"Motion blur"; break; case GPUIMAGE_ZOOMBLUR: tableRowTitle = @"Zoom blur"; break; case GPUIMAGE_SWIRL: tableRowTitle = @"Swirl"; break; case GPUIMAGE_BULGE: tableRowTitle = @"Bulge"; break; case GPUIMAGE_PINCH: tableRowTitle = @"Pinch"; break; case GPUIMAGE_SPHEREREFRACTION: tableRowTitle = @"Sphere refraction"; break; case GPUIMAGE_GLASSSPHERE: tableRowTitle = @"Glass sphere"; break; case GPUIMAGE_STRETCH: tableRowTitle = @"Stretch"; break; case GPUIMAGE_DILATION: tableRowTitle = @"Dilation"; break; case GPUIMAGE_EROSION: tableRowTitle = @"Erosion"; break; case GPUIMAGE_OPENING: tableRowTitle = @"Opening"; break; case GPUIMAGE_CLOSING: tableRowTitle = @"Closing"; break; case GPUIMAGE_PERLINNOISE: tableRowTitle = @"Perlin noise"; break; case GPUIMAGE_VORONOI: tableRowTitle = @"Voronoi"; break; case GPUIMAGE_MOSAIC: tableRowTitle = @"Mosaic"; break; case GPUIMAGE_LOCALBINARYPATTERN: tableRowTitle = @"Local binary pattern"; break; case GPUIMAGE_DISSOLVE: tableRowTitle = @"Dissolve blend"; break; case GPUIMAGE_CHROMAKEY: tableRowTitle = @"Chroma key blend (green)"; break; case GPUIMAGE_ADD: tableRowTitle = @"Add blend"; break; case GPUIMAGE_DIVIDE: tableRowTitle = @"Divide blend"; break; case GPUIMAGE_MULTIPLY: tableRowTitle = @"Multiply blend"; break; case GPUIMAGE_OVERLAY: tableRowTitle = @"Overlay blend"; break; case GPUIMAGE_LIGHTEN: tableRowTitle = @"Lighten blend"; break; case GPUIMAGE_DARKEN: tableRowTitle = @"Darken blend"; break; case GPUIMAGE_COLORBURN: tableRowTitle = @"Color burn blend"; break; case GPUIMAGE_COLORDODGE: tableRowTitle = @"Color dodge blend"; break; case GPUIMAGE_LINEARBURN: tableRowTitle = @"Linear burn blend"; break; case GPUIMAGE_SCREENBLEND: tableRowTitle = @"Screen blend"; break; case GPUIMAGE_DIFFERENCEBLEND: tableRowTitle = @"Difference blend"; break; case GPUIMAGE_SUBTRACTBLEND: tableRowTitle = @"Subtract blend"; break; case GPUIMAGE_EXCLUSIONBLEND: tableRowTitle = @"Exclusion blend"; break; case GPUIMAGE_HARDLIGHTBLEND: tableRowTitle = @"Hard light blend"; break; case GPUIMAGE_SOFTLIGHTBLEND: tableRowTitle = @"Soft light blend"; break; case GPUIMAGE_COLORBLEND: tableRowTitle = @"Color blend"; break; case GPUIMAGE_HUEBLEND: tableRowTitle = @"Hue blend"; break; case GPUIMAGE_SATURATIONBLEND: tableRowTitle = @"Saturation blend"; break; case GPUIMAGE_LUMINOSITYBLEND: tableRowTitle = @"Luminosity blend"; break; case GPUIMAGE_NORMALBLEND: tableRowTitle = @"Normal blend"; break; case GPUIMAGE_POISSONBLEND: tableRowTitle = @"Poisson blend"; break; case GPUIMAGE_OPACITY: tableRowTitle = @"Opacity adjustment"; break; } return tableRowTitle; } - (void)tableViewSelectionDidChange:(NSNotification *)aNotification; { NSInteger rowIndex = [[aNotification object] selectedRow]; [self changeSelectedRow:rowIndex]; } @end ================================================ FILE: examples/Mac/FilterShowcase/SLSFilterShowcaseWindowController.xib ================================================ 1080 12D78 3084 1187.37 626.00 com.apple.InterfaceBuilder.CocoaPlugin 3084 NSCustomObject NSOpenGLView NSScrollView NSScroller NSSlider NSSliderCell NSTableColumn NSTableHeaderView NSTableView NSTextFieldCell NSView NSWindowTemplate com.apple.InterfaceBuilder.CocoaPlugin PluginDependencyRecalculationVersion SLSFilterShowcaseWindowController FirstResponder NSApplication 15 2 {{196, 240}, {854, 553}} 544735232 Filter Showcase NSWindow 256 276 2304 256 {164, 495} _NS:13 YES NO YES 256 {164, 17} _NS:16 -2147483392 {{224, 0}, {16, 17}} _NS:19 159.62109375 40 1000 75497536 2048 Filter LucidaGrande 11 3100 3 MC4zMzMzMzI5ODU2AA 6 System headerTextColor 3 MAA 337641536 2048 Text Cell LucidaGrande 11 16 6 System controlBackgroundColor 3 MC42NjY2NjY2NjY3AA 6 System controlTextColor 3 YES 3 2 3 MQA 6 System gridColor 3 MC41AA 17 44040192 0 15 0 YES 0 1 {{1, 17}, {164, 495}} _NS:11 4 -2147483392 {{224, 17}, {15, 102}} _NS:58 NO _doScroller: 37 0.1947367936372757 -2147483392 {{1, 490}, {162, 16}} _NS:60 NO 1 _doScroller: 1 0.9939393939393939 2304 {{1, 0}, {164, 17}} _NS:15 4 {{20, 20}, {166, 513}} _NS:9 133682 QSAAAEEgAABBmAAAQZgAAA 0.25 4 1 274 {{194, 53}, {640, 480}} _NS:24 AAAAYAAAAAA 290 {{192, 18}, {644, 21}} _NS:9 YES -2080112384 0 _NS:9 100 0.0 50 0.0 0 1 NO NO NO {854, 553} {{0, 0}, {1440, 878}} {10000000000000, 10000000000000} NO window 3 glView 54 delegate 4 delegate 63 dataSource 64 maxValue: maximumSliderValue maxValue: maximumSliderValue maxValue maximumSliderValue 2 59 minValue: minimumSliderValue minValue: minimumSliderValue minValue minimumSliderValue 2 60 value: currentSliderValue value: currentSliderValue value currentSliderValue 2 62 enabled: enableSlider enabled: enableSlider enabled enableSlider 2 68 0 -2 File's Owner -1 First Responder -3 Application 1 2 5 6 7 8 9 10 13 24 39 40 com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin {{357, 418}, {480, 270}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin GPUImageView com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin 68 GPUImageView NSOpenGLView IBProjectSource ./Classes/GPUImageView.h SLSFilterShowcaseWindowController NSWindowController glView GPUImageView glView glView GPUImageView IBProjectSource ./Classes/SLSFilterShowcaseWindowController.h 0 IBCocoaFramework YES 3 ================================================ FILE: examples/Mac/FilterShowcaseSwift/FilterShowcaseSwift/AppDelegate.swift ================================================ import Cocoa class AppDelegate: NSObject, NSApplicationDelegate { var windowController:FilterShowcaseWindowController? func applicationDidFinishLaunching(aNotification: NSNotification) { self.windowController = FilterShowcaseWindowController(windowNibName:"FilterShowcaseWindowController") self.windowController?.showWindow(self) } func applicationWillTerminate(aNotification: NSNotification) { } } ================================================ FILE: examples/Mac/FilterShowcaseSwift/FilterShowcaseSwift/Base.lproj/MainMenu.xib ================================================ Default Left to Right Right to Left Default Left to Right Right to Left ================================================ FILE: examples/Mac/FilterShowcaseSwift/FilterShowcaseSwift/FilterShowcaseWindowController.swift ================================================ import Cocoa import GPUImage class FilterShowcaseWindowController: NSWindowController { @IBOutlet var filterView: GPUImageView! @IBOutlet weak var filterSlider: NSSlider! var enableSlider:Bool = false var minimumSliderValue:CGFloat = 0.0, maximumSliderValue:CGFloat = 1.0 var currentSliderValue:CGFloat = 0.5 { willSet(newSliderValue) { switch (currentFilterOperation!.sliderConfiguration) { case let .Enabled(_, _, _): currentFilterOperation!.updateBasedOnSliderValue(newSliderValue) case .Disabled: break } } } var currentFilterOperation: FilterOperationInterface? var videoCamera: GPUImageAVCamera? lazy var blendImage: GPUImagePicture = { let inputImage = NSImage(named:"Lambeau.jpg") return GPUImagePicture(image: inputImage) }() var currentlySelectedRow = 1 override func windowDidLoad() { super.windowDidLoad() videoCamera = GPUImageAVCamera(sessionPreset: AVCaptureSessionPreset640x480, cameraDevice:nil) self.changeSelectedRow(0) } func changeSelectedRow(row:Int) { if (currentlySelectedRow == row) { return } // Clean up everything from the previous filter selection first videoCamera!.stopCameraCapture() videoCamera!.removeAllTargets() // blendImage?.removeAllTargets() currentFilterOperation?.filter.removeAllTargets() currentFilterOperation = filterOperations[row] switch currentFilterOperation!.filterOperationType { case .SingleInput: videoCamera!.addTarget((currentFilterOperation!.filter as! GPUImageInput)) currentFilterOperation!.filter.addTarget(filterView!) case .Blend: videoCamera!.addTarget((currentFilterOperation!.filter as! GPUImageInput)) self.blendImage.addTarget((currentFilterOperation!.filter as! GPUImageInput)) currentFilterOperation!.filter.addTarget(filterView!) self.blendImage.processImage() case let .Custom(filterSetupFunction:setupFunction): let inputToFunction:(GPUImageOutput, GPUImageOutput?) = setupFunction(camera:videoCamera!, outputView:filterView!) // Type inference falls down, for now needs this hard cast currentFilterOperation!.configureCustomFilter(inputToFunction) } switch currentFilterOperation!.sliderConfiguration { case .Disabled: filterSlider.enabled = false // case let .Enabled(minimumValue, initialValue, maximumValue, filterSliderCallback): case let .Enabled(minimumValue, maximumValue, initialValue): filterSlider.minValue = Double(minimumValue) filterSlider.maxValue = Double(maximumValue) filterSlider.enabled = true currentSliderValue = CGFloat(initialValue) } videoCamera!.startCameraCapture() } // MARK: - // MARK: Table view delegate and datasource methods func numberOfRowsInTableView(aTableView:NSTableView!) -> Int { return filterOperations.count } func tableView(aTableView:NSTableView!, objectValueForTableColumn aTableColumn:NSTableColumn!, row rowIndex:Int) -> AnyObject! { let filterInList:FilterOperationInterface = filterOperations[rowIndex] return filterInList.listName } func tableViewSelectionDidChange(aNotification: NSNotification!) { if let currentTableView = aNotification.object as? NSTableView { let rowIndex = currentTableView.selectedRow self.changeSelectedRow(rowIndex) } } } ================================================ FILE: examples/Mac/FilterShowcaseSwift/FilterShowcaseSwift/FilterShowcaseWindowController.xib ================================================ ================================================ FILE: examples/Mac/FilterShowcaseSwift/FilterShowcaseSwift/Images.xcassets/AppIcon.appiconset/Contents.json ================================================ { "images" : [ { "idiom" : "mac", "size" : "16x16", "scale" : "1x" }, { "idiom" : "mac", "size" : "16x16", "scale" : "2x" }, { "idiom" : "mac", "size" : "32x32", "scale" : "1x" }, { "idiom" : "mac", "size" : "32x32", "scale" : "2x" }, { "idiom" : "mac", "size" : "128x128", "scale" : "1x" }, { "idiom" : "mac", "size" : "128x128", "scale" : "2x" }, { "idiom" : "mac", "size" : "256x256", "scale" : "1x" }, { "idiom" : "mac", "size" : "256x256", "scale" : "2x" }, { "idiom" : "mac", "size" : "512x512", "scale" : "1x" }, { "idiom" : "mac", "size" : "512x512", "scale" : "2x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: examples/Mac/FilterShowcaseSwift/FilterShowcaseSwift/Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIconFile CFBundleIdentifier com.sunsetlakesoftware.${PRODUCT_NAME:rfc1034identifier} CFBundleInfoDictionaryVersion 6.0 CFBundleName ${PRODUCT_NAME} CFBundlePackageType APPL CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion 1 LSMinimumSystemVersion ${MACOSX_DEPLOYMENT_TARGET} NSHumanReadableCopyright Copyright © 2014 Sunset Lake Software. All rights reserved. NSMainNibFile MainMenu NSPrincipalClass NSApplication ================================================ FILE: examples/Mac/FilterShowcaseSwift/FilterShowcaseSwift/main.swift ================================================ import Cocoa NSApplicationMain(Process.argc, Process.unsafeArgv) ================================================ FILE: examples/Mac/FilterShowcaseSwift/FilterShowcaseSwift.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ BC0B247E197DF612009AC707 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = BC0B247D197DF612009AC707 /* AppDelegate.swift */; }; BC0B2480197DF612009AC707 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BC0B247F197DF612009AC707 /* Images.xcassets */; }; BC0B248F197DF612009AC707 /* FilterShowcaseSwiftTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = BC0B248E197DF612009AC707 /* FilterShowcaseSwiftTests.swift */; }; BC0B24A2197DF822009AC707 /* FilterOperations.swift in Sources */ = {isa = PBXBuildFile; fileRef = BC0B24A0197DF822009AC707 /* FilterOperations.swift */; }; BC0B24A3197DF822009AC707 /* FilterOperationTypes.swift in Sources */ = {isa = PBXBuildFile; fileRef = BC0B24A1197DF822009AC707 /* FilterOperationTypes.swift */; }; BC0B24AC197E1372009AC707 /* FilterShowcaseWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BC0B24AA197E1372009AC707 /* FilterShowcaseWindowController.swift */; }; BC61173C1981EB2B006121EE /* voroni_points2.png in Resources */ = {isa = PBXBuildFile; fileRef = BC61173B1981EB2B006121EE /* voroni_points2.png */; }; BC8B7D521A9BDB5E00E234F3 /* GPUImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC0B249D197DF7F7009AC707 /* GPUImage.framework */; }; BC8B7D541A9BDB7500E234F3 /* GPUImage.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = BC0B249D197DF7F7009AC707 /* GPUImage.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; BC8B7D561A9BDD1600E234F3 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = BC0B2481197DF612009AC707 /* MainMenu.xib */; }; BC8B7D581A9BDD7C00E234F3 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = BC8B7D571A9BDD7C00E234F3 /* main.swift */; }; BC8B7D591A9BDDB400E234F3 /* FilterShowcaseWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = BC0B24AB197E1372009AC707 /* FilterShowcaseWindowController.xib */; }; BCB4C0FD197F4D8A00C373B4 /* lookup_amatorka.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB4C0F9197F4D8A00C373B4 /* lookup_amatorka.png */; }; BCB4C0FE197F4D8A00C373B4 /* lookup_miss_etikate.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB4C0FA197F4D8A00C373B4 /* lookup_miss_etikate.png */; }; BCB4C0FF197F4D8A00C373B4 /* lookup_soft_elegance_1.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB4C0FB197F4D8A00C373B4 /* lookup_soft_elegance_1.png */; }; BCB4C100197F4D8A00C373B4 /* lookup_soft_elegance_2.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB4C0FC197F4D8A00C373B4 /* lookup_soft_elegance_2.png */; }; BCEB92F719809BF900B8E840 /* Lambeau.jpg in Resources */ = {isa = PBXBuildFile; fileRef = BCEB92F619809BF900B8E840 /* Lambeau.jpg */; }; BCEB92F919809D8000B8E840 /* mask.png in Resources */ = {isa = PBXBuildFile; fileRef = BCEB92F819809D8000B8E840 /* mask.png */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ BC0B2489197DF612009AC707 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BC0B246E197DF612009AC707 /* Project object */; proxyType = 1; remoteGlobalIDString = BC0B2475197DF612009AC707; remoteInfo = FilterShowcaseSwift; }; BC0B249C197DF7F7009AC707 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BC0B2498197DF7F7009AC707 /* GPUImageMac.xcodeproj */; proxyType = 2; remoteGlobalIDString = BCA3F31C17239B6500E28AEC; remoteInfo = GPUImage; }; BC0B249E197DF804009AC707 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BC0B2498197DF7F7009AC707 /* GPUImageMac.xcodeproj */; proxyType = 1; remoteGlobalIDString = BCA3F31B17239B6500E28AEC; remoteInfo = GPUImage; }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ BC8B7D531A9BDB6900E234F3 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( BC8B7D541A9BDB7500E234F3 /* GPUImage.framework in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ BC0B2476197DF612009AC707 /* FilterShowcaseSwift.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FilterShowcaseSwift.app; sourceTree = BUILT_PRODUCTS_DIR; }; BC0B247A197DF612009AC707 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; BC0B247D197DF612009AC707 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; BC0B247F197DF612009AC707 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; BC0B2482197DF612009AC707 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; BC0B2488197DF612009AC707 /* FilterShowcaseSwiftTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = FilterShowcaseSwiftTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; BC0B248D197DF612009AC707 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; BC0B248E197DF612009AC707 /* FilterShowcaseSwiftTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FilterShowcaseSwiftTests.swift; sourceTree = ""; }; BC0B2498197DF7F7009AC707 /* GPUImageMac.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = GPUImageMac.xcodeproj; path = ../../../../framework/GPUImageMac.xcodeproj; sourceTree = ""; }; BC0B24A0197DF822009AC707 /* FilterOperations.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = FilterOperations.swift; path = ../../../iOS/FilterShowcaseSwift/FilterShowcaseSwift/FilterOperations.swift; sourceTree = ""; }; BC0B24A1197DF822009AC707 /* FilterOperationTypes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = FilterOperationTypes.swift; path = ../../../iOS/FilterShowcaseSwift/FilterShowcaseSwift/FilterOperationTypes.swift; sourceTree = ""; }; BC0B24AA197E1372009AC707 /* FilterShowcaseWindowController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FilterShowcaseWindowController.swift; sourceTree = ""; }; BC0B24AB197E1372009AC707 /* FilterShowcaseWindowController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = FilterShowcaseWindowController.xib; sourceTree = ""; }; BC61173B1981EB2B006121EE /* voroni_points2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = voroni_points2.png; path = ../../../iOS/FilterShowcase/FilterShowcase/voroni_points2.png; sourceTree = ""; }; BC8B7D571A9BDD7C00E234F3 /* main.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; BCB4C0F9197F4D8A00C373B4 /* lookup_amatorka.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = lookup_amatorka.png; path = ../../../../framework/Resources/lookup_amatorka.png; sourceTree = ""; }; BCB4C0FA197F4D8A00C373B4 /* lookup_miss_etikate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = lookup_miss_etikate.png; path = ../../../../framework/Resources/lookup_miss_etikate.png; sourceTree = ""; }; BCB4C0FB197F4D8A00C373B4 /* lookup_soft_elegance_1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = lookup_soft_elegance_1.png; path = ../../../../framework/Resources/lookup_soft_elegance_1.png; sourceTree = ""; }; BCB4C0FC197F4D8A00C373B4 /* lookup_soft_elegance_2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = lookup_soft_elegance_2.png; path = ../../../../framework/Resources/lookup_soft_elegance_2.png; sourceTree = ""; }; BCEB92F619809BF900B8E840 /* Lambeau.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; name = Lambeau.jpg; path = ../../../iOS/SimpleImageFilter/SimpleImageFilter/Lambeau.jpg; sourceTree = ""; }; BCEB92F819809D8000B8E840 /* mask.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = mask.png; path = ../../../iOS/FilterShowcase/FilterShowcase/mask.png; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ BC0B2473197DF612009AC707 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( BC8B7D521A9BDB5E00E234F3 /* GPUImage.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; BC0B2485197DF612009AC707 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ BC0B246D197DF612009AC707 = { isa = PBXGroup; children = ( BC0B2478197DF612009AC707 /* FilterShowcaseSwift */, BC0B248B197DF612009AC707 /* FilterShowcaseSwiftTests */, BC0B2477197DF612009AC707 /* Products */, ); sourceTree = ""; }; BC0B2477197DF612009AC707 /* Products */ = { isa = PBXGroup; children = ( BC0B2476197DF612009AC707 /* FilterShowcaseSwift.app */, BC0B2488197DF612009AC707 /* FilterShowcaseSwiftTests.xctest */, ); name = Products; sourceTree = ""; }; BC0B2478197DF612009AC707 /* FilterShowcaseSwift */ = { isa = PBXGroup; children = ( BC0B24A6197E1018009AC707 /* User interface */, BC0B24A5197E1004009AC707 /* Data model */, BC0B2479197DF612009AC707 /* Supporting Files */, BC0B2498197DF7F7009AC707 /* GPUImageMac.xcodeproj */, ); path = FilterShowcaseSwift; sourceTree = ""; }; BC0B2479197DF612009AC707 /* Supporting Files */ = { isa = PBXGroup; children = ( BC61173B1981EB2B006121EE /* voroni_points2.png */, BCEB92F819809D8000B8E840 /* mask.png */, BCEB92F619809BF900B8E840 /* Lambeau.jpg */, BC0B247F197DF612009AC707 /* Images.xcassets */, BCB4C0F9197F4D8A00C373B4 /* lookup_amatorka.png */, BCB4C0FA197F4D8A00C373B4 /* lookup_miss_etikate.png */, BCB4C0FB197F4D8A00C373B4 /* lookup_soft_elegance_1.png */, BCB4C0FC197F4D8A00C373B4 /* lookup_soft_elegance_2.png */, BC0B247A197DF612009AC707 /* Info.plist */, ); name = "Supporting Files"; sourceTree = ""; }; BC0B248B197DF612009AC707 /* FilterShowcaseSwiftTests */ = { isa = PBXGroup; children = ( BC0B248E197DF612009AC707 /* FilterShowcaseSwiftTests.swift */, BC0B248C197DF612009AC707 /* Supporting Files */, ); path = FilterShowcaseSwiftTests; sourceTree = ""; }; BC0B248C197DF612009AC707 /* Supporting Files */ = { isa = PBXGroup; children = ( BC0B248D197DF612009AC707 /* Info.plist */, ); name = "Supporting Files"; sourceTree = ""; }; BC0B2499197DF7F7009AC707 /* Products */ = { isa = PBXGroup; children = ( BC0B249D197DF7F7009AC707 /* GPUImage.framework */, ); name = Products; sourceTree = ""; }; BC0B24A5197E1004009AC707 /* Data model */ = { isa = PBXGroup; children = ( BC0B24A0197DF822009AC707 /* FilterOperations.swift */, BC0B24A1197DF822009AC707 /* FilterOperationTypes.swift */, ); name = "Data model"; sourceTree = ""; }; BC0B24A6197E1018009AC707 /* User interface */ = { isa = PBXGroup; children = ( BC8B7D571A9BDD7C00E234F3 /* main.swift */, BC0B2481197DF612009AC707 /* MainMenu.xib */, BC0B247D197DF612009AC707 /* AppDelegate.swift */, BC0B24AA197E1372009AC707 /* FilterShowcaseWindowController.swift */, BC0B24AB197E1372009AC707 /* FilterShowcaseWindowController.xib */, ); name = "User interface"; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ BC0B2475197DF612009AC707 /* FilterShowcaseSwift */ = { isa = PBXNativeTarget; buildConfigurationList = BC0B2492197DF612009AC707 /* Build configuration list for PBXNativeTarget "FilterShowcaseSwift" */; buildPhases = ( BC0B2472197DF612009AC707 /* Sources */, BC0B2473197DF612009AC707 /* Frameworks */, BC0B2474197DF612009AC707 /* Resources */, BC8B7D531A9BDB6900E234F3 /* CopyFiles */, ); buildRules = ( ); dependencies = ( BC0B249F197DF804009AC707 /* PBXTargetDependency */, ); name = FilterShowcaseSwift; productName = FilterShowcaseSwift; productReference = BC0B2476197DF612009AC707 /* FilterShowcaseSwift.app */; productType = "com.apple.product-type.application"; }; BC0B2487197DF612009AC707 /* FilterShowcaseSwiftTests */ = { isa = PBXNativeTarget; buildConfigurationList = BC0B2495197DF612009AC707 /* Build configuration list for PBXNativeTarget "FilterShowcaseSwiftTests" */; buildPhases = ( BC0B2484197DF612009AC707 /* Sources */, BC0B2485197DF612009AC707 /* Frameworks */, BC0B2486197DF612009AC707 /* Resources */, ); buildRules = ( ); dependencies = ( BC0B248A197DF612009AC707 /* PBXTargetDependency */, ); name = FilterShowcaseSwiftTests; productName = FilterShowcaseSwiftTests; productReference = BC0B2488197DF612009AC707 /* FilterShowcaseSwiftTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ BC0B246E197DF612009AC707 /* Project object */ = { isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0700; LastUpgradeCheck = 0600; ORGANIZATIONNAME = "Sunset Lake Software"; TargetAttributes = { BC0B2475197DF612009AC707 = { CreatedOnToolsVersion = 6.0; }; BC0B2487197DF612009AC707 = { CreatedOnToolsVersion = 6.0; TestTargetID = BC0B2475197DF612009AC707; }; }; }; buildConfigurationList = BC0B2471197DF612009AC707 /* Build configuration list for PBXProject "FilterShowcaseSwift" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); mainGroup = BC0B246D197DF612009AC707; productRefGroup = BC0B2477197DF612009AC707 /* Products */; projectDirPath = ""; projectReferences = ( { ProductGroup = BC0B2499197DF7F7009AC707 /* Products */; ProjectRef = BC0B2498197DF7F7009AC707 /* GPUImageMac.xcodeproj */; }, ); projectRoot = ""; targets = ( BC0B2475197DF612009AC707 /* FilterShowcaseSwift */, BC0B2487197DF612009AC707 /* FilterShowcaseSwiftTests */, ); }; /* End PBXProject section */ /* Begin PBXReferenceProxy section */ BC0B249D197DF7F7009AC707 /* GPUImage.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; path = GPUImage.framework; remoteRef = BC0B249C197DF7F7009AC707 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ BC0B2474197DF612009AC707 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( BC0B2480197DF612009AC707 /* Images.xcassets in Resources */, BCEB92F719809BF900B8E840 /* Lambeau.jpg in Resources */, BCEB92F919809D8000B8E840 /* mask.png in Resources */, BCB4C100197F4D8A00C373B4 /* lookup_soft_elegance_2.png in Resources */, BC8B7D591A9BDDB400E234F3 /* FilterShowcaseWindowController.xib in Resources */, BC61173C1981EB2B006121EE /* voroni_points2.png in Resources */, BCB4C0FF197F4D8A00C373B4 /* lookup_soft_elegance_1.png in Resources */, BCB4C0FD197F4D8A00C373B4 /* lookup_amatorka.png in Resources */, BCB4C0FE197F4D8A00C373B4 /* lookup_miss_etikate.png in Resources */, BC8B7D561A9BDD1600E234F3 /* MainMenu.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; BC0B2486197DF612009AC707 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ BC0B2472197DF612009AC707 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( BC0B24A2197DF822009AC707 /* FilterOperations.swift in Sources */, BC8B7D581A9BDD7C00E234F3 /* main.swift in Sources */, BC0B24A3197DF822009AC707 /* FilterOperationTypes.swift in Sources */, BC0B24AC197E1372009AC707 /* FilterShowcaseWindowController.swift in Sources */, BC0B247E197DF612009AC707 /* AppDelegate.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; BC0B2484197DF612009AC707 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( BC0B248F197DF612009AC707 /* FilterShowcaseSwiftTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ BC0B248A197DF612009AC707 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = BC0B2475197DF612009AC707 /* FilterShowcaseSwift */; targetProxy = BC0B2489197DF612009AC707 /* PBXContainerItemProxy */; }; BC0B249F197DF804009AC707 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = GPUImage; targetProxy = BC0B249E197DF804009AC707 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ BC0B2481197DF612009AC707 /* MainMenu.xib */ = { isa = PBXVariantGroup; children = ( BC0B2482197DF612009AC707 /* Base */, ); name = MainMenu.xib; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ BC0B2490197DF612009AC707 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "-"; COPY_PHASE_STRIP = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.9; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Debug; }; BC0B2491197DF612009AC707 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "-"; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.9; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; }; name = Release; }; BC0B2493197DF612009AC707 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COMBINE_HIDPI_IMAGES = YES; INFOPLIST_FILE = FilterShowcaseSwift/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; }; BC0B2494197DF612009AC707 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COMBINE_HIDPI_IMAGES = YES; INFOPLIST_FILE = FilterShowcaseSwift/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; }; BC0B2496197DF612009AC707 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/FilterShowcaseSwift.app/Contents/MacOS/FilterShowcaseSwift"; COMBINE_HIDPI_IMAGES = YES; FRAMEWORK_SEARCH_PATHS = ( "$(DEVELOPER_FRAMEWORKS_DIR)", "$(inherited)", ); GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); INFOPLIST_FILE = FilterShowcaseSwiftTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; TEST_HOST = "$(BUNDLE_LOADER)"; }; name = Debug; }; BC0B2497197DF612009AC707 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/FilterShowcaseSwift.app/Contents/MacOS/FilterShowcaseSwift"; COMBINE_HIDPI_IMAGES = YES; FRAMEWORK_SEARCH_PATHS = ( "$(DEVELOPER_FRAMEWORKS_DIR)", "$(inherited)", ); INFOPLIST_FILE = FilterShowcaseSwiftTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; TEST_HOST = "$(BUNDLE_LOADER)"; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ BC0B2471197DF612009AC707 /* Build configuration list for PBXProject "FilterShowcaseSwift" */ = { isa = XCConfigurationList; buildConfigurations = ( BC0B2490197DF612009AC707 /* Debug */, BC0B2491197DF612009AC707 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; BC0B2492197DF612009AC707 /* Build configuration list for PBXNativeTarget "FilterShowcaseSwift" */ = { isa = XCConfigurationList; buildConfigurations = ( BC0B2493197DF612009AC707 /* Debug */, BC0B2494197DF612009AC707 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; BC0B2495197DF612009AC707 /* Build configuration list for PBXNativeTarget "FilterShowcaseSwiftTests" */ = { isa = XCConfigurationList; buildConfigurations = ( BC0B2496197DF612009AC707 /* Debug */, BC0B2497197DF612009AC707 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = BC0B246E197DF612009AC707 /* Project object */; } ================================================ FILE: examples/Mac/FilterShowcaseSwift/FilterShowcaseSwiftTests/FilterShowcaseSwiftTests.swift ================================================ // // FilterShowcaseSwiftTests.swift // FilterShowcaseSwiftTests // // Created by Brad Larson on 7/21/2014. // Copyright (c) 2014 Sunset Lake Software. All rights reserved. // import Cocoa import XCTest class FilterShowcaseSwiftTests: XCTestCase { override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. super.tearDown() } func testExample() { // This is an example of a functional test case. XCTAssert(true, "Pass") } func testPerformanceExample() { // This is an example of a performance test case. self.measureBlock() { // Put the code you want to measure the time of here. } } } ================================================ FILE: examples/Mac/FilterShowcaseSwift/FilterShowcaseSwiftTests/Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier com.sunsetlakesoftware.${PRODUCT_NAME:rfc1034identifier} CFBundleInfoDictionaryVersion 6.0 CFBundleName ${PRODUCT_NAME} CFBundlePackageType BNDL CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion 1 ================================================ FILE: examples/Mac/MultiViewFilterExample/MultiViewFilterExample/MultiViewFilterExample-Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIconFile CFBundleIdentifier com.sunsetlakesoftware.${PRODUCT_NAME:rfc1034identifier} CFBundleInfoDictionaryVersion 6.0 CFBundleName ${PRODUCT_NAME} CFBundlePackageType APPL CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion 1 LSMinimumSystemVersion ${MACOSX_DEPLOYMENT_TARGET} NSHumanReadableCopyright Copyright © 2013 Sunset Lake Software LLC. All rights reserved. NSMainNibFile MainMenu NSPrincipalClass NSApplication ================================================ FILE: examples/Mac/MultiViewFilterExample/MultiViewFilterExample/MultiViewFilterExample-Prefix.pch ================================================ // // Prefix header for all source files of the 'MultiViewFilterExample' target in the 'MultiViewFilterExample' project // #ifdef __OBJC__ #import #endif ================================================ FILE: examples/Mac/MultiViewFilterExample/MultiViewFilterExample/SLSAppDelegate.h ================================================ #import #import "SLSMultiViewWindowController.h" @interface SLSAppDelegate : NSObject { SLSMultiViewWindowController *multiViewWindowController; } @property (assign) IBOutlet NSWindow *window; @end ================================================ FILE: examples/Mac/MultiViewFilterExample/MultiViewFilterExample/SLSAppDelegate.m ================================================ #import "SLSAppDelegate.h" @implementation SLSAppDelegate - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { multiViewWindowController = [[SLSMultiViewWindowController alloc] initWithWindowNibName:@"SLSMultiViewWindowController"]; [multiViewWindowController showWindow:self]; } @end ================================================ FILE: examples/Mac/MultiViewFilterExample/MultiViewFilterExample/SLSMultiViewWindowController.h ================================================ #import #import @interface SLSMultiViewWindowController : NSWindowController { GPUImageFilter *filter1, *filter2, *filter3; GPUImageAVCamera *videoCamera; } @property(readwrite) IBOutlet GPUImageView *upperLeftView, *upperRightView, *lowerLeftView, *lowerRightView; @end ================================================ FILE: examples/Mac/MultiViewFilterExample/MultiViewFilterExample/SLSMultiViewWindowController.m ================================================ #import "SLSMultiViewWindowController.h" @interface SLSMultiViewWindowController () @end @implementation SLSMultiViewWindowController @synthesize upperLeftView = _upperLeftView, upperRightView = _upperRightView, lowerLeftView = _lowerLeftView, lowerRightView = _lowerRightView; - (id)initWithWindow:(NSWindow *)window { self = [super initWithWindow:window]; if (self) { // Initialization code here. } return self; } - (void)windowDidLoad { [super windowDidLoad]; videoCamera = [[GPUImageAVCamera alloc] initWithSessionPreset:AVCaptureSessionPreset640x480 cameraDevice:nil]; filter1 = [[GPUImageFilter alloc] initWithFragmentShaderFromFile:@"Shader1"]; filter2 = [[GPUImageFilter alloc] initWithFragmentShaderFromFile:@"Shader2"]; filter3 = [[GPUImageSepiaFilter alloc] init]; [filter1 forceProcessingAtSizeRespectingAspectRatio:self.upperRightView.sizeInPixels]; [filter2 forceProcessingAtSizeRespectingAspectRatio:self.lowerLeftView.sizeInPixels]; [filter3 forceProcessingAtSizeRespectingAspectRatio:self.upperRightView.sizeInPixels]; [videoCamera addTarget:self.upperLeftView]; [videoCamera addTarget:filter1]; [filter1 addTarget:self.upperRightView]; [videoCamera addTarget:filter2]; [filter2 addTarget:self.lowerLeftView]; [videoCamera addTarget:filter3]; [filter3 addTarget:self.lowerRightView]; [videoCamera startCameraCapture]; } @end ================================================ FILE: examples/Mac/MultiViewFilterExample/MultiViewFilterExample/SLSMultiViewWindowController.xib ================================================ 1080 12D78 3084 1187.37 626.00 com.apple.InterfaceBuilder.CocoaPlugin 3084 NSCustomObject NSOpenGLView NSView NSWindowTemplate com.apple.InterfaceBuilder.CocoaPlugin PluginDependencyRecalculationVersion SLSMultiViewWindowController FirstResponder NSApplication 7 2 {{196, 240}, {688, 528}} 544735232 Multi View Example NSWindow {688, 528} {688, 528} 256 268 {{20, 268}, {320, 240}} _NS:24 AAAAYAAAAAA 268 {{348, 268}, {320, 240}} _NS:24 AAAAYAAAAAA 268 {{20, 20}, {320, 240}} _NS:24 AAAAYAAAAAA 268 {{348, 20}, {320, 240}} _NS:24 AAAAYAAAAAA {688, 528} {{0, 0}, {2560, 1418}} {688, 550} {688, 550} NO window 3 lowerLeftView 47 lowerRightView 48 upperLeftView 49 upperRightView 50 delegate 4 0 -2 File's Owner -1 First Responder -3 Application 1 2 5 16 26 36 com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin {{357, 418}, {480, 270}} GPUImageView com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin GPUImageView com.apple.InterfaceBuilder.CocoaPlugin GPUImageView com.apple.InterfaceBuilder.CocoaPlugin GPUImageView com.apple.InterfaceBuilder.CocoaPlugin 50 GPUImageView NSOpenGLView IBProjectSource ./Classes/GPUImageView.h SLSMultiViewWindowController NSWindowController GPUImageView GPUImageView GPUImageView GPUImageView lowerLeftView GPUImageView lowerRightView GPUImageView upperLeftView GPUImageView upperRightView GPUImageView IBProjectSource ./Classes/SLSMultiViewWindowController.h 0 IBCocoaFramework YES 3 ================================================ FILE: examples/Mac/MultiViewFilterExample/MultiViewFilterExample/Shader1.fsh ================================================ varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; void main() { vec3 tc = vec3(1.0, 0.0, 0.0); vec3 pixcol = texture2D(inputImageTexture, textureCoordinate).rgb; vec3 colors[3]; colors[0] = vec3(0.0, 0.0, 1.0); colors[1] = vec3(1.0, 1.0, 0.0); colors[2] = vec3(1.0, 0.0, 0.0); float lum = (pixcol.r + pixcol.g + pixcol.b) / 3.0; int ix = (lum < 0.5)? 0:1; tc = mix(colors[ix], colors[ix + 1], (lum - float(ix) * 0.5) / 0.5); gl_FragColor = vec4(tc, 1.0); } ================================================ FILE: examples/Mac/MultiViewFilterExample/MultiViewFilterExample/Shader2.fsh ================================================ varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; const vec2 sampleDivisor = vec2(0.1, 0.1); void main() { vec2 samplePos = textureCoordinate - mod(textureCoordinate, sampleDivisor); gl_FragColor = texture2D(inputImageTexture, samplePos ); } ================================================ FILE: examples/Mac/MultiViewFilterExample/MultiViewFilterExample/en.lproj/Credits.rtf ================================================ {\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;} {\colortbl;\red255\green255\blue255;} \paperw9840\paperh8400 \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural \f0\b\fs24 \cf0 Engineering: \b0 \ Some people\ \ \b Human Interface Design: \b0 \ Some other people\ \ \b Testing: \b0 \ Hopefully not nobody\ \ \b Documentation: \b0 \ Whoever\ \ \b With special thanks to: \b0 \ Mom\ } ================================================ FILE: examples/Mac/MultiViewFilterExample/MultiViewFilterExample/en.lproj/InfoPlist.strings ================================================ /* Localized versions of Info.plist keys */ ================================================ FILE: examples/Mac/MultiViewFilterExample/MultiViewFilterExample/en.lproj/MainMenu.xib ================================================ 1080 12D78 3084 1187.37 626.00 com.apple.InterfaceBuilder.CocoaPlugin 3084 NSCustomObject NSMenu NSMenuItem com.apple.InterfaceBuilder.CocoaPlugin PluginDependencyRecalculationVersion NSApplication FirstResponder NSApplication AMainMenu MultiViewFilterExample 1048576 2147483647 NSImage NSMenuCheckmark NSImage NSMenuMixedState submenuAction: MultiViewFilterExample About MultiViewFilterExample 2147483647 YES YES 1048576 2147483647 Preferences… , 1048576 2147483647 YES YES 1048576 2147483647 Services 1048576 2147483647 submenuAction: Services _NSServicesMenu YES YES 1048576 2147483647 Hide MultiViewFilterExample h 1048576 2147483647 Hide Others h 1572864 2147483647 Show All 1048576 2147483647 YES YES 1048576 2147483647 Quit MultiViewFilterExample q 1048576 2147483647 _NSAppleMenu File 1048576 2147483647 submenuAction: File New n 1048576 2147483647 Open… o 1048576 2147483647 Open Recent 1048576 2147483647 submenuAction: Open Recent Clear Menu 1048576 2147483647 _NSRecentDocumentsMenu YES YES 1048576 2147483647 Close w 1048576 2147483647 Save… s 1048576 2147483647 Revert to Saved 2147483647 YES YES 1048576 2147483647 Page Setup... P 1179648 2147483647 Print… p 1048576 2147483647 Edit 1048576 2147483647 submenuAction: Edit Undo z 1048576 2147483647 Redo Z 1179648 2147483647 YES YES 1048576 2147483647 Cut x 1048576 2147483647 Copy c 1048576 2147483647 Paste v 1048576 2147483647 Paste and Match Style V 1572864 2147483647 Delete 1048576 2147483647 Select All a 1048576 2147483647 YES YES 1048576 2147483647 Find 1048576 2147483647 submenuAction: Find Find… f 1048576 2147483647 1 Find and Replace… f 1572864 2147483647 12 Find Next g 1048576 2147483647 2 Find Previous G 1179648 2147483647 3 Use Selection for Find e 1048576 2147483647 7 Jump to Selection j 1048576 2147483647 Spelling and Grammar 1048576 2147483647 submenuAction: Spelling and Grammar Show Spelling and Grammar : 1048576 2147483647 Check Document Now ; 1048576 2147483647 YES YES 2147483647 Check Spelling While Typing 1048576 2147483647 Check Grammar With Spelling 1048576 2147483647 Correct Spelling Automatically 2147483647 Substitutions 1048576 2147483647 submenuAction: Substitutions Show Substitutions 2147483647 YES YES 2147483647 Smart Copy/Paste f 1048576 2147483647 1 Smart Quotes g 1048576 2147483647 2 Smart Dashes 2147483647 Smart Links G 1179648 2147483647 3 Text Replacement 2147483647 Transformations 2147483647 submenuAction: Transformations Make Upper Case 2147483647 Make Lower Case 2147483647 Capitalize 2147483647 Speech 1048576 2147483647 submenuAction: Speech Start Speaking 1048576 2147483647 Stop Speaking 1048576 2147483647 Format 2147483647 submenuAction: Format Font 2147483647 submenuAction: Font Show Fonts t 1048576 2147483647 Bold b 1048576 2147483647 2 Italic i 1048576 2147483647 1 Underline u 1048576 2147483647 YES YES 2147483647 Bigger + 1048576 2147483647 3 Smaller - 1048576 2147483647 4 YES YES 2147483647 Kern 2147483647 submenuAction: Kern Use Default 2147483647 Use None 2147483647 Tighten 2147483647 Loosen 2147483647 Ligatures 2147483647 submenuAction: Ligatures Use Default 2147483647 Use None 2147483647 Use All 2147483647 Baseline 2147483647 submenuAction: Baseline Use Default 2147483647 Superscript 2147483647 Subscript 2147483647 Raise 2147483647 Lower 2147483647 YES YES 2147483647 Show Colors C 1048576 2147483647 YES YES 2147483647 Copy Style c 1572864 2147483647 Paste Style v 1572864 2147483647 _NSFontMenu Text 2147483647 submenuAction: Text Align Left { 1048576 2147483647 Center | 1048576 2147483647 Justify 2147483647 Align Right } 1048576 2147483647 YES YES 2147483647 Writing Direction 2147483647 submenuAction: Writing Direction YES Paragraph 2147483647 CURlZmF1bHQ 2147483647 CUxlZnQgdG8gUmlnaHQ 2147483647 CVJpZ2h0IHRvIExlZnQ 2147483647 YES YES 2147483647 YES Selection 2147483647 CURlZmF1bHQ 2147483647 CUxlZnQgdG8gUmlnaHQ 2147483647 CVJpZ2h0IHRvIExlZnQ 2147483647 YES YES 2147483647 Show Ruler 2147483647 Copy Ruler c 1310720 2147483647 Paste Ruler v 1310720 2147483647 View 1048576 2147483647 submenuAction: View Show Toolbar t 1572864 2147483647 Customize Toolbar… 1048576 2147483647 Window 1048576 2147483647 submenuAction: Window Minimize m 1048576 2147483647 Zoom 1048576 2147483647 YES YES 1048576 2147483647 Bring All to Front 1048576 2147483647 _NSWindowsMenu Help 2147483647 submenuAction: Help MultiViewFilterExample Help ? 1048576 2147483647 _NSHelpMenu _NSMainMenu SLSAppDelegate NSFontManager terminate: 449 orderFrontStandardAboutPanel: 142 delegate 495 performMiniaturize: 37 arrangeInFront: 39 print: 86 runPageLayout: 87 clearRecentDocuments: 127 performClose: 193 toggleContinuousSpellChecking: 222 undo: 223 copy: 224 checkSpelling: 225 paste: 226 stopSpeaking: 227 cut: 228 showGuessPanel: 230 redo: 231 selectAll: 232 startSpeaking: 233 delete: 235 performZoom: 240 performFindPanelAction: 241 centerSelectionInVisibleArea: 245 toggleGrammarChecking: 347 toggleSmartInsertDelete: 355 toggleAutomaticQuoteSubstitution: 356 toggleAutomaticLinkDetection: 357 saveDocument: 362 revertDocumentToSaved: 364 runToolbarCustomizationPalette: 365 toggleToolbarShown: 366 hide: 367 hideOtherApplications: 368 unhideAllApplications: 370 newDocument: 373 openDocument: 374 raiseBaseline: 426 lowerBaseline: 427 copyFont: 428 subscript: 429 superscript: 430 tightenKerning: 431 underline: 432 orderFrontColorPanel: 433 useAllLigatures: 434 loosenKerning: 435 pasteFont: 436 unscript: 437 useStandardKerning: 438 useStandardLigatures: 439 turnOffLigatures: 440 turnOffKerning: 441 toggleAutomaticSpellingCorrection: 456 orderFrontSubstitutionsPanel: 458 toggleAutomaticDashSubstitution: 461 toggleAutomaticTextReplacement: 463 uppercaseWord: 464 capitalizeWord: 467 lowercaseWord: 468 pasteAsPlainText: 486 performFindPanelAction: 487 performFindPanelAction: 488 performFindPanelAction: 489 showHelp: 493 alignCenter: 518 pasteRuler: 519 toggleRuler: 520 alignRight: 521 copyRuler: 522 alignJustified: 523 alignLeft: 524 makeBaseWritingDirectionNatural: 525 makeBaseWritingDirectionLeftToRight: 526 makeBaseWritingDirectionRightToLeft: 527 makeTextWritingDirectionNatural: 528 makeTextWritingDirectionLeftToRight: 529 makeTextWritingDirectionRightToLeft: 530 performFindPanelAction: 535 addFontTrait: 421 addFontTrait: 422 modifyFont: 423 orderFrontFontPanel: 424 modifyFont: 425 0 -2 File's Owner -1 First Responder -3 Application 29 19 56 217 83 81 75 78 72 82 124 77 73 79 112 74 125 126 205 202 198 207 214 199 203 197 206 215 218 216 200 219 201 204 220 213 210 221 208 209 57 58 134 150 136 144 129 143 236 131 149 145 130 24 92 5 239 23 295 296 297 298 211 212 195 196 346 348 349 350 351 354 375 376 377 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 450 451 452 453 454 457 459 460 462 465 466 485 490 491 492 494 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 534 com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin 535 0 IBCocoaFramework YES 3 {11, 11} {10, 3} YES ================================================ FILE: examples/Mac/MultiViewFilterExample/MultiViewFilterExample/main.m ================================================ #import int main(int argc, char *argv[]) { return NSApplicationMain(argc, (const char **)argv); } ================================================ FILE: examples/Mac/MultiViewFilterExample/MultiViewFilterExample.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ BCB00A15172B0CC500DB804C /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB00A14172B0CC500DB804C /* Cocoa.framework */; }; BCB00A1F172B0CC500DB804C /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = BCB00A1D172B0CC500DB804C /* InfoPlist.strings */; }; BCB00A21172B0CC500DB804C /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB00A20172B0CC500DB804C /* main.m */; }; BCB00A25172B0CC500DB804C /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = BCB00A23172B0CC500DB804C /* Credits.rtf */; }; BCB00A28172B0CC500DB804C /* SLSAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB00A27172B0CC500DB804C /* SLSAppDelegate.m */; }; BCB00A2B172B0CC600DB804C /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = BCB00A29172B0CC600DB804C /* MainMenu.xib */; }; BCB00A39172B0CEF00DB804C /* GPUImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB00A36172B0CD700DB804C /* GPUImage.framework */; }; BCB00A3B172B0CFF00DB804C /* GPUImage.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = BCB00A36172B0CD700DB804C /* GPUImage.framework */; }; BCB00A3F172B0D2F00DB804C /* SLSMultiViewWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB00A3D172B0D2F00DB804C /* SLSMultiViewWindowController.m */; }; BCB00A40172B0D2F00DB804C /* SLSMultiViewWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = BCB00A3E172B0D2F00DB804C /* SLSMultiViewWindowController.xib */; }; BCB00A43172B0F2200DB804C /* Shader1.fsh in Resources */ = {isa = PBXBuildFile; fileRef = BCB00A42172B0F2200DB804C /* Shader1.fsh */; }; BCB00A45172B0F3300DB804C /* Shader2.fsh in Resources */ = {isa = PBXBuildFile; fileRef = BCB00A44172B0F3300DB804C /* Shader2.fsh */; }; BCB00A48172B105800DB804C /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB00A47172B105800DB804C /* AVFoundation.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ BCB00A35172B0CD700DB804C /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BCB00A31172B0CD700DB804C /* GPUImageMac.xcodeproj */; proxyType = 2; remoteGlobalIDString = BCA3F31C17239B6500E28AEC; remoteInfo = GPUImage; }; BCB00A37172B0CE500DB804C /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BCB00A31172B0CD700DB804C /* GPUImageMac.xcodeproj */; proxyType = 1; remoteGlobalIDString = BCA3F31B17239B6500E28AEC; remoteInfo = GPUImage; }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ BCB00A3A172B0CF400DB804C /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( BCB00A3B172B0CFF00DB804C /* GPUImage.framework in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ BCB00A11172B0CC500DB804C /* MultiViewFilterExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MultiViewFilterExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; BCB00A14172B0CC500DB804C /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; BCB00A17172B0CC500DB804C /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; BCB00A18172B0CC500DB804C /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; BCB00A19172B0CC500DB804C /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; BCB00A1C172B0CC500DB804C /* MultiViewFilterExample-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "MultiViewFilterExample-Info.plist"; sourceTree = ""; }; BCB00A1E172B0CC500DB804C /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; BCB00A20172B0CC500DB804C /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; BCB00A22172B0CC500DB804C /* MultiViewFilterExample-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MultiViewFilterExample-Prefix.pch"; sourceTree = ""; }; BCB00A24172B0CC500DB804C /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/Credits.rtf; sourceTree = ""; }; BCB00A26172B0CC500DB804C /* SLSAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SLSAppDelegate.h; sourceTree = ""; }; BCB00A27172B0CC500DB804C /* SLSAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SLSAppDelegate.m; sourceTree = ""; }; BCB00A2A172B0CC600DB804C /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = ""; }; BCB00A31172B0CD700DB804C /* GPUImageMac.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = GPUImageMac.xcodeproj; path = ../../../framework/GPUImageMac.xcodeproj; sourceTree = ""; }; BCB00A3C172B0D2F00DB804C /* SLSMultiViewWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SLSMultiViewWindowController.h; sourceTree = ""; }; BCB00A3D172B0D2F00DB804C /* SLSMultiViewWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SLSMultiViewWindowController.m; sourceTree = ""; }; BCB00A3E172B0D2F00DB804C /* SLSMultiViewWindowController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SLSMultiViewWindowController.xib; sourceTree = ""; }; BCB00A42172B0F2200DB804C /* Shader1.fsh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = Shader1.fsh; sourceTree = ""; }; BCB00A44172B0F3300DB804C /* Shader2.fsh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = Shader2.fsh; sourceTree = ""; }; BCB00A47172B105800DB804C /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ BCB00A0E172B0CC500DB804C /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( BCB00A48172B105800DB804C /* AVFoundation.framework in Frameworks */, BCB00A39172B0CEF00DB804C /* GPUImage.framework in Frameworks */, BCB00A15172B0CC500DB804C /* Cocoa.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ BCB00A08172B0CC500DB804C = { isa = PBXGroup; children = ( BCB00A47172B105800DB804C /* AVFoundation.framework */, BCB00A1A172B0CC500DB804C /* MultiViewFilterExample */, BCB00A13172B0CC500DB804C /* Frameworks */, BCB00A12172B0CC500DB804C /* Products */, ); sourceTree = ""; }; BCB00A12172B0CC500DB804C /* Products */ = { isa = PBXGroup; children = ( BCB00A11172B0CC500DB804C /* MultiViewFilterExample.app */, ); name = Products; sourceTree = ""; }; BCB00A13172B0CC500DB804C /* Frameworks */ = { isa = PBXGroup; children = ( BCB00A31172B0CD700DB804C /* GPUImageMac.xcodeproj */, BCB00A14172B0CC500DB804C /* Cocoa.framework */, BCB00A16172B0CC500DB804C /* Other Frameworks */, ); name = Frameworks; sourceTree = ""; }; BCB00A16172B0CC500DB804C /* Other Frameworks */ = { isa = PBXGroup; children = ( BCB00A17172B0CC500DB804C /* AppKit.framework */, BCB00A18172B0CC500DB804C /* CoreData.framework */, BCB00A19172B0CC500DB804C /* Foundation.framework */, ); name = "Other Frameworks"; sourceTree = ""; }; BCB00A1A172B0CC500DB804C /* MultiViewFilterExample */ = { isa = PBXGroup; children = ( BCB00A26172B0CC500DB804C /* SLSAppDelegate.h */, BCB00A27172B0CC500DB804C /* SLSAppDelegate.m */, BCB00A29172B0CC600DB804C /* MainMenu.xib */, BCB00A3C172B0D2F00DB804C /* SLSMultiViewWindowController.h */, BCB00A3D172B0D2F00DB804C /* SLSMultiViewWindowController.m */, BCB00A3E172B0D2F00DB804C /* SLSMultiViewWindowController.xib */, BCB00A1B172B0CC500DB804C /* Supporting Files */, ); path = MultiViewFilterExample; sourceTree = ""; }; BCB00A1B172B0CC500DB804C /* Supporting Files */ = { isa = PBXGroup; children = ( BCB00A1C172B0CC500DB804C /* MultiViewFilterExample-Info.plist */, BCB00A1D172B0CC500DB804C /* InfoPlist.strings */, BCB00A20172B0CC500DB804C /* main.m */, BCB00A22172B0CC500DB804C /* MultiViewFilterExample-Prefix.pch */, BCB00A23172B0CC500DB804C /* Credits.rtf */, BCB00A42172B0F2200DB804C /* Shader1.fsh */, BCB00A44172B0F3300DB804C /* Shader2.fsh */, ); name = "Supporting Files"; sourceTree = ""; }; BCB00A32172B0CD700DB804C /* Products */ = { isa = PBXGroup; children = ( BCB00A36172B0CD700DB804C /* GPUImage.framework */, ); name = Products; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ BCB00A10172B0CC500DB804C /* MultiViewFilterExample */ = { isa = PBXNativeTarget; buildConfigurationList = BCB00A2E172B0CC600DB804C /* Build configuration list for PBXNativeTarget "MultiViewFilterExample" */; buildPhases = ( BCB00A0D172B0CC500DB804C /* Sources */, BCB00A3A172B0CF400DB804C /* CopyFiles */, BCB00A0E172B0CC500DB804C /* Frameworks */, BCB00A0F172B0CC500DB804C /* Resources */, ); buildRules = ( ); dependencies = ( BCB00A38172B0CE500DB804C /* PBXTargetDependency */, ); name = MultiViewFilterExample; productName = MultiViewFilterExample; productReference = BCB00A11172B0CC500DB804C /* MultiViewFilterExample.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ BCB00A09172B0CC500DB804C /* Project object */ = { isa = PBXProject; attributes = { CLASSPREFIX = SLS; LastUpgradeCheck = 0500; ORGANIZATIONNAME = "Sunset Lake Software LLC"; }; buildConfigurationList = BCB00A0C172B0CC500DB804C /* Build configuration list for PBXProject "MultiViewFilterExample" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, ); mainGroup = BCB00A08172B0CC500DB804C; productRefGroup = BCB00A12172B0CC500DB804C /* Products */; projectDirPath = ""; projectReferences = ( { ProductGroup = BCB00A32172B0CD700DB804C /* Products */; ProjectRef = BCB00A31172B0CD700DB804C /* GPUImageMac.xcodeproj */; }, ); projectRoot = ""; targets = ( BCB00A10172B0CC500DB804C /* MultiViewFilterExample */, ); }; /* End PBXProject section */ /* Begin PBXReferenceProxy section */ BCB00A36172B0CD700DB804C /* GPUImage.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; path = GPUImage.framework; remoteRef = BCB00A35172B0CD700DB804C /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ BCB00A0F172B0CC500DB804C /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( BCB00A43172B0F2200DB804C /* Shader1.fsh in Resources */, BCB00A45172B0F3300DB804C /* Shader2.fsh in Resources */, BCB00A1F172B0CC500DB804C /* InfoPlist.strings in Resources */, BCB00A25172B0CC500DB804C /* Credits.rtf in Resources */, BCB00A2B172B0CC600DB804C /* MainMenu.xib in Resources */, BCB00A40172B0D2F00DB804C /* SLSMultiViewWindowController.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ BCB00A0D172B0CC500DB804C /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( BCB00A21172B0CC500DB804C /* main.m in Sources */, BCB00A28172B0CC500DB804C /* SLSAppDelegate.m in Sources */, BCB00A3F172B0D2F00DB804C /* SLSMultiViewWindowController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ BCB00A38172B0CE500DB804C /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = GPUImage; targetProxy = BCB00A37172B0CE500DB804C /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ BCB00A1D172B0CC500DB804C /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( BCB00A1E172B0CC500DB804C /* en */, ); name = InfoPlist.strings; sourceTree = ""; }; BCB00A23172B0CC500DB804C /* Credits.rtf */ = { isa = PBXVariantGroup; children = ( BCB00A24172B0CC500DB804C /* en */, ); name = Credits.rtf; sourceTree = ""; }; BCB00A29172B0CC600DB804C /* MainMenu.xib */ = { isa = PBXVariantGroup; children = ( BCB00A2A172B0CC600DB804C /* en */, ); name = MainMenu.xib; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ BCB00A2C172B0CC600DB804C /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.8; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; }; name = Debug; }; BCB00A2D172B0CC600DB804C /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.8; SDKROOT = macosx; }; name = Release; }; BCB00A2F172B0CC600DB804C /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { COMBINE_HIDPI_IMAGES = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "MultiViewFilterExample/MultiViewFilterExample-Prefix.pch"; INFOPLIST_FILE = "MultiViewFilterExample/MultiViewFilterExample-Info.plist"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; name = Debug; }; BCB00A30172B0CC600DB804C /* Release */ = { isa = XCBuildConfiguration; buildSettings = { COMBINE_HIDPI_IMAGES = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "MultiViewFilterExample/MultiViewFilterExample-Prefix.pch"; INFOPLIST_FILE = "MultiViewFilterExample/MultiViewFilterExample-Info.plist"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ BCB00A0C172B0CC500DB804C /* Build configuration list for PBXProject "MultiViewFilterExample" */ = { isa = XCConfigurationList; buildConfigurations = ( BCB00A2C172B0CC600DB804C /* Debug */, BCB00A2D172B0CC600DB804C /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; BCB00A2E172B0CC600DB804C /* Build configuration list for PBXNativeTarget "MultiViewFilterExample" */ = { isa = XCConfigurationList; buildConfigurations = ( BCB00A2F172B0CC600DB804C /* Debug */, BCB00A30172B0CC600DB804C /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = BCB00A09172B0CC500DB804C /* Project object */; } ================================================ FILE: examples/Mac/MultiViewFilterExample/MultiViewFilterExample.xcodeproj/xcshareddata/xcschemes/MultiViewFilterExample.xcscheme ================================================ ================================================ FILE: examples/Mac/PlaygroundExample/PlaygroundExample/GPUImagePlayground.playground/Resources/CustomFilter.fsh ================================================ varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; void main() { vec3 tc = vec3(1.0, 0.0, 0.0); vec3 pixcol = texture2D(inputImageTexture, textureCoordinate).rgb; vec3 colors[3]; colors[0] = vec3(0.0, 0.0, 1.0); colors[1] = vec3(1.0, 1.0, 0.0); colors[2] = vec3(1.0, 0.0, 0.0); float lum = (pixcol.r + pixcol.g + pixcol.b) / 3.0; int ix = (lum < 0.5)? 0:1; tc = mix(colors[ix], colors[ix + 1], (lum - float(ix) * 0.5) / 0.5); gl_FragColor = vec4(tc, 1.0); } ================================================ FILE: examples/Mac/PlaygroundExample/PlaygroundExample/GPUImagePlayground.playground/contents.xcplayground ================================================ ================================================ FILE: examples/Mac/PlaygroundExample/PlaygroundExample/GPUImagePlayground.playground/section-1.swift ================================================ import Cocoa import GPUImage let sourceImage = NSImage(named: "ChairTest.png") let filter = GPUImageSobelEdgeDetectionFilter() let outputImage = filter.imageByFilteringImage(sourceImage) let customFilter = GPUImageFilter(fragmentShaderFromFile: "CustomFilter") let outputImage2 = customFilter.imageByFilteringImage(sourceImage) ================================================ FILE: examples/Mac/PlaygroundExample/PlaygroundExample/GPUImagePlayground.playground/timeline.xctimeline ================================================ ================================================ FILE: examples/Mac/PlaygroundExample/PlaygroundExample/main.swift ================================================ import Foundation println("Hello, World!") ================================================ FILE: examples/Mac/PlaygroundExample/PlaygroundExample.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ BCF23F621995710B00877133 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = BCF23F611995710B00877133 /* main.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ BCA7F565199571B200830968 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BCF23F681995712E00877133 /* GPUImageMac.xcodeproj */; proxyType = 1; remoteGlobalIDString = BCA3F31B17239B6500E28AEC; remoteInfo = GPUImage; }; BCF23F6C1995712E00877133 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BCF23F681995712E00877133 /* GPUImageMac.xcodeproj */; proxyType = 2; remoteGlobalIDString = BCA3F31C17239B6500E28AEC; remoteInfo = GPUImage; }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ BCF23F5C1995710B00877133 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = /usr/share/man/man1/; dstSubfolderSpec = 0; files = ( ); runOnlyForDeploymentPostprocessing = 1; }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ BC191C78199A6C94000C9A4A /* ChairTest.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ChairTest.png; path = GPUImagePlayground.playground/Resources/ChairTest.png; sourceTree = ""; }; BCC31A581999BD2600DFA879 /* CustomFilter.fsh */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.glsl; name = CustomFilter.fsh; path = GPUImagePlayground.playground/Resources/CustomFilter.fsh; sourceTree = ""; }; BCF23F5E1995710B00877133 /* PlaygroundExample */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = PlaygroundExample; sourceTree = BUILT_PRODUCTS_DIR; }; BCF23F611995710B00877133 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; BCF23F681995712E00877133 /* GPUImageMac.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = GPUImageMac.xcodeproj; path = ../../../framework/GPUImageMac.xcodeproj; sourceTree = ""; }; BCF23F6E1995716700877133 /* GPUImagePlayground.playground */ = {isa = PBXFileReference; lastKnownFileType = file.playground; name = GPUImagePlayground.playground; path = PlaygroundExample/GPUImagePlayground.playground; sourceTree = SOURCE_ROOT; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ BCF23F5B1995710B00877133 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ BC191C79199A6C9B000C9A4A /* Playground Resources */ = { isa = PBXGroup; children = ( BCC31A581999BD2600DFA879 /* CustomFilter.fsh */, BC191C78199A6C94000C9A4A /* ChairTest.png */, ); name = "Playground Resources"; sourceTree = ""; }; BCF23F551995710B00877133 = { isa = PBXGroup; children = ( BCF23F601995710B00877133 /* PlaygroundExample */, BCF23F681995712E00877133 /* GPUImageMac.xcodeproj */, BCF23F5F1995710B00877133 /* Products */, ); sourceTree = ""; }; BCF23F5F1995710B00877133 /* Products */ = { isa = PBXGroup; children = ( BCF23F5E1995710B00877133 /* PlaygroundExample */, ); name = Products; sourceTree = ""; }; BCF23F601995710B00877133 /* PlaygroundExample */ = { isa = PBXGroup; children = ( BCF23F6E1995716700877133 /* GPUImagePlayground.playground */, BC191C79199A6C9B000C9A4A /* Playground Resources */, BCF23F611995710B00877133 /* main.swift */, ); path = PlaygroundExample; sourceTree = ""; }; BCF23F691995712E00877133 /* Products */ = { isa = PBXGroup; children = ( BCF23F6D1995712E00877133 /* GPUImage.framework */, ); name = Products; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ BCF23F5D1995710B00877133 /* PlaygroundExample */ = { isa = PBXNativeTarget; buildConfigurationList = BCF23F651995710B00877133 /* Build configuration list for PBXNativeTarget "PlaygroundExample" */; buildPhases = ( BCF23F5A1995710B00877133 /* Sources */, BCF23F5B1995710B00877133 /* Frameworks */, BCF23F5C1995710B00877133 /* CopyFiles */, ); buildRules = ( ); dependencies = ( BCA7F566199571B200830968 /* PBXTargetDependency */, ); name = PlaygroundExample; productName = PlaygroundExample; productReference = BCF23F5E1995710B00877133 /* PlaygroundExample */; productType = "com.apple.product-type.tool"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ BCF23F561995710B00877133 /* Project object */ = { isa = PBXProject; attributes = { LastUpgradeCheck = 0600; ORGANIZATIONNAME = "Sunset Lake Software"; TargetAttributes = { BCF23F5D1995710B00877133 = { CreatedOnToolsVersion = 6.0; }; }; }; buildConfigurationList = BCF23F591995710B00877133 /* Build configuration list for PBXProject "PlaygroundExample" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, ); mainGroup = BCF23F551995710B00877133; productRefGroup = BCF23F5F1995710B00877133 /* Products */; projectDirPath = ""; projectReferences = ( { ProductGroup = BCF23F691995712E00877133 /* Products */; ProjectRef = BCF23F681995712E00877133 /* GPUImageMac.xcodeproj */; }, ); projectRoot = ""; targets = ( BCF23F5D1995710B00877133 /* PlaygroundExample */, ); }; /* End PBXProject section */ /* Begin PBXReferenceProxy section */ BCF23F6D1995712E00877133 /* GPUImage.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; path = GPUImage.framework; remoteRef = BCF23F6C1995712E00877133 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXReferenceProxy section */ /* Begin PBXSourcesBuildPhase section */ BCF23F5A1995710B00877133 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( BCF23F621995710B00877133 /* main.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ BCA7F566199571B200830968 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = GPUImage; targetProxy = BCA7F565199571B200830968 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ BCF23F631995710B00877133 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.9; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Debug; }; BCF23F641995710B00877133 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.9; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; }; name = Release; }; BCF23F661995710B00877133 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; }; BCF23F671995710B00877133 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ BCF23F591995710B00877133 /* Build configuration list for PBXProject "PlaygroundExample" */ = { isa = XCConfigurationList; buildConfigurations = ( BCF23F631995710B00877133 /* Debug */, BCF23F641995710B00877133 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; BCF23F651995710B00877133 /* Build configuration list for PBXNativeTarget "PlaygroundExample" */ = { isa = XCConfigurationList; buildConfigurations = ( BCF23F661995710B00877133 /* Debug */, BCF23F671995710B00877133 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = BCF23F561995710B00877133 /* Project object */; } ================================================ FILE: examples/Mac/ShaderDesigner/ShaderDesigner/AppDelegate.h ================================================ #import #import "ShaderDesignerWindowController.h" @interface AppDelegate : NSObject { ShaderDesignerWindowController *windowController; } @end ================================================ FILE: examples/Mac/ShaderDesigner/ShaderDesigner/AppDelegate.m ================================================ #import "AppDelegate.h" @interface AppDelegate () @property (weak) IBOutlet NSWindow *window; @end @implementation AppDelegate - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { windowController = [[ShaderDesignerWindowController alloc] initWithWindowNibName:@"ShaderDesignerWindowController"]; [windowController showWindow:self]; } @end ================================================ FILE: examples/Mac/ShaderDesigner/ShaderDesigner/Base.lproj/MainMenu.xib ================================================ ================================================ FILE: examples/Mac/ShaderDesigner/ShaderDesigner/Images.xcassets/AppIcon.appiconset/Contents.json ================================================ { "images" : [ { "idiom" : "mac", "size" : "16x16", "scale" : "1x" }, { "idiom" : "mac", "size" : "16x16", "scale" : "2x" }, { "idiom" : "mac", "size" : "32x32", "scale" : "1x" }, { "idiom" : "mac", "size" : "32x32", "scale" : "2x" }, { "idiom" : "mac", "size" : "128x128", "scale" : "1x" }, { "idiom" : "mac", "size" : "128x128", "scale" : "2x" }, { "idiom" : "mac", "size" : "256x256", "scale" : "1x" }, { "idiom" : "mac", "size" : "256x256", "scale" : "2x" }, { "idiom" : "mac", "size" : "512x512", "scale" : "1x" }, { "idiom" : "mac", "size" : "512x512", "scale" : "2x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: examples/Mac/ShaderDesigner/ShaderDesigner/Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIconFile CFBundleIdentifier com.sunsetlakesoftware.$(PRODUCT_NAME:rfc1034identifier) CFBundleInfoDictionaryVersion 6.0 CFBundleName $(PRODUCT_NAME) CFBundlePackageType APPL CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion 1 LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) NSHumanReadableCopyright Copyright © 2015 Sunset Lake Software. All rights reserved. NSMainNibFile MainMenu NSPrincipalClass NSApplication ================================================ FILE: examples/Mac/ShaderDesigner/ShaderDesigner/ShaderDesignerWindowController.h ================================================ #import #import @interface ShaderDesignerWindowController : NSWindowController { GPUImageFilter *testFilter; GPUImageAVCamera *inputCamera; } @property(readwrite, nonatomic) NSString *vertexShader; @property(readwrite, nonatomic) NSString *fragmentShader; @property(readwrite, nonatomic) NSString *compileLog; @property (weak) IBOutlet GPUImageView *previewView; @property (weak) IBOutlet GPUImageView *shaderOutputView; @property (weak) IBOutlet NSTabView *displayTabView; @property (weak) IBOutlet NSTabViewItem *displayTabItem; @property (weak) IBOutlet NSTabViewItem *logTabItem; @property (unsafe_unretained) IBOutlet NSTextView *vertexShaderTextView; @property (unsafe_unretained) IBOutlet NSTextView *fragmentShaderTextView; - (IBAction)compile:(id)sender; - (IBAction)openVertexShader:(id)sender; - (IBAction)openFragmentShader:(id)sender; - (IBAction)saveVertexShader:(id)sender; - (IBAction)saveFragmentShader:(id)sender; @end ================================================ FILE: examples/Mac/ShaderDesigner/ShaderDesigner/ShaderDesignerWindowController.m ================================================ #import "ShaderDesignerWindowController.h" NSString *const kGPUImageInitialVertexShaderString = @"attribute vec4 position;\nattribute vec4 inputTextureCoordinate;\n\nvarying vec2 textureCoordinate;\n\nvoid main()\n{\n\tgl_Position = position;\n\ttextureCoordinate = inputTextureCoordinate.xy;\n}\n"; NSString *const kGPUImageInitialFragmentShaderString = @"varying vec2 textureCoordinate;\n\nuniform sampler2D inputImageTexture;\n\nvoid main()\n{\n\tgl_FragColor = texture2D(inputImageTexture, textureCoordinate);\n}\n"; @interface ShaderDesignerWindowController () @end @implementation ShaderDesignerWindowController - (void)windowDidLoad { [super windowDidLoad]; inputCamera = [[GPUImageAVCamera alloc] initWithSessionPreset:AVCaptureSessionPreset640x480 cameraDevice:nil]; // inputCamera.runBenchmark = YES; self.vertexShader = kGPUImageInitialVertexShaderString; self.fragmentShader = kGPUImageInitialFragmentShaderString; [inputCamera addTarget:self.previewView]; self.previewView.fillMode = kGPUImageFillModePreserveAspectRatioAndFill; [inputCamera startCameraCapture]; [self compile:self]; } - (IBAction)compile:(id)sender; { [self.window makeFirstResponder:nil]; // Test compilation first, see if it will work __block BOOL compilationFailed = NO; runSynchronouslyOnVideoProcessingQueue(^{ [GPUImageContext useImageProcessingContext]; GLProgram *filterProgram = [[GLProgram alloc] initWithVertexShaderString:self.vertexShader fragmentShaderString:self.fragmentShader]; if (!filterProgram.initialized) { if (![filterProgram link]) { compilationFailed = YES; [self.displayTabView selectTabViewItem:self.logTabItem]; self.compileLog = [NSString stringWithFormat:@"Vertex shader log:\n%@\n\nFragment shader log:\n%@\n\nProgram log:\n%@\n\n", [filterProgram programLog], [filterProgram fragmentShaderLog], [filterProgram vertexShaderLog]]; } } }); if (compilationFailed) { return; } [self.displayTabView selectTabViewItem:self.displayTabItem]; [inputCamera pauseCameraCapture]; if (testFilter != nil) { [inputCamera removeTarget:testFilter]; [testFilter removeTarget:self.shaderOutputView]; } testFilter = [[GPUImageFilter alloc] initWithVertexShaderFromString:self.vertexShader fragmentShaderFromString:self.fragmentShader]; [inputCamera addTarget:testFilter]; [testFilter addTarget:self.shaderOutputView]; [inputCamera resumeCameraCapture]; } #pragma mark - #pragma mark File loading / saving - (IBAction)openVertexShader:(id)sender; { NSOpenPanel *shaderLoadingDialog = [NSOpenPanel openPanel]; [shaderLoadingDialog setAllowedFileTypes:[NSArray arrayWithObjects:@"vsh", @"txt", nil]]; if ( [shaderLoadingDialog runModal] == NSModalResponseOK ) { NSError *error = nil; NSString *fileContents = [NSString stringWithContentsOfURL:[shaderLoadingDialog URL] encoding:NSASCIIStringEncoding error:&error]; if (fileContents == nil) { if (error == nil) { NSLog(@"Don't have an error to present for failing to save topography map"); } [NSApp presentError:error]; } else { self.vertexShader = fileContents; } } } - (IBAction)openFragmentShader:(id)sender; { NSOpenPanel *shaderLoadingDialog = [NSOpenPanel openPanel]; [shaderLoadingDialog setAllowedFileTypes:[NSArray arrayWithObjects:@"fsh", @"txt", nil]]; if ( [shaderLoadingDialog runModal] == NSModalResponseOK ) { NSError *error = nil; NSString *fileContents = [NSString stringWithContentsOfURL:[shaderLoadingDialog URL] encoding:NSASCIIStringEncoding error:&error]; if (fileContents == nil) { if (error == nil) { NSLog(@"Don't have an error to present for failing to save topography map"); } [NSApp presentError:error]; } else { self.fragmentShader = fileContents; } } } - (IBAction)saveVertexShader:(id)sender; { NSSavePanel *shaderSavingDialog = [NSSavePanel savePanel]; [shaderSavingDialog setAllowedFileTypes:[NSArray arrayWithObjects:@"vsh", @"txt", nil]]; if ( [shaderSavingDialog runModal] == NSModalResponseOK ) { NSError *error = nil; if (![self.vertexShader writeToURL:[shaderSavingDialog URL] atomically:NO encoding:NSASCIIStringEncoding error:&error]) { if (error == nil) { NSLog(@"Don't have an error to present for failing to save topography map"); } [NSApp presentError:error]; } } } - (IBAction)saveFragmentShader:(id)sender; { NSSavePanel *shaderSavingDialog = [NSSavePanel savePanel]; [shaderSavingDialog setAllowedFileTypes:[NSArray arrayWithObjects:@"fsh", @"txt", nil]]; if ( [shaderSavingDialog runModal] == NSModalResponseOK ) { NSError *error = nil; if (![self.fragmentShader writeToURL:[shaderSavingDialog URL] atomically:NO encoding:NSASCIIStringEncoding error:&error]) { if (error == nil) { NSLog(@"Don't have an error to present for failing to save topography map"); } [NSApp presentError:error]; } } } @end ================================================ FILE: examples/Mac/ShaderDesigner/ShaderDesigner/ShaderDesignerWindowController.xib ================================================ ================================================ FILE: examples/Mac/ShaderDesigner/ShaderDesigner/main.m ================================================ #import int main(int argc, const char * argv[]) { return NSApplicationMain(argc, argv); } ================================================ FILE: examples/Mac/ShaderDesigner/ShaderDesigner.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ BCD95D1E1A742B4300BC4F64 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = BCD95D1D1A742B4300BC4F64 /* AppDelegate.m */; }; BCD95D201A742B4300BC4F64 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = BCD95D1F1A742B4300BC4F64 /* main.m */; }; BCD95D221A742B4300BC4F64 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BCD95D211A742B4300BC4F64 /* Images.xcassets */; }; BCD95D251A742B4300BC4F64 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = BCD95D231A742B4300BC4F64 /* MainMenu.xib */; }; BCD95D3D1A742CFD00BC4F64 /* ShaderDesignerWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = BCD95D3B1A742CFD00BC4F64 /* ShaderDesignerWindowController.m */; }; BCD95D3E1A742CFD00BC4F64 /* ShaderDesignerWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = BCD95D3C1A742CFD00BC4F64 /* ShaderDesignerWindowController.xib */; }; BCF8E9D21A75D7A0005AE243 /* GPUImage.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = BCD95D451A7442FB00BC4F64 /* GPUImage.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ BCD95D441A7442FB00BC4F64 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BCD95D401A7442FB00BC4F64 /* GPUImageMac.xcodeproj */; proxyType = 2; remoteGlobalIDString = BCA3F31C17239B6500E28AEC; remoteInfo = GPUImage; }; BCD95D461A74430E00BC4F64 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BCD95D401A7442FB00BC4F64 /* GPUImageMac.xcodeproj */; proxyType = 1; remoteGlobalIDString = BCA3F31B17239B6500E28AEC; remoteInfo = GPUImage; }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ BCF8E9D11A75D796005AE243 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( BCF8E9D21A75D7A0005AE243 /* GPUImage.framework in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ BCD95D171A742B4300BC4F64 /* ShaderDesigner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ShaderDesigner.app; sourceTree = BUILT_PRODUCTS_DIR; }; BCD95D1B1A742B4300BC4F64 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; BCD95D1C1A742B4300BC4F64 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; BCD95D1D1A742B4300BC4F64 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; BCD95D1F1A742B4300BC4F64 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; BCD95D211A742B4300BC4F64 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; BCD95D241A742B4300BC4F64 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; BCD95D3A1A742CFD00BC4F64 /* ShaderDesignerWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShaderDesignerWindowController.h; sourceTree = ""; }; BCD95D3B1A742CFD00BC4F64 /* ShaderDesignerWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ShaderDesignerWindowController.m; sourceTree = ""; }; BCD95D3C1A742CFD00BC4F64 /* ShaderDesignerWindowController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ShaderDesignerWindowController.xib; sourceTree = ""; }; BCD95D401A7442FB00BC4F64 /* GPUImageMac.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = GPUImageMac.xcodeproj; path = ../../../../framework/GPUImageMac.xcodeproj; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ BCD95D141A742B4300BC4F64 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ BCD95D0E1A742B4300BC4F64 = { isa = PBXGroup; children = ( BCD95D191A742B4300BC4F64 /* ShaderDesigner */, BCD95D181A742B4300BC4F64 /* Products */, ); sourceTree = ""; }; BCD95D181A742B4300BC4F64 /* Products */ = { isa = PBXGroup; children = ( BCD95D171A742B4300BC4F64 /* ShaderDesigner.app */, ); name = Products; sourceTree = ""; }; BCD95D191A742B4300BC4F64 /* ShaderDesigner */ = { isa = PBXGroup; children = ( BCD95D1C1A742B4300BC4F64 /* AppDelegate.h */, BCD95D1D1A742B4300BC4F64 /* AppDelegate.m */, BCD95D231A742B4300BC4F64 /* MainMenu.xib */, BCD95D3A1A742CFD00BC4F64 /* ShaderDesignerWindowController.h */, BCD95D3B1A742CFD00BC4F64 /* ShaderDesignerWindowController.m */, BCD95D3C1A742CFD00BC4F64 /* ShaderDesignerWindowController.xib */, BCD95D211A742B4300BC4F64 /* Images.xcassets */, BCD95D401A7442FB00BC4F64 /* GPUImageMac.xcodeproj */, BCD95D1A1A742B4300BC4F64 /* Supporting Files */, ); path = ShaderDesigner; sourceTree = ""; }; BCD95D1A1A742B4300BC4F64 /* Supporting Files */ = { isa = PBXGroup; children = ( BCD95D1B1A742B4300BC4F64 /* Info.plist */, BCD95D1F1A742B4300BC4F64 /* main.m */, ); name = "Supporting Files"; sourceTree = ""; }; BCD95D411A7442FB00BC4F64 /* Products */ = { isa = PBXGroup; children = ( BCD95D451A7442FB00BC4F64 /* GPUImage.framework */, ); name = Products; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ BCD95D161A742B4300BC4F64 /* ShaderDesigner */ = { isa = PBXNativeTarget; buildConfigurationList = BCD95D341A742B4300BC4F64 /* Build configuration list for PBXNativeTarget "ShaderDesigner" */; buildPhases = ( BCD95D131A742B4300BC4F64 /* Sources */, BCD95D141A742B4300BC4F64 /* Frameworks */, BCD95D151A742B4300BC4F64 /* Resources */, BCF8E9D11A75D796005AE243 /* CopyFiles */, ); buildRules = ( ); dependencies = ( BCD95D471A74430E00BC4F64 /* PBXTargetDependency */, ); name = ShaderDesigner; productName = ShaderDesigner; productReference = BCD95D171A742B4300BC4F64 /* ShaderDesigner.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ BCD95D0F1A742B4300BC4F64 /* Project object */ = { isa = PBXProject; attributes = { LastUpgradeCheck = 0610; ORGANIZATIONNAME = "Sunset Lake Software"; TargetAttributes = { BCD95D161A742B4300BC4F64 = { CreatedOnToolsVersion = 6.1.1; }; }; }; buildConfigurationList = BCD95D121A742B4300BC4F64 /* Build configuration list for PBXProject "ShaderDesigner" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); mainGroup = BCD95D0E1A742B4300BC4F64; productRefGroup = BCD95D181A742B4300BC4F64 /* Products */; projectDirPath = ""; projectReferences = ( { ProductGroup = BCD95D411A7442FB00BC4F64 /* Products */; ProjectRef = BCD95D401A7442FB00BC4F64 /* GPUImageMac.xcodeproj */; }, ); projectRoot = ""; targets = ( BCD95D161A742B4300BC4F64 /* ShaderDesigner */, ); }; /* End PBXProject section */ /* Begin PBXReferenceProxy section */ BCD95D451A7442FB00BC4F64 /* GPUImage.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; path = GPUImage.framework; remoteRef = BCD95D441A7442FB00BC4F64 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ BCD95D151A742B4300BC4F64 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( BCD95D3E1A742CFD00BC4F64 /* ShaderDesignerWindowController.xib in Resources */, BCD95D221A742B4300BC4F64 /* Images.xcassets in Resources */, BCD95D251A742B4300BC4F64 /* MainMenu.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ BCD95D131A742B4300BC4F64 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( BCD95D3D1A742CFD00BC4F64 /* ShaderDesignerWindowController.m in Sources */, BCD95D201A742B4300BC4F64 /* main.m in Sources */, BCD95D1E1A742B4300BC4F64 /* AppDelegate.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ BCD95D471A74430E00BC4F64 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = GPUImage; targetProxy = BCD95D461A74430E00BC4F64 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ BCD95D231A742B4300BC4F64 /* MainMenu.xib */ = { isa = PBXVariantGroup; children = ( BCD95D241A742B4300BC4F64 /* Base */, ); name = MainMenu.xib; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ BCD95D321A742B4300BC4F64 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "-"; COPY_PHASE_STRIP = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.10; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; }; name = Debug; }; BCD95D331A742B4300BC4F64 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "-"; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.10; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; }; name = Release; }; BCD95D351A742B4300BC4F64 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COMBINE_HIDPI_IMAGES = YES; INFOPLIST_FILE = ShaderDesigner/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; }; BCD95D361A742B4300BC4F64 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COMBINE_HIDPI_IMAGES = YES; INFOPLIST_FILE = ShaderDesigner/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ BCD95D121A742B4300BC4F64 /* Build configuration list for PBXProject "ShaderDesigner" */ = { isa = XCConfigurationList; buildConfigurations = ( BCD95D321A742B4300BC4F64 /* Debug */, BCD95D331A742B4300BC4F64 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; BCD95D341A742B4300BC4F64 /* Build configuration list for PBXNativeTarget "ShaderDesigner" */ = { isa = XCConfigurationList; buildConfigurations = ( BCD95D351A742B4300BC4F64 /* Debug */, BCD95D361A742B4300BC4F64 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = BCD95D0F1A742B4300BC4F64 /* Project object */; } ================================================ FILE: examples/Mac/SimplePhotoFilter/SimplePhotoFilter/SLSDocument.h ================================================ #import #import @interface SLSDocument : NSDocument { GPUImagePicture *inputPicture; GPUImageFilter *imageFilter; } @property(readwrite, weak) IBOutlet GPUImageView *imageView; @property(readwrite, nonatomic) CGFloat sliderSetting; @end ================================================ FILE: examples/Mac/SimplePhotoFilter/SimplePhotoFilter/SLSDocument.m ================================================ #import "SLSDocument.h" @implementation SLSDocument @synthesize imageView = _imageView; @synthesize sliderSetting = _sliderSetting; - (id)init { self = [super init]; if (self) { // Add your subclass-specific initialization here. } return self; } - (NSString *)windowNibName { // Override returning the nib file name of the document // If you need to use a subclass of NSWindowController or if your document supports multiple NSWindowControllers, you should remove this method and override -makeWindowControllers instead. return @"SLSDocument"; } - (void)windowControllerDidLoadNib:(NSWindowController *)aController { [super windowControllerDidLoadNib:aController]; // Add any code here that needs to be executed once the windowController has loaded the document's window. NSLog(@"Did load nib"); // [inputPicture addTarget:imageFilter]; // [imageFilter addTarget:self.imageView]; // [inputPicture addTarget:self.imageView]; // [inputPicture processImage]; [inputPicture addTarget:imageFilter]; GPUImageSketchFilter *sketchFilter = [[GPUImageSketchFilter alloc] init]; [imageFilter addTarget:sketchFilter]; [sketchFilter addTarget:self.imageView]; [inputPicture processImage]; } + (BOOL)autosavesInPlace { return YES; } - (NSData *)dataOfType:(NSString *)typeName error:(NSError **)outError { // Insert code here to write your document to data of the specified type. If outError != NULL, ensure that you create and set an appropriate error when returning nil. // You can also choose to override -fileWrapperOfType:error:, -writeToURL:ofType:error:, or -writeToURL:ofType:forSaveOperation:originalContentsURL:error: instead. NSException *exception = [NSException exceptionWithName:@"UnimplementedMethod" reason:[NSString stringWithFormat:@"%@ is unimplemented", NSStringFromSelector(_cmd)] userInfo:nil]; @throw exception; return nil; } - (BOOL)readFromData:(NSData *)data ofType:(NSString *)typeName error:(NSError **)outError { // Take in image from data, read that into NSImage // Start up a GPUImagePicture with that data NSImage *sourceImage = [[NSImage alloc] initWithData:data]; inputPicture = [[GPUImagePicture alloc] initWithImage:sourceImage]; imageFilter = [[GPUImageBrightnessFilter alloc] init]; NSLog(@"Set up filters"); return YES; } #pragma mark - #pragma mark Accessors - (void)setSliderSetting:(CGFloat)newValue; { _sliderSetting = newValue; [(GPUImageBrightnessFilter *)imageFilter setBrightness:_sliderSetting]; [inputPicture processImage]; } @end ================================================ FILE: examples/Mac/SimplePhotoFilter/SimplePhotoFilter/SimplePhotoFilter-Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleDocumentTypes CFBundleTypeExtensions jpg CFBundleTypeIconFile CFBundleTypeName JPEG CFBundleTypeOSTypes ???? CFBundleTypeRole Editor NSDocumentClass SLSDocument CFBundleTypeExtensions png CFBundleTypeName PNG CFBundleTypeRole Editor NSDocumentClass SLSDocument CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIconFile CFBundleIdentifier com.sunsetlakesoftware.${PRODUCT_NAME:rfc1034identifier} CFBundleInfoDictionaryVersion 6.0 CFBundleName ${PRODUCT_NAME} CFBundlePackageType APPL CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion 1 LSMinimumSystemVersion ${MACOSX_DEPLOYMENT_TARGET} NSHumanReadableCopyright Copyright © 2013 Sunset Lake Software LLC. All rights reserved. NSMainNibFile MainMenu NSPrincipalClass NSApplication ================================================ FILE: examples/Mac/SimplePhotoFilter/SimplePhotoFilter/SimplePhotoFilter-Prefix.pch ================================================ // // Prefix header for all source files of the 'SimplePhotoFilter' target in the 'SimplePhotoFilter' project // #ifdef __OBJC__ #import #endif ================================================ FILE: examples/Mac/SimplePhotoFilter/SimplePhotoFilter/en.lproj/Credits.rtf ================================================ {\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;} {\colortbl;\red255\green255\blue255;} \paperw9840\paperh8400 \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural \f0\b\fs24 \cf0 Engineering: \b0 \ Some people\ \ \b Human Interface Design: \b0 \ Some other people\ \ \b Testing: \b0 \ Hopefully not nobody\ \ \b Documentation: \b0 \ Whoever\ \ \b With special thanks to: \b0 \ Mom\ } ================================================ FILE: examples/Mac/SimplePhotoFilter/SimplePhotoFilter/en.lproj/InfoPlist.strings ================================================ /* Localized versions of Info.plist keys */ ================================================ FILE: examples/Mac/SimplePhotoFilter/SimplePhotoFilter/en.lproj/MainMenu.xib ================================================ 1080 11D50 2457 1138.32 568.00 com.apple.InterfaceBuilder.CocoaPlugin 2457 NSMenu NSMenuItem NSCustomObject com.apple.InterfaceBuilder.CocoaPlugin PluginDependencyRecalculationVersion NSApplication FirstResponder NSApplication AMainMenu SimplePhotoFilter 1048576 2147483647 NSImage NSMenuCheckmark NSImage NSMenuMixedState submenuAction: SimplePhotoFilter About SimplePhotoFilter 2147483647 YES YES 1048576 2147483647 Preferences… , 1048576 2147483647 YES YES 1048576 2147483647 Services 1048576 2147483647 submenuAction: Services _NSServicesMenu YES YES 1048576 2147483647 Hide SimplePhotoFilter h 1048576 2147483647 Hide Others h 1572864 2147483647 Show All 1048576 2147483647 YES YES 1048576 2147483647 Quit SimplePhotoFilter q 1048576 2147483647 _NSAppleMenu File 1048576 2147483647 submenuAction: File New n 1048576 2147483647 Open… o 1048576 2147483647 Open Recent 1048576 2147483647 submenuAction: Open Recent Clear Menu 1048576 2147483647 _NSRecentDocumentsMenu YES YES 1048576 2147483647 Close w 1048576 2147483647 Save… s 1048576 2147483647 Revert to Saved 2147483647 YES YES 1048576 2147483647 Page Setup... P 1179648 2147483647 Print… p 1048576 2147483647 Edit 1048576 2147483647 submenuAction: Edit Undo z 1048576 2147483647 Redo Z 1179648 2147483647 YES YES 1048576 2147483647 Cut x 1048576 2147483647 Copy c 1048576 2147483647 Paste v 1048576 2147483647 Paste and Match Style V 1572864 2147483647 Delete 1048576 2147483647 Select All a 1048576 2147483647 YES YES 1048576 2147483647 Find 1048576 2147483647 submenuAction: Find Find… f 1048576 2147483647 1 Find and Replace… f 1572864 2147483647 12 Find Next g 1048576 2147483647 2 Find Previous G 1179648 2147483647 3 Use Selection for Find e 1048576 2147483647 7 Jump to Selection j 1048576 2147483647 Spelling and Grammar 1048576 2147483647 submenuAction: Spelling and Grammar Show Spelling and Grammar : 1048576 2147483647 Check Document Now ; 1048576 2147483647 YES YES 2147483647 Check Spelling While Typing 1048576 2147483647 Check Grammar With Spelling 1048576 2147483647 Correct Spelling Automatically 2147483647 Substitutions 1048576 2147483647 submenuAction: Substitutions Show Substitutions 2147483647 YES YES 2147483647 Smart Copy/Paste f 1048576 2147483647 1 Smart Quotes g 1048576 2147483647 2 Smart Dashes 2147483647 Smart Links G 1179648 2147483647 3 Text Replacement 2147483647 Transformations 2147483647 submenuAction: Transformations Make Upper Case 2147483647 Make Lower Case 2147483647 Capitalize 2147483647 Speech 1048576 2147483647 submenuAction: Speech Start Speaking 1048576 2147483647 Stop Speaking 1048576 2147483647 Format 2147483647 submenuAction: Format Font 2147483647 submenuAction: Font Show Fonts t 1048576 2147483647 Bold b 1048576 2147483647 2 Italic i 1048576 2147483647 1 Underline u 1048576 2147483647 YES YES 2147483647 Bigger + 1048576 2147483647 3 Smaller - 1048576 2147483647 4 YES YES 2147483647 Kern 2147483647 submenuAction: Kern Use Default 2147483647 Use None 2147483647 Tighten 2147483647 Loosen 2147483647 Ligatures 2147483647 submenuAction: Ligatures Use Default 2147483647 Use None 2147483647 Use All 2147483647 Baseline 2147483647 submenuAction: Baseline Use Default 2147483647 Superscript 2147483647 Subscript 2147483647 Raise 2147483647 Lower 2147483647 YES YES 2147483647 Show Colors C 1048576 2147483647 YES YES 2147483647 Copy Style c 1572864 2147483647 Paste Style v 1572864 2147483647 _NSFontMenu Text 2147483647 submenuAction: Text Align Left { 1048576 2147483647 Center | 1048576 2147483647 Justify 2147483647 Align Right } 1048576 2147483647 YES YES 2147483647 Writing Direction 2147483647 submenuAction: Writing Direction YES Paragraph 2147483647 CURlZmF1bHQ 2147483647 CUxlZnQgdG8gUmlnaHQ 2147483647 CVJpZ2h0IHRvIExlZnQ 2147483647 YES YES 2147483647 YES Selection 2147483647 CURlZmF1bHQ 2147483647 CUxlZnQgdG8gUmlnaHQ 2147483647 CVJpZ2h0IHRvIExlZnQ 2147483647 YES YES 2147483647 Show Ruler 2147483647 Copy Ruler c 1310720 2147483647 Paste Ruler v 1310720 2147483647 View 1048576 2147483647 submenuAction: View Show Toolbar t 1572864 2147483647 Customize Toolbar… 1048576 2147483647 Window 1048576 2147483647 submenuAction: Window Minimize m 1048576 2147483647 Zoom 1048576 2147483647 YES YES 1048576 2147483647 Bring All to Front 1048576 2147483647 _NSWindowsMenu Help 2147483647 submenuAction: Help SimplePhotoFilter Help ? 1048576 2147483647 _NSHelpMenu _NSMainMenu NSFontManager terminate: 448 orderFrontStandardAboutPanel: 142 performMiniaturize: 37 arrangeInFront: 39 runPageLayout: 87 clearRecentDocuments: 127 performClose: 193 toggleContinuousSpellChecking: 222 undo: 223 copy: 224 checkSpelling: 225 paste: 226 stopSpeaking: 227 cut: 228 showGuessPanel: 230 redo: 231 selectAll: 232 startSpeaking: 233 delete: 235 performZoom: 240 performFindPanelAction: 241 centerSelectionInVisibleArea: 245 toggleGrammarChecking: 347 toggleSmartInsertDelete: 355 toggleAutomaticQuoteSubstitution: 356 toggleAutomaticLinkDetection: 357 saveDocument: 362 revertDocumentToSaved: 364 runToolbarCustomizationPalette: 365 toggleToolbarShown: 366 hide: 367 hideOtherApplications: 368 unhideAllApplications: 370 newDocument: 371 openDocument: 372 printDocument: 373 raiseBaseline: 425 lowerBaseline: 426 copyFont: 427 subscript: 428 superscript: 429 tightenKerning: 430 underline: 431 orderFrontColorPanel: 432 useAllLigatures: 433 loosenKerning: 434 pasteFont: 435 unscript: 436 useStandardKerning: 437 useStandardLigatures: 438 turnOffLigatures: 439 turnOffKerning: 440 capitalizeWord: 454 lowercaseWord: 455 uppercaseWord: 456 toggleAutomaticDashSubstitution: 460 orderFrontSubstitutionsPanel: 461 toggleAutomaticTextReplacement: 463 toggleAutomaticSpellingCorrection: 466 performFindPanelAction: 467 performFindPanelAction: 468 performFindPanelAction: 469 pasteAsPlainText: 471 showHelp: 494 alignCenter: 517 pasteRuler: 518 toggleRuler: 519 alignRight: 520 copyRuler: 521 alignJustified: 522 alignLeft: 523 makeBaseWritingDirectionNatural: 524 makeBaseWritingDirectionLeftToRight: 525 makeBaseWritingDirectionRightToLeft: 526 makeTextWritingDirectionNatural: 527 makeTextWritingDirectionLeftToRight: 528 makeTextWritingDirectionRightToLeft: 529 performFindPanelAction: 533 addFontTrait: 420 addFontTrait: 421 modifyFont: 422 orderFrontFontPanel: 423 modifyFont: 424 0 -2 File's Owner -1 First Responder -3 Application 29 19 56 217 83 81 75 78 72 82 124 77 73 79 112 74 125 126 205 202 198 207 214 199 203 197 206 215 218 216 200 219 201 204 220 213 210 221 208 209 57 58 134 150 136 144 129 143 236 131 149 145 130 24 92 5 239 23 295 296 297 298 211 212 195 196 346 348 349 350 351 354 374 375 376 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 449 450 451 452 453 457 458 459 462 464 465 470 491 492 493 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 532 com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin 533 ABAppCardController NSWindowController id id id id id id id id addCardViewField: id copy: id cut: id doDelete: id find: id paste: id saveChanges: id toggleCardEditingMode: id ABCardView NSButton NSManagedObjectContext NSSearchField NSTextField NSWindow mCardView ABCardView mEditButton NSButton mManagedObjectContext NSManagedObjectContext mSearchField NSSearchField mStatusTextField NSTextField mWindow NSWindow IBProjectSource ./Classes/ABAppCardController.h ABCardView NSView id id commitAndSave: id statusImageClicked: id NSObjectController NSImageView NSView ABNameFrameView NSView NSImage ABImageView mBindingsController NSObjectController mBuddyStatusImage NSImageView mHeaderView NSView mNameView ABNameFrameView mNextKeyView NSView mUserImage NSImage mUserImageView ABImageView IBProjectSource ./Classes/ABCardView.h ABImageView NSImageView id id id id copy: id cut: id delete: id paste: id IBProjectSource ./Classes/ABImageView.h DVTBorderedView DVTLayoutView_ML contentView NSView contentView contentView NSView IBProjectSource ./Classes/DVTBorderedView.h DVTDelayedMenuButton NSButton IBProjectSource ./Classes/DVTDelayedMenuButton.h DVTGradientImageButton NSButton IBProjectSource ./Classes/DVTGradientImageButton.h DVTImageAndTextCell NSTextFieldCell IBProjectSource ./Classes/DVTImageAndTextCell.h DVTImageAndTextColumn NSTableColumn IBProjectSource ./Classes/DVTImageAndTextColumn.h DVTLayoutView_ML NSView IBProjectSource ./Classes/DVTLayoutView_ML.h DVTOutlineView NSOutlineView IBProjectSource ./Classes/DVTOutlineView.h DVTSplitView NSSplitView IBProjectSource ./Classes/DVTSplitView.h DVTStackView_ML DVTLayoutView_ML IBProjectSource ./Classes/DVTStackView_ML.h DVTTableView NSTableView IBProjectSource ./Classes/DVTTableView.h DVTViewController NSViewController IBProjectSource ./Classes/DVTViewController.h FirstResponder duplicateDocument: id duplicateDocument: duplicateDocument: id IBUserSource HFController NSObject selectAll: id selectAll: selectAll: id IBProjectSource ./Classes/HFController.h HFRepresenterTextView NSView selectAll: id selectAll: selectAll: id IBProjectSource ./Classes/HFRepresenterTextView.h IBEditor NSObject id id id id id changeFont: id performCopy: id performCut: id selectAll: id sizeSelectionToFit: id IBProjectSource ./Classes/IBEditor.h IDECapsuleListView DVTStackView_ML dataSource id dataSource dataSource id IBProjectSource ./Classes/IDECapsuleListView.h IDEDMArrayController NSArrayController IBProjectSource ./Classes/IDEDMArrayController.h IDEDMEditor IDEEditor DVTBorderedView NSView IDEDMEditorSourceListController DVTSplitView bottomToolbarBorderView DVTBorderedView sourceListSplitViewPane NSView sourceListViewController IDEDMEditorSourceListController splitView DVTSplitView IBProjectSource ./Classes/IDEDMEditor.h IDEDMEditorController IDEViewController IBProjectSource ./Classes/IDEDMEditorController.h IDEDMEditorSourceListController IDEDMEditorController DVTBorderedView IDEDMEditor DVTImageAndTextColumn DVTOutlineView NSTreeController borderedView DVTBorderedView parentEditor IDEDMEditor primaryColumn DVTImageAndTextColumn sourceListOutlineView DVTOutlineView sourceListTreeController NSTreeController IBProjectSource ./Classes/IDEDMEditorSourceListController.h IDEDMHighlightImageAndTextCell DVTImageAndTextCell IBProjectSource ./Classes/IDEDMHighlightImageAndTextCell.h IDEDataModelBrowserEditor IDEDMEditorController IDEDataModelPropertiesTableController IDECapsuleListView NSArrayController IDEDataModelPropertiesTableController IDEDataModelEntityContentsEditor IDEDataModelPropertiesTableController attributesTableViewController IDEDataModelPropertiesTableController capsuleView IDECapsuleListView entityArrayController NSArrayController fetchedPropertiesTableViewController IDEDataModelPropertiesTableController parentEditor IDEDataModelEntityContentsEditor relationshipsTableViewController IDEDataModelPropertiesTableController IBProjectSource ./Classes/IDEDataModelBrowserEditor.h IDEDataModelConfigurationEditor IDEDMEditorController IDECapsuleListView IDEDataModelEditor IDEDataModelConfigurationTableController capsuleListView IDECapsuleListView parentEditor IDEDataModelEditor tableController IDEDataModelConfigurationTableController IBProjectSource ./Classes/IDEDataModelConfigurationEditor.h IDEDataModelConfigurationTableController IDEDMEditorController NSArrayController NSArrayController IDEDataModelConfigurationEditor XDTableView configurationsArrayController NSArrayController entitiesArrayController NSArrayController parentEditor IDEDataModelConfigurationEditor tableView XDTableView IBProjectSource ./Classes/IDEDataModelConfigurationTableController.h IDEDataModelDiagramEditor IDEDMEditorController XDDiagramView IDEDataModelEntityContentsEditor diagramView XDDiagramView parentEditor IDEDataModelEntityContentsEditor IBProjectSource ./Classes/IDEDataModelDiagramEditor.h IDEDataModelEditor IDEDMEditor DVTDelayedMenuButton DVTDelayedMenuButton NSSegmentedControl IDEDataModelConfigurationEditor IDEDataModelEntityContentsEditor IDEDataModelFetchRequestEditor NSSegmentedControl NSTabView addEntityButton DVTDelayedMenuButton addPropertyButton DVTDelayedMenuButton browserDiagramSegmentControl NSSegmentedControl configurationViewController IDEDataModelConfigurationEditor entityContentsViewController IDEDataModelEntityContentsEditor fetchRequestViewController IDEDataModelFetchRequestEditor hierarchySegmentControl NSSegmentedControl tabView NSTabView IBProjectSource ./Classes/IDEDataModelEditor.h IDEDataModelEntityContentsEditor IDEDMEditorController IDEDataModelBrowserEditor IDEDataModelDiagramEditor IDEDataModelEditor NSTabView browserViewController IDEDataModelBrowserEditor diagramViewController IDEDataModelDiagramEditor parentEditor IDEDataModelEditor tabView NSTabView IBProjectSource ./Classes/IDEDataModelEntityContentsEditor.h IDEDataModelFetchRequestEditor IDEDMEditorController NSArrayController IDEDataModelEditor IDECapsuleListView entityController NSArrayController parentEditor IDEDataModelEditor tableView IDECapsuleListView IBProjectSource ./Classes/IDEDataModelFetchRequestEditor.h IDEDataModelPropertiesTableController IDEDMEditorController IDEDMArrayController NSTableColumn NSArrayController IDEDataModelBrowserEditor IDEDMHighlightImageAndTextCell XDTableView arrayController IDEDMArrayController entitiesColumn NSTableColumn entityArrayController NSArrayController parentEditor IDEDataModelBrowserEditor propertyNameAndImageCell IDEDMHighlightImageAndTextCell tableView XDTableView IBProjectSource ./Classes/IDEDataModelPropertiesTableController.h IDEDocDownloadsTableViewController NSObject NSButtonCell DVTTableView IDEDocViewingPrefPaneController _downloadButtonCell NSButtonCell _tableView DVTTableView prefPaneController IDEDocViewingPrefPaneController IBProjectSource ./Classes/IDEDocDownloadsTableViewController.h IDEDocViewingPrefPaneController IDEViewController id id id id id id id id id id id addSubscription: id checkForAndInstallUpdatesNow: id deleteDocSet: id downloadAction: id minimumFontSizeComboBoxAction: id minimumFontSizeEnabledAction: id showHelp: id showSubscriptionSheet: id subscriptionCancelAction: id toggleAutoCheckForAndInstallUpdates: id toggleDocSetInfo: id DVTGradientImageButton DVTGradientImageButton DVTGradientImageButton NSSplitView NSView NSView DVTBorderedView DVTBorderedView NSButton NSTextView IDEDocDownloadsTableViewController NSComboBox NSTextField NSButton NSTextField NSWindow NSButton _addButton DVTGradientImageButton _deleteButton DVTGradientImageButton _showInfoAreaButton DVTGradientImageButton _splitView NSSplitView _splitViewDocSetInfoSubview NSView _splitViewDocSetsListSubview NSView borderedViewAroundSplitView DVTBorderedView borderedViewBelowTable DVTBorderedView checkAndInstallNowButton NSButton docSetInfoTextView NSTextView downloadsTableViewController IDEDocDownloadsTableViewController minimumFontSizeControl NSComboBox noUpdatesAvailableMessage NSTextField showInfoButton NSButton subscriptionTextField NSTextField subscriptionWindow NSWindow validateAddSubscriptionButton NSButton IBProjectSource ./Classes/IDEDocViewingPrefPaneController.h IDEEditor IDEViewController IBProjectSource ./Classes/IDEEditor.h IDEViewController DVTViewController IBProjectSource ./Classes/IDEViewController.h IKImageView id id id id copy: id crop: id cut: id paste: id IBProjectSource ./Classes/IKImageView.h NSDocument id id id id id id printDocument: id revertDocumentToSaved: id runPageLayout: id saveDocument: id saveDocumentAs: id saveDocumentTo: id IBProjectSource ./Classes/NSDocument.h NSDocumentController _openRecentDocument: id _openRecentDocument: _openRecentDocument: id IBProjectSource ./Classes/NSDocumentController.h NSResponder _insertFindPattern: id _insertFindPattern: _insertFindPattern: id IBProjectSource ./Classes/NSResponder.h QLPreviewBubble NSObject id id hide: id show: id parentWindow NSWindow parentWindow parentWindow NSWindow IBProjectSource ./Classes/QLPreviewBubble.h QTMovieView id id id id id showAll: id showCustomButton: id toggleLoops: id zoomIn: id zoomOut: id IBProjectSource ./Classes/QTMovieView.h WebView id id id id reloadFromOrigin: id resetPageZoom: id zoomPageIn: id zoomPageOut: id IBProjectSource ./Classes/WebView.h XDDiagramView NSView id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id _graphLayouterMenuItemAction: id _zoomPopUpButtonAction: id alignBottomEdges: id alignCentersHorizontallyInContainer: id alignCentersVerticallyInContainer: id alignHorizontalCenters: id alignLeftEdges: id alignRightEdges: id alignTopEdges: id alignVerticalCenters: id bringToFront: id collapseAllCompartments: id copy: id cut: id delete: id deleteBackward: id deleteForward: id deselectAll: id diagramZoomIn: id diagramZoomOut: id expandAllCompartments: id flipHorizontally: id flipVertically: id layoutGraphicsConcentrically: id layoutGraphicsHierarchically: id lock: id makeSameHeight: id makeSameWidth: id moveDown: id moveDownAndModifySelection: id moveLeft: id moveLeftAndModifySelection: id moveRight: id moveRightAndModifySelection: id moveUp: id moveUpAndModifySelection: id paste: id rollDownAllCompartments: id rollUpAllCompartments: id selectAll: id sendToBack: id sizeToFit: id toggleGridShown: id toggleHiddenGraphicsShown: id togglePageBreaksShown: id toggleRuler: id toggleSnapsToGrid: id unlock: id _diagramController IDEDataModelDiagramEditor _diagramController _diagramController IDEDataModelDiagramEditor IBProjectSource ./Classes/XDDiagramView.h XDTableView NSTableView showAllTableColumns: id showAllTableColumns: showAllTableColumns: id IBProjectSource ./Classes/XDTableView.h 0 IBCocoaFramework YES 3 {11, 11} {10, 3} YES ================================================ FILE: examples/Mac/SimplePhotoFilter/SimplePhotoFilter/en.lproj/SLSDocument.xib ================================================ 1070 13A598 4514 1265 695.00 com.apple.InterfaceBuilder.CocoaPlugin 4514 IBNSLayoutConstraint NSCustomObject NSOpenGLView NSSlider NSSliderCell NSView NSWindowTemplate com.apple.InterfaceBuilder.CocoaPlugin PluginDependencyRecalculationVersion SLSDocument FirstResponder 15 2 {{133, 235}, {507, 413}} 1618477056 Window NSWindow View {94, 86} 256 268 {{0, 54}, {507, 359}} _NS:24 AAAAYAAAAAA 268 {{18, 18}, {471, 21}} _NS:9 YES -2080112384 0 _NS:9 1 -1 0.0 0.0 0 1 NO NO NO {507, 413} {{0, 0}, {2560, 1418}} {94, 108} {10000000000000, 10000000000000} YES NSApplication window 18 imageView 100050 delegate 17 value: sliderSetting value: sliderSetting value sliderSetting 2 100049 0 -2 File's Owner -1 First Responder 5 Window 6 6 0 6 1 20 1000 0 29 3 NO 5 0 5 1 20 1000 0 29 3 NO 4 0 4 1 20 1000 0 29 3 NO 4 0 4 1 54 1000 3 9 3 NO 6 0 6 1 0.0 1000 0 29 3 NO 3 0 3 1 0.0 1000 0 29 3 NO 5 0 5 1 0.0 1000 0 29 3 NO -3 Application 100027 100033 100035 100036 100038 100039 100041 100043 100045 100047 com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin GPUImageView com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin {{133, 170}, {507, 413}} com.apple.InterfaceBuilder.CocoaPlugin 100050 GPUImageView NSOpenGLView IBProjectSource ./Classes/GPUImageView.h NSDocument id id id id id id id id id id id id id id browseDocumentVersions: id duplicateDocument: id lockDocument: id moveDocument: id moveDocumentToUbiquityContainer: id printDocument: id renameDocument: id revertDocumentToSaved: id runPageLayout: id saveDocument: id saveDocumentAs: id saveDocumentTo: id saveDocumentToPDF: id unlockDocument: id IBProjectSource ./Classes/NSDocument.h NSLayoutConstraint NSObject IBProjectSource ./Classes/NSLayoutConstraint.h SLSDocument NSDocument imageView GPUImageView imageView imageView GPUImageView IBProjectSource ./Classes/SLSDocument.h 0 IBCocoaFramework YES com.apple.InterfaceBuilder.CocoaPlugin.macosx com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 YES 3 YES ================================================ FILE: examples/Mac/SimplePhotoFilter/SimplePhotoFilter/main.m ================================================ // // main.m // SimplePhotoFilter // // Created by Brad Larson on 4/20/2013. // Copyright (c) 2013 Sunset Lake Software LLC. All rights reserved. // #import int main(int argc, char *argv[]) { return NSApplicationMain(argc, (const char **)argv); } ================================================ FILE: examples/Mac/SimplePhotoFilter/SimplePhotoFilter.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ BCA3F3411723A2E800E28AEC /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCA3F3401723A2E800E28AEC /* Cocoa.framework */; }; BCA3F34D1723A2E800E28AEC /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = BCA3F34C1723A2E800E28AEC /* main.m */; }; BCA3F3511723A2E800E28AEC /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = BCA3F34F1723A2E800E28AEC /* Credits.rtf */; }; BCA3F3541723A2E800E28AEC /* SLSDocument.m in Sources */ = {isa = PBXBuildFile; fileRef = BCA3F3531723A2E800E28AEC /* SLSDocument.m */; }; BCA3F3571723A2E800E28AEC /* SLSDocument.xib in Resources */ = {isa = PBXBuildFile; fileRef = BCA3F3551723A2E800E28AEC /* SLSDocument.xib */; }; BCA3F35A1723A2E800E28AEC /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = BCA3F3581723A2E800E28AEC /* MainMenu.xib */; }; BCF40F331724A083005AE36A /* GPUImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCF40F3017249F6F005AE36A /* GPUImage.framework */; }; BCF40F351724AFA0005AE36A /* GPUImage.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = BCF40F3017249F6F005AE36A /* GPUImage.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ BCF40F2F17249F6F005AE36A /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BCF40F2B17249F6F005AE36A /* GPUImageMac.xcodeproj */; proxyType = 2; remoteGlobalIDString = BCA3F31C17239B6500E28AEC; remoteInfo = GPUImage; }; BCF40F311724A042005AE36A /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BCF40F2B17249F6F005AE36A /* GPUImageMac.xcodeproj */; proxyType = 1; remoteGlobalIDString = BCA3F31B17239B6500E28AEC; remoteInfo = GPUImage; }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ BCF40F341724AF95005AE36A /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( BCF40F351724AFA0005AE36A /* GPUImage.framework in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ BCA3F33D1723A2E800E28AEC /* SimplePhotoFilter.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SimplePhotoFilter.app; sourceTree = BUILT_PRODUCTS_DIR; }; BCA3F3401723A2E800E28AEC /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; BCA3F3431723A2E800E28AEC /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; BCA3F3441723A2E800E28AEC /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; BCA3F3451723A2E800E28AEC /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; BCA3F3481723A2E800E28AEC /* SimplePhotoFilter-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SimplePhotoFilter-Info.plist"; sourceTree = ""; }; BCA3F34A1723A2E800E28AEC /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; BCA3F34C1723A2E800E28AEC /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; BCA3F34E1723A2E800E28AEC /* SimplePhotoFilter-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SimplePhotoFilter-Prefix.pch"; sourceTree = ""; }; BCA3F3501723A2E800E28AEC /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/Credits.rtf; sourceTree = ""; }; BCA3F3521723A2E800E28AEC /* SLSDocument.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SLSDocument.h; sourceTree = ""; }; BCA3F3531723A2E800E28AEC /* SLSDocument.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SLSDocument.m; sourceTree = ""; }; BCA3F3561723A2E800E28AEC /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/SLSDocument.xib; sourceTree = ""; }; BCA3F3591723A2E800E28AEC /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = ""; }; BCF40F2B17249F6F005AE36A /* GPUImageMac.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = GPUImageMac.xcodeproj; path = ../../../framework/GPUImageMac.xcodeproj; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ BCA3F33A1723A2E800E28AEC /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( BCF40F331724A083005AE36A /* GPUImage.framework in Frameworks */, BCA3F3411723A2E800E28AEC /* Cocoa.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ BCA3F3341723A2E800E28AEC = { isa = PBXGroup; children = ( BCA3F3461723A2E800E28AEC /* SimplePhotoFilter */, BCA3F33F1723A2E800E28AEC /* Frameworks */, BCA3F33E1723A2E800E28AEC /* Products */, ); sourceTree = ""; }; BCA3F33E1723A2E800E28AEC /* Products */ = { isa = PBXGroup; children = ( BCA3F33D1723A2E800E28AEC /* SimplePhotoFilter.app */, ); name = Products; sourceTree = ""; }; BCA3F33F1723A2E800E28AEC /* Frameworks */ = { isa = PBXGroup; children = ( BCF40F2B17249F6F005AE36A /* GPUImageMac.xcodeproj */, BCA3F3401723A2E800E28AEC /* Cocoa.framework */, BCA3F3421723A2E800E28AEC /* Other Frameworks */, ); name = Frameworks; sourceTree = ""; }; BCA3F3421723A2E800E28AEC /* Other Frameworks */ = { isa = PBXGroup; children = ( BCA3F3431723A2E800E28AEC /* AppKit.framework */, BCA3F3441723A2E800E28AEC /* CoreData.framework */, BCA3F3451723A2E800E28AEC /* Foundation.framework */, ); name = "Other Frameworks"; sourceTree = ""; }; BCA3F3461723A2E800E28AEC /* SimplePhotoFilter */ = { isa = PBXGroup; children = ( BCA3F3581723A2E800E28AEC /* MainMenu.xib */, BCA3F3521723A2E800E28AEC /* SLSDocument.h */, BCA3F3531723A2E800E28AEC /* SLSDocument.m */, BCA3F3551723A2E800E28AEC /* SLSDocument.xib */, BCA3F3471723A2E800E28AEC /* Supporting Files */, ); path = SimplePhotoFilter; sourceTree = ""; }; BCA3F3471723A2E800E28AEC /* Supporting Files */ = { isa = PBXGroup; children = ( BCA3F3481723A2E800E28AEC /* SimplePhotoFilter-Info.plist */, BCA3F3491723A2E800E28AEC /* InfoPlist.strings */, BCA3F34C1723A2E800E28AEC /* main.m */, BCA3F34E1723A2E800E28AEC /* SimplePhotoFilter-Prefix.pch */, BCA3F34F1723A2E800E28AEC /* Credits.rtf */, ); name = "Supporting Files"; sourceTree = ""; }; BCF40F2C17249F6F005AE36A /* Products */ = { isa = PBXGroup; children = ( BCF40F3017249F6F005AE36A /* GPUImage.framework */, ); name = Products; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ BCA3F33C1723A2E800E28AEC /* SimplePhotoFilter */ = { isa = PBXNativeTarget; buildConfigurationList = BCA3F35D1723A2E800E28AEC /* Build configuration list for PBXNativeTarget "SimplePhotoFilter" */; buildPhases = ( BCA3F3391723A2E800E28AEC /* Sources */, BCA3F33A1723A2E800E28AEC /* Frameworks */, BCA3F33B1723A2E800E28AEC /* Resources */, BCF40F341724AF95005AE36A /* CopyFiles */, ); buildRules = ( ); dependencies = ( BCF40F321724A042005AE36A /* PBXTargetDependency */, ); name = SimplePhotoFilter; productName = SimplePhotoFilter; productReference = BCA3F33D1723A2E800E28AEC /* SimplePhotoFilter.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ BCA3F3351723A2E800E28AEC /* Project object */ = { isa = PBXProject; attributes = { CLASSPREFIX = SLS; LastUpgradeCheck = 0500; ORGANIZATIONNAME = "Sunset Lake Software LLC"; }; buildConfigurationList = BCA3F3381723A2E800E28AEC /* Build configuration list for PBXProject "SimplePhotoFilter" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, ); mainGroup = BCA3F3341723A2E800E28AEC; productRefGroup = BCA3F33E1723A2E800E28AEC /* Products */; projectDirPath = ""; projectReferences = ( { ProductGroup = BCF40F2C17249F6F005AE36A /* Products */; ProjectRef = BCF40F2B17249F6F005AE36A /* GPUImageMac.xcodeproj */; }, ); projectRoot = ""; targets = ( BCA3F33C1723A2E800E28AEC /* SimplePhotoFilter */, ); }; /* End PBXProject section */ /* Begin PBXReferenceProxy section */ BCF40F3017249F6F005AE36A /* GPUImage.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; path = GPUImage.framework; remoteRef = BCF40F2F17249F6F005AE36A /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ BCA3F33B1723A2E800E28AEC /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( BCA3F3511723A2E800E28AEC /* Credits.rtf in Resources */, BCA3F3571723A2E800E28AEC /* SLSDocument.xib in Resources */, BCA3F35A1723A2E800E28AEC /* MainMenu.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ BCA3F3391723A2E800E28AEC /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( BCA3F34D1723A2E800E28AEC /* main.m in Sources */, BCA3F3541723A2E800E28AEC /* SLSDocument.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ BCF40F321724A042005AE36A /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = GPUImage; targetProxy = BCF40F311724A042005AE36A /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ BCA3F3491723A2E800E28AEC /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( BCA3F34A1723A2E800E28AEC /* en */, ); name = InfoPlist.strings; sourceTree = ""; }; BCA3F34F1723A2E800E28AEC /* Credits.rtf */ = { isa = PBXVariantGroup; children = ( BCA3F3501723A2E800E28AEC /* en */, ); name = Credits.rtf; sourceTree = ""; }; BCA3F3551723A2E800E28AEC /* SLSDocument.xib */ = { isa = PBXVariantGroup; children = ( BCA3F3561723A2E800E28AEC /* en */, ); name = SLSDocument.xib; sourceTree = ""; }; BCA3F3581723A2E800E28AEC /* MainMenu.xib */ = { isa = PBXVariantGroup; children = ( BCA3F3591723A2E800E28AEC /* en */, ); name = MainMenu.xib; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ BCA3F35B1723A2E800E28AEC /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.7; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; }; name = Debug; }; BCA3F35C1723A2E800E28AEC /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.7; SDKROOT = macosx; }; name = Release; }; BCA3F35E1723A2E800E28AEC /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { COMBINE_HIDPI_IMAGES = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "SimplePhotoFilter/SimplePhotoFilter-Prefix.pch"; INFOPLIST_FILE = "SimplePhotoFilter/SimplePhotoFilter-Info.plist"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; name = Debug; }; BCA3F35F1723A2E800E28AEC /* Release */ = { isa = XCBuildConfiguration; buildSettings = { COMBINE_HIDPI_IMAGES = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "SimplePhotoFilter/SimplePhotoFilter-Prefix.pch"; INFOPLIST_FILE = "SimplePhotoFilter/SimplePhotoFilter-Info.plist"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ BCA3F3381723A2E800E28AEC /* Build configuration list for PBXProject "SimplePhotoFilter" */ = { isa = XCConfigurationList; buildConfigurations = ( BCA3F35B1723A2E800E28AEC /* Debug */, BCA3F35C1723A2E800E28AEC /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; BCA3F35D1723A2E800E28AEC /* Build configuration list for PBXNativeTarget "SimplePhotoFilter" */ = { isa = XCConfigurationList; buildConfigurations = ( BCA3F35E1723A2E800E28AEC /* Debug */, BCA3F35F1723A2E800E28AEC /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = BCA3F3351723A2E800E28AEC /* Project object */; } ================================================ FILE: examples/Mac/SimplePhotoFilter/SimplePhotoFilter.xcodeproj/xcshareddata/xcschemes/SimplePhotoFilter.xcscheme ================================================ ================================================ FILE: examples/Mac/SimpleVideoFileFilter/SimpleVideoFileFilter.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ 575AD8C91BEA6FC60088E866 /* sample_iPod.m4v in Resources */ = {isa = PBXBuildFile; fileRef = 575AD8C81BEA6FC60088E866 /* sample_iPod.m4v */; settings = {ASSET_TAGS = (); }; }; 79C26E221A5EDD1C0054857C /* SLSSimpleVideoFileFilterWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 79C26E211A5EDD1C0054857C /* SLSSimpleVideoFileFilterWindowController.m */; }; 79C26E2E1A5F02B70054857C /* SLSSimpleVideoFileFilterWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 79C26E2D1A5F02B70054857C /* SLSSimpleVideoFileFilterWindowController.xib */; }; 79E8A5FB1A5ED6A700E6A226 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 79E8A5FA1A5ED6A700E6A226 /* AppDelegate.m */; }; 79E8A5FD1A5ED6A700E6A226 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 79E8A5FC1A5ED6A700E6A226 /* main.m */; }; 79E8A5FF1A5ED6A700E6A226 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 79E8A5FE1A5ED6A700E6A226 /* Images.xcassets */; }; 79E8A6021A5ED6A700E6A226 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 79E8A6001A5ED6A700E6A226 /* MainMenu.xib */; }; 79E8A60E1A5ED6A700E6A226 /* SimpleVideoFilterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 79E8A60D1A5ED6A700E6A226 /* SimpleVideoFilterTests.m */; }; BCF8E9E51A75DE67005AE243 /* GPUImage.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = BCF8E9E21A75DE3F005AE243 /* GPUImage.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ 79E8A6081A5ED6A700E6A226 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 79E8A5EC1A5ED6A700E6A226 /* Project object */; proxyType = 1; remoteGlobalIDString = 79E8A5F31A5ED6A700E6A226; remoteInfo = SimpleVideoFilter; }; BCF8E9E11A75DE3F005AE243 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BCF8E9DD1A75DE3F005AE243 /* GPUImageMac.xcodeproj */; proxyType = 2; remoteGlobalIDString = BCA3F31C17239B6500E28AEC; remoteInfo = GPUImage; }; BCF8E9E31A75DE5B005AE243 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BCF8E9DD1A75DE3F005AE243 /* GPUImageMac.xcodeproj */; proxyType = 1; remoteGlobalIDString = BCA3F31B17239B6500E28AEC; remoteInfo = GPUImage; }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ 79C26E251A5EE5210054857C /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( BCF8E9E51A75DE67005AE243 /* GPUImage.framework in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ 575AD8C81BEA6FC60088E866 /* sample_iPod.m4v */ = {isa = PBXFileReference; lastKnownFileType = file; path = sample_iPod.m4v; sourceTree = ""; }; 79C26E201A5EDD1C0054857C /* SLSSimpleVideoFileFilterWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SLSSimpleVideoFileFilterWindowController.h; sourceTree = ""; }; 79C26E211A5EDD1C0054857C /* SLSSimpleVideoFileFilterWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SLSSimpleVideoFileFilterWindowController.m; sourceTree = ""; }; 79C26E2D1A5F02B70054857C /* SLSSimpleVideoFileFilterWindowController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SLSSimpleVideoFileFilterWindowController.xib; sourceTree = ""; }; 79E8A5F41A5ED6A700E6A226 /* SimpleVideoFileFilter.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SimpleVideoFileFilter.app; sourceTree = BUILT_PRODUCTS_DIR; }; 79E8A5F81A5ED6A700E6A226 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 79E8A5F91A5ED6A700E6A226 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 79E8A5FA1A5ED6A700E6A226 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 79E8A5FC1A5ED6A700E6A226 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 79E8A5FE1A5ED6A700E6A226 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 79E8A6011A5ED6A700E6A226 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; 79E8A6071A5ED6A700E6A226 /* SimpleVideoFileFilter.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SimpleVideoFileFilter.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 79E8A60C1A5ED6A700E6A226 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 79E8A60D1A5ED6A700E6A226 /* SimpleVideoFilterTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SimpleVideoFilterTests.m; sourceTree = ""; }; BCF8E9DD1A75DE3F005AE243 /* GPUImageMac.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = GPUImageMac.xcodeproj; path = ../../../../framework/GPUImageMac.xcodeproj; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 79E8A5F11A5ED6A700E6A226 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; 79E8A6041A5ED6A700E6A226 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 79E8A5EB1A5ED6A700E6A226 = { isa = PBXGroup; children = ( 79E8A5F61A5ED6A700E6A226 /* SimpleVideoFileFilter */, 79E8A61D1A5ED97400E6A226 /* Frameworks */, 79E8A60A1A5ED6A700E6A226 /* SimpleVideoFilterTests */, 79E8A5F51A5ED6A700E6A226 /* Products */, ); sourceTree = ""; }; 79E8A5F51A5ED6A700E6A226 /* Products */ = { isa = PBXGroup; children = ( 79E8A5F41A5ED6A700E6A226 /* SimpleVideoFileFilter.app */, 79E8A6071A5ED6A700E6A226 /* SimpleVideoFileFilter.xctest */, ); name = Products; sourceTree = ""; }; 79E8A5F61A5ED6A700E6A226 /* SimpleVideoFileFilter */ = { isa = PBXGroup; children = ( 79E8A5F91A5ED6A700E6A226 /* AppDelegate.h */, 79E8A5FA1A5ED6A700E6A226 /* AppDelegate.m */, 79C26E201A5EDD1C0054857C /* SLSSimpleVideoFileFilterWindowController.h */, 79C26E211A5EDD1C0054857C /* SLSSimpleVideoFileFilterWindowController.m */, 79C26E2D1A5F02B70054857C /* SLSSimpleVideoFileFilterWindowController.xib */, 79E8A5FE1A5ED6A700E6A226 /* Images.xcassets */, 79E8A6001A5ED6A700E6A226 /* MainMenu.xib */, 79E8A5F71A5ED6A700E6A226 /* Supporting Files */, ); name = SimpleVideoFileFilter; path = SimpleVideoFilter; sourceTree = ""; }; 79E8A5F71A5ED6A700E6A226 /* Supporting Files */ = { isa = PBXGroup; children = ( 575AD8C81BEA6FC60088E866 /* sample_iPod.m4v */, 79E8A5F81A5ED6A700E6A226 /* Info.plist */, 79E8A5FC1A5ED6A700E6A226 /* main.m */, ); name = "Supporting Files"; sourceTree = ""; }; 79E8A60A1A5ED6A700E6A226 /* SimpleVideoFilterTests */ = { isa = PBXGroup; children = ( 79E8A60D1A5ED6A700E6A226 /* SimpleVideoFilterTests.m */, 79E8A60B1A5ED6A700E6A226 /* Supporting Files */, ); path = SimpleVideoFilterTests; sourceTree = ""; }; 79E8A60B1A5ED6A700E6A226 /* Supporting Files */ = { isa = PBXGroup; children = ( 79E8A60C1A5ED6A700E6A226 /* Info.plist */, ); name = "Supporting Files"; sourceTree = ""; }; 79E8A61D1A5ED97400E6A226 /* Frameworks */ = { isa = PBXGroup; children = ( BCF8E9DD1A75DE3F005AE243 /* GPUImageMac.xcodeproj */, ); name = Frameworks; path = SimpleVideoFilterTests; sourceTree = ""; }; BCF8E9DE1A75DE3F005AE243 /* Products */ = { isa = PBXGroup; children = ( BCF8E9E21A75DE3F005AE243 /* GPUImage.framework */, ); name = Products; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ 79E8A5F31A5ED6A700E6A226 /* SimpleVideoFileFilter */ = { isa = PBXNativeTarget; buildConfigurationList = 79E8A6111A5ED6A700E6A226 /* Build configuration list for PBXNativeTarget "SimpleVideoFileFilter" */; buildPhases = ( 79E8A5F01A5ED6A700E6A226 /* Sources */, 79E8A5F11A5ED6A700E6A226 /* Frameworks */, 79E8A5F21A5ED6A700E6A226 /* Resources */, 79C26E251A5EE5210054857C /* CopyFiles */, ); buildRules = ( ); dependencies = ( BCF8E9E41A75DE5B005AE243 /* PBXTargetDependency */, ); name = SimpleVideoFileFilter; productName = SimpleVideoFilter; productReference = 79E8A5F41A5ED6A700E6A226 /* SimpleVideoFileFilter.app */; productType = "com.apple.product-type.application"; }; 79E8A6061A5ED6A700E6A226 /* SimpleVideoFileFilterTests */ = { isa = PBXNativeTarget; buildConfigurationList = 79E8A6141A5ED6A700E6A226 /* Build configuration list for PBXNativeTarget "SimpleVideoFileFilterTests" */; buildPhases = ( 79E8A6031A5ED6A700E6A226 /* Sources */, 79E8A6041A5ED6A700E6A226 /* Frameworks */, 79E8A6051A5ED6A700E6A226 /* Resources */, ); buildRules = ( ); dependencies = ( 79E8A6091A5ED6A700E6A226 /* PBXTargetDependency */, ); name = SimpleVideoFileFilterTests; productName = SimpleVideoFilterTests; productReference = 79E8A6071A5ED6A700E6A226 /* SimpleVideoFileFilter.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 79E8A5EC1A5ED6A700E6A226 /* Project object */ = { isa = PBXProject; attributes = { LastUpgradeCheck = 0610; ORGANIZATIONNAME = "Red Queen Coder, LLC"; TargetAttributes = { 79E8A5F31A5ED6A700E6A226 = { CreatedOnToolsVersion = 6.1.1; }; 79E8A6061A5ED6A700E6A226 = { CreatedOnToolsVersion = 6.1.1; TestTargetID = 79E8A5F31A5ED6A700E6A226; }; }; }; buildConfigurationList = 79E8A5EF1A5ED6A700E6A226 /* Build configuration list for PBXProject "SimpleVideoFileFilter" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); mainGroup = 79E8A5EB1A5ED6A700E6A226; productRefGroup = 79E8A5F51A5ED6A700E6A226 /* Products */; projectDirPath = ""; projectReferences = ( { ProductGroup = BCF8E9DE1A75DE3F005AE243 /* Products */; ProjectRef = BCF8E9DD1A75DE3F005AE243 /* GPUImageMac.xcodeproj */; }, ); projectRoot = ""; targets = ( 79E8A5F31A5ED6A700E6A226 /* SimpleVideoFileFilter */, 79E8A6061A5ED6A700E6A226 /* SimpleVideoFileFilterTests */, ); }; /* End PBXProject section */ /* Begin PBXReferenceProxy section */ BCF8E9E21A75DE3F005AE243 /* GPUImage.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; path = GPUImage.framework; remoteRef = BCF8E9E11A75DE3F005AE243 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ 79E8A5F21A5ED6A700E6A226 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( 79E8A5FF1A5ED6A700E6A226 /* Images.xcassets in Resources */, 575AD8C91BEA6FC60088E866 /* sample_iPod.m4v in Resources */, 79C26E2E1A5F02B70054857C /* SLSSimpleVideoFileFilterWindowController.xib in Resources */, 79E8A6021A5ED6A700E6A226 /* MainMenu.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; 79E8A6051A5ED6A700E6A226 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ 79E8A5F01A5ED6A700E6A226 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 79E8A5FD1A5ED6A700E6A226 /* main.m in Sources */, 79E8A5FB1A5ED6A700E6A226 /* AppDelegate.m in Sources */, 79C26E221A5EDD1C0054857C /* SLSSimpleVideoFileFilterWindowController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; 79E8A6031A5ED6A700E6A226 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 79E8A60E1A5ED6A700E6A226 /* SimpleVideoFilterTests.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ 79E8A6091A5ED6A700E6A226 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 79E8A5F31A5ED6A700E6A226 /* SimpleVideoFileFilter */; targetProxy = 79E8A6081A5ED6A700E6A226 /* PBXContainerItemProxy */; }; BCF8E9E41A75DE5B005AE243 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = GPUImage; targetProxy = BCF8E9E31A75DE5B005AE243 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ 79E8A6001A5ED6A700E6A226 /* MainMenu.xib */ = { isa = PBXVariantGroup; children = ( 79E8A6011A5ED6A700E6A226 /* Base */, ); name = MainMenu.xib; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ 79E8A60F1A5ED6A700E6A226 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "-"; COPY_PHASE_STRIP = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.10; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; }; name = Debug; }; 79E8A6101A5ED6A700E6A226 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "-"; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.10; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; }; name = Release; }; 79E8A6121A5ED6A700E6A226 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COMBINE_HIDPI_IMAGES = YES; INFOPLIST_FILE = SimpleVideoFilter/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; PRODUCT_NAME = SimpleVideoFileFilter; }; name = Debug; }; 79E8A6131A5ED6A700E6A226 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COMBINE_HIDPI_IMAGES = YES; INFOPLIST_FILE = SimpleVideoFilter/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; PRODUCT_NAME = SimpleVideoFileFilter; }; name = Release; }; 79E8A6151A5ED6A700E6A226 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; COMBINE_HIDPI_IMAGES = YES; FRAMEWORK_SEARCH_PATHS = ( "$(DEVELOPER_FRAMEWORKS_DIR)", "$(inherited)", ); GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); INFOPLIST_FILE = SimpleVideoFilterTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; PRODUCT_NAME = SimpleVideoFileFilter; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SimpleVideoFileFilter.app/Contents/MacOS/SimpleVideoFileFilter"; }; name = Debug; }; 79E8A6161A5ED6A700E6A226 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; COMBINE_HIDPI_IMAGES = YES; FRAMEWORK_SEARCH_PATHS = ( "$(DEVELOPER_FRAMEWORKS_DIR)", "$(inherited)", ); INFOPLIST_FILE = SimpleVideoFilterTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; PRODUCT_NAME = SimpleVideoFileFilter; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SimpleVideoFileFilter.app/Contents/MacOS/SimpleVideoFileFilter"; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 79E8A5EF1A5ED6A700E6A226 /* Build configuration list for PBXProject "SimpleVideoFileFilter" */ = { isa = XCConfigurationList; buildConfigurations = ( 79E8A60F1A5ED6A700E6A226 /* Debug */, 79E8A6101A5ED6A700E6A226 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 79E8A6111A5ED6A700E6A226 /* Build configuration list for PBXNativeTarget "SimpleVideoFileFilter" */ = { isa = XCConfigurationList; buildConfigurations = ( 79E8A6121A5ED6A700E6A226 /* Debug */, 79E8A6131A5ED6A700E6A226 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 79E8A6141A5ED6A700E6A226 /* Build configuration list for PBXNativeTarget "SimpleVideoFileFilterTests" */ = { isa = XCConfigurationList; buildConfigurations = ( 79E8A6151A5ED6A700E6A226 /* Debug */, 79E8A6161A5ED6A700E6A226 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = 79E8A5EC1A5ED6A700E6A226 /* Project object */; } ================================================ FILE: examples/Mac/SimpleVideoFileFilter/SimpleVideoFilter/AppDelegate.h ================================================ #import #import "SLSSimpleVideoFileFilterWindowController.h" @interface AppDelegate : NSObject { SLSSimpleVideoFileFilterWindowController *simpleVideoFileFilterWindowController; } @end ================================================ FILE: examples/Mac/SimpleVideoFileFilter/SimpleVideoFilter/AppDelegate.m ================================================ #import "AppDelegate.h" #import @interface AppDelegate () @property (weak) IBOutlet NSWindow *window; @end @implementation AppDelegate - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { // Insert code here to initialize your application simpleVideoFileFilterWindowController = [[SLSSimpleVideoFileFilterWindowController alloc] initWithWindowNibName:@"SLSSimpleVideoFileFilterWindowController"]; [simpleVideoFileFilterWindowController showWindow:self]; } - (void)applicationWillTerminate:(NSNotification *)aNotification { // Insert code here to tear down your application } @end ================================================ FILE: examples/Mac/SimpleVideoFileFilter/SimpleVideoFilter/Base.lproj/MainMenu.xib ================================================ Default Left to Right Right to Left Default Left to Right Right to Left ================================================ FILE: examples/Mac/SimpleVideoFileFilter/SimpleVideoFilter/Images.xcassets/AppIcon.appiconset/Contents.json ================================================ { "images" : [ { "idiom" : "mac", "size" : "16x16", "scale" : "1x" }, { "idiom" : "mac", "size" : "16x16", "scale" : "2x" }, { "idiom" : "mac", "size" : "32x32", "scale" : "1x" }, { "idiom" : "mac", "size" : "32x32", "scale" : "2x" }, { "idiom" : "mac", "size" : "128x128", "scale" : "1x" }, { "idiom" : "mac", "size" : "128x128", "scale" : "2x" }, { "idiom" : "mac", "size" : "256x256", "scale" : "1x" }, { "idiom" : "mac", "size" : "256x256", "scale" : "2x" }, { "idiom" : "mac", "size" : "512x512", "scale" : "1x" }, { "idiom" : "mac", "size" : "512x512", "scale" : "2x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: examples/Mac/SimpleVideoFileFilter/SimpleVideoFilter/Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIconFile CFBundleIdentifier com.redqueencoder.$(PRODUCT_NAME:rfc1034identifier) CFBundleInfoDictionaryVersion 6.0 CFBundleName $(PRODUCT_NAME) CFBundlePackageType APPL CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion 1 LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) NSHumanReadableCopyright Copyright © 2015 Red Queen Coder, LLC. All rights reserved. NSMainNibFile MainMenu NSPrincipalClass NSApplication ================================================ FILE: examples/Mac/SimpleVideoFileFilter/SimpleVideoFilter/SLSSimpleVideoFileFilterWindowController.h ================================================ #import @interface SLSSimpleVideoFileFilterWindowController : NSWindowController @end ================================================ FILE: examples/Mac/SimpleVideoFileFilter/SimpleVideoFilter/SLSSimpleVideoFileFilterWindowController.m ================================================ #import "SLSSimpleVideoFileFilterWindowController.h" #import @interface SLSSimpleVideoFileFilterWindowController () { GPUImageMovie *movieFile; GPUImageOutput *filter; GPUImageMovieWriter *movieWriter; NSTimer * timer; } @property (weak) IBOutlet GPUImageView *videoView; @property (weak) IBOutlet NSTextField *progressLabel; @property (weak) IBOutlet NSView *containerView; @property (weak) IBOutlet NSButton *urlButton; @property (weak) IBOutlet NSButton *avPlayerItemButton; @property (nonatomic, strong) AVPlayerItem *playerItem; @property (nonatomic, strong) AVPlayer *player; @end @implementation SLSSimpleVideoFileFilterWindowController - (void)windowDidLoad { [super windowDidLoad]; self.containerView.hidden = YES; } - (IBAction)gpuImageMovieWithURLButtonAction:(id)sender { [self runProcessingWithAVPlayerItem:NO]; [self showProcessingUI]; } - (IBAction)gpuImageMovieWithAvplayeritemButtonAction:(id)sender { [self runProcessingWithAVPlayerItem:YES]; [self showProcessingUI]; } - (void)showProcessingUI { self.containerView.hidden = NO; self.urlButton.hidden = YES; self.avPlayerItemButton.hidden = YES; } - (void)runProcessingWithAVPlayerItem:(BOOL)withAVPlayerItem { NSURL *sampleURL = [[NSBundle mainBundle] URLForResource:@"sample_iPod" withExtension:@"m4v"]; self.playerItem = [[AVPlayerItem alloc] initWithURL:sampleURL]; self.player = [AVPlayer playerWithPlayerItem:self.playerItem]; //movieFile = [[GPUImageMovie alloc] initWithURL:sampleURL]; movieFile = [[GPUImageMovie alloc] initWithPlayerItem:self.playerItem]; movieFile.runBenchmark = YES; movieFile.playAtActualSpeed = NO; filter = [[GPUImagePixellateFilter alloc] init]; // filter = [[GPUImageUnsharpMaskFilter alloc] init]; [movieFile addTarget:filter]; // Only rotate the video for display, leave orientation the same for recording GPUImageView *filterView = (GPUImageView *)self.videoView; [filter addTarget:filterView]; // In addition to displaying to the screen, write out a processed version of the movie to disk NSString *pathToMovie = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/Movie.m4v"]; unlink([pathToMovie UTF8String]); // If a file already exists, AVAssetWriter won't let you record new frames, so delete the old movie NSURL *movieURL = [NSURL fileURLWithPath:pathToMovie]; movieWriter = [[GPUImageMovieWriter alloc] initWithMovieURL:movieURL size:CGSizeMake(640.0, 480.0)]; [filter addTarget:movieWriter]; // Configure this for video from the movie file, where we want to preserve all video frames and audio samples movieWriter.shouldPassthroughAudio = YES; movieFile.audioEncodingTarget = movieWriter; [movieFile enableSynchronizedEncodingUsingMovieWriter:movieWriter]; [movieWriter startRecording]; [movieFile startProcessing]; timer = [NSTimer scheduledTimerWithTimeInterval:0.3f target:self selector:@selector(retrievingProgress) userInfo:nil repeats:YES]; [movieWriter setCompletionBlock:^{ [filter removeTarget:movieWriter]; [movieWriter finishRecording]; dispatch_async(dispatch_get_main_queue(), ^{ [timer invalidate]; self.progressLabel.stringValue = @"100%"; }); }]; [self.player play]; } - (void)retrievingProgress { self.progressLabel.stringValue = [NSString stringWithFormat:@"%d%%", (int)(movieFile.progress * 100)]; } - (IBAction)updatePixelWidth:(id)sender { // [(GPUImageUnsharpMaskFilter *)filter setIntensity:[(UISlider *)sender value]]; [(GPUImagePixellateFilter *)filter setFractionalWidthOfAPixel:[(NSSlider *)sender floatValue]]; } @end ================================================ FILE: examples/Mac/SimpleVideoFileFilter/SimpleVideoFilter/SLSSimpleVideoFileFilterWindowController.xib ================================================ ================================================ FILE: examples/Mac/SimpleVideoFileFilter/SimpleVideoFilter/main.m ================================================ // // main.m // SimpleVideoFilter // // Created by Janie Clayton-Hasz on 1/8/15. // Copyright (c) 2015 Red Queen Coder, LLC. All rights reserved. // #import int main(int argc, const char * argv[]) { return NSApplicationMain(argc, argv); } ================================================ FILE: examples/Mac/SimpleVideoFileFilter/SimpleVideoFilterTests/Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier com.redqueencoder.$(PRODUCT_NAME:rfc1034identifier) CFBundleInfoDictionaryVersion 6.0 CFBundleName $(PRODUCT_NAME) CFBundlePackageType BNDL CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion 1 ================================================ FILE: examples/Mac/SimpleVideoFileFilter/SimpleVideoFilterTests/SimpleVideoFilterTests.m ================================================ // // SimpleVideoFilterTests.m // SimpleVideoFilterTests // // Created by Janie Clayton-Hasz on 1/8/15. // Copyright (c) 2015 Red Queen Coder, LLC. All rights reserved. // #import #import @interface SimpleVideoFilterTests : XCTestCase @end @implementation SimpleVideoFilterTests - (void)setUp { [super setUp]; // Put setup code here. This method is called before the invocation of each test method in the class. } - (void)tearDown { // Put teardown code here. This method is called after the invocation of each test method in the class. [super tearDown]; } - (void)testExample { // This is an example of a functional test case. XCTAssert(YES, @"Pass"); } - (void)testPerformanceExample { // This is an example of a performance test case. [self measureBlock:^{ // Put the code you want to measure the time of here. }]; } @end ================================================ FILE: examples/Mac/SimpleVideoFilter/SimpleVideoFilter/AppDelegate.h ================================================ #import #import "SLSSimpleVideoFilterWindowController.h" @interface AppDelegate : NSObject { SLSSimpleVideoFilterWindowController *simpleVideoFilterWindowController; } @end ================================================ FILE: examples/Mac/SimpleVideoFilter/SimpleVideoFilter/AppDelegate.m ================================================ #import "AppDelegate.h" #import @interface AppDelegate () @property (weak) IBOutlet NSWindow *window; @end @implementation AppDelegate - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { // Insert code here to initialize your application simpleVideoFilterWindowController = [[SLSSimpleVideoFilterWindowController alloc] initWithWindowNibName:@"SLSSimpleVideoFilterWindowController"]; [simpleVideoFilterWindowController showWindow:self]; } - (void)applicationWillTerminate:(NSNotification *)aNotification { // Insert code here to tear down your application } @end ================================================ FILE: examples/Mac/SimpleVideoFilter/SimpleVideoFilter/Base.lproj/MainMenu.xib ================================================ Default Left to Right Right to Left Default Left to Right Right to Left ================================================ FILE: examples/Mac/SimpleVideoFilter/SimpleVideoFilter/Images.xcassets/AppIcon.appiconset/Contents.json ================================================ { "images" : [ { "idiom" : "mac", "size" : "16x16", "scale" : "1x" }, { "idiom" : "mac", "size" : "16x16", "scale" : "2x" }, { "idiom" : "mac", "size" : "32x32", "scale" : "1x" }, { "idiom" : "mac", "size" : "32x32", "scale" : "2x" }, { "idiom" : "mac", "size" : "128x128", "scale" : "1x" }, { "idiom" : "mac", "size" : "128x128", "scale" : "2x" }, { "idiom" : "mac", "size" : "256x256", "scale" : "1x" }, { "idiom" : "mac", "size" : "256x256", "scale" : "2x" }, { "idiom" : "mac", "size" : "512x512", "scale" : "1x" }, { "idiom" : "mac", "size" : "512x512", "scale" : "2x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: examples/Mac/SimpleVideoFilter/SimpleVideoFilter/Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIconFile CFBundleIdentifier com.redqueencoder.$(PRODUCT_NAME:rfc1034identifier) CFBundleInfoDictionaryVersion 6.0 CFBundleName $(PRODUCT_NAME) CFBundlePackageType APPL CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion 1 LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) NSHumanReadableCopyright Copyright © 2015 Red Queen Coder, LLC. All rights reserved. NSMainNibFile MainMenu NSPrincipalClass NSApplication ================================================ FILE: examples/Mac/SimpleVideoFilter/SimpleVideoFilter/SLSSimpleVideoFilterWindowController.h ================================================ #import #import @interface SLSSimpleVideoFilterWindowController : NSWindowController { GPUImageAVCamera *videoCamera; GPUImageOutput *filter; GPUImageMovieWriter *movieWriter; } @property (weak) IBOutlet GPUImageView *videoView; @end ================================================ FILE: examples/Mac/SimpleVideoFilter/SimpleVideoFilter/SLSSimpleVideoFilterWindowController.m ================================================ #import "SLSSimpleVideoFilterWindowController.h" @interface SLSSimpleVideoFilterWindowController () @end @implementation SLSSimpleVideoFilterWindowController - (void)windowDidLoad { [super windowDidLoad]; // Implement this method to handle any initialization after your window controller's window has been loaded from its nib file. // Instantiate video camera videoCamera = [[GPUImageAVCamera alloc] initWithSessionPreset:AVCaptureSessionPreset640x480 cameraDevice:nil]; videoCamera.runBenchmark = YES; // Create filter and add it to target filter = [[GPUImageSepiaFilter alloc] init]; [videoCamera addTarget:filter]; // Save video to desktop NSError *error = nil; NSURL *pathToDesktop = [[NSFileManager defaultManager] URLForDirectory:NSDesktopDirectory inDomain:NSUserDomainMask appropriateForURL:nil create:YES error:&error]; NSURL *pathToMovieFile = [pathToDesktop URLByAppendingPathComponent:@"movie.mp4"]; NSString *filePathString = [pathToMovieFile absoluteString]; NSString *filePathSubstring = [filePathString substringFromIndex:7]; unlink([filePathSubstring UTF8String]); // Instantiate movie writer and add targets movieWriter = [[GPUImageMovieWriter alloc] initWithMovieURL:pathToMovieFile size:CGSizeMake(640.0, 480.0)]; movieWriter.encodingLiveVideo = YES; self.videoView.fillMode = kGPUImageFillModePreserveAspectRatio; [filter addTarget:movieWriter]; [filter addTarget:self.videoView]; // Start capturing [videoCamera startCameraCapture]; double delayToStartRecording = 0.5; dispatch_time_t startTime = dispatch_time(DISPATCH_TIME_NOW, delayToStartRecording * NSEC_PER_SEC); dispatch_after(startTime, dispatch_get_main_queue(), ^(void){ NSLog(@"Start recording"); videoCamera.audioEncodingTarget = movieWriter; [movieWriter startRecording]; double delayInSeconds = 10.0; dispatch_time_t stopTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC); dispatch_after(stopTime, dispatch_get_main_queue(), ^(void){ [filter removeTarget:movieWriter]; videoCamera.audioEncodingTarget = nil; [movieWriter finishRecording]; NSLog(@"Movie completed"); }); }); } @end ================================================ FILE: examples/Mac/SimpleVideoFilter/SimpleVideoFilter/SLSSimpleVideoFilterWindowController.xib ================================================ ================================================ FILE: examples/Mac/SimpleVideoFilter/SimpleVideoFilter/main.m ================================================ // // main.m // SimpleVideoFilter // // Created by Janie Clayton-Hasz on 1/8/15. // Copyright (c) 2015 Red Queen Coder, LLC. All rights reserved. // #import int main(int argc, const char * argv[]) { return NSApplicationMain(argc, argv); } ================================================ FILE: examples/Mac/SimpleVideoFilter/SimpleVideoFilter.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ 79C26E221A5EDD1C0054857C /* SLSSimpleVideoFilterWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 79C26E211A5EDD1C0054857C /* SLSSimpleVideoFilterWindowController.m */; }; 79C26E2E1A5F02B70054857C /* SLSSimpleVideoFilterWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 79C26E2D1A5F02B70054857C /* SLSSimpleVideoFilterWindowController.xib */; }; 79E8A5FB1A5ED6A700E6A226 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 79E8A5FA1A5ED6A700E6A226 /* AppDelegate.m */; }; 79E8A5FD1A5ED6A700E6A226 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 79E8A5FC1A5ED6A700E6A226 /* main.m */; }; 79E8A5FF1A5ED6A700E6A226 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 79E8A5FE1A5ED6A700E6A226 /* Images.xcassets */; }; 79E8A6021A5ED6A700E6A226 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 79E8A6001A5ED6A700E6A226 /* MainMenu.xib */; }; 79E8A60E1A5ED6A700E6A226 /* SimpleVideoFilterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 79E8A60D1A5ED6A700E6A226 /* SimpleVideoFilterTests.m */; }; BCF8E9E51A75DE67005AE243 /* GPUImage.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = BCF8E9E21A75DE3F005AE243 /* GPUImage.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ 79E8A6081A5ED6A700E6A226 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 79E8A5EC1A5ED6A700E6A226 /* Project object */; proxyType = 1; remoteGlobalIDString = 79E8A5F31A5ED6A700E6A226; remoteInfo = SimpleVideoFilter; }; BCF8E9E11A75DE3F005AE243 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BCF8E9DD1A75DE3F005AE243 /* GPUImageMac.xcodeproj */; proxyType = 2; remoteGlobalIDString = BCA3F31C17239B6500E28AEC; remoteInfo = GPUImage; }; BCF8E9E31A75DE5B005AE243 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BCF8E9DD1A75DE3F005AE243 /* GPUImageMac.xcodeproj */; proxyType = 1; remoteGlobalIDString = BCA3F31B17239B6500E28AEC; remoteInfo = GPUImage; }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ 79C26E251A5EE5210054857C /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( BCF8E9E51A75DE67005AE243 /* GPUImage.framework in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ 79C26E201A5EDD1C0054857C /* SLSSimpleVideoFilterWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SLSSimpleVideoFilterWindowController.h; path = SimpleVideoFilter/SLSSimpleVideoFilterWindowController.h; sourceTree = SOURCE_ROOT; }; 79C26E211A5EDD1C0054857C /* SLSSimpleVideoFilterWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SLSSimpleVideoFilterWindowController.m; path = SimpleVideoFilter/SLSSimpleVideoFilterWindowController.m; sourceTree = SOURCE_ROOT; }; 79C26E2D1A5F02B70054857C /* SLSSimpleVideoFilterWindowController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = SLSSimpleVideoFilterWindowController.xib; path = SimpleVideoFilter/SLSSimpleVideoFilterWindowController.xib; sourceTree = SOURCE_ROOT; }; 79E8A5F41A5ED6A700E6A226 /* SimpleVideoFilter.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SimpleVideoFilter.app; sourceTree = BUILT_PRODUCTS_DIR; }; 79E8A5F81A5ED6A700E6A226 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 79E8A5F91A5ED6A700E6A226 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 79E8A5FA1A5ED6A700E6A226 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 79E8A5FC1A5ED6A700E6A226 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 79E8A5FE1A5ED6A700E6A226 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 79E8A6011A5ED6A700E6A226 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; 79E8A6071A5ED6A700E6A226 /* SimpleVideoFilterTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SimpleVideoFilterTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 79E8A60C1A5ED6A700E6A226 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 79E8A60D1A5ED6A700E6A226 /* SimpleVideoFilterTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SimpleVideoFilterTests.m; sourceTree = ""; }; BCF8E9DD1A75DE3F005AE243 /* GPUImageMac.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = GPUImageMac.xcodeproj; path = ../../../../framework/GPUImageMac.xcodeproj; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 79E8A5F11A5ED6A700E6A226 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; 79E8A6041A5ED6A700E6A226 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 79E8A5EB1A5ED6A700E6A226 = { isa = PBXGroup; children = ( 79E8A5F61A5ED6A700E6A226 /* SimpleVideoFilter */, 79E8A61D1A5ED97400E6A226 /* Frameworks */, 79E8A60A1A5ED6A700E6A226 /* SimpleVideoFilterTests */, 79E8A5F51A5ED6A700E6A226 /* Products */, ); sourceTree = ""; }; 79E8A5F51A5ED6A700E6A226 /* Products */ = { isa = PBXGroup; children = ( 79E8A5F41A5ED6A700E6A226 /* SimpleVideoFilter.app */, 79E8A6071A5ED6A700E6A226 /* SimpleVideoFilterTests.xctest */, ); name = Products; sourceTree = ""; }; 79E8A5F61A5ED6A700E6A226 /* SimpleVideoFilter */ = { isa = PBXGroup; children = ( 79E8A5F91A5ED6A700E6A226 /* AppDelegate.h */, 79E8A5FA1A5ED6A700E6A226 /* AppDelegate.m */, 79C26E201A5EDD1C0054857C /* SLSSimpleVideoFilterWindowController.h */, 79C26E211A5EDD1C0054857C /* SLSSimpleVideoFilterWindowController.m */, 79C26E2D1A5F02B70054857C /* SLSSimpleVideoFilterWindowController.xib */, 79E8A5FE1A5ED6A700E6A226 /* Images.xcassets */, 79E8A6001A5ED6A700E6A226 /* MainMenu.xib */, 79E8A5F71A5ED6A700E6A226 /* Supporting Files */, ); path = SimpleVideoFilter; sourceTree = ""; }; 79E8A5F71A5ED6A700E6A226 /* Supporting Files */ = { isa = PBXGroup; children = ( 79E8A5F81A5ED6A700E6A226 /* Info.plist */, 79E8A5FC1A5ED6A700E6A226 /* main.m */, ); name = "Supporting Files"; sourceTree = ""; }; 79E8A60A1A5ED6A700E6A226 /* SimpleVideoFilterTests */ = { isa = PBXGroup; children = ( 79E8A60D1A5ED6A700E6A226 /* SimpleVideoFilterTests.m */, 79E8A60B1A5ED6A700E6A226 /* Supporting Files */, ); path = SimpleVideoFilterTests; sourceTree = ""; }; 79E8A60B1A5ED6A700E6A226 /* Supporting Files */ = { isa = PBXGroup; children = ( 79E8A60C1A5ED6A700E6A226 /* Info.plist */, ); name = "Supporting Files"; sourceTree = ""; }; 79E8A61D1A5ED97400E6A226 /* Frameworks */ = { isa = PBXGroup; children = ( BCF8E9DD1A75DE3F005AE243 /* GPUImageMac.xcodeproj */, ); name = Frameworks; path = SimpleVideoFilterTests; sourceTree = ""; }; BCF8E9DE1A75DE3F005AE243 /* Products */ = { isa = PBXGroup; children = ( BCF8E9E21A75DE3F005AE243 /* GPUImage.framework */, ); name = Products; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ 79E8A5F31A5ED6A700E6A226 /* SimpleVideoFilter */ = { isa = PBXNativeTarget; buildConfigurationList = 79E8A6111A5ED6A700E6A226 /* Build configuration list for PBXNativeTarget "SimpleVideoFilter" */; buildPhases = ( 79E8A5F01A5ED6A700E6A226 /* Sources */, 79E8A5F11A5ED6A700E6A226 /* Frameworks */, 79E8A5F21A5ED6A700E6A226 /* Resources */, 79C26E251A5EE5210054857C /* CopyFiles */, ); buildRules = ( ); dependencies = ( BCF8E9E41A75DE5B005AE243 /* PBXTargetDependency */, ); name = SimpleVideoFilter; productName = SimpleVideoFilter; productReference = 79E8A5F41A5ED6A700E6A226 /* SimpleVideoFilter.app */; productType = "com.apple.product-type.application"; }; 79E8A6061A5ED6A700E6A226 /* SimpleVideoFilterTests */ = { isa = PBXNativeTarget; buildConfigurationList = 79E8A6141A5ED6A700E6A226 /* Build configuration list for PBXNativeTarget "SimpleVideoFilterTests" */; buildPhases = ( 79E8A6031A5ED6A700E6A226 /* Sources */, 79E8A6041A5ED6A700E6A226 /* Frameworks */, 79E8A6051A5ED6A700E6A226 /* Resources */, ); buildRules = ( ); dependencies = ( 79E8A6091A5ED6A700E6A226 /* PBXTargetDependency */, ); name = SimpleVideoFilterTests; productName = SimpleVideoFilterTests; productReference = 79E8A6071A5ED6A700E6A226 /* SimpleVideoFilterTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 79E8A5EC1A5ED6A700E6A226 /* Project object */ = { isa = PBXProject; attributes = { LastUpgradeCheck = 0610; ORGANIZATIONNAME = "Red Queen Coder, LLC"; TargetAttributes = { 79E8A5F31A5ED6A700E6A226 = { CreatedOnToolsVersion = 6.1.1; }; 79E8A6061A5ED6A700E6A226 = { CreatedOnToolsVersion = 6.1.1; TestTargetID = 79E8A5F31A5ED6A700E6A226; }; }; }; buildConfigurationList = 79E8A5EF1A5ED6A700E6A226 /* Build configuration list for PBXProject "SimpleVideoFilter" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); mainGroup = 79E8A5EB1A5ED6A700E6A226; productRefGroup = 79E8A5F51A5ED6A700E6A226 /* Products */; projectDirPath = ""; projectReferences = ( { ProductGroup = BCF8E9DE1A75DE3F005AE243 /* Products */; ProjectRef = BCF8E9DD1A75DE3F005AE243 /* GPUImageMac.xcodeproj */; }, ); projectRoot = ""; targets = ( 79E8A5F31A5ED6A700E6A226 /* SimpleVideoFilter */, 79E8A6061A5ED6A700E6A226 /* SimpleVideoFilterTests */, ); }; /* End PBXProject section */ /* Begin PBXReferenceProxy section */ BCF8E9E21A75DE3F005AE243 /* GPUImage.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; path = GPUImage.framework; remoteRef = BCF8E9E11A75DE3F005AE243 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ 79E8A5F21A5ED6A700E6A226 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( 79E8A5FF1A5ED6A700E6A226 /* Images.xcassets in Resources */, 79C26E2E1A5F02B70054857C /* SLSSimpleVideoFilterWindowController.xib in Resources */, 79E8A6021A5ED6A700E6A226 /* MainMenu.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; 79E8A6051A5ED6A700E6A226 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ 79E8A5F01A5ED6A700E6A226 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 79E8A5FD1A5ED6A700E6A226 /* main.m in Sources */, 79E8A5FB1A5ED6A700E6A226 /* AppDelegate.m in Sources */, 79C26E221A5EDD1C0054857C /* SLSSimpleVideoFilterWindowController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; 79E8A6031A5ED6A700E6A226 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 79E8A60E1A5ED6A700E6A226 /* SimpleVideoFilterTests.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ 79E8A6091A5ED6A700E6A226 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 79E8A5F31A5ED6A700E6A226 /* SimpleVideoFilter */; targetProxy = 79E8A6081A5ED6A700E6A226 /* PBXContainerItemProxy */; }; BCF8E9E41A75DE5B005AE243 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = GPUImage; targetProxy = BCF8E9E31A75DE5B005AE243 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ 79E8A6001A5ED6A700E6A226 /* MainMenu.xib */ = { isa = PBXVariantGroup; children = ( 79E8A6011A5ED6A700E6A226 /* Base */, ); name = MainMenu.xib; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ 79E8A60F1A5ED6A700E6A226 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "-"; COPY_PHASE_STRIP = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.10; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; }; name = Debug; }; 79E8A6101A5ED6A700E6A226 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "-"; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.10; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; }; name = Release; }; 79E8A6121A5ED6A700E6A226 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COMBINE_HIDPI_IMAGES = YES; INFOPLIST_FILE = SimpleVideoFilter/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; }; 79E8A6131A5ED6A700E6A226 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COMBINE_HIDPI_IMAGES = YES; INFOPLIST_FILE = SimpleVideoFilter/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; }; 79E8A6151A5ED6A700E6A226 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; COMBINE_HIDPI_IMAGES = YES; FRAMEWORK_SEARCH_PATHS = ( "$(DEVELOPER_FRAMEWORKS_DIR)", "$(inherited)", ); GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); INFOPLIST_FILE = SimpleVideoFilterTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SimpleVideoFilter.app/Contents/MacOS/SimpleVideoFilter"; }; name = Debug; }; 79E8A6161A5ED6A700E6A226 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; COMBINE_HIDPI_IMAGES = YES; FRAMEWORK_SEARCH_PATHS = ( "$(DEVELOPER_FRAMEWORKS_DIR)", "$(inherited)", ); INFOPLIST_FILE = SimpleVideoFilterTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SimpleVideoFilter.app/Contents/MacOS/SimpleVideoFilter"; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 79E8A5EF1A5ED6A700E6A226 /* Build configuration list for PBXProject "SimpleVideoFilter" */ = { isa = XCConfigurationList; buildConfigurations = ( 79E8A60F1A5ED6A700E6A226 /* Debug */, 79E8A6101A5ED6A700E6A226 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 79E8A6111A5ED6A700E6A226 /* Build configuration list for PBXNativeTarget "SimpleVideoFilter" */ = { isa = XCConfigurationList; buildConfigurations = ( 79E8A6121A5ED6A700E6A226 /* Debug */, 79E8A6131A5ED6A700E6A226 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 79E8A6141A5ED6A700E6A226 /* Build configuration list for PBXNativeTarget "SimpleVideoFilterTests" */ = { isa = XCConfigurationList; buildConfigurations = ( 79E8A6151A5ED6A700E6A226 /* Debug */, 79E8A6161A5ED6A700E6A226 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = 79E8A5EC1A5ED6A700E6A226 /* Project object */; } ================================================ FILE: examples/Mac/SimpleVideoFilter/SimpleVideoFilterTests/Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier com.redqueencoder.$(PRODUCT_NAME:rfc1034identifier) CFBundleInfoDictionaryVersion 6.0 CFBundleName $(PRODUCT_NAME) CFBundlePackageType BNDL CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion 1 ================================================ FILE: examples/Mac/SimpleVideoFilter/SimpleVideoFilterTests/SimpleVideoFilterTests.m ================================================ // // SimpleVideoFilterTests.m // SimpleVideoFilterTests // // Created by Janie Clayton-Hasz on 1/8/15. // Copyright (c) 2015 Red Queen Coder, LLC. All rights reserved. // #import #import @interface SimpleVideoFilterTests : XCTestCase @end @implementation SimpleVideoFilterTests - (void)setUp { [super setUp]; // Put setup code here. This method is called before the invocation of each test method in the class. } - (void)tearDown { // Put teardown code here. This method is called after the invocation of each test method in the class. [super tearDown]; } - (void)testExample { // This is an example of a functional test case. XCTAssert(YES, @"Pass"); } - (void)testPerformanceExample { // This is an example of a performance test case. [self measureBlock:^{ // Put the code you want to measure the time of here. }]; } @end ================================================ FILE: examples/iOS/BenchmarkSuite/BenchmarkSuite/BenchmarkAppDelegate.h ================================================ #import @class ImageFilteringBenchmarkController, VideoFilteringBenchmarkController; @interface BenchmarkAppDelegate : UIResponder { UITabBarController *mainTabBarController; ImageFilteringBenchmarkController *imageFilteringBenchmarkController; VideoFilteringBenchmarkController *videoFilteringBenchmarkController; } @property (strong, nonatomic) UIWindow *window; @end ================================================ FILE: examples/iOS/BenchmarkSuite/BenchmarkSuite/BenchmarkAppDelegate.m ================================================ #import "BenchmarkAppDelegate.h" #import "ImageFilteringBenchmarkController.h" #import "VideoFilteringBenchmarkController.h" // The tab bar icons in this application are courtesy of Joseph Wain / glyphish.com // See the GlyphishIconLicense.txt file for more information on these icons @implementation BenchmarkAppDelegate @synthesize window = _window; - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // Override point for customization after application launch. self.window.backgroundColor = [UIColor whiteColor]; mainTabBarController = [[UITabBarController alloc] initWithNibName:nil bundle:nil]; imageFilteringBenchmarkController = [[ImageFilteringBenchmarkController alloc] initWithNibName:@"BenchmarkTableViewController" bundle:nil]; UIImage *itemImage = [UIImage imageNamed:@"41-picture-frame"]; UITabBarItem *mathTabItem = [[UITabBarItem alloc] initWithTitle:@"Still images" image:itemImage tag:0]; imageFilteringBenchmarkController.tabBarItem = mathTabItem; videoFilteringBenchmarkController = [[VideoFilteringBenchmarkController alloc] initWithNibName:@"BenchmarkTableViewController" bundle:nil]; UIImage *itemImage2 = [UIImage imageNamed:@"86-camera"]; UITabBarItem *mathTabItem2 = [[UITabBarItem alloc] initWithTitle:@"Live video" image:itemImage2 tag:1]; videoFilteringBenchmarkController.tabBarItem = mathTabItem2; NSArray *arrayOfViewControllers = [[NSArray alloc] initWithObjects:imageFilteringBenchmarkController, videoFilteringBenchmarkController, nil]; mainTabBarController.viewControllers = arrayOfViewControllers; mainTabBarController.selectedViewController = imageFilteringBenchmarkController; self.window.rootViewController = mainTabBarController; [self.window makeKeyAndVisible]; return YES; } - (void)applicationWillResignActive:(UIApplication *)application { /* Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. */ } - (void)applicationDidEnterBackground:(UIApplication *)application { /* Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. */ } - (void)applicationWillEnterForeground:(UIApplication *)application { /* Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. */ } - (void)applicationDidBecomeActive:(UIApplication *)application { /* Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. */ } - (void)applicationWillTerminate:(UIApplication *)application { /* Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. */ } @end ================================================ FILE: examples/iOS/BenchmarkSuite/BenchmarkSuite/BenchmarkSuite-Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleDisplayName ${PRODUCT_NAME} CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIconFiles CFBundleIdentifier com.sunsetlakesoftware.${PRODUCT_NAME:rfc1034identifier} CFBundleInfoDictionaryVersion 6.0 CFBundleName ${PRODUCT_NAME} CFBundlePackageType APPL CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion 1.0 LSRequiresIPhoneOS UIFileSharingEnabled UIPrerenderedIcon UIRequiredDeviceCapabilities opengles-2 UISupportedInterfaceOrientations UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UISupportedInterfaceOrientations~ipad UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight ================================================ FILE: examples/iOS/BenchmarkSuite/BenchmarkSuite/BenchmarkSuite-Prefix.pch ================================================ // // Prefix header for all source files of the 'BenchmarkSuite' target in the 'BenchmarkSuite' project // #import #ifndef __IPHONE_3_0 #warning "This project uses features only available in iOS SDK 3.0 and later." #endif #ifdef __OBJC__ #import #import #endif ================================================ FILE: examples/iOS/BenchmarkSuite/BenchmarkSuite/BenchmarkTableViewController.h ================================================ #import @interface BenchmarkTableViewController : UITableViewController { CGFloat processingTimeForCPURoutine, processingTimeForCoreImageRoutine, processingTimeForGPUImageRoutine; } // Benchmarks - (void)runBenchmark; @end ================================================ FILE: examples/iOS/BenchmarkSuite/BenchmarkSuite/BenchmarkTableViewController.m ================================================ #import "BenchmarkTableViewController.h" typedef enum { GPUIMAGE_BENCHMARK_CPU, GPUIMAGE_BENCHMARK_COREIMAGE, GPUIMAGE_BENCHMARK_GPUIMAGE } GPUImageBenchmarkSection; @implementation BenchmarkTableViewController #pragma mark - #pragma mark Initialization and teardown - (id)initWithStyle:(UITableViewStyle)style { self = [super initWithStyle:style]; if (self) { } return self; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; } #pragma mark - View lifecycle - (void)viewDidLoad { [super viewDidLoad]; self.tableView.tableHeaderView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, self.tableView.frame.size.width, 60.0f)]; UIButton *benchmarkButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; benchmarkButton.frame = CGRectMake(60.0f, 20.0f, 200.0f, 40.0f); [benchmarkButton setTitle:@"Run Benchmark" forState:UIControlStateNormal]; [benchmarkButton addTarget:self action:@selector(runBenchmark) forControlEvents:(UIControlEventTouchUpInside | UIControlEventTouchUpOutside)]; [self.tableView.tableHeaderView addSubview:benchmarkButton]; } - (void)viewDidUnload { [super viewDidUnload]; } - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; } - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; } - (void)viewWillDisappear:(BOOL)animated { [super viewWillDisappear:animated]; } - (void)viewDidDisappear:(BOOL)animated { [super viewDidDisappear:animated]; } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationPortrait); } #pragma mark - Table view data source - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return 3; } - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { return NSLocalizedStringFromTable(@"Processing times", @"Localized", nil); return nil; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"StillImageBenchmarkCell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:CellIdentifier]; cell.detailTextLabel.textColor = [UIColor colorWithRed:50.0f/255.0f green:79.0f/255.0f blue:133.0f/255.0f alpha:1.0f]; cell.detailTextLabel.highlightedTextColor = [UIColor whiteColor]; } switch (indexPath.row) { case GPUIMAGE_BENCHMARK_CPU: { cell.textLabel.text = NSLocalizedStringFromTable(@"CPU", @"Localized", nil); cell.detailTextLabel.text = [NSString stringWithFormat:@"%.2f ms", processingTimeForCPURoutine]; }; break; case GPUIMAGE_BENCHMARK_COREIMAGE: { cell.textLabel.text = NSLocalizedStringFromTable(@"Core Image", @"Localized", nil); cell.detailTextLabel.text = [NSString stringWithFormat:@"%.2f ms", processingTimeForCoreImageRoutine]; }; break; case GPUIMAGE_BENCHMARK_GPUIMAGE: { cell.textLabel.text = NSLocalizedStringFromTable(@"GPUImage", @"Localized", nil); cell.detailTextLabel.text = [NSString stringWithFormat:@"%.2f ms", processingTimeForGPUImageRoutine]; }; break; default: { cell.textLabel.text = NSLocalizedStringFromTable(@"CPU", @"Localized", nil); cell.detailTextLabel.text = [NSString stringWithFormat:@"%.2f ms", processingTimeForCPURoutine]; } } return cell; } #pragma mark - Table view delegate - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { // Navigation logic may go here. Create and push another view controller. /* <#DetailViewController#> *detailViewController = [[<#DetailViewController#> alloc] initWithNibName:@"<#Nib name#>" bundle:nil]; // ... // Pass the selected object to the new view controller. [self.navigationController pushViewController:detailViewController animated:YES]; */ } #pragma mark - #pragma mark Benchmarks - (void)runBenchmark; { } @end ================================================ FILE: examples/iOS/BenchmarkSuite/BenchmarkSuite/BenchmarkTableViewController.xib ================================================ 1280 11D50 1938 1138.32 568.00 com.apple.InterfaceBuilder.IBCocoaTouchPlugin 933 IBProxyObject IBUITableView com.apple.InterfaceBuilder.IBCocoaTouchPlugin PluginDependencyRecalculationVersion IBFilesOwner IBCocoaTouchFramework IBFirstResponder IBCocoaTouchFramework 274 {{0, 20}, {320, 411}} 10 549453824 {512, 1} TU0AKgAACAjFzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/ y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/ xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/ xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/ xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/ xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/ xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/ y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/ y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/ xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/ xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/ xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/ xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/ xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/ y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/ y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/ xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/ xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/ xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/ xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/ xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/ y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/ y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/ xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/ xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/ xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/ xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/ xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/ y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/ y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/ xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/ xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/ xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/ xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/ xczS/8vS2P/L0tj/xczU/wANAQAAAwAAAAECAAAAAQEAAwAAAAEAAQAAAQIAAwAAAAQAAAiqAQMAAwAA AAEAAQAAAQYAAwAAAAEAAgAAAREABAAAAAEAAAAIARIAAwAAAAEAAQAAARUAAwAAAAEABAAAARYAAwAA AAEAAQAAARcABAAAAAEAAAgAARwAAwAAAAEAAQAAAVIAAwAAAAEAAQAAAVMAAwAAAAQAAAiyAAAAAAAI AAgACAAIAAEAAQABAAE 3 MCAwAA groupTableViewBackgroundColor NO YES NO IBCocoaTouchFramework NO 1 2 0 YES 44 10 10 view 5 dataSource 6 delegate 7 0 -1 File's Owner -2 4 ImageFilteringBenchmarkController com.apple.InterfaceBuilder.IBCocoaTouchPlugin UIResponder com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin 7 0 IBCocoaTouchFramework YES 3 933 ================================================ FILE: examples/iOS/BenchmarkSuite/BenchmarkSuite/ImageFilteringBenchmarkController.h ================================================ #import "BenchmarkTableViewController.h" @interface ImageFilteringBenchmarkController : BenchmarkTableViewController { CIContext *coreImageContext; } // Still image benchmarks - (UIImage *)imageProcessedOnCPU:(UIImage *)imageToProcess; - (UIImage *)imageProcessedUsingCoreImage:(UIImage *)imageToProcess; - (UIImage *)imageProcessedUsingGPUImage:(UIImage *)imageToProcess; - (void)writeImage:(UIImage *)imageToWrite toFile:(NSString *)fileName; @end ================================================ FILE: examples/iOS/BenchmarkSuite/BenchmarkSuite/ImageFilteringBenchmarkController.m ================================================ #import "ImageFilteringBenchmarkController.h" #import "GPUImage.h" @implementation ImageFilteringBenchmarkController #pragma mark - #pragma mark Still image benchmarks - (void)runBenchmark; { // Take in a UIImage, filter it at full resolution (2000 x 1494), and time one operation of this // Images are written out to disk to verify that the filter worked as expected UIImage *inputImage = [UIImage imageNamed:@"Lambeau.jpg"]; [self imageProcessedOnCPU:inputImage]; // I've disabled the writing here, because something's busted with that // UIImage *imageFilteredUsingCPURoutine = [self imageProcessedOnCPU:inputImage]; // [self writeImage:imageFilteredUsingCPURoutine toFile:@"Lambeau-CPUFiltered.png"]; // Pulling creating the Core Image context out of the benchmarking area, because it can only be created once and reused if (coreImageContext == nil) { coreImageContext = [CIContext contextWithOptions:nil]; } UIImage *imageFilteredUsingCoreImageRoutine = [self imageProcessedUsingCoreImage:inputImage]; [self writeImage:imageFilteredUsingCoreImageRoutine toFile:@"Lambeau-CoreImageFiltered.png"]; UIImage *imageFilteredUsingGPUImageRoutine = [self imageProcessedUsingGPUImage:inputImage]; [self writeImage:imageFilteredUsingGPUImageRoutine toFile:@"Lambeau-GPUImageFiltered.png"]; [self.tableView reloadData]; } - (UIImage *)imageProcessedOnCPU:(UIImage *)imageToProcess; { // Drawn from Rahul Vyas' answer on Stack Overflow at http://stackoverflow.com/a/4211729/19679 CFAbsoluteTime elapsedTime, startTime = CFAbsoluteTimeGetCurrent(); CGImageRef cgImage = [imageToProcess CGImage]; CGImageRetain(cgImage); CGDataProviderRef provider = CGImageGetDataProvider(cgImage); CFDataRef bitmapData = CGDataProviderCopyData(provider); UInt8* data = (UInt8*)CFDataGetBytePtr(bitmapData); CGImageRelease(cgImage); int width = imageToProcess.size.width; int height = imageToProcess.size.height; NSInteger myDataLength = width * height * 4; for (int i = 0; i < myDataLength; i+=4) { UInt8 r_pixel = data[i]; UInt8 g_pixel = data[i+1]; UInt8 b_pixel = data[i+2]; int outputRed = (r_pixel * .393) + (g_pixel *.769) + (b_pixel * .189); int outputGreen = (r_pixel * .349) + (g_pixel *.686) + (b_pixel * .168); int outputBlue = (r_pixel * .272) + (g_pixel *.534) + (b_pixel * .131); if(outputRed>255)outputRed=255; if(outputGreen>255)outputGreen=255; if(outputBlue>255)outputBlue=255; data[i] = outputRed; data[i+1] = outputGreen; data[i+2] = outputBlue; } CGDataProviderRef provider2 = CGDataProviderCreateWithData(NULL, data, myDataLength, NULL); int bitsPerComponent = 8; int bitsPerPixel = 32; int bytesPerRow = 4 * width; CGColorSpaceRef colorSpaceRef = CGColorSpaceCreateDeviceRGB(); CGBitmapInfo bitmapInfo = kCGBitmapByteOrderDefault; CGColorRenderingIntent renderingIntent = kCGRenderingIntentDefault; CGImageRef imageRef = CGImageCreate(width, height, bitsPerComponent, bitsPerPixel, bytesPerRow, colorSpaceRef, bitmapInfo, provider2, NULL, NO, renderingIntent); CGColorSpaceRelease(colorSpaceRef); CGDataProviderRelease(provider2); CFRelease(bitmapData); UIImage *sepiaImage = [UIImage imageWithCGImage:imageRef]; CGImageRelease(imageRef); elapsedTime = CFAbsoluteTimeGetCurrent() - startTime; processingTimeForCPURoutine = elapsedTime * 1000.0; return sepiaImage; } - (UIImage *)imageProcessedUsingCoreImage:(UIImage *)imageToProcess; { /* NSArray *filterNames = [CIFilter filterNamesInCategory:kCICategoryBuiltIn]; NSLog(@"Built in filters"); for (NSString *currentFilterName in filterNames) { NSLog(@"%@", currentFilterName); } */ CFAbsoluteTime elapsedTime, startTime = CFAbsoluteTimeGetCurrent(); CIImage *inputImage = [[CIImage alloc] initWithCGImage:imageToProcess.CGImage]; CIFilter *sepiaTone = [CIFilter filterWithName:@"CISepiaTone" keysAndValues: kCIInputImageKey, inputImage, @"inputIntensity", [NSNumber numberWithFloat:1.0], nil]; CIImage *result = [sepiaTone outputImage]; // UIImage *resultImage = [UIImage imageWithCIImage:result]; // This gives a nil image, because it doesn't render, unless I'm doing something wrong CGImageRef resultRef = [coreImageContext createCGImage:result fromRect:CGRectMake(0, 0, imageToProcess.size.width, imageToProcess.size.height)]; UIImage *resultImage = [UIImage imageWithCGImage:resultRef]; CGImageRelease(resultRef); elapsedTime = CFAbsoluteTimeGetCurrent() - startTime; processingTimeForCoreImageRoutine = elapsedTime * 1000.0; return resultImage; } - (UIImage *)imageProcessedUsingGPUImage:(UIImage *)imageToProcess; { CFAbsoluteTime elapsedTime, startTime = CFAbsoluteTimeGetCurrent(); GPUImagePicture *stillImageSource = [[GPUImagePicture alloc] initWithImage:imageToProcess]; GPUImageSepiaFilter *stillImageFilter = [[GPUImageSepiaFilter alloc] init]; [stillImageSource addTarget:stillImageFilter]; [stillImageFilter useNextFrameForImageCapture]; [stillImageSource processImage]; UIImage *currentFilteredVideoFrame = [stillImageFilter imageFromCurrentFramebuffer]; elapsedTime = CFAbsoluteTimeGetCurrent() - startTime; processingTimeForGPUImageRoutine = elapsedTime * 1000.0; return currentFilteredVideoFrame; } - (void)writeImage:(UIImage *)imageToWrite toFile:(NSString *)fileName; { if (imageToWrite == nil) { return; } NSData *dataForPNGFile = UIImagePNGRepresentation(imageToWrite); NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSError *error = nil; if (![dataForPNGFile writeToFile:[documentsDirectory stringByAppendingPathComponent:fileName] options:NSAtomicWrite error:&error]) { return; } } @end ================================================ FILE: examples/iOS/BenchmarkSuite/BenchmarkSuite/VideoFilteringBenchmarkController.h ================================================ #import "BenchmarkTableViewController.h" #import "VideoFilteringDisplayController.h" @interface VideoFilteringBenchmarkController : BenchmarkTableViewController { VideoFilteringDisplayController *videoFilteringDisplayController; } @end ================================================ FILE: examples/iOS/BenchmarkSuite/BenchmarkSuite/VideoFilteringBenchmarkController.m ================================================ #import "VideoFilteringBenchmarkController.h" @implementation VideoFilteringBenchmarkController #pragma mark - #pragma mark Benchmarks - (void)runBenchmark; { videoFilteringDisplayController = [[VideoFilteringDisplayController alloc] initWithNibName:@"VideoFilteringDisplayController" bundle:nil]; videoFilteringDisplayController.delegate = self; [self presentModalViewController:videoFilteringDisplayController animated:YES]; } - (void)finishedTestWithAverageTimesForCPU:(CGFloat)cpuTime coreImage:(CGFloat)coreImageTime gpuImage:(CGFloat)gpuImageTime; { [self dismissModalViewControllerAnimated:YES]; processingTimeForCPURoutine = cpuTime; processingTimeForCoreImageRoutine = coreImageTime; processingTimeForGPUImageRoutine = gpuImageTime; [self.tableView reloadData]; } @end ================================================ FILE: examples/iOS/BenchmarkSuite/BenchmarkSuite/VideoFilteringDisplayController.h ================================================ #import #import #import "GPUImage.h" @protocol VideoFilteringCallback; @interface VideoFilteringDisplayController : UIViewController { CGFloat totalFrameTimeForCPU, totalFrameTimeForCoreImage, totalFrameTimeForGPUImage; NSUInteger numberOfCPUFramesCaptured, numberOfCoreImageFramesCaptured, numberOfGPUImageFramesCaptured; GLKView *videoDisplayView; AVCaptureSession *captureSession; AVCaptureDeviceInput *videoInput; AVCaptureVideoDataOutput *videoOutput; CIContext *coreImageContext; CIFilter *coreImageFilter; GLuint _renderBuffer; BOOL processUsingCPU; GPUImageVideoCamera *videoCamera; GPUImageOutput *benchmarkedGPUImageFilter; GPUImageView *filterView; __unsafe_unretained id delegate; } @property(unsafe_unretained, nonatomic) id delegate; @property (strong, nonatomic) EAGLContext *openGLESContext; // Video filtering - (void)startAVFoundationVideoProcessing; - (void)displayVideoForCPU; - (void)displayVideoForCoreImage; - (void)displayVideoForGPUImage; @end @protocol VideoFilteringCallback - (void)finishedTestWithAverageTimesForCPU:(CGFloat)cpuTime coreImage:(CGFloat)coreImageTime gpuImage:(CGFloat)gpuImageTime; @end ================================================ FILE: examples/iOS/BenchmarkSuite/BenchmarkSuite/VideoFilteringDisplayController.m ================================================ #import "VideoFilteringDisplayController.h" #define BLURSIGMA 4.0 @implementation VideoFilteringDisplayController - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { // Custom initialization } return self; } #pragma mark - View lifecycle - (void)viewDidLoad { [super viewDidLoad]; [self displayVideoForCPU]; } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationPortrait); } #pragma mark - #pragma mark Video filtering - (void)startAVFoundationVideoProcessing; { // Grab the back-facing camera AVCaptureDevice *backFacingCamera = nil; NSArray *devices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo]; for (AVCaptureDevice *device in devices) { if ([device position] == AVCaptureDevicePositionBack) { backFacingCamera = device; } } // Create the capture session captureSession = [[AVCaptureSession alloc] init]; // Add the video input NSError *error = nil; videoInput = [[AVCaptureDeviceInput alloc] initWithDevice:backFacingCamera error:&error]; if ([captureSession canAddInput:videoInput]) { [captureSession addInput:videoInput]; } // Add the video frame output videoOutput = [[AVCaptureVideoDataOutput alloc] init]; [videoOutput setAlwaysDiscardsLateVideoFrames:YES]; // Use RGB frames instead of YUV to ease color processing [videoOutput setVideoSettings:[NSDictionary dictionaryWithObject:[NSNumber numberWithInt:kCVPixelFormatType_32BGRA] forKey:(id)kCVPixelBufferPixelFormatTypeKey]]; // dispatch_queue_t videoQueue = dispatch_queue_create("com.sunsetlakesoftware.colortracking.videoqueue", NULL); // [videoOutput setSampleBufferDelegate:self queue:videoQueue]; [videoOutput setSampleBufferDelegate:self queue:dispatch_get_main_queue()]; if ([captureSession canAddOutput:videoOutput]) { [captureSession addOutput:videoOutput]; } else { NSLog(@"Couldn't add video output"); } // [captureSession setSessionPreset:AVCaptureSessionPreset1280x720]; [captureSession setSessionPreset:AVCaptureSessionPreset640x480]; } - (void)displayVideoForCPU; { NSLog(@"Start CPU Image"); totalFrameTimeForCPU = 0.0; numberOfCPUFramesCaptured = 0; [self startAVFoundationVideoProcessing]; processUsingCPU = YES; [captureSession startRunning]; double delayInSeconds = 10.0; dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC); dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ [captureSession stopRunning]; // Remove view captureSession = nil; videoInput = nil; videoOutput = nil; NSLog(@"End CPU Image"); [self displayVideoForCoreImage]; }); } - (void)displayVideoForCoreImage; { totalFrameTimeForCoreImage = 0.0; numberOfCoreImageFramesCaptured = 0; NSLog(@"Start Core Image"); self.openGLESContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]; if (!self.openGLESContext) { NSLog(@"Failed to create ES context"); } [EAGLContext setCurrentContext:self.openGLESContext]; videoDisplayView = [[GLKView alloc] initWithFrame:self.view.bounds context:self.openGLESContext]; videoDisplayView.contentScaleFactor = [[UIScreen mainScreen] scale]; // videoDisplayView.frame = self.view.bounds; [self.view addSubview:videoDisplayView]; glGenRenderbuffers(1, &_renderBuffer); glBindRenderbuffer(GL_RENDERBUFFER, _renderBuffer); // videoDisplayView.context = self.openGLESContext; // videoDisplayView.drawableDepthFormat = GLKViewDrawableDepthFormat24; // [videoDisplayView bindDrawable]; // Disable color correction to provide a more fair benchmark NSMutableDictionary *options = [[NSMutableDictionary alloc] init]; [options setObject: [NSNull null] forKey: kCIContextWorkingColorSpace]; coreImageContext = [CIContext contextWithEAGLContext:self.openGLESContext options:options]; // sepiaCoreImageFilter = [CIFilter filterWithName:@"CIGaussianBlur"]; // [sepiaCoreImageFilter setValue:[NSNumber numberWithFloat:BLURSIGMA] forKey:@"inputRadius"]; // sepiaCoreImageFilter = [CIFilter filterWithName:@"CISepiaTone"]; // [sepiaCoreImageFilter setValue:[NSNumber numberWithFloat:1.0] forKey:@"inputIntensity"]; coreImageFilter = [CIFilter filterWithName:@"CIGammaAdjust"]; [coreImageFilter setValue:[NSNumber numberWithFloat:0.75] forKey:@"inputPower"]; [self startAVFoundationVideoProcessing]; processUsingCPU = NO; [captureSession startRunning]; double delayInSeconds = 10.0; dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC); dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ [captureSession stopRunning]; [videoDisplayView removeFromSuperview]; videoDisplayView = nil; captureSession = nil; videoInput = nil; videoOutput = nil; self.openGLESContext = nil; glDeleteRenderbuffers(1, &_renderBuffer); NSLog(@"End Core Image"); sleep(1); [self displayVideoForGPUImage]; }); } - (void)displayVideoForGPUImage; { totalFrameTimeForGPUImage = 0.0; numberOfGPUImageFramesCaptured = 0; NSLog(@"Start GPU Image"); videoCamera = [[GPUImageVideoCamera alloc] initWithSessionPreset:AVCaptureSessionPreset640x480 cameraPosition:AVCaptureDevicePositionBack]; // videoCamera = [[GPUImageVideoCamera alloc] initWithSessionPreset:AVCaptureSessionPreset1280x720 cameraPosition:AVCaptureDevicePositionBack]; videoCamera.runBenchmark = YES; videoCamera.outputImageOrientation = UIInterfaceOrientationPortrait; // sepiaFilter = [[GPUImageSepiaFilter alloc] init]; // sepiaFilter = [[GPUImageiOSBlurFilter alloc] init]; // sepiaFilter = [[GPUImageGaussianBlurFilter alloc] init]; // [(GPUImageGaussianBlurFilter *)sepiaFilter setBlurRadiusInPixels:BLURSIGMA]; benchmarkedGPUImageFilter = [[GPUImageGammaFilter alloc] init]; [(GPUImageGammaFilter *)benchmarkedGPUImageFilter setGamma:0.75]; [videoCamera addTarget:benchmarkedGPUImageFilter]; filterView = [[GPUImageView alloc] initWithFrame:self.view.bounds]; [self.view addSubview:filterView]; [benchmarkedGPUImageFilter addTarget:filterView]; [videoCamera startCameraCapture]; double delayInSeconds = 10.0; dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC); dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ [videoCamera stopCameraCapture]; [filterView removeFromSuperview]; filterView = nil; captureSession = nil; videoInput = nil; videoOutput = nil; NSLog(@"End GPU Image"); [delegate finishedTestWithAverageTimesForCPU:(totalFrameTimeForCPU * 1000.0 / numberOfCPUFramesCaptured) coreImage:(totalFrameTimeForCoreImage * 1000.0 / numberOfCoreImageFramesCaptured) gpuImage:[videoCamera averageFrameDurationDuringCapture]]; videoCamera = nil; }); } -(void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection { CVPixelBufferRef pixelBuffer = (CVPixelBufferRef)CMSampleBufferGetImageBuffer(sampleBuffer); if (processUsingCPU) { // I only do the pixel processing here, not any upload to the view yet // Still, this should be sufficient to get a conservative estimate of the performance of a CPU-bound filtering routine CVPixelBufferLockBaseAddress(pixelBuffer, 0); CFAbsoluteTime elapsedTime, startTime = CFAbsoluteTimeGetCurrent(); unsigned char *data = (unsigned char *)CVPixelBufferGetBaseAddress(pixelBuffer); size_t bufferHeight = CVPixelBufferGetHeight(pixelBuffer); size_t bufferWidth = CVPixelBufferGetWidth(pixelBuffer); NSInteger myDataLength = bufferWidth * bufferHeight * 4; for (int i = 0; i < myDataLength; i+=4) { UInt8 r_pixel = data[i]; UInt8 g_pixel = data[i+1]; UInt8 b_pixel = data[i+2]; int outputRed = (r_pixel * .393) + (g_pixel *.769) + (b_pixel * .189); int outputGreen = (r_pixel * .349) + (g_pixel *.686) + (b_pixel * .168); int outputBlue = (r_pixel * .272) + (g_pixel *.534) + (b_pixel * .131); if(outputRed>255)outputRed=255; if(outputGreen>255)outputGreen=255; if(outputBlue>255)outputBlue=255; data[i] = outputRed; data[i+1] = outputGreen; data[i+2] = outputBlue; } elapsedTime = CFAbsoluteTimeGetCurrent() - startTime; // NSLog(@"CPU frame time: %f", elapsedTime * 1000.0); totalFrameTimeForCPU += elapsedTime; numberOfCPUFramesCaptured++; CVPixelBufferUnlockBaseAddress(pixelBuffer, 0); } else { CFAbsoluteTime elapsedTime, startTime = CFAbsoluteTimeGetCurrent(); CIImage *inputImage = [CIImage imageWithCVPixelBuffer:pixelBuffer]; inputImage = [inputImage imageByApplyingTransform:CGAffineTransformMakeRotation(-M_PI / 2.0)]; [coreImageFilter setValue:inputImage forKey:kCIInputImageKey]; CIImage *outputImage = [coreImageFilter outputImage]; // CGFloat scale = UIScreen.mainScreen.scale; // CGRect s = CGRectMake(0, 0, [[UIScreen mainScreen] bounds].size.width * scale, [[UIScreen mainScreen] bounds].size.height * scale); CGRect s = CGRectMake(0, 0, 480, 640); // CGRect s = CGRectMake(0, 0, 720, 1280); [coreImageContext drawImage:outputImage inRect:s fromRect:[inputImage extent]]; [self.openGLESContext presentRenderbuffer:GL_RENDERBUFFER]; elapsedTime = CFAbsoluteTimeGetCurrent() - startTime; // NSLog(@"Core Image frame time: %f", elapsedTime * 1000.0); totalFrameTimeForCoreImage += elapsedTime; numberOfCoreImageFramesCaptured++; } } #pragma mark - #pragma mark Accessors @synthesize delegate; @synthesize openGLESContext; @end ================================================ FILE: examples/iOS/BenchmarkSuite/BenchmarkSuite/VideoFilteringDisplayController.xib ================================================ 1280 11D50 2177 1138.32 568.00 com.apple.InterfaceBuilder.IBCocoaTouchPlugin 1173 IBProxyObject IBUIView com.apple.InterfaceBuilder.IBCocoaTouchPlugin PluginDependencyRecalculationVersion IBFilesOwner IBCocoaTouchFramework IBFirstResponder IBCocoaTouchFramework 274 {{0, 20}, {320, 460}} 3 MQA 2 IBCocoaTouchFramework view 3 0 1 -1 File's Owner -2 VideoFilteringDisplayController com.apple.InterfaceBuilder.IBCocoaTouchPlugin UIResponder com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin 3 VideoFilteringDisplayController UIViewController IBProjectSource ./Classes/VideoFilteringDisplayController.h 0 IBCocoaTouchFramework YES 3 1173 ================================================ FILE: examples/iOS/BenchmarkSuite/BenchmarkSuite/en.lproj/InfoPlist.strings ================================================ /* Localized versions of Info.plist keys */ ================================================ FILE: examples/iOS/BenchmarkSuite/BenchmarkSuite/main.m ================================================ #import #import "BenchmarkAppDelegate.h" int main(int argc, char *argv[]) { @autoreleasepool { return UIApplicationMain(argc, argv, nil, NSStringFromClass([BenchmarkAppDelegate class])); } } ================================================ FILE: examples/iOS/BenchmarkSuite/BenchmarkSuite.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ BC982A9614EDF8750001FF6F /* GLKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC982A9514EDF8740001FF6F /* GLKit.framework */; }; BCB3C3D216BCA4AD003D26B0 /* Icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C3CD16BCA4AD003D26B0 /* Icon-72.png */; }; BCB3C3D316BCA4AD003D26B0 /* Icon-72@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C3CE16BCA4AD003D26B0 /* Icon-72@2x.png */; }; BCB3C3D416BCA4AD003D26B0 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C3CF16BCA4AD003D26B0 /* Icon.png */; }; BCB3C3D516BCA4AD003D26B0 /* Icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C3D016BCA4AD003D26B0 /* Icon@2x.png */; }; BCB3C3D616BCA4AD003D26B0 /* iTunesArtwork.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C3D116BCA4AD003D26B0 /* iTunesArtwork.png */; }; BCC3D1CE14ECB1DB00E111AF /* ImageFilteringBenchmarkController.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC3D1CD14ECB1DB00E111AF /* ImageFilteringBenchmarkController.m */; }; BCF866DC1725A2EA00912E34 /* libGPUImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BCF866D71725A2D800912E34 /* libGPUImage.a */; }; BCF9D15B14EAD24200986461 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCF9D15A14EAD24200986461 /* UIKit.framework */; }; BCF9D15D14EAD24200986461 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCF9D15C14EAD24200986461 /* Foundation.framework */; }; BCF9D15F14EAD24200986461 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCF9D15E14EAD24200986461 /* CoreGraphics.framework */; }; BCF9D16514EAD24200986461 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = BCF9D16314EAD24200986461 /* InfoPlist.strings */; }; BCF9D16714EAD24200986461 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF9D16614EAD24200986461 /* main.m */; }; BCF9D16B14EAD24200986461 /* BenchmarkAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF9D16A14EAD24200986461 /* BenchmarkAppDelegate.m */; }; BCF9D17414EAD33A00986461 /* BenchmarkTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF9D17214EAD33A00986461 /* BenchmarkTableViewController.m */; }; BCF9D17514EAD33A00986461 /* BenchmarkTableViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = BCF9D17314EAD33A00986461 /* BenchmarkTableViewController.xib */; }; BCF9D17914EAD5C900986461 /* VideoFilteringBenchmarkController.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF9D17714EAD5C900986461 /* VideoFilteringBenchmarkController.m */; }; BCF9D17E14EAD5F900986461 /* VideoFilteringDisplayController.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF9D17C14EAD5F900986461 /* VideoFilteringDisplayController.m */; }; BCF9D17F14EAD5F900986461 /* VideoFilteringDisplayController.xib in Resources */ = {isa = PBXBuildFile; fileRef = BCF9D17D14EAD5F900986461 /* VideoFilteringDisplayController.xib */; }; BCF9D19914EC29FA00986461 /* 41-picture-frame.png in Resources */ = {isa = PBXBuildFile; fileRef = BCF9D19314EC29FA00986461 /* 41-picture-frame.png */; }; BCF9D19A14EC29FA00986461 /* 41-picture-frame@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = BCF9D19414EC29FA00986461 /* 41-picture-frame@2x.png */; }; BCF9D19B14EC29FA00986461 /* 46-movie-2.png in Resources */ = {isa = PBXBuildFile; fileRef = BCF9D19514EC29FA00986461 /* 46-movie-2.png */; }; BCF9D19C14EC29FA00986461 /* 46-movie-2@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = BCF9D19614EC29FA00986461 /* 46-movie-2@2x.png */; }; BCF9D19D14EC29FA00986461 /* 86-camera.png in Resources */ = {isa = PBXBuildFile; fileRef = BCF9D19714EC29FA00986461 /* 86-camera.png */; }; BCF9D19E14EC29FA00986461 /* 86-camera@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = BCF9D19814EC29FA00986461 /* 86-camera@2x.png */; }; BCF9D1DD14EC4F6C00986461 /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCF9D1DA14EC4F6C00986461 /* CoreMedia.framework */; }; BCF9D1DE14EC4F6C00986461 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCF9D1DB14EC4F6C00986461 /* CoreVideo.framework */; }; BCF9D1DF14EC4F6C00986461 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCF9D1DC14EC4F6C00986461 /* QuartzCore.framework */; }; BCF9D1E114EC4F7300986461 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCF9D1E014EC4F7300986461 /* OpenGLES.framework */; }; BCF9D1E314EC4F7C00986461 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCF9D1E214EC4F7C00986461 /* AVFoundation.framework */; }; BCF9D1EA14EC569700986461 /* Lambeau.jpg in Resources */ = {isa = PBXBuildFile; fileRef = BCF9D1E914EC569700986461 /* Lambeau.jpg */; }; BCF9D20C14EC7EB100986461 /* CoreImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCF9D20B14EC7EB100986461 /* CoreImage.framework */; }; E5066F251855A55B008C7682 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E5066F241855A55B008C7682 /* Default-568h@2x.png */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ BCF866D61725A2D800912E34 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BCF9D1CA14EC4F3F00986461 /* GPUImage.xcodeproj */; proxyType = 2; remoteGlobalIDString = BCF1A33414DDB1EC00852800; remoteInfo = GPUImage; }; BCF866D81725A2D800912E34 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BCF9D1CA14EC4F3F00986461 /* GPUImage.xcodeproj */; proxyType = 2; remoteGlobalIDString = BCF1A34414DDB1EC00852800; remoteInfo = GPUImageTests; }; BCF866DA1725A2E400912E34 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BCF9D1CA14EC4F3F00986461 /* GPUImage.xcodeproj */; proxyType = 1; remoteGlobalIDString = BCF1A33314DDB1EC00852800; remoteInfo = GPUImage; }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ BC982A9514EDF8740001FF6F /* GLKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLKit.framework; path = System/Library/Frameworks/GLKit.framework; sourceTree = SDKROOT; }; BCB3C3CD16BCA4AD003D26B0 /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-72.png"; path = "../../SharedIcons/Icon-72.png"; sourceTree = ""; }; BCB3C3CE16BCA4AD003D26B0 /* Icon-72@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-72@2x.png"; path = "../../SharedIcons/Icon-72@2x.png"; sourceTree = ""; }; BCB3C3CF16BCA4AD003D26B0 /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Icon.png; path = ../../SharedIcons/Icon.png; sourceTree = ""; }; BCB3C3D016BCA4AD003D26B0 /* Icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon@2x.png"; path = "../../SharedIcons/Icon@2x.png"; sourceTree = ""; }; BCB3C3D116BCA4AD003D26B0 /* iTunesArtwork.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = iTunesArtwork.png; path = ../../SharedIcons/iTunesArtwork.png; sourceTree = ""; }; BCC3D1CC14ECB1DB00E111AF /* ImageFilteringBenchmarkController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageFilteringBenchmarkController.h; sourceTree = ""; }; BCC3D1CD14ECB1DB00E111AF /* ImageFilteringBenchmarkController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ImageFilteringBenchmarkController.m; sourceTree = ""; }; BCF9D15614EAD24200986461 /* BenchmarkSuite.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BenchmarkSuite.app; sourceTree = BUILT_PRODUCTS_DIR; }; BCF9D15A14EAD24200986461 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; BCF9D15C14EAD24200986461 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; BCF9D15E14EAD24200986461 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; BCF9D16214EAD24200986461 /* BenchmarkSuite-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "BenchmarkSuite-Info.plist"; sourceTree = ""; }; BCF9D16414EAD24200986461 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; BCF9D16614EAD24200986461 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; BCF9D16814EAD24200986461 /* BenchmarkSuite-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "BenchmarkSuite-Prefix.pch"; sourceTree = ""; }; BCF9D16914EAD24200986461 /* BenchmarkAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BenchmarkAppDelegate.h; sourceTree = ""; }; BCF9D16A14EAD24200986461 /* BenchmarkAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BenchmarkAppDelegate.m; sourceTree = ""; }; BCF9D17114EAD33A00986461 /* BenchmarkTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BenchmarkTableViewController.h; sourceTree = ""; }; BCF9D17214EAD33A00986461 /* BenchmarkTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BenchmarkTableViewController.m; sourceTree = ""; }; BCF9D17314EAD33A00986461 /* BenchmarkTableViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = BenchmarkTableViewController.xib; sourceTree = ""; }; BCF9D17614EAD5C900986461 /* VideoFilteringBenchmarkController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoFilteringBenchmarkController.h; sourceTree = ""; }; BCF9D17714EAD5C900986461 /* VideoFilteringBenchmarkController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VideoFilteringBenchmarkController.m; sourceTree = ""; }; BCF9D17B14EAD5F900986461 /* VideoFilteringDisplayController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoFilteringDisplayController.h; sourceTree = ""; }; BCF9D17C14EAD5F900986461 /* VideoFilteringDisplayController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VideoFilteringDisplayController.m; sourceTree = ""; }; BCF9D17D14EAD5F900986461 /* VideoFilteringDisplayController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = VideoFilteringDisplayController.xib; sourceTree = ""; }; BCF9D19314EC29FA00986461 /* 41-picture-frame.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "41-picture-frame.png"; sourceTree = ""; }; BCF9D19414EC29FA00986461 /* 41-picture-frame@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "41-picture-frame@2x.png"; sourceTree = ""; }; BCF9D19514EC29FA00986461 /* 46-movie-2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "46-movie-2.png"; sourceTree = ""; }; BCF9D19614EC29FA00986461 /* 46-movie-2@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "46-movie-2@2x.png"; sourceTree = ""; }; BCF9D19714EC29FA00986461 /* 86-camera.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "86-camera.png"; sourceTree = ""; }; BCF9D19814EC29FA00986461 /* 86-camera@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "86-camera@2x.png"; sourceTree = ""; }; BCF9D1CA14EC4F3F00986461 /* GPUImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = GPUImage.xcodeproj; path = ../../../framework/GPUImage.xcodeproj; sourceTree = ""; }; BCF9D1DA14EC4F6C00986461 /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; }; BCF9D1DB14EC4F6C00986461 /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = System/Library/Frameworks/CoreVideo.framework; sourceTree = SDKROOT; }; BCF9D1DC14EC4F6C00986461 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; BCF9D1E014EC4F7300986461 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; BCF9D1E214EC4F7C00986461 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; BCF9D1E914EC569700986461 /* Lambeau.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; name = Lambeau.jpg; path = ../../SimpleImageFilter/SimpleImageFilter/Lambeau.jpg; sourceTree = ""; }; BCF9D20B14EC7EB100986461 /* CoreImage.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreImage.framework; path = System/Library/Frameworks/CoreImage.framework; sourceTree = SDKROOT; }; E5066F241855A55B008C7682 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ BCF9D15314EAD24200986461 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( BCF866DC1725A2EA00912E34 /* libGPUImage.a in Frameworks */, BC982A9614EDF8750001FF6F /* GLKit.framework in Frameworks */, BCF9D20C14EC7EB100986461 /* CoreImage.framework in Frameworks */, BCF9D1E314EC4F7C00986461 /* AVFoundation.framework in Frameworks */, BCF9D1E114EC4F7300986461 /* OpenGLES.framework in Frameworks */, BCF9D1DD14EC4F6C00986461 /* CoreMedia.framework in Frameworks */, BCF9D1DE14EC4F6C00986461 /* CoreVideo.framework in Frameworks */, BCF9D1DF14EC4F6C00986461 /* QuartzCore.framework in Frameworks */, BCF9D15B14EAD24200986461 /* UIKit.framework in Frameworks */, BCF9D15D14EAD24200986461 /* Foundation.framework in Frameworks */, BCF9D15F14EAD24200986461 /* CoreGraphics.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ BCF866D11725A2D800912E34 /* Products */ = { isa = PBXGroup; children = ( BCF866D71725A2D800912E34 /* libGPUImage.a */, BCF866D91725A2D800912E34 /* GPUImageTests.octest */, ); name = Products; sourceTree = ""; }; BCF9D14B14EAD24200986461 = { isa = PBXGroup; children = ( E5066F241855A55B008C7682 /* Default-568h@2x.png */, BCF9D16014EAD24200986461 /* BenchmarkSuite */, BCF9D15914EAD24200986461 /* Frameworks */, BCF9D15714EAD24200986461 /* Products */, ); sourceTree = ""; }; BCF9D15714EAD24200986461 /* Products */ = { isa = PBXGroup; children = ( BCF9D15614EAD24200986461 /* BenchmarkSuite.app */, ); name = Products; sourceTree = ""; }; BCF9D15914EAD24200986461 /* Frameworks */ = { isa = PBXGroup; children = ( BCF9D1CA14EC4F3F00986461 /* GPUImage.xcodeproj */, BC982A9514EDF8740001FF6F /* GLKit.framework */, BCF9D20B14EC7EB100986461 /* CoreImage.framework */, BCF9D1E214EC4F7C00986461 /* AVFoundation.framework */, BCF9D1E014EC4F7300986461 /* OpenGLES.framework */, BCF9D1DA14EC4F6C00986461 /* CoreMedia.framework */, BCF9D1DB14EC4F6C00986461 /* CoreVideo.framework */, BCF9D1DC14EC4F6C00986461 /* QuartzCore.framework */, BCF9D15A14EAD24200986461 /* UIKit.framework */, BCF9D15C14EAD24200986461 /* Foundation.framework */, BCF9D15E14EAD24200986461 /* CoreGraphics.framework */, ); name = Frameworks; sourceTree = ""; }; BCF9D16014EAD24200986461 /* BenchmarkSuite */ = { isa = PBXGroup; children = ( BCF9D16914EAD24200986461 /* BenchmarkAppDelegate.h */, BCF9D16A14EAD24200986461 /* BenchmarkAppDelegate.m */, BCF9D17114EAD33A00986461 /* BenchmarkTableViewController.h */, BCF9D17214EAD33A00986461 /* BenchmarkTableViewController.m */, BCF9D17314EAD33A00986461 /* BenchmarkTableViewController.xib */, BCC3D1CC14ECB1DB00E111AF /* ImageFilteringBenchmarkController.h */, BCC3D1CD14ECB1DB00E111AF /* ImageFilteringBenchmarkController.m */, BCF9D17614EAD5C900986461 /* VideoFilteringBenchmarkController.h */, BCF9D17714EAD5C900986461 /* VideoFilteringBenchmarkController.m */, BCF9D17B14EAD5F900986461 /* VideoFilteringDisplayController.h */, BCF9D17C14EAD5F900986461 /* VideoFilteringDisplayController.m */, BCF9D17D14EAD5F900986461 /* VideoFilteringDisplayController.xib */, BCF9D16114EAD24200986461 /* Supporting Files */, ); path = BenchmarkSuite; sourceTree = ""; }; BCF9D16114EAD24200986461 /* Supporting Files */ = { isa = PBXGroup; children = ( BCB3C3CD16BCA4AD003D26B0 /* Icon-72.png */, BCB3C3CE16BCA4AD003D26B0 /* Icon-72@2x.png */, BCB3C3CF16BCA4AD003D26B0 /* Icon.png */, BCB3C3D016BCA4AD003D26B0 /* Icon@2x.png */, BCB3C3D116BCA4AD003D26B0 /* iTunesArtwork.png */, BCF9D1E914EC569700986461 /* Lambeau.jpg */, BCF9D19314EC29FA00986461 /* 41-picture-frame.png */, BCF9D19414EC29FA00986461 /* 41-picture-frame@2x.png */, BCF9D19514EC29FA00986461 /* 46-movie-2.png */, BCF9D19614EC29FA00986461 /* 46-movie-2@2x.png */, BCF9D19714EC29FA00986461 /* 86-camera.png */, BCF9D19814EC29FA00986461 /* 86-camera@2x.png */, BCF9D16214EAD24200986461 /* BenchmarkSuite-Info.plist */, BCF9D16314EAD24200986461 /* InfoPlist.strings */, BCF9D16614EAD24200986461 /* main.m */, BCF9D16814EAD24200986461 /* BenchmarkSuite-Prefix.pch */, ); name = "Supporting Files"; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ BCF9D15514EAD24200986461 /* BenchmarkSuite */ = { isa = PBXNativeTarget; buildConfigurationList = BCF9D16E14EAD24200986461 /* Build configuration list for PBXNativeTarget "BenchmarkSuite" */; buildPhases = ( BCF9D15214EAD24200986461 /* Sources */, BCF9D15314EAD24200986461 /* Frameworks */, BCF9D15414EAD24200986461 /* Resources */, ); buildRules = ( ); dependencies = ( BCF866DB1725A2E400912E34 /* PBXTargetDependency */, ); name = BenchmarkSuite; productName = BenchmarkSuite; productReference = BCF9D15614EAD24200986461 /* BenchmarkSuite.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ BCF9D14D14EAD24200986461 /* Project object */ = { isa = PBXProject; attributes = { LastUpgradeCheck = 0500; ORGANIZATIONNAME = "Cell Phone"; }; buildConfigurationList = BCF9D15014EAD24200986461 /* Build configuration list for PBXProject "BenchmarkSuite" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, ); mainGroup = BCF9D14B14EAD24200986461; productRefGroup = BCF9D15714EAD24200986461 /* Products */; projectDirPath = ""; projectReferences = ( { ProductGroup = BCF866D11725A2D800912E34 /* Products */; ProjectRef = BCF9D1CA14EC4F3F00986461 /* GPUImage.xcodeproj */; }, ); projectRoot = ""; targets = ( BCF9D15514EAD24200986461 /* BenchmarkSuite */, ); }; /* End PBXProject section */ /* Begin PBXReferenceProxy section */ BCF866D71725A2D800912E34 /* libGPUImage.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = libGPUImage.a; remoteRef = BCF866D61725A2D800912E34 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; BCF866D91725A2D800912E34 /* GPUImageTests.octest */ = { isa = PBXReferenceProxy; fileType = wrapper.cfbundle; path = GPUImageTests.octest; remoteRef = BCF866D81725A2D800912E34 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ BCF9D15414EAD24200986461 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( BCF9D16514EAD24200986461 /* InfoPlist.strings in Resources */, BCF9D17514EAD33A00986461 /* BenchmarkTableViewController.xib in Resources */, BCF9D17F14EAD5F900986461 /* VideoFilteringDisplayController.xib in Resources */, BCF9D19914EC29FA00986461 /* 41-picture-frame.png in Resources */, BCF9D19A14EC29FA00986461 /* 41-picture-frame@2x.png in Resources */, BCF9D19B14EC29FA00986461 /* 46-movie-2.png in Resources */, BCF9D19C14EC29FA00986461 /* 46-movie-2@2x.png in Resources */, BCF9D19D14EC29FA00986461 /* 86-camera.png in Resources */, BCF9D19E14EC29FA00986461 /* 86-camera@2x.png in Resources */, BCF9D1EA14EC569700986461 /* Lambeau.jpg in Resources */, BCB3C3D216BCA4AD003D26B0 /* Icon-72.png in Resources */, BCB3C3D316BCA4AD003D26B0 /* Icon-72@2x.png in Resources */, BCB3C3D416BCA4AD003D26B0 /* Icon.png in Resources */, E5066F251855A55B008C7682 /* Default-568h@2x.png in Resources */, BCB3C3D516BCA4AD003D26B0 /* Icon@2x.png in Resources */, BCB3C3D616BCA4AD003D26B0 /* iTunesArtwork.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ BCF9D15214EAD24200986461 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( BCF9D16714EAD24200986461 /* main.m in Sources */, BCF9D16B14EAD24200986461 /* BenchmarkAppDelegate.m in Sources */, BCF9D17414EAD33A00986461 /* BenchmarkTableViewController.m in Sources */, BCF9D17914EAD5C900986461 /* VideoFilteringBenchmarkController.m in Sources */, BCF9D17E14EAD5F900986461 /* VideoFilteringDisplayController.m in Sources */, BCC3D1CE14ECB1DB00E111AF /* ImageFilteringBenchmarkController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ BCF866DB1725A2E400912E34 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = GPUImage; targetProxy = BCF866DA1725A2E400912E34 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ BCF9D16314EAD24200986461 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( BCF9D16414EAD24200986461 /* en */, ); name = InfoPlist.strings; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ BCF9D16C14EAD24200986461 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_TREAT_WARNINGS_AS_ERRORS = YES; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "../../../framework/**"; IPHONEOS_DEPLOYMENT_TARGET = 5.0; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = "-ObjC"; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; BCF9D16D14EAD24200986461 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_TREAT_WARNINGS_AS_ERRORS = YES; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "../../../framework/**"; IPHONEOS_DEPLOYMENT_TARGET = 5.0; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; OTHER_LDFLAGS = "-ObjC"; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; name = Release; }; BCF9D16F14EAD24200986461 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "BenchmarkSuite/BenchmarkSuite-Prefix.pch"; INFOPLIST_FILE = "BenchmarkSuite/BenchmarkSuite-Info.plist"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; name = Debug; }; BCF9D17014EAD24200986461 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "BenchmarkSuite/BenchmarkSuite-Prefix.pch"; INFOPLIST_FILE = "BenchmarkSuite/BenchmarkSuite-Info.plist"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ BCF9D15014EAD24200986461 /* Build configuration list for PBXProject "BenchmarkSuite" */ = { isa = XCConfigurationList; buildConfigurations = ( BCF9D16C14EAD24200986461 /* Debug */, BCF9D16D14EAD24200986461 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; BCF9D16E14EAD24200986461 /* Build configuration list for PBXNativeTarget "BenchmarkSuite" */ = { isa = XCConfigurationList; buildConfigurations = ( BCF9D16F14EAD24200986461 /* Debug */, BCF9D17014EAD24200986461 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = BCF9D14D14EAD24200986461 /* Project object */; } ================================================ FILE: examples/iOS/BenchmarkSuite/BenchmarkSuite.xcodeproj/xcshareddata/xcschemes/BenchmarkSuite.xcscheme ================================================ ================================================ FILE: examples/iOS/BenchmarkSuite/GlyphishIconLicense.txt ================================================ Created by Joseph Wain (see http://penandthink.com) at and probably downloaded from http://glyphish.com This work is licensed under the Creative Commons Attribution 3.0 United States License. To view a copy of this license, visit http://creativecommons.org/licenses/by/3.0/us/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA. You are free to share it and to remix it remix under the following conditions: * You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work). * For any reuse or distribution, you must make clear to others the license terms of this work. The best way to do this is with a link to http://creativecommons.org/licenses/by/3.0/us/ * Any of the above conditions can be waived if you get permission from the copyright holder (send me an email!). * Apart from the remix rights granted under this license, nothing in this license impairs or restricts the author's moral rights. ATTRIBUTION -- a note reading "icons by Joseph Wain / glyphish.com" or similar, plus a link back to glyphish.com from your app's website, is the preferred form of attribution. Also acceptable would be, like, a link from within your iPhone application, or from the iTunes store page, but those aren't as useful to other people. If none of these work for you, please contact hello@glyphish.com and we can work something out. USE WITHOUT ATTRIBUTION -- If attribution is not possible, workable or desirable for your application, contact hello@glyphish.com for commercial non-attributed licensing terms. ================================================ FILE: examples/iOS/ColorObjectTracking/ColorObjectTracking/ColorObjectTracking-Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleDisplayName ${PRODUCT_NAME} CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIconFiles CFBundleIdentifier com.sunsetlakesoftware.${PRODUCT_NAME:rfc1034identifier} CFBundleInfoDictionaryVersion 6.0 CFBundleName ${PRODUCT_NAME} CFBundlePackageType APPL CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion 1.0 LSRequiresIPhoneOS UIFileSharingEnabled UIPrerenderedIcon UIRequiredDeviceCapabilities armv7 UISupportedInterfaceOrientations UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UISupportedInterfaceOrientations~ipad UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight ================================================ FILE: examples/iOS/ColorObjectTracking/ColorObjectTracking/ColorObjectTracking-Prefix.pch ================================================ // // Prefix header for all source files of the 'ColorObjectTracking' target in the 'ColorObjectTracking' project // #import #ifndef __IPHONE_3_0 #warning "This project uses features only available in iOS SDK 3.0 and later." #endif #ifdef __OBJC__ #import #import #endif ================================================ FILE: examples/iOS/ColorObjectTracking/ColorObjectTracking/ColorTrackingAppDelegate.h ================================================ #import @class ColorTrackingViewController; @interface ColorTrackingAppDelegate : UIResponder { ColorTrackingViewController *colorTrackingViewController; } @property (strong, nonatomic) UIWindow *window; @end ================================================ FILE: examples/iOS/ColorObjectTracking/ColorObjectTracking/ColorTrackingAppDelegate.m ================================================ #import "ColorTrackingAppDelegate.h" #import "ColorTrackingViewController.h" @implementation ColorTrackingAppDelegate @synthesize window = _window; - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; self.window.backgroundColor = [UIColor whiteColor]; self.window.rootViewController = [[ColorTrackingViewController alloc] initWithNibName:nil bundle:nil]; [self.window makeKeyAndVisible]; return YES; } - (void)applicationWillResignActive:(UIApplication *)application { // Pause camera frame readings } - (void)applicationDidBecomeActive:(UIApplication *)application { // Reactivate camera frame readings } - (void)applicationWillTerminate:(UIApplication *)application { } @end ================================================ FILE: examples/iOS/ColorObjectTracking/ColorObjectTracking/ColorTrackingViewController.h ================================================ #import #import "GPUImage.h" typedef enum { PASSTHROUGH_VIDEO, SIMPLE_THRESHOLDING, POSITION_THRESHOLDING, OBJECT_TRACKING} ColorTrackingDisplayMode; @interface ColorTrackingViewController : UIViewController { CALayer *trackingDot; GPUImageVideoCamera *videoCamera; GPUImageFilter *thresholdFilter, *positionFilter; GPUImageRawDataOutput *positionRawData, *videoRawData; GPUImageAverageColor *positionAverageColor; GPUImageView *filteredVideoView; ColorTrackingDisplayMode displayMode; BOOL shouldReplaceThresholdColor; CGPoint currentTouchPoint; GLfloat thresholdSensitivity; GPUVector3 thresholdColor; } - (void)configureVideoFiltering; - (void)configureToolbar; - (void)configureTrackingDot; // Image processing - (CGPoint)centroidFromTexture:(GLubyte *)pixels ofSize:(CGSize)textureSize; @end ================================================ FILE: examples/iOS/ColorObjectTracking/ColorObjectTracking/ColorTrackingViewController.m ================================================ #import "ColorTrackingViewController.h" #import @implementation ColorTrackingViewController #pragma mark - #pragma mark Initialization and teardown - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { NSUserDefaults *currentDefaults = [NSUserDefaults standardUserDefaults]; [currentDefaults registerDefaults:[NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithFloat:0.89f], @"thresholdColorR", [NSNumber numberWithFloat:0.78f], @"thresholdColorG", [NSNumber numberWithFloat:0.0f], @"thresholdColorB", [NSNumber numberWithFloat:0.7], @"thresholdSensitivity", nil]]; thresholdColor.one = [currentDefaults floatForKey:@"thresholdColorR"]; thresholdColor.two = [currentDefaults floatForKey:@"thresholdColorG"]; thresholdColor.three = [currentDefaults floatForKey:@"thresholdColorB"]; displayMode = PASSTHROUGH_VIDEO; thresholdSensitivity = [currentDefaults floatForKey:@"thresholdSensitivity"]; } return self; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; } - (void)loadView { CGRect mainScreenFrame = [[UIScreen mainScreen] applicationFrame]; UIView *primaryView = [[UIView alloc] initWithFrame:mainScreenFrame]; primaryView.backgroundColor = [UIColor blueColor]; self.view = primaryView; [self configureVideoFiltering]; [self configureToolbar]; [self configureTrackingDot]; } - (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]; thresholdFilter = [[GPUImageFilter alloc] initWithFragmentShaderFromFile:@"Threshold"]; [thresholdFilter setFloat:thresholdSensitivity forUniformName:@"threshold"]; [thresholdFilter setFloatVec3:thresholdColor forUniformName:@"inputColor"]; positionFilter = [[GPUImageFilter alloc] initWithFragmentShaderFromFile:@"PositionColor"]; [positionFilter setFloat:thresholdSensitivity forUniformName:@"threshold"]; [positionFilter setFloatVec3:thresholdColor forUniformName:@"inputColor"]; // CGSize videoPixelSize = filteredVideoView.bounds.size; // videoPixelSize.width *= [filteredVideoView contentScaleFactor]; // videoPixelSize.height *= [filteredVideoView contentScaleFactor]; CGSize videoPixelSize = CGSizeMake(480.0, 640.0); positionRawData = [[GPUImageRawDataOutput alloc] initWithImageSize:videoPixelSize resultsInBGRAFormat:YES]; __unsafe_unretained ColorTrackingViewController *weakSelf = self; [positionRawData setNewFrameAvailableBlock:^{ GLubyte *bytesForPositionData = weakSelf->positionRawData.rawBytesForImage; CGPoint currentTrackingLocation = [weakSelf centroidFromTexture:bytesForPositionData ofSize:[weakSelf->positionRawData maximumOutputSize]]; // NSLog(@"Centroid from CPU: %f, %f", currentTrackingLocation.x, currentTrackingLocation.y); CGSize currentViewSize = weakSelf.view.bounds.size; dispatch_async(dispatch_get_main_queue(), ^{ weakSelf->trackingDot.position = CGPointMake(currentTrackingLocation.x * currentViewSize.width, currentTrackingLocation.y * currentViewSize.height); }); }]; positionAverageColor = [[GPUImageAverageColor alloc] init]; [positionAverageColor setColorAverageProcessingFinishedBlock:^(CGFloat redComponent, CGFloat greenComponent, CGFloat blueComponent, CGFloat alphaComponent, CMTime frameTime) { // NSLog(@"GPU Average R: %f, G: %f, A: %f", redComponent, greenComponent, alphaComponent); CGPoint currentTrackingLocation = CGPointMake(1.0 - (greenComponent / alphaComponent), (redComponent / alphaComponent)); if (isnan(currentTrackingLocation.x) || isnan(currentTrackingLocation.y)) { // NSLog(@"NaN in currentTrackingLocation"); return; } // NSLog(@"Centroid from GPU: %f, %f", currentTrackingLocation.x, currentTrackingLocation.y); // NSLog(@"Average color: %f, %f, %f, %f", redComponent, greenComponent, blueComponent, alphaComponent); CGSize currentViewSize = weakSelf.view.bounds.size; dispatch_async(dispatch_get_main_queue(), ^{ weakSelf->trackingDot.position = CGPointMake(currentTrackingLocation.x * currentViewSize.width, currentTrackingLocation.y * currentViewSize.height); }); }]; videoRawData = [[GPUImageRawDataOutput alloc] initWithImageSize:videoPixelSize resultsInBGRAFormat:YES]; [videoRawData setNewFrameAvailableBlock:^{ if (weakSelf->shouldReplaceThresholdColor) { CGSize currentViewSize = weakSelf.view.bounds.size; CGSize rawPixelsSize = [weakSelf->videoRawData maximumOutputSize]; CGPoint scaledTouchPoint; scaledTouchPoint.x = (weakSelf->currentTouchPoint.x / currentViewSize.width) * rawPixelsSize.width; scaledTouchPoint.y = (weakSelf->currentTouchPoint.y / currentViewSize.height) * rawPixelsSize.height; GPUByteColorVector colorAtTouchPoint = [weakSelf->videoRawData colorAtLocation:scaledTouchPoint]; weakSelf->thresholdColor.one = (float)colorAtTouchPoint.red / 255.0; weakSelf->thresholdColor.two = (float)colorAtTouchPoint.green / 255.0; weakSelf->thresholdColor.three = (float)colorAtTouchPoint.blue / 255.0; // NSLog(@"Color at touch point: %d, %d, %d, %d", colorAtTouchPoint.red, colorAtTouchPoint.green, colorAtTouchPoint.blue, colorAtTouchPoint.alpha); [[NSUserDefaults standardUserDefaults] setFloat:weakSelf->thresholdColor.one forKey:@"thresholdColorR"]; [[NSUserDefaults standardUserDefaults] setFloat:weakSelf->thresholdColor.two forKey:@"thresholdColorG"]; [[NSUserDefaults standardUserDefaults] setFloat:weakSelf->thresholdColor.three forKey:@"thresholdColorB"]; [weakSelf->thresholdFilter setFloatVec3:weakSelf->thresholdColor forUniformName:@"inputColor"]; [weakSelf->positionFilter setFloatVec3:weakSelf->thresholdColor forUniformName:@"inputColor"]; weakSelf->shouldReplaceThresholdColor = NO; } }]; [videoCamera addTarget:filteredVideoView]; [videoCamera addTarget:videoRawData]; [videoCamera startCameraCapture]; } - (void)configureToolbar; { UISegmentedControl *displayModeControl = [[UISegmentedControl alloc] initWithItems:[NSArray arrayWithObjects:NSLocalizedString(@"Video", nil), NSLocalizedString(@"Threshold", nil), NSLocalizedString(@"Position", nil), NSLocalizedString(@"Track", nil), nil]]; displayModeControl.segmentedControlStyle = UISegmentedControlStyleBar; displayModeControl.selectedSegmentIndex = 0; [displayModeControl addTarget:self action:@selector(handleSwitchOfDisplayMode:) forControlEvents:UIControlEventValueChanged]; UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithCustomView:displayModeControl]; CGRect mainScreenFrame = [[UIScreen mainScreen] applicationFrame]; displayModeControl.frame = CGRectMake(0.0f, 10.0f, mainScreenFrame.size.width - 20.0f, 30.0f); NSArray *theToolbarItems = [NSArray arrayWithObjects:item, nil]; UIToolbar *lowerToolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0.0f, self.view.frame.size.height - 44.0f, self.view.frame.size.width, 44.0f)]; lowerToolbar.autoresizingMask = UIViewAutoresizingFlexibleWidth; lowerToolbar.tintColor = [UIColor blackColor]; [lowerToolbar setItems:theToolbarItems]; [self.view addSubview:lowerToolbar]; } - (void)configureTrackingDot; { trackingDot = [[CALayer alloc] init]; trackingDot.bounds = CGRectMake(0.0f, 0.0f, 40.0f, 40.0f); trackingDot.cornerRadius = 20.0f; trackingDot.backgroundColor = [[UIColor blueColor] CGColor]; NSMutableDictionary *newActions = [[NSMutableDictionary alloc] initWithObjectsAndKeys:[NSNull null], @"position", nil]; trackingDot.actions = newActions; trackingDot.position = CGPointMake(100.0f, 100.0f); trackingDot.opacity = 0.0f; [self.view.layer addSublayer:trackingDot]; } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations return (interfaceOrientation == UIInterfaceOrientationPortrait); } #pragma mark - #pragma mark Display mode switching - (void)handleSwitchOfDisplayMode:(id)sender; { ColorTrackingDisplayMode newDisplayMode = [sender selectedSegmentIndex]; if (newDisplayMode != displayMode) { displayMode = newDisplayMode; if (displayMode == OBJECT_TRACKING) { trackingDot.opacity = 1.0f; } else { trackingDot.opacity = 0.0f; } [videoCamera removeAllTargets]; [positionFilter removeAllTargets]; [thresholdFilter removeAllTargets]; [videoCamera addTarget:videoRawData]; switch(displayMode) { case PASSTHROUGH_VIDEO: { [videoCamera addTarget:filteredVideoView]; }; break; case SIMPLE_THRESHOLDING: { [videoCamera addTarget:thresholdFilter]; [thresholdFilter addTarget:filteredVideoView]; }; break; case POSITION_THRESHOLDING: { [videoCamera addTarget:positionFilter]; [positionFilter addTarget:filteredVideoView]; }; break; case OBJECT_TRACKING: { [videoCamera addTarget:filteredVideoView]; [videoCamera addTarget:positionFilter]; // [positionFilter addTarget:positionRawData]; // Enable this for CPU-based centroid computation [positionFilter addTarget:positionAverageColor]; // Enable this for GPU-based centroid computation }; break; } } } #pragma mark - #pragma mark Image processing - (CGPoint)centroidFromTexture:(GLubyte *)pixels ofSize:(CGSize)textureSize; { CGFloat currentXTotal = 0.0f, currentYTotal = 0.0f, currentPixelTotal = 0.0f; if ([GPUImageContext supportsFastTextureUpload]) { for (NSUInteger currentPixel = 0; currentPixel < (textureSize.width * textureSize.height); currentPixel++) { currentXTotal += (CGFloat)pixels[(currentPixel * 4) + 2] / 255.0f; currentYTotal += (CGFloat)pixels[(currentPixel * 4) + 1] / 255.0f; currentPixelTotal += (CGFloat)pixels[(currentPixel * 4) + 3] / 255.0f; } } else { for (NSUInteger currentPixel = 0; currentPixel < (textureSize.width * textureSize.height); currentPixel++) { currentXTotal += (CGFloat)pixels[currentPixel * 4] / 255.0f; currentYTotal += (CGFloat)pixels[(currentPixel * 4) + 1] / 255.0f; currentPixelTotal += (CGFloat)pixels[(currentPixel * 4) + 3] / 255.0f; } } // NSLog(@"CPU Average R: %f, G: %f, A: %f", currentXTotal / (textureSize.width * textureSize.height), currentYTotal / (textureSize.width * textureSize.height), currentPixelTotal / (textureSize.width * textureSize.height)); return CGPointMake((1.0 - currentYTotal / currentPixelTotal), currentXTotal / currentPixelTotal); } #pragma mark - #pragma mark Touch handling - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { currentTouchPoint = [[touches anyObject] locationInView:self.view]; shouldReplaceThresholdColor = YES; } - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event; { CGPoint movedPoint = [[touches anyObject] locationInView:self.view]; CGFloat distanceMoved = sqrt( (movedPoint.x - currentTouchPoint.x) * (movedPoint.x - currentTouchPoint.x) + (movedPoint.y - currentTouchPoint.y) * (movedPoint.y - currentTouchPoint.y) ); thresholdSensitivity = distanceMoved / 160.0f; [[NSUserDefaults standardUserDefaults] setFloat:thresholdSensitivity forKey:@"thresholdSensitivity"]; [thresholdFilter setFloat:thresholdSensitivity forUniformName:@"threshold"]; [positionFilter setFloat:thresholdSensitivity forUniformName:@"threshold"]; } - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { } - (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event { } @end ================================================ FILE: examples/iOS/ColorObjectTracking/ColorObjectTracking/PositionColor.fsh ================================================ varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform mediump vec3 inputColor; uniform mediump float threshold; precision mediump float; vec3 normalizeColor(vec3 color) { return color / max(dot(color, vec3(1.0/3.0)), 0.3); } vec4 maskPixel(vec3 pixelColor, vec3 maskColor) { float d; vec4 calculatedColor; // Compute distance between current pixel color and reference color d = distance(normalizeColor(pixelColor), normalizeColor(maskColor)); // If color difference is larger than threshold, return black. calculatedColor = (d > threshold) ? vec4(0.0) : vec4(1.0); //Multiply color by texture return calculatedColor; } vec4 coordinateMask(vec4 maskColor, vec2 coordinate) { // Return this vector weighted by the mask value return maskColor * vec4(coordinate, vec2(0.0, 1.0)); } void main() { float d; vec4 pixelColor, maskedColor, coordinateColor; pixelColor = texture2D(inputImageTexture, textureCoordinate); maskedColor = maskPixel(pixelColor.rgb, inputColor); coordinateColor = coordinateMask(maskedColor, textureCoordinate); gl_FragColor = coordinateColor; } ================================================ FILE: examples/iOS/ColorObjectTracking/ColorObjectTracking/Threshold.fsh ================================================ varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform mediump vec3 inputColor; uniform mediump float threshold; precision mediump float; vec3 normalizeColor(vec3 color) { return color / max(dot(color, vec3(1.0/3.0)), 0.3); } vec4 maskPixel(vec3 pixelColor, vec3 maskColor) { float d; vec4 calculatedColor; // Compute distance between current pixel color and reference color d = distance(normalizeColor(pixelColor), normalizeColor(maskColor)); // If color difference is larger than threshold, return black. calculatedColor = (d > threshold) ? vec4(0.0) : vec4(1.0); //Multiply color by texture return calculatedColor; } void main() { float d; vec4 pixelColor, maskedColor; pixelColor = texture2D(inputImageTexture, textureCoordinate); maskedColor = maskPixel(pixelColor.rgb, inputColor); gl_FragColor = (maskedColor.a < 1.0) ? pixelColor : maskedColor; } ================================================ FILE: examples/iOS/ColorObjectTracking/ColorObjectTracking/en.lproj/InfoPlist.strings ================================================ /* Localized versions of Info.plist keys */ ================================================ FILE: examples/iOS/ColorObjectTracking/ColorObjectTracking/main.m ================================================ #import #import "ColorTrackingAppDelegate.h" int main(int argc, char *argv[]) { @autoreleasepool { return UIApplicationMain(argc, argv, nil, NSStringFromClass([ColorTrackingAppDelegate class])); } } ================================================ FILE: examples/iOS/ColorObjectTracking/ColorObjectTracking.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ BC245DDF14DDC959009FE7EB /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC245DDE14DDC959009FE7EB /* UIKit.framework */; }; BC245DE114DDC959009FE7EB /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC245DE014DDC959009FE7EB /* Foundation.framework */; }; BC245DE314DDC959009FE7EB /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC245DE214DDC959009FE7EB /* CoreGraphics.framework */; }; BC245DE914DDC959009FE7EB /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = BC245DE714DDC959009FE7EB /* InfoPlist.strings */; }; BC245DEB14DDC959009FE7EB /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = BC245DEA14DDC959009FE7EB /* main.m */; }; BC245DEF14DDC959009FE7EB /* ColorTrackingAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = BC245DEE14DDC959009FE7EB /* ColorTrackingAppDelegate.m */; }; BCB3C3DF16BCA51E003D26B0 /* Icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C3DA16BCA51E003D26B0 /* Icon-72.png */; }; BCB3C3E016BCA51E003D26B0 /* Icon-72@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C3DB16BCA51E003D26B0 /* Icon-72@2x.png */; }; BCB3C3E116BCA51E003D26B0 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C3DC16BCA51E003D26B0 /* Icon.png */; }; BCB3C3E216BCA51E003D26B0 /* Icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C3DD16BCA51E003D26B0 /* Icon@2x.png */; }; BCB3C3E316BCA51E003D26B0 /* iTunesArtwork.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C3DE16BCA51E003D26B0 /* iTunesArtwork.png */; }; BCB5DD8314E85CB0000AF3C2 /* PositionColor.fsh in Resources */ = {isa = PBXBuildFile; fileRef = BCB5DD8214E85CB0000AF3C2 /* PositionColor.fsh */; }; BCB5E74614DDCF4F00701302 /* ColorTrackingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB5E74514DDCF4F00701302 /* ColorTrackingViewController.m */; }; BCB5E74814DDD1B300701302 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB5E74714DDD1B300701302 /* QuartzCore.framework */; }; BCB5E7A314E346BE00701302 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB5E7A214E346BE00701302 /* AVFoundation.framework */; }; BCB5E7A614E346F100701302 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB5E7A514E346F100701302 /* OpenGLES.framework */; }; BCB5E7A814E3471100701302 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB5E7A714E3471100701302 /* CoreVideo.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; BCB5E7AA14E3472100701302 /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB5E7A914E3472100701302 /* CoreMedia.framework */; }; BCB5E7B214E460D300701302 /* Threshold.fsh in Resources */ = {isa = PBXBuildFile; fileRef = BCB5E7B114E460D300701302 /* Threshold.fsh */; }; BCF866E91725A39D00912E34 /* libGPUImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BCF866E41725A38C00912E34 /* libGPUImage.a */; }; E5066F2A1855A595008C7682 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E5066F291855A595008C7682 /* Default-568h@2x.png */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ BC7E93CC19EB22EB006D23C3 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BC245E0C14DDCA1F009FE7EB /* GPUImage.xcodeproj */; proxyType = 2; remoteGlobalIDString = BCE209E51943F20C002FEED8; remoteInfo = GPUImageFramework; }; BCF866E31725A38C00912E34 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BC245E0C14DDCA1F009FE7EB /* GPUImage.xcodeproj */; proxyType = 2; remoteGlobalIDString = BCF1A33414DDB1EC00852800; remoteInfo = GPUImage; }; BCF866E71725A39800912E34 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BC245E0C14DDCA1F009FE7EB /* GPUImage.xcodeproj */; proxyType = 1; remoteGlobalIDString = BCF1A33314DDB1EC00852800; remoteInfo = GPUImage; }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ BC245DDA14DDC959009FE7EB /* ColorObjectTracking.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ColorObjectTracking.app; sourceTree = BUILT_PRODUCTS_DIR; }; BC245DDE14DDC959009FE7EB /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; BC245DE014DDC959009FE7EB /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; BC245DE214DDC959009FE7EB /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; BC245DE614DDC959009FE7EB /* ColorObjectTracking-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "ColorObjectTracking-Info.plist"; sourceTree = ""; }; BC245DE814DDC959009FE7EB /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; BC245DEA14DDC959009FE7EB /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; BC245DEC14DDC959009FE7EB /* ColorObjectTracking-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ColorObjectTracking-Prefix.pch"; sourceTree = ""; }; BC245DED14DDC959009FE7EB /* ColorTrackingAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ColorTrackingAppDelegate.h; sourceTree = ""; }; BC245DEE14DDC959009FE7EB /* ColorTrackingAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ColorTrackingAppDelegate.m; sourceTree = ""; }; BC245E0C14DDCA1F009FE7EB /* GPUImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = GPUImage.xcodeproj; path = ../../../framework/GPUImage.xcodeproj; sourceTree = ""; }; BCB3C3DA16BCA51E003D26B0 /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-72.png"; path = "../../SharedIcons/Icon-72.png"; sourceTree = ""; }; BCB3C3DB16BCA51E003D26B0 /* Icon-72@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-72@2x.png"; path = "../../SharedIcons/Icon-72@2x.png"; sourceTree = ""; }; BCB3C3DC16BCA51E003D26B0 /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Icon.png; path = ../../SharedIcons/Icon.png; sourceTree = ""; }; BCB3C3DD16BCA51E003D26B0 /* Icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon@2x.png"; path = "../../SharedIcons/Icon@2x.png"; sourceTree = ""; }; BCB3C3DE16BCA51E003D26B0 /* iTunesArtwork.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = iTunesArtwork.png; path = ../../SharedIcons/iTunesArtwork.png; sourceTree = ""; }; BCB5DD8214E85CB0000AF3C2 /* PositionColor.fsh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = PositionColor.fsh; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.glsl; }; BCB5E74414DDCF4F00701302 /* ColorTrackingViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ColorTrackingViewController.h; sourceTree = ""; }; BCB5E74514DDCF4F00701302 /* ColorTrackingViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ColorTrackingViewController.m; sourceTree = ""; }; BCB5E74714DDD1B300701302 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; BCB5E7A214E346BE00701302 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; BCB5E7A514E346F100701302 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; BCB5E7A714E3471100701302 /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = System/Library/Frameworks/CoreVideo.framework; sourceTree = SDKROOT; }; BCB5E7A914E3472100701302 /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; }; BCB5E7B114E460D300701302 /* Threshold.fsh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = Threshold.fsh; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.glsl; }; E5066F291855A595008C7682 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ BC245DD714DDC959009FE7EB /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( BCF866E91725A39D00912E34 /* libGPUImage.a in Frameworks */, BCB5E7AA14E3472100701302 /* CoreMedia.framework in Frameworks */, BCB5E7A814E3471100701302 /* CoreVideo.framework in Frameworks */, BCB5E7A614E346F100701302 /* OpenGLES.framework in Frameworks */, BCB5E7A314E346BE00701302 /* AVFoundation.framework in Frameworks */, BCB5E74814DDD1B300701302 /* QuartzCore.framework in Frameworks */, BC245DDF14DDC959009FE7EB /* UIKit.framework in Frameworks */, BC245DE114DDC959009FE7EB /* Foundation.framework in Frameworks */, BC245DE314DDC959009FE7EB /* CoreGraphics.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ BC245DCF14DDC959009FE7EB = { isa = PBXGroup; children = ( E5066F291855A595008C7682 /* Default-568h@2x.png */, BC245DE414DDC959009FE7EB /* ColorObjectTracking */, BC245DDD14DDC959009FE7EB /* Frameworks */, BC245DDB14DDC959009FE7EB /* Products */, ); sourceTree = ""; }; BC245DDB14DDC959009FE7EB /* Products */ = { isa = PBXGroup; children = ( BC245DDA14DDC959009FE7EB /* ColorObjectTracking.app */, ); name = Products; sourceTree = ""; }; BC245DDD14DDC959009FE7EB /* Frameworks */ = { isa = PBXGroup; children = ( BC245E0C14DDCA1F009FE7EB /* GPUImage.xcodeproj */, BCB5E7A914E3472100701302 /* CoreMedia.framework */, BCB5E7A714E3471100701302 /* CoreVideo.framework */, BCB5E7A514E346F100701302 /* OpenGLES.framework */, BCB5E7A214E346BE00701302 /* AVFoundation.framework */, BCB5E74714DDD1B300701302 /* QuartzCore.framework */, BC245DDE14DDC959009FE7EB /* UIKit.framework */, BC245DE014DDC959009FE7EB /* Foundation.framework */, BC245DE214DDC959009FE7EB /* CoreGraphics.framework */, ); name = Frameworks; sourceTree = ""; }; BC245DE414DDC959009FE7EB /* ColorObjectTracking */ = { isa = PBXGroup; children = ( BC245DED14DDC959009FE7EB /* ColorTrackingAppDelegate.h */, BC245DEE14DDC959009FE7EB /* ColorTrackingAppDelegate.m */, BCB5E74414DDCF4F00701302 /* ColorTrackingViewController.h */, BCB5E74514DDCF4F00701302 /* ColorTrackingViewController.m */, BCB5E7B014E4606200701302 /* Shaders */, BC245DE514DDC959009FE7EB /* Supporting Files */, ); path = ColorObjectTracking; sourceTree = ""; }; BC245DE514DDC959009FE7EB /* Supporting Files */ = { isa = PBXGroup; children = ( BCB3C3DA16BCA51E003D26B0 /* Icon-72.png */, BCB3C3DB16BCA51E003D26B0 /* Icon-72@2x.png */, BCB3C3DC16BCA51E003D26B0 /* Icon.png */, BCB3C3DD16BCA51E003D26B0 /* Icon@2x.png */, BCB3C3DE16BCA51E003D26B0 /* iTunesArtwork.png */, BC245DE614DDC959009FE7EB /* ColorObjectTracking-Info.plist */, BC245DE714DDC959009FE7EB /* InfoPlist.strings */, BC245DEA14DDC959009FE7EB /* main.m */, BC245DEC14DDC959009FE7EB /* ColorObjectTracking-Prefix.pch */, ); name = "Supporting Files"; sourceTree = ""; }; BCB5E7B014E4606200701302 /* Shaders */ = { isa = PBXGroup; children = ( BCB5DD8214E85CB0000AF3C2 /* PositionColor.fsh */, BCB5E7B114E460D300701302 /* Threshold.fsh */, ); name = Shaders; sourceTree = ""; }; BCF866DE1725A38C00912E34 /* Products */ = { isa = PBXGroup; children = ( BCF866E41725A38C00912E34 /* libGPUImage.a */, BC7E93CD19EB22EB006D23C3 /* GPUImage.framework */, ); name = Products; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ BC245DD914DDC959009FE7EB /* ColorObjectTracking */ = { isa = PBXNativeTarget; buildConfigurationList = BC245DF214DDC959009FE7EB /* Build configuration list for PBXNativeTarget "ColorObjectTracking" */; buildPhases = ( BC245DD614DDC959009FE7EB /* Sources */, BC245DD714DDC959009FE7EB /* Frameworks */, BC245DD814DDC959009FE7EB /* Resources */, ); buildRules = ( ); dependencies = ( BCF866E81725A39800912E34 /* PBXTargetDependency */, ); name = ColorObjectTracking; productName = ColorObjectTracking; productReference = BC245DDA14DDC959009FE7EB /* ColorObjectTracking.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ BC245DD114DDC959009FE7EB /* Project object */ = { isa = PBXProject; attributes = { LastUpgradeCheck = 0500; ORGANIZATIONNAME = "Cell Phone"; }; buildConfigurationList = BC245DD414DDC959009FE7EB /* Build configuration list for PBXProject "ColorObjectTracking" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, ); mainGroup = BC245DCF14DDC959009FE7EB; productRefGroup = BC245DDB14DDC959009FE7EB /* Products */; projectDirPath = ""; projectReferences = ( { ProductGroup = BCF866DE1725A38C00912E34 /* Products */; ProjectRef = BC245E0C14DDCA1F009FE7EB /* GPUImage.xcodeproj */; }, ); projectRoot = ""; targets = ( BC245DD914DDC959009FE7EB /* ColorObjectTracking */, ); }; /* End PBXProject section */ /* Begin PBXReferenceProxy section */ BC7E93CD19EB22EB006D23C3 /* GPUImage.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; path = GPUImage.framework; remoteRef = BC7E93CC19EB22EB006D23C3 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; BCF866E41725A38C00912E34 /* libGPUImage.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = libGPUImage.a; remoteRef = BCF866E31725A38C00912E34 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ BC245DD814DDC959009FE7EB /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( BC245DE914DDC959009FE7EB /* InfoPlist.strings in Resources */, BCB5E7B214E460D300701302 /* Threshold.fsh in Resources */, E5066F2A1855A595008C7682 /* Default-568h@2x.png in Resources */, BCB5DD8314E85CB0000AF3C2 /* PositionColor.fsh in Resources */, BCB3C3DF16BCA51E003D26B0 /* Icon-72.png in Resources */, BCB3C3E016BCA51E003D26B0 /* Icon-72@2x.png in Resources */, BCB3C3E116BCA51E003D26B0 /* Icon.png in Resources */, BCB3C3E216BCA51E003D26B0 /* Icon@2x.png in Resources */, BCB3C3E316BCA51E003D26B0 /* iTunesArtwork.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ BC245DD614DDC959009FE7EB /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( BC245DEB14DDC959009FE7EB /* main.m in Sources */, BC245DEF14DDC959009FE7EB /* ColorTrackingAppDelegate.m in Sources */, BCB5E74614DDCF4F00701302 /* ColorTrackingViewController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ BCF866E81725A39800912E34 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = GPUImage; targetProxy = BCF866E71725A39800912E34 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ BC245DE714DDC959009FE7EB /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( BC245DE814DDC959009FE7EB /* en */, ); name = InfoPlist.strings; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ BC245DF014DDC959009FE7EB /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "../../../framework/**"; IPHONEOS_DEPLOYMENT_TARGET = 4.3; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; BC245DF114DDC959009FE7EB /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "../../../framework/**"; IPHONEOS_DEPLOYMENT_TARGET = 4.3; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; name = Release; }; BC245DF314DDC959009FE7EB /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "ColorObjectTracking/ColorObjectTracking-Prefix.pch"; GCC_THUMB_SUPPORT = ""; INFOPLIST_FILE = "ColorObjectTracking/ColorObjectTracking-Info.plist"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; name = Debug; }; BC245DF414DDC959009FE7EB /* Release */ = { isa = XCBuildConfiguration; buildSettings = { GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "ColorObjectTracking/ColorObjectTracking-Prefix.pch"; GCC_THUMB_SUPPORT = ""; INFOPLIST_FILE = "ColorObjectTracking/ColorObjectTracking-Info.plist"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ BC245DD414DDC959009FE7EB /* Build configuration list for PBXProject "ColorObjectTracking" */ = { isa = XCConfigurationList; buildConfigurations = ( BC245DF014DDC959009FE7EB /* Debug */, BC245DF114DDC959009FE7EB /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; BC245DF214DDC959009FE7EB /* Build configuration list for PBXNativeTarget "ColorObjectTracking" */ = { isa = XCConfigurationList; buildConfigurations = ( BC245DF314DDC959009FE7EB /* Debug */, BC245DF414DDC959009FE7EB /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = BC245DD114DDC959009FE7EB /* Project object */; } ================================================ FILE: examples/iOS/ColorObjectTracking/ColorObjectTracking.xcodeproj/xcshareddata/xcschemes/ColorObjectTracking.xcscheme ================================================ ================================================ FILE: examples/iOS/CubeExample/Classes/CubeExampleAppDelegate.h ================================================ #import @class DisplayViewController; @interface CubeExampleAppDelegate : NSObject { DisplayViewController *rootViewController; UIWindow *window; } @property (strong, nonatomic) UIWindow *window; @end ================================================ FILE: examples/iOS/CubeExample/Classes/CubeExampleAppDelegate.m ================================================ #import "CubeExampleAppDelegate.h" #import "DisplayViewController.h" @implementation CubeExampleAppDelegate @synthesize window; - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; // Override point for customization after application launch. self.window.backgroundColor = [UIColor whiteColor]; rootViewController = [[DisplayViewController alloc] initWithNibName:nil bundle:nil]; [self.window addSubview:rootViewController.view]; self.window.rootViewController = rootViewController; [self.window makeKeyAndVisible]; return YES; } - (void)applicationWillResignActive:(UIApplication *)application { } - (void)applicationDidBecomeActive:(UIApplication *)application { } - (void)applicationWillTerminate:(UIApplication *)application { } - (void)dealloc { [window release]; [super dealloc]; } @end ================================================ FILE: examples/iOS/CubeExample/Classes/DisplayViewController.h ================================================ #import #import #import "ESRenderer.h" #import "ES2Renderer.h" #import "GPUImage.h" @interface DisplayViewController : UIViewController { CGPoint lastMovementPosition; @private ES2Renderer *renderer; GPUImageTextureInput *textureInput; GPUImageFilter *filter; NSDate *startTime; } - (void)drawView:(id)sender; @end ================================================ FILE: examples/iOS/CubeExample/Classes/DisplayViewController.m ================================================ #import "DisplayViewController.h" @interface DisplayViewController () @end @implementation DisplayViewController - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { // Custom initialization } return self; } - (void)dealloc { [renderer release]; [super dealloc]; } - (void)loadView { CGRect mainScreenFrame = [[UIScreen mainScreen] applicationFrame]; GPUImageView *primaryView = [[[GPUImageView alloc] initWithFrame:mainScreenFrame] autorelease]; self.view = primaryView; renderer = [[ES2Renderer alloc] initWithSize:[primaryView sizeInPixels]]; textureInput = [[GPUImageTextureInput alloc] initWithTexture:renderer.outputTexture size:[primaryView sizeInPixels]]; filter = [[GPUImagePixellateFilter alloc] init]; [(GPUImagePixellateFilter *)filter setFractionalWidthOfAPixel:0.01]; // filter = [[GPUImageGaussianBlurFilter alloc] init]; // [(GPUImageGaussianBlurFilter *)filter setBlurSize:3.0]; [textureInput addTarget:filter]; [filter addTarget:primaryView]; [renderer setNewFrameAvailableBlock:^{ float currentTimeInMilliseconds = [[NSDate date] timeIntervalSinceDate:startTime] * 1000.0; [textureInput processTextureWithFrameTime:CMTimeMake((int)currentTimeInMilliseconds, 1000)]; }]; [renderer startCameraCapture]; } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationPortrait); } - (void)drawView:(id)sender { [renderer renderByRotatingAroundX:0 rotatingAroundY:0]; } #pragma mark - #pragma mark Touch-handling methods - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { NSMutableSet *currentTouches = [[[event touchesForView:self.view] mutableCopy] autorelease]; [currentTouches minusSet:touches]; // New touches are not yet included in the current touches for the view lastMovementPosition = [[touches anyObject] locationInView:self.view]; } - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event; { CGPoint currentMovementPosition = [[touches anyObject] locationInView:self.view]; [renderer renderByRotatingAroundX:(currentMovementPosition.x - lastMovementPosition.x) rotatingAroundY:(lastMovementPosition.y - currentMovementPosition.y)]; lastMovementPosition = currentMovementPosition; } - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { NSMutableSet *remainingTouches = [[[event touchesForView:self.view] mutableCopy] autorelease]; [remainingTouches minusSet:touches]; lastMovementPosition = [[remainingTouches anyObject] locationInView:self.view]; } - (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event { // Handle touches canceled the same as as a touches ended event [self touchesEnded:touches withEvent:event]; } @end ================================================ FILE: examples/iOS/CubeExample/Classes/ES2Renderer.h ================================================ #import "ESRenderer.h" #import #import #import #import "GPUImage.h" @class PVRTexture; @interface ES2Renderer : NSObject { @private EAGLContext *context; GLuint textureForCubeFace, outputTexture; // The pixel dimensions of the CAEAGLLayer GLint backingWidth; GLint backingHeight; // The OpenGL ES names for the framebuffer and renderbuffer used to render to this view GLuint defaultFramebuffer, colorRenderbuffer; CATransform3D currentCalculatedMatrix; GLuint program; GPUImageVideoCamera *videoCamera; GPUImageFilter *inputFilter; GPUImageTextureOutput *textureOutput; } @property(readonly) GLuint outputTexture; @property(nonatomic, copy) void(^newFrameAvailableBlock)(void); - (id)initWithSize:(CGSize)newSize; - (void)renderByRotatingAroundX:(float)xRotation rotatingAroundY:(float)yRotation; - (void)convert3DTransform:(CATransform3D *)transform3D toMatrix:(GLfloat *)matrix; - (void)startCameraCapture; @end ================================================ FILE: examples/iOS/CubeExample/Classes/ES2Renderer.m ================================================ #import "ES2Renderer.h" // uniform index enum { UNIFORM_MODELVIEWMATRIX, UNIFORM_TEXTURE, NUM_UNIFORMS }; GLint uniforms[NUM_UNIFORMS]; // attribute index enum { ATTRIB_VERTEX, ATTRIB_TEXTUREPOSITION, NUM_ATTRIBUTES }; @interface ES2Renderer (PrivateMethods) - (BOOL)loadShaders; - (BOOL)compileShader:(GLuint *)shader type:(GLenum)type file:(NSString *)file; - (BOOL)linkProgram:(GLuint)prog; - (BOOL)validateProgram:(GLuint)prog; @end @implementation ES2Renderer @synthesize outputTexture; @synthesize newFrameAvailableBlock; - (id)initWithSize:(CGSize)newSize; { if ((self = [super init])) { // Need to use a share group based on the GPUImage context to share textures with the 3-D scene context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2 sharegroup:[[[GPUImageContext sharedImageProcessingContext] context] sharegroup]]; if (!context || ![EAGLContext setCurrentContext:context] || ![self loadShaders]) { [self release]; return nil; } backingWidth = (int)newSize.width; backingHeight = (int)newSize.height; currentCalculatedMatrix = CATransform3DIdentity; currentCalculatedMatrix = CATransform3DScale(currentCalculatedMatrix, 0.5, 0.5 * (320.0/480.0), 0.5); glActiveTexture(GL_TEXTURE0); glGenTextures(1, &outputTexture); glBindTexture(GL_TEXTURE_2D, outputTexture); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); // This is necessary for non-power-of-two textures glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glBindTexture(GL_TEXTURE_2D, 0); glActiveTexture(GL_TEXTURE1); glGenFramebuffers(1, &defaultFramebuffer); glBindFramebuffer(GL_FRAMEBUFFER, defaultFramebuffer); glBindTexture(GL_TEXTURE_2D, outputTexture); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, backingWidth, backingHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0); glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, outputTexture, 0); // GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); // // NSAssert(status == GL_FRAMEBUFFER_COMPLETE, @"Incomplete filter FBO: %d", status); glBindTexture(GL_TEXTURE_2D, 0); videoCamera = [[GPUImageVideoCamera alloc] initWithSessionPreset:AVCaptureSessionPreset640x480 cameraPosition:AVCaptureDevicePositionBack]; videoCamera.outputImageOrientation = UIInterfaceOrientationPortrait; inputFilter = [[GPUImageSepiaFilter alloc] init]; textureOutput = [[GPUImageTextureOutput alloc] init]; textureOutput.delegate = self; [videoCamera addTarget:inputFilter]; [inputFilter addTarget:textureOutput]; } return self; } - (void)renderByRotatingAroundX:(float)xRotation rotatingAroundY:(float)yRotation; { if (!newFrameAvailableBlock) { return; } static const GLfloat cubeVertices[] = { -1.0, -1.0, -1.0, // 0 1.0, 1.0, -1.0, // 2 1.0, -1.0, -1.0, // 1 -1.0, -1.0, -1.0, // 0 -1.0, 1.0, -1.0, // 3 1.0, 1.0, -1.0, // 2 1.0, -1.0, -1.0, // 1 1.0, 1.0, -1.0, // 2 1.0, 1.0, 1.0, // 6 1.0, 1.0, 1.0, // 6 1.0, -1.0, 1.0, // 5 1.0, -1.0, -1.0, // 1 -1.0, -1.0, 1.0, // 4 1.0, -1.0, 1.0, // 5 1.0, 1.0, 1.0, // 6 1.0, 1.0, 1.0, // 6 -1.0, 1.0, 1.0, // 7 -1.0, -1.0, 1.0, // 4 1.0, 1.0, -1.0, // 2 -1.0, 1.0, -1.0, // 3 1.0, 1.0, 1.0, // 6 1.0, 1.0, 1.0, // 6 -1.0, 1.0, -1.0, // 3 -1.0, 1.0, 1.0, // 7 -1.0, -1.0, -1.0, // 0 -1.0, 1.0, 1.0, // 7 -1.0, 1.0, -1.0, // 3 -1.0, -1.0, -1.0, // 0 -1.0, -1.0, 1.0, // 4 -1.0, 1.0, 1.0, // 7 -1.0, -1.0, -1.0, // 0 1.0, -1.0, -1.0, // 1 1.0, -1.0, 1.0, // 5 -1.0, -1.0, -1.0, // 0 1.0, -1.0, 1.0, // 5 -1.0, -1.0, 1.0 // 4 }; const GLfloat cubeTexCoords[] = { 0.0, 0.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 0.0 }; [EAGLContext setCurrentContext:context]; glBindFramebuffer(GL_FRAMEBUFFER, defaultFramebuffer); glEnable(GL_CULL_FACE); glCullFace(GL_BACK); glViewport(0, 0, backingWidth, backingHeight); glClearColor(0.0f, 0.0f, 0.0f, 1.0f); glClear(GL_COLOR_BUFFER_BIT); glUseProgram(program); // Perform incremental rotation based on current angles in X and Y if ((xRotation != 0.0) || (yRotation != 0.0)) { GLfloat totalRotation = sqrt(xRotation*xRotation + yRotation*yRotation); CATransform3D temporaryMatrix = CATransform3DRotate(currentCalculatedMatrix, totalRotation * M_PI / 180.0, ((xRotation/totalRotation) * currentCalculatedMatrix.m12 + (yRotation/totalRotation) * currentCalculatedMatrix.m11), ((xRotation/totalRotation) * currentCalculatedMatrix.m22 + (yRotation/totalRotation) * currentCalculatedMatrix.m21), ((xRotation/totalRotation) * currentCalculatedMatrix.m32 + (yRotation/totalRotation) * currentCalculatedMatrix.m31)); if ((temporaryMatrix.m11 >= -100.0) && (temporaryMatrix.m11 <= 100.0)) currentCalculatedMatrix = temporaryMatrix; } else { } GLfloat currentModelViewMatrix[16]; [self convert3DTransform:¤tCalculatedMatrix toMatrix:currentModelViewMatrix]; glActiveTexture(GL_TEXTURE4); glBindTexture(GL_TEXTURE_2D, textureForCubeFace); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); // Update uniform value glUniform1i(uniforms[UNIFORM_TEXTURE], 4); glUniformMatrix4fv(uniforms[UNIFORM_MODELVIEWMATRIX], 1, 0, currentModelViewMatrix); // Update attribute values glVertexAttribPointer(ATTRIB_VERTEX, 3, GL_FLOAT, 0, 0, cubeVertices); glEnableVertexAttribArray(ATTRIB_VERTEX); glVertexAttribPointer(ATTRIB_TEXTUREPOSITION, 2, GL_FLOAT, 0, 0, cubeTexCoords); glEnableVertexAttribArray(ATTRIB_TEXTUREPOSITION); glDrawArrays(GL_TRIANGLES, 0, 36); // The flush is required at the end here to make sure the FBO texture is written to before passing it back to GPUImage glFlush(); newFrameAvailableBlock(); } - (BOOL)compileShader:(GLuint *)shader type:(GLenum)type file:(NSString *)file { GLint status; const GLchar *source; source = (GLchar *)[[NSString stringWithContentsOfFile:file encoding:NSUTF8StringEncoding error:nil] UTF8String]; if (!source) { NSLog(@"Failed to load vertex shader"); return FALSE; } *shader = glCreateShader(type); glShaderSource(*shader, 1, &source, NULL); glCompileShader(*shader); #if defined(DEBUG) GLint logLength; glGetShaderiv(*shader, GL_INFO_LOG_LENGTH, &logLength); if (logLength > 0) { GLchar *log = (GLchar *)malloc(logLength); glGetShaderInfoLog(*shader, logLength, &logLength, log); NSLog(@"Shader compile log:\n%s", log); free(log); } #endif glGetShaderiv(*shader, GL_COMPILE_STATUS, &status); if (status == 0) { glDeleteShader(*shader); return FALSE; } return TRUE; } - (BOOL)linkProgram:(GLuint)prog { GLint status; glLinkProgram(prog); #if defined(DEBUG) GLint logLength; glGetProgramiv(prog, GL_INFO_LOG_LENGTH, &logLength); if (logLength > 0) { GLchar *log = (GLchar *)malloc(logLength); glGetProgramInfoLog(prog, logLength, &logLength, log); NSLog(@"Program link log:\n%s", log); free(log); } #endif glGetProgramiv(prog, GL_LINK_STATUS, &status); if (status == 0) return FALSE; return TRUE; } - (BOOL)validateProgram:(GLuint)prog { GLint logLength, status; glValidateProgram(prog); glGetProgramiv(prog, GL_INFO_LOG_LENGTH, &logLength); if (logLength > 0) { GLchar *log = (GLchar *)malloc(logLength); glGetProgramInfoLog(prog, logLength, &logLength, log); NSLog(@"Program validate log:\n%s", log); free(log); } glGetProgramiv(prog, GL_VALIDATE_STATUS, &status); if (status == 0) return FALSE; return TRUE; } - (BOOL)loadShaders { GLuint vertShader, fragShader; NSString *vertShaderPathname, *fragShaderPathname; // Create shader program program = glCreateProgram(); // Create and compile vertex shader vertShaderPathname = [[NSBundle mainBundle] pathForResource:@"Shader" ofType:@"vsh"]; if (![self compileShader:&vertShader type:GL_VERTEX_SHADER file:vertShaderPathname]) { NSLog(@"Failed to compile vertex shader"); return FALSE; } // Create and compile fragment shader fragShaderPathname = [[NSBundle mainBundle] pathForResource:@"Shader" ofType:@"fsh"]; if (![self compileShader:&fragShader type:GL_FRAGMENT_SHADER file:fragShaderPathname]) { NSLog(@"Failed to compile fragment shader"); return FALSE; } // Attach vertex shader to program glAttachShader(program, vertShader); // Attach fragment shader to program glAttachShader(program, fragShader); // Bind attribute locations // this needs to be done prior to linking glBindAttribLocation(program, ATTRIB_VERTEX, "position"); glBindAttribLocation(program, ATTRIB_TEXTUREPOSITION, "inputTextureCoordinate"); // Link program if (![self linkProgram:program]) { NSLog(@"Failed to link program: %d", program); if (vertShader) { glDeleteShader(vertShader); vertShader = 0; } if (fragShader) { glDeleteShader(fragShader); fragShader = 0; } if (program) { glDeleteProgram(program); program = 0; } return FALSE; } // Get uniform locations uniforms[UNIFORM_MODELVIEWMATRIX] = glGetUniformLocation(program, "modelViewProjMatrix"); uniforms[UNIFORM_TEXTURE] = glGetUniformLocation(program, "texture"); // Release vertex and fragment shaders if (vertShader) glDeleteShader(vertShader); if (fragShader) glDeleteShader(fragShader); return TRUE; } - (void)dealloc { // Tear down GL if (defaultFramebuffer) { glDeleteFramebuffers(1, &defaultFramebuffer); defaultFramebuffer = 0; } if (colorRenderbuffer) { glDeleteRenderbuffers(1, &colorRenderbuffer); colorRenderbuffer = 0; } if (program) { glDeleteProgram(program); program = 0; } // Tear down context if ([EAGLContext currentContext] == context) [EAGLContext setCurrentContext:nil]; [context release]; context = nil; [super dealloc]; } - (void)convert3DTransform:(CATransform3D *)transform3D toMatrix:(GLfloat *)matrix; { // struct CATransform3D // { // CGFloat m11, m12, m13, m14; // CGFloat m21, m22, m23, m24; // CGFloat m31, m32, m33, m34; // CGFloat m41, m42, m43, m44; // }; matrix[0] = (GLfloat)transform3D->m11; matrix[1] = (GLfloat)transform3D->m12; matrix[2] = (GLfloat)transform3D->m13; matrix[3] = (GLfloat)transform3D->m14; matrix[4] = (GLfloat)transform3D->m21; matrix[5] = (GLfloat)transform3D->m22; matrix[6] = (GLfloat)transform3D->m23; matrix[7] = (GLfloat)transform3D->m24; matrix[8] = (GLfloat)transform3D->m31; matrix[9] = (GLfloat)transform3D->m32; matrix[10] = (GLfloat)transform3D->m33; matrix[11] = (GLfloat)transform3D->m34; matrix[12] = (GLfloat)transform3D->m41; matrix[13] = (GLfloat)transform3D->m42; matrix[14] = (GLfloat)transform3D->m43; matrix[15] = (GLfloat)transform3D->m44; } - (void)startCameraCapture; { [videoCamera startCameraCapture]; } #pragma mark - #pragma mark GPUImageTextureOutputDelegate delegate method - (void)newFrameReadyFromTextureOutput:(GPUImageTextureOutput *)callbackTextureOutput; { // Rotation in response to touch events is handled on the main thread, so to be safe we dispatch this on the main queue as well // Nominally, I should create a dispatch queue just for the rendering within this application, but not today dispatch_async(dispatch_get_main_queue(), ^{ textureForCubeFace = callbackTextureOutput.texture; [self renderByRotatingAroundX:0.0 rotatingAroundY:0.0]; [callbackTextureOutput doneWithTexture]; }); } @end ================================================ FILE: examples/iOS/CubeExample/Classes/ESRenderer.h ================================================ #import #import #import @protocol ESRenderer - (void)renderByRotatingAroundX:(float)xRotation rotatingAroundY:(float)yRotation; @end ================================================ FILE: examples/iOS/CubeExample/CubeExample-Info.plist ================================================ CFBundleDevelopmentRegion English CFBundleDisplayName ${PRODUCT_NAME} CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIconFile CFBundleIdentifier com.yourcompany.${PRODUCT_NAME:rfc1034identifier} CFBundleInfoDictionaryVersion 6.0 CFBundleName ${PRODUCT_NAME} CFBundlePackageType APPL CFBundleSignature ???? CFBundleVersion 1.0 LSRequiresIPhoneOS UIPrerenderedIcon UIRequiredDeviceCapabilities armv7 UIStatusBarHidden UISupportedInterfaceOrientations UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UISupportedInterfaceOrientations~ipad UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight ================================================ FILE: examples/iOS/CubeExample/CubeExample.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ 1D3623260D0F684500981E51 /* CubeExampleAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* CubeExampleAppDelegate.m */; }; 1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; }; 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; 2514C27310084DB100A42282 /* ES2Renderer.m in Sources */ = {isa = PBXBuildFile; fileRef = 2514C27010084DB100A42282 /* ES2Renderer.m */; }; 2514C27B10084DCA00A42282 /* Shader.fsh in Resources */ = {isa = PBXBuildFile; fileRef = 2514C27910084DCA00A42282 /* Shader.fsh */; }; 2514C27C10084DCA00A42282 /* Shader.vsh in Resources */ = {isa = PBXBuildFile; fileRef = 2514C27A10084DCA00A42282 /* Shader.vsh */; }; 28FD15000DC6FC520079059D /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28FD14FF0DC6FC520079059D /* OpenGLES.framework */; }; 28FD15080DC6FC5B0079059D /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28FD15070DC6FC5B0079059D /* QuartzCore.framework */; }; BCB3C3EC16BCA5AC003D26B0 /* Icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C3E716BCA5AC003D26B0 /* Icon-72.png */; }; BCB3C3ED16BCA5AC003D26B0 /* Icon-72@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C3E816BCA5AC003D26B0 /* Icon-72@2x.png */; }; BCB3C3EE16BCA5AC003D26B0 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C3E916BCA5AC003D26B0 /* Icon.png */; }; BCB3C3EF16BCA5AC003D26B0 /* Icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C3EA16BCA5AC003D26B0 /* Icon@2x.png */; }; BCB3C3F016BCA5AC003D26B0 /* iTunesArtwork.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C3EB16BCA5AC003D26B0 /* iTunesArtwork.png */; }; BCB6B8A41505A9840041703B /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB6B8A11505A9840041703B /* AVFoundation.framework */; }; BCB6B8A51505A9840041703B /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB6B8A21505A9840041703B /* CoreMedia.framework */; }; BCB6B8A61505A9840041703B /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB6B8A31505A9840041703B /* CoreVideo.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; BCB6B8C41505C2780041703B /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB6B8C31505C2780041703B /* CoreGraphics.framework */; }; BCF3D690153CC5E6009A1FE5 /* DisplayViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF3D68F153CC5E6009A1FE5 /* DisplayViewController.m */; }; BCF866F61725A44300912E34 /* libGPUImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BCF866F11725A41E00912E34 /* libGPUImage.a */; }; E5066F311855A66A008C7682 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E5066F301855A66A008C7682 /* Default-568h@2x.png */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ BC7E93D119EB2306006D23C3 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BCB6B883150447DF0041703B /* GPUImage.xcodeproj */; proxyType = 2; remoteGlobalIDString = BCE209E51943F20C002FEED8; remoteInfo = GPUImageFramework; }; BCF866F01725A41E00912E34 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BCB6B883150447DF0041703B /* GPUImage.xcodeproj */; proxyType = 2; remoteGlobalIDString = BCF1A33414DDB1EC00852800; remoteInfo = GPUImage; }; BCF866F41725A43C00912E34 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BCB6B883150447DF0041703B /* GPUImage.xcodeproj */; proxyType = 1; remoteGlobalIDString = BCF1A33314DDB1EC00852800; remoteInfo = GPUImage; }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 1D3623240D0F684500981E51 /* CubeExampleAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CubeExampleAppDelegate.h; sourceTree = ""; }; 1D3623250D0F684500981E51 /* CubeExampleAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CubeExampleAppDelegate.m; sourceTree = ""; }; 1D6058910D05DD3D006BFB54 /* CubeExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CubeExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 2514C26F10084DB100A42282 /* ES2Renderer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ES2Renderer.h; sourceTree = ""; }; 2514C27010084DB100A42282 /* ES2Renderer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ES2Renderer.m; sourceTree = ""; }; 2514C27110084DB100A42282 /* ESRenderer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ESRenderer.h; sourceTree = ""; }; 2514C27910084DCA00A42282 /* Shader.fsh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; name = Shader.fsh; path = Shaders/Shader.fsh; sourceTree = ""; }; 2514C27A10084DCA00A42282 /* Shader.vsh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; name = Shader.vsh; path = Shaders/Shader.vsh; sourceTree = ""; }; 28FD14FF0DC6FC520079059D /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; 28FD15070DC6FC5B0079059D /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 32CA4F630368D1EE00C91783 /* CubeExample_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CubeExample_Prefix.pch; sourceTree = ""; }; 8D1107310486CEB800E47090 /* CubeExample-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "CubeExample-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = ""; }; BCB3C3E716BCA5AC003D26B0 /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-72.png"; path = "../SharedIcons/Icon-72.png"; sourceTree = ""; }; BCB3C3E816BCA5AC003D26B0 /* Icon-72@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-72@2x.png"; path = "../SharedIcons/Icon-72@2x.png"; sourceTree = ""; }; BCB3C3E916BCA5AC003D26B0 /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Icon.png; path = ../SharedIcons/Icon.png; sourceTree = ""; }; BCB3C3EA16BCA5AC003D26B0 /* Icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon@2x.png"; path = "../SharedIcons/Icon@2x.png"; sourceTree = ""; }; BCB3C3EB16BCA5AC003D26B0 /* iTunesArtwork.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = iTunesArtwork.png; path = ../SharedIcons/iTunesArtwork.png; sourceTree = ""; }; BCB6B883150447DF0041703B /* GPUImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = GPUImage.xcodeproj; path = ../../../framework/GPUImage.xcodeproj; sourceTree = ""; }; BCB6B8A11505A9840041703B /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; BCB6B8A21505A9840041703B /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; }; BCB6B8A31505A9840041703B /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = System/Library/Frameworks/CoreVideo.framework; sourceTree = SDKROOT; }; BCB6B8C31505C2780041703B /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; BCF3D68E153CC5E5009A1FE5 /* DisplayViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DisplayViewController.h; sourceTree = ""; }; BCF3D68F153CC5E6009A1FE5 /* DisplayViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DisplayViewController.m; sourceTree = ""; }; E5066F301855A66A008C7682 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 1D60588F0D05DD3D006BFB54 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( BCF866F61725A44300912E34 /* libGPUImage.a in Frameworks */, BCB6B8C41505C2780041703B /* CoreGraphics.framework in Frameworks */, BCB6B8A41505A9840041703B /* AVFoundation.framework in Frameworks */, BCB6B8A51505A9840041703B /* CoreMedia.framework in Frameworks */, BCB6B8A61505A9840041703B /* CoreVideo.framework in Frameworks */, 28FD15000DC6FC520079059D /* OpenGLES.framework in Frameworks */, 28FD15080DC6FC5B0079059D /* QuartzCore.framework in Frameworks */, 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */, 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 080E96DDFE201D6D7F000001 /* Classes */ = { isa = PBXGroup; children = ( 2514C26F10084DB100A42282 /* ES2Renderer.h */, 2514C27010084DB100A42282 /* ES2Renderer.m */, 2514C27110084DB100A42282 /* ESRenderer.h */, BCF3D68E153CC5E5009A1FE5 /* DisplayViewController.h */, BCF3D68F153CC5E6009A1FE5 /* DisplayViewController.m */, 1D3623240D0F684500981E51 /* CubeExampleAppDelegate.h */, 1D3623250D0F684500981E51 /* CubeExampleAppDelegate.m */, ); path = Classes; sourceTree = ""; }; 19C28FACFE9D520D11CA2CBB /* Products */ = { isa = PBXGroup; children = ( 1D6058910D05DD3D006BFB54 /* CubeExample.app */, ); name = Products; sourceTree = ""; }; 2514C27610084DB600A42282 /* Shaders */ = { isa = PBXGroup; children = ( 2514C27910084DCA00A42282 /* Shader.fsh */, 2514C27A10084DCA00A42282 /* Shader.vsh */, ); name = Shaders; sourceTree = ""; }; 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { isa = PBXGroup; children = ( E5066F301855A66A008C7682 /* Default-568h@2x.png */, 080E96DDFE201D6D7F000001 /* Classes */, 2514C27610084DB600A42282 /* Shaders */, 29B97315FDCFA39411CA2CEA /* Other Sources */, 29B97317FDCFA39411CA2CEA /* Resources */, 29B97323FDCFA39411CA2CEA /* Frameworks */, 19C28FACFE9D520D11CA2CBB /* Products */, ); name = CustomTemplate; sourceTree = ""; }; 29B97315FDCFA39411CA2CEA /* Other Sources */ = { isa = PBXGroup; children = ( 32CA4F630368D1EE00C91783 /* CubeExample_Prefix.pch */, 29B97316FDCFA39411CA2CEA /* main.m */, ); name = "Other Sources"; sourceTree = ""; }; 29B97317FDCFA39411CA2CEA /* Resources */ = { isa = PBXGroup; children = ( BCB3C3E716BCA5AC003D26B0 /* Icon-72.png */, BCB3C3E816BCA5AC003D26B0 /* Icon-72@2x.png */, BCB3C3E916BCA5AC003D26B0 /* Icon.png */, BCB3C3EA16BCA5AC003D26B0 /* Icon@2x.png */, BCB3C3EB16BCA5AC003D26B0 /* iTunesArtwork.png */, 8D1107310486CEB800E47090 /* CubeExample-Info.plist */, ); name = Resources; sourceTree = ""; }; 29B97323FDCFA39411CA2CEA /* Frameworks */ = { isa = PBXGroup; children = ( BCB6B883150447DF0041703B /* GPUImage.xcodeproj */, BCB6B8A11505A9840041703B /* AVFoundation.framework */, BCB6B8A21505A9840041703B /* CoreMedia.framework */, BCB6B8C31505C2780041703B /* CoreGraphics.framework */, BCB6B8A31505A9840041703B /* CoreVideo.framework */, 28FD15070DC6FC5B0079059D /* QuartzCore.framework */, 28FD14FF0DC6FC520079059D /* OpenGLES.framework */, 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */, 1D30AB110D05D00D00671497 /* Foundation.framework */, ); name = Frameworks; sourceTree = ""; }; BCF866EB1725A41E00912E34 /* Products */ = { isa = PBXGroup; children = ( BCF866F11725A41E00912E34 /* libGPUImage.a */, BC7E93D219EB2306006D23C3 /* GPUImage.framework */, ); name = Products; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ 1D6058900D05DD3D006BFB54 /* CubeExample */ = { isa = PBXNativeTarget; buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "CubeExample" */; buildPhases = ( 1D60588D0D05DD3D006BFB54 /* Resources */, 1D60588E0D05DD3D006BFB54 /* Sources */, 1D60588F0D05DD3D006BFB54 /* Frameworks */, ); buildRules = ( ); dependencies = ( BCF866F51725A43C00912E34 /* PBXTargetDependency */, ); name = CubeExample; productName = CubeExample; productReference = 1D6058910D05DD3D006BFB54 /* CubeExample.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 29B97313FDCFA39411CA2CEA /* Project object */ = { isa = PBXProject; attributes = { LastUpgradeCheck = 0500; }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "CubeExample" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 1; knownRegions = ( English, Japanese, French, German, ); mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; projectDirPath = ""; projectReferences = ( { ProductGroup = BCF866EB1725A41E00912E34 /* Products */; ProjectRef = BCB6B883150447DF0041703B /* GPUImage.xcodeproj */; }, ); projectRoot = ""; targets = ( 1D6058900D05DD3D006BFB54 /* CubeExample */, ); }; /* End PBXProject section */ /* Begin PBXReferenceProxy section */ BC7E93D219EB2306006D23C3 /* GPUImage.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; path = GPUImage.framework; remoteRef = BC7E93D119EB2306006D23C3 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; BCF866F11725A41E00912E34 /* libGPUImage.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = libGPUImage.a; remoteRef = BCF866F01725A41E00912E34 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ 1D60588D0D05DD3D006BFB54 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( 2514C27B10084DCA00A42282 /* Shader.fsh in Resources */, 2514C27C10084DCA00A42282 /* Shader.vsh in Resources */, BCB3C3EC16BCA5AC003D26B0 /* Icon-72.png in Resources */, BCB3C3ED16BCA5AC003D26B0 /* Icon-72@2x.png in Resources */, BCB3C3EE16BCA5AC003D26B0 /* Icon.png in Resources */, E5066F311855A66A008C7682 /* Default-568h@2x.png in Resources */, BCB3C3EF16BCA5AC003D26B0 /* Icon@2x.png in Resources */, BCB3C3F016BCA5AC003D26B0 /* iTunesArtwork.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ 1D60588E0D05DD3D006BFB54 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 1D60589B0D05DD56006BFB54 /* main.m in Sources */, 1D3623260D0F684500981E51 /* CubeExampleAppDelegate.m in Sources */, 2514C27310084DB100A42282 /* ES2Renderer.m in Sources */, BCF3D690153CC5E6009A1FE5 /* DisplayViewController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ BCF866F51725A43C00912E34 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = GPUImage; targetProxy = BCF866F41725A43C00912E34 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ 1D6058940D05DD3E006BFB54 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = CubeExample_Prefix.pch; "GCC_THUMB_SUPPORT[arch=armv6]" = ""; INFOPLIST_FILE = "CubeExample-Info.plist"; PRODUCT_NAME = CubeExample; }; name = Debug; }; 1D6058950D05DD3E006BFB54 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; COPY_PHASE_STRIP = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = CubeExample_Prefix.pch; "GCC_THUMB_SUPPORT[arch=armv6]" = ""; INFOPLIST_FILE = "CubeExample-Info.plist"; PRODUCT_NAME = CubeExample; VALIDATE_PRODUCT = YES; }; name = Release; }; C01FCF4F08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; GCC_C_LANGUAGE_STANDARD = c99; GCC_PREPROCESSOR_DEFINITIONS = DEBUG; GCC_TREAT_WARNINGS_AS_ERRORS = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "../../../framework/**"; IPHONEOS_DEPLOYMENT_TARGET = 4.3; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = "-fobjc-arc"; PREBINDING = NO; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; C01FCF5008A954540054247B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; GCC_C_LANGUAGE_STANDARD = c99; GCC_TREAT_WARNINGS_AS_ERRORS = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "../../../framework/**"; IPHONEOS_DEPLOYMENT_TARGET = 4.3; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; OTHER_LDFLAGS = "-fobjc-arc"; PREBINDING = NO; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "CubeExample" */ = { isa = XCConfigurationList; buildConfigurations = ( 1D6058940D05DD3E006BFB54 /* Debug */, 1D6058950D05DD3E006BFB54 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; C01FCF4E08A954540054247B /* Build configuration list for PBXProject "CubeExample" */ = { isa = XCConfigurationList; buildConfigurations = ( C01FCF4F08A954540054247B /* Debug */, C01FCF5008A954540054247B /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; } ================================================ FILE: examples/iOS/CubeExample/CubeExample.xcodeproj/xcshareddata/xcschemes/CubeExample.xcscheme ================================================ ================================================ FILE: examples/iOS/CubeExample/CubeExample_Prefix.pch ================================================ // // Prefix header for all source files of the 'CubeExample' target in the 'CubeExample' project // #import #ifndef __IPHONE_3_0 #warning "This project uses features only available in iPhone SDK 3.0 and later." #endif #ifdef __OBJC__ #import #import #endif ================================================ FILE: examples/iOS/CubeExample/Shaders/Shader.fsh ================================================ varying highp vec2 textureCoordinate; uniform sampler2D texture; void main() { gl_FragColor = texture2D(texture, textureCoordinate); // gl_FragColor = vec4(textureCoordinate, 1.0, 1.0); } ================================================ FILE: examples/iOS/CubeExample/Shaders/Shader.vsh ================================================ attribute vec4 position; attribute vec4 inputTextureCoordinate; varying vec2 textureCoordinate; uniform mat4 modelViewProjMatrix; void main() { gl_Position = modelViewProjMatrix * position; textureCoordinate = inputTextureCoordinate.xy; } ================================================ FILE: examples/iOS/CubeExample/main.m ================================================ // // main.m // CubeExample // // Created by Brad Larson on 4/20/2010. // #import #import "CubeExampleAppDelegate.h" int main(int argc, char *argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; int retVal = UIApplicationMain(argc, argv, nil, NSStringFromClass([CubeExampleAppDelegate class])); [pool release]; return retVal; } ================================================ FILE: examples/iOS/FeatureExtractionTest/FeatureExtractionTest/FeatureExtractionAppDelegate.h ================================================ #import #import "GPUImage.h" @interface FeatureExtractionAppDelegate : UIResponder @property (strong, nonatomic) UIWindow *window; - (void)testHoughTransform:(GPUImageHoughTransformLineDetector *)lineDetector ofName:(NSString *)detectorName againstPicture:(GPUImagePicture *)pictureInput withName:(NSString *)pictureName; - (void)testCornerDetector:(GPUImageHarrisCornerDetectionFilter *)cornerDetector ofName:(NSString *)detectorName againstPicture:(GPUImagePicture *)pictureInput withName:(NSString *)pictureName; - (void)testHarrisCornerDetectorAgainstPicture:(GPUImagePicture *)pictureInput withName:(NSString *)pictureName; - (void)testNobleCornerDetectorAgainstPicture:(GPUImagePicture *)pictureInput withName:(NSString *)pictureName; - (void)testShiTomasiCornerDetectorAgainstPicture:(GPUImagePicture *)pictureInput withName:(NSString *)pictureName; - (void)saveImage:(UIImage *)imageToSave fileName:(NSString *)imageName; @end ================================================ FILE: examples/iOS/FeatureExtractionTest/FeatureExtractionTest/FeatureExtractionAppDelegate.m ================================================ #import "FeatureExtractionAppDelegate.h" @interface FeatureExtractionAppDelegate() { GPUImageHoughTransformLineDetector *houghTransformLineDetector, *houghTransformLineDetector2, *houghTransformLineDetector3, *houghTransformLineDetector4; GPUImagePicture *blackAndWhiteBoxImage, *chairPicture, *lineTestPicture, *lineTestPicture2; GPUImageAverageColor *averageColor; GPUImageLuminosity *averageLuminosity; GPUImageHarrisCornerDetectionFilter *harrisCornerFilter; GPUImageNobleCornerDetectionFilter *nobleCornerFilter; GPUImageShiTomasiFeatureDetectionFilter *shiTomasiCornerFilter; } @end @implementation FeatureExtractionAppDelegate @synthesize window = _window; - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // Override point for customization after application launch. self.window.backgroundColor = [UIColor whiteColor]; [self.window makeKeyAndVisible]; UIImage *inputImage = [UIImage imageNamed:@"71yih.png"]; blackAndWhiteBoxImage = [[GPUImagePicture alloc] initWithImage:inputImage]; UIImage *chairImage = [UIImage imageNamed:@"ChairTest.png"]; chairPicture = [[GPUImagePicture alloc] initWithImage:chairImage]; UIImage *lineTestImage = [UIImage imageNamed:@"LineTest.png"]; lineTestPicture = [[GPUImagePicture alloc] initWithImage:lineTestImage]; UIImage *lineTestImage2 = [UIImage imageNamed:@"LineTest2.png"]; lineTestPicture2 = [[GPUImagePicture alloc] initWithImage:lineTestImage2]; // Testing feature detection [self testHarrisCornerDetectorAgainstPicture:blackAndWhiteBoxImage withName:@"WhiteBoxes"]; [self testNobleCornerDetectorAgainstPicture:blackAndWhiteBoxImage withName:@"WhiteBoxes"]; [self testShiTomasiCornerDetectorAgainstPicture:blackAndWhiteBoxImage withName:@"WhiteBoxes"]; // Testing Hough transform houghTransformLineDetector = [[GPUImageHoughTransformLineDetector alloc] init]; [self testHoughTransform:houghTransformLineDetector ofName:@"HoughTransform" againstPicture:blackAndWhiteBoxImage withName:@"WhiteBoxes"]; houghTransformLineDetector2 = [[GPUImageHoughTransformLineDetector alloc] init]; [self testHoughTransform:houghTransformLineDetector2 ofName:@"HoughTransform" againstPicture:chairPicture withName:@"Chair"]; houghTransformLineDetector3 = [[GPUImageHoughTransformLineDetector alloc] init]; [self testHoughTransform:houghTransformLineDetector3 ofName:@"HoughTransform" againstPicture:lineTestPicture withName:@"LineTest"]; houghTransformLineDetector4 = [[GPUImageHoughTransformLineDetector alloc] init]; [self testHoughTransform:houghTransformLineDetector4 ofName:@"HoughTransform" againstPicture:lineTestPicture2 withName:@"LineTest2"]; // Testing erosion and dilation GPUImageErosionFilter *erosionFilter = [[GPUImageErosionFilter alloc] initWithRadius:4]; [blackAndWhiteBoxImage removeAllTargets]; [blackAndWhiteBoxImage addTarget:erosionFilter]; [erosionFilter useNextFrameForImageCapture]; [blackAndWhiteBoxImage processImage]; UIImage *erosionImage = [erosionFilter imageFromCurrentFramebuffer]; [self saveImage:erosionImage fileName:@"Erosion4.png"]; GPUImageDilationFilter *dilationFilter = [[GPUImageDilationFilter alloc] initWithRadius:4]; [blackAndWhiteBoxImage removeAllTargets]; [blackAndWhiteBoxImage addTarget:dilationFilter]; [dilationFilter useNextFrameForImageCapture]; [blackAndWhiteBoxImage processImage]; UIImage *dilationImage = [dilationFilter imageFromCurrentFramebuffer]; [self saveImage:dilationImage fileName:@"Dilation4.png"]; GPUImageOpeningFilter *openingFilter = [[GPUImageOpeningFilter alloc] initWithRadius:4]; [blackAndWhiteBoxImage removeAllTargets]; [blackAndWhiteBoxImage addTarget:openingFilter]; [openingFilter useNextFrameForImageCapture]; [blackAndWhiteBoxImage processImage]; UIImage *openingImage = [openingFilter imageFromCurrentFramebuffer]; [self saveImage:openingImage fileName:@"Opening4.png"]; GPUImageClosingFilter *closingFilter = [[GPUImageClosingFilter alloc] initWithRadius:4]; [blackAndWhiteBoxImage removeAllTargets]; [blackAndWhiteBoxImage addTarget:closingFilter]; [closingFilter useNextFrameForImageCapture]; [blackAndWhiteBoxImage processImage]; UIImage *closingImage = [closingFilter imageFromCurrentFramebuffer]; [self saveImage:closingImage fileName:@"Closing4.png"]; UIImage *compressionInputImage = [UIImage imageNamed:@"8pixeltest.png"]; GPUImagePicture *compressionImage = [[GPUImagePicture alloc] initWithImage:compressionInputImage]; GPUImageColorPackingFilter *packingFilter = [[GPUImageColorPackingFilter alloc] init]; [compressionImage addTarget:packingFilter]; [packingFilter useNextFrameForImageCapture]; [compressionImage processImage]; UIImage *compressedImage = [packingFilter imageFromCurrentFramebuffer]; [self saveImage:compressedImage fileName:@"Compression.png"]; // Testing local binary patterns UIImage *inputLBPImage = [UIImage imageNamed:@"LBPTest.png"]; GPUImagePicture *lbpImage = [[GPUImagePicture alloc] initWithImage:inputLBPImage]; GPUImageLocalBinaryPatternFilter *lbpFilter = [[GPUImageLocalBinaryPatternFilter alloc] init]; [lbpImage removeAllTargets]; [lbpImage addTarget:lbpFilter]; [lbpFilter useNextFrameForImageCapture]; [lbpImage processImage]; UIImage *lbpOutput = [lbpFilter imageFromCurrentFramebuffer]; [self saveImage:lbpOutput fileName:@"LocalBinaryPatterns.png"]; // Testing image color averaging averageColor = [[GPUImageAverageColor alloc] init]; [averageColor setColorAverageProcessingFinishedBlock:^(CGFloat redComponent, CGFloat greenComponent, CGFloat blueComponent, CGFloat alphaComponent, CMTime frameTime){ NSLog(@"Red: %f, green: %f, blue: %f, alpha: %f", redComponent, greenComponent, blueComponent, alphaComponent); }]; averageLuminosity = [[GPUImageLuminosity alloc] init]; [averageLuminosity setLuminosityProcessingFinishedBlock:^(CGFloat luminosity, CMTime frameTime) { NSLog(@"Luminosity: %f", luminosity); }]; // Testing Gaussian blur UIImage *gaussianBlurInput = [UIImage imageNamed:@"GaussianTest.png"]; GPUImagePicture *gaussianImage = [[GPUImagePicture alloc] initWithImage:gaussianBlurInput]; GPUImageGaussianBlurFilter *gaussianBlur = [[GPUImageGaussianBlurFilter alloc] init]; gaussianBlur.blurRadiusInPixels = 2.0; [gaussianImage addTarget:gaussianBlur]; [gaussianBlur useNextFrameForImageCapture]; [gaussianImage processImage]; UIImage *gaussianOutput = [gaussianBlur imageFromCurrentFramebuffer]; [self saveImage:gaussianOutput fileName:@"Gaussian-GPUImage.png"]; CIContext *coreImageContext = [CIContext contextWithEAGLContext:[[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]]; // CIContext *coreImageContext = [CIContext contextWithOptions:nil]; // NSArray *cifilters = [CIFilter filterNamesInCategory:kCICategoryBuiltIn]; // for (NSString *ciFilterName in cifilters) // { // NSLog(@"%@", ciFilterName); // } CIImage *inputCIGaussianImage = [[CIImage alloc] initWithCGImage:gaussianBlurInput.CGImage]; CIFilter *gaussianBlurCIFilter = [CIFilter filterWithName:@"CIGaussianBlur" keysAndValues: kCIInputImageKey, inputCIGaussianImage, @"inputRadius", [NSNumber numberWithFloat:2.0], nil]; CIImage *coreImageResult = [gaussianBlurCIFilter outputImage]; CGImageRef resultRef = [coreImageContext createCGImage:coreImageResult fromRect:CGRectMake(0, 0, gaussianBlurInput.size.width, gaussianBlurInput.size.height)]; UIImage *coreImageResult2 = [UIImage imageWithCGImage:resultRef]; [self saveImage:coreImageResult2 fileName:@"Gaussian-CoreImage.png"]; CGImageRelease(resultRef); GPUImageBoxBlurFilter *boxBlur = [[GPUImageBoxBlurFilter alloc] init]; boxBlur.blurRadiusInPixels = 3.0; [gaussianImage removeAllTargets]; [gaussianImage addTarget:boxBlur]; [boxBlur useNextFrameForImageCapture]; [gaussianImage processImage]; UIImage *boxOutput = [boxBlur imageFromCurrentFramebuffer]; [self saveImage:boxOutput fileName:@"BoxBlur-GPUImage.png"]; CIImage *inputCIBoxImage = [[CIImage alloc] initWithCGImage:gaussianBlurInput.CGImage]; CIFilter *boxBlurCIFilter = [CIFilter filterWithName:@"CIBoxBlur" keysAndValues: kCIInputImageKey, inputCIBoxImage, @"inputRadius", [NSNumber numberWithFloat:2.0], nil]; NSLog(@"Box blur: %@", boxBlurCIFilter); CIImage *coreImageResult3 = [boxBlurCIFilter outputImage]; CGImageRef resultRef2 = [coreImageContext createCGImage:coreImageResult3 fromRect:CGRectMake(0, 0, gaussianBlurInput.size.width, gaussianBlurInput.size.height)]; UIImage *coreImageResult4 = [UIImage imageWithCGImage:resultRef2]; [self saveImage:coreImageResult4 fileName:@"BoxBlur-CoreImage.png"]; CGImageRelease(resultRef2); [chairPicture removeAllTargets]; [chairPicture addTarget:averageColor]; [chairPicture addTarget:averageLuminosity]; [chairPicture processImage]; // UIImage *lbpOutput = [lbpFilter imageFromCurrentlyProcessedOutput]; // [self saveImage:lbpOutput fileName:@"LocalBinaryPatterns.png"]; return YES; } - (void)testHoughTransform:(GPUImageHoughTransformLineDetector *)lineDetector ofName:(NSString *)detectorName againstPicture:(GPUImagePicture *)pictureInput withName:(NSString *)pictureName; { [pictureInput removeAllTargets]; [pictureInput addTarget:lineDetector]; __unsafe_unretained GPUImageHoughTransformLineDetector * weakDetector = lineDetector; [lineDetector setLinesDetectedBlock:^(GLfloat* lineArray, NSUInteger linesDetected, CMTime frameTime){ NSLog(@"Number of lines: %ld", (unsigned long)linesDetected); GPUImageLineGenerator *lineGenerator = [[GPUImageLineGenerator alloc] init]; // lineGenerator.crosshairWidth = 10.0; [lineGenerator setLineColorRed:1.0 green:0.0 blue:0.0]; [lineGenerator forceProcessingAtSize:[pictureInput outputImageSize]]; GPUImageAlphaBlendFilter *blendFilter = [[GPUImageAlphaBlendFilter alloc] init]; [blendFilter forceProcessingAtSize:[pictureInput outputImageSize]]; [pictureInput addTarget:blendFilter]; [lineGenerator addTarget:blendFilter]; [blendFilter useNextFrameForImageCapture]; [lineGenerator renderLinesFromArray:lineArray count:linesDetected frameTime:frameTime]; dispatch_async(dispatch_get_main_queue(), ^{ NSUInteger currentImageIndex = 0; for (UIImage *currentImage in weakDetector.intermediateImages) { [self saveImage:currentImage fileName:[NSString stringWithFormat:@"%@-%@-%ld.png", detectorName, pictureName, (unsigned long)currentImageIndex]]; currentImageIndex++; } UIImage *crosshairResult = [blendFilter imageFromCurrentFramebuffer]; [self saveImage:crosshairResult fileName:[NSString stringWithFormat:@"%@-%@-Lines.png", detectorName, pictureName]]; }); }]; [pictureInput processImage]; } - (void)testCornerDetector:(GPUImageHarrisCornerDetectionFilter *)cornerDetector ofName:(NSString *)detectorName againstPicture:(GPUImagePicture *)pictureInput withName:(NSString *)pictureName; { cornerDetector.threshold = 0.4; cornerDetector.sensitivity = 4.0; // cornerDetector.blurSize = 1.0; [pictureInput removeAllTargets]; [pictureInput addTarget:cornerDetector]; __unsafe_unretained GPUImageHarrisCornerDetectionFilter * weakDetector = cornerDetector; [cornerDetector setCornersDetectedBlock:^(GLfloat* cornerArray, NSUInteger cornersDetected, CMTime frameTime) { GPUImageCrosshairGenerator *crosshairGenerator = [[GPUImageCrosshairGenerator alloc] init]; crosshairGenerator.crosshairWidth = 10.0; [crosshairGenerator setCrosshairColorRed:1.0 green:0.0 blue:0.0]; [crosshairGenerator forceProcessingAtSize:[pictureInput outputImageSize]]; GPUImageAlphaBlendFilter *blendFilter = [[GPUImageAlphaBlendFilter alloc] init]; [blendFilter forceProcessingAtSize:[pictureInput outputImageSize]]; [pictureInput addTarget:blendFilter]; [crosshairGenerator addTarget:blendFilter]; [blendFilter useNextFrameForImageCapture]; NSLog(@"Number of corners: %ld", (unsigned long)cornersDetected); [crosshairGenerator renderCrosshairsFromArray:cornerArray count:cornersDetected frameTime:frameTime]; dispatch_async(dispatch_get_main_queue(), ^{ NSUInteger currentImageIndex = 0; for (UIImage *currentImage in weakDetector.intermediateImages) { [self saveImage:currentImage fileName:[NSString stringWithFormat:@"%@-%@-%ld.png", detectorName, pictureName, (unsigned long)currentImageIndex]]; currentImageIndex++; } UIImage *crosshairResult = [blendFilter imageFromCurrentFramebuffer]; [self saveImage:crosshairResult fileName:[NSString stringWithFormat:@"%@-%@-Crosshairs.png", detectorName, pictureName]]; }); }]; [pictureInput processImage]; } - (void)testHarrisCornerDetectorAgainstPicture:(GPUImagePicture *)pictureInput withName:(NSString *)pictureName; { harrisCornerFilter = [[GPUImageHarrisCornerDetectionFilter alloc] init]; [self testCornerDetector:harrisCornerFilter ofName:@"Harris" againstPicture:pictureInput withName:pictureName]; } - (void)testNobleCornerDetectorAgainstPicture:(GPUImagePicture *)pictureInput withName:(NSString *)pictureName; { nobleCornerFilter = [[GPUImageNobleCornerDetectionFilter alloc] init]; [self testCornerDetector:nobleCornerFilter ofName:@"Noble" againstPicture:pictureInput withName:pictureName]; } - (void)testShiTomasiCornerDetectorAgainstPicture:(GPUImagePicture *)pictureInput withName:(NSString *)pictureName; { shiTomasiCornerFilter = [[GPUImageShiTomasiFeatureDetectionFilter alloc] init]; [self testCornerDetector:shiTomasiCornerFilter ofName:@"ShiTomasi" againstPicture:pictureInput withName:pictureName]; } - (void)saveImage:(UIImage *)imageToSave fileName:(NSString *)imageName; { NSData *dataForPNGFile = UIImagePNGRepresentation(imageToSave); NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSError *error = nil; if (![dataForPNGFile writeToFile:[documentsDirectory stringByAppendingPathComponent:imageName] options:NSAtomicWrite error:&error]) { return; } } @end ================================================ FILE: examples/iOS/FeatureExtractionTest/FeatureExtractionTest/FeatureExtractionTest-Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleDisplayName ${PRODUCT_NAME} CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier com.sunsetlakesoftware.${PRODUCT_NAME:rfc1034identifier} CFBundleInfoDictionaryVersion 6.0 CFBundleName ${PRODUCT_NAME} CFBundlePackageType APPL CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion 1.0 LSRequiresIPhoneOS UIFileSharingEnabled UIPrerenderedIcon UIRequiredDeviceCapabilities armv7 UISupportedInterfaceOrientations UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UISupportedInterfaceOrientations~ipad UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight ================================================ FILE: examples/iOS/FeatureExtractionTest/FeatureExtractionTest/FeatureExtractionTest-Prefix.pch ================================================ // // Prefix header for all source files of the 'FeatureExtractionTest' target in the 'FeatureExtractionTest' project // #import #ifndef __IPHONE_3_0 #warning "This project uses features only available in iOS SDK 3.0 and later." #endif #ifdef __OBJC__ #import #import #endif ================================================ FILE: examples/iOS/FeatureExtractionTest/FeatureExtractionTest/en.lproj/InfoPlist.strings ================================================ /* Localized versions of Info.plist keys */ ================================================ FILE: examples/iOS/FeatureExtractionTest/FeatureExtractionTest/main.m ================================================ #import #import "FeatureExtractionAppDelegate.h" int main(int argc, char *argv[]) { @autoreleasepool { return UIApplicationMain(argc, argv, nil, NSStringFromClass([FeatureExtractionAppDelegate class])); } } ================================================ FILE: examples/iOS/FeatureExtractionTest/FeatureExtractionTest.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ BC18E09B156C822E00AB8026 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC18E09A156C822E00AB8026 /* UIKit.framework */; }; BC18E09D156C822E00AB8026 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC18E09C156C822E00AB8026 /* Foundation.framework */; }; BC18E09F156C822E00AB8026 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC18E09E156C822E00AB8026 /* CoreGraphics.framework */; }; BC18E0A5156C822E00AB8026 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = BC18E0A3156C822E00AB8026 /* InfoPlist.strings */; }; BC18E0A7156C822E00AB8026 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = BC18E0A6156C822E00AB8026 /* main.m */; }; BC18E0AB156C822E00AB8026 /* FeatureExtractionAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = BC18E0AA156C822E00AB8026 /* FeatureExtractionAppDelegate.m */; }; BC18E0C4156C835500AB8026 /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC18E0C1156C835500AB8026 /* CoreMedia.framework */; }; BC18E0C5156C835500AB8026 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC18E0C2156C835500AB8026 /* CoreVideo.framework */; }; BC18E0C6156C835500AB8026 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC18E0C3156C835500AB8026 /* QuartzCore.framework */; }; BC18E0C8156C835E00AB8026 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC18E0C7156C835E00AB8026 /* OpenGLES.framework */; }; BC18E0CA156C836400AB8026 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC18E0C9156C836400AB8026 /* AVFoundation.framework */; }; BC18E0CC156C881700AB8026 /* 71yih.png in Resources */ = {isa = PBXBuildFile; fileRef = BC18E0CB156C881700AB8026 /* 71yih.png */; }; BC46D52415D03D9C00CC63CA /* LBPTest.png in Resources */ = {isa = PBXBuildFile; fileRef = BC46D52315D03D9C00CC63CA /* LBPTest.png */; }; BC8A581C1810782200E6B507 /* GaussianTest.png in Resources */ = {isa = PBXBuildFile; fileRef = BC8A581B1810782200E6B507 /* GaussianTest.png */; }; BC8A58211810862F00E6B507 /* CoreImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC8A58201810862F00E6B507 /* CoreImage.framework */; }; BCA464C9162785EA00C0F68E /* LineTest.png in Resources */ = {isa = PBXBuildFile; fileRef = BCA464C8162785EA00C0F68E /* LineTest.png */; }; BCB3C3F916BCA61A003D26B0 /* Icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C3F416BCA61A003D26B0 /* Icon-72.png */; }; BCB3C3FA16BCA61A003D26B0 /* Icon-72@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C3F516BCA61A003D26B0 /* Icon-72@2x.png */; }; BCB3C3FB16BCA61A003D26B0 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C3F616BCA61A003D26B0 /* Icon.png */; }; BCB3C3FC16BCA61A003D26B0 /* Icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C3F716BCA61A003D26B0 /* Icon@2x.png */; }; BCB3C3FD16BCA61A003D26B0 /* iTunesArtwork.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C3F816BCA61A003D26B0 /* iTunesArtwork.png */; }; BCB79DC715E9754000965D92 /* ChairTest.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB79DC615E9754000965D92 /* ChairTest.png */; }; BCD9A356157EC35E00C41504 /* 8pixeltest.png in Resources */ = {isa = PBXBuildFile; fileRef = BCD9A355157EC35E00C41504 /* 8pixeltest.png */; }; BCF2860F1628A5140051E9C5 /* LineTest2.png in Resources */ = {isa = PBXBuildFile; fileRef = BCF2860E1628A5140051E9C5 /* LineTest2.png */; }; BCF867031725A53400912E34 /* libGPUImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BCF866FE1725A4E600912E34 /* libGPUImage.a */; }; E5066F3F1855A75D008C7682 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E5066F3E1855A75D008C7682 /* Default-568h@2x.png */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ BC7E93D619EB2321006D23C3 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BC18E0B1156C830F00AB8026 /* GPUImage.xcodeproj */; proxyType = 2; remoteGlobalIDString = BCE209E51943F20C002FEED8; remoteInfo = GPUImageFramework; }; BCF866FD1725A4E600912E34 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BC18E0B1156C830F00AB8026 /* GPUImage.xcodeproj */; proxyType = 2; remoteGlobalIDString = BCF1A33414DDB1EC00852800; remoteInfo = GPUImage; }; BCF867011725A52D00912E34 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BC18E0B1156C830F00AB8026 /* GPUImage.xcodeproj */; proxyType = 1; remoteGlobalIDString = BCF1A33314DDB1EC00852800; remoteInfo = GPUImage; }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ BC18E096156C822E00AB8026 /* FeatureExtractionTest.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FeatureExtractionTest.app; sourceTree = BUILT_PRODUCTS_DIR; }; BC18E09A156C822E00AB8026 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; BC18E09C156C822E00AB8026 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; BC18E09E156C822E00AB8026 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; BC18E0A2156C822E00AB8026 /* FeatureExtractionTest-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "FeatureExtractionTest-Info.plist"; sourceTree = ""; }; BC18E0A4156C822E00AB8026 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; BC18E0A6156C822E00AB8026 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; BC18E0A8156C822E00AB8026 /* FeatureExtractionTest-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "FeatureExtractionTest-Prefix.pch"; sourceTree = ""; }; BC18E0A9156C822E00AB8026 /* FeatureExtractionAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FeatureExtractionAppDelegate.h; sourceTree = ""; }; BC18E0AA156C822E00AB8026 /* FeatureExtractionAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FeatureExtractionAppDelegate.m; sourceTree = ""; }; BC18E0B1156C830F00AB8026 /* GPUImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = GPUImage.xcodeproj; path = ../../../framework/GPUImage.xcodeproj; sourceTree = ""; }; BC18E0C1156C835500AB8026 /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; }; BC18E0C2156C835500AB8026 /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = System/Library/Frameworks/CoreVideo.framework; sourceTree = SDKROOT; }; BC18E0C3156C835500AB8026 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; BC18E0C7156C835E00AB8026 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; BC18E0C9156C836400AB8026 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; BC18E0CB156C881700AB8026 /* 71yih.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = 71yih.png; sourceTree = ""; }; BC46D52315D03D9C00CC63CA /* LBPTest.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = LBPTest.png; sourceTree = ""; }; BC8A581B1810782200E6B507 /* GaussianTest.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = GaussianTest.png; sourceTree = ""; }; BC8A58201810862F00E6B507 /* CoreImage.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreImage.framework; path = System/Library/Frameworks/CoreImage.framework; sourceTree = SDKROOT; }; BCA464C8162785EA00C0F68E /* LineTest.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = LineTest.png; sourceTree = ""; }; BCB3C3F416BCA61A003D26B0 /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-72.png"; path = "../../SharedIcons/Icon-72.png"; sourceTree = ""; }; BCB3C3F516BCA61A003D26B0 /* Icon-72@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-72@2x.png"; path = "../../SharedIcons/Icon-72@2x.png"; sourceTree = ""; }; BCB3C3F616BCA61A003D26B0 /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Icon.png; path = ../../SharedIcons/Icon.png; sourceTree = ""; }; BCB3C3F716BCA61A003D26B0 /* Icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon@2x.png"; path = "../../SharedIcons/Icon@2x.png"; sourceTree = ""; }; BCB3C3F816BCA61A003D26B0 /* iTunesArtwork.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = iTunesArtwork.png; path = ../../SharedIcons/iTunesArtwork.png; sourceTree = ""; }; BCB79DC615E9754000965D92 /* ChairTest.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ChairTest.png; sourceTree = ""; }; BCD9A355157EC35E00C41504 /* 8pixeltest.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = 8pixeltest.png; sourceTree = ""; }; BCF2860E1628A5140051E9C5 /* LineTest2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = LineTest2.png; sourceTree = ""; }; E5066F3E1855A75D008C7682 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ BC18E093156C822E00AB8026 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( BC8A58211810862F00E6B507 /* CoreImage.framework in Frameworks */, BCF867031725A53400912E34 /* libGPUImage.a in Frameworks */, BC18E0CA156C836400AB8026 /* AVFoundation.framework in Frameworks */, BC18E0C8156C835E00AB8026 /* OpenGLES.framework in Frameworks */, BC18E0C4156C835500AB8026 /* CoreMedia.framework in Frameworks */, BC18E0C5156C835500AB8026 /* CoreVideo.framework in Frameworks */, BC18E0C6156C835500AB8026 /* QuartzCore.framework in Frameworks */, BC18E09B156C822E00AB8026 /* UIKit.framework in Frameworks */, BC18E09D156C822E00AB8026 /* Foundation.framework in Frameworks */, BC18E09F156C822E00AB8026 /* CoreGraphics.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ BC18E08B156C822E00AB8026 = { isa = PBXGroup; children = ( E5066F3E1855A75D008C7682 /* Default-568h@2x.png */, BC18E0A0156C822E00AB8026 /* FeatureExtractionTest */, BC18E099156C822E00AB8026 /* Frameworks */, BC18E097156C822E00AB8026 /* Products */, ); sourceTree = ""; }; BC18E097156C822E00AB8026 /* Products */ = { isa = PBXGroup; children = ( BC18E096156C822E00AB8026 /* FeatureExtractionTest.app */, ); name = Products; sourceTree = ""; }; BC18E099156C822E00AB8026 /* Frameworks */ = { isa = PBXGroup; children = ( BC18E0B1156C830F00AB8026 /* GPUImage.xcodeproj */, BC8A58201810862F00E6B507 /* CoreImage.framework */, BC18E09A156C822E00AB8026 /* UIKit.framework */, BC18E09C156C822E00AB8026 /* Foundation.framework */, BC18E09E156C822E00AB8026 /* CoreGraphics.framework */, BC18E0C9156C836400AB8026 /* AVFoundation.framework */, BC18E0C7156C835E00AB8026 /* OpenGLES.framework */, BC18E0C1156C835500AB8026 /* CoreMedia.framework */, BC18E0C2156C835500AB8026 /* CoreVideo.framework */, BC18E0C3156C835500AB8026 /* QuartzCore.framework */, ); name = Frameworks; sourceTree = ""; }; BC18E0A0156C822E00AB8026 /* FeatureExtractionTest */ = { isa = PBXGroup; children = ( BC18E0A9156C822E00AB8026 /* FeatureExtractionAppDelegate.h */, BC18E0AA156C822E00AB8026 /* FeatureExtractionAppDelegate.m */, BC18E0A1156C822E00AB8026 /* Supporting Files */, ); path = FeatureExtractionTest; sourceTree = ""; }; BC18E0A1156C822E00AB8026 /* Supporting Files */ = { isa = PBXGroup; children = ( BC8A581B1810782200E6B507 /* GaussianTest.png */, BCB3C3F416BCA61A003D26B0 /* Icon-72.png */, BCB3C3F516BCA61A003D26B0 /* Icon-72@2x.png */, BCB3C3F616BCA61A003D26B0 /* Icon.png */, BCB3C3F716BCA61A003D26B0 /* Icon@2x.png */, BCB3C3F816BCA61A003D26B0 /* iTunesArtwork.png */, BCF2860E1628A5140051E9C5 /* LineTest2.png */, BCA464C8162785EA00C0F68E /* LineTest.png */, BC46D52315D03D9C00CC63CA /* LBPTest.png */, BCD9A355157EC35E00C41504 /* 8pixeltest.png */, BC18E0CB156C881700AB8026 /* 71yih.png */, BCB79DC615E9754000965D92 /* ChairTest.png */, BC18E0A2156C822E00AB8026 /* FeatureExtractionTest-Info.plist */, BC18E0A3156C822E00AB8026 /* InfoPlist.strings */, BC18E0A6156C822E00AB8026 /* main.m */, BC18E0A8156C822E00AB8026 /* FeatureExtractionTest-Prefix.pch */, ); name = "Supporting Files"; sourceTree = ""; }; BCF866F81725A4E600912E34 /* Products */ = { isa = PBXGroup; children = ( BCF866FE1725A4E600912E34 /* libGPUImage.a */, BC7E93D719EB2321006D23C3 /* GPUImage.framework */, ); name = Products; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ BC18E095156C822E00AB8026 /* FeatureExtractionTest */ = { isa = PBXNativeTarget; buildConfigurationList = BC18E0AE156C822E00AB8026 /* Build configuration list for PBXNativeTarget "FeatureExtractionTest" */; buildPhases = ( BC18E092156C822E00AB8026 /* Sources */, BC18E093156C822E00AB8026 /* Frameworks */, BC18E094156C822E00AB8026 /* Resources */, ); buildRules = ( ); dependencies = ( BCF867021725A52D00912E34 /* PBXTargetDependency */, ); name = FeatureExtractionTest; productName = FeatureExtractionTest; productReference = BC18E096156C822E00AB8026 /* FeatureExtractionTest.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ BC18E08D156C822E00AB8026 /* Project object */ = { isa = PBXProject; attributes = { CLASSPREFIX = FeatureExtraction; LastUpgradeCheck = 0500; ORGANIZATIONNAME = "Cell Phone"; }; buildConfigurationList = BC18E090156C822E00AB8026 /* Build configuration list for PBXProject "FeatureExtractionTest" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, ); mainGroup = BC18E08B156C822E00AB8026; productRefGroup = BC18E097156C822E00AB8026 /* Products */; projectDirPath = ""; projectReferences = ( { ProductGroup = BCF866F81725A4E600912E34 /* Products */; ProjectRef = BC18E0B1156C830F00AB8026 /* GPUImage.xcodeproj */; }, ); projectRoot = ""; targets = ( BC18E095156C822E00AB8026 /* FeatureExtractionTest */, ); }; /* End PBXProject section */ /* Begin PBXReferenceProxy section */ BC7E93D719EB2321006D23C3 /* GPUImage.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; path = GPUImage.framework; remoteRef = BC7E93D619EB2321006D23C3 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; BCF866FE1725A4E600912E34 /* libGPUImage.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = libGPUImage.a; remoteRef = BCF866FD1725A4E600912E34 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ BC18E094156C822E00AB8026 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( BC18E0A5156C822E00AB8026 /* InfoPlist.strings in Resources */, BC18E0CC156C881700AB8026 /* 71yih.png in Resources */, BCD9A356157EC35E00C41504 /* 8pixeltest.png in Resources */, BC46D52415D03D9C00CC63CA /* LBPTest.png in Resources */, BCB79DC715E9754000965D92 /* ChairTest.png in Resources */, E5066F3F1855A75D008C7682 /* Default-568h@2x.png in Resources */, BCA464C9162785EA00C0F68E /* LineTest.png in Resources */, BC8A581C1810782200E6B507 /* GaussianTest.png in Resources */, BCF2860F1628A5140051E9C5 /* LineTest2.png in Resources */, BCB3C3F916BCA61A003D26B0 /* Icon-72.png in Resources */, BCB3C3FA16BCA61A003D26B0 /* Icon-72@2x.png in Resources */, BCB3C3FB16BCA61A003D26B0 /* Icon.png in Resources */, BCB3C3FC16BCA61A003D26B0 /* Icon@2x.png in Resources */, BCB3C3FD16BCA61A003D26B0 /* iTunesArtwork.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ BC18E092156C822E00AB8026 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( BC18E0A7156C822E00AB8026 /* main.m in Sources */, BC18E0AB156C822E00AB8026 /* FeatureExtractionAppDelegate.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ BCF867021725A52D00912E34 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = GPUImage; targetProxy = BCF867011725A52D00912E34 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ BC18E0A3156C822E00AB8026 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( BC18E0A4156C822E00AB8026 /* en */, ); name = InfoPlist.strings; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ BC18E0AC156C822E00AB8026 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "../../../framework/**"; IPHONEOS_DEPLOYMENT_TARGET = 4.3; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; BC18E0AD156C822E00AB8026 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "../../../framework/**"; IPHONEOS_DEPLOYMENT_TARGET = 4.3; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; name = Release; }; BC18E0AF156C822E00AB8026 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "FeatureExtractionTest/FeatureExtractionTest-Prefix.pch"; INFOPLIST_FILE = "FeatureExtractionTest/FeatureExtractionTest-Info.plist"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; name = Debug; }; BC18E0B0156C822E00AB8026 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "FeatureExtractionTest/FeatureExtractionTest-Prefix.pch"; INFOPLIST_FILE = "FeatureExtractionTest/FeatureExtractionTest-Info.plist"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ BC18E090156C822E00AB8026 /* Build configuration list for PBXProject "FeatureExtractionTest" */ = { isa = XCConfigurationList; buildConfigurations = ( BC18E0AC156C822E00AB8026 /* Debug */, BC18E0AD156C822E00AB8026 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; BC18E0AE156C822E00AB8026 /* Build configuration list for PBXNativeTarget "FeatureExtractionTest" */ = { isa = XCConfigurationList; buildConfigurations = ( BC18E0AF156C822E00AB8026 /* Debug */, BC18E0B0156C822E00AB8026 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = BC18E08D156C822E00AB8026 /* Project object */; } ================================================ FILE: examples/iOS/FeatureExtractionTest/FeatureExtractionTest.xcodeproj/xcshareddata/xcschemes/FeatureExtractionTest.xcscheme ================================================ ================================================ FILE: examples/iOS/FilterShowcase/FilterShowcase/CustomFilter.fsh ================================================ varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; void main() { lowp vec3 tc = vec3(1.0, 0.0, 0.0); lowp vec3 pixcol = texture2D(inputImageTexture, textureCoordinate).rgb; lowp vec3 colors[3]; colors[0] = vec3(0.0, 0.0, 1.0); colors[1] = vec3(1.0, 1.0, 0.0); colors[2] = vec3(1.0, 0.0, 0.0); mediump float lum = (pixcol.r + pixcol.g + pixcol.b) / 3.0; int ix = (lum < 0.5)? 0:1; tc = mix(colors[ix], colors[ix + 1], (lum - float(ix) * 0.5) / 0.5); gl_FragColor = vec4(tc, 1.0); } ================================================ FILE: examples/iOS/FilterShowcase/FilterShowcase/FilterShowcase-Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleDisplayName ${PRODUCT_NAME} CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier com.sunsetlakesoftware.${PRODUCT_NAME:rfc1034identifier} CFBundleInfoDictionaryVersion 6.0 CFBundleName ${PRODUCT_NAME} CFBundlePackageType APPL CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion 1.0 LSRequiresIPhoneOS UIPrerenderedIcon UIRequiredDeviceCapabilities armv7 UISupportedInterfaceOrientations UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UISupportedInterfaceOrientations~ipad UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight ================================================ FILE: examples/iOS/FilterShowcase/FilterShowcase/FilterShowcase-Prefix.pch ================================================ // // Prefix header for all source files of the 'FilterShowcase' target in the 'FilterShowcase' project // #import #ifndef __IPHONE_3_0 #warning "This project uses features only available in iOS SDK 3.0 and later." #endif #ifdef __OBJC__ #import #import #endif ================================================ FILE: examples/iOS/FilterShowcase/FilterShowcase/SampleConfiguration.plist ================================================ Filters FilterName GPUImageSepiaFilter FilterName GPUImageGaussianSelectiveBlurFilter Attributes setExcludeCirclePoint: CGPoint(0.5, 0.5) setExcludeCircleRadius: float(0.2) ================================================ FILE: examples/iOS/FilterShowcase/FilterShowcase/ShowcaseAppDelegate.h ================================================ #import @class ShowcaseFilterListController; @interface ShowcaseAppDelegate : UIResponder { UINavigationController *filterNavigationController; ShowcaseFilterListController *filterListController; } @property (strong, nonatomic) UIWindow *window; @end ================================================ FILE: examples/iOS/FilterShowcase/FilterShowcase/ShowcaseAppDelegate.m ================================================ #import "ShowcaseAppDelegate.h" #import "ShowcaseFilterListController.h" @implementation ShowcaseAppDelegate @synthesize window = _window; - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // Override point for customization after application launch. self.window.backgroundColor = [UIColor whiteColor]; filterNavigationController = [[UINavigationController alloc] init]; filterListController = [[ShowcaseFilterListController alloc] initWithNibName:nil bundle:nil]; [filterNavigationController pushViewController:filterListController animated:NO]; [self.window setRootViewController:filterNavigationController]; [self.window makeKeyAndVisible]; return YES; } @end ================================================ FILE: examples/iOS/FilterShowcase/FilterShowcase/ShowcaseFilterListController.h ================================================ #import @interface ShowcaseFilterListController : UITableViewController @end ================================================ FILE: examples/iOS/FilterShowcase/FilterShowcase/ShowcaseFilterListController.m ================================================ #import "ShowcaseFilterListController.h" #import "ShowcaseFilterViewController.h" @interface ShowcaseFilterListController () @end @implementation ShowcaseFilterListController - (id)initWithStyle:(UITableViewStyle)style { self = [super initWithStyle:style]; if (self) { // Custom initialization } return self; } - (void)viewDidLoad { [super viewDidLoad]; self.title = @"Filter List"; } - (void)viewDidUnload { [super viewDidUnload]; // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationPortrait); } #pragma mark - Table view data source - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { // Disable the last filter (Core Image face detection) if running on iOS 4.0 if ([GPUImageContext supportsFastTextureUpload]) { return GPUIMAGE_NUMFILTERS; } else { return (GPUIMAGE_NUMFILTERS - 1); } } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { NSInteger index = [indexPath row]; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"FilterCell"]; if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"FilterCell"]; cell.textLabel.textColor = [UIColor blackColor]; } cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; switch (index) { case GPUIMAGE_SATURATION: cell.textLabel.text = @"Saturation"; break; case GPUIMAGE_CONTRAST: cell.textLabel.text = @"Contrast"; break; case GPUIMAGE_BRIGHTNESS: cell.textLabel.text = @"Brightness"; break; case GPUIMAGE_LEVELS: cell.textLabel.text = @"Levels"; break; case GPUIMAGE_EXPOSURE: cell.textLabel.text = @"Exposure"; break; case GPUIMAGE_RGB: cell.textLabel.text = @"RGB"; break; case GPUIMAGE_HUE: cell.textLabel.text = @"Hue"; break; case GPUIMAGE_WHITEBALANCE: cell.textLabel.text = @"White balance"; break; case GPUIMAGE_MONOCHROME: cell.textLabel.text = @"Monochrome"; break; case GPUIMAGE_FALSECOLOR: cell.textLabel.text = @"False color"; 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; case GPUIMAGE_TONECURVE: cell.textLabel.text = @"Tone curve"; break; case GPUIMAGE_HIGHLIGHTSHADOW: cell.textLabel.text = @"Highlights and shadows"; break; case GPUIMAGE_HAZE: cell.textLabel.text = @"Haze"; break; case GPUIMAGE_CHROMAKEYNONBLEND: cell.textLabel.text = @"Chroma key"; break; case GPUIMAGE_HISTOGRAM: cell.textLabel.text = @"Histogram"; break; case GPUIMAGE_HISTOGRAM_EQUALIZATION: cell.textLabel.text = @"Histogram Equalization"; break; case GPUIMAGE_AVERAGECOLOR: cell.textLabel.text = @"Average color"; break; case GPUIMAGE_LUMINOSITY: cell.textLabel.text = @"Luminosity"; break; case GPUIMAGE_THRESHOLD: cell.textLabel.text = @"Threshold"; break; case GPUIMAGE_ADAPTIVETHRESHOLD: cell.textLabel.text = @"Adaptive threshold"; break; case GPUIMAGE_AVERAGELUMINANCETHRESHOLD: cell.textLabel.text = @"Average luminance threshold"; break; case GPUIMAGE_CROP: cell.textLabel.text = @"Crop"; break; case GPUIMAGE_TRANSFORM: cell.textLabel.text = @"Transform (2-D)"; break; case GPUIMAGE_TRANSFORM3D: cell.textLabel.text = @"Transform (3-D)"; break; case GPUIMAGE_MASK: cell.textLabel.text = @"Mask"; break; case GPUIMAGE_COLORINVERT: cell.textLabel.text = @"Color invert"; break; case GPUIMAGE_GRAYSCALE: cell.textLabel.text = @"Grayscale"; break; case GPUIMAGE_SEPIA: cell.textLabel.text = @"Sepia tone"; break; case GPUIMAGE_MISSETIKATE: cell.textLabel.text = @"Miss Etikate (Lookup)"; break; case GPUIMAGE_SOFTELEGANCE: cell.textLabel.text = @"Soft elegance (Lookup)"; break; case GPUIMAGE_AMATORKA: cell.textLabel.text = @"Amatorka (Lookup)"; break; case GPUIMAGE_PIXELLATE: cell.textLabel.text = @"Pixellate"; break; case GPUIMAGE_POLARPIXELLATE: cell.textLabel.text = @"Polar pixellate"; break; case GPUIMAGE_PIXELLATE_POSITION: cell.textLabel.text = @"Pixellate (position)"; break; case GPUIMAGE_POLKADOT: cell.textLabel.text = @"Polka dot"; break; case GPUIMAGE_HALFTONE: cell.textLabel.text = @"Halftone"; break; case GPUIMAGE_CROSSHATCH: cell.textLabel.text = @"Crosshatch"; break; case GPUIMAGE_SOBELEDGEDETECTION: cell.textLabel.text = @"Sobel edge detection"; break; case GPUIMAGE_PREWITTEDGEDETECTION: cell.textLabel.text = @"Prewitt edge detection"; break; case GPUIMAGE_CANNYEDGEDETECTION: cell.textLabel.text = @"Canny edge detection"; break; case GPUIMAGE_THRESHOLDEDGEDETECTION: cell.textLabel.text = @"Threshold edge detection"; break; case GPUIMAGE_XYGRADIENT: cell.textLabel.text = @"XY derivative"; break; case GPUIMAGE_HARRISCORNERDETECTION: cell.textLabel.text = @"Harris corner detection"; break; case GPUIMAGE_NOBLECORNERDETECTION: cell.textLabel.text = @"Noble corner detection"; break; case GPUIMAGE_SHITOMASIFEATUREDETECTION: cell.textLabel.text = @"Shi-Tomasi feature detection"; break; case GPUIMAGE_HOUGHTRANSFORMLINEDETECTOR: cell.textLabel.text = @"Hough transform line detection"; break; case GPUIMAGE_BUFFER: cell.textLabel.text = @"Image buffer"; break; case GPUIMAGE_MOTIONDETECTOR: cell.textLabel.text = @"Motion detector"; break; case GPUIMAGE_LOWPASS: cell.textLabel.text = @"Low pass"; break; case GPUIMAGE_HIGHPASS: cell.textLabel.text = @"High pass"; break; case GPUIMAGE_SKETCH: cell.textLabel.text = @"Sketch"; break; case GPUIMAGE_THRESHOLDSKETCH: cell.textLabel.text = @"Threshold Sketch"; break; case GPUIMAGE_TOON: cell.textLabel.text = @"Toon"; break; case GPUIMAGE_SMOOTHTOON: cell.textLabel.text = @"Smooth toon"; break; case GPUIMAGE_TILTSHIFT: cell.textLabel.text = @"Tilt shift"; break; case GPUIMAGE_CGA: cell.textLabel.text = @"CGA colorspace"; break; case GPUIMAGE_CONVOLUTION: cell.textLabel.text = @"3x3 convolution"; break; case GPUIMAGE_EMBOSS: cell.textLabel.text = @"Emboss"; break; case GPUIMAGE_LAPLACIAN: cell.textLabel.text = @"Laplacian"; break; case GPUIMAGE_POSTERIZE: cell.textLabel.text = @"Posterize"; break; case GPUIMAGE_SWIRL: cell.textLabel.text = @"Swirl"; break; case GPUIMAGE_BULGE: cell.textLabel.text = @"Bulge"; break; case GPUIMAGE_SPHEREREFRACTION: cell.textLabel.text = @"Sphere refraction"; break; case GPUIMAGE_GLASSSPHERE: cell.textLabel.text = @"Glass sphere"; break; case GPUIMAGE_PINCH: cell.textLabel.text = @"Pinch"; break; case GPUIMAGE_STRETCH: cell.textLabel.text = @"Stretch"; break; case GPUIMAGE_DILATION: cell.textLabel.text = @"Dilation"; break; case GPUIMAGE_EROSION: cell.textLabel.text = @"Erosion"; break; case GPUIMAGE_OPENING: cell.textLabel.text = @"Opening"; break; case GPUIMAGE_CLOSING: cell.textLabel.text = @"Closing"; break; case GPUIMAGE_PERLINNOISE: cell.textLabel.text = @"Perlin noise"; break; case GPUIMAGE_VORONOI: cell.textLabel.text = @"Voronoi"; break; case GPUIMAGE_MOSAIC: cell.textLabel.text = @"Mosaic"; break; case GPUIMAGE_LOCALBINARYPATTERN: cell.textLabel.text = @"Local binary pattern"; break; case GPUIMAGE_CHROMAKEY: cell.textLabel.text = @"Chroma key blend (green)"; break; case GPUIMAGE_DISSOLVE: cell.textLabel.text = @"Dissolve blend"; break; case GPUIMAGE_SCREENBLEND: cell.textLabel.text = @"Screen blend"; break; case GPUIMAGE_COLORBURN: cell.textLabel.text = @"Color burn blend"; break; case GPUIMAGE_COLORDODGE: cell.textLabel.text = @"Color dodge blend"; break; case GPUIMAGE_LINEARBURN: cell.textLabel.text = @"Linear burn blend"; break; case GPUIMAGE_ADD: cell.textLabel.text = @"Add blend"; break; case GPUIMAGE_DIVIDE: cell.textLabel.text = @"Divide blend"; break; case GPUIMAGE_MULTIPLY: cell.textLabel.text = @"Multiply blend"; break; case GPUIMAGE_OVERLAY: cell.textLabel.text = @"Overlay blend"; break; case GPUIMAGE_LIGHTEN: cell.textLabel.text = @"Lighten blend"; break; case GPUIMAGE_DARKEN: cell.textLabel.text = @"Darken blend"; break; case GPUIMAGE_EXCLUSIONBLEND: cell.textLabel.text = @"Exclusion blend"; break; case GPUIMAGE_DIFFERENCEBLEND: cell.textLabel.text = @"Difference blend"; break; case GPUIMAGE_SUBTRACTBLEND: cell.textLabel.text = @"Subtract blend"; break; case GPUIMAGE_HARDLIGHTBLEND: cell.textLabel.text = @"Hard light blend"; break; case GPUIMAGE_SOFTLIGHTBLEND: cell.textLabel.text = @"Soft light blend"; break; case GPUIMAGE_COLORBLEND: cell.textLabel.text = @"Color blend"; break; case GPUIMAGE_HUEBLEND: cell.textLabel.text = @"Hue blend"; break; case GPUIMAGE_SATURATIONBLEND: cell.textLabel.text = @"Saturation blend"; break; case GPUIMAGE_LUMINOSITYBLEND: cell.textLabel.text = @"Luminosity blend"; break; case GPUIMAGE_NORMALBLEND: cell.textLabel.text = @"Normal blend"; break; case GPUIMAGE_POISSONBLEND: cell.textLabel.text = @"Poisson blend"; break; case GPUIMAGE_OPACITY: cell.textLabel.text = @"Opacity adjustment"; break; case GPUIMAGE_KUWAHARA: cell.textLabel.text = @"Kuwahara"; break; case GPUIMAGE_KUWAHARARADIUS3: cell.textLabel.text = @"Kuwahara (fixed radius)"; break; case GPUIMAGE_VIGNETTE: cell.textLabel.text = @"Vignette"; break; case GPUIMAGE_GAUSSIAN: cell.textLabel.text = @"Gaussian blur"; break; case GPUIMAGE_MEDIAN: cell.textLabel.text = @"Median (3x3)"; break; case GPUIMAGE_BILATERAL: cell.textLabel.text = @"Bilateral blur"; break; case GPUIMAGE_MOTIONBLUR: cell.textLabel.text = @"Motion blur"; break; case GPUIMAGE_ZOOMBLUR: cell.textLabel.text = @"Zoom 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_POSITION: cell.textLabel.text = @"Gaussian (centered)"; break; case GPUIMAGE_IOSBLUR: cell.textLabel.text = @"iOS 7 blur"; break; case GPUIMAGE_UIELEMENT: cell.textLabel.text = @"UI element"; 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; case GPUIMAGE_FACES: cell.textLabel.text = @"Face Detection"; break; } return cell; } /* // Override to support conditional editing of the table view. - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { // Return NO if you do not want the specified item to be editable. return YES; } */ /* // Override to support editing the table view. - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { if (editingStyle == UITableViewCellEditingStyleDelete) { // Delete the row from the data source [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade]; } else if (editingStyle == UITableViewCellEditingStyleInsert) { // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view } } */ /* // Override to support rearranging the table view. - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath { } */ /* // Override to support conditional rearranging of the table view. - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath { // Return NO if you do not want the item to be re-orderable. return YES; } */ #pragma mark - Table view delegate - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { ShowcaseFilterViewController *filterViewController = [[ShowcaseFilterViewController alloc] initWithFilterType:(GPUImageShowcaseFilterType)indexPath.row]; [self.navigationController pushViewController:filterViewController animated:YES]; } @end ================================================ FILE: examples/iOS/FilterShowcase/FilterShowcase/ShowcaseFilterViewController.h ================================================ #import #import "GPUImage.h" typedef enum { GPUIMAGE_SATURATION, GPUIMAGE_CONTRAST, GPUIMAGE_BRIGHTNESS, GPUIMAGE_LEVELS, GPUIMAGE_EXPOSURE, GPUIMAGE_RGB, GPUIMAGE_HUE, GPUIMAGE_WHITEBALANCE, GPUIMAGE_MONOCHROME, GPUIMAGE_FALSECOLOR, GPUIMAGE_SHARPEN, GPUIMAGE_UNSHARPMASK, GPUIMAGE_TRANSFORM, GPUIMAGE_TRANSFORM3D, GPUIMAGE_CROP, GPUIMAGE_MASK, GPUIMAGE_GAMMA, GPUIMAGE_TONECURVE, GPUIMAGE_HIGHLIGHTSHADOW, GPUIMAGE_HAZE, GPUIMAGE_SEPIA, GPUIMAGE_AMATORKA, GPUIMAGE_MISSETIKATE, GPUIMAGE_SOFTELEGANCE, GPUIMAGE_COLORINVERT, GPUIMAGE_GRAYSCALE, GPUIMAGE_HISTOGRAM, GPUIMAGE_HISTOGRAM_EQUALIZATION, GPUIMAGE_AVERAGECOLOR, GPUIMAGE_LUMINOSITY, GPUIMAGE_THRESHOLD, GPUIMAGE_ADAPTIVETHRESHOLD, GPUIMAGE_AVERAGELUMINANCETHRESHOLD, GPUIMAGE_PIXELLATE, GPUIMAGE_POLARPIXELLATE, GPUIMAGE_PIXELLATE_POSITION, GPUIMAGE_POLKADOT, GPUIMAGE_HALFTONE, GPUIMAGE_CROSSHATCH, GPUIMAGE_SOBELEDGEDETECTION, GPUIMAGE_PREWITTEDGEDETECTION, GPUIMAGE_CANNYEDGEDETECTION, GPUIMAGE_THRESHOLDEDGEDETECTION, GPUIMAGE_XYGRADIENT, GPUIMAGE_HARRISCORNERDETECTION, GPUIMAGE_NOBLECORNERDETECTION, GPUIMAGE_SHITOMASIFEATUREDETECTION, GPUIMAGE_HOUGHTRANSFORMLINEDETECTOR, GPUIMAGE_BUFFER, GPUIMAGE_LOWPASS, GPUIMAGE_HIGHPASS, GPUIMAGE_MOTIONDETECTOR, GPUIMAGE_SKETCH, GPUIMAGE_THRESHOLDSKETCH, GPUIMAGE_TOON, GPUIMAGE_SMOOTHTOON, GPUIMAGE_TILTSHIFT, GPUIMAGE_CGA, GPUIMAGE_POSTERIZE, GPUIMAGE_CONVOLUTION, GPUIMAGE_EMBOSS, GPUIMAGE_LAPLACIAN, GPUIMAGE_CHROMAKEYNONBLEND, GPUIMAGE_KUWAHARA, GPUIMAGE_KUWAHARARADIUS3, GPUIMAGE_VIGNETTE, GPUIMAGE_GAUSSIAN, GPUIMAGE_GAUSSIAN_SELECTIVE, GPUIMAGE_GAUSSIAN_POSITION, GPUIMAGE_BOXBLUR, GPUIMAGE_MEDIAN, GPUIMAGE_BILATERAL, GPUIMAGE_MOTIONBLUR, GPUIMAGE_ZOOMBLUR, GPUIMAGE_IOSBLUR, GPUIMAGE_SWIRL, GPUIMAGE_BULGE, GPUIMAGE_PINCH, GPUIMAGE_SPHEREREFRACTION, GPUIMAGE_GLASSSPHERE, GPUIMAGE_STRETCH, GPUIMAGE_DILATION, GPUIMAGE_EROSION, GPUIMAGE_OPENING, GPUIMAGE_CLOSING, GPUIMAGE_PERLINNOISE, GPUIMAGE_VORONOI, GPUIMAGE_MOSAIC, GPUIMAGE_LOCALBINARYPATTERN, GPUIMAGE_DISSOLVE, GPUIMAGE_CHROMAKEY, GPUIMAGE_ADD, GPUIMAGE_DIVIDE, GPUIMAGE_MULTIPLY, GPUIMAGE_OVERLAY, GPUIMAGE_LIGHTEN, GPUIMAGE_DARKEN, GPUIMAGE_COLORBURN, GPUIMAGE_COLORDODGE, GPUIMAGE_LINEARBURN, GPUIMAGE_SCREENBLEND, GPUIMAGE_DIFFERENCEBLEND, GPUIMAGE_SUBTRACTBLEND, GPUIMAGE_EXCLUSIONBLEND, GPUIMAGE_HARDLIGHTBLEND, GPUIMAGE_SOFTLIGHTBLEND, GPUIMAGE_COLORBLEND, GPUIMAGE_HUEBLEND, GPUIMAGE_SATURATIONBLEND, GPUIMAGE_LUMINOSITYBLEND, GPUIMAGE_NORMALBLEND, GPUIMAGE_POISSONBLEND, GPUIMAGE_OPACITY, GPUIMAGE_CUSTOM, GPUIMAGE_UIELEMENT, GPUIMAGE_FILECONFIG, GPUIMAGE_FILTERGROUP, GPUIMAGE_FACES, GPUIMAGE_NUMFILTERS } GPUImageShowcaseFilterType; @interface ShowcaseFilterViewController : UIViewController { GPUImageVideoCamera *videoCamera; GPUImageOutput *filter; GPUImagePicture *sourcePicture; GPUImageShowcaseFilterType filterType; GPUImageUIElement *uiElementInput; GPUImageFilterPipeline *pipeline; UIView *faceView; CIDetector *faceDetector; IBOutlet UISwitch *facesSwitch; IBOutlet UILabel *facesLabel; __unsafe_unretained UISlider *_filterSettingsSlider; BOOL faceThinking; } @property(readwrite, unsafe_unretained, nonatomic) IBOutlet UISlider *filterSettingsSlider; @property(nonatomic,retain) CIDetector*faceDetector; // Initialization and teardown - (id)initWithFilterType:(GPUImageShowcaseFilterType)newFilterType; - (void)setupFilter; - (void)willOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer; // Filter adjustments - (IBAction)updateFilterFromSlider:(id)sender; - (void)GPUVCWillOutputFeatures:(NSArray*)featureArray forClap:(CGRect)clap andOrientation:(UIDeviceOrientation)curDeviceOrientation; -(IBAction)facesSwitched:(id)sender; @end ================================================ FILE: examples/iOS/FilterShowcase/FilterShowcase/ShowcaseFilterViewController.m ================================================ #import "ShowcaseFilterViewController.h" #import @implementation ShowcaseFilterViewController @synthesize faceDetector; #pragma mark - #pragma mark Initialization and teardown - (id)initWithFilterType:(GPUImageShowcaseFilterType)newFilterType; { self = [super initWithNibName:@"ShowcaseFilterViewController" bundle:nil]; if (self) { filterType = newFilterType; } return self; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; } - (void)dealloc; { } #pragma mark - View lifecycle - (void)viewDidLoad { [super viewDidLoad]; if ([GPUImageContext supportsFastTextureUpload]) { NSDictionary *detectorOptions = [[NSDictionary alloc] initWithObjectsAndKeys:CIDetectorAccuracyLow, CIDetectorAccuracy, nil]; self.faceDetector = [CIDetector detectorOfType:CIDetectorTypeFace context:nil options:detectorOptions]; faceThinking = NO; } [self setupFilter]; } - (void)viewWillDisappear:(BOOL)animated { // Note: I needed to stop camera capture before the view went off the screen in order to prevent a crash from the camera still sending frames [videoCamera stopCameraCapture]; [super viewWillDisappear:animated]; } - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; // Note: I needed to start camera capture after the view went on the screen, when a partially transition of navigation view controller stopped capturing via viewWilDisappear. [videoCamera startCameraCapture]; } - (void)viewDidUnload { [super viewDidUnload]; } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationPortrait); } - (void)setupFilter; { videoCamera = [[GPUImageVideoCamera alloc] initWithSessionPreset:AVCaptureSessionPreset640x480 cameraPosition:AVCaptureDevicePositionBack]; // videoCamera = [[GPUImageVideoCamera alloc] initWithSessionPreset:AVCaptureSessionPreset1280x720 cameraPosition:AVCaptureDevicePositionBack]; // videoCamera = [[GPUImageVideoCamera alloc] initWithSessionPreset:AVCaptureSessionPreset1920x1080 cameraPosition:AVCaptureDevicePositionBack]; // videoCamera = [[GPUImageVideoCamera alloc] initWithSessionPreset:AVCaptureSessionPreset640x480 cameraPosition:AVCaptureDevicePositionFront]; videoCamera.outputImageOrientation = UIInterfaceOrientationPortrait; facesSwitch.hidden = YES; facesLabel.hidden = YES; BOOL needsSecondImage = NO; switch (filterType) { case GPUIMAGE_SEPIA: { self.title = @"Sepia Tone"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setValue:1.0]; [self.filterSettingsSlider setMinimumValue:0.0]; [self.filterSettingsSlider setMaximumValue:1.0]; filter = [[GPUImageSepiaFilter alloc] init]; }; break; case GPUIMAGE_PIXELLATE: { self.title = @"Pixellate"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setValue:0.05]; [self.filterSettingsSlider setMinimumValue:0.0]; [self.filterSettingsSlider setMaximumValue:0.3]; filter = [[GPUImagePixellateFilter alloc] init]; }; break; case GPUIMAGE_POLARPIXELLATE: { self.title = @"Polar Pixellate"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setValue:0.05]; [self.filterSettingsSlider setMinimumValue:-0.1]; [self.filterSettingsSlider setMaximumValue:0.1]; filter = [[GPUImagePolarPixellateFilter alloc] init]; }; break; case GPUIMAGE_PIXELLATE_POSITION: { self.title = @"Pixellate (position)"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setValue:0.25]; [self.filterSettingsSlider setMinimumValue:0.0]; [self.filterSettingsSlider setMaximumValue:0.5]; filter = [[GPUImagePixellatePositionFilter alloc] init]; }; break; case GPUIMAGE_POLKADOT: { self.title = @"Polka Dot"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setValue:0.05]; [self.filterSettingsSlider setMinimumValue:0.0]; [self.filterSettingsSlider setMaximumValue:0.3]; filter = [[GPUImagePolkaDotFilter alloc] init]; }; break; case GPUIMAGE_HALFTONE: { self.title = @"Halftone"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setValue:0.01]; [self.filterSettingsSlider setMinimumValue:0.0]; [self.filterSettingsSlider setMaximumValue:0.05]; filter = [[GPUImageHalftoneFilter alloc] init]; }; break; case GPUIMAGE_CROSSHATCH: { self.title = @"Crosshatch"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setValue:0.03]; [self.filterSettingsSlider setMinimumValue:0.01]; [self.filterSettingsSlider setMaximumValue:0.06]; filter = [[GPUImageCrosshatchFilter alloc] init]; }; break; case GPUIMAGE_COLORINVERT: { self.title = @"Color Invert"; self.filterSettingsSlider.hidden = YES; filter = [[GPUImageColorInvertFilter alloc] init]; }; break; case GPUIMAGE_GRAYSCALE: { self.title = @"Grayscale"; self.filterSettingsSlider.hidden = YES; filter = [[GPUImageGrayscaleFilter alloc] init]; }; break; case GPUIMAGE_MONOCHROME: { self.title = @"Monochrome"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setValue:1.0]; [self.filterSettingsSlider setMinimumValue:0.0]; [self.filterSettingsSlider setMaximumValue:1.0]; filter = [[GPUImageMonochromeFilter alloc] init]; [(GPUImageMonochromeFilter *)filter setColor:(GPUVector4){0.0f, 0.0f, 1.0f, 1.f}]; }; break; case GPUIMAGE_FALSECOLOR: { self.title = @"False Color"; self.filterSettingsSlider.hidden = YES; filter = [[GPUImageFalseColorFilter alloc] init]; }; break; case GPUIMAGE_SOFTELEGANCE: { self.title = @"Soft Elegance (Lookup)"; self.filterSettingsSlider.hidden = YES; filter = [[GPUImageSoftEleganceFilter alloc] init]; }; break; case GPUIMAGE_MISSETIKATE: { self.title = @"Miss Etikate (Lookup)"; self.filterSettingsSlider.hidden = YES; filter = [[GPUImageMissEtikateFilter alloc] init]; }; break; case GPUIMAGE_AMATORKA: { self.title = @"Amatorka (Lookup)"; self.filterSettingsSlider.hidden = YES; filter = [[GPUImageAmatorkaFilter alloc] init]; }; break; case GPUIMAGE_SATURATION: { self.title = @"Saturation"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setValue:1.0]; [self.filterSettingsSlider setMinimumValue:0.0]; [self.filterSettingsSlider setMaximumValue:2.0]; filter = [[GPUImageSaturationFilter alloc] init]; }; break; case GPUIMAGE_CONTRAST: { self.title = @"Contrast"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:0.0]; [self.filterSettingsSlider setMaximumValue:4.0]; [self.filterSettingsSlider setValue:1.0]; filter = [[GPUImageContrastFilter alloc] init]; }; break; case GPUIMAGE_BRIGHTNESS: { self.title = @"Brightness"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:-1.0]; [self.filterSettingsSlider setMaximumValue:1.0]; [self.filterSettingsSlider setValue:0.0]; filter = [[GPUImageBrightnessFilter alloc] init]; }; break; case GPUIMAGE_LEVELS: { self.title = @"Levels"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:0.0]; [self.filterSettingsSlider setMaximumValue:1.0]; [self.filterSettingsSlider setValue:0.0]; filter = [[GPUImageLevelsFilter alloc] init]; }; break; case GPUIMAGE_RGB: { self.title = @"RGB"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:0.0]; [self.filterSettingsSlider setMaximumValue:2.0]; [self.filterSettingsSlider setValue:1.0]; filter = [[GPUImageRGBFilter alloc] init]; }; break; case GPUIMAGE_HUE: { self.title = @"Hue"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:0.0]; [self.filterSettingsSlider setMaximumValue:360.0]; [self.filterSettingsSlider setValue:90.0]; filter = [[GPUImageHueFilter alloc] init]; }; break; case GPUIMAGE_WHITEBALANCE: { self.title = @"White Balance"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:2500.0]; [self.filterSettingsSlider setMaximumValue:7500.0]; [self.filterSettingsSlider setValue:5000.0]; filter = [[GPUImageWhiteBalanceFilter alloc] init]; }; break; case GPUIMAGE_EXPOSURE: { self.title = @"Exposure"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:-4.0]; [self.filterSettingsSlider setMaximumValue:4.0]; [self.filterSettingsSlider setValue:0.0]; filter = [[GPUImageExposureFilter alloc] init]; }; break; case GPUIMAGE_SHARPEN: { self.title = @"Sharpen"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:-1.0]; [self.filterSettingsSlider setMaximumValue:4.0]; [self.filterSettingsSlider setValue:0.0]; filter = [[GPUImageSharpenFilter alloc] init]; }; break; case GPUIMAGE_UNSHARPMASK: { self.title = @"Unsharp Mask"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:0.0]; [self.filterSettingsSlider setMaximumValue:5.0]; [self.filterSettingsSlider setValue:1.0]; filter = [[GPUImageUnsharpMaskFilter alloc] init]; // [(GPUImageUnsharpMaskFilter *)filter setIntensity:3.0]; }; break; case GPUIMAGE_GAMMA: { self.title = @"Gamma"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:0.0]; [self.filterSettingsSlider setMaximumValue:3.0]; [self.filterSettingsSlider setValue:1.0]; filter = [[GPUImageGammaFilter alloc] init]; }; break; case GPUIMAGE_TONECURVE: { self.title = @"Tone curve"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:0.0]; [self.filterSettingsSlider setMaximumValue:1.0]; [self.filterSettingsSlider setValue:0.5]; filter = [[GPUImageToneCurveFilter alloc] init]; [(GPUImageToneCurveFilter *)filter setBlueControlPoints:[NSArray arrayWithObjects:[NSValue valueWithCGPoint:CGPointMake(0.0, 0.0)], [NSValue valueWithCGPoint:CGPointMake(0.5, 0.5)], [NSValue valueWithCGPoint:CGPointMake(1.0, 0.75)], nil]]; }; break; case GPUIMAGE_HIGHLIGHTSHADOW: { self.title = @"Highlights and Shadows"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setValue:1.0]; [self.filterSettingsSlider setMinimumValue:0.0]; [self.filterSettingsSlider setMaximumValue:1.0]; filter = [[GPUImageHighlightShadowFilter alloc] init]; }; break; case GPUIMAGE_HAZE: { self.title = @"Haze / UV"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:-0.2]; [self.filterSettingsSlider setMaximumValue:0.2]; [self.filterSettingsSlider setValue:0.2]; filter = [[GPUImageHazeFilter alloc] init]; }; break; case GPUIMAGE_AVERAGECOLOR: { self.title = @"Average Color"; self.filterSettingsSlider.hidden = YES; filter = [[GPUImageAverageColor alloc] init]; }; break; case GPUIMAGE_LUMINOSITY: { self.title = @"Luminosity"; self.filterSettingsSlider.hidden = YES; filter = [[GPUImageLuminosity alloc] init]; }; break; case GPUIMAGE_HISTOGRAM: { self.title = @"Histogram"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:4.0]; [self.filterSettingsSlider setMaximumValue:32.0]; [self.filterSettingsSlider setValue:16.0]; filter = [[GPUImageHistogramFilter alloc] initWithHistogramType:kGPUImageHistogramRGB]; }; break; case GPUIMAGE_HISTOGRAM_EQUALIZATION: { self.title = @"Histogram Equalization"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:4.0]; [self.filterSettingsSlider setMaximumValue:32.0]; [self.filterSettingsSlider setValue:16.0]; filter = [[GPUImageHistogramEqualizationFilter alloc] initWithHistogramType:kGPUImageHistogramLuminance]; }; break; case GPUIMAGE_THRESHOLD: { self.title = @"Luminance Threshold"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:0.0]; [self.filterSettingsSlider setMaximumValue:1.0]; [self.filterSettingsSlider setValue:0.5]; filter = [[GPUImageLuminanceThresholdFilter alloc] init]; }; break; case GPUIMAGE_ADAPTIVETHRESHOLD: { self.title = @"Adaptive Threshold"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:1.0]; [self.filterSettingsSlider setMaximumValue:20.0]; [self.filterSettingsSlider setValue:1.0]; filter = [[GPUImageAdaptiveThresholdFilter alloc] init]; }; break; case GPUIMAGE_AVERAGELUMINANCETHRESHOLD: { self.title = @"Avg. Lum. Threshold"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:0.0]; [self.filterSettingsSlider setMaximumValue:2.0]; [self.filterSettingsSlider setValue:1.0]; filter = [[GPUImageAverageLuminanceThresholdFilter alloc] init]; }; break; case GPUIMAGE_CROP: { self.title = @"Crop"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:0.2]; [self.filterSettingsSlider setMaximumValue:1.0]; [self.filterSettingsSlider setValue:0.5]; filter = [[GPUImageCropFilter alloc] initWithCropRegion:CGRectMake(0.0, 0.0, 1.0, 0.25)]; }; break; case GPUIMAGE_MASK: { self.title = @"Mask"; self.filterSettingsSlider.hidden = YES; needsSecondImage = YES; filter = [[GPUImageMaskFilter alloc] init]; [(GPUImageFilter*)filter setBackgroundColorRed:0.0 green:1.0 blue:0.0 alpha:1.0]; }; break; case GPUIMAGE_TRANSFORM: { self.title = @"Transform (2-D)"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:0.0]; [self.filterSettingsSlider setMaximumValue:6.28]; [self.filterSettingsSlider setValue:2.0]; filter = [[GPUImageTransformFilter alloc] init]; [(GPUImageTransformFilter *)filter setAffineTransform:CGAffineTransformMakeRotation(2.0)]; // [(GPUImageTransformFilter *)filter setIgnoreAspectRatio:YES]; }; break; case GPUIMAGE_TRANSFORM3D: { self.title = @"Transform (3-D)"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:0.0]; [self.filterSettingsSlider setMaximumValue:6.28]; [self.filterSettingsSlider setValue:0.75]; filter = [[GPUImageTransformFilter alloc] init]; CATransform3D perspectiveTransform = CATransform3DIdentity; perspectiveTransform.m34 = 0.4; perspectiveTransform.m33 = 0.4; perspectiveTransform = CATransform3DScale(perspectiveTransform, 0.75, 0.75, 0.75); perspectiveTransform = CATransform3DRotate(perspectiveTransform, 0.75, 0.0, 1.0, 0.0); [(GPUImageTransformFilter *)filter setTransform3D:perspectiveTransform]; }; break; case GPUIMAGE_SOBELEDGEDETECTION: { self.title = @"Sobel Edge Detection"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:0.0]; [self.filterSettingsSlider setMaximumValue:1.0]; [self.filterSettingsSlider setValue:0.25]; filter = [[GPUImageSobelEdgeDetectionFilter alloc] init]; }; break; case GPUIMAGE_XYGRADIENT: { self.title = @"XY Derivative"; self.filterSettingsSlider.hidden = YES; filter = [[GPUImageXYDerivativeFilter alloc] init]; }; break; case GPUIMAGE_HARRISCORNERDETECTION: { self.title = @"Harris Corner Detection"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:0.01]; [self.filterSettingsSlider setMaximumValue:0.70]; [self.filterSettingsSlider setValue:0.20]; filter = [[GPUImageHarrisCornerDetectionFilter alloc] init]; [(GPUImageHarrisCornerDetectionFilter *)filter setThreshold:0.20]; }; break; case GPUIMAGE_NOBLECORNERDETECTION: { self.title = @"Noble Corner Detection"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:0.01]; [self.filterSettingsSlider setMaximumValue:0.70]; [self.filterSettingsSlider setValue:0.20]; filter = [[GPUImageNobleCornerDetectionFilter alloc] init]; [(GPUImageNobleCornerDetectionFilter *)filter setThreshold:0.20]; }; break; case GPUIMAGE_SHITOMASIFEATUREDETECTION: { self.title = @"Shi-Tomasi Feature Detection"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:0.01]; [self.filterSettingsSlider setMaximumValue:0.70]; [self.filterSettingsSlider setValue:0.20]; filter = [[GPUImageShiTomasiFeatureDetectionFilter alloc] init]; [(GPUImageShiTomasiFeatureDetectionFilter *)filter setThreshold:0.20]; }; break; case GPUIMAGE_HOUGHTRANSFORMLINEDETECTOR: { self.title = @"Line Detection"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:0.2]; [self.filterSettingsSlider setMaximumValue:1.0]; [self.filterSettingsSlider setValue:0.6]; filter = [[GPUImageHoughTransformLineDetector alloc] init]; [(GPUImageHoughTransformLineDetector *)filter setLineDetectionThreshold:0.60]; }; break; case GPUIMAGE_PREWITTEDGEDETECTION: { self.title = @"Prewitt Edge Detection"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:0.0]; [self.filterSettingsSlider setMaximumValue:1.0]; [self.filterSettingsSlider setValue:1.0]; filter = [[GPUImagePrewittEdgeDetectionFilter alloc] init]; }; break; case GPUIMAGE_CANNYEDGEDETECTION: { self.title = @"Canny Edge Detection"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:0.0]; [self.filterSettingsSlider setMaximumValue:1.0]; [self.filterSettingsSlider setValue:1.0]; filter = [[GPUImageCannyEdgeDetectionFilter alloc] init]; }; break; case GPUIMAGE_THRESHOLDEDGEDETECTION: { self.title = @"Threshold Edge Detection"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:0.0]; [self.filterSettingsSlider setMaximumValue:1.0]; [self.filterSettingsSlider setValue:0.25]; filter = [[GPUImageThresholdEdgeDetectionFilter alloc] init]; }; break; case GPUIMAGE_LOCALBINARYPATTERN: { self.title = @"Local Binary Pattern"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:1.0]; [self.filterSettingsSlider setMaximumValue:5.0]; [self.filterSettingsSlider setValue:1.0]; filter = [[GPUImageLocalBinaryPatternFilter alloc] init]; }; break; case GPUIMAGE_BUFFER: { self.title = @"Image Buffer"; self.filterSettingsSlider.hidden = YES; filter = [[GPUImageBuffer alloc] init]; }; break; case GPUIMAGE_LOWPASS: { self.title = @"Low Pass"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:0.0]; [self.filterSettingsSlider setMaximumValue:1.0]; [self.filterSettingsSlider setValue:0.5]; filter = [[GPUImageLowPassFilter alloc] init]; }; break; case GPUIMAGE_HIGHPASS: { self.title = @"High Pass"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:0.0]; [self.filterSettingsSlider setMaximumValue:1.0]; [self.filterSettingsSlider setValue:0.5]; filter = [[GPUImageHighPassFilter alloc] init]; }; break; case GPUIMAGE_MOTIONDETECTOR: { [videoCamera rotateCamera]; self.title = @"Motion Detector"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:0.0]; [self.filterSettingsSlider setMaximumValue:1.0]; [self.filterSettingsSlider setValue:0.5]; filter = [[GPUImageMotionDetector alloc] init]; }; break; case GPUIMAGE_SKETCH: { self.title = @"Sketch"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:0.0]; [self.filterSettingsSlider setMaximumValue:1.0]; [self.filterSettingsSlider setValue:0.25]; filter = [[GPUImageSketchFilter alloc] init]; }; break; case GPUIMAGE_THRESHOLDSKETCH: { self.title = @"Threshold Sketch"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:0.0]; [self.filterSettingsSlider setMaximumValue:1.0]; [self.filterSettingsSlider setValue:0.25]; filter = [[GPUImageThresholdSketchFilter alloc] init]; }; break; case GPUIMAGE_TOON: { self.title = @"Toon"; self.filterSettingsSlider.hidden = YES; filter = [[GPUImageToonFilter alloc] init]; }; break; case GPUIMAGE_SMOOTHTOON: { self.title = @"Smooth Toon"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:1.0]; [self.filterSettingsSlider setMaximumValue:6.0]; [self.filterSettingsSlider setValue:1.0]; filter = [[GPUImageSmoothToonFilter alloc] init]; }; break; case GPUIMAGE_TILTSHIFT: { self.title = @"Tilt Shift"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:0.2]; [self.filterSettingsSlider setMaximumValue:0.8]; [self.filterSettingsSlider setValue:0.5]; filter = [[GPUImageTiltShiftFilter alloc] init]; [(GPUImageTiltShiftFilter *)filter setTopFocusLevel:0.4]; [(GPUImageTiltShiftFilter *)filter setBottomFocusLevel:0.6]; [(GPUImageTiltShiftFilter *)filter setFocusFallOffRate:0.2]; }; break; case GPUIMAGE_CGA: { self.title = @"CGA Colorspace"; self.filterSettingsSlider.hidden = YES; filter = [[GPUImageCGAColorspaceFilter alloc] init]; }; break; case GPUIMAGE_CONVOLUTION: { self.title = @"3x3 Convolution"; self.filterSettingsSlider.hidden = YES; filter = [[GPUImage3x3ConvolutionFilter alloc] init]; // [(GPUImage3x3ConvolutionFilter *)filter setConvolutionKernel:(GPUMatrix3x3){ // {-2.0f, -1.0f, 0.0f}, // {-1.0f, 1.0f, 1.0f}, // { 0.0f, 1.0f, 2.0f} // }]; [(GPUImage3x3ConvolutionFilter *)filter setConvolutionKernel:(GPUMatrix3x3){ {-1.0f, 0.0f, 1.0f}, {-2.0f, 0.0f, 2.0f}, {-1.0f, 0.0f, 1.0f} }]; // [(GPUImage3x3ConvolutionFilter *)filter setConvolutionKernel:(GPUMatrix3x3){ // {1.0f, 1.0f, 1.0f}, // {1.0f, -8.0f, 1.0f}, // {1.0f, 1.0f, 1.0f} // }]; // [(GPUImage3x3ConvolutionFilter *)filter setConvolutionKernel:(GPUMatrix3x3){ // { 0.11f, 0.11f, 0.11f}, // { 0.11f, 0.11f, 0.11f}, // { 0.11f, 0.11f, 0.11f} // }]; }; break; case GPUIMAGE_EMBOSS: { self.title = @"Emboss"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:0.0]; [self.filterSettingsSlider setMaximumValue:5.0]; [self.filterSettingsSlider setValue:1.0]; filter = [[GPUImageEmbossFilter alloc] init]; }; break; case GPUIMAGE_LAPLACIAN: { self.title = @"Laplacian"; self.filterSettingsSlider.hidden = YES; filter = [[GPUImageLaplacianFilter alloc] init]; }; break; case GPUIMAGE_POSTERIZE: { self.title = @"Posterize"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:1.0]; [self.filterSettingsSlider setMaximumValue:20.0]; [self.filterSettingsSlider setValue:10.0]; filter = [[GPUImagePosterizeFilter alloc] init]; }; break; case GPUIMAGE_SWIRL: { self.title = @"Swirl"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:0.0]; [self.filterSettingsSlider setMaximumValue:2.0]; [self.filterSettingsSlider setValue:1.0]; filter = [[GPUImageSwirlFilter alloc] init]; }; break; case GPUIMAGE_BULGE: { self.title = @"Bulge"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:-1.0]; [self.filterSettingsSlider setMaximumValue:1.0]; [self.filterSettingsSlider setValue:0.5]; filter = [[GPUImageBulgeDistortionFilter alloc] init]; }; break; case GPUIMAGE_SPHEREREFRACTION: { self.title = @"Sphere Refraction"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:0.0]; [self.filterSettingsSlider setMaximumValue:1.0]; [self.filterSettingsSlider setValue:0.15]; filter = [[GPUImageSphereRefractionFilter alloc] init]; [(GPUImageSphereRefractionFilter *)filter setRadius:0.15]; }; break; case GPUIMAGE_GLASSSPHERE: { self.title = @"Glass Sphere"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:0.0]; [self.filterSettingsSlider setMaximumValue:1.0]; [self.filterSettingsSlider setValue:0.15]; filter = [[GPUImageGlassSphereFilter alloc] init]; [(GPUImageGlassSphereFilter *)filter setRadius:0.15]; }; break; case GPUIMAGE_PINCH: { self.title = @"Pinch"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:-2.0]; [self.filterSettingsSlider setMaximumValue:2.0]; [self.filterSettingsSlider setValue:0.5]; filter = [[GPUImagePinchDistortionFilter alloc] init]; }; break; case GPUIMAGE_STRETCH: { self.title = @"Stretch"; self.filterSettingsSlider.hidden = YES; filter = [[GPUImageStretchDistortionFilter alloc] init]; }; break; case GPUIMAGE_DILATION: { self.title = @"Dilation"; self.filterSettingsSlider.hidden = YES; filter = [[GPUImageRGBDilationFilter alloc] initWithRadius:4]; }; break; case GPUIMAGE_EROSION: { self.title = @"Erosion"; self.filterSettingsSlider.hidden = YES; filter = [[GPUImageRGBErosionFilter alloc] initWithRadius:4]; }; break; case GPUIMAGE_OPENING: { self.title = @"Opening"; self.filterSettingsSlider.hidden = YES; filter = [[GPUImageRGBOpeningFilter alloc] initWithRadius:4]; }; break; case GPUIMAGE_CLOSING: { self.title = @"Closing"; self.filterSettingsSlider.hidden = YES; filter = [[GPUImageRGBClosingFilter alloc] initWithRadius:4]; }; break; case GPUIMAGE_PERLINNOISE: { self.title = @"Perlin Noise"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:1.0]; [self.filterSettingsSlider setMaximumValue:30.0]; [self.filterSettingsSlider setValue:8.0]; filter = [[GPUImagePerlinNoiseFilter alloc] init]; }; break; case GPUIMAGE_VORONOI: { self.title = @"Voronoi"; self.filterSettingsSlider.hidden = YES; needsSecondImage = YES; GPUImageJFAVoronoiFilter *jfa = [[GPUImageJFAVoronoiFilter alloc] init]; [jfa setSizeInPixels:CGSizeMake(1024.0, 1024.0)]; sourcePicture = [[GPUImagePicture alloc] initWithImage:[UIImage imageNamed:@"voroni_points2.png"]]; [sourcePicture addTarget:jfa]; filter = [[GPUImageVoronoiConsumerFilter alloc] init]; [jfa setSizeInPixels:CGSizeMake(1024.0, 1024.0)]; [(GPUImageVoronoiConsumerFilter *)filter setSizeInPixels:CGSizeMake(1024.0, 1024.0)]; [videoCamera addTarget:filter]; [jfa addTarget:filter]; [sourcePicture processImage]; }; break; case GPUIMAGE_MOSAIC: { self.title = @"Mosaic"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:0.002]; [self.filterSettingsSlider setMaximumValue:0.05]; [self.filterSettingsSlider setValue:0.025]; filter = [[GPUImageMosaicFilter alloc] init]; [(GPUImageMosaicFilter *)filter setTileSet:@"squares.png"]; [(GPUImageMosaicFilter *)filter setColorOn:NO]; //[(GPUImageMosaicFilter *)filter setTileSet:@"dotletterstiles.png"]; //[(GPUImageMosaicFilter *)filter setTileSet:@"curvies.png"]; }; break; case GPUIMAGE_CHROMAKEY: { self.title = @"Chroma Key (Green)"; self.filterSettingsSlider.hidden = NO; needsSecondImage = YES; [self.filterSettingsSlider setMinimumValue:0.0]; [self.filterSettingsSlider setMaximumValue:1.0]; [self.filterSettingsSlider setValue:0.4]; filter = [[GPUImageChromaKeyBlendFilter alloc] init]; [(GPUImageChromaKeyBlendFilter *)filter setColorToReplaceRed:0.0 green:1.0 blue:0.0]; }; break; case GPUIMAGE_CHROMAKEYNONBLEND: { self.title = @"Chroma Key (Green)"; self.filterSettingsSlider.hidden = NO; needsSecondImage = YES; [self.filterSettingsSlider setMinimumValue:0.0]; [self.filterSettingsSlider setMaximumValue:1.0]; [self.filterSettingsSlider setValue:0.4]; filter = [[GPUImageChromaKeyFilter alloc] init]; [(GPUImageChromaKeyFilter *)filter setColorToReplaceRed:0.0 green:1.0 blue:0.0]; }; break; case GPUIMAGE_ADD: { self.title = @"Add Blend"; self.filterSettingsSlider.hidden = YES; needsSecondImage = YES; filter = [[GPUImageAddBlendFilter alloc] init]; }; break; case GPUIMAGE_DIVIDE: { self.title = @"Divide Blend"; self.filterSettingsSlider.hidden = YES; needsSecondImage = YES; filter = [[GPUImageDivideBlendFilter alloc] init]; }; break; case GPUIMAGE_MULTIPLY: { self.title = @"Multiply Blend"; self.filterSettingsSlider.hidden = YES; needsSecondImage = YES; filter = [[GPUImageMultiplyBlendFilter alloc] init]; }; break; case GPUIMAGE_OVERLAY: { self.title = @"Overlay Blend"; self.filterSettingsSlider.hidden = YES; needsSecondImage = YES; filter = [[GPUImageOverlayBlendFilter alloc] init]; }; break; case GPUIMAGE_LIGHTEN: { self.title = @"Lighten Blend"; self.filterSettingsSlider.hidden = YES; needsSecondImage = YES; filter = [[GPUImageLightenBlendFilter alloc] init]; }; break; case GPUIMAGE_DARKEN: { self.title = @"Darken Blend"; self.filterSettingsSlider.hidden = YES; needsSecondImage = YES; filter = [[GPUImageDarkenBlendFilter alloc] init]; }; break; case GPUIMAGE_DISSOLVE: { self.title = @"Dissolve Blend"; self.filterSettingsSlider.hidden = NO; needsSecondImage = YES; [self.filterSettingsSlider setMinimumValue:0.0]; [self.filterSettingsSlider setMaximumValue:1.0]; [self.filterSettingsSlider setValue:0.5]; filter = [[GPUImageDissolveBlendFilter alloc] init]; }; break; case GPUIMAGE_SCREENBLEND: { self.title = @"Screen Blend"; self.filterSettingsSlider.hidden = YES; needsSecondImage = YES; filter = [[GPUImageScreenBlendFilter alloc] init]; }; break; case GPUIMAGE_COLORBURN: { self.title = @"Color Burn Blend"; self.filterSettingsSlider.hidden = YES; needsSecondImage = YES; filter = [[GPUImageColorBurnBlendFilter alloc] init]; }; break; case GPUIMAGE_COLORDODGE: { self.title = @"Color Dodge Blend"; self.filterSettingsSlider.hidden = YES; needsSecondImage = YES; filter = [[GPUImageColorDodgeBlendFilter alloc] init]; }; break; case GPUIMAGE_LINEARBURN: { self.title = @"Linear Burn Blend"; self.filterSettingsSlider.hidden = YES; needsSecondImage = YES; filter = [[GPUImageLinearBurnBlendFilter alloc] init]; }; break; case GPUIMAGE_EXCLUSIONBLEND: { self.title = @"Exclusion Blend"; self.filterSettingsSlider.hidden = YES; needsSecondImage = YES; filter = [[GPUImageExclusionBlendFilter alloc] init]; }; break; case GPUIMAGE_DIFFERENCEBLEND: { self.title = @"Difference Blend"; self.filterSettingsSlider.hidden = YES; needsSecondImage = YES; filter = [[GPUImageDifferenceBlendFilter alloc] init]; }; break; case GPUIMAGE_SUBTRACTBLEND: { self.title = @"Subtract Blend"; self.filterSettingsSlider.hidden = YES; needsSecondImage = YES; filter = [[GPUImageSubtractBlendFilter alloc] init]; }; break; case GPUIMAGE_HARDLIGHTBLEND: { self.title = @"Hard Light Blend"; self.filterSettingsSlider.hidden = YES; needsSecondImage = YES; filter = [[GPUImageHardLightBlendFilter alloc] init]; }; break; case GPUIMAGE_SOFTLIGHTBLEND: { self.title = @"Soft Light Blend"; self.filterSettingsSlider.hidden = YES; needsSecondImage = YES; filter = [[GPUImageSoftLightBlendFilter alloc] init]; }; break; case GPUIMAGE_COLORBLEND: { self.title = @"Color Blend"; self.filterSettingsSlider.hidden = YES; needsSecondImage = YES; filter = [[GPUImageColorBlendFilter alloc] init]; }; break; case GPUIMAGE_HUEBLEND: { self.title = @"Hue Blend"; self.filterSettingsSlider.hidden = YES; needsSecondImage = YES; filter = [[GPUImageHueBlendFilter alloc] init]; }; break; case GPUIMAGE_SATURATIONBLEND: { self.title = @"Saturation Blend"; self.filterSettingsSlider.hidden = YES; needsSecondImage = YES; filter = [[GPUImageSaturationBlendFilter alloc] init]; }; break; case GPUIMAGE_LUMINOSITYBLEND: { self.title = @"Luminosity Blend"; self.filterSettingsSlider.hidden = YES; needsSecondImage = YES; filter = [[GPUImageLuminosityBlendFilter alloc] init]; }; break; case GPUIMAGE_NORMALBLEND: { self.title = @"Normal Blend"; self.filterSettingsSlider.hidden = YES; needsSecondImage = YES; filter = [[GPUImageNormalBlendFilter alloc] init]; }; break; case GPUIMAGE_POISSONBLEND: { self.title = @"Poisson Blend"; self.filterSettingsSlider.hidden = NO; needsSecondImage = YES; [self.filterSettingsSlider setMinimumValue:0.0]; [self.filterSettingsSlider setMaximumValue:1.0]; [self.filterSettingsSlider setValue:0.5]; filter = [[GPUImagePoissonBlendFilter alloc] init]; }; break; case GPUIMAGE_OPACITY: { self.title = @"Opacity Adjustment"; self.filterSettingsSlider.hidden = NO; needsSecondImage = YES; [self.filterSettingsSlider setValue:1.0]; [self.filterSettingsSlider setMinimumValue:0.0]; [self.filterSettingsSlider setMaximumValue:1.0]; filter = [[GPUImageOpacityFilter alloc] init]; }; break; case GPUIMAGE_CUSTOM: { self.title = @"Custom"; self.filterSettingsSlider.hidden = YES; filter = [[GPUImageFilter alloc] initWithFragmentShaderFromFile:@"CustomFilter"]; }; break; case GPUIMAGE_KUWAHARA: { self.title = @"Kuwahara"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:3.0]; [self.filterSettingsSlider setMaximumValue:8.0]; [self.filterSettingsSlider setValue:3.0]; filter = [[GPUImageKuwaharaFilter alloc] init]; }; break; case GPUIMAGE_KUWAHARARADIUS3: { self.title = @"Kuwahara (Radius 3)"; self.filterSettingsSlider.hidden = YES; filter = [[GPUImageKuwaharaRadius3Filter alloc] init]; }; break; case GPUIMAGE_VIGNETTE: { self.title = @"Vignette"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:0.5]; [self.filterSettingsSlider setMaximumValue:0.9]; [self.filterSettingsSlider setValue:0.75]; filter = [[GPUImageVignetteFilter alloc] init]; }; break; case GPUIMAGE_GAUSSIAN: { self.title = @"Gaussian Blur"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:0.0]; [self.filterSettingsSlider setMaximumValue:24.0]; [self.filterSettingsSlider setValue:2.0]; filter = [[GPUImageGaussianBlurFilter alloc] init]; }; break; case GPUIMAGE_BOXBLUR: { self.title = @"Box Blur"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:0.0]; [self.filterSettingsSlider setMaximumValue:24.0]; [self.filterSettingsSlider setValue:2.0]; filter = [[GPUImageBoxBlurFilter alloc] init]; }; break; case GPUIMAGE_MEDIAN: { self.title = @"Median"; self.filterSettingsSlider.hidden = YES; filter = [[GPUImageMedianFilter alloc] init]; }; break; case GPUIMAGE_MOTIONBLUR: { self.title = @"Motion Blur"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:0.0]; [self.filterSettingsSlider setMaximumValue:180.0f]; [self.filterSettingsSlider setValue:0.0]; filter = [[GPUImageMotionBlurFilter alloc] init]; }; break; case GPUIMAGE_ZOOMBLUR: { self.title = @"Zoom Blur"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:0.0]; [self.filterSettingsSlider setMaximumValue:2.5f]; [self.filterSettingsSlider setValue:1.0]; filter = [[GPUImageZoomBlurFilter alloc] init]; }; break; case GPUIMAGE_IOSBLUR: { self.title = @"iOS 7 Blur"; self.filterSettingsSlider.hidden = YES; filter = [[GPUImageiOSBlurFilter alloc] init]; }; break; case GPUIMAGE_UIELEMENT: { self.title = @"UI Element"; self.filterSettingsSlider.hidden = YES; filter = [[GPUImageSepiaFilter alloc] init]; }; break; case GPUIMAGE_GAUSSIAN_SELECTIVE: { self.title = @"Selective Blur"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:0.0]; [self.filterSettingsSlider setMaximumValue:.75f]; [self.filterSettingsSlider setValue:40.0/320.0]; filter = [[GPUImageGaussianSelectiveBlurFilter alloc] init]; [(GPUImageGaussianSelectiveBlurFilter*)filter setExcludeCircleRadius:40.0/320.0]; }; break; case GPUIMAGE_GAUSSIAN_POSITION: { self.title = @"Selective Blur"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:0.0]; [self.filterSettingsSlider setMaximumValue:.75f]; [self.filterSettingsSlider setValue:40.0/320.0]; filter = [[GPUImageGaussianBlurPositionFilter alloc] init]; [(GPUImageGaussianBlurPositionFilter*)filter setBlurRadius:40.0/320.0]; }; break; case GPUIMAGE_BILATERAL: { self.title = @"Bilateral Blur"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setMinimumValue:0.0]; [self.filterSettingsSlider setMaximumValue:10.0]; [self.filterSettingsSlider setValue:1.0]; filter = [[GPUImageBilateralFilter alloc] init]; }; break; case GPUIMAGE_FILTERGROUP: { self.title = @"Filter Group"; self.filterSettingsSlider.hidden = NO; [self.filterSettingsSlider setValue:0.05]; [self.filterSettingsSlider setMinimumValue:0.0]; [self.filterSettingsSlider setMaximumValue:0.3]; filter = [[GPUImageFilterGroup alloc] init]; GPUImageSepiaFilter *sepiaFilter = [[GPUImageSepiaFilter alloc] init]; [(GPUImageFilterGroup *)filter addFilter:sepiaFilter]; GPUImagePixellateFilter *pixellateFilter = [[GPUImagePixellateFilter alloc] init]; [(GPUImageFilterGroup *)filter addFilter:pixellateFilter]; [sepiaFilter addTarget:pixellateFilter]; [(GPUImageFilterGroup *)filter setInitialFilters:[NSArray arrayWithObject:sepiaFilter]]; [(GPUImageFilterGroup *)filter setTerminalFilter:pixellateFilter]; }; break; case GPUIMAGE_FACES: { facesSwitch.hidden = NO; facesLabel.hidden = NO; [videoCamera rotateCamera]; self.title = @"Face Detection"; self.filterSettingsSlider.hidden = YES; [self.filterSettingsSlider setValue:1.0]; [self.filterSettingsSlider setMinimumValue:0.0]; [self.filterSettingsSlider setMaximumValue:2.0]; filter = [[GPUImageSaturationFilter alloc] init]; [videoCamera setDelegate:self]; break; } default: filter = [[GPUImageSepiaFilter alloc] init]; break; } if (filterType == GPUIMAGE_FILECONFIG) { self.title = @"File Configuration"; pipeline = [[GPUImageFilterPipeline alloc] initWithConfigurationFile:[[NSBundle mainBundle] URLForResource:@"SampleConfiguration" withExtension:@"plist"] input:videoCamera output:(GPUImageView*)self.view]; // [pipeline addFilter:rotationFilter atIndex:0]; } else { if (filterType != GPUIMAGE_VORONOI) { [videoCamera addTarget:filter]; } videoCamera.runBenchmark = YES; GPUImageView *filterView = (GPUImageView *)self.view; if (needsSecondImage) { UIImage *inputImage; if (filterType == GPUIMAGE_MASK) { inputImage = [UIImage imageNamed:@"mask"]; } /* else if (filterType == GPUIMAGE_VORONOI) { inputImage = [UIImage imageNamed:@"voroni_points.png"]; }*/ else { // The picture is only used for two-image blend filters inputImage = [UIImage imageNamed:@"WID-small.jpg"]; } // sourcePicture = [[GPUImagePicture alloc] initWithImage:inputImage smoothlyScaleOutput:NO]; sourcePicture = [[GPUImagePicture alloc] initWithImage:inputImage smoothlyScaleOutput:YES]; [sourcePicture processImage]; [sourcePicture addTarget:filter]; } if (filterType == GPUIMAGE_HISTOGRAM) { // I'm adding an intermediary filter because glReadPixels() requires something to be rendered for its glReadPixels() operation to work [videoCamera removeTarget:filter]; GPUImageGammaFilter *gammaFilter = [[GPUImageGammaFilter alloc] init]; [videoCamera addTarget:gammaFilter]; [gammaFilter addTarget:filter]; GPUImageHistogramGenerator *histogramGraph = [[GPUImageHistogramGenerator alloc] init]; [histogramGraph forceProcessingAtSize:CGSizeMake(256.0, 330.0)]; [filter addTarget:histogramGraph]; GPUImageAlphaBlendFilter *blendFilter = [[GPUImageAlphaBlendFilter alloc] init]; blendFilter.mix = 0.75; [blendFilter forceProcessingAtSize:CGSizeMake(256.0, 330.0)]; [videoCamera addTarget:blendFilter]; [histogramGraph addTarget:blendFilter]; [blendFilter addTarget:filterView]; } else if ( (filterType == GPUIMAGE_HARRISCORNERDETECTION) || (filterType == GPUIMAGE_NOBLECORNERDETECTION) || (filterType == GPUIMAGE_SHITOMASIFEATUREDETECTION) ) { GPUImageCrosshairGenerator *crosshairGenerator = [[GPUImageCrosshairGenerator alloc] init]; crosshairGenerator.crosshairWidth = 15.0; [crosshairGenerator forceProcessingAtSize:CGSizeMake(480.0, 640.0)]; [(GPUImageHarrisCornerDetectionFilter *)filter setCornersDetectedBlock:^(GLfloat* cornerArray, NSUInteger cornersDetected, CMTime frameTime) { [crosshairGenerator renderCrosshairsFromArray:cornerArray count:cornersDetected frameTime:frameTime]; }]; GPUImageAlphaBlendFilter *blendFilter = [[GPUImageAlphaBlendFilter alloc] init]; [blendFilter forceProcessingAtSize:CGSizeMake(480.0, 640.0)]; GPUImageGammaFilter *gammaFilter = [[GPUImageGammaFilter alloc] init]; [videoCamera addTarget:gammaFilter]; [gammaFilter addTarget:blendFilter]; [crosshairGenerator addTarget:blendFilter]; [blendFilter addTarget:filterView]; } else if (filterType == GPUIMAGE_HOUGHTRANSFORMLINEDETECTOR) { GPUImageLineGenerator *lineGenerator = [[GPUImageLineGenerator alloc] init]; // lineGenerator.crosshairWidth = 15.0; [lineGenerator forceProcessingAtSize:CGSizeMake(480.0, 640.0)]; [lineGenerator setLineColorRed:1.0 green:0.0 blue:0.0]; [(GPUImageHoughTransformLineDetector *)filter setLinesDetectedBlock:^(GLfloat* lineArray, NSUInteger linesDetected, CMTime frameTime){ [lineGenerator renderLinesFromArray:lineArray count:linesDetected frameTime:frameTime]; }]; GPUImageAlphaBlendFilter *blendFilter = [[GPUImageAlphaBlendFilter alloc] init]; [blendFilter forceProcessingAtSize:CGSizeMake(480.0, 640.0)]; GPUImageGammaFilter *gammaFilter = [[GPUImageGammaFilter alloc] init]; [videoCamera addTarget:gammaFilter]; [gammaFilter addTarget:blendFilter]; [lineGenerator addTarget:blendFilter]; [blendFilter addTarget:filterView]; } else if (filterType == GPUIMAGE_UIELEMENT) { GPUImageAlphaBlendFilter *blendFilter = [[GPUImageAlphaBlendFilter alloc] init]; blendFilter.mix = 1.0; NSDate *startTime = [NSDate date]; UILabel *timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(0.0, 0.0, 240.0f, 320.0f)]; timeLabel.font = [UIFont systemFontOfSize:17.0f]; timeLabel.text = @"Time: 0.0 s"; timeLabel.textAlignment = UITextAlignmentCenter; timeLabel.backgroundColor = [UIColor clearColor]; timeLabel.textColor = [UIColor whiteColor]; uiElementInput = [[GPUImageUIElement alloc] initWithView:timeLabel]; [filter addTarget:blendFilter]; [uiElementInput addTarget:blendFilter]; [blendFilter addTarget:filterView]; __unsafe_unretained GPUImageUIElement *weakUIElementInput = uiElementInput; [filter setFrameProcessingCompletionBlock:^(GPUImageOutput * filter, CMTime frameTime){ timeLabel.text = [NSString stringWithFormat:@"Time: %f s", -[startTime timeIntervalSinceNow]]; [weakUIElementInput update]; }]; } else if (filterType == GPUIMAGE_BUFFER) { GPUImageDifferenceBlendFilter *blendFilter = [[GPUImageDifferenceBlendFilter alloc] init]; [videoCamera removeTarget:filter]; GPUImageGammaFilter *gammaFilter = [[GPUImageGammaFilter alloc] init]; [videoCamera addTarget:gammaFilter]; [gammaFilter addTarget:blendFilter]; [videoCamera addTarget:filter]; [filter addTarget:blendFilter]; [blendFilter addTarget:filterView]; } else if ( (filterType == GPUIMAGE_OPACITY) || (filterType == GPUIMAGE_CHROMAKEYNONBLEND) ) { [sourcePicture removeTarget:filter]; [videoCamera removeTarget:filter]; [videoCamera addTarget:filter]; GPUImageAlphaBlendFilter *blendFilter = [[GPUImageAlphaBlendFilter alloc] init]; blendFilter.mix = 1.0; [sourcePicture addTarget:blendFilter]; [filter addTarget:blendFilter]; [blendFilter addTarget:filterView]; } else if ( (filterType == GPUIMAGE_SPHEREREFRACTION) || (filterType == GPUIMAGE_GLASSSPHERE) ) { // Provide a blurred image for a cool-looking background GPUImageGaussianBlurFilter *gaussianBlur = [[GPUImageGaussianBlurFilter alloc] init]; [videoCamera addTarget:gaussianBlur]; gaussianBlur.blurRadiusInPixels = 5.0; GPUImageAlphaBlendFilter *blendFilter = [[GPUImageAlphaBlendFilter alloc] init]; blendFilter.mix = 1.0; [gaussianBlur addTarget:blendFilter]; [filter addTarget:blendFilter]; [blendFilter addTarget:filterView]; } else if (filterType == GPUIMAGE_AVERAGECOLOR) { GPUImageSolidColorGenerator *colorGenerator = [[GPUImageSolidColorGenerator alloc] init]; [colorGenerator forceProcessingAtSize:[filterView sizeInPixels]]; [(GPUImageAverageColor *)filter setColorAverageProcessingFinishedBlock:^(CGFloat redComponent, CGFloat greenComponent, CGFloat blueComponent, CGFloat alphaComponent, CMTime frameTime) { [colorGenerator setColorRed:redComponent green:greenComponent blue:blueComponent alpha:alphaComponent]; // NSLog(@"Average color: %f, %f, %f, %f", redComponent, greenComponent, blueComponent, alphaComponent); }]; [colorGenerator addTarget:filterView]; } else if (filterType == GPUIMAGE_LUMINOSITY) { GPUImageSolidColorGenerator *colorGenerator = [[GPUImageSolidColorGenerator alloc] init]; [colorGenerator forceProcessingAtSize:[filterView sizeInPixels]]; [(GPUImageLuminosity *)filter setLuminosityProcessingFinishedBlock:^(CGFloat luminosity, CMTime frameTime) { [colorGenerator setColorRed:luminosity green:luminosity blue:luminosity alpha:1.0]; }]; [colorGenerator addTarget:filterView]; } else if (filterType == GPUIMAGE_IOSBLUR) { [videoCamera removeAllTargets]; [videoCamera addTarget:filterView]; GPUImageCropFilter *cropFilter = [[GPUImageCropFilter alloc] init]; cropFilter.cropRegion = CGRectMake(0.0, 0.5, 1.0, 0.5); [videoCamera addTarget:cropFilter]; [cropFilter addTarget:filter]; CGRect currentViewFrame = filterView.bounds; GPUImageView *blurOverlayView = [[GPUImageView alloc] initWithFrame:CGRectMake(0.0, round(currentViewFrame.size.height / 2.0), currentViewFrame.size.width, currentViewFrame.size.height - round(currentViewFrame.size.height / 2.0))]; [filterView addSubview:blurOverlayView]; [filter addTarget:blurOverlayView]; } else if (filterType == GPUIMAGE_MOTIONDETECTOR) { faceView = [[UIView alloc] initWithFrame:CGRectMake(100.0, 100.0, 100.0, 100.0)]; faceView.layer.borderWidth = 1; faceView.layer.borderColor = [[UIColor redColor] CGColor]; [self.view addSubview:faceView]; faceView.hidden = YES; __unsafe_unretained ShowcaseFilterViewController * weakSelf = self; [(GPUImageMotionDetector *) filter setMotionDetectionBlock:^(CGPoint motionCentroid, CGFloat motionIntensity, CMTime frameTime) { if (motionIntensity > 0.01) { CGFloat motionBoxWidth = 1500.0 * motionIntensity; CGSize viewBounds = weakSelf.view.bounds.size; dispatch_async(dispatch_get_main_queue(), ^{ weakSelf->faceView.frame = CGRectMake(round(viewBounds.width * motionCentroid.x - motionBoxWidth / 2.0), round(viewBounds.height * motionCentroid.y - motionBoxWidth / 2.0), motionBoxWidth, motionBoxWidth); weakSelf->faceView.hidden = NO; }); } else { dispatch_async(dispatch_get_main_queue(), ^{ weakSelf->faceView.hidden = YES; }); } }]; [videoCamera addTarget:filterView]; } else { [filter addTarget:filterView]; } } [videoCamera startCameraCapture]; } #pragma mark - #pragma mark Filter adjustments - (IBAction)updateFilterFromSlider:(id)sender; { [videoCamera resetBenchmarkAverage]; switch(filterType) { case GPUIMAGE_SEPIA: [(GPUImageSepiaFilter *)filter setIntensity:[(UISlider *)sender value]]; break; case GPUIMAGE_PIXELLATE: [(GPUImagePixellateFilter *)filter setFractionalWidthOfAPixel:[(UISlider *)sender value]]; break; case GPUIMAGE_POLARPIXELLATE: [(GPUImagePolarPixellateFilter *)filter setPixelSize:CGSizeMake([(UISlider *)sender value], [(UISlider *)sender value])]; break; case GPUIMAGE_PIXELLATE_POSITION: [(GPUImagePixellatePositionFilter *)filter setRadius:[(UISlider *)sender value]]; break; case GPUIMAGE_POLKADOT: [(GPUImagePolkaDotFilter *)filter setFractionalWidthOfAPixel:[(UISlider *)sender value]]; break; case GPUIMAGE_HALFTONE: [(GPUImageHalftoneFilter *)filter setFractionalWidthOfAPixel:[(UISlider *)sender value]]; break; case GPUIMAGE_SATURATION: [(GPUImageSaturationFilter *)filter setSaturation:[(UISlider *)sender value]]; break; case GPUIMAGE_CONTRAST: [(GPUImageContrastFilter *)filter setContrast:[(UISlider *)sender value]]; break; case GPUIMAGE_BRIGHTNESS: [(GPUImageBrightnessFilter *)filter setBrightness:[(UISlider *)sender value]]; break; case GPUIMAGE_LEVELS: { float value = [(UISlider *)sender value]; [(GPUImageLevelsFilter *)filter setRedMin:value gamma:1.0 max:1.0 minOut:0.0 maxOut:1.0]; [(GPUImageLevelsFilter *)filter setGreenMin:value gamma:1.0 max:1.0 minOut:0.0 maxOut:1.0]; [(GPUImageLevelsFilter *)filter setBlueMin:value gamma:1.0 max:1.0 minOut:0.0 maxOut:1.0]; }; break; case GPUIMAGE_EXPOSURE: [(GPUImageExposureFilter *)filter setExposure:[(UISlider *)sender value]]; break; case GPUIMAGE_MONOCHROME: [(GPUImageMonochromeFilter *)filter setIntensity:[(UISlider *)sender value]]; break; case GPUIMAGE_RGB: [(GPUImageRGBFilter *)filter setGreen:[(UISlider *)sender value]]; break; case GPUIMAGE_HUE: [(GPUImageHueFilter *)filter setHue:[(UISlider *)sender value]]; break; case GPUIMAGE_WHITEBALANCE: [(GPUImageWhiteBalanceFilter *)filter setTemperature:[(UISlider *)sender value]]; break; case GPUIMAGE_SHARPEN: [(GPUImageSharpenFilter *)filter setSharpness:[(UISlider *)sender value]]; break; case GPUIMAGE_HISTOGRAM: [(GPUImageHistogramFilter *)filter setDownsamplingFactor:round([(UISlider *)sender value])]; break; case GPUIMAGE_HISTOGRAM_EQUALIZATION: [(GPUImageHistogramEqualizationFilter *)filter setDownsamplingFactor:round([(UISlider *)sender value])]; break; case GPUIMAGE_UNSHARPMASK: [(GPUImageUnsharpMaskFilter *)filter setIntensity:[(UISlider *)sender value]]; break; // case GPUIMAGE_UNSHARPMASK: [(GPUImageUnsharpMaskFilter *)filter setBlurSize:[(UISlider *)sender value]]; break; case GPUIMAGE_GAMMA: [(GPUImageGammaFilter *)filter setGamma:[(UISlider *)sender value]]; break; case GPUIMAGE_CROSSHATCH: [(GPUImageCrosshatchFilter *)filter setCrossHatchSpacing:[(UISlider *)sender value]]; break; case GPUIMAGE_POSTERIZE: [(GPUImagePosterizeFilter *)filter setColorLevels:round([(UISlider*)sender value])]; break; case GPUIMAGE_HAZE: [(GPUImageHazeFilter *)filter setDistance:[(UISlider *)sender value]]; break; case GPUIMAGE_SOBELEDGEDETECTION: [(GPUImageSobelEdgeDetectionFilter *)filter setEdgeStrength:[(UISlider *)sender value]]; break; case GPUIMAGE_PREWITTEDGEDETECTION: [(GPUImagePrewittEdgeDetectionFilter *)filter setEdgeStrength:[(UISlider *)sender value]]; break; case GPUIMAGE_SKETCH: [(GPUImageSketchFilter *)filter setEdgeStrength:[(UISlider *)sender value]]; break; case GPUIMAGE_THRESHOLD: [(GPUImageLuminanceThresholdFilter *)filter setThreshold:[(UISlider *)sender value]]; break; case GPUIMAGE_ADAPTIVETHRESHOLD: [(GPUImageAdaptiveThresholdFilter *)filter setBlurRadiusInPixels:[(UISlider*)sender value]]; break; case GPUIMAGE_AVERAGELUMINANCETHRESHOLD: [(GPUImageAverageLuminanceThresholdFilter *)filter setThresholdMultiplier:[(UISlider *)sender value]]; break; case GPUIMAGE_DISSOLVE: [(GPUImageDissolveBlendFilter *)filter setMix:[(UISlider *)sender value]]; break; case GPUIMAGE_POISSONBLEND: [(GPUImagePoissonBlendFilter *)filter setMix:[(UISlider *)sender value]]; break; case GPUIMAGE_LOWPASS: [(GPUImageLowPassFilter *)filter setFilterStrength:[(UISlider *)sender value]]; break; case GPUIMAGE_HIGHPASS: [(GPUImageHighPassFilter *)filter setFilterStrength:[(UISlider *)sender value]]; break; case GPUIMAGE_MOTIONDETECTOR: [(GPUImageMotionDetector *)filter setLowPassFilterStrength:[(UISlider *)sender value]]; break; case GPUIMAGE_CHROMAKEY: [(GPUImageChromaKeyBlendFilter *)filter setThresholdSensitivity:[(UISlider *)sender value]]; break; case GPUIMAGE_CHROMAKEYNONBLEND: [(GPUImageChromaKeyFilter *)filter setThresholdSensitivity:[(UISlider *)sender value]]; break; case GPUIMAGE_KUWAHARA: [(GPUImageKuwaharaFilter *)filter setRadius:round([(UISlider *)sender value])]; break; case GPUIMAGE_SWIRL: [(GPUImageSwirlFilter *)filter setAngle:[(UISlider *)sender value]]; break; case GPUIMAGE_EMBOSS: [(GPUImageEmbossFilter *)filter setIntensity:[(UISlider *)sender value]]; break; case GPUIMAGE_CANNYEDGEDETECTION: [(GPUImageCannyEdgeDetectionFilter *)filter setBlurTexelSpacingMultiplier:[(UISlider*)sender value]]; break; // case GPUIMAGE_CANNYEDGEDETECTION: [(GPUImageCannyEdgeDetectionFilter *)filter setLowerThreshold:[(UISlider*)sender value]]; break; case GPUIMAGE_HARRISCORNERDETECTION: [(GPUImageHarrisCornerDetectionFilter *)filter setThreshold:[(UISlider*)sender value]]; break; case GPUIMAGE_NOBLECORNERDETECTION: [(GPUImageNobleCornerDetectionFilter *)filter setThreshold:[(UISlider*)sender value]]; break; case GPUIMAGE_SHITOMASIFEATUREDETECTION: [(GPUImageShiTomasiFeatureDetectionFilter *)filter setThreshold:[(UISlider*)sender value]]; break; case GPUIMAGE_HOUGHTRANSFORMLINEDETECTOR: [(GPUImageHoughTransformLineDetector *)filter setLineDetectionThreshold:[(UISlider*)sender value]]; break; // case GPUIMAGE_HARRISCORNERDETECTION: [(GPUImageHarrisCornerDetectionFilter *)filter setSensitivity:[(UISlider*)sender value]]; break; case GPUIMAGE_THRESHOLDEDGEDETECTION: [(GPUImageThresholdEdgeDetectionFilter *)filter setThreshold:[(UISlider *)sender value]]; break; case GPUIMAGE_SMOOTHTOON: [(GPUImageSmoothToonFilter *)filter setBlurRadiusInPixels:[(UISlider*)sender value]]; break; case GPUIMAGE_THRESHOLDSKETCH: [(GPUImageThresholdSketchFilter *)filter setThreshold:[(UISlider *)sender value]]; break; // case GPUIMAGE_BULGE: [(GPUImageBulgeDistortionFilter *)filter setRadius:[(UISlider *)sender value]]; break; case GPUIMAGE_BULGE: [(GPUImageBulgeDistortionFilter *)filter setScale:[(UISlider *)sender value]]; break; case GPUIMAGE_SPHEREREFRACTION: [(GPUImageSphereRefractionFilter *)filter setRadius:[(UISlider *)sender value]]; break; case GPUIMAGE_GLASSSPHERE: [(GPUImageGlassSphereFilter *)filter setRadius:[(UISlider *)sender value]]; break; case GPUIMAGE_TONECURVE: [(GPUImageToneCurveFilter *)filter setBlueControlPoints:[NSArray arrayWithObjects:[NSValue valueWithCGPoint:CGPointMake(0.0, 0.0)], [NSValue valueWithCGPoint:CGPointMake(0.5, [(UISlider *)sender value])], [NSValue valueWithCGPoint:CGPointMake(1.0, 0.75)], nil]]; break; case GPUIMAGE_HIGHLIGHTSHADOW: [(GPUImageHighlightShadowFilter *)filter setHighlights:[(UISlider *)sender value]]; break; case GPUIMAGE_PINCH: [(GPUImagePinchDistortionFilter *)filter setScale:[(UISlider *)sender value]]; break; case GPUIMAGE_PERLINNOISE: [(GPUImagePerlinNoiseFilter *)filter setScale:[(UISlider *)sender value]]; break; case GPUIMAGE_MOSAIC: [(GPUImageMosaicFilter *)filter setDisplayTileSize:CGSizeMake([(UISlider *)sender value], [(UISlider *)sender value])]; break; case GPUIMAGE_VIGNETTE: [(GPUImageVignetteFilter *)filter setVignetteEnd:[(UISlider *)sender value]]; break; case GPUIMAGE_BOXBLUR: [(GPUImageBoxBlurFilter *)filter setBlurRadiusInPixels:[(UISlider*)sender value]]; break; case GPUIMAGE_GAUSSIAN: [(GPUImageGaussianBlurFilter *)filter setBlurRadiusInPixels:[(UISlider*)sender value]]; break; // case GPUIMAGE_GAUSSIAN: [(GPUImageGaussianBlurFilter *)filter setBlurPasses:round([(UISlider*)sender value])]; break; // case GPUIMAGE_BILATERAL: [(GPUImageBilateralFilter *)filter setBlurSize:[(UISlider*)sender value]]; break; case GPUIMAGE_BILATERAL: [(GPUImageBilateralFilter *)filter setDistanceNormalizationFactor:[(UISlider*)sender value]]; break; case GPUIMAGE_MOTIONBLUR: [(GPUImageMotionBlurFilter *)filter setBlurAngle:[(UISlider*)sender value]]; break; case GPUIMAGE_ZOOMBLUR: [(GPUImageZoomBlurFilter *)filter setBlurSize:[(UISlider*)sender value]]; break; case GPUIMAGE_OPACITY: [(GPUImageOpacityFilter *)filter setOpacity:[(UISlider *)sender value]]; break; case GPUIMAGE_GAUSSIAN_SELECTIVE: [(GPUImageGaussianSelectiveBlurFilter *)filter setExcludeCircleRadius:[(UISlider*)sender value]]; break; case GPUIMAGE_GAUSSIAN_POSITION: [(GPUImageGaussianBlurPositionFilter *)filter setBlurRadius:[(UISlider *)sender value]]; break; case GPUIMAGE_FILTERGROUP: [(GPUImagePixellateFilter *)[(GPUImageFilterGroup *)filter filterAtIndex:1] setFractionalWidthOfAPixel:[(UISlider *)sender value]]; break; case GPUIMAGE_CROP: [(GPUImageCropFilter *)filter setCropRegion:CGRectMake(0.0, 0.0, 1.0, [(UISlider*)sender value])]; break; case GPUIMAGE_TRANSFORM: [(GPUImageTransformFilter *)filter setAffineTransform:CGAffineTransformMakeRotation([(UISlider*)sender value])]; break; case GPUIMAGE_TRANSFORM3D: { CATransform3D perspectiveTransform = CATransform3DIdentity; perspectiveTransform.m34 = 0.4; perspectiveTransform.m33 = 0.4; perspectiveTransform = CATransform3DScale(perspectiveTransform, 0.75, 0.75, 0.75); perspectiveTransform = CATransform3DRotate(perspectiveTransform, [(UISlider*)sender value], 0.0, 1.0, 0.0); [(GPUImageTransformFilter *)filter setTransform3D:perspectiveTransform]; }; break; case GPUIMAGE_TILTSHIFT: { CGFloat midpoint = [(UISlider *)sender value]; [(GPUImageTiltShiftFilter *)filter setTopFocusLevel:midpoint - 0.1]; [(GPUImageTiltShiftFilter *)filter setBottomFocusLevel:midpoint + 0.1]; }; break; case GPUIMAGE_LOCALBINARYPATTERN: { CGFloat multiplier = [(UISlider *)sender value]; [(GPUImageLocalBinaryPatternFilter *)filter setTexelWidth:(multiplier / self.view.bounds.size.width)]; [(GPUImageLocalBinaryPatternFilter *)filter setTexelHeight:(multiplier / self.view.bounds.size.height)]; }; break; default: break; } } #pragma mark - Face Detection Delegate Callback - (void)willOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer{ if (!faceThinking) { CFAllocatorRef allocator = CFAllocatorGetDefault(); CMSampleBufferRef sbufCopyOut; CMSampleBufferCreateCopy(allocator,sampleBuffer,&sbufCopyOut); [self performSelectorInBackground:@selector(grepFacesForSampleBuffer:) withObject:CFBridgingRelease(sbufCopyOut)]; } } - (void)grepFacesForSampleBuffer:(CMSampleBufferRef)sampleBuffer{ faceThinking = TRUE; NSLog(@"Faces thinking"); CVPixelBufferRef pixelBuffer = CMSampleBufferGetImageBuffer(sampleBuffer); CFDictionaryRef attachments = CMCopyDictionaryOfAttachments(kCFAllocatorDefault, sampleBuffer, kCMAttachmentMode_ShouldPropagate); CIImage *convertedImage = [[CIImage alloc] initWithCVPixelBuffer:pixelBuffer options:(__bridge NSDictionary *)attachments]; if (attachments) CFRelease(attachments); NSDictionary *imageOptions = nil; UIDeviceOrientation curDeviceOrientation = [[UIDevice currentDevice] orientation]; int exifOrientation; /* kCGImagePropertyOrientation values The intended display orientation of the image. If present, this key is a CFNumber value with the same value as defined by the TIFF and EXIF specifications -- see enumeration of integer constants. The value specified where the origin (0,0) of the image is located. If not present, a value of 1 is assumed. used when calling featuresInImage: options: The value for this key is an integer NSNumber from 1..8 as found in kCGImagePropertyOrientation. If present, the detection will be done based on that orientation but the coordinates in the returned features will still be based on those of the image. */ enum { PHOTOS_EXIF_0ROW_TOP_0COL_LEFT = 1, // 1 = 0th row is at the top, and 0th column is on the left (THE DEFAULT). PHOTOS_EXIF_0ROW_TOP_0COL_RIGHT = 2, // 2 = 0th row is at the top, and 0th column is on the right. PHOTOS_EXIF_0ROW_BOTTOM_0COL_RIGHT = 3, // 3 = 0th row is at the bottom, and 0th column is on the right. PHOTOS_EXIF_0ROW_BOTTOM_0COL_LEFT = 4, // 4 = 0th row is at the bottom, and 0th column is on the left. PHOTOS_EXIF_0ROW_LEFT_0COL_TOP = 5, // 5 = 0th row is on the left, and 0th column is the top. PHOTOS_EXIF_0ROW_RIGHT_0COL_TOP = 6, // 6 = 0th row is on the right, and 0th column is the top. PHOTOS_EXIF_0ROW_RIGHT_0COL_BOTTOM = 7, // 7 = 0th row is on the right, and 0th column is the bottom. PHOTOS_EXIF_0ROW_LEFT_0COL_BOTTOM = 8 // 8 = 0th row is on the left, and 0th column is the bottom. }; BOOL isUsingFrontFacingCamera = FALSE; AVCaptureDevicePosition currentCameraPosition = [videoCamera cameraPosition]; if (currentCameraPosition != AVCaptureDevicePositionBack) { isUsingFrontFacingCamera = TRUE; } switch (curDeviceOrientation) { case UIDeviceOrientationPortraitUpsideDown: // Device oriented vertically, home button on the top exifOrientation = PHOTOS_EXIF_0ROW_LEFT_0COL_BOTTOM; break; case UIDeviceOrientationLandscapeLeft: // Device oriented horizontally, home button on the right if (isUsingFrontFacingCamera) exifOrientation = PHOTOS_EXIF_0ROW_BOTTOM_0COL_RIGHT; else exifOrientation = PHOTOS_EXIF_0ROW_TOP_0COL_LEFT; break; case UIDeviceOrientationLandscapeRight: // Device oriented horizontally, home button on the left if (isUsingFrontFacingCamera) exifOrientation = PHOTOS_EXIF_0ROW_TOP_0COL_LEFT; else exifOrientation = PHOTOS_EXIF_0ROW_BOTTOM_0COL_RIGHT; break; case UIDeviceOrientationPortrait: // Device oriented vertically, home button on the bottom default: exifOrientation = PHOTOS_EXIF_0ROW_RIGHT_0COL_TOP; break; } imageOptions = [NSDictionary dictionaryWithObject:[NSNumber numberWithInt:exifOrientation] forKey:CIDetectorImageOrientation]; NSLog(@"Face Detector %@", [self.faceDetector description]); NSLog(@"converted Image %@", [convertedImage description]); NSArray *features = [self.faceDetector featuresInImage:convertedImage options:imageOptions]; // get the clean aperture // the clean aperture is a rectangle that defines the portion of the encoded pixel dimensions // that represents image data valid for display. CMFormatDescriptionRef fdesc = CMSampleBufferGetFormatDescription(sampleBuffer); CGRect clap = CMVideoFormatDescriptionGetCleanAperture(fdesc, false /*originIsTopLeft == false*/); [self GPUVCWillOutputFeatures:features forClap:clap andOrientation:curDeviceOrientation]; faceThinking = FALSE; } - (void)GPUVCWillOutputFeatures:(NSArray*)featureArray forClap:(CGRect)clap andOrientation:(UIDeviceOrientation)curDeviceOrientation { dispatch_async(dispatch_get_main_queue(), ^{ NSLog(@"Did receive array"); CGRect previewBox = self.view.frame; if (featureArray == nil && faceView) { [faceView removeFromSuperview]; faceView = nil; } for ( CIFaceFeature *faceFeature in featureArray) { // find the correct position for the square layer within the previewLayer // the feature box originates in the bottom left of the video frame. // (Bottom right if mirroring is turned on) NSLog(@"%@", NSStringFromCGRect([faceFeature bounds])); //Update face bounds for iOS Coordinate System CGRect faceRect = [faceFeature bounds]; // flip preview width and height CGFloat temp = faceRect.size.width; faceRect.size.width = faceRect.size.height; faceRect.size.height = temp; temp = faceRect.origin.x; faceRect.origin.x = faceRect.origin.y; faceRect.origin.y = temp; // scale coordinates so they fit in the preview box, which may be scaled CGFloat widthScaleBy = previewBox.size.width / clap.size.height; CGFloat heightScaleBy = previewBox.size.height / clap.size.width; faceRect.size.width *= widthScaleBy; faceRect.size.height *= heightScaleBy; faceRect.origin.x *= widthScaleBy; faceRect.origin.y *= heightScaleBy; faceRect = CGRectOffset(faceRect, previewBox.origin.x, previewBox.origin.y); if (faceView) { [faceView removeFromSuperview]; faceView = nil; } // create a UIView using the bounds of the face faceView = [[UIView alloc] initWithFrame:faceRect]; // add a border around the newly created UIView faceView.layer.borderWidth = 1; faceView.layer.borderColor = [[UIColor redColor] CGColor]; // add the new view to create a box around the face [self.view addSubview:faceView]; } }); } -(IBAction)facesSwitched:(UISwitch*)sender{ if (![sender isOn]) { [videoCamera setDelegate:nil]; if (faceView) { [faceView removeFromSuperview]; faceView = nil; } }else{ [videoCamera setDelegate:self]; } } #pragma mark - #pragma mark Accessors @synthesize filterSettingsSlider = _filterSettingsSlider; @end ================================================ FILE: examples/iOS/FilterShowcase/FilterShowcase/ShowcaseFilterViewController.xib ================================================ 1536 12A269 2818 1187 624.00 com.apple.InterfaceBuilder.IBCocoaTouchPlugin 1900 IBProxyObject IBUILabel IBUISlider IBUISwitch IBUIView com.apple.InterfaceBuilder.IBCocoaTouchPlugin PluginDependencyRecalculationVersion IBFilesOwner IBCocoaTouchFramework IBFirstResponder IBCocoaTouchFramework 274 266 {{18, 374}, {284, 23}} _NS:623 NO IBCocoaTouchFramework 0 0 0.5 292 {{219, 8}, {94, 27}} _NS:9 NO IBCocoaTouchFramework 0 0 2 MC45MTc2NDcxMjMzIDAuOTE3NjQ3MTIzMyAwLjkxNzY0NzEyMzMAA 292 {{173, 8}, {52, 27}} _NS:9 NO YES 7 NO IBCocoaTouchFramework 0 Faces: 1 MCAwIDAAA HelveticaNeue-Bold Helvetica Neue 2 16 HelveticaNeue-Bold 16 16 NO 0 {{0, 64}, {320, 416}} 3 MQA 2 NO IBCocoaTouchFramework view 3 filterSettingsSlider 7 facesSwitch 10 facesLabel 12 updateFilterFromSlider: 13 6 facesSwitched: 13 11 0 1 -1 File's Owner -2 4 8 9 ShowcaseFilterViewController com.apple.InterfaceBuilder.IBCocoaTouchPlugin UIResponder com.apple.InterfaceBuilder.IBCocoaTouchPlugin GPUImageView com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin 12 0 IBCocoaTouchFramework YES 3 1900 ================================================ FILE: examples/iOS/FilterShowcase/FilterShowcase/en.lproj/InfoPlist.strings ================================================ /* Localized versions of Info.plist keys */ ================================================ FILE: examples/iOS/FilterShowcase/FilterShowcase/main.m ================================================ #import #import "ShowcaseAppDelegate.h" int main(int argc, char *argv[]) { @autoreleasepool { return UIApplicationMain(argc, argv, nil, NSStringFromClass([ShowcaseAppDelegate class])); } } ================================================ FILE: examples/iOS/FilterShowcase/FilterShowcase.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ 0D69488E1501F71900206FF8 /* SampleConfiguration.plist in Resources */ = {isa = PBXBuildFile; fileRef = 0D69488D1501F71900206FF8 /* SampleConfiguration.plist */; }; 6BF3ED5715B5C2BF002F9E9E /* CoreImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6BF3ED5615B5C2BF002F9E9E /* CoreImage.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; 83AE9FD41540F3CC00F7FC13 /* mask.png in Resources */ = {isa = PBXBuildFile; fileRef = 83AE9FD31540F3CC00F7FC13 /* mask.png */; }; BC982B0714F046AC0001FF6F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC982B0614F046AC0001FF6F /* UIKit.framework */; }; BC982B0914F046AC0001FF6F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC982B0814F046AC0001FF6F /* Foundation.framework */; }; BC982B0B14F046AC0001FF6F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC982B0A14F046AC0001FF6F /* CoreGraphics.framework */; }; BC982B1114F046AC0001FF6F /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = BC982B0F14F046AC0001FF6F /* InfoPlist.strings */; }; BC982B1314F046AC0001FF6F /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = BC982B1214F046AC0001FF6F /* main.m */; }; BC982B1714F046AC0001FF6F /* ShowcaseAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = BC982B1614F046AC0001FF6F /* ShowcaseAppDelegate.m */; }; BC982B2014F048160001FF6F /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC982B1D14F048160001FF6F /* CoreMedia.framework */; }; BC982B2114F048160001FF6F /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC982B1E14F048160001FF6F /* CoreVideo.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; BC982B2214F048160001FF6F /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC982B1F14F048160001FF6F /* QuartzCore.framework */; }; BC982B2414F0481C0001FF6F /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC982B2314F0481C0001FF6F /* AVFoundation.framework */; }; BC982B2614F048230001FF6F /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC982B2514F048230001FF6F /* OpenGLES.framework */; }; BC982B3614F04B3A0001FF6F /* ShowcaseFilterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BC982B3414F04B3A0001FF6F /* ShowcaseFilterViewController.m */; }; BC982B3714F04B3A0001FF6F /* ShowcaseFilterViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = BC982B3514F04B3A0001FF6F /* ShowcaseFilterViewController.xib */; }; BC982B3F14F05DC20001FF6F /* ShowcaseFilterListController.m in Sources */ = {isa = PBXBuildFile; fileRef = BC982B3E14F05DC10001FF6F /* ShowcaseFilterListController.m */; }; BC982BD114F1C0F00001FF6F /* WID-small.jpg in Resources */ = {isa = PBXBuildFile; fileRef = BC982BD014F1C0F00001FF6F /* WID-small.jpg */; }; BC982C4114F1F6C80001FF6F /* CustomFilter.fsh in Resources */ = {isa = PBXBuildFile; fileRef = BC982C4014F1F6C80001FF6F /* CustomFilter.fsh */; }; BCB3C3C516BCA2EB003D26B0 /* Icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C3C016BCA2EB003D26B0 /* Icon-72.png */; }; BCB3C3C616BCA2EB003D26B0 /* Icon-72@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C3C116BCA2EB003D26B0 /* Icon-72@2x.png */; }; BCB3C3C716BCA2EB003D26B0 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C3C216BCA2EB003D26B0 /* Icon.png */; }; BCB3C3C816BCA2EB003D26B0 /* Icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C3C316BCA2EB003D26B0 /* Icon@2x.png */; }; BCB3C3C916BCA2EB003D26B0 /* iTunesArtwork.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C3C416BCA2EB003D26B0 /* iTunesArtwork.png */; }; BCF866CF1725A19A00912E34 /* libGPUImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BCF866C41725894100912E34 /* libGPUImage.a */; }; BCF9D9AB15CCD1AF007E7FBA /* lookup_amatorka.png in Resources */ = {isa = PBXBuildFile; fileRef = BCF9D9A715CCD1AF007E7FBA /* lookup_amatorka.png */; }; BCF9D9AC15CCD1AF007E7FBA /* lookup_miss_etikate.png in Resources */ = {isa = PBXBuildFile; fileRef = BCF9D9A815CCD1AF007E7FBA /* lookup_miss_etikate.png */; }; BCF9D9AD15CCD1AF007E7FBA /* lookup_soft_elegance_1.png in Resources */ = {isa = PBXBuildFile; fileRef = BCF9D9A915CCD1AF007E7FBA /* lookup_soft_elegance_1.png */; }; BCF9D9AE15CCD1AF007E7FBA /* lookup_soft_elegance_2.png in Resources */ = {isa = PBXBuildFile; fileRef = BCF9D9AA15CCD1AF007E7FBA /* lookup_soft_elegance_2.png */; }; E5530A36180FD1D500597F98 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E5530A35180FD1D500597F98 /* Default-568h@2x.png */; }; F2F3361E156585C400B0FBB8 /* voroni_points2.png in Resources */ = {isa = PBXBuildFile; fileRef = F2F3361D156585C400B0FBB8 /* voroni_points2.png */; }; F2F336271565906000B0FBB8 /* dotletterstiles.png in Resources */ = {isa = PBXBuildFile; fileRef = F2F336261565906000B0FBB8 /* dotletterstiles.png */; }; F2F33629156591CA00B0FBB8 /* curvies.png in Resources */ = {isa = PBXBuildFile; fileRef = F2F33628156591CA00B0FBB8 /* curvies.png */; }; F2F3362B156591DB00B0FBB8 /* squares.png in Resources */ = {isa = PBXBuildFile; fileRef = F2F3362A156591DB00B0FBB8 /* squares.png */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ BC7E93DB19EB2334006D23C3 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BC982B2714F049950001FF6F /* GPUImage.xcodeproj */; proxyType = 2; remoteGlobalIDString = BCE209E51943F20C002FEED8; remoteInfo = GPUImageFramework; }; BCF866C31725894100912E34 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BC982B2714F049950001FF6F /* GPUImage.xcodeproj */; proxyType = 2; remoteGlobalIDString = BCF1A33414DDB1EC00852800; remoteInfo = GPUImage; }; BCF866CD1725A19100912E34 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BC982B2714F049950001FF6F /* GPUImage.xcodeproj */; proxyType = 1; remoteGlobalIDString = BCF1A33314DDB1EC00852800; remoteInfo = GPUImage; }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ 0D69488D1501F71900206FF8 /* SampleConfiguration.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = SampleConfiguration.plist; sourceTree = ""; }; 6BF3ED5615B5C2BF002F9E9E /* CoreImage.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreImage.framework; path = System/Library/Frameworks/CoreImage.framework; sourceTree = SDKROOT; }; 83AE9FD31540F3CC00F7FC13 /* mask.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = mask.png; sourceTree = ""; }; BC982B0214F046AC0001FF6F /* FilterShowcase.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FilterShowcase.app; sourceTree = BUILT_PRODUCTS_DIR; }; BC982B0614F046AC0001FF6F /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; BC982B0814F046AC0001FF6F /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; BC982B0A14F046AC0001FF6F /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; BC982B0E14F046AC0001FF6F /* FilterShowcase-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "FilterShowcase-Info.plist"; sourceTree = ""; }; BC982B1014F046AC0001FF6F /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; BC982B1214F046AC0001FF6F /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; BC982B1414F046AC0001FF6F /* FilterShowcase-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "FilterShowcase-Prefix.pch"; sourceTree = ""; }; BC982B1514F046AC0001FF6F /* ShowcaseAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ShowcaseAppDelegate.h; sourceTree = ""; }; BC982B1614F046AC0001FF6F /* ShowcaseAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ShowcaseAppDelegate.m; sourceTree = ""; }; BC982B1D14F048160001FF6F /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; }; BC982B1E14F048160001FF6F /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = System/Library/Frameworks/CoreVideo.framework; sourceTree = SDKROOT; }; BC982B1F14F048160001FF6F /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; BC982B2314F0481C0001FF6F /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; BC982B2514F048230001FF6F /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; BC982B2714F049950001FF6F /* GPUImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = GPUImage.xcodeproj; path = ../../../framework/GPUImage.xcodeproj; sourceTree = ""; }; BC982B3314F04B3A0001FF6F /* ShowcaseFilterViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShowcaseFilterViewController.h; sourceTree = ""; }; BC982B3414F04B3A0001FF6F /* ShowcaseFilterViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ShowcaseFilterViewController.m; sourceTree = ""; }; BC982B3514F04B3A0001FF6F /* ShowcaseFilterViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ShowcaseFilterViewController.xib; sourceTree = ""; }; BC982B3D14F05DC10001FF6F /* ShowcaseFilterListController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShowcaseFilterListController.h; sourceTree = ""; }; BC982B3E14F05DC10001FF6F /* ShowcaseFilterListController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ShowcaseFilterListController.m; sourceTree = ""; }; BC982BD014F1C0F00001FF6F /* WID-small.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; name = "WID-small.jpg"; path = "../../SimpleImageFilter/SimpleImageFilter/WID-small.jpg"; sourceTree = ""; }; BC982C4014F1F6C80001FF6F /* CustomFilter.fsh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = CustomFilter.fsh; sourceTree = ""; }; BCB3C3C016BCA2EB003D26B0 /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-72.png"; path = "../../SharedIcons/Icon-72.png"; sourceTree = ""; }; BCB3C3C116BCA2EB003D26B0 /* Icon-72@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-72@2x.png"; path = "../../SharedIcons/Icon-72@2x.png"; sourceTree = ""; }; BCB3C3C216BCA2EB003D26B0 /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Icon.png; path = ../../SharedIcons/Icon.png; sourceTree = ""; }; BCB3C3C316BCA2EB003D26B0 /* Icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon@2x.png"; path = "../../SharedIcons/Icon@2x.png"; sourceTree = ""; }; BCB3C3C416BCA2EB003D26B0 /* iTunesArtwork.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = iTunesArtwork.png; path = ../../SharedIcons/iTunesArtwork.png; sourceTree = ""; }; BCF9D9A715CCD1AF007E7FBA /* lookup_amatorka.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = lookup_amatorka.png; path = ../../../../framework/Resources/lookup_amatorka.png; sourceTree = ""; }; BCF9D9A815CCD1AF007E7FBA /* lookup_miss_etikate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = lookup_miss_etikate.png; path = ../../../../framework/Resources/lookup_miss_etikate.png; sourceTree = ""; }; BCF9D9A915CCD1AF007E7FBA /* lookup_soft_elegance_1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = lookup_soft_elegance_1.png; path = ../../../../framework/Resources/lookup_soft_elegance_1.png; sourceTree = ""; }; BCF9D9AA15CCD1AF007E7FBA /* lookup_soft_elegance_2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = lookup_soft_elegance_2.png; path = ../../../../framework/Resources/lookup_soft_elegance_2.png; sourceTree = ""; }; E5530A35180FD1D500597F98 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; F2F3361D156585C400B0FBB8 /* voroni_points2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = voroni_points2.png; sourceTree = ""; }; F2F336261565906000B0FBB8 /* dotletterstiles.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = dotletterstiles.png; sourceTree = ""; }; F2F33628156591CA00B0FBB8 /* curvies.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = curvies.png; sourceTree = ""; }; F2F3362A156591DB00B0FBB8 /* squares.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = squares.png; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ BC982AFF14F046AC0001FF6F /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( BCF866CF1725A19A00912E34 /* libGPUImage.a in Frameworks */, 6BF3ED5715B5C2BF002F9E9E /* CoreImage.framework in Frameworks */, BC982B2614F048230001FF6F /* OpenGLES.framework in Frameworks */, BC982B2414F0481C0001FF6F /* AVFoundation.framework in Frameworks */, BC982B2014F048160001FF6F /* CoreMedia.framework in Frameworks */, BC982B2114F048160001FF6F /* CoreVideo.framework in Frameworks */, BC982B2214F048160001FF6F /* QuartzCore.framework in Frameworks */, BC982B0714F046AC0001FF6F /* UIKit.framework in Frameworks */, BC982B0914F046AC0001FF6F /* Foundation.framework in Frameworks */, BC982B0B14F046AC0001FF6F /* CoreGraphics.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ BC982AF714F046AC0001FF6F = { isa = PBXGroup; children = ( E5530A35180FD1D500597F98 /* Default-568h@2x.png */, BC982B0C14F046AC0001FF6F /* FilterShowcase */, BC982B0514F046AC0001FF6F /* Frameworks */, BC982B0314F046AC0001FF6F /* Products */, ); sourceTree = ""; }; BC982B0314F046AC0001FF6F /* Products */ = { isa = PBXGroup; children = ( BC982B0214F046AC0001FF6F /* FilterShowcase.app */, ); name = Products; sourceTree = ""; }; BC982B0514F046AC0001FF6F /* Frameworks */ = { isa = PBXGroup; children = ( BC982B2714F049950001FF6F /* GPUImage.xcodeproj */, 6BF3ED5615B5C2BF002F9E9E /* CoreImage.framework */, BC982B2514F048230001FF6F /* OpenGLES.framework */, BC982B2314F0481C0001FF6F /* AVFoundation.framework */, BC982B1D14F048160001FF6F /* CoreMedia.framework */, BC982B1E14F048160001FF6F /* CoreVideo.framework */, BC982B1F14F048160001FF6F /* QuartzCore.framework */, BC982B0614F046AC0001FF6F /* UIKit.framework */, BC982B0814F046AC0001FF6F /* Foundation.framework */, BC982B0A14F046AC0001FF6F /* CoreGraphics.framework */, ); name = Frameworks; sourceTree = ""; }; BC982B0C14F046AC0001FF6F /* FilterShowcase */ = { isa = PBXGroup; children = ( BC982B1514F046AC0001FF6F /* ShowcaseAppDelegate.h */, BC982B1614F046AC0001FF6F /* ShowcaseAppDelegate.m */, BC982B3D14F05DC10001FF6F /* ShowcaseFilterListController.h */, BC982B3E14F05DC10001FF6F /* ShowcaseFilterListController.m */, BC982B3514F04B3A0001FF6F /* ShowcaseFilterViewController.xib */, BC982B3314F04B3A0001FF6F /* ShowcaseFilterViewController.h */, BC982B3414F04B3A0001FF6F /* ShowcaseFilterViewController.m */, BC982C4014F1F6C80001FF6F /* CustomFilter.fsh */, BC982B0D14F046AC0001FF6F /* Supporting Files */, ); path = FilterShowcase; sourceTree = ""; }; BC982B0D14F046AC0001FF6F /* Supporting Files */ = { isa = PBXGroup; children = ( BCB3C3C016BCA2EB003D26B0 /* Icon-72.png */, BCB3C3C116BCA2EB003D26B0 /* Icon-72@2x.png */, BCB3C3C216BCA2EB003D26B0 /* Icon.png */, BCB3C3C316BCA2EB003D26B0 /* Icon@2x.png */, BCB3C3C416BCA2EB003D26B0 /* iTunesArtwork.png */, BCF9D9A715CCD1AF007E7FBA /* lookup_amatorka.png */, BCF9D9A815CCD1AF007E7FBA /* lookup_miss_etikate.png */, BCF9D9A915CCD1AF007E7FBA /* lookup_soft_elegance_1.png */, BCF9D9AA15CCD1AF007E7FBA /* lookup_soft_elegance_2.png */, F2F3362A156591DB00B0FBB8 /* squares.png */, F2F33628156591CA00B0FBB8 /* curvies.png */, F2F336261565906000B0FBB8 /* dotletterstiles.png */, F2F3361D156585C400B0FBB8 /* voroni_points2.png */, 83AE9FD31540F3CC00F7FC13 /* mask.png */, BC982BD014F1C0F00001FF6F /* WID-small.jpg */, BC982B0E14F046AC0001FF6F /* FilterShowcase-Info.plist */, BC982B0F14F046AC0001FF6F /* InfoPlist.strings */, BC982B1214F046AC0001FF6F /* main.m */, BC982B1414F046AC0001FF6F /* FilterShowcase-Prefix.pch */, 0D69488D1501F71900206FF8 /* SampleConfiguration.plist */, ); name = "Supporting Files"; sourceTree = ""; }; BCF866BE1725894100912E34 /* Products */ = { isa = PBXGroup; children = ( BCF866C41725894100912E34 /* libGPUImage.a */, BC7E93DC19EB2334006D23C3 /* GPUImage.framework */, ); name = Products; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ BC982B0114F046AC0001FF6F /* FilterShowcase */ = { isa = PBXNativeTarget; buildConfigurationList = BC982B1A14F046AC0001FF6F /* Build configuration list for PBXNativeTarget "FilterShowcase" */; buildPhases = ( BC982AFE14F046AC0001FF6F /* Sources */, BC982AFF14F046AC0001FF6F /* Frameworks */, BC982B0014F046AC0001FF6F /* Resources */, ); buildRules = ( ); dependencies = ( BCF866CE1725A19100912E34 /* PBXTargetDependency */, ); name = FilterShowcase; productName = FilterShowcase; productReference = BC982B0214F046AC0001FF6F /* FilterShowcase.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ BC982AF914F046AC0001FF6F /* Project object */ = { isa = PBXProject; attributes = { CLASSPREFIX = Showcase; LastUpgradeCheck = 0610; ORGANIZATIONNAME = "Cell Phone"; TargetAttributes = { BC982B0114F046AC0001FF6F = { DevelopmentTeam = J2U2U9GBML; }; }; }; buildConfigurationList = BC982AFC14F046AC0001FF6F /* Build configuration list for PBXProject "FilterShowcase" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, ); mainGroup = BC982AF714F046AC0001FF6F; productRefGroup = BC982B0314F046AC0001FF6F /* Products */; projectDirPath = ""; projectReferences = ( { ProductGroup = BCF866BE1725894100912E34 /* Products */; ProjectRef = BC982B2714F049950001FF6F /* GPUImage.xcodeproj */; }, ); projectRoot = ""; targets = ( BC982B0114F046AC0001FF6F /* FilterShowcase */, ); }; /* End PBXProject section */ /* Begin PBXReferenceProxy section */ BC7E93DC19EB2334006D23C3 /* GPUImage.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; path = GPUImage.framework; remoteRef = BC7E93DB19EB2334006D23C3 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; BCF866C41725894100912E34 /* libGPUImage.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = libGPUImage.a; remoteRef = BCF866C31725894100912E34 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ BC982B0014F046AC0001FF6F /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( BC982C4114F1F6C80001FF6F /* CustomFilter.fsh in Resources */, BC982B1114F046AC0001FF6F /* InfoPlist.strings in Resources */, BC982B3714F04B3A0001FF6F /* ShowcaseFilterViewController.xib in Resources */, BC982BD114F1C0F00001FF6F /* WID-small.jpg in Resources */, 0D69488E1501F71900206FF8 /* SampleConfiguration.plist in Resources */, 83AE9FD41540F3CC00F7FC13 /* mask.png in Resources */, F2F3361E156585C400B0FBB8 /* voroni_points2.png in Resources */, F2F336271565906000B0FBB8 /* dotletterstiles.png in Resources */, F2F33629156591CA00B0FBB8 /* curvies.png in Resources */, F2F3362B156591DB00B0FBB8 /* squares.png in Resources */, BCF9D9AB15CCD1AF007E7FBA /* lookup_amatorka.png in Resources */, BCF9D9AC15CCD1AF007E7FBA /* lookup_miss_etikate.png in Resources */, BCF9D9AD15CCD1AF007E7FBA /* lookup_soft_elegance_1.png in Resources */, E5530A36180FD1D500597F98 /* Default-568h@2x.png in Resources */, BCF9D9AE15CCD1AF007E7FBA /* lookup_soft_elegance_2.png in Resources */, BCB3C3C516BCA2EB003D26B0 /* Icon-72.png in Resources */, BCB3C3C616BCA2EB003D26B0 /* Icon-72@2x.png in Resources */, BCB3C3C716BCA2EB003D26B0 /* Icon.png in Resources */, BCB3C3C816BCA2EB003D26B0 /* Icon@2x.png in Resources */, BCB3C3C916BCA2EB003D26B0 /* iTunesArtwork.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ BC982AFE14F046AC0001FF6F /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( BC982B1314F046AC0001FF6F /* main.m in Sources */, BC982B1714F046AC0001FF6F /* ShowcaseAppDelegate.m in Sources */, BC982B3614F04B3A0001FF6F /* ShowcaseFilterViewController.m in Sources */, BC982B3F14F05DC20001FF6F /* ShowcaseFilterListController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ BCF866CE1725A19100912E34 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = GPUImage; targetProxy = BCF866CD1725A19100912E34 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ BC982B0F14F046AC0001FF6F /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( BC982B1014F046AC0001FF6F /* en */, ); name = InfoPlist.strings; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ BC982B1814F046AC0001FF6F /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; ENABLE_BITCODE = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ( ../../../framework/Source, ../../../framework/Source/iOS, ); IPHONEOS_DEPLOYMENT_TARGET = 4.3; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = "-ObjC"; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; BC982B1914F046AC0001FF6F /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; ENABLE_BITCODE = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ( ../../../framework/Source, ../../../framework/Source/iOS, ); IPHONEOS_DEPLOYMENT_TARGET = 4.3; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; OTHER_LDFLAGS = "-ObjC"; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; name = Release; }; BC982B1B14F046AC0001FF6F /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "FilterShowcase/FilterShowcase-Prefix.pch"; INFOPLIST_FILE = "FilterShowcase/FilterShowcase-Info.plist"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; WRAPPER_EXTENSION = app; }; name = Debug; }; BC982B1C14F046AC0001FF6F /* Release */ = { isa = XCBuildConfiguration; buildSettings = { CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "FilterShowcase/FilterShowcase-Prefix.pch"; INFOPLIST_FILE = "FilterShowcase/FilterShowcase-Info.plist"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; WRAPPER_EXTENSION = app; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ BC982AFC14F046AC0001FF6F /* Build configuration list for PBXProject "FilterShowcase" */ = { isa = XCConfigurationList; buildConfigurations = ( BC982B1814F046AC0001FF6F /* Debug */, BC982B1914F046AC0001FF6F /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; BC982B1A14F046AC0001FF6F /* Build configuration list for PBXNativeTarget "FilterShowcase" */ = { isa = XCConfigurationList; buildConfigurations = ( BC982B1B14F046AC0001FF6F /* Debug */, BC982B1C14F046AC0001FF6F /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = BC982AF914F046AC0001FF6F /* Project object */; } ================================================ FILE: examples/iOS/FilterShowcase/FilterShowcase.xcodeproj/xcshareddata/xcschemes/FilterShowcase.xcscheme ================================================ ================================================ FILE: examples/iOS/FilterShowcaseSwift/FilterShowcaseSwift/AppDelegate.swift ================================================ import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]?) -> Bool { return true } } ================================================ FILE: examples/iOS/FilterShowcaseSwift/FilterShowcaseSwift/Base.lproj/Main.storyboard ================================================ ================================================ FILE: examples/iOS/FilterShowcaseSwift/FilterShowcaseSwift/FilterDisplayViewController.swift ================================================ import UIKit import GPUImage class FilterDisplayViewController: UIViewController, UISplitViewControllerDelegate { @IBOutlet var filterSlider: UISlider? @IBOutlet var filterView: GPUImageView? let videoCamera: GPUImageVideoCamera var blendImage: GPUImagePicture? required init(coder aDecoder: NSCoder) { videoCamera = GPUImageVideoCamera(sessionPreset: AVCaptureSessionPreset640x480, cameraPosition: .Back) videoCamera.outputImageOrientation = .Portrait; super.init(coder: aDecoder)! } var filterOperation: FilterOperationInterface? { didSet { self.configureView() } } func configureView() { if let currentFilterConfiguration = self.filterOperation { self.title = currentFilterConfiguration.titleName // Configure the filter chain, ending with the view if let view = self.filterView { switch currentFilterConfiguration.filterOperationType { case .SingleInput: videoCamera.addTarget((currentFilterConfiguration.filter as! GPUImageInput)) currentFilterConfiguration.filter.addTarget(view) case .Blend: videoCamera.addTarget((currentFilterConfiguration.filter as! GPUImageInput)) let inputImage = UIImage(named:"WID-small.jpg") self.blendImage = GPUImagePicture(image: inputImage) self.blendImage?.addTarget((currentFilterConfiguration.filter as! GPUImageInput)) self.blendImage?.processImage() currentFilterConfiguration.filter.addTarget(view) case let .Custom(filterSetupFunction:setupFunction): let inputToFunction:(GPUImageOutput, GPUImageOutput?) = setupFunction(camera:videoCamera, outputView:view) // Type inference falls down, for now needs this hard cast currentFilterConfiguration.configureCustomFilter(inputToFunction) } videoCamera.startCameraCapture() } // Hide or display the slider, based on whether the filter needs it if let slider = self.filterSlider { switch currentFilterConfiguration.sliderConfiguration { case .Disabled: slider.hidden = true // case let .Enabled(minimumValue, initialValue, maximumValue, filterSliderCallback): case let .Enabled(minimumValue, maximumValue, initialValue): slider.minimumValue = minimumValue slider.maximumValue = maximumValue slider.value = initialValue slider.hidden = false self.updateSliderValue() } } } } @IBAction func updateSliderValue() { if let currentFilterConfiguration = self.filterOperation { switch (currentFilterConfiguration.sliderConfiguration) { case .Enabled(_, _, _): currentFilterConfiguration.updateBasedOnSliderValue(CGFloat(self.filterSlider!.value)) // If the UISlider isn't wired up, I want this to throw a runtime exception case .Disabled: break } } } override func viewDidLoad() { super.viewDidLoad() self.configureView() } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } } ================================================ FILE: examples/iOS/FilterShowcaseSwift/FilterShowcaseSwift/FilterListViewController.swift ================================================ import UIKit class FilterListViewController: UITableViewController { var filterDisplayViewController: FilterDisplayViewController? = nil var objects = NSMutableArray() // #pragma mark - Segues override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { if segue.identifier == "showDetail" { if let indexPath = self.tableView.indexPathForSelectedRow { let filterInList = filterOperations[indexPath.row] (segue.destinationViewController as! FilterDisplayViewController).filterOperation = filterInList } } } // #pragma mark - Table View override func numberOfSectionsInTableView(tableView: UITableView) -> Int { return 1 } override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return filterOperations.count } override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) let filterInList:FilterOperationInterface = filterOperations[indexPath.row] cell.textLabel?.text = filterInList.listName return cell } } ================================================ FILE: examples/iOS/FilterShowcaseSwift/FilterShowcaseSwift/FilterOperationTypes.swift ================================================ import Foundation import GPUImage enum FilterSliderSetting { case Disabled case Enabled(minimumValue:Float, maximumValue:Float, initialValue:Float) } #if os(iOS) typealias FilterSetupFunction = (camera:GPUImageVideoCamera, outputView:GPUImageView) -> (filter:GPUImageOutput, secondOutput:GPUImageOutput?) #else typealias FilterSetupFunction = (camera:GPUImageAVCamera, outputView:GPUImageView) -> (filter:GPUImageOutput, secondOutput:GPUImageOutput?) #endif enum FilterOperationType { case SingleInput case Blend case Custom(filterSetupFunction:FilterSetupFunction) } protocol FilterOperationInterface { var filter: GPUImageOutput { get } var listName: String { get } var titleName: String { get } var sliderConfiguration: FilterSliderSetting { get } var filterOperationType: FilterOperationType { get } func configureCustomFilter(input:(filter:GPUImageOutput, secondInput:GPUImageOutput?)) func updateBasedOnSliderValue(sliderValue:CGFloat) } class FilterOperation: FilterOperationInterface { var internalFilter: FilterClass? var secondInput: GPUImageOutput? let listName: String let titleName: String let sliderConfiguration: FilterSliderSetting let filterOperationType: FilterOperationType let sliderUpdateCallback: ((filter:FilterClass, sliderValue:CGFloat) -> ())? init(listName: String, titleName: String, sliderConfiguration: FilterSliderSetting, sliderUpdateCallback:((filter:FilterClass, sliderValue:CGFloat) -> ())?, filterOperationType: FilterOperationType) { self.listName = listName self.titleName = titleName self.sliderConfiguration = sliderConfiguration self.filterOperationType = filterOperationType self.sliderUpdateCallback = sliderUpdateCallback switch (filterOperationType) { case .Custom: break default: self.internalFilter = FilterClass() } } var filter: GPUImageOutput { return internalFilter! } func configureCustomFilter(input:(filter:GPUImageOutput, secondInput:GPUImageOutput?)) { self.internalFilter = (input.filter as! FilterClass) self.secondInput = input.secondInput } func updateBasedOnSliderValue(sliderValue:CGFloat) { if let updateFunction = sliderUpdateCallback { updateFunction(filter:internalFilter!, sliderValue:sliderValue) } } } ================================================ FILE: examples/iOS/FilterShowcaseSwift/FilterShowcaseSwift/FilterOperations.swift ================================================ import Foundation import GPUImage import QuartzCore #if os(iOS) import OpenGLES #else import OpenGL #endif let filterOperations: Array = [ FilterOperation ( listName:"Saturation", titleName:"Saturation", sliderConfiguration:.Enabled(minimumValue:0.0, maximumValue:2.0, initialValue:1.0), sliderUpdateCallback: {(filter, sliderValue) in filter.saturation = sliderValue }, filterOperationType:.SingleInput ), FilterOperation ( listName:"Contrast", titleName:"Contrast", sliderConfiguration:.Enabled(minimumValue:0.0, maximumValue:4.0, initialValue:1.0), sliderUpdateCallback: {(filter, sliderValue) in filter.contrast = sliderValue }, filterOperationType:.SingleInput ), FilterOperation ( listName:"Brightness", titleName:"Brightness", sliderConfiguration:.Enabled(minimumValue:-1.0, maximumValue:1.0, initialValue:0.0), sliderUpdateCallback: {(filter, sliderValue) in filter.brightness = sliderValue }, filterOperationType:.SingleInput ), FilterOperation ( listName:"Levels", titleName:"Levels", sliderConfiguration:.Enabled(minimumValue:0.0, maximumValue:1.0, initialValue:0.0), sliderUpdateCallback: {(filter, sliderValue) in filter.setRedMin(sliderValue, gamma:1.0, max:1.0, minOut:0.0, maxOut:1.0) filter.setGreenMin(sliderValue, gamma:1.0, max:1.0, minOut:0.0, maxOut:1.0) filter.setBlueMin(sliderValue, gamma:1.0, max:1.0, minOut:0.0, maxOut:1.0) }, filterOperationType:.SingleInput ), FilterOperation ( listName:"Exposure", titleName:"Exposure", sliderConfiguration:.Enabled(minimumValue:-4.0, maximumValue:4.0, initialValue:0.0), sliderUpdateCallback: {(filter, sliderValue) in filter.exposure = sliderValue }, filterOperationType:.SingleInput ), FilterOperation ( listName:"RGB", titleName:"RGB", sliderConfiguration:.Enabled(minimumValue:0.0, maximumValue:2.0, initialValue:1.0), sliderUpdateCallback: {(filter, sliderValue) in filter.green = sliderValue }, filterOperationType:.SingleInput ), FilterOperation ( listName:"Hue", titleName:"Hue", sliderConfiguration:.Enabled(minimumValue:0.0, maximumValue:360.0, initialValue:90.0), sliderUpdateCallback: {(filter, sliderValue) in filter.hue = sliderValue }, filterOperationType:.SingleInput ), FilterOperation ( listName:"White balance", titleName:"White Balance", sliderConfiguration:.Enabled(minimumValue:2500.0, maximumValue:7500.0, initialValue:5000.0), sliderUpdateCallback: {(filter, sliderValue) in filter.temperature = sliderValue }, filterOperationType:.SingleInput ), FilterOperation ( listName:"Monochrome", titleName:"Monochrome", sliderConfiguration:.Enabled(minimumValue:0.0, maximumValue:1.0, initialValue:1.0), sliderUpdateCallback: {(filter, sliderValue) in filter.intensity = sliderValue }, filterOperationType:.Custom(filterSetupFunction:{(camera, outputView) in let filter = GPUImageMonochromeFilter() camera.addTarget(filter) filter.addTarget(outputView) filter.color = GPUVector4(one:0.0, two:0.0, three:1.0, four:1.0) return (filter, nil) }) ), FilterOperation ( listName:"False color", titleName:"False Color", sliderConfiguration:.Disabled, sliderUpdateCallback:nil, filterOperationType:.SingleInput ), FilterOperation ( listName:"Sharpen", titleName:"Sharpen", sliderConfiguration:.Enabled(minimumValue:-1.0, maximumValue:4.0, initialValue:0.0), sliderUpdateCallback: {(filter, sliderValue) in filter.sharpness = sliderValue }, filterOperationType:.SingleInput ), FilterOperation ( listName:"Unsharp mask", titleName:"Unsharp Mask", sliderConfiguration:.Enabled(minimumValue:0.0, maximumValue:5.0, initialValue:1.0), sliderUpdateCallback: {(filter, sliderValue) in filter.intensity = sliderValue }, filterOperationType:.SingleInput ), FilterOperation ( listName:"Transform (2-D)", titleName:"Transform (2-D)", sliderConfiguration:.Enabled(minimumValue:0.0, maximumValue:6.28, initialValue:0.75), sliderUpdateCallback:{(filter, sliderValue) in filter.affineTransform = CGAffineTransformMakeRotation(sliderValue) }, filterOperationType:.SingleInput ), FilterOperation ( listName:"Transform (3-D)", titleName:"Transform (3-D)", sliderConfiguration:.Enabled(minimumValue:0.0, maximumValue:6.28, initialValue:0.75), sliderUpdateCallback:{(filter, sliderValue) in var perspectiveTransform = CATransform3DIdentity perspectiveTransform.m34 = 0.4 perspectiveTransform.m33 = 0.4 perspectiveTransform = CATransform3DScale(perspectiveTransform, 0.75, 0.75, 0.75) perspectiveTransform = CATransform3DRotate(perspectiveTransform, sliderValue, 0.0, 1.0, 0.0) filter.transform3D = perspectiveTransform }, filterOperationType:.SingleInput ), FilterOperation ( listName:"Crop", titleName:"Crop", sliderConfiguration:.Enabled(minimumValue:0.2, maximumValue:1.0, initialValue:0.25), sliderUpdateCallback:{(filter, sliderValue) in filter.cropRegion = CGRectMake(0.0, 0.0, 1.0, sliderValue) }, filterOperationType:.SingleInput ), FilterOperation ( listName:"Mask", titleName:"Mask", sliderConfiguration:.Disabled, sliderUpdateCallback:nil, filterOperationType:.Custom(filterSetupFunction:{(camera, outputView) in let filter = GPUImageMaskFilter() #if os(iOS) let inputImage = UIImage(named:"mask.png") #else let inputImage = NSImage(named:"mask.png") #endif let inputPicture = GPUImagePicture(image:inputImage) camera.addTarget(filter) inputPicture.addTarget(filter) inputPicture.processImage() filter.addTarget(outputView) filter.setBackgroundColorRed(0.0, green:1.0, blue:0.0, alpha:1.0) return (filter, inputPicture) }) ), FilterOperation ( listName:"Gamma", titleName:"Gamma", sliderConfiguration:.Enabled(minimumValue:0.0, maximumValue:3.0, initialValue:1.0), sliderUpdateCallback: {(filter, sliderValue) in filter.gamma = sliderValue }, filterOperationType:.SingleInput ), FilterOperation ( listName:"Tone curve", titleName:"Tone Curve", sliderConfiguration:.Enabled(minimumValue:0.0, maximumValue:1.0, initialValue:0.5), sliderUpdateCallback: {(filter, sliderValue) in #if os(iOS) filter.blueControlPoints = ([NSValue(CGPoint:CGPointMake(0.0, 0.0)), NSValue(CGPoint:CGPointMake(0.5, sliderValue)), NSValue(CGPoint:CGPointMake(1.0, 0.75))]) #else filter.blueControlPoints = ([NSValue(point:NSMakePoint(0.0, 0.0)), NSValue(point:NSMakePoint(0.5, sliderValue)), NSValue(point:NSMakePoint(1.0, 0.75))]) #endif }, filterOperationType:.SingleInput ), FilterOperation ( listName:"Highlights and shadows", titleName:"Highlights and Shadows", sliderConfiguration:.Enabled(minimumValue:0.0, maximumValue:1.0, initialValue:1.0), sliderUpdateCallback: {(filter, sliderValue) in filter.highlights = sliderValue }, filterOperationType:.SingleInput ), FilterOperation ( listName:"Haze / UV", titleName:"Haze / UV", sliderConfiguration:.Enabled(minimumValue:-0.2, maximumValue:0.2, initialValue:0.2), sliderUpdateCallback: {(filter, sliderValue) in filter.distance = sliderValue }, filterOperationType:.SingleInput ), FilterOperation ( listName:"Sepia tone", titleName:"Sepia Tone", sliderConfiguration:.Enabled(minimumValue:0.0, maximumValue:1.0, initialValue:1.0), sliderUpdateCallback: {(filter, sliderValue) in filter.intensity = sliderValue }, filterOperationType:.SingleInput ), FilterOperation ( listName:"Amatorka (Lookup)", titleName:"Amatorka (Lookup)", sliderConfiguration:.Disabled, sliderUpdateCallback: nil, filterOperationType:.SingleInput ), FilterOperation ( listName:"Miss Etikate (Lookup)", titleName:"Miss Etikate (Lookup)", sliderConfiguration:.Disabled, sliderUpdateCallback: nil, filterOperationType:.SingleInput ), FilterOperation ( listName:"Soft elegance (Lookup)", titleName:"Soft Elegance (Lookup)", sliderConfiguration:.Disabled, sliderUpdateCallback: nil, filterOperationType:.SingleInput ), FilterOperation ( listName:"Color invert", titleName:"Color Invert", sliderConfiguration:.Disabled, sliderUpdateCallback: nil, filterOperationType:.SingleInput ), FilterOperation ( listName:"Grayscale", titleName:"Grayscale", sliderConfiguration:.Disabled, sliderUpdateCallback: nil, filterOperationType:.SingleInput ), FilterOperation ( listName:"Histogram", titleName:"Histogram", sliderConfiguration:.Enabled(minimumValue:4.0, maximumValue:32.0, initialValue:16.0), sliderUpdateCallback: {(filter, sliderValue) in filter.downsamplingFactor = UInt(round(sliderValue)) }, filterOperationType:.Custom(filterSetupFunction: {(camera, outputView) in let filter = GPUImageHistogramFilter() let gammaFilter = GPUImageGammaFilter() let histogramGraph = GPUImageHistogramGenerator() histogramGraph.forceProcessingAtSize(CGSizeMake(256.0, 330.0)) let blendFilter = GPUImageAlphaBlendFilter() blendFilter.mix = 0.75 blendFilter.forceProcessingAtSize(CGSizeMake(256.0, 330.0)) camera.addTarget(gammaFilter) gammaFilter.addTarget(filter) camera.addTarget(blendFilter) filter.addTarget(histogramGraph) histogramGraph.addTarget(blendFilter) blendFilter.addTarget(outputView) return (filter, nil) }) ), FilterOperation ( listName:"Average color", titleName:"Average Color", sliderConfiguration:.Disabled, sliderUpdateCallback: nil, filterOperationType:.Custom(filterSetupFunction:{(camera, outputView) in let filter = GPUImageAverageColor() let colorGenerator = GPUImageSolidColorGenerator() colorGenerator.forceProcessingAtSize(outputView.sizeInPixels) filter.colorAverageProcessingFinishedBlock = {(redComponent, greenComponent, blueComponent, alphaComponent, frameTime) in colorGenerator.setColorRed(redComponent, green:greenComponent, blue:blueComponent, alpha:alphaComponent) // NSLog(@"Average color: %f, %f, %f, %f", redComponent, greenComponent, blueComponent, alphaComponent); } camera.addTarget(filter) colorGenerator.addTarget(outputView) return (filter, nil) }) ), FilterOperation ( listName:"Average luminosity", titleName:"Average Luminosity", sliderConfiguration:.Disabled, sliderUpdateCallback: nil, filterOperationType:.Custom(filterSetupFunction:{(camera, outputView) in let filter = GPUImageLuminosity() let colorGenerator = GPUImageSolidColorGenerator() colorGenerator.forceProcessingAtSize(outputView.sizeInPixels) filter.luminosityProcessingFinishedBlock = {(luminosity, frameTime) in colorGenerator.setColorRed(luminosity, green:luminosity, blue:luminosity, alpha:luminosity) // NSLog(@"Average color: %f, %f, %f, %f", redComponent, greenComponent, blueComponent, alphaComponent); } camera.addTarget(filter) colorGenerator.addTarget(outputView) return (filter, nil) }) ), FilterOperation ( listName:"Luminance threshold", titleName:"Luminance Threshold", sliderConfiguration:.Enabled(minimumValue:0.0, maximumValue:1.0, initialValue:0.5), sliderUpdateCallback: {(filter, sliderValue) in filter.threshold = sliderValue }, filterOperationType:.SingleInput ), FilterOperation ( listName:"Adaptive threshold", titleName:"Adaptive Threshold", sliderConfiguration:.Enabled(minimumValue:1.0, maximumValue:20.0, initialValue:1.0), sliderUpdateCallback: {(filter, sliderValue) in filter.blurRadiusInPixels = sliderValue }, filterOperationType:.SingleInput ), FilterOperation ( listName:"Average luminance threshold", titleName:"Avg. Lum. Threshold", sliderConfiguration:.Enabled(minimumValue:0.0, maximumValue:2.0, initialValue:1.0), sliderUpdateCallback: {(filter, sliderValue) in filter.thresholdMultiplier = sliderValue }, filterOperationType:.SingleInput ), FilterOperation ( listName:"Solarize", titleName:"Solarize", sliderConfiguration:.Enabled(minimumValue:0.0, maximumValue:1.0, initialValue:0.5), sliderUpdateCallback: {(filter, sliderValue) in filter.threshold = sliderValue }, filterOperationType:.SingleInput ), FilterOperation ( listName:"Pixellate", titleName:"Pixellate", sliderConfiguration:.Enabled(minimumValue:0.0, maximumValue:0.3, initialValue:0.05), sliderUpdateCallback: {(filter, sliderValue) in filter.fractionalWidthOfAPixel = sliderValue }, filterOperationType:.SingleInput ), FilterOperation ( listName:"Polar pixellate", titleName:"Polar Pixellate", sliderConfiguration:.Enabled(minimumValue:-0.1, maximumValue:0.1, initialValue:0.05), sliderUpdateCallback: {(filter, sliderValue) in filter.pixelSize = CGSizeMake(sliderValue, sliderValue) }, filterOperationType:.SingleInput ), FilterOperation ( listName:"Pixellate (position)", titleName:"Pixellate (position)", sliderConfiguration:.Enabled(minimumValue:0.0, maximumValue:0.5, initialValue:0.25), sliderUpdateCallback: {(filter, sliderValue) in filter.radius = sliderValue }, filterOperationType:.SingleInput ), FilterOperation ( listName:"Polka dot", titleName:"Polka Dot", sliderConfiguration:.Enabled(minimumValue:0.0, maximumValue:0.3, initialValue:0.05), sliderUpdateCallback: {(filter, sliderValue) in filter.fractionalWidthOfAPixel = sliderValue }, filterOperationType:.SingleInput ), FilterOperation ( listName:"Halftone", titleName:"Halftone", sliderConfiguration:.Enabled(minimumValue:0.0, maximumValue:0.05, initialValue:0.01), sliderUpdateCallback: {(filter, sliderValue) in filter.fractionalWidthOfAPixel = sliderValue }, filterOperationType:.SingleInput ), FilterOperation ( listName:"Crosshatch", titleName:"Crosshatch", sliderConfiguration:.Enabled(minimumValue:0.01, maximumValue:0.06, initialValue:0.03), sliderUpdateCallback: {(filter, sliderValue) in filter.crossHatchSpacing = sliderValue }, filterOperationType:.SingleInput ), FilterOperation ( listName:"Sobel edge detection", titleName:"Sobel Edge Detection", sliderConfiguration:.Enabled(minimumValue:0.0, maximumValue:1.0, initialValue:0.25), sliderUpdateCallback: {(filter, sliderValue) in filter.edgeStrength = sliderValue }, filterOperationType:.SingleInput ), FilterOperation ( listName:"Prewitt edge detection", titleName:"Prewitt Edge Detection", sliderConfiguration:.Enabled(minimumValue:0.0, maximumValue:1.0, initialValue:1.0), sliderUpdateCallback: {(filter, sliderValue) in filter.edgeStrength = sliderValue }, filterOperationType:.SingleInput ), FilterOperation ( listName:"Canny edge detection", titleName:"Canny Edge Detection", sliderConfiguration:.Enabled(minimumValue:0.0, maximumValue:1.0, initialValue:1.0), sliderUpdateCallback: {(filter, sliderValue) in filter.blurTexelSpacingMultiplier = sliderValue }, filterOperationType:.SingleInput ), FilterOperation ( listName:"Threshold edge detection", titleName:"Threshold Edge Detection", sliderConfiguration:.Enabled(minimumValue:0.0, maximumValue:1.0, initialValue:0.25), sliderUpdateCallback: {(filter, sliderValue) in filter.threshold = sliderValue }, filterOperationType:.SingleInput ), FilterOperation ( listName:"XY derivative", titleName:"XY Derivative", sliderConfiguration:.Disabled, sliderUpdateCallback: nil, filterOperationType:.SingleInput ), FilterOperation ( listName:"Harris corner detector", titleName:"Harris Corner Detector", sliderConfiguration:.Enabled(minimumValue:0.01, maximumValue:0.70, initialValue:0.20), sliderUpdateCallback: {(filter, sliderValue) in filter.threshold = sliderValue }, filterOperationType:.Custom(filterSetupFunction:{(camera, outputView) in let filter = GPUImageHarrisCornerDetectionFilter() let crosshairGenerator = GPUImageCrosshairGenerator() crosshairGenerator.crosshairWidth = 15.0 crosshairGenerator.forceProcessingAtSize(outputView.sizeInPixels) filter.cornersDetectedBlock = { (cornerArray:UnsafeMutablePointer, cornersDetected:UInt, frameTime:CMTime) in crosshairGenerator.renderCrosshairsFromArray(cornerArray, count:cornersDetected, frameTime:frameTime) } camera.addTarget(filter) let blendFilter = GPUImageAlphaBlendFilter() blendFilter.forceProcessingAtSize(outputView.sizeInPixels) let gammaFilter = GPUImageGammaFilter() camera.addTarget(gammaFilter) gammaFilter.addTarget(blendFilter) crosshairGenerator.addTarget(blendFilter) blendFilter.addTarget(outputView) return (filter, nil) }) ), FilterOperation ( listName:"Noble corner detector", titleName:"Noble Corner Detector", sliderConfiguration:.Enabled(minimumValue:0.01, maximumValue:0.70, initialValue:0.20), sliderUpdateCallback: {(filter, sliderValue) in filter.threshold = sliderValue }, filterOperationType:.Custom(filterSetupFunction:{(camera, outputView) in let filter = GPUImageNobleCornerDetectionFilter() let crosshairGenerator = GPUImageCrosshairGenerator() crosshairGenerator.crosshairWidth = 15.0 crosshairGenerator.forceProcessingAtSize(outputView.sizeInPixels) filter.cornersDetectedBlock = { (cornerArray:UnsafeMutablePointer, cornersDetected:UInt, frameTime:CMTime) in crosshairGenerator.renderCrosshairsFromArray(cornerArray, count:cornersDetected, frameTime:frameTime) } camera.addTarget(filter) let blendFilter = GPUImageAlphaBlendFilter() blendFilter.forceProcessingAtSize(outputView.sizeInPixels) let gammaFilter = GPUImageGammaFilter() camera.addTarget(gammaFilter) gammaFilter.addTarget(blendFilter) crosshairGenerator.addTarget(blendFilter) blendFilter.addTarget(outputView) return (filter, nil) }) ), FilterOperation ( listName:"Shi-Tomasi feature detection", titleName:"Shi-Tomasi Feature Detection", sliderConfiguration:.Enabled(minimumValue:0.01, maximumValue:0.70, initialValue:0.20), sliderUpdateCallback: {(filter, sliderValue) in filter.threshold = sliderValue }, filterOperationType:.Custom(filterSetupFunction:{(camera, outputView) in let filter = GPUImageShiTomasiFeatureDetectionFilter() let crosshairGenerator = GPUImageCrosshairGenerator() crosshairGenerator.crosshairWidth = 15.0 crosshairGenerator.forceProcessingAtSize(outputView.sizeInPixels) filter.cornersDetectedBlock = { (cornerArray:UnsafeMutablePointer, cornersDetected:UInt, frameTime:CMTime) in crosshairGenerator.renderCrosshairsFromArray(cornerArray, count:cornersDetected, frameTime:frameTime) } camera.addTarget(filter) let blendFilter = GPUImageAlphaBlendFilter() blendFilter.forceProcessingAtSize(outputView.sizeInPixels) let gammaFilter = GPUImageGammaFilter() camera.addTarget(gammaFilter) gammaFilter.addTarget(blendFilter) crosshairGenerator.addTarget(blendFilter) blendFilter.addTarget(outputView) return (filter, nil) }) ), FilterOperation ( listName:"Hough transform line detection", titleName:"Hough Transform Line Detection", sliderConfiguration:.Enabled(minimumValue:0.01, maximumValue:0.70, initialValue:0.60), sliderUpdateCallback: {(filter, sliderValue) in filter.lineDetectionThreshold = sliderValue }, filterOperationType:.Custom(filterSetupFunction:{(camera, outputView) in let filter = GPUImageHoughTransformLineDetector() let lineGenerator = GPUImageLineGenerator() lineGenerator.forceProcessingAtSize(outputView.sizeInPixels) lineGenerator.setLineColorRed(1.0, green:0.0, blue:0.0) filter.linesDetectedBlock = { (lineArray:UnsafeMutablePointer, linesDetected:UInt, frameTime:CMTime) in lineGenerator.renderLinesFromArray(lineArray, count:linesDetected, frameTime:frameTime) } camera.addTarget(filter) let blendFilter = GPUImageAlphaBlendFilter() blendFilter.forceProcessingAtSize(outputView.sizeInPixels) let gammaFilter = GPUImageGammaFilter() camera.addTarget(gammaFilter) gammaFilter.addTarget(blendFilter) lineGenerator.addTarget(blendFilter) blendFilter.addTarget(outputView) return (filter, nil) }) ), FilterOperation ( listName:"ColourFAST feature detector", titleName:"ColourFAST Feature Detector", sliderConfiguration:.Disabled, sliderUpdateCallback:nil, filterOperationType:.SingleInput ), FilterOperation ( listName:"Buffer", titleName:"Buffer", sliderConfiguration:.Disabled, sliderUpdateCallback: nil, filterOperationType:.Custom(filterSetupFunction:{(camera, outputView) in let filter = GPUImageBuffer() let blendFilter = GPUImageDifferenceBlendFilter() let gammaFilter = GPUImageGammaFilter() camera.addTarget(gammaFilter) gammaFilter.addTarget(blendFilter) camera.addTarget(filter) filter.addTarget(blendFilter) blendFilter.addTarget(outputView) return (filter, nil) }) ), FilterOperation ( listName:"Low pass", titleName:"Low Pass", sliderConfiguration:.Enabled(minimumValue:0.0, maximumValue:1.0, initialValue:0.5), sliderUpdateCallback: {(filter, sliderValue) in filter.filterStrength = sliderValue }, filterOperationType:.SingleInput ), FilterOperation ( listName:"High pass", titleName:"High Pass", sliderConfiguration:.Enabled(minimumValue:0.0, maximumValue:1.0, initialValue:0.5), sliderUpdateCallback: {(filter, sliderValue) in filter.filterStrength = sliderValue }, filterOperationType:.SingleInput ), // GPUIMAGE_MOTIONDETECTOR, FilterOperation ( listName:"Sketch", titleName:"Sketch", sliderConfiguration:.Enabled(minimumValue:0.0, maximumValue:1.0, initialValue:0.5), sliderUpdateCallback: {(filter, sliderValue) in filter.edgeStrength = sliderValue }, filterOperationType:.SingleInput ), FilterOperation ( listName:"Threshold Sketch", titleName:"Threshold Sketch", sliderConfiguration:.Enabled(minimumValue:0.0, maximumValue:1.0, initialValue:0.25), sliderUpdateCallback: {(filter, sliderValue) in filter.threshold = sliderValue }, filterOperationType:.SingleInput ), FilterOperation ( listName:"Toon", titleName:"Toon", sliderConfiguration:.Disabled, sliderUpdateCallback: nil, filterOperationType:.SingleInput ), FilterOperation ( listName:"Smooth toon", titleName:"Smooth Toon", sliderConfiguration:.Enabled(minimumValue:1.0, maximumValue:6.0, initialValue:1.0), sliderUpdateCallback: {(filter, sliderValue) in filter.blurRadiusInPixels = sliderValue }, filterOperationType:.SingleInput ), FilterOperation ( listName:"Tilt shift", titleName:"Tilt Shift", sliderConfiguration:.Enabled(minimumValue:0.2, maximumValue:0.8, initialValue:0.5), sliderUpdateCallback: {(filter, sliderValue) in filter.topFocusLevel = sliderValue - 0.1 filter.bottomFocusLevel = sliderValue + 0.1 }, filterOperationType:.SingleInput ), FilterOperation ( listName:"CGA colorspace", titleName:"CGA Colorspace", sliderConfiguration:.Disabled, sliderUpdateCallback: nil, filterOperationType:.SingleInput ), FilterOperation ( listName:"Posterize", titleName:"Posterize", sliderConfiguration:.Enabled(minimumValue:1.0, maximumValue:20.0, initialValue:10.0), sliderUpdateCallback: {(filter, sliderValue) in filter.colorLevels = UInt(round(sliderValue)) }, filterOperationType:.SingleInput ), FilterOperation ( listName:"3x3 convolution", titleName:"3x3 Convolution", sliderConfiguration:.Disabled, sliderUpdateCallback: nil, filterOperationType:.Custom(filterSetupFunction:{(camera, outputView) in let filter = GPUImage3x3ConvolutionFilter() camera.addTarget(filter) filter.addTarget(outputView) filter.convolutionKernel = GPUMatrix3x3( one:GPUVector3(one:-1.0, two:0.0, three:1.0), two:GPUVector3(one:-2.0, two:0.0, three:2.0), three:GPUVector3(one:-1.0, two:0.0, three:1.0)) return (filter, nil) }) ), FilterOperation ( listName:"Emboss", titleName:"Emboss", sliderConfiguration:.Enabled(minimumValue:0.0, maximumValue:5.0, initialValue:1.0), sliderUpdateCallback: {(filter, sliderValue) in filter.intensity = sliderValue }, filterOperationType:.SingleInput ), FilterOperation ( listName:"Laplacian", titleName:"Laplacian", sliderConfiguration:.Disabled, sliderUpdateCallback: nil, filterOperationType:.SingleInput ), FilterOperation ( listName:"Chroma key", titleName:"Chroma Key", sliderConfiguration:.Enabled(minimumValue:0.0, maximumValue:1.00, initialValue:0.40), sliderUpdateCallback: {(filter, sliderValue) in filter.thresholdSensitivity = sliderValue }, filterOperationType:.Custom(filterSetupFunction:{(camera, outputView) in let filter = GPUImageChromaKeyFilter() let blendFilter = GPUImageAlphaBlendFilter() blendFilter.mix = 1.0 #if os(iOS) let inputImage = UIImage(named:"WID-small.jpg") #else let inputImage = NSImage(named:"Lambeau.jpg") #endif let blendImage = GPUImagePicture(image: inputImage) camera.addTarget(filter) blendImage.addTarget(blendFilter) blendImage.processImage() filter.addTarget(blendFilter) blendFilter.addTarget(outputView) return (filter, blendImage) }) ), FilterOperation ( listName:"Kuwahara", titleName:"Kuwahara", sliderConfiguration:.Enabled(minimumValue:3.0, maximumValue:8.0, initialValue:3.0), sliderUpdateCallback: {(filter, sliderValue) in filter.radius = UInt(round(sliderValue)) }, filterOperationType:.SingleInput ), FilterOperation ( listName:"Kuwahara (radius 3)", titleName:"Kuwahara (Radius 3)", sliderConfiguration:.Disabled, sliderUpdateCallback: nil, filterOperationType:.SingleInput ), FilterOperation ( listName:"Vignette", titleName:"Vignette", sliderConfiguration:.Enabled(minimumValue:0.5, maximumValue:0.9, initialValue:0.75), sliderUpdateCallback: {(filter, sliderValue) in filter.vignetteEnd = sliderValue }, filterOperationType:.SingleInput ), FilterOperation ( listName:"Gaussian blur", titleName:"Gaussian Blur", sliderConfiguration:.Enabled(minimumValue:0.0, maximumValue:24.0, initialValue:2.0), sliderUpdateCallback: {(filter, sliderValue) in filter.blurRadiusInPixels = sliderValue }, filterOperationType:.SingleInput ), FilterOperation ( listName:"Selective Gaussian blur", titleName:"Selective Blur", sliderConfiguration:.Enabled(minimumValue:0.0, maximumValue:0.75, initialValue:40.0/320.0), sliderUpdateCallback: {(filter, sliderValue) in filter.excludeCircleRadius = sliderValue }, filterOperationType:.SingleInput ), FilterOperation ( listName:"Positional Gaussian blur", titleName:"Circular Blur", sliderConfiguration:.Enabled(minimumValue:0.0, maximumValue:0.75, initialValue:40.0/320.0), sliderUpdateCallback: {(filter, sliderValue) in filter.blurRadius = sliderValue }, filterOperationType:.SingleInput ), FilterOperation ( listName:"Box blur", titleName:"Box Blur", sliderConfiguration:.Enabled(minimumValue:0.0, maximumValue:24.0, initialValue:2.0), sliderUpdateCallback: {(filter, sliderValue) in filter.blurRadiusInPixels = sliderValue }, filterOperationType:.SingleInput ), FilterOperation ( listName:"Median", titleName:"Median", sliderConfiguration:.Disabled, sliderUpdateCallback: nil, filterOperationType:.SingleInput ), FilterOperation ( listName:"Bilateral blur", titleName:"Bilateral Blur", sliderConfiguration:.Enabled(minimumValue:0.0, maximumValue:10.0, initialValue:1.0), sliderUpdateCallback: {(filter, sliderValue) in filter.distanceNormalizationFactor = sliderValue }, filterOperationType:.SingleInput ), FilterOperation ( listName:"Motion blur", titleName:"Motion Blur", sliderConfiguration:.Enabled(minimumValue:0.0, maximumValue:180.0, initialValue:0.0), sliderUpdateCallback: {(filter, sliderValue) in filter.blurAngle = sliderValue }, filterOperationType:.SingleInput ), FilterOperation ( listName:"Zoom blur", titleName:"Zoom Blur", sliderConfiguration:.Enabled(minimumValue:0.0, maximumValue:2.5, initialValue:1.0), sliderUpdateCallback: {(filter, sliderValue) in filter.blurSize = sliderValue }, filterOperationType:.SingleInput ), // GPUIMAGE_IOSBLUR, FilterOperation ( listName:"Swirl", titleName:"Swirl", sliderConfiguration:.Enabled(minimumValue:0.0, maximumValue:2.0, initialValue:1.0), sliderUpdateCallback: {(filter, sliderValue) in filter.angle = sliderValue }, filterOperationType:.SingleInput ), FilterOperation ( listName:"Bulge", titleName:"Bulge", sliderConfiguration:.Enabled(minimumValue:-1.0, maximumValue:1.0, initialValue:0.5), sliderUpdateCallback: {(filter, sliderValue) in // filter.scale = sliderValue filter.center = CGPoint(x:0.5, y:sliderValue) }, filterOperationType:.SingleInput ), FilterOperation ( listName:"Pinch", titleName:"Pinch", sliderConfiguration:.Enabled(minimumValue:-2.0, maximumValue:2.0, initialValue:0.5), sliderUpdateCallback: {(filter, sliderValue) in filter.scale = sliderValue }, filterOperationType:.SingleInput ), FilterOperation ( listName:"Sphere refraction", titleName:"Sphere Refraction", sliderConfiguration:.Enabled(minimumValue:0.0, maximumValue:1.0, initialValue:0.15), sliderUpdateCallback:{(filter, sliderValue) in filter.radius = sliderValue }, filterOperationType:.Custom(filterSetupFunction:{(camera, outputView) in let filter = GPUImageSphereRefractionFilter() camera.addTarget(filter) // Provide a blurred image for a cool-looking background let gaussianBlur = GPUImageGaussianBlurFilter() camera.addTarget(gaussianBlur) gaussianBlur.blurRadiusInPixels = 5.0 let blendFilter = GPUImageAlphaBlendFilter() blendFilter.mix = 1.0 gaussianBlur.addTarget(blendFilter) filter.addTarget(blendFilter) blendFilter.addTarget(outputView) return (filter, nil) }) ), FilterOperation ( listName:"Glass sphere", titleName:"Glass Sphere", sliderConfiguration:.Enabled(minimumValue:0.0, maximumValue:1.0, initialValue:0.15), sliderUpdateCallback:{(filter, sliderValue) in filter.radius = sliderValue }, filterOperationType:.Custom(filterSetupFunction:{(camera, outputView) in let filter = GPUImageGlassSphereFilter() camera.addTarget(filter) // Provide a blurred image for a cool-looking background let gaussianBlur = GPUImageGaussianBlurFilter() camera.addTarget(gaussianBlur) gaussianBlur.blurRadiusInPixels = 5.0 let blendFilter = GPUImageAlphaBlendFilter() blendFilter.mix = 1.0 gaussianBlur.addTarget(blendFilter) filter.addTarget(blendFilter) blendFilter.addTarget(outputView) return (filter, nil) }) ), FilterOperation ( listName:"Stretch", titleName:"Stretch", sliderConfiguration:.Disabled, sliderUpdateCallback: nil, filterOperationType:.SingleInput ), FilterOperation ( listName:"Dilation", titleName:"Dilation", sliderConfiguration:.Disabled, sliderUpdateCallback: nil, filterOperationType:.SingleInput ), FilterOperation ( listName:"Erosion", titleName:"Erosion", sliderConfiguration:.Disabled, sliderUpdateCallback: nil, filterOperationType:.SingleInput ), FilterOperation ( listName:"Opening", titleName:"Opening", sliderConfiguration:.Disabled, sliderUpdateCallback: nil, filterOperationType:.SingleInput ), FilterOperation ( listName:"Closing", titleName:"Closing", sliderConfiguration:.Disabled, sliderUpdateCallback: nil, filterOperationType:.SingleInput ), // GPUIMAGE_PERLINNOISE, FilterOperation ( listName:"Voronoi", titleName:"Voronoi", sliderConfiguration:.Disabled, sliderUpdateCallback: nil, filterOperationType:.Custom(filterSetupFunction: {(camera, outputView) in let filter = GPUImageJFAVoronoiFilter() let consumerFilter = GPUImageVoronoiConsumerFilter() #if os(iOS) let voronoiPoints = UIImage(named:"voroni_points2.png") #else let voronoiPoints = NSImage(named:"voroni_points2.png") #endif let voronoiPointImage = GPUImagePicture(image:voronoiPoints) filter.sizeInPixels = CGSizeMake(1024.0, 1024.0) consumerFilter.sizeInPixels = CGSizeMake(1024.0, 1024.0) voronoiPointImage.addTarget(filter) camera.addTarget(consumerFilter) filter.addTarget(consumerFilter) voronoiPointImage.processImage() consumerFilter.addTarget(outputView) return (filter, voronoiPointImage) }) ), FilterOperation ( listName:"Mosaic", titleName:"Mosaic", sliderConfiguration:.Enabled(minimumValue:0.002, maximumValue:0.05, initialValue:0.025), sliderUpdateCallback:{(filter, sliderValue) in filter.displayTileSize = CGSizeMake(sliderValue, sliderValue) }, filterOperationType:.Custom(filterSetupFunction:{(camera, outputView) in let filter = GPUImageMosaicFilter() camera.addTarget(filter) filter.tileSet = "squares.png" filter.colorOn = false filter.addTarget(outputView) return (filter, nil) }) ), FilterOperation ( listName:"Local binary pattern", titleName:"Local Binary Pattern", sliderConfiguration:.Enabled(minimumValue:1.0, maximumValue:5.0, initialValue:1.0), sliderUpdateCallback: {(filter, sliderValue) in let filterSize = filter.outputFrameSize() filter.texelWidth = (sliderValue / filterSize.width) filter.texelHeight = (sliderValue / filterSize.height) }, filterOperationType:.SingleInput ), FilterOperation ( listName:"Local binary pattern (color)", titleName:"Local Binary Pattern (color)", sliderConfiguration:.Enabled(minimumValue:1.0, maximumValue:5.0, initialValue:1.0), sliderUpdateCallback: {(filter, sliderValue) in let filterSize = filter.outputFrameSize() filter.texelWidth = (sliderValue / filterSize.width) filter.texelHeight = (sliderValue / filterSize.height) }, filterOperationType:.SingleInput ), FilterOperation ( listName:"Dissolve blend", titleName:"Dissolve Blend", sliderConfiguration:.Enabled(minimumValue:0.0, maximumValue:1.0, initialValue:0.5), sliderUpdateCallback: {(filter, sliderValue) in filter.mix = sliderValue }, filterOperationType:.Blend ), FilterOperation ( listName:"Chroma key blend (green)", titleName:"Chroma Key (Green)", sliderConfiguration:.Enabled(minimumValue:0.0, maximumValue:1.0, initialValue:0.4), sliderUpdateCallback: {(filter, sliderValue) in filter.thresholdSensitivity = sliderValue }, filterOperationType:.Blend ), FilterOperation ( listName:"Add blend", titleName:"Add Blend", sliderConfiguration:.Disabled, sliderUpdateCallback: nil, filterOperationType:.Blend ), FilterOperation ( listName:"Divide blend", titleName:"Divide Blend", sliderConfiguration:.Disabled, sliderUpdateCallback: nil, filterOperationType:.Blend ), FilterOperation ( listName:"Multiply blend", titleName:"Multiply Blend", sliderConfiguration:.Disabled, sliderUpdateCallback: nil, filterOperationType:.Blend ), FilterOperation ( listName:"Overlay blend", titleName:"Overlay Blend", sliderConfiguration:.Disabled, sliderUpdateCallback: nil, filterOperationType:.Blend ), FilterOperation ( listName:"Lighten blend", titleName:"Lighten Blend", sliderConfiguration:.Disabled, sliderUpdateCallback: nil, filterOperationType:.Blend ), FilterOperation ( listName:"Darken blend", titleName:"Darken Blend", sliderConfiguration:.Disabled, sliderUpdateCallback: nil, filterOperationType:.Blend ), FilterOperation ( listName:"Color burn blend", titleName:"Color Burn Blend", sliderConfiguration:.Disabled, sliderUpdateCallback: nil, filterOperationType:.Blend ), FilterOperation ( listName:"Color dodge blend", titleName:"Color Dodge Blend", sliderConfiguration:.Disabled, sliderUpdateCallback: nil, filterOperationType:.Blend ), FilterOperation ( listName:"Linear burn blend", titleName:"Linear Burn Blend", sliderConfiguration:.Disabled, sliderUpdateCallback: nil, filterOperationType:.Blend ), FilterOperation ( listName:"Screen blend", titleName:"Screen Blend", sliderConfiguration:.Disabled, sliderUpdateCallback:nil, filterOperationType:.Blend ), FilterOperation ( listName:"Difference blend", titleName:"Difference Blend", sliderConfiguration:.Disabled, sliderUpdateCallback:nil, filterOperationType:.Blend ), FilterOperation ( listName:"Subtract blend", titleName:"Subtract Blend", sliderConfiguration:.Disabled, sliderUpdateCallback:nil, filterOperationType:.Blend ), FilterOperation ( listName:"Exclusion blend", titleName:"Exclusion Blend", sliderConfiguration:.Disabled, sliderUpdateCallback:nil, filterOperationType:.Blend ), FilterOperation ( listName:"Hard light blend", titleName:"Hard Light Blend", sliderConfiguration:.Disabled, sliderUpdateCallback:nil, filterOperationType:.Blend ), FilterOperation ( listName:"Soft light blend", titleName:"Soft Light Blend", sliderConfiguration:.Disabled, sliderUpdateCallback:nil, filterOperationType:.Blend ), FilterOperation ( listName:"Color blend", titleName:"Color Blend", sliderConfiguration:.Disabled, sliderUpdateCallback:nil, filterOperationType:.Blend ), FilterOperation ( listName:"Hue blend", titleName:"Hue Blend", sliderConfiguration:.Disabled, sliderUpdateCallback:nil, filterOperationType:.Blend ), FilterOperation ( listName:"Saturation blend", titleName:"Saturation Blend", sliderConfiguration:.Disabled, sliderUpdateCallback:nil, filterOperationType:.Blend ), FilterOperation ( listName:"Luminosity blend", titleName:"Luminosity Blend", sliderConfiguration:.Disabled, sliderUpdateCallback:nil, filterOperationType:.Blend ), FilterOperation ( listName:"Normal blend", titleName:"Normal Blend", sliderConfiguration:.Disabled, sliderUpdateCallback:nil, filterOperationType:.Blend ), FilterOperation ( listName:"Poisson blend", titleName:"Poisson Blend", sliderConfiguration:.Disabled, sliderUpdateCallback:nil, filterOperationType:.Blend ), // GPUIMAGE_OPACITY, // GPUIMAGE_CUSTOM, // GPUIMAGE_UIELEMENT, // GPUIMAGE_FILECONFIG, // GPUIMAGE_FILTERGROUP, // GPUIMAGE_FACES, ] ================================================ FILE: examples/iOS/FilterShowcaseSwift/FilterShowcaseSwift/Images.xcassets/AppIcon.appiconset/Contents.json ================================================ { "images" : [ { "idiom" : "iphone", "size" : "29x29", "scale" : "2x" }, { "idiom" : "iphone", "size" : "29x29", "scale" : "3x" }, { "idiom" : "iphone", "size" : "40x40", "scale" : "2x" }, { "idiom" : "iphone", "size" : "40x40", "scale" : "3x" }, { "idiom" : "iphone", "size" : "60x60", "scale" : "2x" }, { "idiom" : "iphone", "size" : "60x60", "scale" : "3x" }, { "idiom" : "ipad", "size" : "29x29", "scale" : "1x" }, { "idiom" : "ipad", "size" : "29x29", "scale" : "2x" }, { "idiom" : "ipad", "size" : "40x40", "scale" : "1x" }, { "idiom" : "ipad", "size" : "40x40", "scale" : "2x" }, { "idiom" : "ipad", "size" : "76x76", "scale" : "1x" }, { "idiom" : "ipad", "size" : "76x76", "scale" : "2x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: examples/iOS/FilterShowcaseSwift/FilterShowcaseSwift/Images.xcassets/LaunchImage.launchimage/Contents.json ================================================ { "images" : [ { "orientation" : "portrait", "idiom" : "iphone", "extent" : "full-screen", "minimum-system-version" : "7.0", "scale" : "2x" }, { "orientation" : "portrait", "idiom" : "iphone", "subtype" : "retina4", "extent" : "full-screen", "minimum-system-version" : "7.0", "scale" : "2x" }, { "orientation" : "portrait", "idiom" : "ipad", "extent" : "full-screen", "minimum-system-version" : "7.0", "scale" : "1x" }, { "orientation" : "landscape", "idiom" : "ipad", "extent" : "full-screen", "minimum-system-version" : "7.0", "scale" : "1x" }, { "orientation" : "portrait", "idiom" : "ipad", "extent" : "full-screen", "minimum-system-version" : "7.0", "scale" : "2x" }, { "orientation" : "landscape", "idiom" : "ipad", "extent" : "full-screen", "minimum-system-version" : "7.0", "scale" : "2x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: examples/iOS/FilterShowcaseSwift/FilterShowcaseSwift/Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName ${PRODUCT_NAME} CFBundlePackageType APPL CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion 1 LSRequiresIPhoneOS UIMainStoryboardFile Main UIRequiredDeviceCapabilities armv7 UIRequiresFullScreen UIStatusBarHidden UIStatusBarTintParameters UINavigationBar Style UIBarStyleDefault Translucent UISupportedInterfaceOrientations UIInterfaceOrientationPortrait ================================================ FILE: examples/iOS/FilterShowcaseSwift/FilterShowcaseSwift.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ BC0037BD195CA11B00B9D651 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = BC0037BC195CA11B00B9D651 /* AppDelegate.swift */; }; BC0037BF195CA11B00B9D651 /* FilterListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BC0037BE195CA11B00B9D651 /* FilterListViewController.swift */; }; BC0037C1195CA11B00B9D651 /* FilterDisplayViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BC0037C0195CA11B00B9D651 /* FilterDisplayViewController.swift */; }; BC0037C4195CA11B00B9D651 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BC0037C2195CA11B00B9D651 /* Main.storyboard */; }; BC0037C6195CA11B00B9D651 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BC0037C5195CA11B00B9D651 /* Images.xcassets */; }; BC0037EA195CC25D00B9D651 /* GPUImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC0037E7195CC24200B9D651 /* GPUImage.framework */; }; BC0037ED195CC54D00B9D651 /* GPUImage.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = BC0037E7195CC24200B9D651 /* GPUImage.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; BC0037EF195CC9E200B9D651 /* FilterOperations.swift in Sources */ = {isa = PBXBuildFile; fileRef = BC0037EE195CC9E200B9D651 /* FilterOperations.swift */; }; BC990323197C79050092A21B /* WID-small.jpg in Resources */ = {isa = PBXBuildFile; fileRef = BC990322197C79050092A21B /* WID-small.jpg */; }; BC990327197C79160092A21B /* mask.png in Resources */ = {isa = PBXBuildFile; fileRef = BC990326197C79160092A21B /* mask.png */; }; BC99032A197CCCF80092A21B /* squares.png in Resources */ = {isa = PBXBuildFile; fileRef = BC990328197CCCF80092A21B /* squares.png */; }; BC99032B197CCCF80092A21B /* voroni_points2.png in Resources */ = {isa = PBXBuildFile; fileRef = BC990329197CCCF80092A21B /* voroni_points2.png */; }; BC990330197CCD080092A21B /* lookup_amatorka.png in Resources */ = {isa = PBXBuildFile; fileRef = BC99032C197CCD080092A21B /* lookup_amatorka.png */; }; BC990331197CCD080092A21B /* lookup_miss_etikate.png in Resources */ = {isa = PBXBuildFile; fileRef = BC99032D197CCD080092A21B /* lookup_miss_etikate.png */; }; BC990332197CCD080092A21B /* lookup_soft_elegance_1.png in Resources */ = {isa = PBXBuildFile; fileRef = BC99032E197CCD080092A21B /* lookup_soft_elegance_1.png */; }; BC990333197CCD080092A21B /* lookup_soft_elegance_2.png in Resources */ = {isa = PBXBuildFile; fileRef = BC99032F197CCD080092A21B /* lookup_soft_elegance_2.png */; }; BCA01891195E503E004BC89E /* FilterOperationTypes.swift in Sources */ = {isa = PBXBuildFile; fileRef = BCA01890195E503E004BC89E /* FilterOperationTypes.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ BC0037E2195CC24200B9D651 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BC0037DB195CC24200B9D651 /* GPUImage.xcodeproj */; proxyType = 2; remoteGlobalIDString = BCF1A33414DDB1EC00852800; remoteInfo = GPUImage; }; BC0037E6195CC24200B9D651 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BC0037DB195CC24200B9D651 /* GPUImage.xcodeproj */; proxyType = 2; remoteGlobalIDString = BCE209E51943F20C002FEED8; remoteInfo = GPUImageFramework; }; BC0037E8195CC25500B9D651 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BC0037DB195CC24200B9D651 /* GPUImage.xcodeproj */; proxyType = 1; remoteGlobalIDString = BCE209E41943F20C002FEED8; remoteInfo = GPUImageFramework; }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ BC0037EC195CC54100B9D651 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( BC0037ED195CC54D00B9D651 /* GPUImage.framework in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ BC0037B7195CA11B00B9D651 /* FilterShowcaseSwift.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FilterShowcaseSwift.app; sourceTree = BUILT_PRODUCTS_DIR; }; BC0037BB195CA11B00B9D651 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; BC0037BC195CA11B00B9D651 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; BC0037BE195CA11B00B9D651 /* FilterListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FilterListViewController.swift; sourceTree = ""; }; BC0037C0195CA11B00B9D651 /* FilterDisplayViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FilterDisplayViewController.swift; sourceTree = ""; }; BC0037C3195CA11B00B9D651 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; BC0037C5195CA11B00B9D651 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; BC0037DB195CC24200B9D651 /* GPUImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = GPUImage.xcodeproj; path = ../../../framework/GPUImage.xcodeproj; sourceTree = ""; }; BC0037EE195CC9E200B9D651 /* FilterOperations.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FilterOperations.swift; sourceTree = ""; }; BC990322197C79050092A21B /* WID-small.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; name = "WID-small.jpg"; path = "../../SimpleImageFilter/SimpleImageFilter/WID-small.jpg"; sourceTree = ""; }; BC990326197C79160092A21B /* mask.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = mask.png; path = ../../FilterShowcase/FilterShowcase/mask.png; sourceTree = ""; }; BC990328197CCCF80092A21B /* squares.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = squares.png; path = ../../FilterShowcase/FilterShowcase/squares.png; sourceTree = ""; }; BC990329197CCCF80092A21B /* voroni_points2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = voroni_points2.png; path = ../../FilterShowcase/FilterShowcase/voroni_points2.png; sourceTree = ""; }; BC99032C197CCD080092A21B /* lookup_amatorka.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = lookup_amatorka.png; path = ../../../../framework/Resources/lookup_amatorka.png; sourceTree = ""; }; BC99032D197CCD080092A21B /* lookup_miss_etikate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = lookup_miss_etikate.png; path = ../../../../framework/Resources/lookup_miss_etikate.png; sourceTree = ""; }; BC99032E197CCD080092A21B /* lookup_soft_elegance_1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = lookup_soft_elegance_1.png; path = ../../../../framework/Resources/lookup_soft_elegance_1.png; sourceTree = ""; }; BC99032F197CCD080092A21B /* lookup_soft_elegance_2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = lookup_soft_elegance_2.png; path = ../../../../framework/Resources/lookup_soft_elegance_2.png; sourceTree = ""; }; BCA01890195E503E004BC89E /* FilterOperationTypes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FilterOperationTypes.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ BC0037B4195CA11B00B9D651 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( BC0037EA195CC25D00B9D651 /* GPUImage.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ BC0037AE195CA11B00B9D651 = { isa = PBXGroup; children = ( BC0037B9195CA11B00B9D651 /* User interface */, BCA018951960B031004BC89E /* Data model */, BC0037BA195CA11B00B9D651 /* Supporting Files */, BC0037DB195CC24200B9D651 /* GPUImage.xcodeproj */, BC0037B8195CA11B00B9D651 /* Products */, ); sourceTree = ""; }; BC0037B8195CA11B00B9D651 /* Products */ = { isa = PBXGroup; children = ( BC0037B7195CA11B00B9D651 /* FilterShowcaseSwift.app */, ); name = Products; sourceTree = ""; }; BC0037B9195CA11B00B9D651 /* User interface */ = { isa = PBXGroup; children = ( BC0037BC195CA11B00B9D651 /* AppDelegate.swift */, BC0037BE195CA11B00B9D651 /* FilterListViewController.swift */, BC0037C0195CA11B00B9D651 /* FilterDisplayViewController.swift */, BC0037C2195CA11B00B9D651 /* Main.storyboard */, ); name = "User interface"; path = FilterShowcaseSwift; sourceTree = ""; }; BC0037BA195CA11B00B9D651 /* Supporting Files */ = { isa = PBXGroup; children = ( BC99032C197CCD080092A21B /* lookup_amatorka.png */, BC99032D197CCD080092A21B /* lookup_miss_etikate.png */, BC99032E197CCD080092A21B /* lookup_soft_elegance_1.png */, BC99032F197CCD080092A21B /* lookup_soft_elegance_2.png */, BC990328197CCCF80092A21B /* squares.png */, BC990329197CCCF80092A21B /* voroni_points2.png */, BC990326197C79160092A21B /* mask.png */, BC990322197C79050092A21B /* WID-small.jpg */, BC0037C5195CA11B00B9D651 /* Images.xcassets */, BC0037BB195CA11B00B9D651 /* Info.plist */, ); name = "Supporting Files"; path = FilterShowcaseSwift; sourceTree = ""; }; BC0037DC195CC24200B9D651 /* Products */ = { isa = PBXGroup; children = ( BC0037E3195CC24200B9D651 /* libGPUImage.a */, BC0037E7195CC24200B9D651 /* GPUImage.framework */, ); name = Products; sourceTree = ""; }; BCA018951960B031004BC89E /* Data model */ = { isa = PBXGroup; children = ( BC0037EE195CC9E200B9D651 /* FilterOperations.swift */, BCA01890195E503E004BC89E /* FilterOperationTypes.swift */, ); name = "Data model"; path = FilterShowcaseSwift; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ BC0037B6195CA11B00B9D651 /* FilterShowcaseSwift */ = { isa = PBXNativeTarget; buildConfigurationList = BC0037D5195CA11B00B9D651 /* Build configuration list for PBXNativeTarget "FilterShowcaseSwift" */; buildPhases = ( BC0037B3195CA11B00B9D651 /* Sources */, BC0037B4195CA11B00B9D651 /* Frameworks */, BC0037B5195CA11B00B9D651 /* Resources */, BC0037EC195CC54100B9D651 /* CopyFiles */, ); buildRules = ( ); dependencies = ( BC0037E9195CC25500B9D651 /* PBXTargetDependency */, ); name = FilterShowcaseSwift; productName = FilterShowcaseSwift; productReference = BC0037B7195CA11B00B9D651 /* FilterShowcaseSwift.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ BC0037AF195CA11B00B9D651 /* Project object */ = { isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0700; LastUpgradeCheck = 0700; ORGANIZATIONNAME = "Sunset Lake Software"; TargetAttributes = { BC0037B6195CA11B00B9D651 = { CreatedOnToolsVersion = 6.0; }; }; }; buildConfigurationList = BC0037B2195CA11B00B9D651 /* Build configuration list for PBXProject "FilterShowcaseSwift" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); mainGroup = BC0037AE195CA11B00B9D651; productRefGroup = BC0037B8195CA11B00B9D651 /* Products */; projectDirPath = ""; projectReferences = ( { ProductGroup = BC0037DC195CC24200B9D651 /* Products */; ProjectRef = BC0037DB195CC24200B9D651 /* GPUImage.xcodeproj */; }, ); projectRoot = ""; targets = ( BC0037B6195CA11B00B9D651 /* FilterShowcaseSwift */, ); }; /* End PBXProject section */ /* Begin PBXReferenceProxy section */ BC0037E3195CC24200B9D651 /* libGPUImage.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = libGPUImage.a; remoteRef = BC0037E2195CC24200B9D651 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; BC0037E7195CC24200B9D651 /* GPUImage.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; path = GPUImage.framework; remoteRef = BC0037E6195CC24200B9D651 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ BC0037B5195CA11B00B9D651 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( BC990330197CCD080092A21B /* lookup_amatorka.png in Resources */, BC99032A197CCCF80092A21B /* squares.png in Resources */, BC990333197CCD080092A21B /* lookup_soft_elegance_2.png in Resources */, BC990323197C79050092A21B /* WID-small.jpg in Resources */, BC990332197CCD080092A21B /* lookup_soft_elegance_1.png in Resources */, BC0037C4195CA11B00B9D651 /* Main.storyboard in Resources */, BC0037C6195CA11B00B9D651 /* Images.xcassets in Resources */, BC990331197CCD080092A21B /* lookup_miss_etikate.png in Resources */, BC99032B197CCCF80092A21B /* voroni_points2.png in Resources */, BC990327197C79160092A21B /* mask.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ BC0037B3195CA11B00B9D651 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( BC0037C1195CA11B00B9D651 /* FilterDisplayViewController.swift in Sources */, BC0037BF195CA11B00B9D651 /* FilterListViewController.swift in Sources */, BC0037BD195CA11B00B9D651 /* AppDelegate.swift in Sources */, BCA01891195E503E004BC89E /* FilterOperationTypes.swift in Sources */, BC0037EF195CC9E200B9D651 /* FilterOperations.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ BC0037E9195CC25500B9D651 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = GPUImageFramework; targetProxy = BC0037E8195CC25500B9D651 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ BC0037C2195CA11B00B9D651 /* Main.storyboard */ = { isa = PBXVariantGroup; children = ( BC0037C3195CA11B00B9D651 /* Base */, ); name = Main.storyboard; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ BC0037D3195CA11B00B9D651 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; ENABLE_BITCODE = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 8.0; METAL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; BC0037D4195CA11B00B9D651 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; ENABLE_BITCODE = NO; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 8.0; METAL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; name = Release; }; BC0037D6195CA11B00B9D651 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; INFOPLIST_FILE = FilterShowcaseSwift/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.sunsetlakesoftware.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; }; BC0037D7195CA11B00B9D651 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; INFOPLIST_FILE = FilterShowcaseSwift/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.sunsetlakesoftware.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ BC0037B2195CA11B00B9D651 /* Build configuration list for PBXProject "FilterShowcaseSwift" */ = { isa = XCConfigurationList; buildConfigurations = ( BC0037D3195CA11B00B9D651 /* Debug */, BC0037D4195CA11B00B9D651 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; BC0037D5195CA11B00B9D651 /* Build configuration list for PBXNativeTarget "FilterShowcaseSwift" */ = { isa = XCConfigurationList; buildConfigurations = ( BC0037D6195CA11B00B9D651 /* Debug */, BC0037D7195CA11B00B9D651 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = BC0037AF195CA11B00B9D651 /* Project object */; } ================================================ FILE: examples/iOS/MultiViewFilterExample/MultiViewFilterExample/MultiViewAppDelegate.h ================================================ #import #import "MultiViewViewController.h" @interface MultiViewAppDelegate : UIResponder { MultiViewViewController *rootViewController; } @property (strong, nonatomic) UIWindow *window; @end ================================================ FILE: examples/iOS/MultiViewFilterExample/MultiViewFilterExample/MultiViewAppDelegate.m ================================================ #import "MultiViewAppDelegate.h" @implementation MultiViewAppDelegate @synthesize window = _window; - (void)dealloc { [_window release]; [super dealloc]; } - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; // Override point for customization after application launch. self.window.backgroundColor = [UIColor whiteColor]; rootViewController = [[MultiViewViewController alloc] initWithNibName:nil bundle:nil]; [self.window addSubview:rootViewController.view]; self.window.rootViewController = rootViewController; [self.window makeKeyAndVisible]; return YES; } - (void)applicationWillResignActive:(UIApplication *)application { /* Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. */ } - (void)applicationDidEnterBackground:(UIApplication *)application { /* Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. */ } - (void)applicationWillEnterForeground:(UIApplication *)application { /* Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. */ } - (void)applicationDidBecomeActive:(UIApplication *)application { /* Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. */ } - (void)applicationWillTerminate:(UIApplication *)application { /* Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. */ } @end ================================================ FILE: examples/iOS/MultiViewFilterExample/MultiViewFilterExample/MultiViewFilterExample-Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleDisplayName MultiView CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIconFiles CFBundleIdentifier com.sunsetlakesoftware.${PRODUCT_NAME:rfc1034identifier} CFBundleInfoDictionaryVersion 6.0 CFBundleName ${PRODUCT_NAME} CFBundlePackageType APPL CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion 1.0 LSRequiresIPhoneOS UIPrerenderedIcon UIRequiredDeviceCapabilities armv7 UISupportedInterfaceOrientations UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UISupportedInterfaceOrientations~ipad UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight ================================================ FILE: examples/iOS/MultiViewFilterExample/MultiViewFilterExample/MultiViewFilterExample-Prefix.pch ================================================ // // Prefix header for all source files of the 'MultiViewFilterExample' target in the 'MultiViewFilterExample' project // #import #ifndef __IPHONE_3_0 #warning "This project uses features only available in iOS SDK 3.0 and later." #endif #ifdef __OBJC__ #import #import #endif ================================================ FILE: examples/iOS/MultiViewFilterExample/MultiViewFilterExample/MultiViewViewController.h ================================================ #import #import "GPUImage.h" @interface MultiViewViewController : UIViewController { GPUImageView *view1, *view2, *view3, *view4; GPUImageVideoCamera *videoCamera; } @end ================================================ FILE: examples/iOS/MultiViewFilterExample/MultiViewFilterExample/MultiViewViewController.m ================================================ #import "MultiViewViewController.h" @implementation MultiViewViewController - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { } return self; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; } #pragma mark - View lifecycle - (void)loadView { CGRect mainScreenFrame = [[UIScreen mainScreen] applicationFrame]; UIView *primaryView = [[[UIView alloc] initWithFrame:mainScreenFrame] autorelease]; primaryView.backgroundColor = [UIColor blueColor]; self.view = primaryView; videoCamera = [[GPUImageVideoCamera alloc] initWithSessionPreset:AVCaptureSessionPreset640x480 cameraPosition:AVCaptureDevicePositionBack]; videoCamera.outputImageOrientation = UIInterfaceOrientationPortrait; CGFloat halfWidth = round(mainScreenFrame.size.width / 2.0); CGFloat halfHeight = round(mainScreenFrame.size.height / 2.0); view1 = [[GPUImageView alloc] initWithFrame:CGRectMake(0.0, 0.0, halfWidth, halfHeight)]; view2 = [[GPUImageView alloc] initWithFrame:CGRectMake(halfWidth, 0.0, halfWidth, halfHeight)]; view3 = [[GPUImageView alloc] initWithFrame:CGRectMake(0.0, halfHeight, halfWidth, halfHeight)]; view4 = [[GPUImageView alloc] initWithFrame:CGRectMake(halfWidth, halfHeight, halfWidth, halfHeight)]; [self.view addSubview:view1]; [self.view addSubview:view2]; [self.view addSubview:view3]; [self.view addSubview:view4]; GPUImageFilter *filter1 = [[[GPUImageFilter alloc] initWithFragmentShaderFromFile:@"Shader1"] autorelease]; GPUImageFilter *filter2 = [[[GPUImageFilter alloc] initWithFragmentShaderFromFile:@"Shader2"] autorelease]; GPUImageSepiaFilter *filter3 = [[[GPUImageSepiaFilter alloc] init] autorelease]; // GPUImageBrightnessFilter *filter1 = [[GPUImageBrightnessFilter alloc] init]; // GPUImageBrightnessFilter *filter2 = [[GPUImageBrightnessFilter alloc] init]; // [filter2 setBrightness:0.5]; // GPUImageBrightnessFilter *filter3 = [[GPUImageBrightnessFilter alloc] init]; // [filter3 setBrightness:-0.5]; // GPUImageSobelEdgeDetectionFilter *filter1 = [[GPUImageSobelEdgeDetectionFilter alloc] init]; // GPUImageSobelEdgeDetectionFilter *filter2 = [[GPUImageSobelEdgeDetectionFilter alloc] init]; // [filter2 setTexelHeight:(1.0 / 1024.0)]; // [filter2 setTexelWidth:(1.0 / 768.0)]; // GPUImageSobelEdgeDetectionFilter *filter3 = [[GPUImageSobelEdgeDetectionFilter alloc] init]; // [filter3 setTexelHeight:(1.0 / 200.0)]; // [filter3 setTexelWidth:(1.0 / 400.0)]; // GPUImageTransformFilter *filter1 = [[GPUImageTransformFilter alloc] init]; // GPUImageTransformFilter *filter2 = [[GPUImageTransformFilter alloc] init]; // CATransform3D perspectiveTransform = CATransform3DIdentity; // perspectiveTransform.m34 = 0.4; // perspectiveTransform.m33 = 0.4; // perspectiveTransform = CATransform3DScale(perspectiveTransform, 0.75, 0.75, 0.75); // perspectiveTransform = CATransform3DRotate(perspectiveTransform, 0.5, 0.0, 1.0, 0.0); // [filter2 setTransform3D:perspectiveTransform]; // GPUImageTransformFilter *filter3 = [[GPUImageTransformFilter alloc] init]; // [filter3 setAffineTransform:CGAffineTransformMakeRotation(1.0)]; // For thumbnails smaller than the input video size, we currently need to make them render at a smaller size. // This is to avoid wasting processing time on larger frames than will be displayed. // You'll need to use -forceProcessingAtSize: with a zero size to re-enable full frame processing of video. [filter1 forceProcessingAtSize:view2.sizeInPixels]; [filter2 forceProcessingAtSize:view3.sizeInPixels]; [filter3 forceProcessingAtSize:view4.sizeInPixels]; [videoCamera addTarget:view1]; [videoCamera addTarget:filter1]; [filter1 addTarget:view2]; [videoCamera addTarget:filter2]; [filter2 addTarget:view3]; [videoCamera addTarget:filter3]; [filter3 addTarget:view4]; [videoCamera startCameraCapture]; } - (void)viewDidUnload { [super viewDidUnload]; } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationPortrait); } @end ================================================ FILE: examples/iOS/MultiViewFilterExample/MultiViewFilterExample/Shader1.fsh ================================================ varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; void main() { lowp vec3 tc = vec3(1.0, 0.0, 0.0); lowp vec3 pixcol = texture2D(inputImageTexture, textureCoordinate).rgb; lowp vec3 colors[3]; colors[0] = vec3(0.0, 0.0, 1.0); colors[1] = vec3(1.0, 1.0, 0.0); colors[2] = vec3(1.0, 0.0, 0.0); mediump float lum = (pixcol.r + pixcol.g + pixcol.b) / 3.0; int ix = (lum < 0.5)? 0:1; tc = mix(colors[ix], colors[ix + 1], (lum - float(ix) * 0.5) / 0.5); gl_FragColor = vec4(tc, 1.0); } ================================================ FILE: examples/iOS/MultiViewFilterExample/MultiViewFilterExample/Shader2.fsh ================================================ varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; const highp vec2 sampleDivisor = vec2(0.1, 0.1); void main() { highp vec2 samplePos = textureCoordinate - mod(textureCoordinate, sampleDivisor); gl_FragColor = texture2D(inputImageTexture, samplePos ); } ================================================ FILE: examples/iOS/MultiViewFilterExample/MultiViewFilterExample/en.lproj/InfoPlist.strings ================================================ /* Localized versions of Info.plist keys */ ================================================ FILE: examples/iOS/MultiViewFilterExample/MultiViewFilterExample/main.m ================================================ #import #import "MultiViewAppDelegate.h" int main(int argc, char *argv[]) { @autoreleasepool { return UIApplicationMain(argc, argv, nil, NSStringFromClass([MultiViewAppDelegate class])); } } ================================================ FILE: examples/iOS/MultiViewFilterExample/MultiViewFilterExample.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ BC01CA8614E7620600967264 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC01CA8514E7620600967264 /* UIKit.framework */; }; BC01CA8814E7620600967264 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC01CA8714E7620600967264 /* Foundation.framework */; }; BC01CA8A14E7620600967264 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC01CA8914E7620600967264 /* CoreGraphics.framework */; }; BC01CA9014E7620600967264 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = BC01CA8E14E7620600967264 /* InfoPlist.strings */; }; BC01CA9214E7620600967264 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = BC01CA9114E7620600967264 /* main.m */; }; BC01CA9614E7620600967264 /* MultiViewAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = BC01CA9514E7620600967264 /* MultiViewAppDelegate.m */; }; BC01CAAC14E762E600967264 /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC01CAAB14E762E600967264 /* CoreMedia.framework */; }; BC01CAAE14E762EE00967264 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC01CAAD14E762EE00967264 /* CoreVideo.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; BC01CAB014E762F600967264 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC01CAAF14E762F600967264 /* QuartzCore.framework */; }; BC01CAB214E762FD00967264 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC01CAB114E762FD00967264 /* OpenGLES.framework */; }; BC01CAB514E763FC00967264 /* MultiViewViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BC01CAB414E763FC00967264 /* MultiViewViewController.m */; }; BC3145C814E76BA700824EA0 /* Shader1.fsh in Resources */ = {isa = PBXBuildFile; fileRef = BC3145C614E76BA700824EA0 /* Shader1.fsh */; }; BC3145C914E76BA700824EA0 /* Shader2.fsh in Resources */ = {isa = PBXBuildFile; fileRef = BC3145C714E76BA700824EA0 /* Shader2.fsh */; }; BCB3C40616BCA69F003D26B0 /* Icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C40116BCA69F003D26B0 /* Icon-72.png */; }; BCB3C40716BCA69F003D26B0 /* Icon-72@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C40216BCA69F003D26B0 /* Icon-72@2x.png */; }; BCB3C40816BCA69F003D26B0 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C40316BCA69F003D26B0 /* Icon.png */; }; BCB3C40916BCA69F003D26B0 /* Icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C40416BCA69F003D26B0 /* Icon@2x.png */; }; BCB3C40A16BCA69F003D26B0 /* iTunesArtwork.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C40516BCA69F003D26B0 /* iTunesArtwork.png */; }; BCB5DD6614E76CD2000AF3C2 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB5DD6514E76CD2000AF3C2 /* AVFoundation.framework */; }; BCF867101725A58F00912E34 /* libGPUImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BCF8670B1725A56D00912E34 /* libGPUImage.a */; }; E5066F471855A86D008C7682 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E5066F461855A86D008C7682 /* Default-568h@2x.png */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ BCE5A96D19EB27BF00EBFD33 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BC01CA9C14E762BE00967264 /* GPUImage.xcodeproj */; proxyType = 2; remoteGlobalIDString = BCE209E51943F20C002FEED8; remoteInfo = GPUImageFramework; }; BCF8670A1725A56D00912E34 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BC01CA9C14E762BE00967264 /* GPUImage.xcodeproj */; proxyType = 2; remoteGlobalIDString = BCF1A33414DDB1EC00852800; remoteInfo = GPUImage; }; BCF8670E1725A58A00912E34 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BC01CA9C14E762BE00967264 /* GPUImage.xcodeproj */; proxyType = 1; remoteGlobalIDString = BCF1A33314DDB1EC00852800; remoteInfo = GPUImage; }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ BC01CA8114E7620600967264 /* MultiViewFilterExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MultiViewFilterExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; BC01CA8514E7620600967264 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; BC01CA8714E7620600967264 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; BC01CA8914E7620600967264 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; BC01CA8D14E7620600967264 /* MultiViewFilterExample-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "MultiViewFilterExample-Info.plist"; sourceTree = ""; }; BC01CA8F14E7620600967264 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; BC01CA9114E7620600967264 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; BC01CA9314E7620600967264 /* MultiViewFilterExample-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MultiViewFilterExample-Prefix.pch"; sourceTree = ""; }; BC01CA9414E7620600967264 /* MultiViewAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MultiViewAppDelegate.h; sourceTree = ""; }; BC01CA9514E7620600967264 /* MultiViewAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MultiViewAppDelegate.m; sourceTree = ""; }; BC01CA9C14E762BE00967264 /* GPUImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = GPUImage.xcodeproj; path = ../../../framework/GPUImage.xcodeproj; sourceTree = ""; }; BC01CAAB14E762E600967264 /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; }; BC01CAAD14E762EE00967264 /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = System/Library/Frameworks/CoreVideo.framework; sourceTree = SDKROOT; }; BC01CAAF14E762F600967264 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; BC01CAB114E762FD00967264 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; BC01CAB314E763FC00967264 /* MultiViewViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MultiViewViewController.h; sourceTree = ""; }; BC01CAB414E763FC00967264 /* MultiViewViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MultiViewViewController.m; sourceTree = ""; }; BC3145C614E76BA700824EA0 /* Shader1.fsh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = Shader1.fsh; sourceTree = ""; }; BC3145C714E76BA700824EA0 /* Shader2.fsh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = Shader2.fsh; sourceTree = ""; }; BCB3C40116BCA69F003D26B0 /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-72.png"; path = "../../SharedIcons/Icon-72.png"; sourceTree = ""; }; BCB3C40216BCA69F003D26B0 /* Icon-72@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-72@2x.png"; path = "../../SharedIcons/Icon-72@2x.png"; sourceTree = ""; }; BCB3C40316BCA69F003D26B0 /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Icon.png; path = ../../SharedIcons/Icon.png; sourceTree = ""; }; BCB3C40416BCA69F003D26B0 /* Icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon@2x.png"; path = "../../SharedIcons/Icon@2x.png"; sourceTree = ""; }; BCB3C40516BCA69F003D26B0 /* iTunesArtwork.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = iTunesArtwork.png; path = ../../SharedIcons/iTunesArtwork.png; sourceTree = ""; }; BCB5DD6514E76CD2000AF3C2 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; E5066F461855A86D008C7682 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ BC01CA7E14E7620600967264 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( BCF867101725A58F00912E34 /* libGPUImage.a in Frameworks */, BCB5DD6614E76CD2000AF3C2 /* AVFoundation.framework in Frameworks */, BC01CAB214E762FD00967264 /* OpenGLES.framework in Frameworks */, BC01CAB014E762F600967264 /* QuartzCore.framework in Frameworks */, BC01CAAE14E762EE00967264 /* CoreVideo.framework in Frameworks */, BC01CAAC14E762E600967264 /* CoreMedia.framework in Frameworks */, BC01CA8614E7620600967264 /* UIKit.framework in Frameworks */, BC01CA8814E7620600967264 /* Foundation.framework in Frameworks */, BC01CA8A14E7620600967264 /* CoreGraphics.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ BC01CA7614E7620600967264 = { isa = PBXGroup; children = ( E5066F461855A86D008C7682 /* Default-568h@2x.png */, BC01CA8B14E7620600967264 /* MultiViewFilterExample */, BC01CA8414E7620600967264 /* Frameworks */, BC01CA8214E7620600967264 /* Products */, ); sourceTree = ""; }; BC01CA8214E7620600967264 /* Products */ = { isa = PBXGroup; children = ( BC01CA8114E7620600967264 /* MultiViewFilterExample.app */, ); name = Products; sourceTree = ""; }; BC01CA8414E7620600967264 /* Frameworks */ = { isa = PBXGroup; children = ( BC01CA9C14E762BE00967264 /* GPUImage.xcodeproj */, BC01CAB114E762FD00967264 /* OpenGLES.framework */, BC01CAAF14E762F600967264 /* QuartzCore.framework */, BC01CAAD14E762EE00967264 /* CoreVideo.framework */, BC01CAAB14E762E600967264 /* CoreMedia.framework */, BC01CA8514E7620600967264 /* UIKit.framework */, BC01CA8714E7620600967264 /* Foundation.framework */, BC01CA8914E7620600967264 /* CoreGraphics.framework */, BCB5DD6514E76CD2000AF3C2 /* AVFoundation.framework */, ); name = Frameworks; sourceTree = ""; }; BC01CA8B14E7620600967264 /* MultiViewFilterExample */ = { isa = PBXGroup; children = ( BC01CA9414E7620600967264 /* MultiViewAppDelegate.h */, BC01CA9514E7620600967264 /* MultiViewAppDelegate.m */, BC01CAB314E763FC00967264 /* MultiViewViewController.h */, BC01CAB414E763FC00967264 /* MultiViewViewController.m */, BC3145C614E76BA700824EA0 /* Shader1.fsh */, BC3145C714E76BA700824EA0 /* Shader2.fsh */, BC01CA8C14E7620600967264 /* Supporting Files */, ); path = MultiViewFilterExample; sourceTree = ""; }; BC01CA8C14E7620600967264 /* Supporting Files */ = { isa = PBXGroup; children = ( BCB3C40116BCA69F003D26B0 /* Icon-72.png */, BCB3C40216BCA69F003D26B0 /* Icon-72@2x.png */, BCB3C40316BCA69F003D26B0 /* Icon.png */, BCB3C40416BCA69F003D26B0 /* Icon@2x.png */, BCB3C40516BCA69F003D26B0 /* iTunesArtwork.png */, BC01CA8D14E7620600967264 /* MultiViewFilterExample-Info.plist */, BC01CA8E14E7620600967264 /* InfoPlist.strings */, BC01CA9114E7620600967264 /* main.m */, BC01CA9314E7620600967264 /* MultiViewFilterExample-Prefix.pch */, ); name = "Supporting Files"; sourceTree = ""; }; BCF867051725A56D00912E34 /* Products */ = { isa = PBXGroup; children = ( BCF8670B1725A56D00912E34 /* libGPUImage.a */, BCE5A96E19EB27BF00EBFD33 /* GPUImage.framework */, ); name = Products; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ BC01CA8014E7620600967264 /* MultiViewFilterExample */ = { isa = PBXNativeTarget; buildConfigurationList = BC01CA9914E7620600967264 /* Build configuration list for PBXNativeTarget "MultiViewFilterExample" */; buildPhases = ( BC01CA7D14E7620600967264 /* Sources */, BC01CA7E14E7620600967264 /* Frameworks */, BC01CA7F14E7620600967264 /* Resources */, ); buildRules = ( ); dependencies = ( BCF8670F1725A58A00912E34 /* PBXTargetDependency */, ); name = MultiViewFilterExample; productName = MultiViewFilterExample; productReference = BC01CA8114E7620600967264 /* MultiViewFilterExample.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ BC01CA7814E7620600967264 /* Project object */ = { isa = PBXProject; attributes = { LastUpgradeCheck = 0500; ORGANIZATIONNAME = "Cell Phone"; }; buildConfigurationList = BC01CA7B14E7620600967264 /* Build configuration list for PBXProject "MultiViewFilterExample" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, ); mainGroup = BC01CA7614E7620600967264; productRefGroup = BC01CA8214E7620600967264 /* Products */; projectDirPath = ""; projectReferences = ( { ProductGroup = BCF867051725A56D00912E34 /* Products */; ProjectRef = BC01CA9C14E762BE00967264 /* GPUImage.xcodeproj */; }, ); projectRoot = ""; targets = ( BC01CA8014E7620600967264 /* MultiViewFilterExample */, ); }; /* End PBXProject section */ /* Begin PBXReferenceProxy section */ BCE5A96E19EB27BF00EBFD33 /* GPUImage.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; path = GPUImage.framework; remoteRef = BCE5A96D19EB27BF00EBFD33 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; BCF8670B1725A56D00912E34 /* libGPUImage.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = libGPUImage.a; remoteRef = BCF8670A1725A56D00912E34 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ BC01CA7F14E7620600967264 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( BC01CA9014E7620600967264 /* InfoPlist.strings in Resources */, BC3145C814E76BA700824EA0 /* Shader1.fsh in Resources */, E5066F471855A86D008C7682 /* Default-568h@2x.png in Resources */, BC3145C914E76BA700824EA0 /* Shader2.fsh in Resources */, BCB3C40616BCA69F003D26B0 /* Icon-72.png in Resources */, BCB3C40716BCA69F003D26B0 /* Icon-72@2x.png in Resources */, BCB3C40816BCA69F003D26B0 /* Icon.png in Resources */, BCB3C40916BCA69F003D26B0 /* Icon@2x.png in Resources */, BCB3C40A16BCA69F003D26B0 /* iTunesArtwork.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ BC01CA7D14E7620600967264 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( BC01CA9214E7620600967264 /* main.m in Sources */, BC01CA9614E7620600967264 /* MultiViewAppDelegate.m in Sources */, BC01CAB514E763FC00967264 /* MultiViewViewController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ BCF8670F1725A58A00912E34 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = GPUImage; targetProxy = BCF8670E1725A58A00912E34 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ BC01CA8E14E7620600967264 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( BC01CA8F14E7620600967264 /* en */, ); name = InfoPlist.strings; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ BC01CA9714E7620600967264 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; FRAMEWORK_SEARCH_PATHS = ""; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "../../../framework/**"; IPHONEOS_DEPLOYMENT_TARGET = 4.3; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = "-fobjc-arc"; PROVISIONING_PROFILE = ""; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; BC01CA9814E7620600967264 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; FRAMEWORK_SEARCH_PATHS = ""; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "../../../framework/**"; IPHONEOS_DEPLOYMENT_TARGET = 4.3; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; OTHER_LDFLAGS = "-fobjc-arc"; PROVISIONING_PROFILE = ""; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; name = Release; }; BC01CA9A14E7620600967264 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "MultiViewFilterExample/MultiViewFilterExample-Prefix.pch"; INFOPLIST_FILE = "MultiViewFilterExample/MultiViewFilterExample-Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 4.3; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; name = Debug; }; BC01CA9B14E7620600967264 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "MultiViewFilterExample/MultiViewFilterExample-Prefix.pch"; INFOPLIST_FILE = "MultiViewFilterExample/MultiViewFilterExample-Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 4.3; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ BC01CA7B14E7620600967264 /* Build configuration list for PBXProject "MultiViewFilterExample" */ = { isa = XCConfigurationList; buildConfigurations = ( BC01CA9714E7620600967264 /* Debug */, BC01CA9814E7620600967264 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; BC01CA9914E7620600967264 /* Build configuration list for PBXNativeTarget "MultiViewFilterExample" */ = { isa = XCConfigurationList; buildConfigurations = ( BC01CA9A14E7620600967264 /* Debug */, BC01CA9B14E7620600967264 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = BC01CA7814E7620600967264 /* Project object */; } ================================================ FILE: examples/iOS/MultiViewFilterExample/MultiViewFilterExample.xcodeproj/xcshareddata/xcschemes/MultiViewFilterExample.xcscheme ================================================ ================================================ FILE: examples/iOS/RawDataTest/RawDataTest/CalculationShader.fsh ================================================ varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform lowp float gamma; void main() { lowp vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); gl_FragColor = textureColor; } ================================================ FILE: examples/iOS/RawDataTest/RawDataTest/RawDataTest-Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleDisplayName ${PRODUCT_NAME} CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier com.sunsetlakesoftware.${PRODUCT_NAME:rfc1034identifier} CFBundleInfoDictionaryVersion 6.0 CFBundleName ${PRODUCT_NAME} CFBundlePackageType APPL CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion 1.0 LSRequiresIPhoneOS UIPrerenderedIcon UIRequiredDeviceCapabilities armv7 UISupportedInterfaceOrientations UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UISupportedInterfaceOrientations~ipad UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight ================================================ FILE: examples/iOS/RawDataTest/RawDataTest/RawDataTest-Prefix.pch ================================================ // // Prefix header for all source files of the 'RawDataTest' target in the 'RawDataTest' project // #import #ifndef __IPHONE_3_0 #warning "This project uses features only available in iOS SDK 3.0 and later." #endif #ifdef __OBJC__ #import #import #endif ================================================ FILE: examples/iOS/RawDataTest/RawDataTest/RawDataTestAppDelegate.h ================================================ #import "GPUImage.h" #import @interface RawDataTestAppDelegate : UIResponder @property (strong, nonatomic) UIWindow *window; @end ================================================ FILE: examples/iOS/RawDataTest/RawDataTest/RawDataTestAppDelegate.m ================================================ #import "RawDataTestAppDelegate.h" @implementation RawDataTestAppDelegate @synthesize window = _window; - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // Override point for customization after application launch. self.window.backgroundColor = [UIColor whiteColor]; [self.window makeKeyAndVisible]; GLubyte *rawDataBytes = calloc(10 * 10 * 4, sizeof(GLubyte)); for (unsigned int yIndex = 0; yIndex < 10; yIndex++) { for (unsigned int xIndex = 0; xIndex < 10; xIndex++) { rawDataBytes[yIndex * 10 * 4 + xIndex * 4] = xIndex; rawDataBytes[yIndex * 10 * 4 + xIndex * 4 + 1] = yIndex; rawDataBytes[yIndex * 10 * 4 + xIndex * 4 + 2] = 255; rawDataBytes[yIndex * 10 * 4 + xIndex * 4 + 3] = 0; } } GPUImageRawDataInput *rawDataInput = [[GPUImageRawDataInput alloc] initWithBytes:rawDataBytes size:CGSizeMake(10.0, 10.0)]; GPUImageFilter *customFilter = [[GPUImageFilter alloc] initWithFragmentShaderFromFile:@"CalculationShader"]; GPUImageRawDataOutput *rawDataOutput = [[GPUImageRawDataOutput alloc] initWithImageSize:CGSizeMake(10.0, 10.0) resultsInBGRAFormat:YES]; [rawDataInput addTarget:customFilter]; [customFilter addTarget:rawDataOutput]; __unsafe_unretained GPUImageRawDataOutput * weakOutput = rawDataOutput; [rawDataOutput setNewFrameAvailableBlock:^{ [weakOutput lockFramebufferForReading]; GLubyte *outputBytes = [weakOutput rawBytesForImage]; NSInteger bytesPerRow = [weakOutput bytesPerRowInOutput]; NSLog(@"Bytes per row: %ld", (unsigned long)bytesPerRow); for (unsigned int yIndex = 0; yIndex < 10; yIndex++) { for (unsigned int xIndex = 0; xIndex < 10; xIndex++) { NSLog(@"Byte at (%d, %d): %d, %d, %d, %d", xIndex, yIndex, outputBytes[yIndex * bytesPerRow + xIndex * 4], outputBytes[yIndex * bytesPerRow + xIndex * 4 + 1], outputBytes[yIndex * bytesPerRow + xIndex * 4 + 2], outputBytes[yIndex * bytesPerRow + xIndex * 4 + 3]); } } [weakOutput unlockFramebufferAfterReading]; }]; [rawDataInput processData]; free(rawDataBytes); return YES; } @end ================================================ FILE: examples/iOS/RawDataTest/RawDataTest/en.lproj/InfoPlist.strings ================================================ /* Localized versions of Info.plist keys */ ================================================ FILE: examples/iOS/RawDataTest/RawDataTest/main.m ================================================ #import #import "RawDataTestAppDelegate.h" int main(int argc, char *argv[]) { @autoreleasepool { return UIApplicationMain(argc, argv, nil, NSStringFromClass([RawDataTestAppDelegate class])); } } ================================================ FILE: examples/iOS/RawDataTest/RawDataTest.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ BC18E03F156B354000AB8026 /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC18E03E156B354000AB8026 /* CoreMedia.framework */; }; BCB3C41116BCA74F003D26B0 /* Icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C40E16BCA74F003D26B0 /* Icon-72.png */; }; BCB3C41216BCA74F003D26B0 /* Icon-72@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C40F16BCA74F003D26B0 /* Icon-72@2x.png */; }; BCB3C41316BCA74F003D26B0 /* Icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C41016BCA74F003D26B0 /* Icon@2x.png */; }; BCB3C41816BCA75A003D26B0 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C41616BCA75A003D26B0 /* Icon.png */; }; BCB3C41916BCA75A003D26B0 /* iTunesArtwork.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C41716BCA75A003D26B0 /* iTunesArtwork.png */; }; BCF1E6071569D372006B155F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCF1E6061569D372006B155F /* UIKit.framework */; }; BCF1E6091569D372006B155F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCF1E6081569D372006B155F /* Foundation.framework */; }; BCF1E60B1569D372006B155F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCF1E60A1569D372006B155F /* CoreGraphics.framework */; }; BCF1E6111569D372006B155F /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = BCF1E60F1569D372006B155F /* InfoPlist.strings */; }; BCF1E6131569D372006B155F /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF1E6121569D372006B155F /* main.m */; }; BCF1E6171569D372006B155F /* RawDataTestAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF1E6161569D372006B155F /* RawDataTestAppDelegate.m */; }; BCF1E61E1569D3F8006B155F /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCF1E61D1569D3F8006B155F /* CoreVideo.framework */; }; BCF1E6201569D408006B155F /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCF1E61F1569D408006B155F /* AVFoundation.framework */; }; BCF1E6231569D42A006B155F /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCF1E6211569D42A006B155F /* OpenGLES.framework */; }; BCF1E6241569D42A006B155F /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCF1E6221569D42A006B155F /* QuartzCore.framework */; }; BCF1E63F156AAB4E006B155F /* CalculationShader.fsh in Resources */ = {isa = PBXBuildFile; fileRef = BCF1E63E156AAB4E006B155F /* CalculationShader.fsh */; }; BCF8671D1725A63600912E34 /* libGPUImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BCF867181725A62900912E34 /* libGPUImage.a */; }; E5066F4C1855A96B008C7682 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E5066F4B1855A96B008C7682 /* Default-568h@2x.png */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ BC7E93E019EB234A006D23C3 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BCF1E6251569D453006B155F /* GPUImage.xcodeproj */; proxyType = 2; remoteGlobalIDString = BCE209E51943F20C002FEED8; remoteInfo = GPUImageFramework; }; BCF867171725A62900912E34 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BCF1E6251569D453006B155F /* GPUImage.xcodeproj */; proxyType = 2; remoteGlobalIDString = BCF1A33414DDB1EC00852800; remoteInfo = GPUImage; }; BCF8671B1725A63100912E34 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BCF1E6251569D453006B155F /* GPUImage.xcodeproj */; proxyType = 1; remoteGlobalIDString = BCF1A33314DDB1EC00852800; remoteInfo = GPUImage; }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ BC18E03E156B354000AB8026 /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; }; BCB3C40E16BCA74F003D26B0 /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-72.png"; path = "../../SharedIcons/Icon-72.png"; sourceTree = ""; }; BCB3C40F16BCA74F003D26B0 /* Icon-72@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-72@2x.png"; path = "../../SharedIcons/Icon-72@2x.png"; sourceTree = ""; }; BCB3C41016BCA74F003D26B0 /* Icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon@2x.png"; path = "../../SharedIcons/Icon@2x.png"; sourceTree = ""; }; BCB3C41616BCA75A003D26B0 /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Icon.png; path = ../../SharedIcons/Icon.png; sourceTree = ""; }; BCB3C41716BCA75A003D26B0 /* iTunesArtwork.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = iTunesArtwork.png; path = ../../SharedIcons/iTunesArtwork.png; sourceTree = ""; }; BCF1E6021569D372006B155F /* RawDataTest.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RawDataTest.app; sourceTree = BUILT_PRODUCTS_DIR; }; BCF1E6061569D372006B155F /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; BCF1E6081569D372006B155F /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; BCF1E60A1569D372006B155F /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; BCF1E60E1569D372006B155F /* RawDataTest-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "RawDataTest-Info.plist"; sourceTree = ""; }; BCF1E6101569D372006B155F /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; BCF1E6121569D372006B155F /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; BCF1E6141569D372006B155F /* RawDataTest-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "RawDataTest-Prefix.pch"; sourceTree = ""; }; BCF1E6151569D372006B155F /* RawDataTestAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RawDataTestAppDelegate.h; sourceTree = ""; }; BCF1E6161569D372006B155F /* RawDataTestAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RawDataTestAppDelegate.m; sourceTree = ""; }; BCF1E61D1569D3F8006B155F /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = System/Library/Frameworks/CoreVideo.framework; sourceTree = SDKROOT; }; BCF1E61F1569D408006B155F /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; BCF1E6211569D42A006B155F /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; BCF1E6221569D42A006B155F /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; BCF1E6251569D453006B155F /* GPUImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = GPUImage.xcodeproj; path = ../../../framework/GPUImage.xcodeproj; sourceTree = ""; }; BCF1E63E156AAB4E006B155F /* CalculationShader.fsh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = CalculationShader.fsh; sourceTree = ""; }; E5066F4B1855A96B008C7682 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ BCF1E5FF1569D372006B155F /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( BCF8671D1725A63600912E34 /* libGPUImage.a in Frameworks */, BC18E03F156B354000AB8026 /* CoreMedia.framework in Frameworks */, BCF1E6231569D42A006B155F /* OpenGLES.framework in Frameworks */, BCF1E6241569D42A006B155F /* QuartzCore.framework in Frameworks */, BCF1E6201569D408006B155F /* AVFoundation.framework in Frameworks */, BCF1E61E1569D3F8006B155F /* CoreVideo.framework in Frameworks */, BCF1E6071569D372006B155F /* UIKit.framework in Frameworks */, BCF1E6091569D372006B155F /* Foundation.framework in Frameworks */, BCF1E60B1569D372006B155F /* CoreGraphics.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ BCF1E5F71569D372006B155F = { isa = PBXGroup; children = ( E5066F4B1855A96B008C7682 /* Default-568h@2x.png */, BCF1E60C1569D372006B155F /* RawDataTest */, BCF1E6051569D372006B155F /* Frameworks */, BCF1E6031569D372006B155F /* Products */, ); sourceTree = ""; }; BCF1E6031569D372006B155F /* Products */ = { isa = PBXGroup; children = ( BCF1E6021569D372006B155F /* RawDataTest.app */, ); name = Products; sourceTree = ""; }; BCF1E6051569D372006B155F /* Frameworks */ = { isa = PBXGroup; children = ( BCF1E6251569D453006B155F /* GPUImage.xcodeproj */, BC18E03E156B354000AB8026 /* CoreMedia.framework */, BCF1E6211569D42A006B155F /* OpenGLES.framework */, BCF1E6221569D42A006B155F /* QuartzCore.framework */, BCF1E61F1569D408006B155F /* AVFoundation.framework */, BCF1E61D1569D3F8006B155F /* CoreVideo.framework */, BCF1E6061569D372006B155F /* UIKit.framework */, BCF1E6081569D372006B155F /* Foundation.framework */, BCF1E60A1569D372006B155F /* CoreGraphics.framework */, ); name = Frameworks; sourceTree = ""; }; BCF1E60C1569D372006B155F /* RawDataTest */ = { isa = PBXGroup; children = ( BCF1E6151569D372006B155F /* RawDataTestAppDelegate.h */, BCF1E6161569D372006B155F /* RawDataTestAppDelegate.m */, BCF1E63E156AAB4E006B155F /* CalculationShader.fsh */, BCF1E60D1569D372006B155F /* Supporting Files */, ); path = RawDataTest; sourceTree = ""; }; BCF1E60D1569D372006B155F /* Supporting Files */ = { isa = PBXGroup; children = ( BCB3C41616BCA75A003D26B0 /* Icon.png */, BCB3C41716BCA75A003D26B0 /* iTunesArtwork.png */, BCB3C40E16BCA74F003D26B0 /* Icon-72.png */, BCB3C40F16BCA74F003D26B0 /* Icon-72@2x.png */, BCB3C41016BCA74F003D26B0 /* Icon@2x.png */, BCF1E60E1569D372006B155F /* RawDataTest-Info.plist */, BCF1E60F1569D372006B155F /* InfoPlist.strings */, BCF1E6121569D372006B155F /* main.m */, BCF1E6141569D372006B155F /* RawDataTest-Prefix.pch */, ); name = "Supporting Files"; sourceTree = ""; }; BCF867121725A62900912E34 /* Products */ = { isa = PBXGroup; children = ( BCF867181725A62900912E34 /* libGPUImage.a */, BC7E93E119EB234A006D23C3 /* GPUImage.framework */, ); name = Products; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ BCF1E6011569D372006B155F /* RawDataTest */ = { isa = PBXNativeTarget; buildConfigurationList = BCF1E61A1569D372006B155F /* Build configuration list for PBXNativeTarget "RawDataTest" */; buildPhases = ( BCF1E5FE1569D372006B155F /* Sources */, BCF1E5FF1569D372006B155F /* Frameworks */, BCF1E6001569D372006B155F /* Resources */, ); buildRules = ( ); dependencies = ( BCF8671C1725A63100912E34 /* PBXTargetDependency */, ); name = RawDataTest; productName = RawDataTest; productReference = BCF1E6021569D372006B155F /* RawDataTest.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ BCF1E5F91569D372006B155F /* Project object */ = { isa = PBXProject; attributes = { CLASSPREFIX = RawDataTest; LastUpgradeCheck = 0500; ORGANIZATIONNAME = "Cell Phone"; }; buildConfigurationList = BCF1E5FC1569D372006B155F /* Build configuration list for PBXProject "RawDataTest" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, ); mainGroup = BCF1E5F71569D372006B155F; productRefGroup = BCF1E6031569D372006B155F /* Products */; projectDirPath = ""; projectReferences = ( { ProductGroup = BCF867121725A62900912E34 /* Products */; ProjectRef = BCF1E6251569D453006B155F /* GPUImage.xcodeproj */; }, ); projectRoot = ""; targets = ( BCF1E6011569D372006B155F /* RawDataTest */, ); }; /* End PBXProject section */ /* Begin PBXReferenceProxy section */ BC7E93E119EB234A006D23C3 /* GPUImage.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; path = GPUImage.framework; remoteRef = BC7E93E019EB234A006D23C3 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; BCF867181725A62900912E34 /* libGPUImage.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = libGPUImage.a; remoteRef = BCF867171725A62900912E34 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ BCF1E6001569D372006B155F /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( BCF1E6111569D372006B155F /* InfoPlist.strings in Resources */, BCF1E63F156AAB4E006B155F /* CalculationShader.fsh in Resources */, BCB3C41116BCA74F003D26B0 /* Icon-72.png in Resources */, BCB3C41216BCA74F003D26B0 /* Icon-72@2x.png in Resources */, BCB3C41316BCA74F003D26B0 /* Icon@2x.png in Resources */, E5066F4C1855A96B008C7682 /* Default-568h@2x.png in Resources */, BCB3C41816BCA75A003D26B0 /* Icon.png in Resources */, BCB3C41916BCA75A003D26B0 /* iTunesArtwork.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ BCF1E5FE1569D372006B155F /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( BCF1E6131569D372006B155F /* main.m in Sources */, BCF1E6171569D372006B155F /* RawDataTestAppDelegate.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ BCF8671C1725A63100912E34 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = GPUImage; targetProxy = BCF8671B1725A63100912E34 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ BCF1E60F1569D372006B155F /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( BCF1E6101569D372006B155F /* en */, ); name = InfoPlist.strings; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ BCF1E6181569D372006B155F /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "../../../framework/**"; IPHONEOS_DEPLOYMENT_TARGET = 4.3; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; BCF1E6191569D372006B155F /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "../../../framework/**"; IPHONEOS_DEPLOYMENT_TARGET = 4.3; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; name = Release; }; BCF1E61B1569D372006B155F /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "RawDataTest/RawDataTest-Prefix.pch"; INFOPLIST_FILE = "RawDataTest/RawDataTest-Info.plist"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; name = Debug; }; BCF1E61C1569D372006B155F /* Release */ = { isa = XCBuildConfiguration; buildSettings = { GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "RawDataTest/RawDataTest-Prefix.pch"; INFOPLIST_FILE = "RawDataTest/RawDataTest-Info.plist"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ BCF1E5FC1569D372006B155F /* Build configuration list for PBXProject "RawDataTest" */ = { isa = XCConfigurationList; buildConfigurations = ( BCF1E6181569D372006B155F /* Debug */, BCF1E6191569D372006B155F /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; BCF1E61A1569D372006B155F /* Build configuration list for PBXNativeTarget "RawDataTest" */ = { isa = XCConfigurationList; buildConfigurations = ( BCF1E61B1569D372006B155F /* Debug */, BCF1E61C1569D372006B155F /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = BCF1E5F91569D372006B155F /* Project object */; } ================================================ FILE: examples/iOS/RawDataTest/RawDataTest.xcodeproj/xcshareddata/xcschemes/RawDataTest.xcscheme ================================================ ================================================ FILE: examples/iOS/SimpleImageFilter/SimpleImageFilter/SimpleImageAppDelegate.h ================================================ #import #import "GPUImage.h" #import "SimpleImageViewController.h" @interface SimpleImageAppDelegate : UIResponder { SimpleImageViewController *rootViewController; } @property (strong, nonatomic) UIWindow *window; @end ================================================ FILE: examples/iOS/SimpleImageFilter/SimpleImageFilter/SimpleImageAppDelegate.m ================================================ #import "SimpleImageAppDelegate.h" @implementation SimpleImageAppDelegate @synthesize window = _window; - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // Override point for customization after application launch. self.window.backgroundColor = [UIColor whiteColor]; rootViewController = [[SimpleImageViewController alloc] initWithNibName:nil bundle:nil]; [self.window setRootViewController:rootViewController]; [self.window makeKeyAndVisible]; return YES; } @end ================================================ FILE: examples/iOS/SimpleImageFilter/SimpleImageFilter/SimpleImageFilter-Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleDisplayName ImageFilter CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIconFiles CFBundleIdentifier com.sunsetlakesoftware.${PRODUCT_NAME:rfc1034identifier} CFBundleInfoDictionaryVersion 6.0 CFBundleName ${PRODUCT_NAME} CFBundlePackageType APPL CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion 1.0 LSRequiresIPhoneOS UIFileSharingEnabled UIPrerenderedIcon UIRequiredDeviceCapabilities opengles-2 UISupportedInterfaceOrientations UIInterfaceOrientationPortrait UISupportedInterfaceOrientations~ipad UIInterfaceOrientationPortrait ================================================ FILE: examples/iOS/SimpleImageFilter/SimpleImageFilter/SimpleImageFilter-Prefix.pch ================================================ // // Prefix header for all source files of the 'SimpleImageFilter' target in the 'SimpleImageFilter' project // #import #ifndef __IPHONE_5_0 #warning "This project uses features only available in iOS SDK 5.0 and later." #endif #ifdef __OBJC__ #import #import #endif ================================================ FILE: examples/iOS/SimpleImageFilter/SimpleImageFilter/SimpleImageViewController.h ================================================ #import #import "GPUImage.h" @interface SimpleImageViewController : UIViewController { GPUImagePicture *sourcePicture; GPUImageOutput *sepiaFilter, *sepiaFilter2; UISlider *imageSlider; } // Image filtering - (void)setupDisplayFiltering; - (void)setupImageFilteringToDisk; - (void)setupImageResampling; - (IBAction)updateSliderValue:(id)sender; @end ================================================ FILE: examples/iOS/SimpleImageFilter/SimpleImageFilter/SimpleImageViewController.m ================================================ #import "SimpleImageViewController.h" @implementation SimpleImageViewController - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Release any cached data, images, etc that aren't in use. } #pragma mark - View lifecycle - (void)loadView { CGRect mainScreenFrame = [[UIScreen mainScreen] applicationFrame]; GPUImageView *primaryView = [[GPUImageView alloc] initWithFrame:mainScreenFrame]; self.view = primaryView; imageSlider = [[UISlider alloc] initWithFrame:CGRectMake(25.0, mainScreenFrame.size.height - 50.0, mainScreenFrame.size.width - 50.0, 40.0)]; [imageSlider addTarget:self action:@selector(updateSliderValue:) forControlEvents:UIControlEventValueChanged]; imageSlider.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin; imageSlider.minimumValue = 0.0; imageSlider.maximumValue = 1.0; imageSlider.value = 0.5; [primaryView addSubview:imageSlider]; [self setupDisplayFiltering]; [self setupImageResampling]; [self setupImageFilteringToDisk]; } - (void)viewDidUnload { [super viewDidUnload]; // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { if (interfaceOrientation == UIInterfaceOrientationPortrait) { return YES; } return NO; } - (IBAction)updateSliderValue:(id)sender { CGFloat midpoint = [(UISlider *)sender value]; [(GPUImageTiltShiftFilter *)sepiaFilter setTopFocusLevel:midpoint - 0.1]; [(GPUImageTiltShiftFilter *)sepiaFilter setBottomFocusLevel:midpoint + 0.1]; [sourcePicture processImage]; } #pragma mark - #pragma mark Image filtering - (void)setupDisplayFiltering; { UIImage *inputImage = [UIImage imageNamed:@"WID-small.jpg"]; // The WID.jpg example is greater than 2048 pixels tall, so it fails on older devices sourcePicture = [[GPUImagePicture alloc] initWithImage:inputImage smoothlyScaleOutput:YES]; sepiaFilter = [[GPUImageTiltShiftFilter alloc] init]; // sepiaFilter = [[GPUImageSobelEdgeDetectionFilter alloc] init]; GPUImageView *imageView = (GPUImageView *)self.view; [sepiaFilter forceProcessingAtSize:imageView.sizeInPixels]; // This is now needed to make the filter run at the smaller output size [sourcePicture addTarget:sepiaFilter]; [sepiaFilter addTarget:imageView]; [sourcePicture processImage]; } - (void)setupImageFilteringToDisk; { // Set up a manual image filtering chain NSURL *inputImageURL = [[NSBundle mainBundle] URLForResource:@"Lambeau" withExtension:@"jpg"]; // GPUImagePicture *stillImageSource = [[GPUImagePicture alloc] initWithImage:inputImage]; NSLog(@"First image filtering"); GPUImagePicture *stillImageSource = [[GPUImagePicture alloc] initWithURL:inputImageURL]; GPUImageSepiaFilter *stillImageFilter = [[GPUImageSepiaFilter alloc] init]; GPUImageVignetteFilter *vignetteImageFilter = [[GPUImageVignetteFilter alloc] init]; vignetteImageFilter.vignetteEnd = 0.6; vignetteImageFilter.vignetteStart = 0.4; [stillImageSource addTarget:stillImageFilter]; [stillImageFilter addTarget:vignetteImageFilter]; [vignetteImageFilter useNextFrameForImageCapture]; [stillImageSource processImage]; NSError *error = nil; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; @autoreleasepool { UIImage *currentFilteredImage = [vignetteImageFilter imageFromCurrentFramebuffer]; NSData *dataForPNGFile = UIImagePNGRepresentation(currentFilteredImage); if (![dataForPNGFile writeToFile:[documentsDirectory stringByAppendingPathComponent:@"Lambeau-filtered1.png"] options:NSAtomicWrite error:&error]) { NSLog(@"Error: Couldn't save image 1"); } dataForPNGFile = nil; currentFilteredImage = nil; } // Do a simpler image filtering // GPUImageSketchFilter *stillImageFilter2 = [[GPUImageSketchFilter alloc] init]; // GPUImageSobelEdgeDetectionFilter *stillImageFilter2 = [[GPUImageSobelEdgeDetectionFilter alloc] init]; // GPUImageAmatorkaFilter *stillImageFilter2 = [[GPUImageAmatorkaFilter alloc] init]; // GPUImageUnsharpMaskFilter *stillImageFilter2 = [[GPUImageUnsharpMaskFilter alloc] init]; GPUImageSepiaFilter *stillImageFilter2 = [[GPUImageSepiaFilter alloc] init]; NSLog(@"Second image filtering"); UIImage *inputImage = [UIImage imageNamed:@"Lambeau.jpg"]; UIImage *quickFilteredImage = [stillImageFilter2 imageByFilteringImage:inputImage]; // Write images to disk, as proof NSData *dataForPNGFile2 = UIImagePNGRepresentation(quickFilteredImage); if (![dataForPNGFile2 writeToFile:[documentsDirectory stringByAppendingPathComponent:@"Lambeau-filtered2.png"] options:NSAtomicWrite error:&error]) { NSLog(@"Error: Couldn't save image 2"); } } - (void)setupImageResampling; { UIImage *inputImage = [UIImage imageNamed:@"Lambeau.jpg"]; GPUImagePicture *stillImageSource = [[GPUImagePicture alloc] initWithImage:inputImage]; // Linear downsampling GPUImageBrightnessFilter *passthroughFilter = [[GPUImageBrightnessFilter alloc] init]; [passthroughFilter forceProcessingAtSize:CGSizeMake(640.0, 480.0)]; [stillImageSource addTarget:passthroughFilter]; [passthroughFilter useNextFrameForImageCapture]; [stillImageSource processImage]; UIImage *nearestNeighborImage = [passthroughFilter imageFromCurrentFramebuffer]; // Lanczos downsampling [stillImageSource removeAllTargets]; GPUImageLanczosResamplingFilter *lanczosResamplingFilter = [[GPUImageLanczosResamplingFilter alloc] init]; [lanczosResamplingFilter forceProcessingAtSize:CGSizeMake(640.0, 480.0)]; [stillImageSource addTarget:lanczosResamplingFilter]; [lanczosResamplingFilter useNextFrameForImageCapture]; [stillImageSource processImage]; UIImage *lanczosImage = [lanczosResamplingFilter imageFromCurrentFramebuffer]; // Trilinear downsampling GPUImagePicture *stillImageSource2 = [[GPUImagePicture alloc] initWithImage:inputImage smoothlyScaleOutput:YES]; GPUImageBrightnessFilter *passthroughFilter2 = [[GPUImageBrightnessFilter alloc] init]; [passthroughFilter2 forceProcessingAtSize:CGSizeMake(640.0, 480.0)]; [stillImageSource2 addTarget:passthroughFilter2]; [passthroughFilter2 useNextFrameForImageCapture]; [stillImageSource2 processImage]; UIImage *trilinearImage = [passthroughFilter2 imageFromCurrentFramebuffer]; NSData *dataForPNGFile1 = UIImagePNGRepresentation(nearestNeighborImage); NSData *dataForPNGFile2 = UIImagePNGRepresentation(lanczosImage); NSData *dataForPNGFile3 = UIImagePNGRepresentation(trilinearImage); NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSError *error = nil; if (![dataForPNGFile1 writeToFile:[documentsDirectory stringByAppendingPathComponent:@"Lambeau-Resized-NN.png"] options:NSAtomicWrite error:&error]) { return; } if (![dataForPNGFile2 writeToFile:[documentsDirectory stringByAppendingPathComponent:@"Lambeau-Resized-Lanczos.png"] options:NSAtomicWrite error:&error]) { return; } if (![dataForPNGFile3 writeToFile:[documentsDirectory stringByAppendingPathComponent:@"Lambeau-Resized-Trilinear.png"] options:NSAtomicWrite error:&error]) { return; } } @end ================================================ FILE: examples/iOS/SimpleImageFilter/SimpleImageFilter/en.lproj/InfoPlist.strings ================================================ /* Localized versions of Info.plist keys */ ================================================ FILE: examples/iOS/SimpleImageFilter/SimpleImageFilter/main.m ================================================ #import #import "SimpleImageAppDelegate.h" int main(int argc, char *argv[]) { @autoreleasepool { return UIApplicationMain(argc, argv, nil, NSStringFromClass([SimpleImageAppDelegate class])); } } ================================================ FILE: examples/iOS/SimpleImageFilter/SimpleImageFilter.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ BCB3C42016BCA7B7003D26B0 /* Icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C41B16BCA7B7003D26B0 /* Icon-72.png */; }; BCB3C42116BCA7B7003D26B0 /* Icon-72@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C41C16BCA7B7003D26B0 /* Icon-72@2x.png */; }; BCB3C42216BCA7B7003D26B0 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C41D16BCA7B7003D26B0 /* Icon.png */; }; BCB3C42316BCA7B7003D26B0 /* Icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C41E16BCA7B7003D26B0 /* Icon@2x.png */; }; BCB3C42416BCA7B7003D26B0 /* iTunesArtwork.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C41F16BCA7B7003D26B0 /* iTunesArtwork.png */; }; BCB5E7ED14E605A900701302 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB5E7EC14E605A900701302 /* UIKit.framework */; }; BCB5E7EF14E605A900701302 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB5E7EE14E605A900701302 /* Foundation.framework */; }; BCB5E7F114E605A900701302 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB5E7F014E605A900701302 /* CoreGraphics.framework */; }; BCB5E7F714E605A900701302 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = BCB5E7F514E605A900701302 /* InfoPlist.strings */; }; BCB5E7F914E605A900701302 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB5E7F814E605A900701302 /* main.m */; }; BCB5E7FD14E605A900701302 /* SimpleImageAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB5E7FC14E605A900701302 /* SimpleImageAppDelegate.m */; }; BCB5E80614E605A900701302 /* SimpleImageViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB5E80514E605A900701302 /* SimpleImageViewController.m */; }; BCB5E82314E62A3C00701302 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB5E81E14E62A3C00701302 /* AVFoundation.framework */; }; BCB5E82414E62A3C00701302 /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB5E81F14E62A3C00701302 /* CoreMedia.framework */; }; BCB5E82514E62A3C00701302 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB5E82014E62A3C00701302 /* CoreVideo.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; BCB5E82614E62A3C00701302 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB5E82114E62A3C00701302 /* OpenGLES.framework */; }; BCB5E82714E62A3C00701302 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB5E82214E62A3C00701302 /* QuartzCore.framework */; }; BCB5E86314E6F05A00701302 /* WID-small.jpg in Resources */ = {isa = PBXBuildFile; fileRef = BCB5E86214E6F05A00701302 /* WID-small.jpg */; }; BCB5E86514E6F1D700701302 /* Lambeau.jpg in Resources */ = {isa = PBXBuildFile; fileRef = BCB5E86414E6F1D700701302 /* Lambeau.jpg */; }; BCC9005F18DA278200A5A5C7 /* lookup_amatorka.png in Resources */ = {isa = PBXBuildFile; fileRef = BCC9005E18DA278200A5A5C7 /* lookup_amatorka.png */; }; BCF8672A1725A6B400912E34 /* libGPUImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BCF867251725A69A00912E34 /* libGPUImage.a */; }; E5066F511855A9F2008C7682 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E5066F501855A9F2008C7682 /* Default-568h@2x.png */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ BC3240A619E5DE6C001EAB0E /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BCB5E80C14E610BE00701302 /* GPUImage.xcodeproj */; proxyType = 2; remoteGlobalIDString = BCE209E51943F20C002FEED8; remoteInfo = GPUImageFramework; }; BCF867241725A69A00912E34 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BCB5E80C14E610BE00701302 /* GPUImage.xcodeproj */; proxyType = 2; remoteGlobalIDString = BCF1A33414DDB1EC00852800; remoteInfo = GPUImage; }; BCF867281725A6AD00912E34 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BCB5E80C14E610BE00701302 /* GPUImage.xcodeproj */; proxyType = 1; remoteGlobalIDString = BCF1A33314DDB1EC00852800; remoteInfo = GPUImage; }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ BCB3C41B16BCA7B7003D26B0 /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-72.png"; path = "../../SharedIcons/Icon-72.png"; sourceTree = ""; }; BCB3C41C16BCA7B7003D26B0 /* Icon-72@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-72@2x.png"; path = "../../SharedIcons/Icon-72@2x.png"; sourceTree = ""; }; BCB3C41D16BCA7B7003D26B0 /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Icon.png; path = ../../SharedIcons/Icon.png; sourceTree = ""; }; BCB3C41E16BCA7B7003D26B0 /* Icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon@2x.png"; path = "../../SharedIcons/Icon@2x.png"; sourceTree = ""; }; BCB3C41F16BCA7B7003D26B0 /* iTunesArtwork.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = iTunesArtwork.png; path = ../../SharedIcons/iTunesArtwork.png; sourceTree = ""; }; BCB5E7E814E605A900701302 /* SimpleImageFilter.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SimpleImageFilter.app; sourceTree = BUILT_PRODUCTS_DIR; }; BCB5E7EC14E605A900701302 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; BCB5E7EE14E605A900701302 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; BCB5E7F014E605A900701302 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; BCB5E7F414E605A900701302 /* SimpleImageFilter-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SimpleImageFilter-Info.plist"; sourceTree = ""; }; BCB5E7F614E605A900701302 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; BCB5E7F814E605A900701302 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; BCB5E7FA14E605A900701302 /* SimpleImageFilter-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SimpleImageFilter-Prefix.pch"; sourceTree = ""; }; BCB5E7FB14E605A900701302 /* SimpleImageAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SimpleImageAppDelegate.h; sourceTree = ""; }; BCB5E7FC14E605A900701302 /* SimpleImageAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SimpleImageAppDelegate.m; sourceTree = ""; }; BCB5E80414E605A900701302 /* SimpleImageViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SimpleImageViewController.h; sourceTree = ""; }; BCB5E80514E605A900701302 /* SimpleImageViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SimpleImageViewController.m; sourceTree = ""; }; BCB5E80C14E610BE00701302 /* GPUImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = GPUImage.xcodeproj; path = ../../../framework/GPUImage.xcodeproj; sourceTree = ""; }; BCB5E81E14E62A3C00701302 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; BCB5E81F14E62A3C00701302 /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; }; BCB5E82014E62A3C00701302 /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = System/Library/Frameworks/CoreVideo.framework; sourceTree = SDKROOT; }; BCB5E82114E62A3C00701302 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; BCB5E82214E62A3C00701302 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; BCB5E86214E6F05A00701302 /* WID-small.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "WID-small.jpg"; sourceTree = ""; }; BCB5E86414E6F1D700701302 /* Lambeau.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = Lambeau.jpg; sourceTree = ""; }; BCC9005E18DA278200A5A5C7 /* lookup_amatorka.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = lookup_amatorka.png; path = ../../../../framework/Resources/lookup_amatorka.png; sourceTree = ""; }; E5066F501855A9F2008C7682 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ BCB5E7E514E605A900701302 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( BCF8672A1725A6B400912E34 /* libGPUImage.a in Frameworks */, BCB5E82314E62A3C00701302 /* AVFoundation.framework in Frameworks */, BCB5E82414E62A3C00701302 /* CoreMedia.framework in Frameworks */, BCB5E82514E62A3C00701302 /* CoreVideo.framework in Frameworks */, BCB5E82614E62A3C00701302 /* OpenGLES.framework in Frameworks */, BCB5E82714E62A3C00701302 /* QuartzCore.framework in Frameworks */, BCB5E7ED14E605A900701302 /* UIKit.framework in Frameworks */, BCB5E7EF14E605A900701302 /* Foundation.framework in Frameworks */, BCB5E7F114E605A900701302 /* CoreGraphics.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ BCB5E7DD14E605A900701302 = { isa = PBXGroup; children = ( E5066F501855A9F2008C7682 /* Default-568h@2x.png */, BCB5E7F214E605A900701302 /* SimpleImageFilter */, BCB5E7EB14E605A900701302 /* Frameworks */, BCB5E7E914E605A900701302 /* Products */, ); sourceTree = ""; }; BCB5E7E914E605A900701302 /* Products */ = { isa = PBXGroup; children = ( BCB5E7E814E605A900701302 /* SimpleImageFilter.app */, ); name = Products; sourceTree = ""; }; BCB5E7EB14E605A900701302 /* Frameworks */ = { isa = PBXGroup; children = ( BCB5E80C14E610BE00701302 /* GPUImage.xcodeproj */, BCB5E81E14E62A3C00701302 /* AVFoundation.framework */, BCB5E81F14E62A3C00701302 /* CoreMedia.framework */, BCB5E82014E62A3C00701302 /* CoreVideo.framework */, BCB5E82114E62A3C00701302 /* OpenGLES.framework */, BCB5E82214E62A3C00701302 /* QuartzCore.framework */, BCB5E7EC14E605A900701302 /* UIKit.framework */, BCB5E7EE14E605A900701302 /* Foundation.framework */, BCB5E7F014E605A900701302 /* CoreGraphics.framework */, ); name = Frameworks; sourceTree = ""; }; BCB5E7F214E605A900701302 /* SimpleImageFilter */ = { isa = PBXGroup; children = ( BCB5E7FB14E605A900701302 /* SimpleImageAppDelegate.h */, BCB5E7FC14E605A900701302 /* SimpleImageAppDelegate.m */, BCB5E80414E605A900701302 /* SimpleImageViewController.h */, BCB5E80514E605A900701302 /* SimpleImageViewController.m */, BCB5E7F314E605A900701302 /* Supporting Files */, ); path = SimpleImageFilter; sourceTree = ""; }; BCB5E7F314E605A900701302 /* Supporting Files */ = { isa = PBXGroup; children = ( BCC9005E18DA278200A5A5C7 /* lookup_amatorka.png */, BCB3C41B16BCA7B7003D26B0 /* Icon-72.png */, BCB3C41C16BCA7B7003D26B0 /* Icon-72@2x.png */, BCB3C41D16BCA7B7003D26B0 /* Icon.png */, BCB3C41E16BCA7B7003D26B0 /* Icon@2x.png */, BCB3C41F16BCA7B7003D26B0 /* iTunesArtwork.png */, BCB5E86414E6F1D700701302 /* Lambeau.jpg */, BCB5E86214E6F05A00701302 /* WID-small.jpg */, BCB5E7F414E605A900701302 /* SimpleImageFilter-Info.plist */, BCB5E7F514E605A900701302 /* InfoPlist.strings */, BCB5E7F814E605A900701302 /* main.m */, BCB5E7FA14E605A900701302 /* SimpleImageFilter-Prefix.pch */, ); name = "Supporting Files"; sourceTree = ""; }; BCF8671F1725A69A00912E34 /* Products */ = { isa = PBXGroup; children = ( BCF867251725A69A00912E34 /* libGPUImage.a */, BC3240A719E5DE6C001EAB0E /* GPUImage.framework */, ); name = Products; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ BCB5E7E714E605A900701302 /* SimpleImageFilter */ = { isa = PBXNativeTarget; buildConfigurationList = BCB5E80914E605A900701302 /* Build configuration list for PBXNativeTarget "SimpleImageFilter" */; buildPhases = ( BCB5E7E414E605A900701302 /* Sources */, BCB5E7E514E605A900701302 /* Frameworks */, BCB5E7E614E605A900701302 /* Resources */, ); buildRules = ( ); dependencies = ( BCF867291725A6AD00912E34 /* PBXTargetDependency */, ); name = SimpleImageFilter; productName = SimpleImageFilter; productReference = BCB5E7E814E605A900701302 /* SimpleImageFilter.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ BCB5E7DF14E605A900701302 /* Project object */ = { isa = PBXProject; attributes = { LastUpgradeCheck = 0500; ORGANIZATIONNAME = "Cell Phone"; }; buildConfigurationList = BCB5E7E214E605A900701302 /* Build configuration list for PBXProject "SimpleImageFilter" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, ); mainGroup = BCB5E7DD14E605A900701302; productRefGroup = BCB5E7E914E605A900701302 /* Products */; projectDirPath = ""; projectReferences = ( { ProductGroup = BCF8671F1725A69A00912E34 /* Products */; ProjectRef = BCB5E80C14E610BE00701302 /* GPUImage.xcodeproj */; }, ); projectRoot = ""; targets = ( BCB5E7E714E605A900701302 /* SimpleImageFilter */, ); }; /* End PBXProject section */ /* Begin PBXReferenceProxy section */ BC3240A719E5DE6C001EAB0E /* GPUImage.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; path = GPUImage.framework; remoteRef = BC3240A619E5DE6C001EAB0E /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; BCF867251725A69A00912E34 /* libGPUImage.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = libGPUImage.a; remoteRef = BCF867241725A69A00912E34 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ BCB5E7E614E605A900701302 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( BCB5E7F714E605A900701302 /* InfoPlist.strings in Resources */, BCB5E86314E6F05A00701302 /* WID-small.jpg in Resources */, E5066F511855A9F2008C7682 /* Default-568h@2x.png in Resources */, BCB5E86514E6F1D700701302 /* Lambeau.jpg in Resources */, BCB3C42016BCA7B7003D26B0 /* Icon-72.png in Resources */, BCC9005F18DA278200A5A5C7 /* lookup_amatorka.png in Resources */, BCB3C42116BCA7B7003D26B0 /* Icon-72@2x.png in Resources */, BCB3C42216BCA7B7003D26B0 /* Icon.png in Resources */, BCB3C42316BCA7B7003D26B0 /* Icon@2x.png in Resources */, BCB3C42416BCA7B7003D26B0 /* iTunesArtwork.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ BCB5E7E414E605A900701302 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( BCB5E7F914E605A900701302 /* main.m in Sources */, BCB5E7FD14E605A900701302 /* SimpleImageAppDelegate.m in Sources */, BCB5E80614E605A900701302 /* SimpleImageViewController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ BCF867291725A6AD00912E34 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = GPUImage; targetProxy = BCF867281725A6AD00912E34 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ BCB5E7F514E605A900701302 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( BCB5E7F614E605A900701302 /* en */, ); name = InfoPlist.strings; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ BCB5E80714E605A900701302 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "../../../framework/**"; IPHONEOS_DEPLOYMENT_TARGET = 4.3; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = "-ObjC"; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; BCB5E80814E605A900701302 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "../../../framework/**"; IPHONEOS_DEPLOYMENT_TARGET = 4.3; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; OTHER_LDFLAGS = "-ObjC"; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; name = Release; }; BCB5E80A14E605A900701302 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "SimpleImageFilter/SimpleImageFilter-Prefix.pch"; INFOPLIST_FILE = "SimpleImageFilter/SimpleImageFilter-Info.plist"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; name = Debug; }; BCB5E80B14E605A900701302 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "SimpleImageFilter/SimpleImageFilter-Prefix.pch"; INFOPLIST_FILE = "SimpleImageFilter/SimpleImageFilter-Info.plist"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ BCB5E7E214E605A900701302 /* Build configuration list for PBXProject "SimpleImageFilter" */ = { isa = XCConfigurationList; buildConfigurations = ( BCB5E80714E605A900701302 /* Debug */, BCB5E80814E605A900701302 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; BCB5E80914E605A900701302 /* Build configuration list for PBXNativeTarget "SimpleImageFilter" */ = { isa = XCConfigurationList; buildConfigurations = ( BCB5E80A14E605A900701302 /* Debug */, BCB5E80B14E605A900701302 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = BCB5E7DF14E605A900701302 /* Project object */; } ================================================ FILE: examples/iOS/SimpleImageFilter/SimpleImageFilter.xcodeproj/xcshareddata/xcschemes/SimpleImageFilter.xcscheme ================================================ ================================================ FILE: examples/iOS/SimplePhotoFilter/SimplePhotoFilter/PhotoAppDelegate.h ================================================ #import @class PhotoViewController; @interface PhotoAppDelegate : UIResponder { PhotoViewController *rootViewController; } @property (strong, nonatomic) UIWindow *window; @end ================================================ FILE: examples/iOS/SimplePhotoFilter/SimplePhotoFilter/PhotoAppDelegate.m ================================================ #import "PhotoAppDelegate.h" #import "PhotoViewController.h" @implementation PhotoAppDelegate @synthesize window = _window; - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // Override point for customization after application launch. self.window.backgroundColor = [UIColor whiteColor]; rootViewController = [[PhotoViewController alloc] initWithNibName:nil bundle:nil]; rootViewController.view.frame = [[UIScreen mainScreen] bounds]; [self.window addSubview:rootViewController.view]; [self.window makeKeyAndVisible]; return YES; } - (void)applicationWillResignActive:(UIApplication *)application { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. } - (void)applicationDidEnterBackground:(UIApplication *)application { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } - (void)applicationWillEnterForeground:(UIApplication *)application { // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. } - (void)applicationDidBecomeActive:(UIApplication *)application { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } - (void)applicationWillTerminate:(UIApplication *)application { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } @end ================================================ FILE: examples/iOS/SimplePhotoFilter/SimplePhotoFilter/PhotoViewController.h ================================================ #import #import "GPUImage.h" @interface PhotoViewController : UIViewController { GPUImageStillCamera *stillCamera; GPUImageOutput *filter, *secondFilter, *terminalFilter; UISlider *filterSettingsSlider; UIButton *photoCaptureButton; GPUImagePicture *memoryPressurePicture1, *memoryPressurePicture2; } - (IBAction)updateSliderValue:(id)sender; - (IBAction)takePhoto:(id)sender; @end ================================================ FILE: examples/iOS/SimplePhotoFilter/SimplePhotoFilter/PhotoViewController.m ================================================ #import "PhotoViewController.h" #import @interface PhotoViewController () @end @implementation PhotoViewController - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { // Custom initialization } return self; } - (void)loadView { CGRect mainScreenFrame = [[UIScreen mainScreen] bounds]; // Yes, I know I'm a caveman for doing all this by hand GPUImageView *primaryView = [[GPUImageView alloc] initWithFrame:mainScreenFrame]; primaryView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; filterSettingsSlider = [[UISlider alloc] initWithFrame:CGRectMake(25.0, mainScreenFrame.size.height - 50.0, mainScreenFrame.size.width - 50.0, 40.0)]; [filterSettingsSlider addTarget:self action:@selector(updateSliderValue:) forControlEvents:UIControlEventValueChanged]; filterSettingsSlider.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin; filterSettingsSlider.minimumValue = 0.0; filterSettingsSlider.maximumValue = 3.0; filterSettingsSlider.value = 1.0; [primaryView addSubview:filterSettingsSlider]; photoCaptureButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; photoCaptureButton.frame = CGRectMake(round(mainScreenFrame.size.width / 2.0 - 150.0 / 2.0), mainScreenFrame.size.height - 90.0, 150.0, 40.0); [photoCaptureButton setTitle:@"Capture Photo" forState:UIControlStateNormal]; photoCaptureButton.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin; [photoCaptureButton addTarget:self action:@selector(takePhoto:) forControlEvents:UIControlEventTouchUpInside]; [photoCaptureButton setTitleColor:[UIColor grayColor] forState:UIControlStateDisabled]; [primaryView addSubview:photoCaptureButton]; self.view = primaryView; } - (void)viewDidLoad { [super viewDidLoad]; stillCamera = [[GPUImageStillCamera alloc] init]; // stillCamera = [[GPUImageStillCamera alloc] initWithSessionPreset:AVCaptureSessionPreset640x480 cameraPosition:AVCaptureDevicePositionBack]; stillCamera.outputImageOrientation = UIInterfaceOrientationPortrait; // filter = [[GPUImageGammaFilter alloc] init]; filter = [[GPUImageSketchFilter alloc] init]; // filter = [[GPUImageUnsharpMaskFilter alloc] init]; // [(GPUImageSketchFilter *)filter setTexelHeight:(1.0 / 1024.0)]; // [(GPUImageSketchFilter *)filter setTexelWidth:(1.0 / 768.0)]; // filter = [[GPUImageSmoothToonFilter alloc] init]; // filter = [[GPUImageSepiaFilter alloc] init]; // filter = [[GPUImageCropFilter alloc] initWithCropRegion:CGRectMake(0.5, 0.5, 0.5, 0.5)]; // secondFilter = [[GPUImageSepiaFilter alloc] init]; // terminalFilter = [[GPUImageSepiaFilter alloc] init]; // [filter addTarget:secondFilter]; // [secondFilter addTarget:terminalFilter]; // [filter prepareForImageCapture]; // [terminalFilter prepareForImageCapture]; [stillCamera addTarget:filter]; GPUImageView *filterView = (GPUImageView *)self.view; // [filter addTarget:filterView]; [filter addTarget:filterView]; // [terminalFilter addTarget:filterView]; // [stillCamera.inputCamera lockForConfiguration:nil]; // [stillCamera.inputCamera setFlashMode:AVCaptureFlashModeOn]; // [stillCamera.inputCamera unlockForConfiguration]; [stillCamera startCameraCapture]; // UIImage *inputImage = [UIImage imageNamed:@"Lambeau.jpg"]; // memoryPressurePicture1 = [[GPUImagePicture alloc] initWithImage:inputImage]; // // memoryPressurePicture2 = [[GPUImagePicture alloc] initWithImage:inputImage]; } - (void)viewDidUnload { [super viewDidUnload]; // Release any retained subviews of the main view. } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationPortrait); } - (IBAction)updateSliderValue:(id)sender { // [(GPUImagePixellateFilter *)filter setFractionalWidthOfAPixel:[(UISlider *)sender value]]; // [(GPUImageGammaFilter *)filter setGamma:[(UISlider *)sender value]]; } - (IBAction)takePhoto:(id)sender; { [photoCaptureButton setEnabled:NO]; [stillCamera capturePhotoAsJPEGProcessedUpToFilter:filter withCompletionHandler:^(NSData *processedJPEG, NSError *error){ // Save to assets library ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init]; [library writeImageDataToSavedPhotosAlbum:processedJPEG metadata:stillCamera.currentCaptureMetadata completionBlock:^(NSURL *assetURL, NSError *error2) { if (error2) { NSLog(@"ERROR: the image failed to be written"); } else { NSLog(@"PHOTO SAVED - assetURL: %@", assetURL); } runOnMainQueueWithoutDeadlocking(^{ [photoCaptureButton setEnabled:YES]; }); }]; }]; } @end ================================================ FILE: examples/iOS/SimplePhotoFilter/SimplePhotoFilter/SimplePhotoFilter-Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleDisplayName ${PRODUCT_NAME} CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier com.sunsetlakesoftware.${PRODUCT_NAME:rfc1034identifier} CFBundleInfoDictionaryVersion 6.0 CFBundleName ${PRODUCT_NAME} CFBundlePackageType APPL CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion 1.0 LSRequiresIPhoneOS UIFileSharingEnabled UIPrerenderedIcon UIRequiredDeviceCapabilities armv7 UISupportedInterfaceOrientations UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UISupportedInterfaceOrientations~ipad UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight ================================================ FILE: examples/iOS/SimplePhotoFilter/SimplePhotoFilter/SimplePhotoFilter-Prefix.pch ================================================ // // Prefix header for all source files of the 'SimplePhotoFilter' target in the 'SimplePhotoFilter' project // #import #ifndef __IPHONE_3_0 #warning "This project uses features only available in iOS SDK 3.0 and later." #endif #ifdef __OBJC__ #import #import #endif ================================================ FILE: examples/iOS/SimplePhotoFilter/SimplePhotoFilter/en.lproj/InfoPlist.strings ================================================ /* Localized versions of Info.plist keys */ ================================================ FILE: examples/iOS/SimplePhotoFilter/SimplePhotoFilter/main.m ================================================ #import #import "PhotoAppDelegate.h" int main(int argc, char *argv[]) { @autoreleasepool { return UIApplicationMain(argc, argv, nil, NSStringFromClass([PhotoAppDelegate class])); } } ================================================ FILE: examples/iOS/SimplePhotoFilter/SimplePhotoFilter.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ BC6ED8E11545B9A900966798 /* AssetsLibrary.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC6ED8E01545B9A900966798 /* AssetsLibrary.framework */; }; BCB3C42D16BCA81D003D26B0 /* Icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C42816BCA81D003D26B0 /* Icon-72.png */; }; BCB3C42E16BCA81D003D26B0 /* Icon-72@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C42916BCA81D003D26B0 /* Icon-72@2x.png */; }; BCB3C42F16BCA81D003D26B0 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C42A16BCA81D003D26B0 /* Icon.png */; }; BCB3C43016BCA81D003D26B0 /* Icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C42B16BCA81D003D26B0 /* Icon@2x.png */; }; BCB3C43116BCA81D003D26B0 /* iTunesArtwork.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C42C16BCA81D003D26B0 /* iTunesArtwork.png */; }; BCC1E6A11523E3620006EFA5 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCC1E6A01523E3620006EFA5 /* UIKit.framework */; }; BCC1E6A31523E3620006EFA5 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCC1E6A21523E3620006EFA5 /* Foundation.framework */; }; BCC1E6A51523E3620006EFA5 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCC1E6A41523E3620006EFA5 /* CoreGraphics.framework */; }; BCC1E6AB1523E3620006EFA5 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = BCC1E6A91523E3620006EFA5 /* InfoPlist.strings */; }; BCC1E6AD1523E3620006EFA5 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC1E6AC1523E3620006EFA5 /* main.m */; }; BCC1E6B11523E3630006EFA5 /* PhotoAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC1E6B01523E3630006EFA5 /* PhotoAppDelegate.m */; }; BCC1E6CA1523E3C50006EFA5 /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCC1E6C61523E3C50006EFA5 /* CoreMedia.framework */; }; BCC1E6CB1523E3C50006EFA5 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCC1E6C71523E3C50006EFA5 /* CoreVideo.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; BCC1E6CC1523E3C50006EFA5 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCC1E6C81523E3C50006EFA5 /* OpenGLES.framework */; }; BCC1E6CD1523E3C50006EFA5 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCC1E6C91523E3C50006EFA5 /* QuartzCore.framework */; }; BCC1E6D01523E4780006EFA5 /* PhotoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC1E6CF1523E4780006EFA5 /* PhotoViewController.m */; }; BCC1E6DA1523E9DC0006EFA5 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCC1E6D91523E9DB0006EFA5 /* AVFoundation.framework */; }; BCC9004B18D7D4F100A5A5C7 /* Lambeau.jpg in Resources */ = {isa = PBXBuildFile; fileRef = BCC9004A18D7D4F100A5A5C7 /* Lambeau.jpg */; }; BCF867371725A72000912E34 /* libGPUImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BCF867321725A70500912E34 /* libGPUImage.a */; }; E5066F561855AA1A008C7682 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E5066F551855AA1A008C7682 /* Default-568h@2x.png */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ BC7E93E619EB236A006D23C3 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BCC1E6B71523E3880006EFA5 /* GPUImage.xcodeproj */; proxyType = 2; remoteGlobalIDString = BCE209E51943F20C002FEED8; remoteInfo = GPUImageFramework; }; BCF867311725A70500912E34 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BCC1E6B71523E3880006EFA5 /* GPUImage.xcodeproj */; proxyType = 2; remoteGlobalIDString = BCF1A33414DDB1EC00852800; remoteInfo = GPUImage; }; BCF867351725A71B00912E34 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BCC1E6B71523E3880006EFA5 /* GPUImage.xcodeproj */; proxyType = 1; remoteGlobalIDString = BCF1A33314DDB1EC00852800; remoteInfo = GPUImage; }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ BC6ED8E01545B9A900966798 /* AssetsLibrary.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AssetsLibrary.framework; path = System/Library/Frameworks/AssetsLibrary.framework; sourceTree = SDKROOT; }; BCB3C42816BCA81D003D26B0 /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-72.png"; path = "../../SharedIcons/Icon-72.png"; sourceTree = ""; }; BCB3C42916BCA81D003D26B0 /* Icon-72@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-72@2x.png"; path = "../../SharedIcons/Icon-72@2x.png"; sourceTree = ""; }; BCB3C42A16BCA81D003D26B0 /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Icon.png; path = ../../SharedIcons/Icon.png; sourceTree = ""; }; BCB3C42B16BCA81D003D26B0 /* Icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon@2x.png"; path = "../../SharedIcons/Icon@2x.png"; sourceTree = ""; }; BCB3C42C16BCA81D003D26B0 /* iTunesArtwork.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = iTunesArtwork.png; path = ../../SharedIcons/iTunesArtwork.png; sourceTree = ""; }; BCC1E69C1523E3620006EFA5 /* SimplePhotoFilter.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SimplePhotoFilter.app; sourceTree = BUILT_PRODUCTS_DIR; }; BCC1E6A01523E3620006EFA5 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; BCC1E6A21523E3620006EFA5 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; BCC1E6A41523E3620006EFA5 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; BCC1E6A81523E3620006EFA5 /* SimplePhotoFilter-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SimplePhotoFilter-Info.plist"; sourceTree = ""; }; BCC1E6AA1523E3620006EFA5 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; BCC1E6AC1523E3620006EFA5 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; BCC1E6AE1523E3620006EFA5 /* SimplePhotoFilter-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SimplePhotoFilter-Prefix.pch"; sourceTree = ""; }; BCC1E6AF1523E3630006EFA5 /* PhotoAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PhotoAppDelegate.h; sourceTree = ""; }; BCC1E6B01523E3630006EFA5 /* PhotoAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PhotoAppDelegate.m; sourceTree = ""; }; BCC1E6B71523E3880006EFA5 /* GPUImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = GPUImage.xcodeproj; path = ../../../framework/GPUImage.xcodeproj; sourceTree = ""; }; BCC1E6C61523E3C50006EFA5 /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; }; BCC1E6C71523E3C50006EFA5 /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = System/Library/Frameworks/CoreVideo.framework; sourceTree = SDKROOT; }; BCC1E6C81523E3C50006EFA5 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; BCC1E6C91523E3C50006EFA5 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; BCC1E6CE1523E4780006EFA5 /* PhotoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PhotoViewController.h; sourceTree = ""; }; BCC1E6CF1523E4780006EFA5 /* PhotoViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PhotoViewController.m; sourceTree = ""; }; BCC1E6D91523E9DB0006EFA5 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; BCC9004A18D7D4F100A5A5C7 /* Lambeau.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; name = Lambeau.jpg; path = ../../SimpleImageFilter/SimpleImageFilter/Lambeau.jpg; sourceTree = ""; }; E5066F551855AA1A008C7682 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ BCC1E6991523E3620006EFA5 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( BCF867371725A72000912E34 /* libGPUImage.a in Frameworks */, BC6ED8E11545B9A900966798 /* AssetsLibrary.framework in Frameworks */, BCC1E6DA1523E9DC0006EFA5 /* AVFoundation.framework in Frameworks */, BCC1E6CA1523E3C50006EFA5 /* CoreMedia.framework in Frameworks */, BCC1E6CB1523E3C50006EFA5 /* CoreVideo.framework in Frameworks */, BCC1E6CC1523E3C50006EFA5 /* OpenGLES.framework in Frameworks */, BCC1E6CD1523E3C50006EFA5 /* QuartzCore.framework in Frameworks */, BCC1E6A11523E3620006EFA5 /* UIKit.framework in Frameworks */, BCC1E6A31523E3620006EFA5 /* Foundation.framework in Frameworks */, BCC1E6A51523E3620006EFA5 /* CoreGraphics.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ BCC1E6911523E3620006EFA5 = { isa = PBXGroup; children = ( E5066F551855AA1A008C7682 /* Default-568h@2x.png */, BCC1E6A61523E3620006EFA5 /* SimplePhotoFilter */, BCC1E69F1523E3620006EFA5 /* Frameworks */, BCC1E69D1523E3620006EFA5 /* Products */, ); sourceTree = ""; }; BCC1E69D1523E3620006EFA5 /* Products */ = { isa = PBXGroup; children = ( BCC1E69C1523E3620006EFA5 /* SimplePhotoFilter.app */, ); name = Products; sourceTree = ""; }; BCC1E69F1523E3620006EFA5 /* Frameworks */ = { isa = PBXGroup; children = ( BCC1E6B71523E3880006EFA5 /* GPUImage.xcodeproj */, BCC1E6C61523E3C50006EFA5 /* CoreMedia.framework */, BCC1E6C71523E3C50006EFA5 /* CoreVideo.framework */, BCC1E6C81523E3C50006EFA5 /* OpenGLES.framework */, BCC1E6C91523E3C50006EFA5 /* QuartzCore.framework */, BCC1E6A01523E3620006EFA5 /* UIKit.framework */, BCC1E6A21523E3620006EFA5 /* Foundation.framework */, BCC1E6A41523E3620006EFA5 /* CoreGraphics.framework */, BC6ED8E01545B9A900966798 /* AssetsLibrary.framework */, BCC1E6D91523E9DB0006EFA5 /* AVFoundation.framework */, ); name = Frameworks; sourceTree = ""; }; BCC1E6A61523E3620006EFA5 /* SimplePhotoFilter */ = { isa = PBXGroup; children = ( BCC1E6AF1523E3630006EFA5 /* PhotoAppDelegate.h */, BCC1E6B01523E3630006EFA5 /* PhotoAppDelegate.m */, BCC1E6CE1523E4780006EFA5 /* PhotoViewController.h */, BCC1E6CF1523E4780006EFA5 /* PhotoViewController.m */, BCC1E6A71523E3620006EFA5 /* Supporting Files */, ); path = SimplePhotoFilter; sourceTree = ""; }; BCC1E6A71523E3620006EFA5 /* Supporting Files */ = { isa = PBXGroup; children = ( BCC9004A18D7D4F100A5A5C7 /* Lambeau.jpg */, BCB3C42816BCA81D003D26B0 /* Icon-72.png */, BCB3C42916BCA81D003D26B0 /* Icon-72@2x.png */, BCB3C42A16BCA81D003D26B0 /* Icon.png */, BCB3C42B16BCA81D003D26B0 /* Icon@2x.png */, BCB3C42C16BCA81D003D26B0 /* iTunesArtwork.png */, BCC1E6A81523E3620006EFA5 /* SimplePhotoFilter-Info.plist */, BCC1E6A91523E3620006EFA5 /* InfoPlist.strings */, BCC1E6AC1523E3620006EFA5 /* main.m */, BCC1E6AE1523E3620006EFA5 /* SimplePhotoFilter-Prefix.pch */, ); name = "Supporting Files"; sourceTree = ""; }; BCF8672C1725A70500912E34 /* Products */ = { isa = PBXGroup; children = ( BCF867321725A70500912E34 /* libGPUImage.a */, BC7E93E719EB236A006D23C3 /* GPUImage.framework */, ); name = Products; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ BCC1E69B1523E3620006EFA5 /* SimplePhotoFilter */ = { isa = PBXNativeTarget; buildConfigurationList = BCC1E6B41523E3630006EFA5 /* Build configuration list for PBXNativeTarget "SimplePhotoFilter" */; buildPhases = ( BCC1E6981523E3620006EFA5 /* Sources */, BCC1E6991523E3620006EFA5 /* Frameworks */, BCC1E69A1523E3620006EFA5 /* Resources */, ); buildRules = ( ); dependencies = ( BCF867361725A71B00912E34 /* PBXTargetDependency */, ); name = SimplePhotoFilter; productName = SimplePhotoFilter; productReference = BCC1E69C1523E3620006EFA5 /* SimplePhotoFilter.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ BCC1E6931523E3620006EFA5 /* Project object */ = { isa = PBXProject; attributes = { CLASSPREFIX = Showcase; LastUpgradeCheck = 0500; ORGANIZATIONNAME = "Cell Phone"; }; buildConfigurationList = BCC1E6961523E3620006EFA5 /* Build configuration list for PBXProject "SimplePhotoFilter" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, ); mainGroup = BCC1E6911523E3620006EFA5; productRefGroup = BCC1E69D1523E3620006EFA5 /* Products */; projectDirPath = ""; projectReferences = ( { ProductGroup = BCF8672C1725A70500912E34 /* Products */; ProjectRef = BCC1E6B71523E3880006EFA5 /* GPUImage.xcodeproj */; }, ); projectRoot = ""; targets = ( BCC1E69B1523E3620006EFA5 /* SimplePhotoFilter */, ); }; /* End PBXProject section */ /* Begin PBXReferenceProxy section */ BC7E93E719EB236A006D23C3 /* GPUImage.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; path = GPUImage.framework; remoteRef = BC7E93E619EB236A006D23C3 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; BCF867321725A70500912E34 /* libGPUImage.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = libGPUImage.a; remoteRef = BCF867311725A70500912E34 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ BCC1E69A1523E3620006EFA5 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( BCC1E6AB1523E3620006EFA5 /* InfoPlist.strings in Resources */, BCC9004B18D7D4F100A5A5C7 /* Lambeau.jpg in Resources */, BCB3C42D16BCA81D003D26B0 /* Icon-72.png in Resources */, BCB3C42E16BCA81D003D26B0 /* Icon-72@2x.png in Resources */, BCB3C42F16BCA81D003D26B0 /* Icon.png in Resources */, BCB3C43016BCA81D003D26B0 /* Icon@2x.png in Resources */, E5066F561855AA1A008C7682 /* Default-568h@2x.png in Resources */, BCB3C43116BCA81D003D26B0 /* iTunesArtwork.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ BCC1E6981523E3620006EFA5 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( BCC1E6AD1523E3620006EFA5 /* main.m in Sources */, BCC1E6B11523E3630006EFA5 /* PhotoAppDelegate.m in Sources */, BCC1E6D01523E4780006EFA5 /* PhotoViewController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ BCF867361725A71B00912E34 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = GPUImage; targetProxy = BCF867351725A71B00912E34 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ BCC1E6A91523E3620006EFA5 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( BCC1E6AA1523E3620006EFA5 /* en */, ); name = InfoPlist.strings; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ BCC1E6B21523E3630006EFA5 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "../../../framework/**"; IPHONEOS_DEPLOYMENT_TARGET = 4.3; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; BCC1E6B31523E3630006EFA5 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "../../../framework/**"; IPHONEOS_DEPLOYMENT_TARGET = 4.3; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; name = Release; }; BCC1E6B51523E3630006EFA5 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "SimplePhotoFilter/SimplePhotoFilter-Prefix.pch"; INFOPLIST_FILE = "SimplePhotoFilter/SimplePhotoFilter-Info.plist"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; name = Debug; }; BCC1E6B61523E3630006EFA5 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "SimplePhotoFilter/SimplePhotoFilter-Prefix.pch"; INFOPLIST_FILE = "SimplePhotoFilter/SimplePhotoFilter-Info.plist"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ BCC1E6961523E3620006EFA5 /* Build configuration list for PBXProject "SimplePhotoFilter" */ = { isa = XCConfigurationList; buildConfigurations = ( BCC1E6B21523E3630006EFA5 /* Debug */, BCC1E6B31523E3630006EFA5 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; BCC1E6B41523E3630006EFA5 /* Build configuration list for PBXNativeTarget "SimplePhotoFilter" */ = { isa = XCConfigurationList; buildConfigurations = ( BCC1E6B51523E3630006EFA5 /* Debug */, BCC1E6B61523E3630006EFA5 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = BCC1E6931523E3620006EFA5 /* Project object */; } ================================================ FILE: examples/iOS/SimplePhotoFilter/SimplePhotoFilter.xcodeproj/xcshareddata/xcschemes/SimplePhotoFilter.xcscheme ================================================ ================================================ FILE: examples/iOS/SimpleSwiftVideoFilterExample/SimpleSwiftVideoFilterExample/AppDelegate.swift ================================================ import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]?) -> Bool { return true } } ================================================ FILE: examples/iOS/SimpleSwiftVideoFilterExample/SimpleSwiftVideoFilterExample/Base.lproj/Main.storyboard ================================================ ================================================ FILE: examples/iOS/SimpleSwiftVideoFilterExample/SimpleSwiftVideoFilterExample/Images.xcassets/AppIcon.appiconset/Contents.json ================================================ { "images" : [ { "idiom" : "iphone", "size" : "29x29", "scale" : "2x" }, { "idiom" : "iphone", "size" : "40x40", "scale" : "2x" }, { "idiom" : "iphone", "size" : "60x60", "scale" : "2x" }, { "idiom" : "ipad", "size" : "29x29", "scale" : "1x" }, { "idiom" : "ipad", "size" : "29x29", "scale" : "2x" }, { "idiom" : "ipad", "size" : "40x40", "scale" : "1x" }, { "idiom" : "ipad", "size" : "40x40", "scale" : "2x" }, { "idiom" : "ipad", "size" : "76x76", "scale" : "1x" }, { "idiom" : "ipad", "size" : "76x76", "scale" : "2x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: examples/iOS/SimpleSwiftVideoFilterExample/SimpleSwiftVideoFilterExample/Images.xcassets/LaunchImage.launchimage/Contents.json ================================================ { "images" : [ { "orientation" : "portrait", "idiom" : "iphone", "extent" : "full-screen", "minimum-system-version" : "7.0", "scale" : "2x" }, { "orientation" : "portrait", "idiom" : "iphone", "subtype" : "retina4", "extent" : "full-screen", "minimum-system-version" : "7.0", "scale" : "2x" }, { "orientation" : "portrait", "idiom" : "ipad", "extent" : "full-screen", "minimum-system-version" : "7.0", "scale" : "1x" }, { "orientation" : "landscape", "idiom" : "ipad", "extent" : "full-screen", "minimum-system-version" : "7.0", "scale" : "1x" }, { "orientation" : "portrait", "idiom" : "ipad", "extent" : "full-screen", "minimum-system-version" : "7.0", "scale" : "2x" }, { "orientation" : "landscape", "idiom" : "ipad", "extent" : "full-screen", "minimum-system-version" : "7.0", "scale" : "2x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: examples/iOS/SimpleSwiftVideoFilterExample/SimpleSwiftVideoFilterExample/Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName ${PRODUCT_NAME} CFBundlePackageType APPL CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion 1 LSRequiresIPhoneOS UIMainStoryboardFile Main UIRequiredDeviceCapabilities armv7 UISupportedInterfaceOrientations UIInterfaceOrientationPortrait ================================================ FILE: examples/iOS/SimpleSwiftVideoFilterExample/SimpleSwiftVideoFilterExample/ViewController.swift ================================================ import UIKit import GPUImage class ViewController: UIViewController { var videoCamera:GPUImageVideoCamera? var filter:GPUImagePixellateFilter? override func viewDidLoad() { super.viewDidLoad() videoCamera = GPUImageVideoCamera(sessionPreset: AVCaptureSessionPreset640x480, cameraPosition: .Back) videoCamera!.outputImageOrientation = .Portrait; filter = GPUImagePixellateFilter() videoCamera?.addTarget(filter) filter?.addTarget(self.view as! GPUImageView) videoCamera?.startCameraCapture() } } ================================================ FILE: examples/iOS/SimpleSwiftVideoFilterExample/SimpleSwiftVideoFilterExample.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ BC73FD2419612C19004A9191 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = BC73FD2319612C19004A9191 /* AppDelegate.swift */; }; BC73FD2619612C19004A9191 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BC73FD2519612C19004A9191 /* ViewController.swift */; }; BC73FD2919612C19004A9191 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BC73FD2719612C19004A9191 /* Main.storyboard */; }; BC73FD2B19612C19004A9191 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BC73FD2A19612C19004A9191 /* Images.xcassets */; }; BC73FD5519612C75004A9191 /* GPUImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC73FD5419612C75004A9191 /* GPUImage.framework */; }; BC73FD5719612C8F004A9191 /* GPUImage.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = BC73FD5419612C75004A9191 /* GPUImage.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ BC73FD4919612C6F004A9191 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BC73FD4419612C4E004A9191 /* GPUImage.xcodeproj */; proxyType = 1; remoteGlobalIDString = BCE209E41943F20C002FEED8; remoteInfo = GPUImageFramework; }; BC73FD4F19612C75004A9191 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BC73FD4419612C4E004A9191 /* GPUImage.xcodeproj */; proxyType = 2; remoteGlobalIDString = BCF1A33414DDB1EC00852800; remoteInfo = GPUImage; }; BC73FD5319612C75004A9191 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BC73FD4419612C4E004A9191 /* GPUImage.xcodeproj */; proxyType = 2; remoteGlobalIDString = BCE209E51943F20C002FEED8; remoteInfo = GPUImageFramework; }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ BC73FD5619612C86004A9191 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( BC73FD5719612C8F004A9191 /* GPUImage.framework in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ BC73FD1E19612C19004A9191 /* SimpleSwiftVideoFilterExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SimpleSwiftVideoFilterExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; BC73FD2219612C19004A9191 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; BC73FD2319612C19004A9191 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; BC73FD2519612C19004A9191 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; BC73FD2819612C19004A9191 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; BC73FD2A19612C19004A9191 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; BC73FD4419612C4E004A9191 /* GPUImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = GPUImage.xcodeproj; path = ../../../framework/GPUImage.xcodeproj; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ BC73FD1B19612C19004A9191 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( BC73FD5519612C75004A9191 /* GPUImage.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ BC73FD1519612C19004A9191 = { isa = PBXGroup; children = ( BC73FD2019612C19004A9191 /* SimpleSwiftVideoFilterExample */, BC73FD4419612C4E004A9191 /* GPUImage.xcodeproj */, BC73FD1F19612C19004A9191 /* Products */, ); sourceTree = ""; }; BC73FD1F19612C19004A9191 /* Products */ = { isa = PBXGroup; children = ( BC73FD1E19612C19004A9191 /* SimpleSwiftVideoFilterExample.app */, ); name = Products; sourceTree = ""; }; BC73FD2019612C19004A9191 /* SimpleSwiftVideoFilterExample */ = { isa = PBXGroup; children = ( BC73FD2319612C19004A9191 /* AppDelegate.swift */, BC73FD2519612C19004A9191 /* ViewController.swift */, BC73FD2719612C19004A9191 /* Main.storyboard */, BC73FD2A19612C19004A9191 /* Images.xcassets */, BC73FD2119612C19004A9191 /* Supporting Files */, ); path = SimpleSwiftVideoFilterExample; sourceTree = ""; }; BC73FD2119612C19004A9191 /* Supporting Files */ = { isa = PBXGroup; children = ( BC73FD2219612C19004A9191 /* Info.plist */, ); name = "Supporting Files"; sourceTree = ""; }; BC73FD4719612C54004A9191 /* Products */ = { isa = PBXGroup; children = ( BC73FD5019612C75004A9191 /* libGPUImage.a */, BC73FD5419612C75004A9191 /* GPUImage.framework */, ); name = Products; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ BC73FD1D19612C19004A9191 /* SimpleSwiftVideoFilterExample */ = { isa = PBXNativeTarget; buildConfigurationList = BC73FD3A19612C19004A9191 /* Build configuration list for PBXNativeTarget "SimpleSwiftVideoFilterExample" */; buildPhases = ( BC73FD1A19612C19004A9191 /* Sources */, BC73FD1B19612C19004A9191 /* Frameworks */, BC73FD5619612C86004A9191 /* CopyFiles */, BC73FD1C19612C19004A9191 /* Resources */, ); buildRules = ( ); dependencies = ( BC73FD4A19612C6F004A9191 /* PBXTargetDependency */, ); name = SimpleSwiftVideoFilterExample; productName = SimpleSwiftVideoFilterExample; productReference = BC73FD1E19612C19004A9191 /* SimpleSwiftVideoFilterExample.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ BC73FD1619612C19004A9191 /* Project object */ = { isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0700; LastUpgradeCheck = 0700; ORGANIZATIONNAME = "Sunset Lake Software"; TargetAttributes = { BC73FD1D19612C19004A9191 = { CreatedOnToolsVersion = 6.0; }; }; }; buildConfigurationList = BC73FD1919612C19004A9191 /* Build configuration list for PBXProject "SimpleSwiftVideoFilterExample" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); mainGroup = BC73FD1519612C19004A9191; productRefGroup = BC73FD1F19612C19004A9191 /* Products */; projectDirPath = ""; projectReferences = ( { ProductGroup = BC73FD4719612C54004A9191 /* Products */; ProjectRef = BC73FD4419612C4E004A9191 /* GPUImage.xcodeproj */; }, ); projectRoot = ""; targets = ( BC73FD1D19612C19004A9191 /* SimpleSwiftVideoFilterExample */, ); }; /* End PBXProject section */ /* Begin PBXReferenceProxy section */ BC73FD5019612C75004A9191 /* libGPUImage.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = libGPUImage.a; remoteRef = BC73FD4F19612C75004A9191 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; BC73FD5419612C75004A9191 /* GPUImage.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; path = GPUImage.framework; remoteRef = BC73FD5319612C75004A9191 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ BC73FD1C19612C19004A9191 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( BC73FD2919612C19004A9191 /* Main.storyboard in Resources */, BC73FD2B19612C19004A9191 /* Images.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ BC73FD1A19612C19004A9191 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( BC73FD2619612C19004A9191 /* ViewController.swift in Sources */, BC73FD2419612C19004A9191 /* AppDelegate.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ BC73FD4A19612C6F004A9191 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = GPUImageFramework; targetProxy = BC73FD4919612C6F004A9191 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ BC73FD2719612C19004A9191 /* Main.storyboard */ = { isa = PBXVariantGroup; children = ( BC73FD2819612C19004A9191 /* Base */, ); name = Main.storyboard; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ BC73FD3819612C19004A9191 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 8.0; METAL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; BC73FD3919612C19004A9191 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 8.0; METAL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; name = Release; }; BC73FD3B19612C19004A9191 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; CODE_SIGN_IDENTITY = "iPhone Developer"; INFOPLIST_FILE = SimpleSwiftVideoFilterExample/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.sunsetlakesoftware.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; }; BC73FD3C19612C19004A9191 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; CODE_SIGN_IDENTITY = "iPhone Developer"; INFOPLIST_FILE = SimpleSwiftVideoFilterExample/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.sunsetlakesoftware.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ BC73FD1919612C19004A9191 /* Build configuration list for PBXProject "SimpleSwiftVideoFilterExample" */ = { isa = XCConfigurationList; buildConfigurations = ( BC73FD3819612C19004A9191 /* Debug */, BC73FD3919612C19004A9191 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; BC73FD3A19612C19004A9191 /* Build configuration list for PBXNativeTarget "SimpleSwiftVideoFilterExample" */ = { isa = XCConfigurationList; buildConfigurations = ( BC73FD3B19612C19004A9191 /* Debug */, BC73FD3C19612C19004A9191 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = BC73FD1619612C19004A9191 /* Project object */; } ================================================ FILE: examples/iOS/SimpleVideoFileFilter/SimpleVideoFileFilter/SimpleVideoFileFilter-Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleDisplayName ${PRODUCT_NAME} CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIconFiles CFBundleIdentifier com.sunsetlakesoftware.${PRODUCT_NAME:rfc1034identifier} CFBundleInfoDictionaryVersion 6.0 CFBundleName ${PRODUCT_NAME} CFBundlePackageType APPL CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion 1.0 LSRequiresIPhoneOS UIFileSharingEnabled UIPrerenderedIcon UIRequiredDeviceCapabilities armv7 UISupportedInterfaceOrientations UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UISupportedInterfaceOrientations~ipad UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight ================================================ FILE: examples/iOS/SimpleVideoFileFilter/SimpleVideoFileFilter/SimpleVideoFileFilter-Prefix.pch ================================================ // // Prefix header for all source files of the 'SimpleVideoFileFilter' target in the 'SimpleVideoFileFilter' project // #import #ifndef __IPHONE_3_0 #warning "This project uses features only available in iOS SDK 3.0 and later." #endif #ifdef __OBJC__ #import #import #endif ================================================ FILE: examples/iOS/SimpleVideoFileFilter/SimpleVideoFileFilter/SimpleVideoFileFilterAppDelegate.h ================================================ #import @class SimpleVideoFileFilterViewController; @interface SimpleVideoFileFilterAppDelegate : UIResponder { SimpleVideoFileFilterViewController *rootViewController; } @property (strong, nonatomic) UIWindow *window; @end ================================================ FILE: examples/iOS/SimpleVideoFileFilter/SimpleVideoFileFilter/SimpleVideoFileFilterAppDelegate.m ================================================ #import "SimpleVideoFileFilterAppDelegate.h" #import "SimpleVideoFileFilterViewController.h" @implementation SimpleVideoFileFilterAppDelegate @synthesize window = _window; - (void)dealloc { [_window release]; [super dealloc]; } - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; // Override point for customization after application launch. self.window.backgroundColor = [UIColor whiteColor]; rootViewController = [[SimpleVideoFileFilterViewController alloc] initWithNibName:@"SimpleVideoFileFilterViewController" bundle:nil]; rootViewController.view.frame = [[UIScreen mainScreen] bounds]; self.window.rootViewController = rootViewController; // [self.window addSubview:rootViewController.view]; [self.window makeKeyAndVisible]; [self.window layoutSubviews]; self.window.rootViewController = rootViewController; return YES; } - (void)applicationWillResignActive:(UIApplication *)application { /* Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. */ } - (void)applicationDidEnterBackground:(UIApplication *)application { /* Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. */ } - (void)applicationWillEnterForeground:(UIApplication *)application { /* Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. */ } - (void)applicationDidBecomeActive:(UIApplication *)application { /* Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. */ } - (void)applicationWillTerminate:(UIApplication *)application { /* Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. */ } @end ================================================ FILE: examples/iOS/SimpleVideoFileFilter/SimpleVideoFileFilter/SimpleVideoFileFilterViewController.h ================================================ #import #import "GPUImage.h" @interface SimpleVideoFileFilterViewController : UIViewController { GPUImageMovie *movieFile; GPUImageOutput *filter; GPUImageMovieWriter *movieWriter; NSTimer * timer; } @property (retain, nonatomic) IBOutlet UILabel *progressLabel; - (IBAction)updatePixelWidth:(id)sender; @end ================================================ FILE: examples/iOS/SimpleVideoFileFilter/SimpleVideoFileFilter/SimpleVideoFileFilterViewController.m ================================================ #import "SimpleVideoFileFilterViewController.h" @implementation SimpleVideoFileFilterViewController - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { } return self; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; } #pragma mark - View lifecycle - (void)viewDidLoad { [super viewDidLoad]; NSURL *sampleURL = [[NSBundle mainBundle] URLForResource:@"sample_iPod" withExtension:@"m4v"]; movieFile = [[GPUImageMovie alloc] initWithURL:sampleURL]; movieFile.runBenchmark = YES; movieFile.playAtActualSpeed = NO; filter = [[GPUImagePixellateFilter alloc] init]; // filter = [[GPUImageUnsharpMaskFilter alloc] init]; [movieFile addTarget:filter]; // Only rotate the video for display, leave orientation the same for recording GPUImageView *filterView = (GPUImageView *)self.view; [filter addTarget:filterView]; // In addition to displaying to the screen, write out a processed version of the movie to disk NSString *pathToMovie = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/Movie.m4v"]; unlink([pathToMovie UTF8String]); // If a file already exists, AVAssetWriter won't let you record new frames, so delete the old movie NSURL *movieURL = [NSURL fileURLWithPath:pathToMovie]; movieWriter = [[GPUImageMovieWriter alloc] initWithMovieURL:movieURL size:CGSizeMake(640.0, 480.0)]; [filter addTarget:movieWriter]; // Configure this for video from the movie file, where we want to preserve all video frames and audio samples movieWriter.shouldPassthroughAudio = YES; movieFile.audioEncodingTarget = movieWriter; [movieFile enableSynchronizedEncodingUsingMovieWriter:movieWriter]; [movieWriter startRecording]; [movieFile startProcessing]; timer = [NSTimer scheduledTimerWithTimeInterval:0.3f target:self selector:@selector(retrievingProgress) userInfo:nil repeats:YES]; [movieWriter setCompletionBlock:^{ [filter removeTarget:movieWriter]; [movieWriter finishRecording]; dispatch_async(dispatch_get_main_queue(), ^{ [timer invalidate]; self.progressLabel.text = @"100%"; }); }]; } - (void)retrievingProgress { self.progressLabel.text = [NSString stringWithFormat:@"%d%%", (int)(movieFile.progress * 100)]; } - (void)viewDidUnload { [self setProgressLabel:nil]; [super viewDidUnload]; } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationPortrait); } - (IBAction)updatePixelWidth:(id)sender { // [(GPUImageUnsharpMaskFilter *)filter setIntensity:[(UISlider *)sender value]]; [(GPUImagePixellateFilter *)filter setFractionalWidthOfAPixel:[(UISlider *)sender value]]; } - (void)dealloc { [_progressLabel release]; [super dealloc]; } @end ================================================ FILE: examples/iOS/SimpleVideoFileFilter/SimpleVideoFileFilter/SimpleVideoFileFilterViewController.xib ================================================ ================================================ FILE: examples/iOS/SimpleVideoFileFilter/SimpleVideoFileFilter/en.lproj/InfoPlist.strings ================================================ /* Localized versions of Info.plist keys */ ================================================ FILE: examples/iOS/SimpleVideoFileFilter/SimpleVideoFileFilter/main.m ================================================ #import #import "SimpleVideoFileFilterAppDelegate.h" int main(int argc, char *argv[]) { @autoreleasepool { return UIApplicationMain(argc, argv, nil, NSStringFromClass([SimpleVideoFileFilterAppDelegate class])); } } ================================================ FILE: examples/iOS/SimpleVideoFileFilter/SimpleVideoFileFilter.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ 466AE00B14F2A196004FE0E5 /* sample_iPod.m4v in Resources */ = {isa = PBXBuildFile; fileRef = 466AE00A14F2A196004FE0E5 /* sample_iPod.m4v */; }; BC11C28315BCBE2300E5BEC7 /* WID-small.jpg in Resources */ = {isa = PBXBuildFile; fileRef = BC11C28215BCBE2300E5BEC7 /* WID-small.jpg */; }; BCB3C43A16BCA871003D26B0 /* Icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C43516BCA871003D26B0 /* Icon-72.png */; }; BCB3C43B16BCA871003D26B0 /* Icon-72@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C43616BCA871003D26B0 /* Icon-72@2x.png */; }; BCB3C43C16BCA871003D26B0 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C43716BCA871003D26B0 /* Icon.png */; }; BCB3C43D16BCA871003D26B0 /* Icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C43816BCA871003D26B0 /* Icon@2x.png */; }; BCB3C43E16BCA871003D26B0 /* iTunesArtwork.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C43916BCA871003D26B0 /* iTunesArtwork.png */; }; BCB5DDCF14E86899000AF3C2 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB5DDCE14E86899000AF3C2 /* UIKit.framework */; }; BCB5DDD114E86899000AF3C2 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB5DDD014E86899000AF3C2 /* Foundation.framework */; }; BCB5DDD314E86899000AF3C2 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB5DDD214E86899000AF3C2 /* CoreGraphics.framework */; }; BCB5DDD914E86899000AF3C2 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = BCB5DDD714E86899000AF3C2 /* InfoPlist.strings */; }; BCB5DDDB14E86899000AF3C2 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB5DDDA14E86899000AF3C2 /* main.m */; }; BCB5DDDF14E86899000AF3C2 /* SimpleVideoFileFilterAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB5DDDE14E86899000AF3C2 /* SimpleVideoFileFilterAppDelegate.m */; }; BCB5DDE814E868C0000AF3C2 /* SimpleVideoFileFilterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB5DDE614E868C0000AF3C2 /* SimpleVideoFileFilterViewController.m */; }; BCB5DDE914E868C0000AF3C2 /* SimpleVideoFileFilterViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = BCB5DDE714E868C0000AF3C2 /* SimpleVideoFileFilterViewController.xib */; }; BCB5DDF914E876DD000AF3C2 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB5DDF814E876DD000AF3C2 /* AVFoundation.framework */; }; BCB5DDFC14E876ED000AF3C2 /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB5DDFA14E876ED000AF3C2 /* CoreMedia.framework */; }; BCB5DDFD14E876ED000AF3C2 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB5DDFB14E876ED000AF3C2 /* CoreVideo.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; BCB5DDFF14E87783000AF3C2 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB5DDFE14E87783000AF3C2 /* QuartzCore.framework */; }; BCB5DE0114E87789000AF3C2 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB5DE0014E87789000AF3C2 /* OpenGLES.framework */; }; BCF867441725AAA300912E34 /* libGPUImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BCF8673F1725AA7E00912E34 /* libGPUImage.a */; }; E5066F5C1855AC55008C7682 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E5066F5B1855AC55008C7682 /* Default-568h@2x.png */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ BC7E93EB19EB2382006D23C3 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BCB5DDEA14E8756A000AF3C2 /* GPUImage.xcodeproj */; proxyType = 2; remoteGlobalIDString = BCE209E51943F20C002FEED8; remoteInfo = GPUImageFramework; }; BCF8673E1725AA7E00912E34 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BCB5DDEA14E8756A000AF3C2 /* GPUImage.xcodeproj */; proxyType = 2; remoteGlobalIDString = BCF1A33414DDB1EC00852800; remoteInfo = GPUImage; }; BCF867421725AA9E00912E34 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BCB5DDEA14E8756A000AF3C2 /* GPUImage.xcodeproj */; proxyType = 1; remoteGlobalIDString = BCF1A33314DDB1EC00852800; remoteInfo = GPUImage; }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ 466AE00A14F2A196004FE0E5 /* sample_iPod.m4v */ = {isa = PBXFileReference; lastKnownFileType = file; path = sample_iPod.m4v; sourceTree = ""; }; BC11C28215BCBE2300E5BEC7 /* WID-small.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "WID-small.jpg"; sourceTree = ""; }; BCB3C43516BCA871003D26B0 /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-72.png"; path = "../../SharedIcons/Icon-72.png"; sourceTree = ""; }; BCB3C43616BCA871003D26B0 /* Icon-72@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-72@2x.png"; path = "../../SharedIcons/Icon-72@2x.png"; sourceTree = ""; }; BCB3C43716BCA871003D26B0 /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Icon.png; path = ../../SharedIcons/Icon.png; sourceTree = ""; }; BCB3C43816BCA871003D26B0 /* Icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon@2x.png"; path = "../../SharedIcons/Icon@2x.png"; sourceTree = ""; }; BCB3C43916BCA871003D26B0 /* iTunesArtwork.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = iTunesArtwork.png; path = ../../SharedIcons/iTunesArtwork.png; sourceTree = ""; }; BCB5DDCA14E86899000AF3C2 /* SimpleVideoFileFilter.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SimpleVideoFileFilter.app; sourceTree = BUILT_PRODUCTS_DIR; }; BCB5DDCE14E86899000AF3C2 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; BCB5DDD014E86899000AF3C2 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; BCB5DDD214E86899000AF3C2 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; BCB5DDD614E86899000AF3C2 /* SimpleVideoFileFilter-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SimpleVideoFileFilter-Info.plist"; sourceTree = ""; }; BCB5DDD814E86899000AF3C2 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; BCB5DDDA14E86899000AF3C2 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; BCB5DDDC14E86899000AF3C2 /* SimpleVideoFileFilter-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SimpleVideoFileFilter-Prefix.pch"; sourceTree = ""; }; BCB5DDDD14E86899000AF3C2 /* SimpleVideoFileFilterAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SimpleVideoFileFilterAppDelegate.h; sourceTree = ""; }; BCB5DDDE14E86899000AF3C2 /* SimpleVideoFileFilterAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SimpleVideoFileFilterAppDelegate.m; sourceTree = ""; }; BCB5DDE514E868C0000AF3C2 /* SimpleVideoFileFilterViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimpleVideoFileFilterViewController.h; sourceTree = ""; }; BCB5DDE614E868C0000AF3C2 /* SimpleVideoFileFilterViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SimpleVideoFileFilterViewController.m; sourceTree = ""; }; BCB5DDE714E868C0000AF3C2 /* SimpleVideoFileFilterViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SimpleVideoFileFilterViewController.xib; sourceTree = ""; }; BCB5DDEA14E8756A000AF3C2 /* GPUImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = GPUImage.xcodeproj; path = ../../../framework/GPUImage.xcodeproj; sourceTree = ""; }; BCB5DDF814E876DD000AF3C2 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; BCB5DDFA14E876ED000AF3C2 /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; }; BCB5DDFB14E876ED000AF3C2 /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = System/Library/Frameworks/CoreVideo.framework; sourceTree = SDKROOT; }; BCB5DDFE14E87783000AF3C2 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; BCB5DE0014E87789000AF3C2 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; E5066F5B1855AC55008C7682 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ BCB5DDC714E86899000AF3C2 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( BCF867441725AAA300912E34 /* libGPUImage.a in Frameworks */, BCB5DE0114E87789000AF3C2 /* OpenGLES.framework in Frameworks */, BCB5DDFF14E87783000AF3C2 /* QuartzCore.framework in Frameworks */, BCB5DDFC14E876ED000AF3C2 /* CoreMedia.framework in Frameworks */, BCB5DDFD14E876ED000AF3C2 /* CoreVideo.framework in Frameworks */, BCB5DDF914E876DD000AF3C2 /* AVFoundation.framework in Frameworks */, BCB5DDCF14E86899000AF3C2 /* UIKit.framework in Frameworks */, BCB5DDD114E86899000AF3C2 /* Foundation.framework in Frameworks */, BCB5DDD314E86899000AF3C2 /* CoreGraphics.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ BCB5DDBF14E86899000AF3C2 = { isa = PBXGroup; children = ( E5066F5B1855AC55008C7682 /* Default-568h@2x.png */, BCB5DDD414E86899000AF3C2 /* SimpleVideoFileFilter */, BCB5DDCD14E86899000AF3C2 /* Frameworks */, BCB5DDCB14E86899000AF3C2 /* Products */, ); sourceTree = ""; }; BCB5DDCB14E86899000AF3C2 /* Products */ = { isa = PBXGroup; children = ( BCB5DDCA14E86899000AF3C2 /* SimpleVideoFileFilter.app */, ); name = Products; sourceTree = ""; }; BCB5DDCD14E86899000AF3C2 /* Frameworks */ = { isa = PBXGroup; children = ( BCB5DDEA14E8756A000AF3C2 /* GPUImage.xcodeproj */, BCB5DE0014E87789000AF3C2 /* OpenGLES.framework */, BCB5DDFE14E87783000AF3C2 /* QuartzCore.framework */, BCB5DDFA14E876ED000AF3C2 /* CoreMedia.framework */, BCB5DDFB14E876ED000AF3C2 /* CoreVideo.framework */, BCB5DDF814E876DD000AF3C2 /* AVFoundation.framework */, BCB5DDCE14E86899000AF3C2 /* UIKit.framework */, BCB5DDD014E86899000AF3C2 /* Foundation.framework */, BCB5DDD214E86899000AF3C2 /* CoreGraphics.framework */, ); name = Frameworks; sourceTree = ""; }; BCB5DDD414E86899000AF3C2 /* SimpleVideoFileFilter */ = { isa = PBXGroup; children = ( BCB5DDDD14E86899000AF3C2 /* SimpleVideoFileFilterAppDelegate.h */, BCB5DDDE14E86899000AF3C2 /* SimpleVideoFileFilterAppDelegate.m */, BCB5DDE514E868C0000AF3C2 /* SimpleVideoFileFilterViewController.h */, BCB5DDE614E868C0000AF3C2 /* SimpleVideoFileFilterViewController.m */, BCB5DDE714E868C0000AF3C2 /* SimpleVideoFileFilterViewController.xib */, BCB5DDD514E86899000AF3C2 /* Supporting Files */, ); path = SimpleVideoFileFilter; sourceTree = ""; }; BCB5DDD514E86899000AF3C2 /* Supporting Files */ = { isa = PBXGroup; children = ( BCB3C43516BCA871003D26B0 /* Icon-72.png */, BCB3C43616BCA871003D26B0 /* Icon-72@2x.png */, BCB3C43716BCA871003D26B0 /* Icon.png */, BCB3C43816BCA871003D26B0 /* Icon@2x.png */, BCB3C43916BCA871003D26B0 /* iTunesArtwork.png */, BC11C28215BCBE2300E5BEC7 /* WID-small.jpg */, 466AE00A14F2A196004FE0E5 /* sample_iPod.m4v */, BCB5DDD614E86899000AF3C2 /* SimpleVideoFileFilter-Info.plist */, BCB5DDD714E86899000AF3C2 /* InfoPlist.strings */, BCB5DDDA14E86899000AF3C2 /* main.m */, BCB5DDDC14E86899000AF3C2 /* SimpleVideoFileFilter-Prefix.pch */, ); name = "Supporting Files"; sourceTree = ""; }; BCF867391725AA7E00912E34 /* Products */ = { isa = PBXGroup; children = ( BCF8673F1725AA7E00912E34 /* libGPUImage.a */, BC7E93EC19EB2382006D23C3 /* GPUImage.framework */, ); name = Products; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ BCB5DDC914E86899000AF3C2 /* SimpleVideoFileFilter */ = { isa = PBXNativeTarget; buildConfigurationList = BCB5DDE214E86899000AF3C2 /* Build configuration list for PBXNativeTarget "SimpleVideoFileFilter" */; buildPhases = ( BCB5DDC614E86899000AF3C2 /* Sources */, BCB5DDC714E86899000AF3C2 /* Frameworks */, BCB5DDC814E86899000AF3C2 /* Resources */, ); buildRules = ( ); dependencies = ( BCF867431725AA9E00912E34 /* PBXTargetDependency */, ); name = SimpleVideoFileFilter; productName = SimpleVideoFileFilter; productReference = BCB5DDCA14E86899000AF3C2 /* SimpleVideoFileFilter.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ BCB5DDC114E86899000AF3C2 /* Project object */ = { isa = PBXProject; attributes = { LastUpgradeCheck = 0600; ORGANIZATIONNAME = "Cell Phone"; }; buildConfigurationList = BCB5DDC414E86899000AF3C2 /* Build configuration list for PBXProject "SimpleVideoFileFilter" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, ); mainGroup = BCB5DDBF14E86899000AF3C2; productRefGroup = BCB5DDCB14E86899000AF3C2 /* Products */; projectDirPath = ""; projectReferences = ( { ProductGroup = BCF867391725AA7E00912E34 /* Products */; ProjectRef = BCB5DDEA14E8756A000AF3C2 /* GPUImage.xcodeproj */; }, ); projectRoot = ""; targets = ( BCB5DDC914E86899000AF3C2 /* SimpleVideoFileFilter */, ); }; /* End PBXProject section */ /* Begin PBXReferenceProxy section */ BC7E93EC19EB2382006D23C3 /* GPUImage.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; path = GPUImage.framework; remoteRef = BC7E93EB19EB2382006D23C3 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; BCF8673F1725AA7E00912E34 /* libGPUImage.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = libGPUImage.a; remoteRef = BCF8673E1725AA7E00912E34 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ BCB5DDC814E86899000AF3C2 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( BCB5DDD914E86899000AF3C2 /* InfoPlist.strings in Resources */, BCB5DDE914E868C0000AF3C2 /* SimpleVideoFileFilterViewController.xib in Resources */, 466AE00B14F2A196004FE0E5 /* sample_iPod.m4v in Resources */, E5066F5C1855AC55008C7682 /* Default-568h@2x.png in Resources */, BC11C28315BCBE2300E5BEC7 /* WID-small.jpg in Resources */, BCB3C43A16BCA871003D26B0 /* Icon-72.png in Resources */, BCB3C43B16BCA871003D26B0 /* Icon-72@2x.png in Resources */, BCB3C43C16BCA871003D26B0 /* Icon.png in Resources */, BCB3C43D16BCA871003D26B0 /* Icon@2x.png in Resources */, BCB3C43E16BCA871003D26B0 /* iTunesArtwork.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ BCB5DDC614E86899000AF3C2 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( BCB5DDDB14E86899000AF3C2 /* main.m in Sources */, BCB5DDDF14E86899000AF3C2 /* SimpleVideoFileFilterAppDelegate.m in Sources */, BCB5DDE814E868C0000AF3C2 /* SimpleVideoFileFilterViewController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ BCF867431725AA9E00912E34 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = GPUImage; targetProxy = BCF867421725AA9E00912E34 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ BCB5DDD714E86899000AF3C2 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( BCB5DDD814E86899000AF3C2 /* en */, ); name = InfoPlist.strings; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ BCB5DDE014E86899000AF3C2 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "../../../framework/**"; IPHONEOS_DEPLOYMENT_TARGET = 4.3; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ( "-ObjC", "-fobjc-arc", ); SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; BCB5DDE114E86899000AF3C2 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "../../../framework/**"; IPHONEOS_DEPLOYMENT_TARGET = 4.3; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; OTHER_LDFLAGS = ( "-ObjC", "-fobjc-arc", ); SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; name = Release; }; BCB5DDE314E86899000AF3C2 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ENABLE_BITCODE = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "SimpleVideoFileFilter/SimpleVideoFileFilter-Prefix.pch"; INFOPLIST_FILE = "SimpleVideoFileFilter/SimpleVideoFileFilter-Info.plist"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; name = Debug; }; BCB5DDE414E86899000AF3C2 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ENABLE_BITCODE = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "SimpleVideoFileFilter/SimpleVideoFileFilter-Prefix.pch"; INFOPLIST_FILE = "SimpleVideoFileFilter/SimpleVideoFileFilter-Info.plist"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ BCB5DDC414E86899000AF3C2 /* Build configuration list for PBXProject "SimpleVideoFileFilter" */ = { isa = XCConfigurationList; buildConfigurations = ( BCB5DDE014E86899000AF3C2 /* Debug */, BCB5DDE114E86899000AF3C2 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; BCB5DDE214E86899000AF3C2 /* Build configuration list for PBXNativeTarget "SimpleVideoFileFilter" */ = { isa = XCConfigurationList; buildConfigurations = ( BCB5DDE314E86899000AF3C2 /* Debug */, BCB5DDE414E86899000AF3C2 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = BCB5DDC114E86899000AF3C2 /* Project object */; } ================================================ FILE: examples/iOS/SimpleVideoFileFilter/SimpleVideoFileFilter.xcodeproj/xcshareddata/xcschemes/SimpleVideoFileFilter.xcscheme ================================================ ================================================ FILE: examples/iOS/SimpleVideoFilter/SimpleVideoFilter/SimpleVideoFilter-Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleDisplayName VideoFilter CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIconFiles CFBundleIdentifier com.sunsetlakesoftware.${PRODUCT_NAME:rfc1034identifier} CFBundleInfoDictionaryVersion 6.0 CFBundleName ${PRODUCT_NAME} CFBundlePackageType APPL CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion 1.0 LSRequiresIPhoneOS UIFileSharingEnabled UIPrerenderedIcon UIRequiredDeviceCapabilities armv7 UISupportedInterfaceOrientations UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UISupportedInterfaceOrientations~ipad UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight ================================================ FILE: examples/iOS/SimpleVideoFilter/SimpleVideoFilter/SimpleVideoFilter-Prefix.pch ================================================ // // Prefix header for all source files of the 'SimpleVideoFilter' target in the 'SimpleVideoFilter' project // #import #ifndef __IPHONE_3_0 #warning "This project uses features only available in iOS SDK 3.0 and later." #endif #ifdef __OBJC__ #import #import #endif ================================================ FILE: examples/iOS/SimpleVideoFilter/SimpleVideoFilter/SimpleVideoFilterAppDelegate.h ================================================ #import @class SimpleVideoFilterViewController; @interface SimpleVideoFilterAppDelegate : UIResponder { SimpleVideoFilterViewController *rootViewController; } @property (strong, nonatomic) UIWindow *window; @end ================================================ FILE: examples/iOS/SimpleVideoFilter/SimpleVideoFilter/SimpleVideoFilterAppDelegate.m ================================================ #import "SimpleVideoFilterAppDelegate.h" #import "SimpleVideoFilterViewController.h" @implementation SimpleVideoFilterAppDelegate @synthesize window = _window; - (void)dealloc { [_window release]; [super dealloc]; } - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; // Override point for customization after application launch. self.window.backgroundColor = [UIColor whiteColor]; rootViewController = [[SimpleVideoFilterViewController alloc] initWithNibName:@"SimpleVideoFilterViewController" bundle:nil]; rootViewController.view.frame = [[UIScreen mainScreen] bounds]; [self.window addSubview:rootViewController.view]; [self.window makeKeyAndVisible]; [self.window layoutSubviews]; self.window.rootViewController = rootViewController; return YES; } - (void)applicationWillResignActive:(UIApplication *)application { /* Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. */ } - (void)applicationDidEnterBackground:(UIApplication *)application { /* Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. */ } - (void)applicationWillEnterForeground:(UIApplication *)application { /* Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. */ } - (void)applicationDidBecomeActive:(UIApplication *)application { /* Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. */ } - (void)applicationWillTerminate:(UIApplication *)application { /* Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. */ } @end ================================================ FILE: examples/iOS/SimpleVideoFilter/SimpleVideoFilter/SimpleVideoFilterViewController.h ================================================ #import #import "GPUImage.h" @interface SimpleVideoFilterViewController : UIViewController { GPUImageVideoCamera *videoCamera; GPUImageOutput *filter; GPUImageMovieWriter *movieWriter; } - (IBAction)updateSliderValue:(id)sender; @end ================================================ FILE: examples/iOS/SimpleVideoFilter/SimpleVideoFilter/SimpleVideoFilterViewController.m ================================================ #import "SimpleVideoFilterViewController.h" #import @implementation SimpleVideoFilterViewController - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { } return self; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; } #pragma mark - View lifecycle - (void)viewDidLoad { [super viewDidLoad]; videoCamera = [[GPUImageVideoCamera alloc] initWithSessionPreset:AVCaptureSessionPreset640x480 cameraPosition:AVCaptureDevicePositionBack]; // videoCamera = [[GPUImageVideoCamera alloc] initWithSessionPreset:AVCaptureSessionPreset640x480 cameraPosition:AVCaptureDevicePositionFront]; // videoCamera = [[GPUImageVideoCamera alloc] initWithSessionPreset:AVCaptureSessionPreset1280x720 cameraPosition:AVCaptureDevicePositionBack]; // videoCamera = [[GPUImageVideoCamera alloc] initWithSessionPreset:AVCaptureSessionPreset1920x1080 cameraPosition:AVCaptureDevicePositionBack]; videoCamera.outputImageOrientation = UIInterfaceOrientationPortrait; videoCamera.horizontallyMirrorFrontFacingCamera = NO; videoCamera.horizontallyMirrorRearFacingCamera = NO; filter = [[GPUImageSepiaFilter alloc] init]; // filter = [[GPUImageTiltShiftFilter alloc] init]; // [(GPUImageTiltShiftFilter *)filter setTopFocusLevel:0.65]; // [(GPUImageTiltShiftFilter *)filter setBottomFocusLevel:0.85]; // [(GPUImageTiltShiftFilter *)filter setBlurSize:1.5]; // [(GPUImageTiltShiftFilter *)filter setFocusFallOffRate:0.2]; // filter = [[GPUImageSketchFilter alloc] init]; // filter = [[GPUImageColorInvertFilter alloc] init]; // filter = [[GPUImageSmoothToonFilter alloc] init]; // GPUImageRotationFilter *rotationFilter = [[GPUImageRotationFilter alloc] initWithRotation:kGPUImageRotateRightFlipVertical]; [videoCamera addTarget:filter]; GPUImageView *filterView = (GPUImageView *)self.view; // filterView.fillMode = kGPUImageFillModeStretch; // filterView.fillMode = kGPUImageFillModePreserveAspectRatioAndFill; // Record a movie for 10 s and store it in /Documents, visible via iTunes file sharing NSString *pathToMovie = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/Movie.m4v"]; unlink([pathToMovie UTF8String]); // If a file already exists, AVAssetWriter won't let you record new frames, so delete the old movie NSURL *movieURL = [NSURL fileURLWithPath:pathToMovie]; movieWriter = [[GPUImageMovieWriter alloc] initWithMovieURL:movieURL size:CGSizeMake(480.0, 640.0)]; movieWriter.encodingLiveVideo = YES; // movieWriter = [[GPUImageMovieWriter alloc] initWithMovieURL:movieURL size:CGSizeMake(640.0, 480.0)]; // movieWriter = [[GPUImageMovieWriter alloc] initWithMovieURL:movieURL size:CGSizeMake(720.0, 1280.0)]; // movieWriter = [[GPUImageMovieWriter alloc] initWithMovieURL:movieURL size:CGSizeMake(1080.0, 1920.0)]; [filter addTarget:movieWriter]; [filter addTarget:filterView]; [videoCamera startCameraCapture]; double delayToStartRecording = 0.5; dispatch_time_t startTime = dispatch_time(DISPATCH_TIME_NOW, delayToStartRecording * NSEC_PER_SEC); dispatch_after(startTime, dispatch_get_main_queue(), ^(void){ NSLog(@"Start recording"); videoCamera.audioEncodingTarget = movieWriter; [movieWriter startRecording]; // NSError *error = nil; // if (![videoCamera.inputCamera lockForConfiguration:&error]) // { // NSLog(@"Error locking for configuration: %@", error); // } // [videoCamera.inputCamera setTorchMode:AVCaptureTorchModeOn]; // [videoCamera.inputCamera unlockForConfiguration]; double delayInSeconds = 10.0; dispatch_time_t stopTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC); dispatch_after(stopTime, dispatch_get_main_queue(), ^(void){ [filter removeTarget:movieWriter]; videoCamera.audioEncodingTarget = nil; [movieWriter finishRecording]; NSLog(@"Movie completed"); ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init]; if ([library videoAtPathIsCompatibleWithSavedPhotosAlbum:movieURL]) { [library writeVideoAtPathToSavedPhotosAlbum:movieURL completionBlock:^(NSURL *assetURL, NSError *error) { dispatch_async(dispatch_get_main_queue(), ^{ if (error) { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Video Saving Failed" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alert show]; } else { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Video Saved" message:@"Saved To Photo Album" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alert show]; } }); }]; } // [videoCamera.inputCamera lockForConfiguration:nil]; // [videoCamera.inputCamera setTorchMode:AVCaptureTorchModeOff]; // [videoCamera.inputCamera unlockForConfiguration]; }); }); } - (void)viewDidUnload { [super viewDidUnload]; } - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation { // Map UIDeviceOrientation to UIInterfaceOrientation. UIInterfaceOrientation orient = UIInterfaceOrientationPortrait; switch ([[UIDevice currentDevice] orientation]) { case UIDeviceOrientationLandscapeLeft: orient = UIInterfaceOrientationLandscapeLeft; break; case UIDeviceOrientationLandscapeRight: orient = UIInterfaceOrientationLandscapeRight; break; case UIDeviceOrientationPortrait: orient = UIInterfaceOrientationPortrait; break; case UIDeviceOrientationPortraitUpsideDown: orient = UIInterfaceOrientationPortraitUpsideDown; break; case UIDeviceOrientationFaceUp: case UIDeviceOrientationFaceDown: case UIDeviceOrientationUnknown: // When in doubt, stay the same. orient = fromInterfaceOrientation; break; } videoCamera.outputImageOrientation = orient; } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return YES; // Support all orientations. } - (IBAction)updateSliderValue:(id)sender { [(GPUImageSepiaFilter *)filter setIntensity:[(UISlider *)sender value]]; } @end ================================================ FILE: examples/iOS/SimpleVideoFilter/SimpleVideoFilter/SimpleVideoFilterViewController.xib ================================================ ================================================ FILE: examples/iOS/SimpleVideoFilter/SimpleVideoFilter/en.lproj/InfoPlist.strings ================================================ /* Localized versions of Info.plist keys */ ================================================ FILE: examples/iOS/SimpleVideoFilter/SimpleVideoFilter/main.m ================================================ #import #import "SimpleVideoFilterAppDelegate.h" int main(int argc, char *argv[]) { @autoreleasepool { return UIApplicationMain(argc, argv, nil, NSStringFromClass([SimpleVideoFilterAppDelegate class])); } } ================================================ FILE: examples/iOS/SimpleVideoFilter/SimpleVideoFilter.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ BCB3C44716BCA8C4003D26B0 /* Icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C44216BCA8C4003D26B0 /* Icon-72.png */; }; BCB3C44816BCA8C4003D26B0 /* Icon-72@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C44316BCA8C4003D26B0 /* Icon-72@2x.png */; }; BCB3C44916BCA8C4003D26B0 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C44416BCA8C4003D26B0 /* Icon.png */; }; BCB3C44A16BCA8C4003D26B0 /* Icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C44516BCA8C4003D26B0 /* Icon@2x.png */; }; BCB3C44B16BCA8C4003D26B0 /* iTunesArtwork.png in Resources */ = {isa = PBXBuildFile; fileRef = BCB3C44616BCA8C4003D26B0 /* iTunesArtwork.png */; }; BCB5DDCF14E86899000AF3C2 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB5DDCE14E86899000AF3C2 /* UIKit.framework */; }; BCB5DDD114E86899000AF3C2 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB5DDD014E86899000AF3C2 /* Foundation.framework */; }; BCB5DDD314E86899000AF3C2 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB5DDD214E86899000AF3C2 /* CoreGraphics.framework */; }; BCB5DDD914E86899000AF3C2 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = BCB5DDD714E86899000AF3C2 /* InfoPlist.strings */; }; BCB5DDDB14E86899000AF3C2 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB5DDDA14E86899000AF3C2 /* main.m */; }; BCB5DDDF14E86899000AF3C2 /* SimpleVideoFilterAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB5DDDE14E86899000AF3C2 /* SimpleVideoFilterAppDelegate.m */; }; BCB5DDE814E868C0000AF3C2 /* SimpleVideoFilterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB5DDE614E868C0000AF3C2 /* SimpleVideoFilterViewController.m */; }; BCB5DDE914E868C0000AF3C2 /* SimpleVideoFilterViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = BCB5DDE714E868C0000AF3C2 /* SimpleVideoFilterViewController.xib */; }; BCB5DDF914E876DD000AF3C2 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB5DDF814E876DD000AF3C2 /* AVFoundation.framework */; }; BCB5DDFC14E876ED000AF3C2 /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB5DDFA14E876ED000AF3C2 /* CoreMedia.framework */; }; BCB5DDFD14E876ED000AF3C2 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB5DDFB14E876ED000AF3C2 /* CoreVideo.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; BCB5DDFF14E87783000AF3C2 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB5DDFE14E87783000AF3C2 /* QuartzCore.framework */; }; BCB5DE0114E87789000AF3C2 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB5DE0014E87789000AF3C2 /* OpenGLES.framework */; }; BCF867511725AB5300912E34 /* libGPUImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BCF8674C1725AB2100912E34 /* libGPUImage.a */; }; D30ACF271BAFE43F00E9759C /* AssetsLibrary.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D30ACF261BAFE43F00E9759C /* AssetsLibrary.framework */; }; E5066F611855AC78008C7682 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E5066F601855AC78008C7682 /* Default-568h@2x.png */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ BC7E93F019EB2398006D23C3 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BCB5DDEA14E8756A000AF3C2 /* GPUImage.xcodeproj */; proxyType = 2; remoteGlobalIDString = BCE209E51943F20C002FEED8; remoteInfo = GPUImageFramework; }; BCF8674B1725AB2100912E34 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BCB5DDEA14E8756A000AF3C2 /* GPUImage.xcodeproj */; proxyType = 2; remoteGlobalIDString = BCF1A33414DDB1EC00852800; remoteInfo = GPUImage; }; BCF8674F1725AB4E00912E34 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BCB5DDEA14E8756A000AF3C2 /* GPUImage.xcodeproj */; proxyType = 1; remoteGlobalIDString = BCF1A33314DDB1EC00852800; remoteInfo = GPUImage; }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ BCB3C44216BCA8C4003D26B0 /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-72.png"; path = "../../SharedIcons/Icon-72.png"; sourceTree = ""; }; BCB3C44316BCA8C4003D26B0 /* Icon-72@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-72@2x.png"; path = "../../SharedIcons/Icon-72@2x.png"; sourceTree = ""; }; BCB3C44416BCA8C4003D26B0 /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Icon.png; path = ../../SharedIcons/Icon.png; sourceTree = ""; }; BCB3C44516BCA8C4003D26B0 /* Icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon@2x.png"; path = "../../SharedIcons/Icon@2x.png"; sourceTree = ""; }; BCB3C44616BCA8C4003D26B0 /* iTunesArtwork.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = iTunesArtwork.png; path = ../../SharedIcons/iTunesArtwork.png; sourceTree = ""; }; BCB5DDCA14E86899000AF3C2 /* SimpleVideoFilter.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SimpleVideoFilter.app; sourceTree = BUILT_PRODUCTS_DIR; }; BCB5DDCE14E86899000AF3C2 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; BCB5DDD014E86899000AF3C2 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; BCB5DDD214E86899000AF3C2 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; BCB5DDD614E86899000AF3C2 /* SimpleVideoFilter-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SimpleVideoFilter-Info.plist"; sourceTree = ""; }; BCB5DDD814E86899000AF3C2 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; BCB5DDDA14E86899000AF3C2 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; BCB5DDDC14E86899000AF3C2 /* SimpleVideoFilter-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SimpleVideoFilter-Prefix.pch"; sourceTree = ""; }; BCB5DDDD14E86899000AF3C2 /* SimpleVideoFilterAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SimpleVideoFilterAppDelegate.h; sourceTree = ""; }; BCB5DDDE14E86899000AF3C2 /* SimpleVideoFilterAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SimpleVideoFilterAppDelegate.m; sourceTree = ""; }; BCB5DDE514E868C0000AF3C2 /* SimpleVideoFilterViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimpleVideoFilterViewController.h; sourceTree = ""; }; BCB5DDE614E868C0000AF3C2 /* SimpleVideoFilterViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SimpleVideoFilterViewController.m; sourceTree = ""; }; BCB5DDE714E868C0000AF3C2 /* SimpleVideoFilterViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SimpleVideoFilterViewController.xib; sourceTree = ""; }; BCB5DDEA14E8756A000AF3C2 /* GPUImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = GPUImage.xcodeproj; path = ../../../framework/GPUImage.xcodeproj; sourceTree = ""; }; BCB5DDF814E876DD000AF3C2 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; BCB5DDFA14E876ED000AF3C2 /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; }; BCB5DDFB14E876ED000AF3C2 /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = System/Library/Frameworks/CoreVideo.framework; sourceTree = SDKROOT; }; BCB5DDFE14E87783000AF3C2 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; BCB5DE0014E87789000AF3C2 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; D30ACF261BAFE43F00E9759C /* AssetsLibrary.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AssetsLibrary.framework; path = System/Library/Frameworks/AssetsLibrary.framework; sourceTree = SDKROOT; }; E5066F601855AC78008C7682 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ BCB5DDC714E86899000AF3C2 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( D30ACF271BAFE43F00E9759C /* AssetsLibrary.framework in Frameworks */, BCF867511725AB5300912E34 /* libGPUImage.a in Frameworks */, BCB5DE0114E87789000AF3C2 /* OpenGLES.framework in Frameworks */, BCB5DDFF14E87783000AF3C2 /* QuartzCore.framework in Frameworks */, BCB5DDFC14E876ED000AF3C2 /* CoreMedia.framework in Frameworks */, BCB5DDFD14E876ED000AF3C2 /* CoreVideo.framework in Frameworks */, BCB5DDF914E876DD000AF3C2 /* AVFoundation.framework in Frameworks */, BCB5DDCF14E86899000AF3C2 /* UIKit.framework in Frameworks */, BCB5DDD114E86899000AF3C2 /* Foundation.framework in Frameworks */, BCB5DDD314E86899000AF3C2 /* CoreGraphics.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ BCB5DDBF14E86899000AF3C2 = { isa = PBXGroup; children = ( E5066F601855AC78008C7682 /* Default-568h@2x.png */, BCB5DDD414E86899000AF3C2 /* SimpleVideoFilter */, BCB5DDCD14E86899000AF3C2 /* Frameworks */, BCB5DDCB14E86899000AF3C2 /* Products */, ); sourceTree = ""; }; BCB5DDCB14E86899000AF3C2 /* Products */ = { isa = PBXGroup; children = ( BCB5DDCA14E86899000AF3C2 /* SimpleVideoFilter.app */, ); name = Products; sourceTree = ""; }; BCB5DDCD14E86899000AF3C2 /* Frameworks */ = { isa = PBXGroup; children = ( D30ACF261BAFE43F00E9759C /* AssetsLibrary.framework */, BCB5DDEA14E8756A000AF3C2 /* GPUImage.xcodeproj */, BCB5DE0014E87789000AF3C2 /* OpenGLES.framework */, BCB5DDFE14E87783000AF3C2 /* QuartzCore.framework */, BCB5DDFA14E876ED000AF3C2 /* CoreMedia.framework */, BCB5DDFB14E876ED000AF3C2 /* CoreVideo.framework */, BCB5DDF814E876DD000AF3C2 /* AVFoundation.framework */, BCB5DDCE14E86899000AF3C2 /* UIKit.framework */, BCB5DDD014E86899000AF3C2 /* Foundation.framework */, BCB5DDD214E86899000AF3C2 /* CoreGraphics.framework */, ); name = Frameworks; sourceTree = ""; }; BCB5DDD414E86899000AF3C2 /* SimpleVideoFilter */ = { isa = PBXGroup; children = ( BCB5DDDD14E86899000AF3C2 /* SimpleVideoFilterAppDelegate.h */, BCB5DDDE14E86899000AF3C2 /* SimpleVideoFilterAppDelegate.m */, BCB5DDE514E868C0000AF3C2 /* SimpleVideoFilterViewController.h */, BCB5DDE614E868C0000AF3C2 /* SimpleVideoFilterViewController.m */, BCB5DDE714E868C0000AF3C2 /* SimpleVideoFilterViewController.xib */, BCB5DDD514E86899000AF3C2 /* Supporting Files */, ); path = SimpleVideoFilter; sourceTree = ""; }; BCB5DDD514E86899000AF3C2 /* Supporting Files */ = { isa = PBXGroup; children = ( BCB3C44216BCA8C4003D26B0 /* Icon-72.png */, BCB3C44316BCA8C4003D26B0 /* Icon-72@2x.png */, BCB3C44416BCA8C4003D26B0 /* Icon.png */, BCB3C44516BCA8C4003D26B0 /* Icon@2x.png */, BCB3C44616BCA8C4003D26B0 /* iTunesArtwork.png */, BCB5DDD614E86899000AF3C2 /* SimpleVideoFilter-Info.plist */, BCB5DDD714E86899000AF3C2 /* InfoPlist.strings */, BCB5DDDA14E86899000AF3C2 /* main.m */, BCB5DDDC14E86899000AF3C2 /* SimpleVideoFilter-Prefix.pch */, ); name = "Supporting Files"; sourceTree = ""; }; BCF867461725AB2100912E34 /* Products */ = { isa = PBXGroup; children = ( BCF8674C1725AB2100912E34 /* libGPUImage.a */, BC7E93F119EB2398006D23C3 /* GPUImage.framework */, ); name = Products; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ BCB5DDC914E86899000AF3C2 /* SimpleVideoFilter */ = { isa = PBXNativeTarget; buildConfigurationList = BCB5DDE214E86899000AF3C2 /* Build configuration list for PBXNativeTarget "SimpleVideoFilter" */; buildPhases = ( BCB5DDC614E86899000AF3C2 /* Sources */, BCB5DDC714E86899000AF3C2 /* Frameworks */, BCB5DDC814E86899000AF3C2 /* Resources */, ); buildRules = ( ); dependencies = ( BCF867501725AB4E00912E34 /* PBXTargetDependency */, ); name = SimpleVideoFilter; productName = SimpleVideoFilter; productReference = BCB5DDCA14E86899000AF3C2 /* SimpleVideoFilter.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ BCB5DDC114E86899000AF3C2 /* Project object */ = { isa = PBXProject; attributes = { LastUpgradeCheck = 0500; ORGANIZATIONNAME = "Cell Phone"; TargetAttributes = { BCB5DDC914E86899000AF3C2 = { DevelopmentTeam = V2DTUY5PQ8; }; }; }; buildConfigurationList = BCB5DDC414E86899000AF3C2 /* Build configuration list for PBXProject "SimpleVideoFilter" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, ); mainGroup = BCB5DDBF14E86899000AF3C2; productRefGroup = BCB5DDCB14E86899000AF3C2 /* Products */; projectDirPath = ""; projectReferences = ( { ProductGroup = BCF867461725AB2100912E34 /* Products */; ProjectRef = BCB5DDEA14E8756A000AF3C2 /* GPUImage.xcodeproj */; }, ); projectRoot = ""; targets = ( BCB5DDC914E86899000AF3C2 /* SimpleVideoFilter */, ); }; /* End PBXProject section */ /* Begin PBXReferenceProxy section */ BC7E93F119EB2398006D23C3 /* GPUImage.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; path = GPUImage.framework; remoteRef = BC7E93F019EB2398006D23C3 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; BCF8674C1725AB2100912E34 /* libGPUImage.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = libGPUImage.a; remoteRef = BCF8674B1725AB2100912E34 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ BCB5DDC814E86899000AF3C2 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( BCB5DDD914E86899000AF3C2 /* InfoPlist.strings in Resources */, BCB5DDE914E868C0000AF3C2 /* SimpleVideoFilterViewController.xib in Resources */, BCB3C44716BCA8C4003D26B0 /* Icon-72.png in Resources */, BCB3C44816BCA8C4003D26B0 /* Icon-72@2x.png in Resources */, BCB3C44916BCA8C4003D26B0 /* Icon.png in Resources */, E5066F611855AC78008C7682 /* Default-568h@2x.png in Resources */, BCB3C44A16BCA8C4003D26B0 /* Icon@2x.png in Resources */, BCB3C44B16BCA8C4003D26B0 /* iTunesArtwork.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ BCB5DDC614E86899000AF3C2 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( BCB5DDDB14E86899000AF3C2 /* main.m in Sources */, BCB5DDDF14E86899000AF3C2 /* SimpleVideoFilterAppDelegate.m in Sources */, BCB5DDE814E868C0000AF3C2 /* SimpleVideoFilterViewController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ BCF867501725AB4E00912E34 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = GPUImage; targetProxy = BCF8674F1725AB4E00912E34 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ BCB5DDD714E86899000AF3C2 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( BCB5DDD814E86899000AF3C2 /* en */, ); name = InfoPlist.strings; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ BCB5DDE014E86899000AF3C2 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "../../../framework/**"; IPHONEOS_DEPLOYMENT_TARGET = 7.0; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ( "-ObjC", "-fobjc-arc", ); SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; BCB5DDE114E86899000AF3C2 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "../../../framework/**"; IPHONEOS_DEPLOYMENT_TARGET = 7.0; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; OTHER_LDFLAGS = ( "-ObjC", "-fobjc-arc", ); SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; name = Release; }; BCB5DDE314E86899000AF3C2 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { CODE_SIGN_IDENTITY = "iPhone Developer"; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "SimpleVideoFilter/SimpleVideoFilter-Prefix.pch"; INFOPLIST_FILE = "SimpleVideoFilter/SimpleVideoFilter-Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 6.0; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; name = Debug; }; BCB5DDE414E86899000AF3C2 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { CODE_SIGN_IDENTITY = "iPhone Developer"; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "SimpleVideoFilter/SimpleVideoFilter-Prefix.pch"; INFOPLIST_FILE = "SimpleVideoFilter/SimpleVideoFilter-Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 6.0; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ BCB5DDC414E86899000AF3C2 /* Build configuration list for PBXProject "SimpleVideoFilter" */ = { isa = XCConfigurationList; buildConfigurations = ( BCB5DDE014E86899000AF3C2 /* Debug */, BCB5DDE114E86899000AF3C2 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; BCB5DDE214E86899000AF3C2 /* Build configuration list for PBXNativeTarget "SimpleVideoFilter" */ = { isa = XCConfigurationList; buildConfigurations = ( BCB5DDE314E86899000AF3C2 /* Debug */, BCB5DDE414E86899000AF3C2 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = BCB5DDC114E86899000AF3C2 /* Project object */; } ================================================ FILE: examples/iOS/SimpleVideoFilter/SimpleVideoFilter.xcodeproj/xcshareddata/xcschemes/SimpleVideoFilter.xcscheme ================================================ ================================================ FILE: framework/GPUImage.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXAggregateTarget section */ BC552B361558C6F4001F3FFA /* Documentation */ = { isa = PBXAggregateTarget; buildConfigurationList = BC552B371558C6F4001F3FFA /* Build configuration list for PBXAggregateTarget "Documentation" */; buildPhases = ( BC552B3A1558C6FC001F3FFA /* ShellScript */, ); dependencies = ( ); name = Documentation; productName = Documentation; }; /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ 0DF3FA2B14FA00C9006AF7D9 /* GPUImageVignetteFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 0DF3FA2914FA00C9006AF7D9 /* GPUImageVignetteFilter.h */; }; 0DF3FA2C14FA00C9006AF7D9 /* GPUImageVignetteFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 0DF3FA2A14FA00C9006AF7D9 /* GPUImageVignetteFilter.m */; }; 4308B1D715F7EED30014437A /* GPUImageNormalBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 4308B1D515F7EED10014437A /* GPUImageNormalBlendFilter.h */; }; 4308B1D815F7EED30014437A /* GPUImageNormalBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 4308B1D615F7EED20014437A /* GPUImageNormalBlendFilter.m */; }; 4686952F155AACAC0060BA43 /* GPUImageSourceOverBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 4686952D155AACAC0060BA43 /* GPUImageSourceOverBlendFilter.h */; }; 46869530155AACAC0060BA43 /* GPUImageSourceOverBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 4686952E155AACAC0060BA43 /* GPUImageSourceOverBlendFilter.m */; }; 46A8097816B8A48E000C29ED /* GPUImageTwoInputCrossTextureSamplingFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A8097616B8A48E000C29ED /* GPUImageTwoInputCrossTextureSamplingFilter.h */; }; 46A8097916B8A48E000C29ED /* GPUImageTwoInputCrossTextureSamplingFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 46A8097716B8A48E000C29ED /* GPUImageTwoInputCrossTextureSamplingFilter.m */; }; 574B5D8A1BEA3CC000F4EC5A /* GPUImageColorConversion.m in Sources */ = {isa = PBXBuildFile; fileRef = 574B5D891BEA3CC000F4EC5A /* GPUImageColorConversion.m */; }; 574B5D8B1BEA3CC000F4EC5A /* GPUImageColorConversion.m in Sources */ = {isa = PBXBuildFile; fileRef = 574B5D891BEA3CC000F4EC5A /* GPUImageColorConversion.m */; }; 574B5D8D1BEA3E5B00F4EC5A /* GPUImageColorConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = 574B5D8C1BEA3E5B00F4EC5A /* GPUImageColorConversion.h */; }; 574B5D8E1BEA3E5B00F4EC5A /* GPUImageColorConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = 574B5D8C1BEA3E5B00F4EC5A /* GPUImageColorConversion.h */; settings = {ATTRIBUTES = (Public, ); }; }; 6D13DBE6151AA804000B23BA /* GPUImageHazeFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 6D13DBE4151AA804000B23BA /* GPUImageHazeFilter.h */; }; 6D13DBE7151AA804000B23BA /* GPUImageHazeFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 6D13DBE5151AA804000B23BA /* GPUImageHazeFilter.m */; }; 6EE27493150E8FC60040DDB6 /* GPUImageGrayscaleFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 6EE27491150E8FC50040DDB6 /* GPUImageGrayscaleFilter.h */; }; 6EE27494150E8FC60040DDB6 /* GPUImageGrayscaleFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 6EE27492150E8FC50040DDB6 /* GPUImageGrayscaleFilter.m */; }; 79F8FD151C8B2A620095AB3E /* GPUImageSolarizeFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 79F8FD131C8B2A620095AB3E /* GPUImageSolarizeFilter.h */; }; 79F8FD161C8B2A620095AB3E /* GPUImageSolarizeFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 79F8FD141C8B2A620095AB3E /* GPUImageSolarizeFilter.m */; }; 79F8FD171C8B2AA00095AB3E /* GPUImageSolarizeFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 79F8FD131C8B2A620095AB3E /* GPUImageSolarizeFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; 79F8FD181C8B2AA60095AB3E /* GPUImageSolarizeFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 79F8FD141C8B2A620095AB3E /* GPUImageSolarizeFilter.m */; }; 83AE9F981540DFE500F7FC13 /* GPUImageSubtractBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 83AE9F961540DFE400F7FC13 /* GPUImageSubtractBlendFilter.h */; }; 83AE9F991540DFE500F7FC13 /* GPUImageSubtractBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 83AE9F971540DFE500F7FC13 /* GPUImageSubtractBlendFilter.m */; }; 83AE9FCD1540E92800F7FC13 /* GPUImageMaskFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 83AE9FCB1540E92800F7FC13 /* GPUImageMaskFilter.h */; }; 83AE9FCE1540E92800F7FC13 /* GPUImageMaskFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 83AE9FCC1540E92800F7FC13 /* GPUImageMaskFilter.m */; }; 84FFC80B1936408F00994258 /* GPUImagePicture+TextureSubimage.h in Headers */ = {isa = PBXBuildFile; fileRef = 84FFC8091936408F00994258 /* GPUImagePicture+TextureSubimage.h */; }; 84FFC80C1936408F00994258 /* GPUImagePicture+TextureSubimage.m in Sources */ = {isa = PBXBuildFile; fileRef = 84FFC80A1936408F00994258 /* GPUImagePicture+TextureSubimage.m */; }; 96781B2F15C38DCF005FA0D7 /* GPUImageAmatorkaFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 96781B2D15C38DCF005FA0D7 /* GPUImageAmatorkaFilter.h */; }; 96781B3015C38DCF005FA0D7 /* GPUImageAmatorkaFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 96781B2E15C38DCF005FA0D7 /* GPUImageAmatorkaFilter.m */; }; 96781B3415C39E80005FA0D7 /* GPUImageMissEtikateFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 96781B3215C39E80005FA0D7 /* GPUImageMissEtikateFilter.h */; }; 96781B3515C39E80005FA0D7 /* GPUImageMissEtikateFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 96781B3315C39E80005FA0D7 /* GPUImageMissEtikateFilter.m */; }; 96781B4615C3A6F1005FA0D7 /* GPUImageSoftEleganceFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 96781B4415C3A6F0005FA0D7 /* GPUImageSoftEleganceFilter.h */; }; 96781B4715C3A6F1005FA0D7 /* GPUImageSoftEleganceFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 96781B4515C3A6F0005FA0D7 /* GPUImageSoftEleganceFilter.m */; }; 96DD3C1415C2780500DF637E /* GPUImageLookupFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 96DD3C1215C2780500DF637E /* GPUImageLookupFilter.h */; }; 96DD3C1515C2780500DF637E /* GPUImageLookupFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 96DD3C1315C2780500DF637E /* GPUImageLookupFilter.m */; }; A4741D5019A91F87005EE1A4 /* GPUImageHistogramEqualizationFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = A4741D4E19A91F87005EE1A4 /* GPUImageHistogramEqualizationFilter.h */; }; A4741D5119A91F87005EE1A4 /* GPUImageHistogramEqualizationFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = A4741D4F19A91F87005EE1A4 /* GPUImageHistogramEqualizationFilter.m */; }; B80171E616311FCB001C8D16 /* GPUImageHueBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = B80171E416311FCB001C8D16 /* GPUImageHueBlendFilter.h */; }; B80171E716311FCB001C8D16 /* GPUImageHueBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = B80171E516311FCB001C8D16 /* GPUImageHueBlendFilter.m */; }; B80171FE16312800001C8D16 /* GPUImageSaturationBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = B80171FC16312800001C8D16 /* GPUImageSaturationBlendFilter.h */; }; B80171FF16312800001C8D16 /* GPUImageSaturationBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = B80171FD16312800001C8D16 /* GPUImageSaturationBlendFilter.m */; }; B801722F16313151001C8D16 /* GPUImageLuminosityBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = B801722D16313151001C8D16 /* GPUImageLuminosityBlendFilter.h */; }; B801723016313151001C8D16 /* GPUImageLuminosityBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = B801722E16313151001C8D16 /* GPUImageLuminosityBlendFilter.m */; }; B81521A214F1BA6A00F105F8 /* GPUImageColorMatrixFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = B81521A014F1BA6A00F105F8 /* GPUImageColorMatrixFilter.h */; }; B81521A314F1BA6A00F105F8 /* GPUImageColorMatrixFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = B81521A114F1BA6A00F105F8 /* GPUImageColorMatrixFilter.m */; }; B81F2D751788C95500118374 /* GPUImageHSBFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = B81F2D731788C95500118374 /* GPUImageHSBFilter.h */; }; B81F2D761788C95500118374 /* GPUImageHSBFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = B81F2D741788C95500118374 /* GPUImageHSBFilter.m */; }; B8EF4E95162F85850036E5B3 /* GPUImageLevelsFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = B8EF4E93162F85850036E5B3 /* GPUImageLevelsFilter.h */; }; B8EF4E96162F85850036E5B3 /* GPUImageLevelsFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = B8EF4E94162F85850036E5B3 /* GPUImageLevelsFilter.m */; }; BC0147E415BEFE6800FC2B6D /* GPUImageGlassSphereFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC0147E215BEFE6800FC2B6D /* GPUImageGlassSphereFilter.h */; }; BC0147E515BEFE6800FC2B6D /* GPUImageGlassSphereFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC0147E315BEFE6800FC2B6D /* GPUImageGlassSphereFilter.m */; }; BC01E82D155CA3F1004C75C3 /* GPUImageMedianFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC01E82B155CA3F1004C75C3 /* GPUImageMedianFilter.h */; }; BC01E82E155CA3F1004C75C3 /* GPUImageMedianFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC01E82C155CA3F1004C75C3 /* GPUImageMedianFilter.m */; }; BC01E832155CA5E2004C75C3 /* GPUImage3x3TextureSamplingFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC01E830155CA5E1004C75C3 /* GPUImage3x3TextureSamplingFilter.h */; }; BC01E833155CA5E2004C75C3 /* GPUImage3x3TextureSamplingFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC01E831155CA5E1004C75C3 /* GPUImage3x3TextureSamplingFilter.m */; }; BC0690B8157C0C28009274F9 /* GPUImageTwoPassTextureSamplingFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC0690B6157C0C27009274F9 /* GPUImageTwoPassTextureSamplingFilter.h */; }; BC0690B9157C0C28009274F9 /* GPUImageTwoPassTextureSamplingFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC0690B7157C0C28009274F9 /* GPUImageTwoPassTextureSamplingFilter.m */; }; BC0690BD157C1B38009274F9 /* GPUImageOpeningFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC0690BB157C1B37009274F9 /* GPUImageOpeningFilter.h */; }; BC0690BE157C1B38009274F9 /* GPUImageOpeningFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC0690BC157C1B38009274F9 /* GPUImageOpeningFilter.m */; }; BC0690C1157C2368009274F9 /* GPUImageClosingFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC0690BF157C2366009274F9 /* GPUImageClosingFilter.h */; }; BC0690C2157C2368009274F9 /* GPUImageClosingFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC0690C0157C2367009274F9 /* GPUImageClosingFilter.m */; }; BC0690D0157C2EBA009274F9 /* GPUImageRGBDilationFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC0690CE157C2EB9009274F9 /* GPUImageRGBDilationFilter.h */; }; BC0690D1157C2EBA009274F9 /* GPUImageRGBDilationFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC0690CF157C2EBA009274F9 /* GPUImageRGBDilationFilter.m */; }; BC0690D5157C31C9009274F9 /* GPUImageRGBErosionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC0690D3157C31C9009274F9 /* GPUImageRGBErosionFilter.h */; }; BC0690D6157C31C9009274F9 /* GPUImageRGBErosionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC0690D4157C31C9009274F9 /* GPUImageRGBErosionFilter.m */; }; BC0690D9157C33B9009274F9 /* GPUImageRGBOpeningFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC0690D7157C33B8009274F9 /* GPUImageRGBOpeningFilter.h */; }; BC0690DA157C33B9009274F9 /* GPUImageRGBOpeningFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC0690D8157C33B8009274F9 /* GPUImageRGBOpeningFilter.m */; }; BC0690DD157C344D009274F9 /* GPUImageRGBClosingFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC0690DB157C344B009274F9 /* GPUImageRGBClosingFilter.h */; }; BC0690DE157C344D009274F9 /* GPUImageRGBClosingFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC0690DC157C344C009274F9 /* GPUImageRGBClosingFilter.m */; }; BC0690F7157C5075009274F9 /* GPUImageColorPackingFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC0690F5157C5075009274F9 /* GPUImageColorPackingFilter.h */; }; BC0690F8157C5075009274F9 /* GPUImageColorPackingFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC0690F6157C5075009274F9 /* GPUImageColorPackingFilter.m */; }; BC114898155AF65400F107AF /* GPUImageTwoInputFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC114896155AF65400F107AF /* GPUImageTwoInputFilter.h */; }; BC114899155AF65400F107AF /* GPUImageTwoInputFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC114897155AF65400F107AF /* GPUImageTwoInputFilter.m */; }; BC185E7A16B866AD00EA01AD /* GPUImageLinearBurnBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC185E7816B866AD00EA01AD /* GPUImageLinearBurnBlendFilter.h */; }; BC185E7B16B866AD00EA01AD /* GPUImageLinearBurnBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC185E7916B866AD00EA01AD /* GPUImageLinearBurnBlendFilter.m */; }; BC185E7E16B866CE00EA01AD /* GPUImageGaussianBlurPositionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC185E7C16B866CE00EA01AD /* GPUImageGaussianBlurPositionFilter.h */; }; BC185E7F16B866CE00EA01AD /* GPUImageGaussianBlurPositionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC185E7D16B866CE00EA01AD /* GPUImageGaussianBlurPositionFilter.m */; }; BC185E8216B866F000EA01AD /* GPUImagePixellatePositionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC185E8016B866F000EA01AD /* GPUImagePixellatePositionFilter.h */; }; BC185E8316B866F000EA01AD /* GPUImagePixellatePositionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC185E8116B866F000EA01AD /* GPUImagePixellatePositionFilter.m */; }; BC1A47F514FC759D00D552E8 /* GPUImageGaussianBlurFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 0D04CB7B14FB2A29001D6733 /* GPUImageGaussianBlurFilter.m */; }; BC1A483E14FD1EF900D552E8 /* GPUImageGaussianBlurFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 0D04CB7A14FB2A29001D6733 /* GPUImageGaussianBlurFilter.h */; }; BC1B715714F49DAA00ACA2AB /* GPUImageRawDataOutput.h in Headers */ = {isa = PBXBuildFile; fileRef = BC1B715514F49DAA00ACA2AB /* GPUImageRawDataOutput.h */; }; BC1B715814F49DAA00ACA2AB /* GPUImageRawDataOutput.m in Sources */ = {isa = PBXBuildFile; fileRef = BC1B715614F49DAA00ACA2AB /* GPUImageRawDataOutput.m */; }; BC1B717C14F566E200ACA2AB /* GPUImageSketchFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC1B717A14F566E200ACA2AB /* GPUImageSketchFilter.h */; }; BC1B717D14F566E200ACA2AB /* GPUImageSketchFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC1B717B14F566E200ACA2AB /* GPUImageSketchFilter.m */; }; BC1B718E14F56C1D00ACA2AB /* GPUImageSwirlFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC1B718C14F56C1D00ACA2AB /* GPUImageSwirlFilter.h */; }; BC1B718F14F56C1D00ACA2AB /* GPUImageSwirlFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC1B718D14F56C1D00ACA2AB /* GPUImageSwirlFilter.m */; }; BC1B728114FB16AF00ACA2AB /* GPUImageMovieWriter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC1B727F14FB16AF00ACA2AB /* GPUImageMovieWriter.h */; }; BC1B728214FB16AF00ACA2AB /* GPUImageMovieWriter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC1B728014FB16AF00ACA2AB /* GPUImageMovieWriter.m */; }; BC1BBFA8193BC55B0025FC88 /* GPUImageFASTCornerDetectionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC1BBFA6193BC55B0025FC88 /* GPUImageFASTCornerDetectionFilter.h */; }; BC1BBFA9193BC55B0025FC88 /* GPUImageFASTCornerDetectionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC1BBFA7193BC55B0025FC88 /* GPUImageFASTCornerDetectionFilter.m */; }; BC245DCA14DDBED7009FE7EB /* GPUImageFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC245DC814DDBED7009FE7EB /* GPUImageFilter.h */; }; BC245DCB14DDBED7009FE7EB /* GPUImageFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC245DC914DDBED7009FE7EB /* GPUImageFilter.m */; }; BC27A3CB15654F5A004F2D45 /* GPUImagePerlinNoiseFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC27A3C915654F5A004F2D45 /* GPUImagePerlinNoiseFilter.h */; }; BC27A3CC15654F5A004F2D45 /* GPUImagePerlinNoiseFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC27A3CA15654F5A004F2D45 /* GPUImagePerlinNoiseFilter.m */; }; BC3AA4B21C11104B003B7561 /* GPUImageColourFASTFeatureDetector.h in Headers */ = {isa = PBXBuildFile; fileRef = BC44A42C1C110D4500B0DAA0 /* GPUImageColourFASTFeatureDetector.h */; settings = {ATTRIBUTES = (Public, ); }; }; BC3AA4B31C11104E003B7561 /* GPUImageColourFASTSamplingOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = BC44A42E1C110D4500B0DAA0 /* GPUImageColourFASTSamplingOperation.h */; settings = {ATTRIBUTES = (Public, ); }; }; BC3AA4B41C111054003B7561 /* GPUImageColourFASTFeatureDetector.m in Sources */ = {isa = PBXBuildFile; fileRef = BC44A42D1C110D4500B0DAA0 /* GPUImageColourFASTFeatureDetector.m */; }; BC3AA4B51C111057003B7561 /* GPUImageColourFASTSamplingOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = BC44A42F1C110D4500B0DAA0 /* GPUImageColourFASTSamplingOperation.m */; }; BC3AC8B015E6F6170065144E /* GPUImageAverageColor.h in Headers */ = {isa = PBXBuildFile; fileRef = BC3AC8AE15E6F6170065144E /* GPUImageAverageColor.h */; }; BC3AC8B115E6F6170065144E /* GPUImageAverageColor.m in Sources */ = {isa = PBXBuildFile; fileRef = BC3AC8AF15E6F6170065144E /* GPUImageAverageColor.m */; }; BC44A4301C110D4500B0DAA0 /* GPUImageColourFASTFeatureDetector.h in Headers */ = {isa = PBXBuildFile; fileRef = BC44A42C1C110D4500B0DAA0 /* GPUImageColourFASTFeatureDetector.h */; }; BC44A4311C110D4500B0DAA0 /* GPUImageColourFASTFeatureDetector.m in Sources */ = {isa = PBXBuildFile; fileRef = BC44A42D1C110D4500B0DAA0 /* GPUImageColourFASTFeatureDetector.m */; }; BC44A4321C110D4500B0DAA0 /* GPUImageColourFASTSamplingOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = BC44A42E1C110D4500B0DAA0 /* GPUImageColourFASTSamplingOperation.h */; }; BC44A4331C110D4500B0DAA0 /* GPUImageColourFASTSamplingOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = BC44A42F1C110D4500B0DAA0 /* GPUImageColourFASTSamplingOperation.m */; }; BC4D03CF160919AE00F64358 /* GPUImageHalftoneFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC4D03CD160919AE00F64358 /* GPUImageHalftoneFilter.h */; }; BC4D03D0160919AE00F64358 /* GPUImageHalftoneFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC4D03CE160919AE00F64358 /* GPUImageHalftoneFilter.m */; }; BC54D563151904FF003F4A41 /* GPUImageChromaKeyBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC54D561151904FF003F4A41 /* GPUImageChromaKeyBlendFilter.h */; }; BC54D564151904FF003F4A41 /* GPUImageChromaKeyBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC54D562151904FF003F4A41 /* GPUImageChromaKeyBlendFilter.m */; }; BC56D82A1579779700CC9C1E /* GPUImageUIElement.h in Headers */ = {isa = PBXBuildFile; fileRef = BC56D8281579779700CC9C1E /* GPUImageUIElement.h */; }; BC56D82B1579779700CC9C1E /* GPUImageUIElement.m in Sources */ = {isa = PBXBuildFile; fileRef = BC56D8291579779700CC9C1E /* GPUImageUIElement.m */; }; BC56D84A157ADA4F00CC9C1E /* GPUImageDilationFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC56D848157ADA4F00CC9C1E /* GPUImageDilationFilter.h */; }; BC56D84B157ADA4F00CC9C1E /* GPUImageDilationFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC56D849157ADA4F00CC9C1E /* GPUImageDilationFilter.m */; }; BC56D84F157ADA6F00CC9C1E /* GPUImageErosionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC56D84D157ADA6F00CC9C1E /* GPUImageErosionFilter.h */; }; BC56D850157ADA6F00CC9C1E /* GPUImageErosionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC56D84E157ADA6F00CC9C1E /* GPUImageErosionFilter.m */; }; BC57607919441DD90096FFA5 /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB5E77814E20BAF00701302 /* CoreMedia.framework */; }; BC57607A19441DE00096FFA5 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB5E77614E20BA800701302 /* CoreVideo.framework */; }; BC57607B19441DE80096FFA5 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB5E77414E20B9700701302 /* OpenGLES.framework */; }; BC57607C19441DF10096FFA5 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB5E77214E20B9100701302 /* QuartzCore.framework */; }; BC57607D19441DF60096FFA5 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB5E77014E20B8A00701302 /* AVFoundation.framework */; }; BC57607E19441E010096FFA5 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB5E76E14E20B7F00701302 /* UIKit.framework */; }; BC57607F19441E060096FFA5 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCF1A33714DDB1EC00852800 /* Foundation.framework */; }; BC57608019441E610096FFA5 /* GPUImageContext.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB5E76B14E20AD700701302 /* GPUImageContext.m */; }; BC61F4B116B9CAEB009F6234 /* GPUImagePoissonBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 46A8097C16B8A6A2000C29ED /* GPUImagePoissonBlendFilter.m */; }; BC6C55401730679D00EB222D /* GPUImageLaplacianFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC6C553E1730679D00EB222D /* GPUImageLaplacianFilter.h */; }; BC6C55411730679D00EB222D /* GPUImageLaplacianFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC6C553F1730679D00EB222D /* GPUImageLaplacianFilter.m */; }; BC6ED9C21549CA0600966798 /* GPUImageHistogramFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC6ED9C01549CA0600966798 /* GPUImageHistogramFilter.h */; }; BC6ED9C31549CA0600966798 /* GPUImageHistogramFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC6ED9C11549CA0600966798 /* GPUImageHistogramFilter.m */; }; BC73FC021944008500671325 /* GPUImageFramework.h in Headers */ = {isa = PBXBuildFile; fileRef = BC73FC011944008500671325 /* GPUImageFramework.h */; }; BC76CE9B15813818008B45D3 /* GPUImageSphereRefractionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC76CE9915813818008B45D3 /* GPUImageSphereRefractionFilter.h */; }; BC76CE9C15813818008B45D3 /* GPUImageSphereRefractionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC76CE9A15813818008B45D3 /* GPUImageSphereRefractionFilter.m */; }; BC7CC63515605A3500468085 /* GPUImageBilateralFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC7CC63315605A3500468085 /* GPUImageBilateralFilter.h */; }; BC7CC63615605A3500468085 /* GPUImageBilateralFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC7CC63415605A3500468085 /* GPUImageBilateralFilter.m */; }; BC7CC69C1562C4BB00468085 /* GPUImageCrosshairGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = BC7CC69A1562C4BA00468085 /* GPUImageCrosshairGenerator.h */; }; BC7CC69D1562C4BB00468085 /* GPUImageCrosshairGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = BC7CC69B1562C4BA00468085 /* GPUImageCrosshairGenerator.m */; }; BC7D95D51523EE67000DF037 /* GPUImageStillCamera.h in Headers */ = {isa = PBXBuildFile; fileRef = BC7D95D31523EE67000DF037 /* GPUImageStillCamera.h */; }; BC7D95D61523EE67000DF037 /* GPUImageStillCamera.m in Sources */ = {isa = PBXBuildFile; fileRef = BC7D95D41523EE67000DF037 /* GPUImageStillCamera.m */; }; BC8A583C1813060F00E6B507 /* GPUImageiOSBlurFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC8A583A1813060F00E6B507 /* GPUImageiOSBlurFilter.h */; }; BC8A583D1813060F00E6B507 /* GPUImageiOSBlurFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC8A583B1813060F00E6B507 /* GPUImageiOSBlurFilter.m */; }; BC8A584B18131E4B00E6B507 /* GPUImageLuminanceRangeFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC8A584918131E4B00E6B507 /* GPUImageLuminanceRangeFilter.h */; }; BC8A584C18131E4B00E6B507 /* GPUImageLuminanceRangeFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC8A584A18131E4B00E6B507 /* GPUImageLuminanceRangeFilter.m */; }; BC95C4081622763D002C4BC7 /* GPUImageHoughTransformLineDetector.h in Headers */ = {isa = PBXBuildFile; fileRef = BC95C4061622763D002C4BC7 /* GPUImageHoughTransformLineDetector.h */; }; BC95C4091622763D002C4BC7 /* GPUImageHoughTransformLineDetector.m in Sources */ = {isa = PBXBuildFile; fileRef = BC95C4071622763D002C4BC7 /* GPUImageHoughTransformLineDetector.m */; }; BC982B5314F07F790001FF6F /* GPUImageColorInvertFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC982B4F14F07F790001FF6F /* GPUImageColorInvertFilter.h */; }; BC982B5414F07F790001FF6F /* GPUImageColorInvertFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC982B5014F07F790001FF6F /* GPUImageColorInvertFilter.m */; }; BC982B5514F07F790001FF6F /* GPUImageSaturationFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC982B5114F07F790001FF6F /* GPUImageSaturationFilter.h */; }; BC982B5614F07F790001FF6F /* GPUImageSaturationFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC982B5214F07F790001FF6F /* GPUImageSaturationFilter.m */; }; BC982B6714F092EF0001FF6F /* GPUImageContrastFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC982B6514F092EF0001FF6F /* GPUImageContrastFilter.h */; }; BC982B6814F092EF0001FF6F /* GPUImageContrastFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC982B6614F092EF0001FF6F /* GPUImageContrastFilter.m */; }; BC982B7914F098CC0001FF6F /* GPUImageBrightnessFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC982B7714F098CC0001FF6F /* GPUImageBrightnessFilter.h */; }; BC982B7A14F098CC0001FF6F /* GPUImageBrightnessFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC982B7814F098CC0001FF6F /* GPUImageBrightnessFilter.m */; }; BC982B7E14F09F980001FF6F /* GPUImageGammaFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC982B7C14F09F980001FF6F /* GPUImageGammaFilter.h */; }; BC982B7F14F09F980001FF6F /* GPUImageGammaFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC982B7D14F09F980001FF6F /* GPUImageGammaFilter.m */; }; BC982B9914F0B34E0001FF6F /* GPUImageSobelEdgeDetectionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC982B9714F0B34E0001FF6F /* GPUImageSobelEdgeDetectionFilter.h */; }; BC982B9A14F0B34E0001FF6F /* GPUImageSobelEdgeDetectionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC982B9814F0B34E0001FF6F /* GPUImageSobelEdgeDetectionFilter.m */; }; BC982BEB14F1CE600001FF6F /* GPUImageDissolveBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC982BE714F1CE600001FF6F /* GPUImageDissolveBlendFilter.h */; }; BC982BEC14F1CE600001FF6F /* GPUImageDissolveBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC982BE814F1CE600001FF6F /* GPUImageDissolveBlendFilter.m */; }; BC982BED14F1CE600001FF6F /* GPUImageMultiplyBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC982BE914F1CE600001FF6F /* GPUImageMultiplyBlendFilter.h */; }; BC982BEE14F1CE600001FF6F /* GPUImageMultiplyBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC982BEA14F1CE600001FF6F /* GPUImageMultiplyBlendFilter.m */; }; BC982C4714F29E580001FF6F /* GPUImageKuwaharaFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC982C4514F29E580001FF6F /* GPUImageKuwaharaFilter.h */; }; BC982C4814F29E580001FF6F /* GPUImageKuwaharaFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC982C4614F29E580001FF6F /* GPUImageKuwaharaFilter.m */; }; BC982C6E14F33C2A0001FF6F /* GPUImageMovie.h in Headers */ = {isa = PBXBuildFile; fileRef = BC982C6A14F33C290001FF6F /* GPUImageMovie.h */; }; BC982C6F14F33C2A0001FF6F /* GPUImageMovie.m in Sources */ = {isa = PBXBuildFile; fileRef = BC982C6B14F33C2A0001FF6F /* GPUImageMovie.m */; }; BC982C7014F33C2A0001FF6F /* GPUImageOverlayBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC982C6C14F33C2A0001FF6F /* GPUImageOverlayBlendFilter.h */; }; BC982C7114F33C2A0001FF6F /* GPUImageOverlayBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC982C6D14F33C2A0001FF6F /* GPUImageOverlayBlendFilter.m */; }; BC982C8114F34F0C0001FF6F /* GPUImageDarkenBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC982C7D14F34F0B0001FF6F /* GPUImageDarkenBlendFilter.h */; }; BC982C8214F34F0C0001FF6F /* GPUImageDarkenBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC982C7E14F34F0B0001FF6F /* GPUImageDarkenBlendFilter.m */; }; BC982C8314F34F0C0001FF6F /* GPUImageLightenBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC982C7F14F34F0C0001FF6F /* GPUImageLightenBlendFilter.h */; }; BC982C8414F34F0C0001FF6F /* GPUImageLightenBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC982C8014F34F0C0001FF6F /* GPUImageLightenBlendFilter.m */; }; BC982C9F14F35C2D0001FF6F /* GPUImageToonFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC982C9D14F35C2D0001FF6F /* GPUImageToonFilter.h */; }; BC982CA014F35C2D0001FF6F /* GPUImageToonFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC982C9E14F35C2D0001FF6F /* GPUImageToonFilter.m */; }; BC99234E15EFFC8700ED2C8C /* GPUImageChromaKeyFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC99234C15EFFC8700ED2C8C /* GPUImageChromaKeyFilter.h */; }; BC99234F15EFFC8700ED2C8C /* GPUImageChromaKeyFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC99234D15EFFC8700ED2C8C /* GPUImageChromaKeyFilter.m */; }; BC99235315EFFC9700ED2C8C /* GPUImageWhiteBalanceFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC99235115EFFC9700ED2C8C /* GPUImageWhiteBalanceFilter.h */; }; BC99235415EFFC9700ED2C8C /* GPUImageWhiteBalanceFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC99235215EFFC9700ED2C8C /* GPUImageWhiteBalanceFilter.m */; }; BCA464CC1627C1BD00C0F68E /* GPUImageLineGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA464CA1627C1BC00C0F68E /* GPUImageLineGenerator.h */; }; BCA464CD1627C1BD00C0F68E /* GPUImageLineGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = BCA464CB1627C1BC00C0F68E /* GPUImageLineGenerator.m */; }; BCA632811623C80800EEB24F /* GPUImageThresholdedNonMaximumSuppressionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA6327F1623C80800EEB24F /* GPUImageThresholdedNonMaximumSuppressionFilter.h */; }; BCA632821623C80800EEB24F /* GPUImageThresholdedNonMaximumSuppressionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCA632801623C80800EEB24F /* GPUImageThresholdedNonMaximumSuppressionFilter.m */; }; BCA632861623D18B00EEB24F /* GPUImageParallelCoordinateLineTransformFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA632841623D18B00EEB24F /* GPUImageParallelCoordinateLineTransformFilter.h */; }; BCA632871623D18B00EEB24F /* GPUImageParallelCoordinateLineTransformFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCA632851623D18B00EEB24F /* GPUImageParallelCoordinateLineTransformFilter.m */; }; BCA6328A1623DD0E00EEB24F /* GPUImageThresholdSketchFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA632881623DD0E00EEB24F /* GPUImageThresholdSketchFilter.h */; }; BCA6328B1623DD0E00EEB24F /* GPUImageThresholdSketchFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCA632891623DD0E00EEB24F /* GPUImageThresholdSketchFilter.m */; }; BCAA73BC1C18E42400BC2D31 /* GPUImageFourInputFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCAA73BA1C18E42400BC2D31 /* GPUImageFourInputFilter.h */; }; BCAA73BD1C18E42400BC2D31 /* GPUImageFourInputFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCAA73BB1C18E42400BC2D31 /* GPUImageFourInputFilter.m */; }; BCAA73BE1C18E42D00BC2D31 /* GPUImageFourInputFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCAA73BA1C18E42400BC2D31 /* GPUImageFourInputFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCAA73BF1C18E43400BC2D31 /* GPUImageFourInputFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCAA73BB1C18E42400BC2D31 /* GPUImageFourInputFilter.m */; }; BCABED8E15263CF20098A93E /* GPUImagePolarPixellateFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCABED8A15263CF20098A93E /* GPUImagePolarPixellateFilter.h */; }; BCABED8F15263CF20098A93E /* GPUImagePolarPixellateFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCABED8B15263CF20098A93E /* GPUImagePolarPixellateFilter.m */; }; BCABED9015263CF20098A93E /* GPUImageStretchDistortionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCABED8C15263CF20098A93E /* GPUImageStretchDistortionFilter.h */; }; BCABED9115263CF20098A93E /* GPUImageStretchDistortionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCABED8D15263CF20098A93E /* GPUImageStretchDistortionFilter.m */; }; BCAD0978154F39CA00278521 /* GPUImagePrewittEdgeDetectionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCAD0976154F39C900278521 /* GPUImagePrewittEdgeDetectionFilter.h */; }; BCAD0979154F39CA00278521 /* GPUImagePrewittEdgeDetectionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCAD0977154F39CA00278521 /* GPUImagePrewittEdgeDetectionFilter.m */; }; BCAD097D154F3CB000278521 /* GPUImageXYDerivativeFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCAD097B154F3CAF00278521 /* GPUImageXYDerivativeFilter.h */; }; BCAD097E154F3CB000278521 /* GPUImageXYDerivativeFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCAD097C154F3CB000278521 /* GPUImageXYDerivativeFilter.m */; }; BCAD0981154F7B2800278521 /* GPUImageHarrisCornerDetectionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCAD097F154F7B2700278521 /* GPUImageHarrisCornerDetectionFilter.h */; }; BCAD0982154F7B2800278521 /* GPUImageHarrisCornerDetectionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCAD0980154F7B2800278521 /* GPUImageHarrisCornerDetectionFilter.m */; }; BCAD0985154F931C00278521 /* GPUImageAlphaBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCAD0983154F931C00278521 /* GPUImageAlphaBlendFilter.h */; }; BCAD0986154F931C00278521 /* GPUImageAlphaBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCAD0984154F931C00278521 /* GPUImageAlphaBlendFilter.m */; }; BCAD099F15506F6F00278521 /* GPUImageNonMaximumSuppressionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCAD099D15506F6E00278521 /* GPUImageNonMaximumSuppressionFilter.h */; }; BCAD09A015506F6F00278521 /* GPUImageNonMaximumSuppressionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCAD099E15506F6E00278521 /* GPUImageNonMaximumSuppressionFilter.m */; }; BCAD4C9E156F0D8F001E50E1 /* GPUImageShiTomasiFeatureDetectionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCAD4C9C156F0D8E001E50E1 /* GPUImageShiTomasiFeatureDetectionFilter.h */; }; BCAD4C9F156F0D8F001E50E1 /* GPUImageShiTomasiFeatureDetectionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCAD4C9D156F0D8E001E50E1 /* GPUImageShiTomasiFeatureDetectionFilter.m */; }; BCAD4CA3156F0F35001E50E1 /* GPUImageNobleCornerDetectionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCAD4CA1156F0F35001E50E1 /* GPUImageNobleCornerDetectionFilter.h */; }; BCAD4CA4156F0F35001E50E1 /* GPUImageNobleCornerDetectionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCAD4CA2156F0F35001E50E1 /* GPUImageNobleCornerDetectionFilter.m */; }; BCAD4D0F15718AD2001E50E1 /* GPUImageSingleComponentGaussianBlurFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCAD4D0D15718ACF001E50E1 /* GPUImageSingleComponentGaussianBlurFilter.h */; }; BCAD4D1015718AD2001E50E1 /* GPUImageSingleComponentGaussianBlurFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCAD4D0E15718AD0001E50E1 /* GPUImageSingleComponentGaussianBlurFilter.m */; }; BCAD4D1415718F9E001E50E1 /* GPUImageDirectionalSobelEdgeDetectionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCAD4D1215718F9A001E50E1 /* GPUImageDirectionalSobelEdgeDetectionFilter.h */; }; BCAD4D1515718F9E001E50E1 /* GPUImageDirectionalSobelEdgeDetectionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCAD4D1315718F9C001E50E1 /* GPUImageDirectionalSobelEdgeDetectionFilter.m */; }; BCAD4D1C1571B410001E50E1 /* GPUImageDirectionalNonMaximumSuppressionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCAD4D1A1571B410001E50E1 /* GPUImageDirectionalNonMaximumSuppressionFilter.h */; }; BCAD4D1D1571B410001E50E1 /* GPUImageDirectionalNonMaximumSuppressionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCAD4D1B1571B410001E50E1 /* GPUImageDirectionalNonMaximumSuppressionFilter.m */; }; BCAD4D201571CB50001E50E1 /* GPUImageWeakPixelInclusionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCAD4D1E1571CB48001E50E1 /* GPUImageWeakPixelInclusionFilter.h */; }; BCAD4D211571CB50001E50E1 /* GPUImageWeakPixelInclusionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCAD4D1F1571CB4C001E50E1 /* GPUImageWeakPixelInclusionFilter.m */; }; BCB030BE173400BC001A1A20 /* GPUImageThreeInputFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB030BC173400BC001A1A20 /* GPUImageThreeInputFilter.h */; }; BCB030BF173400BC001A1A20 /* GPUImageThreeInputFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB030BD173400BC001A1A20 /* GPUImageThreeInputFilter.m */; }; BCB3B46515F2BA9300EDA3BE /* GPUImageLowPassFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB3B46315F2BA9300EDA3BE /* GPUImageLowPassFilter.h */; }; BCB3B46615F2BA9300EDA3BE /* GPUImageLowPassFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB3B46415F2BA9300EDA3BE /* GPUImageLowPassFilter.m */; }; BCB3B46A15F2FD1B00EDA3BE /* GPUImageHighPassFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB3B46815F2FD1B00EDA3BE /* GPUImageHighPassFilter.h */; }; BCB3B46B15F2FD1B00EDA3BE /* GPUImageHighPassFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB3B46915F2FD1B00EDA3BE /* GPUImageHighPassFilter.m */; }; BCB3B47915F3108700EDA3BE /* GPUImageMotionDetector.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB3B47715F3108700EDA3BE /* GPUImageMotionDetector.h */; }; BCB3B47A15F3108700EDA3BE /* GPUImageMotionDetector.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB3B47815F3108700EDA3BE /* GPUImageMotionDetector.m */; }; BCB5DE0D14E87F32000AF3C2 /* GPUImagePixellateFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB5DE0B14E87F32000AF3C2 /* GPUImagePixellateFilter.h */; }; BCB5DE0E14E87F32000AF3C2 /* GPUImagePixellateFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB5DE0C14E87F32000AF3C2 /* GPUImagePixellateFilter.m */; }; BCB5E75C14E2086300701302 /* GPUImageView.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB5E75A14E2086300701302 /* GPUImageView.h */; }; BCB5E75D14E2086300701302 /* GPUImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB5E75B14E2086300701302 /* GPUImageView.m */; }; BCB5E76514E208D700701302 /* GPUImageVideoCamera.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB5E76314E208D600701302 /* GPUImageVideoCamera.h */; }; BCB5E76614E208D700701302 /* GPUImageVideoCamera.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB5E76414E208D600701302 /* GPUImageVideoCamera.m */; }; BCB5E76C14E20AD700701302 /* GPUImageContext.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB5E76A14E20AD700701302 /* GPUImageContext.h */; }; BCB5E76D14E20AD700701302 /* GPUImageContext.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB5E76B14E20AD700701302 /* GPUImageContext.m */; }; BCB5E76F14E20B8000701302 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB5E76E14E20B7F00701302 /* UIKit.framework */; }; BCB5E77114E20B8A00701302 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB5E77014E20B8A00701302 /* AVFoundation.framework */; }; BCB5E77314E20B9100701302 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB5E77214E20B9100701302 /* QuartzCore.framework */; }; BCB5E77514E20B9700701302 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB5E77414E20B9700701302 /* OpenGLES.framework */; }; BCB5E77714E20BA800701302 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB5E77614E20BA800701302 /* CoreVideo.framework */; settings = {ATTRIBUTES = (Required, ); }; }; BCB5E77914E20BAF00701302 /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB5E77814E20BAF00701302 /* CoreMedia.framework */; }; BCB5E77F14E22E4300701302 /* GPUImageOutput.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB5E77D14E22E4200701302 /* GPUImageOutput.h */; }; BCB5E78014E22E4300701302 /* GPUImageOutput.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB5E77E14E22E4200701302 /* GPUImageOutput.m */; }; BCB5E79414E3275200701302 /* GLProgram.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB5E79214E3275100701302 /* GLProgram.h */; }; BCB5E79514E3275200701302 /* GLProgram.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB5E79314E3275200701302 /* GLProgram.m */; }; BCB5E7C214E4B6D400701302 /* GPUImageSepiaFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB5E7C014E4B6D400701302 /* GPUImageSepiaFilter.h */; }; BCB5E7C314E4B6D400701302 /* GPUImageSepiaFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB5E7C114E4B6D400701302 /* GPUImageSepiaFilter.m */; }; BCB5E7DA14E6003400701302 /* GPUImagePicture.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB5E7D814E6003400701302 /* GPUImagePicture.h */; }; BCB5E7DB14E6003400701302 /* GPUImagePicture.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB5E7D914E6003400701302 /* GPUImagePicture.m */; }; BCB6B837150400030041703B /* GPUImageExposureFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB6B833150400030041703B /* GPUImageExposureFilter.h */; }; BCB6B838150400030041703B /* GPUImageExposureFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB6B834150400030041703B /* GPUImageExposureFilter.m */; }; BCB6B839150400030041703B /* GPUImageSharpenFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB6B835150400030041703B /* GPUImageSharpenFilter.h */; }; BCB6B83A150400030041703B /* GPUImageSharpenFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB6B836150400030041703B /* GPUImageSharpenFilter.m */; }; BCB6B85615041A920041703B /* GPUImageColorBurnBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB6B85015041A920041703B /* GPUImageColorBurnBlendFilter.h */; }; BCB6B85715041A920041703B /* GPUImageColorBurnBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB6B85115041A920041703B /* GPUImageColorBurnBlendFilter.m */; }; BCB6B85815041A920041703B /* GPUImageColorDodgeBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB6B85215041A920041703B /* GPUImageColorDodgeBlendFilter.h */; }; BCB6B85915041A920041703B /* GPUImageColorDodgeBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB6B85315041A920041703B /* GPUImageColorDodgeBlendFilter.m */; }; BCB6B85A15041A920041703B /* GPUImageScreenBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB6B85415041A920041703B /* GPUImageScreenBlendFilter.h */; }; BCB6B85B15041A920041703B /* GPUImageScreenBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB6B85515041A920041703B /* GPUImageScreenBlendFilter.m */; }; BCB6B8701504234A0041703B /* GPUImageDifferenceBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB6B868150423490041703B /* GPUImageDifferenceBlendFilter.h */; }; BCB6B8711504234A0041703B /* GPUImageDifferenceBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB6B8691504234A0041703B /* GPUImageDifferenceBlendFilter.m */; }; BCB6B8721504234A0041703B /* GPUImageExclusionBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB6B86A1504234A0041703B /* GPUImageExclusionBlendFilter.h */; }; BCB6B8731504234A0041703B /* GPUImageExclusionBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB6B86B1504234A0041703B /* GPUImageExclusionBlendFilter.m */; }; BCB6B8741504234A0041703B /* GPUImageHardLightBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB6B86C1504234A0041703B /* GPUImageHardLightBlendFilter.h */; }; BCB6B8751504234A0041703B /* GPUImageHardLightBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB6B86D1504234A0041703B /* GPUImageHardLightBlendFilter.m */; }; BCB6B8761504234A0041703B /* GPUImageSoftLightBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB6B86E1504234A0041703B /* GPUImageSoftLightBlendFilter.h */; }; BCB6B8771504234A0041703B /* GPUImageSoftLightBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB6B86F1504234A0041703B /* GPUImageSoftLightBlendFilter.m */; }; BCB6B8BB1505BF940041703B /* GPUImageTextureOutput.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB6B8B91505BF940041703B /* GPUImageTextureOutput.h */; }; BCB6B8BC1505BF940041703B /* GPUImageTextureOutput.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB6B8BA1505BF940041703B /* GPUImageTextureOutput.m */; }; BCB6B9041507CA8D0041703B /* GPUImageCropFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB6B9021507CA8C0041703B /* GPUImageCropFilter.h */; }; BCB6B9051507CA8D0041703B /* GPUImageCropFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB6B9031507CA8C0041703B /* GPUImageCropFilter.m */; }; BCB79E1015EBE1A700965D92 /* GPUImageSolidColorGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB79E0E15EBE1A600965D92 /* GPUImageSolidColorGenerator.h */; }; BCB79E1115EBE1A700965D92 /* GPUImageSolidColorGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB79E0F15EBE1A600965D92 /* GPUImageSolidColorGenerator.m */; }; BCB79E5F15EC131A00965D92 /* GPUImageLuminosity.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB79E5D15EC131A00965D92 /* GPUImageLuminosity.h */; }; BCB79E6015EC131A00965D92 /* GPUImageLuminosity.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB79E5E15EC131A00965D92 /* GPUImageLuminosity.m */; }; BCB79E7A15EC2A8400965D92 /* GPUImageAverageLuminanceThresholdFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB79E7815EC2A8300965D92 /* GPUImageAverageLuminanceThresholdFilter.h */; }; BCB79E7B15EC2A8400965D92 /* GPUImageAverageLuminanceThresholdFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB79E7915EC2A8300965D92 /* GPUImageAverageLuminanceThresholdFilter.m */; }; BCBC604D16C58B0900B11741 /* GPUImageMotionBlurFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCBC604B16C58B0900B11741 /* GPUImageMotionBlurFilter.h */; }; BCBC604E16C58B0900B11741 /* GPUImageMotionBlurFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCBC604C16C58B0900B11741 /* GPUImageMotionBlurFilter.m */; }; BCBC605716C8527C00B11741 /* GPUImageZoomBlurFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCBC605516C8527C00B11741 /* GPUImageZoomBlurFilter.h */; }; BCBC605816C8527C00B11741 /* GPUImageZoomBlurFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCBC605616C8527C00B11741 /* GPUImageZoomBlurFilter.m */; }; BCBCE9991595021B00E0ED33 /* GPUImageMonochromeFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCBCE9971595021B00E0ED33 /* GPUImageMonochromeFilter.h */; }; BCBCE99A1595021B00E0ED33 /* GPUImageMonochromeFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCBCE9981595021B00E0ED33 /* GPUImageMonochromeFilter.m */; }; BCBCE9D5159944AC00E0ED33 /* GPUImageBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = BCBCE9D3159944AB00E0ED33 /* GPUImageBuffer.h */; }; BCBCE9D6159944AC00E0ED33 /* GPUImageBuffer.m in Sources */ = {isa = PBXBuildFile; fileRef = BCBCE9D4159944AB00E0ED33 /* GPUImageBuffer.m */; }; BCBF617A16E4F44600E2784A /* GPUImageKuwaharaRadius3Filter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCBF617816E4F44600E2784A /* GPUImageKuwaharaRadius3Filter.h */; }; BCBF617B16E4F44700E2784A /* GPUImageKuwaharaRadius3Filter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCBF617916E4F44600E2784A /* GPUImageKuwaharaRadius3Filter.m */; }; BCBF617D16E4F69B00E2784A /* GPUImagePoissonBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A8097B16B8A6A2000C29ED /* GPUImagePoissonBlendFilter.h */; }; BCC11D72154B44DC0044F5A0 /* GPUImageHistogramGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC11D70154B44DC0044F5A0 /* GPUImageHistogramGenerator.h */; }; BCC11D73154B44DC0044F5A0 /* GPUImageHistogramGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC11D71154B44DC0044F5A0 /* GPUImageHistogramGenerator.m */; }; BCC1E5A8151E74B20006EFA5 /* GPUImagePosterizeFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC1E5A6151E74B20006EFA5 /* GPUImagePosterizeFilter.h */; }; BCC1E5A9151E74B20006EFA5 /* GPUImagePosterizeFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC1E5A7151E74B20006EFA5 /* GPUImagePosterizeFilter.m */; }; BCC1E5B8151E83700006EFA5 /* GPUImageFilterGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC1E5B6151E83700006EFA5 /* GPUImageFilterGroup.h */; }; BCC1E5B9151E83700006EFA5 /* GPUImageFilterGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC1E5B7151E83700006EFA5 /* GPUImageFilterGroup.m */; }; BCC1E5C7151EA12B0006EFA5 /* GPUImageBoxBlurFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC1E5C5151EA12B0006EFA5 /* GPUImageBoxBlurFilter.h */; }; BCC1E5C8151EA12B0006EFA5 /* GPUImageBoxBlurFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC1E5C6151EA12B0006EFA5 /* GPUImageBoxBlurFilter.m */; }; BCC1E5CC151EA6610006EFA5 /* GPUImageAdaptiveThresholdFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC1E5CA151EA6610006EFA5 /* GPUImageAdaptiveThresholdFilter.h */; }; BCC1E5CD151EA6610006EFA5 /* GPUImageAdaptiveThresholdFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC1E5CB151EA6610006EFA5 /* GPUImageAdaptiveThresholdFilter.m */; }; BCC1E610152156620006EFA5 /* GPUImageUnsharpMaskFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC1E60E152156620006EFA5 /* GPUImageUnsharpMaskFilter.h */; }; BCC1E611152156620006EFA5 /* GPUImageUnsharpMaskFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC1E60F152156620006EFA5 /* GPUImageUnsharpMaskFilter.m */; }; BCC1E633152239090006EFA5 /* GPUImageBulgeDistortionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC1E631152239090006EFA5 /* GPUImageBulgeDistortionFilter.h */; }; BCC1E634152239090006EFA5 /* GPUImageBulgeDistortionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC1E632152239090006EFA5 /* GPUImageBulgeDistortionFilter.m */; }; BCC1E638152243630006EFA5 /* GPUImagePinchDistortionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC1E636152243620006EFA5 /* GPUImagePinchDistortionFilter.h */; }; BCC1E639152243630006EFA5 /* GPUImagePinchDistortionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC1E637152243620006EFA5 /* GPUImagePinchDistortionFilter.m */; }; BCC1E66B152368130006EFA5 /* GPUImageCGAColorspaceFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC1E667152368130006EFA5 /* GPUImageCGAColorspaceFilter.h */; }; BCC1E66D152368130006EFA5 /* GPUImageCrosshatchFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC1E669152368130006EFA5 /* GPUImageCrosshatchFilter.h */; }; BCC1E66E152368130006EFA5 /* GPUImageCrosshatchFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC1E66A152368130006EFA5 /* GPUImageCrosshatchFilter.m */; }; BCC1E67C152368840006EFA5 /* GPUImageCGAColorspaceFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC1E67B152368840006EFA5 /* GPUImageCGAColorspaceFilter.m */; }; BCC46E5E15B9EFE8005519B9 /* GPUImageHighlightShadowFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC46E5C15B9EFE8005519B9 /* GPUImageHighlightShadowFilter.h */; }; BCC46E5F15B9EFE8005519B9 /* GPUImageHighlightShadowFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC46E5D15B9EFE8005519B9 /* GPUImageHighlightShadowFilter.m */; }; BCC46E6315BA095F005519B9 /* GPUImageFalseColorFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC46E6115BA095F005519B9 /* GPUImageFalseColorFilter.h */; }; BCC46E6415BA095F005519B9 /* GPUImageFalseColorFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC46E6215BA095F005519B9 /* GPUImageFalseColorFilter.m */; }; BCC887CC18A1CEEB008DB37D /* GPUImageFramebuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC887CA18A1CEEB008DB37D /* GPUImageFramebuffer.h */; }; BCC887CD18A1CEEB008DB37D /* GPUImageFramebuffer.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC887CB18A1CEEB008DB37D /* GPUImageFramebuffer.m */; }; BCC887D018A1D3AD008DB37D /* GPUImageFramebufferCache.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC887CE18A1D3AD008DB37D /* GPUImageFramebufferCache.h */; }; BCC887D118A1D3AD008DB37D /* GPUImageFramebufferCache.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC887CF18A1D3AD008DB37D /* GPUImageFramebufferCache.m */; }; BCC93A1E1501E42F00958B26 /* GPUImageTwoPassFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC93A1C1501E42E00958B26 /* GPUImageTwoPassFilter.h */; }; BCC93A1F1501E42F00958B26 /* GPUImageTwoPassFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC93A1D1501E42F00958B26 /* GPUImageTwoPassFilter.m */; }; BCC93A301502A90F00958B26 /* GPUImageFilterPipeline.m in Sources */ = {isa = PBXBuildFile; fileRef = 0D69488A1501F58200206FF8 /* GPUImageFilterPipeline.m */; }; BCC93A311502A91500958B26 /* GPUImageGaussianSelectiveBlurFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 0D9D91AE15011CA200A5BC83 /* GPUImageGaussianSelectiveBlurFilter.m */; }; BCC93A321502A92100958B26 /* GPUImageGaussianSelectiveBlurFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 0D9D91AD15011CA200A5BC83 /* GPUImageGaussianSelectiveBlurFilter.h */; }; BCC93A331502A92A00958B26 /* GPUImageFilterPipeline.h in Headers */ = {isa = PBXBuildFile; fileRef = 0D6948891501F58200206FF8 /* GPUImageFilterPipeline.h */; }; BCC94ABB151E4FD6008554B4 /* GPUImageLuminanceThresholdFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC94AB9151E4FD6008554B4 /* GPUImageLuminanceThresholdFilter.h */; }; BCC94ABC151E4FD6008554B4 /* GPUImageLuminanceThresholdFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC94ABA151E4FD6008554B4 /* GPUImageLuminanceThresholdFilter.m */; }; BCC94CFA15101EB3002F9BC5 /* GPUImageTransformFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC94CF815101EB3002F9BC5 /* GPUImageTransformFilter.h */; }; BCC94CFB15101EB3002F9BC5 /* GPUImageTransformFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC94CF915101EB3002F9BC5 /* GPUImageTransformFilter.m */; }; BCD81E8A194403FE007133DB /* GLProgram.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB5E79214E3275100701302 /* GLProgram.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81E8B194403FE007133DB /* GPUImageContext.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB5E76A14E20AD700701302 /* GPUImageContext.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81E8D19440418007133DB /* GPUImageFramebuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC887CA18A1CEEB008DB37D /* GPUImageFramebuffer.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81E8E1944041B007133DB /* GPUImageFramebufferCache.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC887CE18A1D3AD008DB37D /* GPUImageFramebufferCache.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81E8F19440425007133DB /* GPUImageOutput.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB5E77D14E22E4200701302 /* GPUImageOutput.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81E9019440428007133DB /* GPUImageVideoCamera.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB5E76314E208D600701302 /* GPUImageVideoCamera.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81E911944042B007133DB /* GPUImageStillCamera.h in Headers */ = {isa = PBXBuildFile; fileRef = BC7D95D31523EE67000DF037 /* GPUImageStillCamera.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81E921944042E007133DB /* GPUImagePicture.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB5E7D814E6003400701302 /* GPUImagePicture.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81E9319440430007133DB /* GPUImageMovie.h in Headers */ = {isa = PBXBuildFile; fileRef = BC982C6A14F33C290001FF6F /* GPUImageMovie.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81E9419440432007133DB /* GPUImageMovieComposition.h in Headers */ = {isa = PBXBuildFile; fileRef = D443237817C81C0C00204484 /* GPUImageMovieComposition.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81E9519440435007133DB /* GPUImageTextureInput.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF3D689153CC124009A1FE5 /* GPUImageTextureInput.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81E9619440438007133DB /* GPUImageRawDataInput.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF1E640156AB332006B155F /* GPUImageRawDataInput.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81E971944043A007133DB /* GPUImageUIElement.h in Headers */ = {isa = PBXBuildFile; fileRef = BC56D8281579779700CC9C1E /* GPUImageUIElement.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81E981944043F007133DB /* GPUImageFilterPipeline.h in Headers */ = {isa = PBXBuildFile; fileRef = 0D6948891501F58200206FF8 /* GPUImageFilterPipeline.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81E9919440442007133DB /* GPUImageFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC245DC814DDBED7009FE7EB /* GPUImageFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81E9A19440444007133DB /* GPUImageTwoInputFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC114896155AF65400F107AF /* GPUImageTwoInputFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81E9B19440453007133DB /* GPUImageThreeInputFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB030BC173400BC001A1A20 /* GPUImageThreeInputFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81E9C194404EB007133DB /* GPUImageTwoPassFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC93A1C1501E42E00958B26 /* GPUImageTwoPassFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81E9D194404EB007133DB /* GPUImageTwoPassTextureSamplingFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC0690B6157C0C27009274F9 /* GPUImageTwoPassTextureSamplingFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81E9E194404EB007133DB /* GPUImageFilterGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC1E5B6151E83700006EFA5 /* GPUImageFilterGroup.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81E9F194404EB007133DB /* GPUImage3x3TextureSamplingFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC01E830155CA5E1004C75C3 /* GPUImage3x3TextureSamplingFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EA0194404EB007133DB /* GPUImageTwoInputCrossTextureSamplingFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A8097616B8A48E000C29ED /* GPUImageTwoInputCrossTextureSamplingFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EA1194404EB007133DB /* GPUImageBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = BCBCE9D3159944AB00E0ED33 /* GPUImageBuffer.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EA2194404EB007133DB /* GPUImageBrightnessFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC982B7714F098CC0001FF6F /* GPUImageBrightnessFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EA3194404EB007133DB /* GPUImageLevelsFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = B8EF4E93162F85850036E5B3 /* GPUImageLevelsFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EA4194404EB007133DB /* GPUImageExposureFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB6B833150400030041703B /* GPUImageExposureFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EA5194404EB007133DB /* GPUImageContrastFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC982B6514F092EF0001FF6F /* GPUImageContrastFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EA6194404EB007133DB /* GPUImageSaturationFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC982B5114F07F790001FF6F /* GPUImageSaturationFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EA7194404EB007133DB /* GPUImageGammaFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC982B7C14F09F980001FF6F /* GPUImageGammaFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EA8194404EB007133DB /* GPUImageColorMatrixFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = B81521A014F1BA6A00F105F8 /* GPUImageColorMatrixFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EA9194404EB007133DB /* GPUImageRGBFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BEBE83B3155C092A00EEF8C3 /* GPUImageRGBFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EAA194404EB007133DB /* GPUImageHSBFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = B81F2D731788C95500118374 /* GPUImageHSBFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EAB194404EB007133DB /* GPUImageHueFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = C2EDA90415BB136D007CBA0F /* GPUImageHueFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EAC194404EB007133DB /* GPUImageMonochromeFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCBCE9971595021B00E0ED33 /* GPUImageMonochromeFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EAD194404EB007133DB /* GPUImageFalseColorFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC46E6115BA095F005519B9 /* GPUImageFalseColorFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EAE194404EB007133DB /* GPUImageHazeFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 6D13DBE4151AA804000B23BA /* GPUImageHazeFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EAF194404EB007133DB /* GPUImageSepiaFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB5E7C014E4B6D400701302 /* GPUImageSepiaFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EB0194404EB007133DB /* GPUImageColorInvertFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC982B4F14F07F790001FF6F /* GPUImageColorInvertFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EB1194404EB007133DB /* GPUImageGrayscaleFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 6EE27491150E8FC50040DDB6 /* GPUImageGrayscaleFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EB2194404EB007133DB /* GPUImageLuminanceThresholdFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC94AB9151E4FD6008554B4 /* GPUImageLuminanceThresholdFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EB3194404EB007133DB /* GPUImageAdaptiveThresholdFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC1E5CA151EA6610006EFA5 /* GPUImageAdaptiveThresholdFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EB4194404EB007133DB /* GPUImageAverageLuminanceThresholdFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB79E7815EC2A8300965D92 /* GPUImageAverageLuminanceThresholdFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EB5194404EB007133DB /* GPUImageHistogramFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC6ED9C01549CA0600966798 /* GPUImageHistogramFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EB6194404EB007133DB /* GPUImageHistogramGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC11D70154B44DC0044F5A0 /* GPUImageHistogramGenerator.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EB7194404EB007133DB /* GPUImageToneCurveFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF1E57915673599006B155F /* GPUImageToneCurveFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EB8194404EB007133DB /* GPUImageHighlightShadowFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC46E5C15B9EFE8005519B9 /* GPUImageHighlightShadowFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EB9194404EB007133DB /* GPUImageLookupFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 96DD3C1215C2780500DF637E /* GPUImageLookupFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EBA194404EC007133DB /* GPUImageAmatorkaFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 96781B2D15C38DCF005FA0D7 /* GPUImageAmatorkaFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EBB194404EC007133DB /* GPUImageMissEtikateFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 96781B3215C39E80005FA0D7 /* GPUImageMissEtikateFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EBC194404EC007133DB /* GPUImageSoftEleganceFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 96781B4415C3A6F0005FA0D7 /* GPUImageSoftEleganceFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EBD194404EC007133DB /* GPUImageOpacityFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF6B40F15A7849F00FC6F58 /* GPUImageOpacityFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EBE194404EC007133DB /* GPUImageAverageColor.h in Headers */ = {isa = PBXBuildFile; fileRef = BC3AC8AE15E6F6170065144E /* GPUImageAverageColor.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EBF194404EC007133DB /* GPUImageLuminosity.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB79E5D15EC131A00965D92 /* GPUImageLuminosity.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EC0194404EC007133DB /* GPUImageSolidColorGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB79E0E15EBE1A600965D92 /* GPUImageSolidColorGenerator.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EC1194404EC007133DB /* GPUImageChromaKeyFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC99234C15EFFC8700ED2C8C /* GPUImageChromaKeyFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EC2194404EC007133DB /* GPUImageWhiteBalanceFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC99235115EFFC9700ED2C8C /* GPUImageWhiteBalanceFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EC3194404EC007133DB /* GPUImageLuminanceRangeFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC8A584918131E4B00E6B507 /* GPUImageLuminanceRangeFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EC4194404EC007133DB /* GPUImageTransformFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC94CF815101EB3002F9BC5 /* GPUImageTransformFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EC5194404EC007133DB /* GPUImageCropFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB6B9021507CA8C0041703B /* GPUImageCropFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EC6194404EC007133DB /* GPUImageSharpenFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB6B835150400030041703B /* GPUImageSharpenFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EC7194404EC007133DB /* GPUImageUnsharpMaskFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC1E60E152156620006EFA5 /* GPUImageUnsharpMaskFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EC8194404EC007133DB /* GPUImageBoxBlurFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC1E5C5151EA12B0006EFA5 /* GPUImageBoxBlurFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EC9194404EC007133DB /* GPUImageGaussianBlurFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 0D04CB7A14FB2A29001D6733 /* GPUImageGaussianBlurFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81ECA194404EC007133DB /* GPUImageGaussianSelectiveBlurFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 0D9D91AD15011CA200A5BC83 /* GPUImageGaussianSelectiveBlurFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81ECB194404EC007133DB /* GPUImageGaussianBlurPositionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC185E7C16B866CE00EA01AD /* GPUImageGaussianBlurPositionFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81ECC194404EC007133DB /* GPUImageSingleComponentGaussianBlurFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCAD4D0D15718ACF001E50E1 /* GPUImageSingleComponentGaussianBlurFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81ECD194404EC007133DB /* GPUImageMedianFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC01E82B155CA3F1004C75C3 /* GPUImageMedianFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81ECE194404ED007133DB /* GPUImageBilateralFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC7CC63315605A3500468085 /* GPUImageBilateralFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81ECF194404ED007133DB /* GPUImageTiltShiftFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF3D6DB153CFF61009A1FE5 /* GPUImageTiltShiftFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81ED0194404ED007133DB /* GPUImage3x3ConvolutionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF3D708153DCC9A009A1FE5 /* GPUImage3x3ConvolutionFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81ED1194404ED007133DB /* GPUImageLaplacianFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC6C553E1730679D00EB222D /* GPUImageLaplacianFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81ED2194404ED007133DB /* GPUImageSobelEdgeDetectionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC982B9714F0B34E0001FF6F /* GPUImageSobelEdgeDetectionFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81ED3194404ED007133DB /* GPUImageThresholdEdgeDetectionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF3D720153E0E0B009A1FE5 /* GPUImageThresholdEdgeDetectionFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81ED4194404ED007133DB /* GPUImageDirectionalSobelEdgeDetectionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCAD4D1215718F9A001E50E1 /* GPUImageDirectionalSobelEdgeDetectionFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81ED5194404ED007133DB /* GPUImageDirectionalNonMaximumSuppressionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCAD4D1A1571B410001E50E1 /* GPUImageDirectionalNonMaximumSuppressionFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81ED6194404ED007133DB /* GPUImageWeakPixelInclusionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCAD4D1E1571CB48001E50E1 /* GPUImageWeakPixelInclusionFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81ED7194404ED007133DB /* GPUImageCannyEdgeDetectionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF3D71B153E06C3009A1FE5 /* GPUImageCannyEdgeDetectionFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81ED8194404ED007133DB /* GPUImagePrewittEdgeDetectionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCAD0976154F39C900278521 /* GPUImagePrewittEdgeDetectionFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81ED9194404ED007133DB /* GPUImageXYDerivativeFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCAD097B154F3CAF00278521 /* GPUImageXYDerivativeFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EDA194404ED007133DB /* GPUImageHarrisCornerDetectionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCAD097F154F7B2700278521 /* GPUImageHarrisCornerDetectionFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EDB194404ED007133DB /* GPUImageNobleCornerDetectionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCAD4CA1156F0F35001E50E1 /* GPUImageNobleCornerDetectionFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EDC194404EE007133DB /* GPUImageShiTomasiFeatureDetectionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCAD4C9C156F0D8E001E50E1 /* GPUImageShiTomasiFeatureDetectionFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EDD194404EE007133DB /* GPUImageFASTCornerDetectionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC1BBFA6193BC55B0025FC88 /* GPUImageFASTCornerDetectionFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EDE194404EE007133DB /* GPUImageNonMaximumSuppressionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCAD099D15506F6E00278521 /* GPUImageNonMaximumSuppressionFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EDF194404EE007133DB /* GPUImageThresholdedNonMaximumSuppressionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA6327F1623C80800EEB24F /* GPUImageThresholdedNonMaximumSuppressionFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EE0194404EE007133DB /* GPUImageCrosshairGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = BC7CC69A1562C4BA00468085 /* GPUImageCrosshairGenerator.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EE1194404EE007133DB /* GPUImageDilationFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC56D848157ADA4F00CC9C1E /* GPUImageDilationFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EE2194404EE007133DB /* GPUImageRGBDilationFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC0690CE157C2EB9009274F9 /* GPUImageRGBDilationFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EE3194404EE007133DB /* GPUImageErosionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC56D84D157ADA6F00CC9C1E /* GPUImageErosionFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EE4194404EE007133DB /* GPUImageRGBErosionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC0690D3157C31C9009274F9 /* GPUImageRGBErosionFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EE5194404EE007133DB /* GPUImageOpeningFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC0690BB157C1B37009274F9 /* GPUImageOpeningFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EE6194404EE007133DB /* GPUImageRGBOpeningFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC0690D7157C33B8009274F9 /* GPUImageRGBOpeningFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EE7194404EE007133DB /* GPUImageClosingFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC0690BF157C2366009274F9 /* GPUImageClosingFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EE8194404EF007133DB /* GPUImageRGBClosingFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC0690DB157C344B009274F9 /* GPUImageRGBClosingFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EE9194404EF007133DB /* GPUImageColorPackingFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC0690F5157C5075009274F9 /* GPUImageColorPackingFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EEA194404EF007133DB /* GPUImageLocalBinaryPatternFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF851BD15CF5D59000EBC8B /* GPUImageLocalBinaryPatternFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EEB194404EF007133DB /* GPUImageLanczosResamplingFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCFB588515E03E4F00750F12 /* GPUImageLanczosResamplingFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EEC194404EF007133DB /* GPUImageLowPassFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB3B46315F2BA9300EDA3BE /* GPUImageLowPassFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EED194404EF007133DB /* GPUImageHighPassFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB3B46815F2FD1B00EDA3BE /* GPUImageHighPassFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EEE194404EF007133DB /* GPUImageMotionDetector.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB3B47715F3108700EDA3BE /* GPUImageMotionDetector.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EEF194404EF007133DB /* GPUImageHoughTransformLineDetector.h in Headers */ = {isa = PBXBuildFile; fileRef = BC95C4061622763D002C4BC7 /* GPUImageHoughTransformLineDetector.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EF0194404EF007133DB /* GPUImageParallelCoordinateLineTransformFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA632841623D18B00EEB24F /* GPUImageParallelCoordinateLineTransformFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EF1194404EF007133DB /* GPUImageLineGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA464CA1627C1BC00C0F68E /* GPUImageLineGenerator.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EF2194404F0007133DB /* GPUImageMotionBlurFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCBC604B16C58B0900B11741 /* GPUImageMotionBlurFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EF3194404F0007133DB /* GPUImageZoomBlurFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCBC605516C8527C00B11741 /* GPUImageZoomBlurFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EF4194404F0007133DB /* GPUImageiOSBlurFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC8A583A1813060F00E6B507 /* GPUImageiOSBlurFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EF5194404F0007133DB /* GPUImageSourceOverBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 4686952D155AACAC0060BA43 /* GPUImageSourceOverBlendFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EF6194404F0007133DB /* GPUImageColorBurnBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB6B85015041A920041703B /* GPUImageColorBurnBlendFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EF7194404F0007133DB /* GPUImageColorDodgeBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB6B85215041A920041703B /* GPUImageColorDodgeBlendFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EF8194404F0007133DB /* GPUImageDarkenBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC982C7D14F34F0B0001FF6F /* GPUImageDarkenBlendFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EF9194404F0007133DB /* GPUImageDifferenceBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB6B868150423490041703B /* GPUImageDifferenceBlendFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EFA194404F0007133DB /* GPUImageDissolveBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC982BE714F1CE600001FF6F /* GPUImageDissolveBlendFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EFB194404F1007133DB /* GPUImageExclusionBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB6B86A1504234A0041703B /* GPUImageExclusionBlendFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EFC194404F1007133DB /* GPUImageHardLightBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB6B86C1504234A0041703B /* GPUImageHardLightBlendFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EFD194404F1007133DB /* GPUImageSoftLightBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB6B86E1504234A0041703B /* GPUImageSoftLightBlendFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EFE194404F1007133DB /* GPUImageLightenBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC982C7F14F34F0C0001FF6F /* GPUImageLightenBlendFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81EFF194404F1007133DB /* GPUImageAddBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD907D115CDEE930019C556 /* GPUImageAddBlendFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81F00194404F1007133DB /* GPUImageSubtractBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 83AE9F961540DFE400F7FC13 /* GPUImageSubtractBlendFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81F01194404F1007133DB /* GPUImageDivideBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD907CC15CDEE720019C556 /* GPUImageDivideBlendFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81F02194404F1007133DB /* GPUImageMultiplyBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC982BE914F1CE600001FF6F /* GPUImageMultiplyBlendFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81F03194404F2007133DB /* GPUImageOverlayBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC982C6C14F33C2A0001FF6F /* GPUImageOverlayBlendFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81F04194404F2007133DB /* GPUImageScreenBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB6B85415041A920041703B /* GPUImageScreenBlendFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81F05194404F2007133DB /* GPUImageChromaKeyBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC54D561151904FF003F4A41 /* GPUImageChromaKeyBlendFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81F06194404F2007133DB /* GPUImageAlphaBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCAD0983154F931C00278521 /* GPUImageAlphaBlendFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81F07194404F2007133DB /* GPUImageNormalBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 4308B1D515F7EED10014437A /* GPUImageNormalBlendFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81F08194404F2007133DB /* GPUImageColorBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = C04C8D1515F8059F00449601 /* GPUImageColorBlendFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81F09194404F2007133DB /* GPUImageHueBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = B80171E416311FCB001C8D16 /* GPUImageHueBlendFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81F0A194404F2007133DB /* GPUImageSaturationBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = B80171FC16312800001C8D16 /* GPUImageSaturationBlendFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81F0B194404F3007133DB /* GPUImageLuminosityBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = B801722D16313151001C8D16 /* GPUImageLuminosityBlendFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81F0C194404F3007133DB /* GPUImageLinearBurnBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC185E7816B866AD00EA01AD /* GPUImageLinearBurnBlendFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81F0D194404F3007133DB /* GPUImagePoissonBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A8097B16B8A6A2000C29ED /* GPUImagePoissonBlendFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81F0E194404F3007133DB /* GPUImageMaskFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 83AE9FCB1540E92800F7FC13 /* GPUImageMaskFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81F0F194404F3007133DB /* GPUImagePerlinNoiseFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC27A3C915654F5A004F2D45 /* GPUImagePerlinNoiseFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81F10194404F3007133DB /* GPUImagePixellateFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB5DE0B14E87F32000AF3C2 /* GPUImagePixellateFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81F11194404F3007133DB /* GPUImagePixellatePositionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC185E8016B866F000EA01AD /* GPUImagePixellatePositionFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81F12194404F4007133DB /* GPUImagePolkaDotFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF851B815CF29B3000EBC8B /* GPUImagePolkaDotFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81F13194404F4007133DB /* GPUImageHalftoneFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC4D03CD160919AE00F64358 /* GPUImageHalftoneFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81F14194404F4007133DB /* GPUImagePolarPixellateFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCABED8A15263CF20098A93E /* GPUImagePolarPixellateFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81F15194404F4007133DB /* GPUImageCrosshatchFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC1E669152368130006EFA5 /* GPUImageCrosshatchFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81F16194404F4007133DB /* GPUImageSketchFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC1B717A14F566E200ACA2AB /* GPUImageSketchFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81F17194404F4007133DB /* GPUImageThresholdSketchFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA632881623DD0E00EEB24F /* GPUImageThresholdSketchFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81F18194404F4007133DB /* GPUImageEmbossFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF3D70D153DF9E6009A1FE5 /* GPUImageEmbossFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81F19194404F5007133DB /* GPUImageToonFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC982C9D14F35C2D0001FF6F /* GPUImageToonFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81F1A194404F5007133DB /* GPUImageSmoothToonFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF3D72E153F0D6E009A1FE5 /* GPUImageSmoothToonFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81F1B194404F5007133DB /* GPUImageCGAColorspaceFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC1E667152368130006EFA5 /* GPUImageCGAColorspaceFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81F1C194404F5007133DB /* GPUImagePosterizeFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC1E5A6151E74B20006EFA5 /* GPUImagePosterizeFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81F1D194404F5007133DB /* GPUImageSwirlFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC1B718C14F56C1D00ACA2AB /* GPUImageSwirlFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81F1E194404F5007133DB /* GPUImageBulgeDistortionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC1E631152239090006EFA5 /* GPUImageBulgeDistortionFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81F1F194404F6007133DB /* GPUImagePinchDistortionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC1E636152243620006EFA5 /* GPUImagePinchDistortionFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81F20194404F6007133DB /* GPUImageStretchDistortionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCABED8C15263CF20098A93E /* GPUImageStretchDistortionFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81F21194404F6007133DB /* GPUImageSphereRefractionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC76CE9915813818008B45D3 /* GPUImageSphereRefractionFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81F22194404F6007133DB /* GPUImageGlassSphereFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC0147E215BEFE6800FC2B6D /* GPUImageGlassSphereFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81F23194404F6007133DB /* GPUImageKuwaharaFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC982C4514F29E580001FF6F /* GPUImageKuwaharaFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81F24194404F6007133DB /* GPUImageKuwaharaRadius3Filter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCBF617816E4F44600E2784A /* GPUImageKuwaharaRadius3Filter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81F25194404F7007133DB /* GPUImageVignetteFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 0DF3FA2914FA00C9006AF7D9 /* GPUImageVignetteFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81F26194404F7007133DB /* GPUImageJFAVoronoiFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF1E53A15669907006B155F /* GPUImageJFAVoronoiFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81F27194404F7007133DB /* GPUImageMosaicFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF1E53C15669907006B155F /* GPUImageMosaicFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81F28194404F7007133DB /* GPUImageVoronoiConsumerFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF1E53E15669907006B155F /* GPUImageVoronoiConsumerFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81F29194404F7007133DB /* GPUImageView.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB5E75A14E2086300701302 /* GPUImageView.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81F2A194404F7007133DB /* GPUImageMovieWriter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC1B727F14FB16AF00ACA2AB /* GPUImageMovieWriter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81F2B194404F8007133DB /* GPUImageTextureOutput.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB6B8B91505BF940041703B /* GPUImageTextureOutput.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81F2C194404F8007133DB /* GPUImageRawDataOutput.h in Headers */ = {isa = PBXBuildFile; fileRef = BC1B715514F49DAA00ACA2AB /* GPUImageRawDataOutput.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD81F2D19440604007133DB /* GLProgram.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB5E79314E3275200701302 /* GLProgram.m */; }; BCD81F2F19440604007133DB /* GPUImageFramebuffer.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC887CB18A1CEEB008DB37D /* GPUImageFramebuffer.m */; }; BCD81F3019440604007133DB /* GPUImageFramebufferCache.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC887CF18A1D3AD008DB37D /* GPUImageFramebufferCache.m */; }; BCD81F3119440604007133DB /* GPUImageOutput.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB5E77E14E22E4200701302 /* GPUImageOutput.m */; }; BCD81F3219440604007133DB /* GPUImageVideoCamera.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB5E76414E208D600701302 /* GPUImageVideoCamera.m */; }; BCD81F3319440604007133DB /* GPUImageStillCamera.m in Sources */ = {isa = PBXBuildFile; fileRef = BC7D95D41523EE67000DF037 /* GPUImageStillCamera.m */; }; BCD81F3419440604007133DB /* GPUImagePicture.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB5E7D914E6003400701302 /* GPUImagePicture.m */; }; BCD81F3519440604007133DB /* GPUImageMovie.m in Sources */ = {isa = PBXBuildFile; fileRef = BC982C6B14F33C2A0001FF6F /* GPUImageMovie.m */; }; BCD81F3619440604007133DB /* GPUImageMovieComposition.m in Sources */ = {isa = PBXBuildFile; fileRef = D443237917C81C0C00204484 /* GPUImageMovieComposition.m */; }; BCD81F3719440604007133DB /* GPUImageTextureInput.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF3D68A153CC124009A1FE5 /* GPUImageTextureInput.m */; }; BCD81F3819440604007133DB /* GPUImageRawDataInput.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF1E641156AB332006B155F /* GPUImageRawDataInput.m */; }; BCD81F3919440604007133DB /* GPUImageUIElement.m in Sources */ = {isa = PBXBuildFile; fileRef = BC56D8291579779700CC9C1E /* GPUImageUIElement.m */; }; BCD81F3A19440604007133DB /* GPUImageFilterPipeline.m in Sources */ = {isa = PBXBuildFile; fileRef = 0D69488A1501F58200206FF8 /* GPUImageFilterPipeline.m */; }; BCD81F3B19440604007133DB /* GPUImageFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC245DC914DDBED7009FE7EB /* GPUImageFilter.m */; }; BCD81F3C19440604007133DB /* GPUImageTwoInputFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC114897155AF65400F107AF /* GPUImageTwoInputFilter.m */; }; BCD81F3D19440604007133DB /* GPUImageThreeInputFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB030BD173400BC001A1A20 /* GPUImageThreeInputFilter.m */; }; BCD81F3E19440604007133DB /* GPUImageTwoPassFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC93A1D1501E42F00958B26 /* GPUImageTwoPassFilter.m */; }; BCD81F3F19440604007133DB /* GPUImageTwoPassTextureSamplingFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC0690B7157C0C28009274F9 /* GPUImageTwoPassTextureSamplingFilter.m */; }; BCD81F4019440604007133DB /* GPUImageFilterGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC1E5B7151E83700006EFA5 /* GPUImageFilterGroup.m */; }; BCD81F4119440604007133DB /* GPUImage3x3TextureSamplingFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC01E831155CA5E1004C75C3 /* GPUImage3x3TextureSamplingFilter.m */; }; BCD81F4219440604007133DB /* GPUImageTwoInputCrossTextureSamplingFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 46A8097716B8A48E000C29ED /* GPUImageTwoInputCrossTextureSamplingFilter.m */; }; BCD81F4319440604007133DB /* GPUImageBuffer.m in Sources */ = {isa = PBXBuildFile; fileRef = BCBCE9D4159944AB00E0ED33 /* GPUImageBuffer.m */; }; BCD81F4419440604007133DB /* GPUImageBrightnessFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC982B7814F098CC0001FF6F /* GPUImageBrightnessFilter.m */; }; BCD81F4519440604007133DB /* GPUImageLevelsFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = B8EF4E94162F85850036E5B3 /* GPUImageLevelsFilter.m */; }; BCD81F4619440604007133DB /* GPUImageExposureFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB6B834150400030041703B /* GPUImageExposureFilter.m */; }; BCD81F4719440604007133DB /* GPUImageContrastFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC982B6614F092EF0001FF6F /* GPUImageContrastFilter.m */; }; BCD81F4819440604007133DB /* GPUImageSaturationFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC982B5214F07F790001FF6F /* GPUImageSaturationFilter.m */; }; BCD81F4919440604007133DB /* GPUImageGammaFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC982B7D14F09F980001FF6F /* GPUImageGammaFilter.m */; }; BCD81F4A19440604007133DB /* GPUImageColorMatrixFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = B81521A114F1BA6A00F105F8 /* GPUImageColorMatrixFilter.m */; }; BCD81F4B19440604007133DB /* GPUImageRGBFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BEBE83B4155C092A00EEF8C3 /* GPUImageRGBFilter.m */; }; BCD81F4C19440604007133DB /* GPUImageHSBFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = B81F2D741788C95500118374 /* GPUImageHSBFilter.m */; }; BCD81F4D19440604007133DB /* GPUImageHueFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = C2EDA90515BB136D007CBA0F /* GPUImageHueFilter.m */; }; BCD81F4E19440604007133DB /* GPUImageMonochromeFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCBCE9981595021B00E0ED33 /* GPUImageMonochromeFilter.m */; }; BCD81F4F19440604007133DB /* GPUImageFalseColorFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC46E6215BA095F005519B9 /* GPUImageFalseColorFilter.m */; }; BCD81F5019440604007133DB /* GPUImageHazeFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 6D13DBE5151AA804000B23BA /* GPUImageHazeFilter.m */; }; BCD81F5119440604007133DB /* GPUImageSepiaFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB5E7C114E4B6D400701302 /* GPUImageSepiaFilter.m */; }; BCD81F5219440604007133DB /* GPUImageColorInvertFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC982B5014F07F790001FF6F /* GPUImageColorInvertFilter.m */; }; BCD81F5319440604007133DB /* GPUImageGrayscaleFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 6EE27492150E8FC50040DDB6 /* GPUImageGrayscaleFilter.m */; }; BCD81F5419440604007133DB /* GPUImageLuminanceThresholdFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC94ABA151E4FD6008554B4 /* GPUImageLuminanceThresholdFilter.m */; }; BCD81F5519440604007133DB /* GPUImageAdaptiveThresholdFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC1E5CB151EA6610006EFA5 /* GPUImageAdaptiveThresholdFilter.m */; }; BCD81F5619440604007133DB /* GPUImageAverageLuminanceThresholdFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB79E7915EC2A8300965D92 /* GPUImageAverageLuminanceThresholdFilter.m */; }; BCD81F5719440604007133DB /* GPUImageHistogramFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC6ED9C11549CA0600966798 /* GPUImageHistogramFilter.m */; }; BCD81F5819440604007133DB /* GPUImageHistogramGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC11D71154B44DC0044F5A0 /* GPUImageHistogramGenerator.m */; }; BCD81F5919440604007133DB /* GPUImageToneCurveFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF1E57A15673599006B155F /* GPUImageToneCurveFilter.m */; }; BCD81F5A19440604007133DB /* GPUImageHighlightShadowFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC46E5D15B9EFE8005519B9 /* GPUImageHighlightShadowFilter.m */; }; BCD81F5B19440604007133DB /* GPUImageLookupFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 96DD3C1315C2780500DF637E /* GPUImageLookupFilter.m */; }; BCD81F5C19440604007133DB /* GPUImageAmatorkaFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 96781B2E15C38DCF005FA0D7 /* GPUImageAmatorkaFilter.m */; }; BCD81F5D19440604007133DB /* GPUImageMissEtikateFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 96781B3315C39E80005FA0D7 /* GPUImageMissEtikateFilter.m */; }; BCD81F5E19440604007133DB /* GPUImageSoftEleganceFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 96781B4515C3A6F0005FA0D7 /* GPUImageSoftEleganceFilter.m */; }; BCD81F5F19440604007133DB /* GPUImageOpacityFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF6B41015A7849F00FC6F58 /* GPUImageOpacityFilter.m */; }; BCD81F6019440604007133DB /* GPUImageAverageColor.m in Sources */ = {isa = PBXBuildFile; fileRef = BC3AC8AF15E6F6170065144E /* GPUImageAverageColor.m */; }; BCD81F6119440604007133DB /* GPUImageLuminosity.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB79E5E15EC131A00965D92 /* GPUImageLuminosity.m */; }; BCD81F6219440604007133DB /* GPUImageSolidColorGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB79E0F15EBE1A600965D92 /* GPUImageSolidColorGenerator.m */; }; BCD81F6319440604007133DB /* GPUImageChromaKeyFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC99234D15EFFC8700ED2C8C /* GPUImageChromaKeyFilter.m */; }; BCD81F6419440604007133DB /* GPUImageWhiteBalanceFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC99235215EFFC9700ED2C8C /* GPUImageWhiteBalanceFilter.m */; }; BCD81F6519440604007133DB /* GPUImageLuminanceRangeFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC8A584A18131E4B00E6B507 /* GPUImageLuminanceRangeFilter.m */; }; BCD81F6619440604007133DB /* GPUImageTransformFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC94CF915101EB3002F9BC5 /* GPUImageTransformFilter.m */; }; BCD81F6719440604007133DB /* GPUImageCropFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB6B9031507CA8C0041703B /* GPUImageCropFilter.m */; }; BCD81F6819440604007133DB /* GPUImageSharpenFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB6B836150400030041703B /* GPUImageSharpenFilter.m */; }; BCD81F6919440604007133DB /* GPUImageUnsharpMaskFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC1E60F152156620006EFA5 /* GPUImageUnsharpMaskFilter.m */; }; BCD81F6A19440604007133DB /* GPUImageBoxBlurFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC1E5C6151EA12B0006EFA5 /* GPUImageBoxBlurFilter.m */; }; BCD81F6B19440604007133DB /* GPUImageGaussianBlurFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 0D04CB7B14FB2A29001D6733 /* GPUImageGaussianBlurFilter.m */; }; BCD81F6C19440604007133DB /* GPUImageGaussianSelectiveBlurFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 0D9D91AE15011CA200A5BC83 /* GPUImageGaussianSelectiveBlurFilter.m */; }; BCD81F6D19440604007133DB /* GPUImageGaussianBlurPositionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC185E7D16B866CE00EA01AD /* GPUImageGaussianBlurPositionFilter.m */; }; BCD81F6E19440604007133DB /* GPUImageSingleComponentGaussianBlurFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCAD4D0E15718AD0001E50E1 /* GPUImageSingleComponentGaussianBlurFilter.m */; }; BCD81F6F19440604007133DB /* GPUImageMedianFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC01E82C155CA3F1004C75C3 /* GPUImageMedianFilter.m */; }; BCD81F7019440604007133DB /* GPUImageBilateralFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC7CC63415605A3500468085 /* GPUImageBilateralFilter.m */; }; BCD81F7119440604007133DB /* GPUImageTiltShiftFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF3D6DC153CFF61009A1FE5 /* GPUImageTiltShiftFilter.m */; }; BCD81F7219440604007133DB /* GPUImage3x3ConvolutionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF3D709153DCC9A009A1FE5 /* GPUImage3x3ConvolutionFilter.m */; }; BCD81F7319440604007133DB /* GPUImageLaplacianFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC6C553F1730679D00EB222D /* GPUImageLaplacianFilter.m */; }; BCD81F7419440604007133DB /* GPUImageSobelEdgeDetectionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC982B9814F0B34E0001FF6F /* GPUImageSobelEdgeDetectionFilter.m */; }; BCD81F7519440604007133DB /* GPUImageThresholdEdgeDetectionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF3D721153E0E0B009A1FE5 /* GPUImageThresholdEdgeDetectionFilter.m */; }; BCD81F7619440604007133DB /* GPUImageDirectionalSobelEdgeDetectionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCAD4D1315718F9C001E50E1 /* GPUImageDirectionalSobelEdgeDetectionFilter.m */; }; BCD81F7719440604007133DB /* GPUImageDirectionalNonMaximumSuppressionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCAD4D1B1571B410001E50E1 /* GPUImageDirectionalNonMaximumSuppressionFilter.m */; }; BCD81F7819440604007133DB /* GPUImageWeakPixelInclusionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCAD4D1F1571CB4C001E50E1 /* GPUImageWeakPixelInclusionFilter.m */; }; BCD81F7919440604007133DB /* GPUImageCannyEdgeDetectionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF3D71C153E06C3009A1FE5 /* GPUImageCannyEdgeDetectionFilter.m */; }; BCD81F7A19440604007133DB /* GPUImagePrewittEdgeDetectionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCAD0977154F39CA00278521 /* GPUImagePrewittEdgeDetectionFilter.m */; }; BCD81F7B19440604007133DB /* GPUImageXYDerivativeFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCAD097C154F3CB000278521 /* GPUImageXYDerivativeFilter.m */; }; BCD81F7C19440604007133DB /* GPUImageHarrisCornerDetectionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCAD0980154F7B2800278521 /* GPUImageHarrisCornerDetectionFilter.m */; }; BCD81F7D19440604007133DB /* GPUImageNobleCornerDetectionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCAD4CA2156F0F35001E50E1 /* GPUImageNobleCornerDetectionFilter.m */; }; BCD81F7E19440604007133DB /* GPUImageShiTomasiFeatureDetectionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCAD4C9D156F0D8E001E50E1 /* GPUImageShiTomasiFeatureDetectionFilter.m */; }; BCD81F7F19440604007133DB /* GPUImageFASTCornerDetectionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC1BBFA7193BC55B0025FC88 /* GPUImageFASTCornerDetectionFilter.m */; }; BCD81F8019440604007133DB /* GPUImageNonMaximumSuppressionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCAD099E15506F6E00278521 /* GPUImageNonMaximumSuppressionFilter.m */; }; BCD81F8119440604007133DB /* GPUImageThresholdedNonMaximumSuppressionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCA632801623C80800EEB24F /* GPUImageThresholdedNonMaximumSuppressionFilter.m */; }; BCD81F8219440604007133DB /* GPUImageCrosshairGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = BC7CC69B1562C4BA00468085 /* GPUImageCrosshairGenerator.m */; }; BCD81F8319440604007133DB /* GPUImageDilationFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC56D849157ADA4F00CC9C1E /* GPUImageDilationFilter.m */; }; BCD81F8419440604007133DB /* GPUImageRGBDilationFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC0690CF157C2EBA009274F9 /* GPUImageRGBDilationFilter.m */; }; BCD81F8519440604007133DB /* GPUImageErosionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC56D84E157ADA6F00CC9C1E /* GPUImageErosionFilter.m */; }; BCD81F8619440604007133DB /* GPUImageRGBErosionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC0690D4157C31C9009274F9 /* GPUImageRGBErosionFilter.m */; }; BCD81F8719440604007133DB /* GPUImageOpeningFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC0690BC157C1B38009274F9 /* GPUImageOpeningFilter.m */; }; BCD81F8819440604007133DB /* GPUImageRGBOpeningFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC0690D8157C33B8009274F9 /* GPUImageRGBOpeningFilter.m */; }; BCD81F8919440604007133DB /* GPUImageClosingFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC0690C0157C2367009274F9 /* GPUImageClosingFilter.m */; }; BCD81F8A19440604007133DB /* GPUImageRGBClosingFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC0690DC157C344C009274F9 /* GPUImageRGBClosingFilter.m */; }; BCD81F8B19440604007133DB /* GPUImageColorPackingFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC0690F6157C5075009274F9 /* GPUImageColorPackingFilter.m */; }; BCD81F8C19440605007133DB /* GPUImageLocalBinaryPatternFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF851BE15CF5D59000EBC8B /* GPUImageLocalBinaryPatternFilter.m */; }; BCD81F8D19440605007133DB /* GPUImageLanczosResamplingFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCFB588615E03E4F00750F12 /* GPUImageLanczosResamplingFilter.m */; }; BCD81F8E19440605007133DB /* GPUImageLowPassFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB3B46415F2BA9300EDA3BE /* GPUImageLowPassFilter.m */; }; BCD81F8F19440605007133DB /* GPUImageHighPassFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB3B46915F2FD1B00EDA3BE /* GPUImageHighPassFilter.m */; }; BCD81F9019440605007133DB /* GPUImageMotionDetector.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB3B47815F3108700EDA3BE /* GPUImageMotionDetector.m */; }; BCD81F9119440605007133DB /* GPUImageHoughTransformLineDetector.m in Sources */ = {isa = PBXBuildFile; fileRef = BC95C4071622763D002C4BC7 /* GPUImageHoughTransformLineDetector.m */; }; BCD81F9219440605007133DB /* GPUImageParallelCoordinateLineTransformFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCA632851623D18B00EEB24F /* GPUImageParallelCoordinateLineTransformFilter.m */; }; BCD81F9319440605007133DB /* GPUImageLineGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = BCA464CB1627C1BC00C0F68E /* GPUImageLineGenerator.m */; }; BCD81F9419440605007133DB /* GPUImageMotionBlurFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCBC604C16C58B0900B11741 /* GPUImageMotionBlurFilter.m */; }; BCD81F9519440605007133DB /* GPUImageZoomBlurFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCBC605616C8527C00B11741 /* GPUImageZoomBlurFilter.m */; }; BCD81F9619440605007133DB /* GPUImageiOSBlurFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC8A583B1813060F00E6B507 /* GPUImageiOSBlurFilter.m */; }; BCD81F9719440605007133DB /* GPUImageSourceOverBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 4686952E155AACAC0060BA43 /* GPUImageSourceOverBlendFilter.m */; }; BCD81F9819440605007133DB /* GPUImageColorBurnBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB6B85115041A920041703B /* GPUImageColorBurnBlendFilter.m */; }; BCD81F9919440605007133DB /* GPUImageColorDodgeBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB6B85315041A920041703B /* GPUImageColorDodgeBlendFilter.m */; }; BCD81F9A19440605007133DB /* GPUImageDarkenBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC982C7E14F34F0B0001FF6F /* GPUImageDarkenBlendFilter.m */; }; BCD81F9B19440605007133DB /* GPUImageDifferenceBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB6B8691504234A0041703B /* GPUImageDifferenceBlendFilter.m */; }; BCD81F9C19440605007133DB /* GPUImageDissolveBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC982BE814F1CE600001FF6F /* GPUImageDissolveBlendFilter.m */; }; BCD81F9D19440605007133DB /* GPUImageExclusionBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB6B86B1504234A0041703B /* GPUImageExclusionBlendFilter.m */; }; BCD81F9E19440605007133DB /* GPUImageHardLightBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB6B86D1504234A0041703B /* GPUImageHardLightBlendFilter.m */; }; BCD81F9F19440605007133DB /* GPUImageSoftLightBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB6B86F1504234A0041703B /* GPUImageSoftLightBlendFilter.m */; }; BCD81FA019440605007133DB /* GPUImageLightenBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC982C8014F34F0C0001FF6F /* GPUImageLightenBlendFilter.m */; }; BCD81FA119440605007133DB /* GPUImageAddBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCD907D215CDEE930019C556 /* GPUImageAddBlendFilter.m */; }; BCD81FA219440605007133DB /* GPUImageSubtractBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 83AE9F971540DFE500F7FC13 /* GPUImageSubtractBlendFilter.m */; }; BCD81FA319440605007133DB /* GPUImageDivideBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCD907CD15CDEE720019C556 /* GPUImageDivideBlendFilter.m */; }; BCD81FA419440605007133DB /* GPUImageMultiplyBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC982BEA14F1CE600001FF6F /* GPUImageMultiplyBlendFilter.m */; }; BCD81FA519440605007133DB /* GPUImageOverlayBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC982C6D14F33C2A0001FF6F /* GPUImageOverlayBlendFilter.m */; }; BCD81FA619440605007133DB /* GPUImageScreenBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB6B85515041A920041703B /* GPUImageScreenBlendFilter.m */; }; BCD81FA719440605007133DB /* GPUImageChromaKeyBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC54D562151904FF003F4A41 /* GPUImageChromaKeyBlendFilter.m */; }; BCD81FA819440605007133DB /* GPUImageAlphaBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCAD0984154F931C00278521 /* GPUImageAlphaBlendFilter.m */; }; BCD81FA919440605007133DB /* GPUImageNormalBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 4308B1D615F7EED20014437A /* GPUImageNormalBlendFilter.m */; }; BCD81FAA19440605007133DB /* GPUImageColorBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = C04C8D1615F8059F00449601 /* GPUImageColorBlendFilter.m */; }; BCD81FAB19440605007133DB /* GPUImageHueBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = B80171E516311FCB001C8D16 /* GPUImageHueBlendFilter.m */; }; BCD81FAC19440605007133DB /* GPUImageSaturationBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = B80171FD16312800001C8D16 /* GPUImageSaturationBlendFilter.m */; }; BCD81FAD19440605007133DB /* GPUImageLuminosityBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = B801722E16313151001C8D16 /* GPUImageLuminosityBlendFilter.m */; }; BCD81FAE19440605007133DB /* GPUImageLinearBurnBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC185E7916B866AD00EA01AD /* GPUImageLinearBurnBlendFilter.m */; }; BCD81FAF19440605007133DB /* GPUImagePoissonBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 46A8097C16B8A6A2000C29ED /* GPUImagePoissonBlendFilter.m */; }; BCD81FB019440605007133DB /* GPUImageMaskFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 83AE9FCC1540E92800F7FC13 /* GPUImageMaskFilter.m */; }; BCD81FB119440605007133DB /* GPUImagePerlinNoiseFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC27A3CA15654F5A004F2D45 /* GPUImagePerlinNoiseFilter.m */; }; BCD81FB219440605007133DB /* GPUImagePixellateFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB5DE0C14E87F32000AF3C2 /* GPUImagePixellateFilter.m */; }; BCD81FB319440605007133DB /* GPUImagePixellatePositionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC185E8116B866F000EA01AD /* GPUImagePixellatePositionFilter.m */; }; BCD81FB419440605007133DB /* GPUImagePolkaDotFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF851B915CF29B3000EBC8B /* GPUImagePolkaDotFilter.m */; }; BCD81FB519440605007133DB /* GPUImageHalftoneFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC4D03CE160919AE00F64358 /* GPUImageHalftoneFilter.m */; }; BCD81FB619440605007133DB /* GPUImagePolarPixellateFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCABED8B15263CF20098A93E /* GPUImagePolarPixellateFilter.m */; }; BCD81FB719440605007133DB /* GPUImageCrosshatchFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC1E66A152368130006EFA5 /* GPUImageCrosshatchFilter.m */; }; BCD81FB819440605007133DB /* GPUImageSketchFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC1B717B14F566E200ACA2AB /* GPUImageSketchFilter.m */; }; BCD81FB919440605007133DB /* GPUImageThresholdSketchFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCA632891623DD0E00EEB24F /* GPUImageThresholdSketchFilter.m */; }; BCD81FBA19440605007133DB /* GPUImageEmbossFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF3D70E153DF9E6009A1FE5 /* GPUImageEmbossFilter.m */; }; BCD81FBB19440605007133DB /* GPUImageToonFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC982C9E14F35C2D0001FF6F /* GPUImageToonFilter.m */; }; BCD81FBC19440605007133DB /* GPUImageSmoothToonFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF3D72F153F0D6F009A1FE5 /* GPUImageSmoothToonFilter.m */; }; BCD81FBD19440605007133DB /* GPUImageCGAColorspaceFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC1E67B152368840006EFA5 /* GPUImageCGAColorspaceFilter.m */; }; BCD81FBE19440605007133DB /* GPUImagePosterizeFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC1E5A7151E74B20006EFA5 /* GPUImagePosterizeFilter.m */; }; BCD81FBF19440605007133DB /* GPUImageSwirlFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC1B718D14F56C1D00ACA2AB /* GPUImageSwirlFilter.m */; }; BCD81FC019440605007133DB /* GPUImageBulgeDistortionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC1E632152239090006EFA5 /* GPUImageBulgeDistortionFilter.m */; }; BCD81FC119440605007133DB /* GPUImagePinchDistortionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC1E637152243620006EFA5 /* GPUImagePinchDistortionFilter.m */; }; BCD81FC219440605007133DB /* GPUImageStretchDistortionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCABED8D15263CF20098A93E /* GPUImageStretchDistortionFilter.m */; }; BCD81FC319440605007133DB /* GPUImageSphereRefractionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC76CE9A15813818008B45D3 /* GPUImageSphereRefractionFilter.m */; }; BCD81FC419440605007133DB /* GPUImageGlassSphereFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC0147E315BEFE6800FC2B6D /* GPUImageGlassSphereFilter.m */; }; BCD81FC519440606007133DB /* GPUImageKuwaharaFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC982C4614F29E580001FF6F /* GPUImageKuwaharaFilter.m */; }; BCD81FC619440606007133DB /* GPUImageKuwaharaRadius3Filter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCBF617916E4F44600E2784A /* GPUImageKuwaharaRadius3Filter.m */; }; BCD81FC719440606007133DB /* GPUImageVignetteFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 0DF3FA2A14FA00C9006AF7D9 /* GPUImageVignetteFilter.m */; }; BCD81FC819440606007133DB /* GPUImageJFAVoronoiFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF1E53B15669907006B155F /* GPUImageJFAVoronoiFilter.m */; }; BCD81FC919440606007133DB /* GPUImageMosaicFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF1E53D15669907006B155F /* GPUImageMosaicFilter.m */; }; BCD81FCA19440606007133DB /* GPUImageVoronoiConsumerFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF1E53F15669907006B155F /* GPUImageVoronoiConsumerFilter.m */; }; BCD81FCB19440606007133DB /* GPUImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB5E75B14E2086300701302 /* GPUImageView.m */; }; BCD81FCC19440606007133DB /* GPUImageMovieWriter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC1B728014FB16AF00ACA2AB /* GPUImageMovieWriter.m */; }; BCD81FCD19440606007133DB /* GPUImageTextureOutput.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB6B8BA1505BF940041703B /* GPUImageTextureOutput.m */; }; BCD81FCE19440606007133DB /* GPUImageRawDataOutput.m in Sources */ = {isa = PBXBuildFile; fileRef = BC1B715614F49DAA00ACA2AB /* GPUImageRawDataOutput.m */; }; BCD81FD919440A97007133DB /* GPUImageFramework.h in Headers */ = {isa = PBXBuildFile; fileRef = BC73FC011944008500671325 /* GPUImageFramework.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD907CE15CDEE720019C556 /* GPUImageDivideBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD907CC15CDEE720019C556 /* GPUImageDivideBlendFilter.h */; }; BCD907CF15CDEE720019C556 /* GPUImageDivideBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCD907CD15CDEE720019C556 /* GPUImageDivideBlendFilter.m */; }; BCD907D315CDEE930019C556 /* GPUImageAddBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD907D115CDEE930019C556 /* GPUImageAddBlendFilter.h */; }; BCD907D415CDEE930019C556 /* GPUImageAddBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCD907D215CDEE930019C556 /* GPUImageAddBlendFilter.m */; }; BCF1A33814DDB1EC00852800 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCF1A33714DDB1EC00852800 /* Foundation.framework */; }; BCF1E54015669907006B155F /* GPUImageJFAVoronoiFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF1E53A15669907006B155F /* GPUImageJFAVoronoiFilter.h */; }; BCF1E54115669907006B155F /* GPUImageJFAVoronoiFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF1E53B15669907006B155F /* GPUImageJFAVoronoiFilter.m */; }; BCF1E54215669907006B155F /* GPUImageMosaicFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF1E53C15669907006B155F /* GPUImageMosaicFilter.h */; }; BCF1E54315669907006B155F /* GPUImageMosaicFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF1E53D15669907006B155F /* GPUImageMosaicFilter.m */; }; BCF1E54415669907006B155F /* GPUImageVoronoiConsumerFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF1E53E15669907006B155F /* GPUImageVoronoiConsumerFilter.h */; }; BCF1E54515669907006B155F /* GPUImageVoronoiConsumerFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF1E53F15669907006B155F /* GPUImageVoronoiConsumerFilter.m */; }; BCF1E57B15673599006B155F /* GPUImageToneCurveFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF1E57915673599006B155F /* GPUImageToneCurveFilter.h */; }; BCF1E57C15673599006B155F /* GPUImageToneCurveFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF1E57A15673599006B155F /* GPUImageToneCurveFilter.m */; }; BCF1E642156AB332006B155F /* GPUImageRawDataInput.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF1E640156AB332006B155F /* GPUImageRawDataInput.h */; }; BCF1E643156AB332006B155F /* GPUImageRawDataInput.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF1E641156AB332006B155F /* GPUImageRawDataInput.m */; }; BCF3D68B153CC124009A1FE5 /* GPUImageTextureInput.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF3D689153CC124009A1FE5 /* GPUImageTextureInput.h */; }; BCF3D68C153CC124009A1FE5 /* GPUImageTextureInput.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF3D68A153CC124009A1FE5 /* GPUImageTextureInput.m */; }; BCF3D6DD153CFF61009A1FE5 /* GPUImageTiltShiftFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF3D6DB153CFF61009A1FE5 /* GPUImageTiltShiftFilter.h */; }; BCF3D6DE153CFF61009A1FE5 /* GPUImageTiltShiftFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF3D6DC153CFF61009A1FE5 /* GPUImageTiltShiftFilter.m */; }; BCF3D70A153DCC9A009A1FE5 /* GPUImage3x3ConvolutionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF3D708153DCC9A009A1FE5 /* GPUImage3x3ConvolutionFilter.h */; }; BCF3D70B153DCC9A009A1FE5 /* GPUImage3x3ConvolutionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF3D709153DCC9A009A1FE5 /* GPUImage3x3ConvolutionFilter.m */; }; BCF3D70F153DF9E7009A1FE5 /* GPUImageEmbossFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF3D70D153DF9E6009A1FE5 /* GPUImageEmbossFilter.h */; }; BCF3D710153DF9E7009A1FE5 /* GPUImageEmbossFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF3D70E153DF9E6009A1FE5 /* GPUImageEmbossFilter.m */; }; BCF3D71D153E06C3009A1FE5 /* GPUImageCannyEdgeDetectionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF3D71B153E06C3009A1FE5 /* GPUImageCannyEdgeDetectionFilter.h */; }; BCF3D71E153E06C3009A1FE5 /* GPUImageCannyEdgeDetectionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF3D71C153E06C3009A1FE5 /* GPUImageCannyEdgeDetectionFilter.m */; }; BCF3D722153E0E0C009A1FE5 /* GPUImageThresholdEdgeDetectionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF3D720153E0E0B009A1FE5 /* GPUImageThresholdEdgeDetectionFilter.h */; }; BCF3D723153E0E0C009A1FE5 /* GPUImageThresholdEdgeDetectionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF3D721153E0E0B009A1FE5 /* GPUImageThresholdEdgeDetectionFilter.m */; }; BCF3D730153F0D6F009A1FE5 /* GPUImageSmoothToonFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF3D72E153F0D6E009A1FE5 /* GPUImageSmoothToonFilter.h */; }; BCF3D731153F0D6F009A1FE5 /* GPUImageSmoothToonFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF3D72F153F0D6F009A1FE5 /* GPUImageSmoothToonFilter.m */; }; BCF6B41115A7849F00FC6F58 /* GPUImageOpacityFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF6B40F15A7849F00FC6F58 /* GPUImageOpacityFilter.h */; }; BCF6B41215A7849F00FC6F58 /* GPUImageOpacityFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF6B41015A7849F00FC6F58 /* GPUImageOpacityFilter.m */; }; BCF851BA15CF29B3000EBC8B /* GPUImagePolkaDotFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF851B815CF29B3000EBC8B /* GPUImagePolkaDotFilter.h */; }; BCF851BB15CF29B3000EBC8B /* GPUImagePolkaDotFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF851B915CF29B3000EBC8B /* GPUImagePolkaDotFilter.m */; }; BCF851BF15CF5D59000EBC8B /* GPUImageLocalBinaryPatternFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF851BD15CF5D59000EBC8B /* GPUImageLocalBinaryPatternFilter.h */; }; BCF851C015CF5D59000EBC8B /* GPUImageLocalBinaryPatternFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF851BE15CF5D59000EBC8B /* GPUImageLocalBinaryPatternFilter.m */; }; BCF866C8172589A500912E34 /* GPUImage.h in Headers */ = {isa = PBXBuildFile; fileRef = BC245DBF14DDBCF5009FE7EB /* GPUImage.h */; }; BCFB588715E03E4F00750F12 /* GPUImageLanczosResamplingFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCFB588515E03E4F00750F12 /* GPUImageLanczosResamplingFilter.h */; }; BCFB588815E03E4F00750F12 /* GPUImageLanczosResamplingFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCFB588615E03E4F00750F12 /* GPUImageLanczosResamplingFilter.m */; }; BCFC5F661C18C3B100C7F43B /* GPUImageColorLocalBinaryPatternFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCFC5F641C18C3B100C7F43B /* GPUImageColorLocalBinaryPatternFilter.h */; }; BCFC5F671C18C3B100C7F43B /* GPUImageColorLocalBinaryPatternFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCFC5F651C18C3B100C7F43B /* GPUImageColorLocalBinaryPatternFilter.m */; }; BCFC5F681C18C3D300C7F43B /* GPUImageColorLocalBinaryPatternFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCFC5F641C18C3B100C7F43B /* GPUImageColorLocalBinaryPatternFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCFC5F691C18C3E200C7F43B /* GPUImageColorLocalBinaryPatternFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCFC5F651C18C3B100C7F43B /* GPUImageColorLocalBinaryPatternFilter.m */; }; BEBE83B5155C092A00EEF8C3 /* GPUImageRGBFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BEBE83B3155C092A00EEF8C3 /* GPUImageRGBFilter.h */; }; BEBE83B6155C092A00EEF8C3 /* GPUImageRGBFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BEBE83B4155C092A00EEF8C3 /* GPUImageRGBFilter.m */; }; C04C8D1715F8059F00449601 /* GPUImageColorBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = C04C8D1515F8059F00449601 /* GPUImageColorBlendFilter.h */; }; C04C8D1815F8059F00449601 /* GPUImageColorBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = C04C8D1615F8059F00449601 /* GPUImageColorBlendFilter.m */; }; C2EDA90615BB136D007CBA0F /* GPUImageHueFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = C2EDA90415BB136D007CBA0F /* GPUImageHueFilter.h */; }; C2EDA90715BB136D007CBA0F /* GPUImageHueFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = C2EDA90515BB136D007CBA0F /* GPUImageHueFilter.m */; }; D30ACF231BAFE3DD00E9759C /* AssetsLibrary.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D30ACF221BAFE3DD00E9759C /* AssetsLibrary.framework */; }; D443237A17C81C0C00204484 /* GPUImageMovieComposition.h in Headers */ = {isa = PBXBuildFile; fileRef = D443237817C81C0C00204484 /* GPUImageMovieComposition.h */; }; D443237B17C81C0C00204484 /* GPUImageMovieComposition.m in Sources */ = {isa = PBXBuildFile; fileRef = D443237917C81C0C00204484 /* GPUImageMovieComposition.m */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ 0D04CB7A14FB2A29001D6733 /* GPUImageGaussianBlurFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageGaussianBlurFilter.h; path = Source/GPUImageGaussianBlurFilter.h; sourceTree = SOURCE_ROOT; }; 0D04CB7B14FB2A29001D6733 /* GPUImageGaussianBlurFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageGaussianBlurFilter.m; path = Source/GPUImageGaussianBlurFilter.m; sourceTree = SOURCE_ROOT; }; 0D6948891501F58200206FF8 /* GPUImageFilterPipeline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageFilterPipeline.h; path = Source/GPUImageFilterPipeline.h; sourceTree = SOURCE_ROOT; }; 0D69488A1501F58200206FF8 /* GPUImageFilterPipeline.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageFilterPipeline.m; path = Source/GPUImageFilterPipeline.m; sourceTree = SOURCE_ROOT; }; 0D9D91AD15011CA200A5BC83 /* GPUImageGaussianSelectiveBlurFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageGaussianSelectiveBlurFilter.h; path = Source/GPUImageGaussianSelectiveBlurFilter.h; sourceTree = SOURCE_ROOT; }; 0D9D91AE15011CA200A5BC83 /* GPUImageGaussianSelectiveBlurFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageGaussianSelectiveBlurFilter.m; path = Source/GPUImageGaussianSelectiveBlurFilter.m; sourceTree = SOURCE_ROOT; }; 0DF3FA2914FA00C9006AF7D9 /* GPUImageVignetteFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageVignetteFilter.h; path = Source/GPUImageVignetteFilter.h; sourceTree = SOURCE_ROOT; }; 0DF3FA2A14FA00C9006AF7D9 /* GPUImageVignetteFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageVignetteFilter.m; path = Source/GPUImageVignetteFilter.m; sourceTree = SOURCE_ROOT; }; 4308B1D515F7EED10014437A /* GPUImageNormalBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageNormalBlendFilter.h; path = Source/GPUImageNormalBlendFilter.h; sourceTree = SOURCE_ROOT; }; 4308B1D615F7EED20014437A /* GPUImageNormalBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageNormalBlendFilter.m; path = Source/GPUImageNormalBlendFilter.m; sourceTree = SOURCE_ROOT; }; 4686952D155AACAC0060BA43 /* GPUImageSourceOverBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageSourceOverBlendFilter.h; path = Source/GPUImageSourceOverBlendFilter.h; sourceTree = SOURCE_ROOT; }; 4686952E155AACAC0060BA43 /* GPUImageSourceOverBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageSourceOverBlendFilter.m; path = Source/GPUImageSourceOverBlendFilter.m; sourceTree = SOURCE_ROOT; }; 46A8097616B8A48E000C29ED /* GPUImageTwoInputCrossTextureSamplingFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageTwoInputCrossTextureSamplingFilter.h; path = Source/GPUImageTwoInputCrossTextureSamplingFilter.h; sourceTree = SOURCE_ROOT; }; 46A8097716B8A48E000C29ED /* GPUImageTwoInputCrossTextureSamplingFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageTwoInputCrossTextureSamplingFilter.m; path = Source/GPUImageTwoInputCrossTextureSamplingFilter.m; sourceTree = SOURCE_ROOT; }; 46A8097B16B8A6A2000C29ED /* GPUImagePoissonBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImagePoissonBlendFilter.h; path = Source/GPUImagePoissonBlendFilter.h; sourceTree = SOURCE_ROOT; }; 46A8097C16B8A6A2000C29ED /* GPUImagePoissonBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImagePoissonBlendFilter.m; path = Source/GPUImagePoissonBlendFilter.m; sourceTree = SOURCE_ROOT; }; 574B5D891BEA3CC000F4EC5A /* GPUImageColorConversion.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageColorConversion.m; path = Source/GPUImageColorConversion.m; sourceTree = SOURCE_ROOT; }; 574B5D8C1BEA3E5B00F4EC5A /* GPUImageColorConversion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageColorConversion.h; path = Source/GPUImageColorConversion.h; sourceTree = SOURCE_ROOT; }; 6D13DBE4151AA804000B23BA /* GPUImageHazeFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageHazeFilter.h; path = Source/GPUImageHazeFilter.h; sourceTree = SOURCE_ROOT; }; 6D13DBE5151AA804000B23BA /* GPUImageHazeFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageHazeFilter.m; path = Source/GPUImageHazeFilter.m; sourceTree = SOURCE_ROOT; }; 6EE27491150E8FC50040DDB6 /* GPUImageGrayscaleFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageGrayscaleFilter.h; path = Source/GPUImageGrayscaleFilter.h; sourceTree = SOURCE_ROOT; }; 6EE27492150E8FC50040DDB6 /* GPUImageGrayscaleFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageGrayscaleFilter.m; path = Source/GPUImageGrayscaleFilter.m; sourceTree = SOURCE_ROOT; }; 79F8FD131C8B2A620095AB3E /* GPUImageSolarizeFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageSolarizeFilter.h; path = Source/GPUImageSolarizeFilter.h; sourceTree = SOURCE_ROOT; }; 79F8FD141C8B2A620095AB3E /* GPUImageSolarizeFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageSolarizeFilter.m; path = Source/GPUImageSolarizeFilter.m; sourceTree = SOURCE_ROOT; }; 83AE9F961540DFE400F7FC13 /* GPUImageSubtractBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageSubtractBlendFilter.h; path = Source/GPUImageSubtractBlendFilter.h; sourceTree = SOURCE_ROOT; }; 83AE9F971540DFE500F7FC13 /* GPUImageSubtractBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageSubtractBlendFilter.m; path = Source/GPUImageSubtractBlendFilter.m; sourceTree = SOURCE_ROOT; }; 83AE9FCB1540E92800F7FC13 /* GPUImageMaskFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageMaskFilter.h; path = Source/GPUImageMaskFilter.h; sourceTree = SOURCE_ROOT; }; 83AE9FCC1540E92800F7FC13 /* GPUImageMaskFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageMaskFilter.m; path = Source/GPUImageMaskFilter.m; sourceTree = SOURCE_ROOT; }; 84FFC8091936408F00994258 /* GPUImagePicture+TextureSubimage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "GPUImagePicture+TextureSubimage.h"; path = "Source/iOS/GPUImagePicture+TextureSubimage.h"; sourceTree = SOURCE_ROOT; }; 84FFC80A1936408F00994258 /* GPUImagePicture+TextureSubimage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "GPUImagePicture+TextureSubimage.m"; path = "Source/iOS/GPUImagePicture+TextureSubimage.m"; sourceTree = SOURCE_ROOT; }; 96781B2D15C38DCF005FA0D7 /* GPUImageAmatorkaFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageAmatorkaFilter.h; path = Source/GPUImageAmatorkaFilter.h; sourceTree = SOURCE_ROOT; }; 96781B2E15C38DCF005FA0D7 /* GPUImageAmatorkaFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageAmatorkaFilter.m; path = Source/GPUImageAmatorkaFilter.m; sourceTree = SOURCE_ROOT; }; 96781B3215C39E80005FA0D7 /* GPUImageMissEtikateFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageMissEtikateFilter.h; path = Source/GPUImageMissEtikateFilter.h; sourceTree = SOURCE_ROOT; }; 96781B3315C39E80005FA0D7 /* GPUImageMissEtikateFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageMissEtikateFilter.m; path = Source/GPUImageMissEtikateFilter.m; sourceTree = SOURCE_ROOT; }; 96781B4415C3A6F0005FA0D7 /* GPUImageSoftEleganceFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageSoftEleganceFilter.h; path = Source/GPUImageSoftEleganceFilter.h; sourceTree = SOURCE_ROOT; }; 96781B4515C3A6F0005FA0D7 /* GPUImageSoftEleganceFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageSoftEleganceFilter.m; path = Source/GPUImageSoftEleganceFilter.m; sourceTree = SOURCE_ROOT; }; 96DD3C1215C2780500DF637E /* GPUImageLookupFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageLookupFilter.h; path = Source/GPUImageLookupFilter.h; sourceTree = SOURCE_ROOT; }; 96DD3C1315C2780500DF637E /* GPUImageLookupFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageLookupFilter.m; path = Source/GPUImageLookupFilter.m; sourceTree = SOURCE_ROOT; }; A4741D4E19A91F87005EE1A4 /* GPUImageHistogramEqualizationFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageHistogramEqualizationFilter.h; path = Source/GPUImageHistogramEqualizationFilter.h; sourceTree = SOURCE_ROOT; }; A4741D4F19A91F87005EE1A4 /* GPUImageHistogramEqualizationFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageHistogramEqualizationFilter.m; path = Source/GPUImageHistogramEqualizationFilter.m; sourceTree = SOURCE_ROOT; }; B80171E416311FCB001C8D16 /* GPUImageHueBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageHueBlendFilter.h; path = Source/GPUImageHueBlendFilter.h; sourceTree = SOURCE_ROOT; }; B80171E516311FCB001C8D16 /* GPUImageHueBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageHueBlendFilter.m; path = Source/GPUImageHueBlendFilter.m; sourceTree = SOURCE_ROOT; }; B80171FC16312800001C8D16 /* GPUImageSaturationBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageSaturationBlendFilter.h; path = Source/GPUImageSaturationBlendFilter.h; sourceTree = SOURCE_ROOT; }; B80171FD16312800001C8D16 /* GPUImageSaturationBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageSaturationBlendFilter.m; path = Source/GPUImageSaturationBlendFilter.m; sourceTree = SOURCE_ROOT; }; B801722D16313151001C8D16 /* GPUImageLuminosityBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageLuminosityBlendFilter.h; path = Source/GPUImageLuminosityBlendFilter.h; sourceTree = SOURCE_ROOT; }; B801722E16313151001C8D16 /* GPUImageLuminosityBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageLuminosityBlendFilter.m; path = Source/GPUImageLuminosityBlendFilter.m; sourceTree = SOURCE_ROOT; }; B81521A014F1BA6A00F105F8 /* GPUImageColorMatrixFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageColorMatrixFilter.h; path = Source/GPUImageColorMatrixFilter.h; sourceTree = SOURCE_ROOT; }; B81521A114F1BA6A00F105F8 /* GPUImageColorMatrixFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageColorMatrixFilter.m; path = Source/GPUImageColorMatrixFilter.m; sourceTree = SOURCE_ROOT; }; B81F2D731788C95500118374 /* GPUImageHSBFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageHSBFilter.h; path = Source/GPUImageHSBFilter.h; sourceTree = SOURCE_ROOT; }; B81F2D741788C95500118374 /* GPUImageHSBFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageHSBFilter.m; path = Source/GPUImageHSBFilter.m; sourceTree = SOURCE_ROOT; }; B8EF4E93162F85850036E5B3 /* GPUImageLevelsFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageLevelsFilter.h; path = Source/GPUImageLevelsFilter.h; sourceTree = SOURCE_ROOT; }; B8EF4E94162F85850036E5B3 /* GPUImageLevelsFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageLevelsFilter.m; path = Source/GPUImageLevelsFilter.m; sourceTree = SOURCE_ROOT; }; BC0147E215BEFE6800FC2B6D /* GPUImageGlassSphereFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageGlassSphereFilter.h; path = Source/GPUImageGlassSphereFilter.h; sourceTree = SOURCE_ROOT; }; BC0147E315BEFE6800FC2B6D /* GPUImageGlassSphereFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageGlassSphereFilter.m; path = Source/GPUImageGlassSphereFilter.m; sourceTree = SOURCE_ROOT; }; BC01E82B155CA3F1004C75C3 /* GPUImageMedianFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageMedianFilter.h; path = Source/GPUImageMedianFilter.h; sourceTree = SOURCE_ROOT; }; BC01E82C155CA3F1004C75C3 /* GPUImageMedianFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageMedianFilter.m; path = Source/GPUImageMedianFilter.m; sourceTree = SOURCE_ROOT; }; BC01E830155CA5E1004C75C3 /* GPUImage3x3TextureSamplingFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImage3x3TextureSamplingFilter.h; path = Source/GPUImage3x3TextureSamplingFilter.h; sourceTree = SOURCE_ROOT; }; BC01E831155CA5E1004C75C3 /* GPUImage3x3TextureSamplingFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImage3x3TextureSamplingFilter.m; path = Source/GPUImage3x3TextureSamplingFilter.m; sourceTree = SOURCE_ROOT; }; BC0690B6157C0C27009274F9 /* GPUImageTwoPassTextureSamplingFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageTwoPassTextureSamplingFilter.h; path = Source/GPUImageTwoPassTextureSamplingFilter.h; sourceTree = SOURCE_ROOT; }; BC0690B7157C0C28009274F9 /* GPUImageTwoPassTextureSamplingFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageTwoPassTextureSamplingFilter.m; path = Source/GPUImageTwoPassTextureSamplingFilter.m; sourceTree = SOURCE_ROOT; }; BC0690BB157C1B37009274F9 /* GPUImageOpeningFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageOpeningFilter.h; path = Source/GPUImageOpeningFilter.h; sourceTree = SOURCE_ROOT; }; BC0690BC157C1B38009274F9 /* GPUImageOpeningFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageOpeningFilter.m; path = Source/GPUImageOpeningFilter.m; sourceTree = SOURCE_ROOT; }; BC0690BF157C2366009274F9 /* GPUImageClosingFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageClosingFilter.h; path = Source/GPUImageClosingFilter.h; sourceTree = SOURCE_ROOT; }; BC0690C0157C2367009274F9 /* GPUImageClosingFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageClosingFilter.m; path = Source/GPUImageClosingFilter.m; sourceTree = SOURCE_ROOT; }; BC0690CE157C2EB9009274F9 /* GPUImageRGBDilationFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageRGBDilationFilter.h; path = Source/GPUImageRGBDilationFilter.h; sourceTree = SOURCE_ROOT; }; BC0690CF157C2EBA009274F9 /* GPUImageRGBDilationFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageRGBDilationFilter.m; path = Source/GPUImageRGBDilationFilter.m; sourceTree = SOURCE_ROOT; }; BC0690D3157C31C9009274F9 /* GPUImageRGBErosionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageRGBErosionFilter.h; path = Source/GPUImageRGBErosionFilter.h; sourceTree = SOURCE_ROOT; }; BC0690D4157C31C9009274F9 /* GPUImageRGBErosionFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageRGBErosionFilter.m; path = Source/GPUImageRGBErosionFilter.m; sourceTree = SOURCE_ROOT; }; BC0690D7157C33B8009274F9 /* GPUImageRGBOpeningFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageRGBOpeningFilter.h; path = Source/GPUImageRGBOpeningFilter.h; sourceTree = SOURCE_ROOT; }; BC0690D8157C33B8009274F9 /* GPUImageRGBOpeningFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageRGBOpeningFilter.m; path = Source/GPUImageRGBOpeningFilter.m; sourceTree = SOURCE_ROOT; }; BC0690DB157C344B009274F9 /* GPUImageRGBClosingFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageRGBClosingFilter.h; path = Source/GPUImageRGBClosingFilter.h; sourceTree = SOURCE_ROOT; }; BC0690DC157C344C009274F9 /* GPUImageRGBClosingFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageRGBClosingFilter.m; path = Source/GPUImageRGBClosingFilter.m; sourceTree = SOURCE_ROOT; }; BC0690F5157C5075009274F9 /* GPUImageColorPackingFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageColorPackingFilter.h; path = Source/GPUImageColorPackingFilter.h; sourceTree = SOURCE_ROOT; }; BC0690F6157C5075009274F9 /* GPUImageColorPackingFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageColorPackingFilter.m; path = Source/GPUImageColorPackingFilter.m; sourceTree = SOURCE_ROOT; }; BC114896155AF65400F107AF /* GPUImageTwoInputFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageTwoInputFilter.h; path = Source/GPUImageTwoInputFilter.h; sourceTree = SOURCE_ROOT; }; BC114897155AF65400F107AF /* GPUImageTwoInputFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageTwoInputFilter.m; path = Source/GPUImageTwoInputFilter.m; sourceTree = SOURCE_ROOT; }; BC185E7816B866AD00EA01AD /* GPUImageLinearBurnBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageLinearBurnBlendFilter.h; path = Source/GPUImageLinearBurnBlendFilter.h; sourceTree = SOURCE_ROOT; }; BC185E7916B866AD00EA01AD /* GPUImageLinearBurnBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageLinearBurnBlendFilter.m; path = Source/GPUImageLinearBurnBlendFilter.m; sourceTree = SOURCE_ROOT; }; BC185E7C16B866CE00EA01AD /* GPUImageGaussianBlurPositionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageGaussianBlurPositionFilter.h; path = Source/GPUImageGaussianBlurPositionFilter.h; sourceTree = SOURCE_ROOT; }; BC185E7D16B866CE00EA01AD /* GPUImageGaussianBlurPositionFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageGaussianBlurPositionFilter.m; path = Source/GPUImageGaussianBlurPositionFilter.m; sourceTree = SOURCE_ROOT; }; BC185E8016B866F000EA01AD /* GPUImagePixellatePositionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImagePixellatePositionFilter.h; path = Source/GPUImagePixellatePositionFilter.h; sourceTree = SOURCE_ROOT; }; BC185E8116B866F000EA01AD /* GPUImagePixellatePositionFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImagePixellatePositionFilter.m; path = Source/GPUImagePixellatePositionFilter.m; sourceTree = SOURCE_ROOT; }; BC1B715514F49DAA00ACA2AB /* GPUImageRawDataOutput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageRawDataOutput.h; path = Source/GPUImageRawDataOutput.h; sourceTree = SOURCE_ROOT; }; BC1B715614F49DAA00ACA2AB /* GPUImageRawDataOutput.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageRawDataOutput.m; path = Source/GPUImageRawDataOutput.m; sourceTree = SOURCE_ROOT; }; BC1B717A14F566E200ACA2AB /* GPUImageSketchFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageSketchFilter.h; path = Source/GPUImageSketchFilter.h; sourceTree = SOURCE_ROOT; }; BC1B717B14F566E200ACA2AB /* GPUImageSketchFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageSketchFilter.m; path = Source/GPUImageSketchFilter.m; sourceTree = SOURCE_ROOT; }; BC1B718C14F56C1D00ACA2AB /* GPUImageSwirlFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageSwirlFilter.h; path = Source/GPUImageSwirlFilter.h; sourceTree = SOURCE_ROOT; }; BC1B718D14F56C1D00ACA2AB /* GPUImageSwirlFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageSwirlFilter.m; path = Source/GPUImageSwirlFilter.m; sourceTree = SOURCE_ROOT; }; BC1B727F14FB16AF00ACA2AB /* GPUImageMovieWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageMovieWriter.h; path = Source/iOS/GPUImageMovieWriter.h; sourceTree = SOURCE_ROOT; }; BC1B728014FB16AF00ACA2AB /* GPUImageMovieWriter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageMovieWriter.m; path = Source/iOS/GPUImageMovieWriter.m; sourceTree = SOURCE_ROOT; }; BC1BBFA6193BC55B0025FC88 /* GPUImageFASTCornerDetectionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageFASTCornerDetectionFilter.h; path = Source/GPUImageFASTCornerDetectionFilter.h; sourceTree = SOURCE_ROOT; }; BC1BBFA7193BC55B0025FC88 /* GPUImageFASTCornerDetectionFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageFASTCornerDetectionFilter.m; path = Source/GPUImageFASTCornerDetectionFilter.m; sourceTree = SOURCE_ROOT; }; BC245DBF14DDBCF5009FE7EB /* GPUImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImage.h; path = Source/GPUImage.h; sourceTree = SOURCE_ROOT; }; BC245DC814DDBED7009FE7EB /* GPUImageFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageFilter.h; path = Source/GPUImageFilter.h; sourceTree = SOURCE_ROOT; }; BC245DC914DDBED7009FE7EB /* GPUImageFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageFilter.m; path = Source/GPUImageFilter.m; sourceTree = SOURCE_ROOT; }; BC27A3C915654F5A004F2D45 /* GPUImagePerlinNoiseFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImagePerlinNoiseFilter.h; path = Source/GPUImagePerlinNoiseFilter.h; sourceTree = SOURCE_ROOT; }; BC27A3CA15654F5A004F2D45 /* GPUImagePerlinNoiseFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImagePerlinNoiseFilter.m; path = Source/GPUImagePerlinNoiseFilter.m; sourceTree = SOURCE_ROOT; }; BC3AC8AE15E6F6170065144E /* GPUImageAverageColor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageAverageColor.h; path = Source/GPUImageAverageColor.h; sourceTree = SOURCE_ROOT; }; BC3AC8AF15E6F6170065144E /* GPUImageAverageColor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageAverageColor.m; path = Source/GPUImageAverageColor.m; sourceTree = SOURCE_ROOT; }; BC44A42C1C110D4500B0DAA0 /* GPUImageColourFASTFeatureDetector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageColourFASTFeatureDetector.h; path = Source/GPUImageColourFASTFeatureDetector.h; sourceTree = SOURCE_ROOT; }; BC44A42D1C110D4500B0DAA0 /* GPUImageColourFASTFeatureDetector.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageColourFASTFeatureDetector.m; path = Source/GPUImageColourFASTFeatureDetector.m; sourceTree = SOURCE_ROOT; }; BC44A42E1C110D4500B0DAA0 /* GPUImageColourFASTSamplingOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageColourFASTSamplingOperation.h; path = Source/GPUImageColourFASTSamplingOperation.h; sourceTree = SOURCE_ROOT; }; BC44A42F1C110D4500B0DAA0 /* GPUImageColourFASTSamplingOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageColourFASTSamplingOperation.m; path = Source/GPUImageColourFASTSamplingOperation.m; sourceTree = SOURCE_ROOT; }; BC4D03CD160919AE00F64358 /* GPUImageHalftoneFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageHalftoneFilter.h; path = Source/GPUImageHalftoneFilter.h; sourceTree = SOURCE_ROOT; }; BC4D03CE160919AE00F64358 /* GPUImageHalftoneFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageHalftoneFilter.m; path = Source/GPUImageHalftoneFilter.m; sourceTree = SOURCE_ROOT; }; BC54D561151904FF003F4A41 /* GPUImageChromaKeyBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageChromaKeyBlendFilter.h; path = Source/GPUImageChromaKeyBlendFilter.h; sourceTree = SOURCE_ROOT; }; BC54D562151904FF003F4A41 /* GPUImageChromaKeyBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageChromaKeyBlendFilter.m; path = Source/GPUImageChromaKeyBlendFilter.m; sourceTree = SOURCE_ROOT; }; BC56D8281579779700CC9C1E /* GPUImageUIElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageUIElement.h; path = Source/GPUImageUIElement.h; sourceTree = SOURCE_ROOT; }; BC56D8291579779700CC9C1E /* GPUImageUIElement.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageUIElement.m; path = Source/GPUImageUIElement.m; sourceTree = SOURCE_ROOT; }; BC56D848157ADA4F00CC9C1E /* GPUImageDilationFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageDilationFilter.h; path = Source/GPUImageDilationFilter.h; sourceTree = SOURCE_ROOT; }; BC56D849157ADA4F00CC9C1E /* GPUImageDilationFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageDilationFilter.m; path = Source/GPUImageDilationFilter.m; sourceTree = SOURCE_ROOT; }; BC56D84D157ADA6F00CC9C1E /* GPUImageErosionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageErosionFilter.h; path = Source/GPUImageErosionFilter.h; sourceTree = SOURCE_ROOT; }; BC56D84E157ADA6F00CC9C1E /* GPUImageErosionFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageErosionFilter.m; path = Source/GPUImageErosionFilter.m; sourceTree = SOURCE_ROOT; }; BC6C553E1730679D00EB222D /* GPUImageLaplacianFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageLaplacianFilter.h; path = Source/GPUImageLaplacianFilter.h; sourceTree = SOURCE_ROOT; }; BC6C553F1730679D00EB222D /* GPUImageLaplacianFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageLaplacianFilter.m; path = Source/GPUImageLaplacianFilter.m; sourceTree = SOURCE_ROOT; }; BC6ED9C01549CA0600966798 /* GPUImageHistogramFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageHistogramFilter.h; path = Source/GPUImageHistogramFilter.h; sourceTree = SOURCE_ROOT; }; BC6ED9C11549CA0600966798 /* GPUImageHistogramFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageHistogramFilter.m; path = Source/GPUImageHistogramFilter.m; sourceTree = SOURCE_ROOT; }; BC73FC011944008500671325 /* GPUImageFramework.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageFramework.h; path = Source/iOS/Framework/GPUImageFramework.h; sourceTree = SOURCE_ROOT; }; BC76CE9915813818008B45D3 /* GPUImageSphereRefractionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageSphereRefractionFilter.h; path = Source/GPUImageSphereRefractionFilter.h; sourceTree = SOURCE_ROOT; }; BC76CE9A15813818008B45D3 /* GPUImageSphereRefractionFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageSphereRefractionFilter.m; path = Source/GPUImageSphereRefractionFilter.m; sourceTree = SOURCE_ROOT; }; BC7CC63315605A3500468085 /* GPUImageBilateralFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageBilateralFilter.h; path = Source/GPUImageBilateralFilter.h; sourceTree = SOURCE_ROOT; }; BC7CC63415605A3500468085 /* GPUImageBilateralFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageBilateralFilter.m; path = Source/GPUImageBilateralFilter.m; sourceTree = SOURCE_ROOT; }; BC7CC69A1562C4BA00468085 /* GPUImageCrosshairGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageCrosshairGenerator.h; path = Source/GPUImageCrosshairGenerator.h; sourceTree = SOURCE_ROOT; }; BC7CC69B1562C4BA00468085 /* GPUImageCrosshairGenerator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageCrosshairGenerator.m; path = Source/GPUImageCrosshairGenerator.m; sourceTree = SOURCE_ROOT; }; BC7D95D31523EE67000DF037 /* GPUImageStillCamera.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageStillCamera.h; path = Source/GPUImageStillCamera.h; sourceTree = SOURCE_ROOT; }; BC7D95D41523EE67000DF037 /* GPUImageStillCamera.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageStillCamera.m; path = Source/GPUImageStillCamera.m; sourceTree = SOURCE_ROOT; }; BC8A583A1813060F00E6B507 /* GPUImageiOSBlurFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageiOSBlurFilter.h; path = Source/GPUImageiOSBlurFilter.h; sourceTree = SOURCE_ROOT; }; BC8A583B1813060F00E6B507 /* GPUImageiOSBlurFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageiOSBlurFilter.m; path = Source/GPUImageiOSBlurFilter.m; sourceTree = SOURCE_ROOT; }; BC8A584918131E4B00E6B507 /* GPUImageLuminanceRangeFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageLuminanceRangeFilter.h; path = Source/GPUImageLuminanceRangeFilter.h; sourceTree = SOURCE_ROOT; }; BC8A584A18131E4B00E6B507 /* GPUImageLuminanceRangeFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageLuminanceRangeFilter.m; path = Source/GPUImageLuminanceRangeFilter.m; sourceTree = SOURCE_ROOT; }; BC95C4061622763D002C4BC7 /* GPUImageHoughTransformLineDetector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageHoughTransformLineDetector.h; path = Source/GPUImageHoughTransformLineDetector.h; sourceTree = SOURCE_ROOT; }; BC95C4071622763D002C4BC7 /* GPUImageHoughTransformLineDetector.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageHoughTransformLineDetector.m; path = Source/GPUImageHoughTransformLineDetector.m; sourceTree = SOURCE_ROOT; }; BC982B4F14F07F790001FF6F /* GPUImageColorInvertFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageColorInvertFilter.h; path = Source/GPUImageColorInvertFilter.h; sourceTree = SOURCE_ROOT; }; BC982B5014F07F790001FF6F /* GPUImageColorInvertFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageColorInvertFilter.m; path = Source/GPUImageColorInvertFilter.m; sourceTree = SOURCE_ROOT; }; BC982B5114F07F790001FF6F /* GPUImageSaturationFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageSaturationFilter.h; path = Source/GPUImageSaturationFilter.h; sourceTree = SOURCE_ROOT; }; BC982B5214F07F790001FF6F /* GPUImageSaturationFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageSaturationFilter.m; path = Source/GPUImageSaturationFilter.m; sourceTree = SOURCE_ROOT; }; BC982B6514F092EF0001FF6F /* GPUImageContrastFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageContrastFilter.h; path = Source/GPUImageContrastFilter.h; sourceTree = SOURCE_ROOT; }; BC982B6614F092EF0001FF6F /* GPUImageContrastFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageContrastFilter.m; path = Source/GPUImageContrastFilter.m; sourceTree = SOURCE_ROOT; }; BC982B7714F098CC0001FF6F /* GPUImageBrightnessFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageBrightnessFilter.h; path = Source/GPUImageBrightnessFilter.h; sourceTree = SOURCE_ROOT; }; BC982B7814F098CC0001FF6F /* GPUImageBrightnessFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageBrightnessFilter.m; path = Source/GPUImageBrightnessFilter.m; sourceTree = SOURCE_ROOT; }; BC982B7C14F09F980001FF6F /* GPUImageGammaFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageGammaFilter.h; path = Source/GPUImageGammaFilter.h; sourceTree = SOURCE_ROOT; }; BC982B7D14F09F980001FF6F /* GPUImageGammaFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageGammaFilter.m; path = Source/GPUImageGammaFilter.m; sourceTree = SOURCE_ROOT; }; BC982B9714F0B34E0001FF6F /* GPUImageSobelEdgeDetectionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageSobelEdgeDetectionFilter.h; path = Source/GPUImageSobelEdgeDetectionFilter.h; sourceTree = SOURCE_ROOT; }; BC982B9814F0B34E0001FF6F /* GPUImageSobelEdgeDetectionFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageSobelEdgeDetectionFilter.m; path = Source/GPUImageSobelEdgeDetectionFilter.m; sourceTree = SOURCE_ROOT; }; BC982BE714F1CE600001FF6F /* GPUImageDissolveBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageDissolveBlendFilter.h; path = Source/GPUImageDissolveBlendFilter.h; sourceTree = SOURCE_ROOT; }; BC982BE814F1CE600001FF6F /* GPUImageDissolveBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageDissolveBlendFilter.m; path = Source/GPUImageDissolveBlendFilter.m; sourceTree = SOURCE_ROOT; }; BC982BE914F1CE600001FF6F /* GPUImageMultiplyBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageMultiplyBlendFilter.h; path = Source/GPUImageMultiplyBlendFilter.h; sourceTree = SOURCE_ROOT; }; BC982BEA14F1CE600001FF6F /* GPUImageMultiplyBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageMultiplyBlendFilter.m; path = Source/GPUImageMultiplyBlendFilter.m; sourceTree = SOURCE_ROOT; }; BC982C4514F29E580001FF6F /* GPUImageKuwaharaFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageKuwaharaFilter.h; path = Source/GPUImageKuwaharaFilter.h; sourceTree = SOURCE_ROOT; }; BC982C4614F29E580001FF6F /* GPUImageKuwaharaFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageKuwaharaFilter.m; path = Source/GPUImageKuwaharaFilter.m; sourceTree = SOURCE_ROOT; }; BC982C6A14F33C290001FF6F /* GPUImageMovie.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageMovie.h; path = Source/GPUImageMovie.h; sourceTree = SOURCE_ROOT; }; BC982C6B14F33C2A0001FF6F /* GPUImageMovie.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageMovie.m; path = Source/GPUImageMovie.m; sourceTree = SOURCE_ROOT; }; BC982C6C14F33C2A0001FF6F /* GPUImageOverlayBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageOverlayBlendFilter.h; path = Source/GPUImageOverlayBlendFilter.h; sourceTree = SOURCE_ROOT; }; BC982C6D14F33C2A0001FF6F /* GPUImageOverlayBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageOverlayBlendFilter.m; path = Source/GPUImageOverlayBlendFilter.m; sourceTree = SOURCE_ROOT; }; BC982C7D14F34F0B0001FF6F /* GPUImageDarkenBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageDarkenBlendFilter.h; path = Source/GPUImageDarkenBlendFilter.h; sourceTree = SOURCE_ROOT; }; BC982C7E14F34F0B0001FF6F /* GPUImageDarkenBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageDarkenBlendFilter.m; path = Source/GPUImageDarkenBlendFilter.m; sourceTree = SOURCE_ROOT; }; BC982C7F14F34F0C0001FF6F /* GPUImageLightenBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageLightenBlendFilter.h; path = Source/GPUImageLightenBlendFilter.h; sourceTree = SOURCE_ROOT; }; BC982C8014F34F0C0001FF6F /* GPUImageLightenBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageLightenBlendFilter.m; path = Source/GPUImageLightenBlendFilter.m; sourceTree = SOURCE_ROOT; }; BC982C9D14F35C2D0001FF6F /* GPUImageToonFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageToonFilter.h; path = Source/GPUImageToonFilter.h; sourceTree = SOURCE_ROOT; }; BC982C9E14F35C2D0001FF6F /* GPUImageToonFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageToonFilter.m; path = Source/GPUImageToonFilter.m; sourceTree = SOURCE_ROOT; }; BC99234C15EFFC8700ED2C8C /* GPUImageChromaKeyFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageChromaKeyFilter.h; path = Source/GPUImageChromaKeyFilter.h; sourceTree = SOURCE_ROOT; }; BC99234D15EFFC8700ED2C8C /* GPUImageChromaKeyFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageChromaKeyFilter.m; path = Source/GPUImageChromaKeyFilter.m; sourceTree = SOURCE_ROOT; }; BC99235115EFFC9700ED2C8C /* GPUImageWhiteBalanceFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageWhiteBalanceFilter.h; path = Source/GPUImageWhiteBalanceFilter.h; sourceTree = SOURCE_ROOT; }; BC99235215EFFC9700ED2C8C /* GPUImageWhiteBalanceFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageWhiteBalanceFilter.m; path = Source/GPUImageWhiteBalanceFilter.m; sourceTree = SOURCE_ROOT; }; BCA464CA1627C1BC00C0F68E /* GPUImageLineGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageLineGenerator.h; path = Source/GPUImageLineGenerator.h; sourceTree = SOURCE_ROOT; }; BCA464CB1627C1BC00C0F68E /* GPUImageLineGenerator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageLineGenerator.m; path = Source/GPUImageLineGenerator.m; sourceTree = SOURCE_ROOT; }; BCA6327F1623C80800EEB24F /* GPUImageThresholdedNonMaximumSuppressionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageThresholdedNonMaximumSuppressionFilter.h; path = Source/GPUImageThresholdedNonMaximumSuppressionFilter.h; sourceTree = SOURCE_ROOT; }; BCA632801623C80800EEB24F /* GPUImageThresholdedNonMaximumSuppressionFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageThresholdedNonMaximumSuppressionFilter.m; path = Source/GPUImageThresholdedNonMaximumSuppressionFilter.m; sourceTree = SOURCE_ROOT; }; BCA632841623D18B00EEB24F /* GPUImageParallelCoordinateLineTransformFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageParallelCoordinateLineTransformFilter.h; path = Source/GPUImageParallelCoordinateLineTransformFilter.h; sourceTree = SOURCE_ROOT; }; BCA632851623D18B00EEB24F /* GPUImageParallelCoordinateLineTransformFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageParallelCoordinateLineTransformFilter.m; path = Source/GPUImageParallelCoordinateLineTransformFilter.m; sourceTree = SOURCE_ROOT; }; BCA632881623DD0E00EEB24F /* GPUImageThresholdSketchFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageThresholdSketchFilter.h; path = Source/GPUImageThresholdSketchFilter.h; sourceTree = SOURCE_ROOT; }; BCA632891623DD0E00EEB24F /* GPUImageThresholdSketchFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageThresholdSketchFilter.m; path = Source/GPUImageThresholdSketchFilter.m; sourceTree = SOURCE_ROOT; }; BCAA73BA1C18E42400BC2D31 /* GPUImageFourInputFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageFourInputFilter.h; path = Source/GPUImageFourInputFilter.h; sourceTree = SOURCE_ROOT; }; BCAA73BB1C18E42400BC2D31 /* GPUImageFourInputFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageFourInputFilter.m; path = Source/GPUImageFourInputFilter.m; sourceTree = SOURCE_ROOT; }; BCABED8A15263CF20098A93E /* GPUImagePolarPixellateFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImagePolarPixellateFilter.h; path = Source/GPUImagePolarPixellateFilter.h; sourceTree = SOURCE_ROOT; }; BCABED8B15263CF20098A93E /* GPUImagePolarPixellateFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImagePolarPixellateFilter.m; path = Source/GPUImagePolarPixellateFilter.m; sourceTree = SOURCE_ROOT; }; BCABED8C15263CF20098A93E /* GPUImageStretchDistortionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageStretchDistortionFilter.h; path = Source/GPUImageStretchDistortionFilter.h; sourceTree = SOURCE_ROOT; }; BCABED8D15263CF20098A93E /* GPUImageStretchDistortionFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageStretchDistortionFilter.m; path = Source/GPUImageStretchDistortionFilter.m; sourceTree = SOURCE_ROOT; }; BCAD0976154F39C900278521 /* GPUImagePrewittEdgeDetectionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImagePrewittEdgeDetectionFilter.h; path = Source/GPUImagePrewittEdgeDetectionFilter.h; sourceTree = SOURCE_ROOT; }; BCAD0977154F39CA00278521 /* GPUImagePrewittEdgeDetectionFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImagePrewittEdgeDetectionFilter.m; path = Source/GPUImagePrewittEdgeDetectionFilter.m; sourceTree = SOURCE_ROOT; }; BCAD097B154F3CAF00278521 /* GPUImageXYDerivativeFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageXYDerivativeFilter.h; path = Source/GPUImageXYDerivativeFilter.h; sourceTree = SOURCE_ROOT; }; BCAD097C154F3CB000278521 /* GPUImageXYDerivativeFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageXYDerivativeFilter.m; path = Source/GPUImageXYDerivativeFilter.m; sourceTree = SOURCE_ROOT; }; BCAD097F154F7B2700278521 /* GPUImageHarrisCornerDetectionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageHarrisCornerDetectionFilter.h; path = Source/GPUImageHarrisCornerDetectionFilter.h; sourceTree = SOURCE_ROOT; }; BCAD0980154F7B2800278521 /* GPUImageHarrisCornerDetectionFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageHarrisCornerDetectionFilter.m; path = Source/GPUImageHarrisCornerDetectionFilter.m; sourceTree = SOURCE_ROOT; }; BCAD0983154F931C00278521 /* GPUImageAlphaBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageAlphaBlendFilter.h; path = Source/GPUImageAlphaBlendFilter.h; sourceTree = SOURCE_ROOT; }; BCAD0984154F931C00278521 /* GPUImageAlphaBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageAlphaBlendFilter.m; path = Source/GPUImageAlphaBlendFilter.m; sourceTree = SOURCE_ROOT; }; BCAD099D15506F6E00278521 /* GPUImageNonMaximumSuppressionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageNonMaximumSuppressionFilter.h; path = Source/GPUImageNonMaximumSuppressionFilter.h; sourceTree = SOURCE_ROOT; }; BCAD099E15506F6E00278521 /* GPUImageNonMaximumSuppressionFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageNonMaximumSuppressionFilter.m; path = Source/GPUImageNonMaximumSuppressionFilter.m; sourceTree = SOURCE_ROOT; }; BCAD4C9C156F0D8E001E50E1 /* GPUImageShiTomasiFeatureDetectionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageShiTomasiFeatureDetectionFilter.h; path = Source/GPUImageShiTomasiFeatureDetectionFilter.h; sourceTree = SOURCE_ROOT; }; BCAD4C9D156F0D8E001E50E1 /* GPUImageShiTomasiFeatureDetectionFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageShiTomasiFeatureDetectionFilter.m; path = Source/GPUImageShiTomasiFeatureDetectionFilter.m; sourceTree = SOURCE_ROOT; }; BCAD4CA1156F0F35001E50E1 /* GPUImageNobleCornerDetectionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageNobleCornerDetectionFilter.h; path = Source/GPUImageNobleCornerDetectionFilter.h; sourceTree = SOURCE_ROOT; }; BCAD4CA2156F0F35001E50E1 /* GPUImageNobleCornerDetectionFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageNobleCornerDetectionFilter.m; path = Source/GPUImageNobleCornerDetectionFilter.m; sourceTree = SOURCE_ROOT; }; BCAD4D0D15718ACF001E50E1 /* GPUImageSingleComponentGaussianBlurFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageSingleComponentGaussianBlurFilter.h; path = Source/GPUImageSingleComponentGaussianBlurFilter.h; sourceTree = SOURCE_ROOT; }; BCAD4D0E15718AD0001E50E1 /* GPUImageSingleComponentGaussianBlurFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageSingleComponentGaussianBlurFilter.m; path = Source/GPUImageSingleComponentGaussianBlurFilter.m; sourceTree = SOURCE_ROOT; }; BCAD4D1215718F9A001E50E1 /* GPUImageDirectionalSobelEdgeDetectionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageDirectionalSobelEdgeDetectionFilter.h; path = Source/GPUImageDirectionalSobelEdgeDetectionFilter.h; sourceTree = SOURCE_ROOT; }; BCAD4D1315718F9C001E50E1 /* GPUImageDirectionalSobelEdgeDetectionFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageDirectionalSobelEdgeDetectionFilter.m; path = Source/GPUImageDirectionalSobelEdgeDetectionFilter.m; sourceTree = SOURCE_ROOT; }; BCAD4D1A1571B410001E50E1 /* GPUImageDirectionalNonMaximumSuppressionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageDirectionalNonMaximumSuppressionFilter.h; path = Source/GPUImageDirectionalNonMaximumSuppressionFilter.h; sourceTree = SOURCE_ROOT; }; BCAD4D1B1571B410001E50E1 /* GPUImageDirectionalNonMaximumSuppressionFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageDirectionalNonMaximumSuppressionFilter.m; path = Source/GPUImageDirectionalNonMaximumSuppressionFilter.m; sourceTree = SOURCE_ROOT; }; BCAD4D1E1571CB48001E50E1 /* GPUImageWeakPixelInclusionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageWeakPixelInclusionFilter.h; path = Source/GPUImageWeakPixelInclusionFilter.h; sourceTree = SOURCE_ROOT; }; BCAD4D1F1571CB4C001E50E1 /* GPUImageWeakPixelInclusionFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageWeakPixelInclusionFilter.m; path = Source/GPUImageWeakPixelInclusionFilter.m; sourceTree = SOURCE_ROOT; }; BCB030BC173400BC001A1A20 /* GPUImageThreeInputFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageThreeInputFilter.h; path = Source/GPUImageThreeInputFilter.h; sourceTree = SOURCE_ROOT; }; BCB030BD173400BC001A1A20 /* GPUImageThreeInputFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageThreeInputFilter.m; path = Source/GPUImageThreeInputFilter.m; sourceTree = SOURCE_ROOT; }; BCB3B46315F2BA9300EDA3BE /* GPUImageLowPassFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageLowPassFilter.h; path = Source/GPUImageLowPassFilter.h; sourceTree = SOURCE_ROOT; }; BCB3B46415F2BA9300EDA3BE /* GPUImageLowPassFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageLowPassFilter.m; path = Source/GPUImageLowPassFilter.m; sourceTree = SOURCE_ROOT; }; BCB3B46815F2FD1B00EDA3BE /* GPUImageHighPassFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageHighPassFilter.h; path = Source/GPUImageHighPassFilter.h; sourceTree = SOURCE_ROOT; }; BCB3B46915F2FD1B00EDA3BE /* GPUImageHighPassFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageHighPassFilter.m; path = Source/GPUImageHighPassFilter.m; sourceTree = SOURCE_ROOT; }; BCB3B47715F3108700EDA3BE /* GPUImageMotionDetector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageMotionDetector.h; path = Source/GPUImageMotionDetector.h; sourceTree = SOURCE_ROOT; }; BCB3B47815F3108700EDA3BE /* GPUImageMotionDetector.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageMotionDetector.m; path = Source/GPUImageMotionDetector.m; sourceTree = SOURCE_ROOT; }; BCB5DE0B14E87F32000AF3C2 /* GPUImagePixellateFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImagePixellateFilter.h; path = Source/GPUImagePixellateFilter.h; sourceTree = SOURCE_ROOT; }; BCB5DE0C14E87F32000AF3C2 /* GPUImagePixellateFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImagePixellateFilter.m; path = Source/GPUImagePixellateFilter.m; sourceTree = SOURCE_ROOT; }; BCB5E75A14E2086300701302 /* GPUImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageView.h; path = Source/iOS/GPUImageView.h; sourceTree = SOURCE_ROOT; }; BCB5E75B14E2086300701302 /* GPUImageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageView.m; path = Source/iOS/GPUImageView.m; sourceTree = SOURCE_ROOT; }; BCB5E76314E208D600701302 /* GPUImageVideoCamera.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageVideoCamera.h; path = Source/GPUImageVideoCamera.h; sourceTree = SOURCE_ROOT; }; BCB5E76414E208D600701302 /* GPUImageVideoCamera.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageVideoCamera.m; path = Source/GPUImageVideoCamera.m; sourceTree = SOURCE_ROOT; }; BCB5E76A14E20AD700701302 /* GPUImageContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageContext.h; path = Source/iOS/GPUImageContext.h; sourceTree = SOURCE_ROOT; }; BCB5E76B14E20AD700701302 /* GPUImageContext.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageContext.m; path = Source/iOS/GPUImageContext.m; sourceTree = SOURCE_ROOT; }; BCB5E76E14E20B7F00701302 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; BCB5E77014E20B8A00701302 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; BCB5E77214E20B9100701302 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; BCB5E77414E20B9700701302 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; BCB5E77614E20BA800701302 /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = System/Library/Frameworks/CoreVideo.framework; sourceTree = SDKROOT; }; BCB5E77814E20BAF00701302 /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; }; BCB5E77D14E22E4200701302 /* GPUImageOutput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageOutput.h; path = Source/GPUImageOutput.h; sourceTree = SOURCE_ROOT; }; BCB5E77E14E22E4200701302 /* GPUImageOutput.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageOutput.m; path = Source/GPUImageOutput.m; sourceTree = SOURCE_ROOT; }; BCB5E79214E3275100701302 /* GLProgram.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GLProgram.h; path = Source/GLProgram.h; sourceTree = SOURCE_ROOT; }; BCB5E79314E3275200701302 /* GLProgram.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GLProgram.m; path = Source/GLProgram.m; sourceTree = SOURCE_ROOT; }; BCB5E7C014E4B6D400701302 /* GPUImageSepiaFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageSepiaFilter.h; path = Source/GPUImageSepiaFilter.h; sourceTree = SOURCE_ROOT; }; BCB5E7C114E4B6D400701302 /* GPUImageSepiaFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageSepiaFilter.m; path = Source/GPUImageSepiaFilter.m; sourceTree = SOURCE_ROOT; }; BCB5E7D814E6003400701302 /* GPUImagePicture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImagePicture.h; path = Source/iOS/GPUImagePicture.h; sourceTree = SOURCE_ROOT; }; BCB5E7D914E6003400701302 /* GPUImagePicture.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImagePicture.m; path = Source/iOS/GPUImagePicture.m; sourceTree = SOURCE_ROOT; }; BCB6B833150400030041703B /* GPUImageExposureFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageExposureFilter.h; path = Source/GPUImageExposureFilter.h; sourceTree = SOURCE_ROOT; }; BCB6B834150400030041703B /* GPUImageExposureFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageExposureFilter.m; path = Source/GPUImageExposureFilter.m; sourceTree = SOURCE_ROOT; }; BCB6B835150400030041703B /* GPUImageSharpenFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageSharpenFilter.h; path = Source/GPUImageSharpenFilter.h; sourceTree = SOURCE_ROOT; }; BCB6B836150400030041703B /* GPUImageSharpenFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageSharpenFilter.m; path = Source/GPUImageSharpenFilter.m; sourceTree = SOURCE_ROOT; }; BCB6B85015041A920041703B /* GPUImageColorBurnBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageColorBurnBlendFilter.h; path = Source/GPUImageColorBurnBlendFilter.h; sourceTree = SOURCE_ROOT; }; BCB6B85115041A920041703B /* GPUImageColorBurnBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageColorBurnBlendFilter.m; path = Source/GPUImageColorBurnBlendFilter.m; sourceTree = SOURCE_ROOT; }; BCB6B85215041A920041703B /* GPUImageColorDodgeBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageColorDodgeBlendFilter.h; path = Source/GPUImageColorDodgeBlendFilter.h; sourceTree = SOURCE_ROOT; }; BCB6B85315041A920041703B /* GPUImageColorDodgeBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageColorDodgeBlendFilter.m; path = Source/GPUImageColorDodgeBlendFilter.m; sourceTree = SOURCE_ROOT; }; BCB6B85415041A920041703B /* GPUImageScreenBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageScreenBlendFilter.h; path = Source/GPUImageScreenBlendFilter.h; sourceTree = SOURCE_ROOT; }; BCB6B85515041A920041703B /* GPUImageScreenBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageScreenBlendFilter.m; path = Source/GPUImageScreenBlendFilter.m; sourceTree = SOURCE_ROOT; }; BCB6B868150423490041703B /* GPUImageDifferenceBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageDifferenceBlendFilter.h; path = Source/GPUImageDifferenceBlendFilter.h; sourceTree = SOURCE_ROOT; }; BCB6B8691504234A0041703B /* GPUImageDifferenceBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageDifferenceBlendFilter.m; path = Source/GPUImageDifferenceBlendFilter.m; sourceTree = SOURCE_ROOT; }; BCB6B86A1504234A0041703B /* GPUImageExclusionBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageExclusionBlendFilter.h; path = Source/GPUImageExclusionBlendFilter.h; sourceTree = SOURCE_ROOT; }; BCB6B86B1504234A0041703B /* GPUImageExclusionBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageExclusionBlendFilter.m; path = Source/GPUImageExclusionBlendFilter.m; sourceTree = SOURCE_ROOT; }; BCB6B86C1504234A0041703B /* GPUImageHardLightBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageHardLightBlendFilter.h; path = Source/GPUImageHardLightBlendFilter.h; sourceTree = SOURCE_ROOT; }; BCB6B86D1504234A0041703B /* GPUImageHardLightBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageHardLightBlendFilter.m; path = Source/GPUImageHardLightBlendFilter.m; sourceTree = SOURCE_ROOT; }; BCB6B86E1504234A0041703B /* GPUImageSoftLightBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageSoftLightBlendFilter.h; path = Source/GPUImageSoftLightBlendFilter.h; sourceTree = SOURCE_ROOT; }; BCB6B86F1504234A0041703B /* GPUImageSoftLightBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageSoftLightBlendFilter.m; path = Source/GPUImageSoftLightBlendFilter.m; sourceTree = SOURCE_ROOT; }; BCB6B8B91505BF940041703B /* GPUImageTextureOutput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageTextureOutput.h; path = Source/GPUImageTextureOutput.h; sourceTree = SOURCE_ROOT; }; BCB6B8BA1505BF940041703B /* GPUImageTextureOutput.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageTextureOutput.m; path = Source/GPUImageTextureOutput.m; sourceTree = SOURCE_ROOT; }; BCB6B9021507CA8C0041703B /* GPUImageCropFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageCropFilter.h; path = Source/GPUImageCropFilter.h; sourceTree = SOURCE_ROOT; }; BCB6B9031507CA8C0041703B /* GPUImageCropFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageCropFilter.m; path = Source/GPUImageCropFilter.m; sourceTree = SOURCE_ROOT; }; BCB79E0E15EBE1A600965D92 /* GPUImageSolidColorGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageSolidColorGenerator.h; path = Source/GPUImageSolidColorGenerator.h; sourceTree = SOURCE_ROOT; }; BCB79E0F15EBE1A600965D92 /* GPUImageSolidColorGenerator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageSolidColorGenerator.m; path = Source/GPUImageSolidColorGenerator.m; sourceTree = SOURCE_ROOT; }; BCB79E5D15EC131A00965D92 /* GPUImageLuminosity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageLuminosity.h; path = Source/GPUImageLuminosity.h; sourceTree = SOURCE_ROOT; }; BCB79E5E15EC131A00965D92 /* GPUImageLuminosity.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageLuminosity.m; path = Source/GPUImageLuminosity.m; sourceTree = SOURCE_ROOT; }; BCB79E7815EC2A8300965D92 /* GPUImageAverageLuminanceThresholdFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageAverageLuminanceThresholdFilter.h; path = Source/GPUImageAverageLuminanceThresholdFilter.h; sourceTree = SOURCE_ROOT; }; BCB79E7915EC2A8300965D92 /* GPUImageAverageLuminanceThresholdFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageAverageLuminanceThresholdFilter.m; path = Source/GPUImageAverageLuminanceThresholdFilter.m; sourceTree = SOURCE_ROOT; }; BCBC604B16C58B0900B11741 /* GPUImageMotionBlurFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageMotionBlurFilter.h; path = Source/GPUImageMotionBlurFilter.h; sourceTree = SOURCE_ROOT; }; BCBC604C16C58B0900B11741 /* GPUImageMotionBlurFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageMotionBlurFilter.m; path = Source/GPUImageMotionBlurFilter.m; sourceTree = SOURCE_ROOT; }; BCBC605516C8527C00B11741 /* GPUImageZoomBlurFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageZoomBlurFilter.h; path = Source/GPUImageZoomBlurFilter.h; sourceTree = SOURCE_ROOT; }; BCBC605616C8527C00B11741 /* GPUImageZoomBlurFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageZoomBlurFilter.m; path = Source/GPUImageZoomBlurFilter.m; sourceTree = SOURCE_ROOT; }; BCBCE9971595021B00E0ED33 /* GPUImageMonochromeFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageMonochromeFilter.h; path = Source/GPUImageMonochromeFilter.h; sourceTree = SOURCE_ROOT; }; BCBCE9981595021B00E0ED33 /* GPUImageMonochromeFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageMonochromeFilter.m; path = Source/GPUImageMonochromeFilter.m; sourceTree = SOURCE_ROOT; }; BCBCE9D3159944AB00E0ED33 /* GPUImageBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageBuffer.h; path = Source/GPUImageBuffer.h; sourceTree = SOURCE_ROOT; }; BCBCE9D4159944AB00E0ED33 /* GPUImageBuffer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageBuffer.m; path = Source/GPUImageBuffer.m; sourceTree = SOURCE_ROOT; }; BCBF617816E4F44600E2784A /* GPUImageKuwaharaRadius3Filter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageKuwaharaRadius3Filter.h; path = Source/GPUImageKuwaharaRadius3Filter.h; sourceTree = SOURCE_ROOT; }; BCBF617916E4F44600E2784A /* GPUImageKuwaharaRadius3Filter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageKuwaharaRadius3Filter.m; path = Source/GPUImageKuwaharaRadius3Filter.m; sourceTree = SOURCE_ROOT; }; BCC11D70154B44DC0044F5A0 /* GPUImageHistogramGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageHistogramGenerator.h; path = Source/GPUImageHistogramGenerator.h; sourceTree = SOURCE_ROOT; }; BCC11D71154B44DC0044F5A0 /* GPUImageHistogramGenerator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageHistogramGenerator.m; path = Source/GPUImageHistogramGenerator.m; sourceTree = SOURCE_ROOT; }; BCC1E5A6151E74B20006EFA5 /* GPUImagePosterizeFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImagePosterizeFilter.h; path = Source/GPUImagePosterizeFilter.h; sourceTree = SOURCE_ROOT; }; BCC1E5A7151E74B20006EFA5 /* GPUImagePosterizeFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImagePosterizeFilter.m; path = Source/GPUImagePosterizeFilter.m; sourceTree = SOURCE_ROOT; }; BCC1E5B6151E83700006EFA5 /* GPUImageFilterGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageFilterGroup.h; path = Source/GPUImageFilterGroup.h; sourceTree = SOURCE_ROOT; }; BCC1E5B7151E83700006EFA5 /* GPUImageFilterGroup.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageFilterGroup.m; path = Source/GPUImageFilterGroup.m; sourceTree = SOURCE_ROOT; }; BCC1E5C5151EA12B0006EFA5 /* GPUImageBoxBlurFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageBoxBlurFilter.h; path = Source/GPUImageBoxBlurFilter.h; sourceTree = SOURCE_ROOT; }; BCC1E5C6151EA12B0006EFA5 /* GPUImageBoxBlurFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageBoxBlurFilter.m; path = Source/GPUImageBoxBlurFilter.m; sourceTree = SOURCE_ROOT; }; BCC1E5CA151EA6610006EFA5 /* GPUImageAdaptiveThresholdFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageAdaptiveThresholdFilter.h; path = Source/GPUImageAdaptiveThresholdFilter.h; sourceTree = SOURCE_ROOT; }; BCC1E5CB151EA6610006EFA5 /* GPUImageAdaptiveThresholdFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageAdaptiveThresholdFilter.m; path = Source/GPUImageAdaptiveThresholdFilter.m; sourceTree = SOURCE_ROOT; }; BCC1E60E152156620006EFA5 /* GPUImageUnsharpMaskFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageUnsharpMaskFilter.h; path = Source/GPUImageUnsharpMaskFilter.h; sourceTree = SOURCE_ROOT; }; BCC1E60F152156620006EFA5 /* GPUImageUnsharpMaskFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageUnsharpMaskFilter.m; path = Source/GPUImageUnsharpMaskFilter.m; sourceTree = SOURCE_ROOT; }; BCC1E631152239090006EFA5 /* GPUImageBulgeDistortionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageBulgeDistortionFilter.h; path = Source/GPUImageBulgeDistortionFilter.h; sourceTree = SOURCE_ROOT; }; BCC1E632152239090006EFA5 /* GPUImageBulgeDistortionFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageBulgeDistortionFilter.m; path = Source/GPUImageBulgeDistortionFilter.m; sourceTree = SOURCE_ROOT; }; BCC1E636152243620006EFA5 /* GPUImagePinchDistortionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImagePinchDistortionFilter.h; path = Source/GPUImagePinchDistortionFilter.h; sourceTree = SOURCE_ROOT; }; BCC1E637152243620006EFA5 /* GPUImagePinchDistortionFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImagePinchDistortionFilter.m; path = Source/GPUImagePinchDistortionFilter.m; sourceTree = SOURCE_ROOT; }; BCC1E667152368130006EFA5 /* GPUImageCGAColorspaceFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageCGAColorspaceFilter.h; path = Source/GPUImageCGAColorspaceFilter.h; sourceTree = SOURCE_ROOT; }; BCC1E669152368130006EFA5 /* GPUImageCrosshatchFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageCrosshatchFilter.h; path = Source/GPUImageCrosshatchFilter.h; sourceTree = SOURCE_ROOT; }; BCC1E66A152368130006EFA5 /* GPUImageCrosshatchFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageCrosshatchFilter.m; path = Source/GPUImageCrosshatchFilter.m; sourceTree = SOURCE_ROOT; }; BCC1E67B152368840006EFA5 /* GPUImageCGAColorspaceFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageCGAColorspaceFilter.m; path = Source/GPUImageCGAColorspaceFilter.m; sourceTree = SOURCE_ROOT; }; BCC46E5C15B9EFE8005519B9 /* GPUImageHighlightShadowFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageHighlightShadowFilter.h; path = Source/GPUImageHighlightShadowFilter.h; sourceTree = SOURCE_ROOT; }; BCC46E5D15B9EFE8005519B9 /* GPUImageHighlightShadowFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageHighlightShadowFilter.m; path = Source/GPUImageHighlightShadowFilter.m; sourceTree = SOURCE_ROOT; }; BCC46E6115BA095F005519B9 /* GPUImageFalseColorFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageFalseColorFilter.h; path = Source/GPUImageFalseColorFilter.h; sourceTree = SOURCE_ROOT; }; BCC46E6215BA095F005519B9 /* GPUImageFalseColorFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageFalseColorFilter.m; path = Source/GPUImageFalseColorFilter.m; sourceTree = SOURCE_ROOT; }; BCC887CA18A1CEEB008DB37D /* GPUImageFramebuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageFramebuffer.h; path = Source/GPUImageFramebuffer.h; sourceTree = SOURCE_ROOT; }; BCC887CB18A1CEEB008DB37D /* GPUImageFramebuffer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageFramebuffer.m; path = Source/GPUImageFramebuffer.m; sourceTree = SOURCE_ROOT; }; BCC887CE18A1D3AD008DB37D /* GPUImageFramebufferCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageFramebufferCache.h; path = Source/GPUImageFramebufferCache.h; sourceTree = SOURCE_ROOT; }; BCC887CF18A1D3AD008DB37D /* GPUImageFramebufferCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageFramebufferCache.m; path = Source/GPUImageFramebufferCache.m; sourceTree = SOURCE_ROOT; }; BCC93A1C1501E42E00958B26 /* GPUImageTwoPassFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageTwoPassFilter.h; path = Source/GPUImageTwoPassFilter.h; sourceTree = SOURCE_ROOT; }; BCC93A1D1501E42F00958B26 /* GPUImageTwoPassFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageTwoPassFilter.m; path = Source/GPUImageTwoPassFilter.m; sourceTree = SOURCE_ROOT; }; BCC94AB9151E4FD6008554B4 /* GPUImageLuminanceThresholdFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageLuminanceThresholdFilter.h; path = Source/GPUImageLuminanceThresholdFilter.h; sourceTree = SOURCE_ROOT; }; BCC94ABA151E4FD6008554B4 /* GPUImageLuminanceThresholdFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageLuminanceThresholdFilter.m; path = Source/GPUImageLuminanceThresholdFilter.m; sourceTree = SOURCE_ROOT; }; BCC94CF815101EB3002F9BC5 /* GPUImageTransformFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageTransformFilter.h; path = Source/GPUImageTransformFilter.h; sourceTree = SOURCE_ROOT; }; BCC94CF915101EB3002F9BC5 /* GPUImageTransformFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageTransformFilter.m; path = Source/GPUImageTransformFilter.m; sourceTree = SOURCE_ROOT; }; BCD907CC15CDEE720019C556 /* GPUImageDivideBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageDivideBlendFilter.h; path = Source/GPUImageDivideBlendFilter.h; sourceTree = SOURCE_ROOT; }; BCD907CD15CDEE720019C556 /* GPUImageDivideBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageDivideBlendFilter.m; path = Source/GPUImageDivideBlendFilter.m; sourceTree = SOURCE_ROOT; }; BCD907D115CDEE930019C556 /* GPUImageAddBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageAddBlendFilter.h; path = Source/GPUImageAddBlendFilter.h; sourceTree = SOURCE_ROOT; }; BCD907D215CDEE930019C556 /* GPUImageAddBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageAddBlendFilter.m; path = Source/GPUImageAddBlendFilter.m; sourceTree = SOURCE_ROOT; }; BCE209E51943F20C002FEED8 /* GPUImage.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = GPUImage.framework; sourceTree = BUILT_PRODUCTS_DIR; }; BCE209E81943F20C002FEED8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; name = Info.plist; path = Source/iOS/Framework/Info.plist; sourceTree = ""; }; BCF1A33414DDB1EC00852800 /* libGPUImage.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libGPUImage.a; sourceTree = BUILT_PRODUCTS_DIR; }; BCF1A33714DDB1EC00852800 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; BCF1A33B14DDB1EC00852800 /* GPUImage-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "GPUImage-Prefix.pch"; path = "Source/iOS/GPUImage-Prefix.pch"; sourceTree = ""; }; BCF1A34514DDB1EC00852800 /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; }; BCF1E53A15669907006B155F /* GPUImageJFAVoronoiFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageJFAVoronoiFilter.h; path = Source/GPUImageJFAVoronoiFilter.h; sourceTree = SOURCE_ROOT; }; BCF1E53B15669907006B155F /* GPUImageJFAVoronoiFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageJFAVoronoiFilter.m; path = Source/GPUImageJFAVoronoiFilter.m; sourceTree = SOURCE_ROOT; }; BCF1E53C15669907006B155F /* GPUImageMosaicFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageMosaicFilter.h; path = Source/GPUImageMosaicFilter.h; sourceTree = SOURCE_ROOT; }; BCF1E53D15669907006B155F /* GPUImageMosaicFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageMosaicFilter.m; path = Source/GPUImageMosaicFilter.m; sourceTree = SOURCE_ROOT; }; BCF1E53E15669907006B155F /* GPUImageVoronoiConsumerFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageVoronoiConsumerFilter.h; path = Source/GPUImageVoronoiConsumerFilter.h; sourceTree = SOURCE_ROOT; }; BCF1E53F15669907006B155F /* GPUImageVoronoiConsumerFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageVoronoiConsumerFilter.m; path = Source/GPUImageVoronoiConsumerFilter.m; sourceTree = SOURCE_ROOT; }; BCF1E57915673599006B155F /* GPUImageToneCurveFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageToneCurveFilter.h; path = Source/GPUImageToneCurveFilter.h; sourceTree = SOURCE_ROOT; }; BCF1E57A15673599006B155F /* GPUImageToneCurveFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageToneCurveFilter.m; path = Source/GPUImageToneCurveFilter.m; sourceTree = SOURCE_ROOT; }; BCF1E640156AB332006B155F /* GPUImageRawDataInput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageRawDataInput.h; path = Source/GPUImageRawDataInput.h; sourceTree = SOURCE_ROOT; }; BCF1E641156AB332006B155F /* GPUImageRawDataInput.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageRawDataInput.m; path = Source/GPUImageRawDataInput.m; sourceTree = SOURCE_ROOT; }; BCF3D689153CC124009A1FE5 /* GPUImageTextureInput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageTextureInput.h; path = Source/GPUImageTextureInput.h; sourceTree = SOURCE_ROOT; }; BCF3D68A153CC124009A1FE5 /* GPUImageTextureInput.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageTextureInput.m; path = Source/GPUImageTextureInput.m; sourceTree = SOURCE_ROOT; }; BCF3D6DB153CFF61009A1FE5 /* GPUImageTiltShiftFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageTiltShiftFilter.h; path = Source/GPUImageTiltShiftFilter.h; sourceTree = SOURCE_ROOT; }; BCF3D6DC153CFF61009A1FE5 /* GPUImageTiltShiftFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageTiltShiftFilter.m; path = Source/GPUImageTiltShiftFilter.m; sourceTree = SOURCE_ROOT; }; BCF3D708153DCC9A009A1FE5 /* GPUImage3x3ConvolutionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImage3x3ConvolutionFilter.h; path = Source/GPUImage3x3ConvolutionFilter.h; sourceTree = SOURCE_ROOT; }; BCF3D709153DCC9A009A1FE5 /* GPUImage3x3ConvolutionFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImage3x3ConvolutionFilter.m; path = Source/GPUImage3x3ConvolutionFilter.m; sourceTree = SOURCE_ROOT; }; BCF3D70D153DF9E6009A1FE5 /* GPUImageEmbossFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageEmbossFilter.h; path = Source/GPUImageEmbossFilter.h; sourceTree = SOURCE_ROOT; }; BCF3D70E153DF9E6009A1FE5 /* GPUImageEmbossFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageEmbossFilter.m; path = Source/GPUImageEmbossFilter.m; sourceTree = SOURCE_ROOT; }; BCF3D71B153E06C3009A1FE5 /* GPUImageCannyEdgeDetectionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageCannyEdgeDetectionFilter.h; path = Source/GPUImageCannyEdgeDetectionFilter.h; sourceTree = SOURCE_ROOT; }; BCF3D71C153E06C3009A1FE5 /* GPUImageCannyEdgeDetectionFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageCannyEdgeDetectionFilter.m; path = Source/GPUImageCannyEdgeDetectionFilter.m; sourceTree = SOURCE_ROOT; }; BCF3D720153E0E0B009A1FE5 /* GPUImageThresholdEdgeDetectionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageThresholdEdgeDetectionFilter.h; path = Source/GPUImageThresholdEdgeDetectionFilter.h; sourceTree = SOURCE_ROOT; }; BCF3D721153E0E0B009A1FE5 /* GPUImageThresholdEdgeDetectionFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageThresholdEdgeDetectionFilter.m; path = Source/GPUImageThresholdEdgeDetectionFilter.m; sourceTree = SOURCE_ROOT; }; BCF3D72E153F0D6E009A1FE5 /* GPUImageSmoothToonFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageSmoothToonFilter.h; path = Source/GPUImageSmoothToonFilter.h; sourceTree = SOURCE_ROOT; }; BCF3D72F153F0D6F009A1FE5 /* GPUImageSmoothToonFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageSmoothToonFilter.m; path = Source/GPUImageSmoothToonFilter.m; sourceTree = SOURCE_ROOT; }; BCF6B40F15A7849F00FC6F58 /* GPUImageOpacityFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageOpacityFilter.h; path = Source/GPUImageOpacityFilter.h; sourceTree = SOURCE_ROOT; }; BCF6B41015A7849F00FC6F58 /* GPUImageOpacityFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageOpacityFilter.m; path = Source/GPUImageOpacityFilter.m; sourceTree = SOURCE_ROOT; }; BCF851B815CF29B3000EBC8B /* GPUImagePolkaDotFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImagePolkaDotFilter.h; path = Source/GPUImagePolkaDotFilter.h; sourceTree = SOURCE_ROOT; }; BCF851B915CF29B3000EBC8B /* GPUImagePolkaDotFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImagePolkaDotFilter.m; path = Source/GPUImagePolkaDotFilter.m; sourceTree = SOURCE_ROOT; }; BCF851BD15CF5D59000EBC8B /* GPUImageLocalBinaryPatternFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageLocalBinaryPatternFilter.h; path = Source/GPUImageLocalBinaryPatternFilter.h; sourceTree = SOURCE_ROOT; }; BCF851BE15CF5D59000EBC8B /* GPUImageLocalBinaryPatternFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageLocalBinaryPatternFilter.m; path = Source/GPUImageLocalBinaryPatternFilter.m; sourceTree = SOURCE_ROOT; }; BCFB588515E03E4F00750F12 /* GPUImageLanczosResamplingFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageLanczosResamplingFilter.h; path = Source/GPUImageLanczosResamplingFilter.h; sourceTree = SOURCE_ROOT; }; BCFB588615E03E4F00750F12 /* GPUImageLanczosResamplingFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageLanczosResamplingFilter.m; path = Source/GPUImageLanczosResamplingFilter.m; sourceTree = SOURCE_ROOT; }; BCFC5F641C18C3B100C7F43B /* GPUImageColorLocalBinaryPatternFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageColorLocalBinaryPatternFilter.h; path = Source/GPUImageColorLocalBinaryPatternFilter.h; sourceTree = SOURCE_ROOT; }; BCFC5F651C18C3B100C7F43B /* GPUImageColorLocalBinaryPatternFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageColorLocalBinaryPatternFilter.m; path = Source/GPUImageColorLocalBinaryPatternFilter.m; sourceTree = SOURCE_ROOT; }; BEBE83B3155C092A00EEF8C3 /* GPUImageRGBFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageRGBFilter.h; path = Source/GPUImageRGBFilter.h; sourceTree = SOURCE_ROOT; }; BEBE83B4155C092A00EEF8C3 /* GPUImageRGBFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageRGBFilter.m; path = Source/GPUImageRGBFilter.m; sourceTree = SOURCE_ROOT; }; C04C8D1515F8059F00449601 /* GPUImageColorBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageColorBlendFilter.h; path = Source/GPUImageColorBlendFilter.h; sourceTree = SOURCE_ROOT; }; C04C8D1615F8059F00449601 /* GPUImageColorBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageColorBlendFilter.m; path = Source/GPUImageColorBlendFilter.m; sourceTree = SOURCE_ROOT; }; C2EDA90415BB136D007CBA0F /* GPUImageHueFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageHueFilter.h; path = Source/GPUImageHueFilter.h; sourceTree = SOURCE_ROOT; }; C2EDA90515BB136D007CBA0F /* GPUImageHueFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageHueFilter.m; path = Source/GPUImageHueFilter.m; sourceTree = SOURCE_ROOT; }; D30ACF221BAFE3DD00E9759C /* AssetsLibrary.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AssetsLibrary.framework; path = System/Library/Frameworks/AssetsLibrary.framework; sourceTree = SDKROOT; }; D443237817C81C0C00204484 /* GPUImageMovieComposition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageMovieComposition.h; path = Source/GPUImageMovieComposition.h; sourceTree = SOURCE_ROOT; }; D443237917C81C0C00204484 /* GPUImageMovieComposition.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageMovieComposition.m; path = Source/GPUImageMovieComposition.m; sourceTree = SOURCE_ROOT; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ BCE209E11943F20C002FEED8 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( BC57607F19441E060096FFA5 /* Foundation.framework in Frameworks */, BC57607E19441E010096FFA5 /* UIKit.framework in Frameworks */, BC57607D19441DF60096FFA5 /* AVFoundation.framework in Frameworks */, BC57607C19441DF10096FFA5 /* QuartzCore.framework in Frameworks */, BC57607B19441DE80096FFA5 /* OpenGLES.framework in Frameworks */, BC57607A19441DE00096FFA5 /* CoreVideo.framework in Frameworks */, BC57607919441DD90096FFA5 /* CoreMedia.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; BCF1A33114DDB1EC00852800 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( D30ACF231BAFE3DD00E9759C /* AssetsLibrary.framework in Frameworks */, BCB5E77914E20BAF00701302 /* CoreMedia.framework in Frameworks */, BCB5E77714E20BA800701302 /* CoreVideo.framework in Frameworks */, BCB5E77514E20B9700701302 /* OpenGLES.framework in Frameworks */, BCB5E77314E20B9100701302 /* QuartzCore.framework in Frameworks */, BCB5E77114E20B8A00701302 /* AVFoundation.framework in Frameworks */, BCB5E76F14E20B8000701302 /* UIKit.framework in Frameworks */, BCF1A33814DDB1EC00852800 /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 0D6948871501F56600206FF8 /* Pipeline */ = { isa = PBXGroup; children = ( 0D6948891501F58200206FF8 /* GPUImageFilterPipeline.h */, 0D69488A1501F58200206FF8 /* GPUImageFilterPipeline.m */, ); name = Pipeline; sourceTree = ""; }; BC1B715D14F4AFFF00ACA2AB /* Color processing */ = { isa = PBXGroup; children = ( BC982B7714F098CC0001FF6F /* GPUImageBrightnessFilter.h */, BC982B7814F098CC0001FF6F /* GPUImageBrightnessFilter.m */, B8EF4E93162F85850036E5B3 /* GPUImageLevelsFilter.h */, B8EF4E94162F85850036E5B3 /* GPUImageLevelsFilter.m */, BCB6B833150400030041703B /* GPUImageExposureFilter.h */, BCB6B834150400030041703B /* GPUImageExposureFilter.m */, BC982B6514F092EF0001FF6F /* GPUImageContrastFilter.h */, BC982B6614F092EF0001FF6F /* GPUImageContrastFilter.m */, BC982B5114F07F790001FF6F /* GPUImageSaturationFilter.h */, BC982B5214F07F790001FF6F /* GPUImageSaturationFilter.m */, BC982B7C14F09F980001FF6F /* GPUImageGammaFilter.h */, BC982B7D14F09F980001FF6F /* GPUImageGammaFilter.m */, B81521A014F1BA6A00F105F8 /* GPUImageColorMatrixFilter.h */, B81521A114F1BA6A00F105F8 /* GPUImageColorMatrixFilter.m */, BEBE83B3155C092A00EEF8C3 /* GPUImageRGBFilter.h */, BEBE83B4155C092A00EEF8C3 /* GPUImageRGBFilter.m */, B81F2D731788C95500118374 /* GPUImageHSBFilter.h */, B81F2D741788C95500118374 /* GPUImageHSBFilter.m */, C2EDA90415BB136D007CBA0F /* GPUImageHueFilter.h */, C2EDA90515BB136D007CBA0F /* GPUImageHueFilter.m */, BCBCE9971595021B00E0ED33 /* GPUImageMonochromeFilter.h */, BCBCE9981595021B00E0ED33 /* GPUImageMonochromeFilter.m */, BCC46E6115BA095F005519B9 /* GPUImageFalseColorFilter.h */, BCC46E6215BA095F005519B9 /* GPUImageFalseColorFilter.m */, 6D13DBE4151AA804000B23BA /* GPUImageHazeFilter.h */, 6D13DBE5151AA804000B23BA /* GPUImageHazeFilter.m */, BCB5E7C014E4B6D400701302 /* GPUImageSepiaFilter.h */, BCB5E7C114E4B6D400701302 /* GPUImageSepiaFilter.m */, BC982B4F14F07F790001FF6F /* GPUImageColorInvertFilter.h */, BC982B5014F07F790001FF6F /* GPUImageColorInvertFilter.m */, 6EE27491150E8FC50040DDB6 /* GPUImageGrayscaleFilter.h */, 6EE27492150E8FC50040DDB6 /* GPUImageGrayscaleFilter.m */, BCC94AB9151E4FD6008554B4 /* GPUImageLuminanceThresholdFilter.h */, BCC94ABA151E4FD6008554B4 /* GPUImageLuminanceThresholdFilter.m */, BCC1E5CA151EA6610006EFA5 /* GPUImageAdaptiveThresholdFilter.h */, BCC1E5CB151EA6610006EFA5 /* GPUImageAdaptiveThresholdFilter.m */, 79F8FD131C8B2A620095AB3E /* GPUImageSolarizeFilter.h */, 79F8FD141C8B2A620095AB3E /* GPUImageSolarizeFilter.m */, BCB79E7815EC2A8300965D92 /* GPUImageAverageLuminanceThresholdFilter.h */, BCB79E7915EC2A8300965D92 /* GPUImageAverageLuminanceThresholdFilter.m */, BC6ED9C01549CA0600966798 /* GPUImageHistogramFilter.h */, BC6ED9C11549CA0600966798 /* GPUImageHistogramFilter.m */, BCC11D70154B44DC0044F5A0 /* GPUImageHistogramGenerator.h */, BCC11D71154B44DC0044F5A0 /* GPUImageHistogramGenerator.m */, A4741D4E19A91F87005EE1A4 /* GPUImageHistogramEqualizationFilter.h */, A4741D4F19A91F87005EE1A4 /* GPUImageHistogramEqualizationFilter.m */, BCF1E57915673599006B155F /* GPUImageToneCurveFilter.h */, BCF1E57A15673599006B155F /* GPUImageToneCurveFilter.m */, BCC46E5C15B9EFE8005519B9 /* GPUImageHighlightShadowFilter.h */, BCC46E5D15B9EFE8005519B9 /* GPUImageHighlightShadowFilter.m */, 96DD3C1215C2780500DF637E /* GPUImageLookupFilter.h */, 96DD3C1315C2780500DF637E /* GPUImageLookupFilter.m */, 96781B2D15C38DCF005FA0D7 /* GPUImageAmatorkaFilter.h */, 96781B2E15C38DCF005FA0D7 /* GPUImageAmatorkaFilter.m */, 96781B3215C39E80005FA0D7 /* GPUImageMissEtikateFilter.h */, 96781B3315C39E80005FA0D7 /* GPUImageMissEtikateFilter.m */, 96781B4415C3A6F0005FA0D7 /* GPUImageSoftEleganceFilter.h */, 96781B4515C3A6F0005FA0D7 /* GPUImageSoftEleganceFilter.m */, BCF6B40F15A7849F00FC6F58 /* GPUImageOpacityFilter.h */, BCF6B41015A7849F00FC6F58 /* GPUImageOpacityFilter.m */, BC3AC8AE15E6F6170065144E /* GPUImageAverageColor.h */, BC3AC8AF15E6F6170065144E /* GPUImageAverageColor.m */, BCB79E5D15EC131A00965D92 /* GPUImageLuminosity.h */, BCB79E5E15EC131A00965D92 /* GPUImageLuminosity.m */, BCB79E0E15EBE1A600965D92 /* GPUImageSolidColorGenerator.h */, BCB79E0F15EBE1A600965D92 /* GPUImageSolidColorGenerator.m */, BC99234C15EFFC8700ED2C8C /* GPUImageChromaKeyFilter.h */, BC99234D15EFFC8700ED2C8C /* GPUImageChromaKeyFilter.m */, BC99235115EFFC9700ED2C8C /* GPUImageWhiteBalanceFilter.h */, BC99235215EFFC9700ED2C8C /* GPUImageWhiteBalanceFilter.m */, BC8A584918131E4B00E6B507 /* GPUImageLuminanceRangeFilter.h */, BC8A584A18131E4B00E6B507 /* GPUImageLuminanceRangeFilter.m */, ); name = "Color processing"; sourceTree = ""; }; BC1B715E14F4B04800ACA2AB /* Blends */ = { isa = PBXGroup; children = ( 4686952D155AACAC0060BA43 /* GPUImageSourceOverBlendFilter.h */, 4686952E155AACAC0060BA43 /* GPUImageSourceOverBlendFilter.m */, BCB6B85015041A920041703B /* GPUImageColorBurnBlendFilter.h */, BCB6B85115041A920041703B /* GPUImageColorBurnBlendFilter.m */, BCB6B85215041A920041703B /* GPUImageColorDodgeBlendFilter.h */, BCB6B85315041A920041703B /* GPUImageColorDodgeBlendFilter.m */, BC982C7D14F34F0B0001FF6F /* GPUImageDarkenBlendFilter.h */, BC982C7E14F34F0B0001FF6F /* GPUImageDarkenBlendFilter.m */, BCB6B868150423490041703B /* GPUImageDifferenceBlendFilter.h */, BCB6B8691504234A0041703B /* GPUImageDifferenceBlendFilter.m */, BC982BE714F1CE600001FF6F /* GPUImageDissolveBlendFilter.h */, BC982BE814F1CE600001FF6F /* GPUImageDissolveBlendFilter.m */, BCB6B86A1504234A0041703B /* GPUImageExclusionBlendFilter.h */, BCB6B86B1504234A0041703B /* GPUImageExclusionBlendFilter.m */, BCB6B86C1504234A0041703B /* GPUImageHardLightBlendFilter.h */, BCB6B86D1504234A0041703B /* GPUImageHardLightBlendFilter.m */, BCB6B86E1504234A0041703B /* GPUImageSoftLightBlendFilter.h */, BCB6B86F1504234A0041703B /* GPUImageSoftLightBlendFilter.m */, BC982C7F14F34F0C0001FF6F /* GPUImageLightenBlendFilter.h */, BC982C8014F34F0C0001FF6F /* GPUImageLightenBlendFilter.m */, BCD907D115CDEE930019C556 /* GPUImageAddBlendFilter.h */, BCD907D215CDEE930019C556 /* GPUImageAddBlendFilter.m */, 83AE9F961540DFE400F7FC13 /* GPUImageSubtractBlendFilter.h */, 83AE9F971540DFE500F7FC13 /* GPUImageSubtractBlendFilter.m */, BCD907CC15CDEE720019C556 /* GPUImageDivideBlendFilter.h */, BCD907CD15CDEE720019C556 /* GPUImageDivideBlendFilter.m */, BC982BE914F1CE600001FF6F /* GPUImageMultiplyBlendFilter.h */, BC982BEA14F1CE600001FF6F /* GPUImageMultiplyBlendFilter.m */, BC982C6C14F33C2A0001FF6F /* GPUImageOverlayBlendFilter.h */, BC982C6D14F33C2A0001FF6F /* GPUImageOverlayBlendFilter.m */, BCB6B85415041A920041703B /* GPUImageScreenBlendFilter.h */, BCB6B85515041A920041703B /* GPUImageScreenBlendFilter.m */, BC54D561151904FF003F4A41 /* GPUImageChromaKeyBlendFilter.h */, BC54D562151904FF003F4A41 /* GPUImageChromaKeyBlendFilter.m */, BCAD0983154F931C00278521 /* GPUImageAlphaBlendFilter.h */, BCAD0984154F931C00278521 /* GPUImageAlphaBlendFilter.m */, 4308B1D515F7EED10014437A /* GPUImageNormalBlendFilter.h */, 4308B1D615F7EED20014437A /* GPUImageNormalBlendFilter.m */, C04C8D1515F8059F00449601 /* GPUImageColorBlendFilter.h */, C04C8D1615F8059F00449601 /* GPUImageColorBlendFilter.m */, B80171E416311FCB001C8D16 /* GPUImageHueBlendFilter.h */, B80171E516311FCB001C8D16 /* GPUImageHueBlendFilter.m */, B80171FC16312800001C8D16 /* GPUImageSaturationBlendFilter.h */, B80171FD16312800001C8D16 /* GPUImageSaturationBlendFilter.m */, B801722D16313151001C8D16 /* GPUImageLuminosityBlendFilter.h */, B801722E16313151001C8D16 /* GPUImageLuminosityBlendFilter.m */, BC185E7816B866AD00EA01AD /* GPUImageLinearBurnBlendFilter.h */, BC185E7916B866AD00EA01AD /* GPUImageLinearBurnBlendFilter.m */, 46A8097B16B8A6A2000C29ED /* GPUImagePoissonBlendFilter.h */, 46A8097C16B8A6A2000C29ED /* GPUImagePoissonBlendFilter.m */, 83AE9FCB1540E92800F7FC13 /* GPUImageMaskFilter.h */, 83AE9FCC1540E92800F7FC13 /* GPUImageMaskFilter.m */, ); name = Blends; sourceTree = ""; }; BC1B715F14F4B06600ACA2AB /* Effects */ = { isa = PBXGroup; children = ( BC27A3C915654F5A004F2D45 /* GPUImagePerlinNoiseFilter.h */, BC27A3CA15654F5A004F2D45 /* GPUImagePerlinNoiseFilter.m */, BCB5DE0B14E87F32000AF3C2 /* GPUImagePixellateFilter.h */, BCB5DE0C14E87F32000AF3C2 /* GPUImagePixellateFilter.m */, BC185E8016B866F000EA01AD /* GPUImagePixellatePositionFilter.h */, BC185E8116B866F000EA01AD /* GPUImagePixellatePositionFilter.m */, BCF851B815CF29B3000EBC8B /* GPUImagePolkaDotFilter.h */, BCF851B915CF29B3000EBC8B /* GPUImagePolkaDotFilter.m */, BC4D03CD160919AE00F64358 /* GPUImageHalftoneFilter.h */, BC4D03CE160919AE00F64358 /* GPUImageHalftoneFilter.m */, BCABED8A15263CF20098A93E /* GPUImagePolarPixellateFilter.h */, BCABED8B15263CF20098A93E /* GPUImagePolarPixellateFilter.m */, BCC1E669152368130006EFA5 /* GPUImageCrosshatchFilter.h */, BCC1E66A152368130006EFA5 /* GPUImageCrosshatchFilter.m */, BC1B717A14F566E200ACA2AB /* GPUImageSketchFilter.h */, BC1B717B14F566E200ACA2AB /* GPUImageSketchFilter.m */, BCA632881623DD0E00EEB24F /* GPUImageThresholdSketchFilter.h */, BCA632891623DD0E00EEB24F /* GPUImageThresholdSketchFilter.m */, BCF3D70D153DF9E6009A1FE5 /* GPUImageEmbossFilter.h */, BCF3D70E153DF9E6009A1FE5 /* GPUImageEmbossFilter.m */, BC982C9D14F35C2D0001FF6F /* GPUImageToonFilter.h */, BC982C9E14F35C2D0001FF6F /* GPUImageToonFilter.m */, BCF3D72E153F0D6E009A1FE5 /* GPUImageSmoothToonFilter.h */, BCF3D72F153F0D6F009A1FE5 /* GPUImageSmoothToonFilter.m */, BCC1E667152368130006EFA5 /* GPUImageCGAColorspaceFilter.h */, BCC1E67B152368840006EFA5 /* GPUImageCGAColorspaceFilter.m */, BCC1E5A6151E74B20006EFA5 /* GPUImagePosterizeFilter.h */, BCC1E5A7151E74B20006EFA5 /* GPUImagePosterizeFilter.m */, BC1B718C14F56C1D00ACA2AB /* GPUImageSwirlFilter.h */, BC1B718D14F56C1D00ACA2AB /* GPUImageSwirlFilter.m */, BCC1E631152239090006EFA5 /* GPUImageBulgeDistortionFilter.h */, BCC1E632152239090006EFA5 /* GPUImageBulgeDistortionFilter.m */, BCC1E636152243620006EFA5 /* GPUImagePinchDistortionFilter.h */, BCC1E637152243620006EFA5 /* GPUImagePinchDistortionFilter.m */, BCABED8C15263CF20098A93E /* GPUImageStretchDistortionFilter.h */, BCABED8D15263CF20098A93E /* GPUImageStretchDistortionFilter.m */, BC76CE9915813818008B45D3 /* GPUImageSphereRefractionFilter.h */, BC76CE9A15813818008B45D3 /* GPUImageSphereRefractionFilter.m */, BC0147E215BEFE6800FC2B6D /* GPUImageGlassSphereFilter.h */, BC0147E315BEFE6800FC2B6D /* GPUImageGlassSphereFilter.m */, BC982C4514F29E580001FF6F /* GPUImageKuwaharaFilter.h */, BC982C4614F29E580001FF6F /* GPUImageKuwaharaFilter.m */, BCBF617816E4F44600E2784A /* GPUImageKuwaharaRadius3Filter.h */, BCBF617916E4F44600E2784A /* GPUImageKuwaharaRadius3Filter.m */, 0DF3FA2914FA00C9006AF7D9 /* GPUImageVignetteFilter.h */, 0DF3FA2A14FA00C9006AF7D9 /* GPUImageVignetteFilter.m */, BCF1E53A15669907006B155F /* GPUImageJFAVoronoiFilter.h */, BCF1E53B15669907006B155F /* GPUImageJFAVoronoiFilter.m */, BCF1E53C15669907006B155F /* GPUImageMosaicFilter.h */, BCF1E53D15669907006B155F /* GPUImageMosaicFilter.m */, BCF1E53E15669907006B155F /* GPUImageVoronoiConsumerFilter.h */, BCF1E53F15669907006B155F /* GPUImageVoronoiConsumerFilter.m */, ); name = Effects; sourceTree = ""; }; BC245DC314DDBE6B009FE7EB /* Filters */ = { isa = PBXGroup; children = ( BC245DC814DDBED7009FE7EB /* GPUImageFilter.h */, BC245DC914DDBED7009FE7EB /* GPUImageFilter.m */, BC114896155AF65400F107AF /* GPUImageTwoInputFilter.h */, BC114897155AF65400F107AF /* GPUImageTwoInputFilter.m */, BCB030BC173400BC001A1A20 /* GPUImageThreeInputFilter.h */, BCB030BD173400BC001A1A20 /* GPUImageThreeInputFilter.m */, BCAA73BA1C18E42400BC2D31 /* GPUImageFourInputFilter.h */, BCAA73BB1C18E42400BC2D31 /* GPUImageFourInputFilter.m */, BCC93A1C1501E42E00958B26 /* GPUImageTwoPassFilter.h */, BCC93A1D1501E42F00958B26 /* GPUImageTwoPassFilter.m */, BC0690B6157C0C27009274F9 /* GPUImageTwoPassTextureSamplingFilter.h */, BC0690B7157C0C28009274F9 /* GPUImageTwoPassTextureSamplingFilter.m */, BCC1E5B6151E83700006EFA5 /* GPUImageFilterGroup.h */, BCC1E5B7151E83700006EFA5 /* GPUImageFilterGroup.m */, BC01E830155CA5E1004C75C3 /* GPUImage3x3TextureSamplingFilter.h */, BC01E831155CA5E1004C75C3 /* GPUImage3x3TextureSamplingFilter.m */, 46A8097616B8A48E000C29ED /* GPUImageTwoInputCrossTextureSamplingFilter.h */, 46A8097716B8A48E000C29ED /* GPUImageTwoInputCrossTextureSamplingFilter.m */, BCBCE9D3159944AB00E0ED33 /* GPUImageBuffer.h */, BCBCE9D4159944AB00E0ED33 /* GPUImageBuffer.m */, BC1B715D14F4AFFF00ACA2AB /* Color processing */, BCC93A5215031B1700958B26 /* Image processing */, BC1B715E14F4B04800ACA2AB /* Blends */, BC1B715F14F4B06600ACA2AB /* Effects */, ); name = Filters; sourceTree = ""; }; BCB5E78114E232BC00701302 /* Sources */ = { isa = PBXGroup; children = ( BCB5E77D14E22E4200701302 /* GPUImageOutput.h */, BCB5E77E14E22E4200701302 /* GPUImageOutput.m */, BCB5E76314E208D600701302 /* GPUImageVideoCamera.h */, BCB5E76414E208D600701302 /* GPUImageVideoCamera.m */, BC7D95D31523EE67000DF037 /* GPUImageStillCamera.h */, BC7D95D41523EE67000DF037 /* GPUImageStillCamera.m */, BCB5E7D814E6003400701302 /* GPUImagePicture.h */, BCB5E7D914E6003400701302 /* GPUImagePicture.m */, 84FFC8091936408F00994258 /* GPUImagePicture+TextureSubimage.h */, 84FFC80A1936408F00994258 /* GPUImagePicture+TextureSubimage.m */, BC982C6A14F33C290001FF6F /* GPUImageMovie.h */, BC982C6B14F33C2A0001FF6F /* GPUImageMovie.m */, D443237817C81C0C00204484 /* GPUImageMovieComposition.h */, D443237917C81C0C00204484 /* GPUImageMovieComposition.m */, BCF3D689153CC124009A1FE5 /* GPUImageTextureInput.h */, BCF3D68A153CC124009A1FE5 /* GPUImageTextureInput.m */, BCF1E640156AB332006B155F /* GPUImageRawDataInput.h */, BCF1E641156AB332006B155F /* GPUImageRawDataInput.m */, BC56D8281579779700CC9C1E /* GPUImageUIElement.h */, BC56D8291579779700CC9C1E /* GPUImageUIElement.m */, 574B5D8C1BEA3E5B00F4EC5A /* GPUImageColorConversion.h */, 574B5D891BEA3CC000F4EC5A /* GPUImageColorConversion.m */, ); name = Sources; sourceTree = ""; }; BCB5E78214E232D600701302 /* Outputs */ = { isa = PBXGroup; children = ( BCB5E75A14E2086300701302 /* GPUImageView.h */, BCB5E75B14E2086300701302 /* GPUImageView.m */, BC1B727F14FB16AF00ACA2AB /* GPUImageMovieWriter.h */, BC1B728014FB16AF00ACA2AB /* GPUImageMovieWriter.m */, BCB6B8B91505BF940041703B /* GPUImageTextureOutput.h */, BCB6B8BA1505BF940041703B /* GPUImageTextureOutput.m */, BC1B715514F49DAA00ACA2AB /* GPUImageRawDataOutput.h */, BC1B715614F49DAA00ACA2AB /* GPUImageRawDataOutput.m */, ); name = Outputs; sourceTree = ""; }; BCC93A5215031B1700958B26 /* Image processing */ = { isa = PBXGroup; children = ( BCC94CF815101EB3002F9BC5 /* GPUImageTransformFilter.h */, BCC94CF915101EB3002F9BC5 /* GPUImageTransformFilter.m */, BCB6B9021507CA8C0041703B /* GPUImageCropFilter.h */, BCB6B9031507CA8C0041703B /* GPUImageCropFilter.m */, BCB6B835150400030041703B /* GPUImageSharpenFilter.h */, BCB6B836150400030041703B /* GPUImageSharpenFilter.m */, BCC1E60E152156620006EFA5 /* GPUImageUnsharpMaskFilter.h */, BCC1E60F152156620006EFA5 /* GPUImageUnsharpMaskFilter.m */, BCC1E5C5151EA12B0006EFA5 /* GPUImageBoxBlurFilter.h */, BCC1E5C6151EA12B0006EFA5 /* GPUImageBoxBlurFilter.m */, 0D04CB7A14FB2A29001D6733 /* GPUImageGaussianBlurFilter.h */, 0D04CB7B14FB2A29001D6733 /* GPUImageGaussianBlurFilter.m */, 0D9D91AD15011CA200A5BC83 /* GPUImageGaussianSelectiveBlurFilter.h */, 0D9D91AE15011CA200A5BC83 /* GPUImageGaussianSelectiveBlurFilter.m */, BC185E7C16B866CE00EA01AD /* GPUImageGaussianBlurPositionFilter.h */, BC185E7D16B866CE00EA01AD /* GPUImageGaussianBlurPositionFilter.m */, BCAD4D0D15718ACF001E50E1 /* GPUImageSingleComponentGaussianBlurFilter.h */, BCAD4D0E15718AD0001E50E1 /* GPUImageSingleComponentGaussianBlurFilter.m */, BC01E82B155CA3F1004C75C3 /* GPUImageMedianFilter.h */, BC01E82C155CA3F1004C75C3 /* GPUImageMedianFilter.m */, BC7CC63315605A3500468085 /* GPUImageBilateralFilter.h */, BC7CC63415605A3500468085 /* GPUImageBilateralFilter.m */, BCF3D6DB153CFF61009A1FE5 /* GPUImageTiltShiftFilter.h */, BCF3D6DC153CFF61009A1FE5 /* GPUImageTiltShiftFilter.m */, BCF3D708153DCC9A009A1FE5 /* GPUImage3x3ConvolutionFilter.h */, BCF3D709153DCC9A009A1FE5 /* GPUImage3x3ConvolutionFilter.m */, BC6C553E1730679D00EB222D /* GPUImageLaplacianFilter.h */, BC6C553F1730679D00EB222D /* GPUImageLaplacianFilter.m */, BC982B9714F0B34E0001FF6F /* GPUImageSobelEdgeDetectionFilter.h */, BC982B9814F0B34E0001FF6F /* GPUImageSobelEdgeDetectionFilter.m */, BCF3D720153E0E0B009A1FE5 /* GPUImageThresholdEdgeDetectionFilter.h */, BCF3D721153E0E0B009A1FE5 /* GPUImageThresholdEdgeDetectionFilter.m */, BCAD4D1215718F9A001E50E1 /* GPUImageDirectionalSobelEdgeDetectionFilter.h */, BCAD4D1315718F9C001E50E1 /* GPUImageDirectionalSobelEdgeDetectionFilter.m */, BCAD4D1A1571B410001E50E1 /* GPUImageDirectionalNonMaximumSuppressionFilter.h */, BCAD4D1B1571B410001E50E1 /* GPUImageDirectionalNonMaximumSuppressionFilter.m */, BCAD4D1E1571CB48001E50E1 /* GPUImageWeakPixelInclusionFilter.h */, BCAD4D1F1571CB4C001E50E1 /* GPUImageWeakPixelInclusionFilter.m */, BCF3D71B153E06C3009A1FE5 /* GPUImageCannyEdgeDetectionFilter.h */, BCF3D71C153E06C3009A1FE5 /* GPUImageCannyEdgeDetectionFilter.m */, BCAD0976154F39C900278521 /* GPUImagePrewittEdgeDetectionFilter.h */, BCAD0977154F39CA00278521 /* GPUImagePrewittEdgeDetectionFilter.m */, BCAD097B154F3CAF00278521 /* GPUImageXYDerivativeFilter.h */, BCAD097C154F3CB000278521 /* GPUImageXYDerivativeFilter.m */, BCAD097F154F7B2700278521 /* GPUImageHarrisCornerDetectionFilter.h */, BCAD0980154F7B2800278521 /* GPUImageHarrisCornerDetectionFilter.m */, BCAD4CA1156F0F35001E50E1 /* GPUImageNobleCornerDetectionFilter.h */, BCAD4CA2156F0F35001E50E1 /* GPUImageNobleCornerDetectionFilter.m */, BCAD4C9C156F0D8E001E50E1 /* GPUImageShiTomasiFeatureDetectionFilter.h */, BCAD4C9D156F0D8E001E50E1 /* GPUImageShiTomasiFeatureDetectionFilter.m */, BC1BBFA6193BC55B0025FC88 /* GPUImageFASTCornerDetectionFilter.h */, BC1BBFA7193BC55B0025FC88 /* GPUImageFASTCornerDetectionFilter.m */, BCAD099D15506F6E00278521 /* GPUImageNonMaximumSuppressionFilter.h */, BCAD099E15506F6E00278521 /* GPUImageNonMaximumSuppressionFilter.m */, BCA6327F1623C80800EEB24F /* GPUImageThresholdedNonMaximumSuppressionFilter.h */, BCA632801623C80800EEB24F /* GPUImageThresholdedNonMaximumSuppressionFilter.m */, BC7CC69A1562C4BA00468085 /* GPUImageCrosshairGenerator.h */, BC7CC69B1562C4BA00468085 /* GPUImageCrosshairGenerator.m */, BC56D848157ADA4F00CC9C1E /* GPUImageDilationFilter.h */, BC56D849157ADA4F00CC9C1E /* GPUImageDilationFilter.m */, BC0690CE157C2EB9009274F9 /* GPUImageRGBDilationFilter.h */, BC0690CF157C2EBA009274F9 /* GPUImageRGBDilationFilter.m */, BC56D84D157ADA6F00CC9C1E /* GPUImageErosionFilter.h */, BC56D84E157ADA6F00CC9C1E /* GPUImageErosionFilter.m */, BC0690D3157C31C9009274F9 /* GPUImageRGBErosionFilter.h */, BC0690D4157C31C9009274F9 /* GPUImageRGBErosionFilter.m */, BC0690BB157C1B37009274F9 /* GPUImageOpeningFilter.h */, BC0690BC157C1B38009274F9 /* GPUImageOpeningFilter.m */, BC0690D7157C33B8009274F9 /* GPUImageRGBOpeningFilter.h */, BC0690D8157C33B8009274F9 /* GPUImageRGBOpeningFilter.m */, BC0690BF157C2366009274F9 /* GPUImageClosingFilter.h */, BC0690C0157C2367009274F9 /* GPUImageClosingFilter.m */, BC0690DB157C344B009274F9 /* GPUImageRGBClosingFilter.h */, BC0690DC157C344C009274F9 /* GPUImageRGBClosingFilter.m */, BC0690F5157C5075009274F9 /* GPUImageColorPackingFilter.h */, BC0690F6157C5075009274F9 /* GPUImageColorPackingFilter.m */, BCF851BD15CF5D59000EBC8B /* GPUImageLocalBinaryPatternFilter.h */, BCF851BE15CF5D59000EBC8B /* GPUImageLocalBinaryPatternFilter.m */, BCFC5F641C18C3B100C7F43B /* GPUImageColorLocalBinaryPatternFilter.h */, BCFC5F651C18C3B100C7F43B /* GPUImageColorLocalBinaryPatternFilter.m */, BCFB588515E03E4F00750F12 /* GPUImageLanczosResamplingFilter.h */, BCFB588615E03E4F00750F12 /* GPUImageLanczosResamplingFilter.m */, BCB3B46315F2BA9300EDA3BE /* GPUImageLowPassFilter.h */, BCB3B46415F2BA9300EDA3BE /* GPUImageLowPassFilter.m */, BCB3B46815F2FD1B00EDA3BE /* GPUImageHighPassFilter.h */, BCB3B46915F2FD1B00EDA3BE /* GPUImageHighPassFilter.m */, BCB3B47715F3108700EDA3BE /* GPUImageMotionDetector.h */, BCB3B47815F3108700EDA3BE /* GPUImageMotionDetector.m */, BC95C4061622763D002C4BC7 /* GPUImageHoughTransformLineDetector.h */, BC95C4071622763D002C4BC7 /* GPUImageHoughTransformLineDetector.m */, BCA632841623D18B00EEB24F /* GPUImageParallelCoordinateLineTransformFilter.h */, BCA632851623D18B00EEB24F /* GPUImageParallelCoordinateLineTransformFilter.m */, BCA464CA1627C1BC00C0F68E /* GPUImageLineGenerator.h */, BCA464CB1627C1BC00C0F68E /* GPUImageLineGenerator.m */, BCBC604B16C58B0900B11741 /* GPUImageMotionBlurFilter.h */, BCBC604C16C58B0900B11741 /* GPUImageMotionBlurFilter.m */, BCBC605516C8527C00B11741 /* GPUImageZoomBlurFilter.h */, BCBC605616C8527C00B11741 /* GPUImageZoomBlurFilter.m */, BC8A583A1813060F00E6B507 /* GPUImageiOSBlurFilter.h */, BC8A583B1813060F00E6B507 /* GPUImageiOSBlurFilter.m */, BC44A42C1C110D4500B0DAA0 /* GPUImageColourFASTFeatureDetector.h */, BC44A42D1C110D4500B0DAA0 /* GPUImageColourFASTFeatureDetector.m */, BC44A42E1C110D4500B0DAA0 /* GPUImageColourFASTSamplingOperation.h */, BC44A42F1C110D4500B0DAA0 /* GPUImageColourFASTSamplingOperation.m */, ); name = "Image processing"; sourceTree = ""; }; BCF1A32914DDB1EC00852800 = { isa = PBXGroup; children = ( BCF1A33914DDB1EC00852800 /* GPUImage */, BCF1A33614DDB1EC00852800 /* Frameworks */, BCF1A33514DDB1EC00852800 /* Products */, ); sourceTree = ""; }; BCF1A33514DDB1EC00852800 /* Products */ = { isa = PBXGroup; children = ( BCF1A33414DDB1EC00852800 /* libGPUImage.a */, BCE209E51943F20C002FEED8 /* GPUImage.framework */, ); name = Products; sourceTree = ""; }; BCF1A33614DDB1EC00852800 /* Frameworks */ = { isa = PBXGroup; children = ( D30ACF221BAFE3DD00E9759C /* AssetsLibrary.framework */, BCB5E77814E20BAF00701302 /* CoreMedia.framework */, BCB5E77614E20BA800701302 /* CoreVideo.framework */, BCB5E77414E20B9700701302 /* OpenGLES.framework */, BCB5E77214E20B9100701302 /* QuartzCore.framework */, BCB5E77014E20B8A00701302 /* AVFoundation.framework */, BCB5E76E14E20B7F00701302 /* UIKit.framework */, BCF1A33714DDB1EC00852800 /* Foundation.framework */, BCF1A34514DDB1EC00852800 /* SenTestingKit.framework */, ); name = Frameworks; sourceTree = ""; }; BCF1A33914DDB1EC00852800 /* GPUImage */ = { isa = PBXGroup; children = ( BC245DBF14DDBCF5009FE7EB /* GPUImage.h */, BCB5E79214E3275100701302 /* GLProgram.h */, BCB5E79314E3275200701302 /* GLProgram.m */, BCB5E76A14E20AD700701302 /* GPUImageContext.h */, BCB5E76B14E20AD700701302 /* GPUImageContext.m */, BCC887CA18A1CEEB008DB37D /* GPUImageFramebuffer.h */, BCC887CB18A1CEEB008DB37D /* GPUImageFramebuffer.m */, BCC887CE18A1D3AD008DB37D /* GPUImageFramebufferCache.h */, BCC887CF18A1D3AD008DB37D /* GPUImageFramebufferCache.m */, BCB5E78114E232BC00701302 /* Sources */, 0D6948871501F56600206FF8 /* Pipeline */, BC245DC314DDBE6B009FE7EB /* Filters */, BCB5E78214E232D600701302 /* Outputs */, BCF1A33A14DDB1EC00852800 /* Supporting Files */, ); path = GPUImage; sourceTree = ""; }; BCF1A33A14DDB1EC00852800 /* Supporting Files */ = { isa = PBXGroup; children = ( BC73FC011944008500671325 /* GPUImageFramework.h */, BCF1A33B14DDB1EC00852800 /* GPUImage-Prefix.pch */, BCE209E81943F20C002FEED8 /* Info.plist */, ); name = "Supporting Files"; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ BCE209E21943F20C002FEED8 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( BCD81FD919440A97007133DB /* GPUImageFramework.h in Headers */, BCD81E8A194403FE007133DB /* GLProgram.h in Headers */, BCD81E8B194403FE007133DB /* GPUImageContext.h in Headers */, BCD81E8E1944041B007133DB /* GPUImageFramebufferCache.h in Headers */, BCD81E8D19440418007133DB /* GPUImageFramebuffer.h in Headers */, BCD81E8F19440425007133DB /* GPUImageOutput.h in Headers */, BCD81E9019440428007133DB /* GPUImageVideoCamera.h in Headers */, BCD81E911944042B007133DB /* GPUImageStillCamera.h in Headers */, BCD81E921944042E007133DB /* GPUImagePicture.h in Headers */, BCD81E9319440430007133DB /* GPUImageMovie.h in Headers */, BCD81E9419440432007133DB /* GPUImageMovieComposition.h in Headers */, BCD81E9519440435007133DB /* GPUImageTextureInput.h in Headers */, BCD81E9619440438007133DB /* GPUImageRawDataInput.h in Headers */, BCD81E971944043A007133DB /* GPUImageUIElement.h in Headers */, BCD81E981944043F007133DB /* GPUImageFilterPipeline.h in Headers */, BCD81E9919440442007133DB /* GPUImageFilter.h in Headers */, BCD81E9A19440444007133DB /* GPUImageTwoInputFilter.h in Headers */, BCD81E9B19440453007133DB /* GPUImageThreeInputFilter.h in Headers */, BCD81E9C194404EB007133DB /* GPUImageTwoPassFilter.h in Headers */, BCD81E9D194404EB007133DB /* GPUImageTwoPassTextureSamplingFilter.h in Headers */, BCD81E9E194404EB007133DB /* GPUImageFilterGroup.h in Headers */, BCD81E9F194404EB007133DB /* GPUImage3x3TextureSamplingFilter.h in Headers */, BCD81EA0194404EB007133DB /* GPUImageTwoInputCrossTextureSamplingFilter.h in Headers */, BCD81EA1194404EB007133DB /* GPUImageBuffer.h in Headers */, BCD81EA2194404EB007133DB /* GPUImageBrightnessFilter.h in Headers */, BCD81EA3194404EB007133DB /* GPUImageLevelsFilter.h in Headers */, BCD81EA4194404EB007133DB /* GPUImageExposureFilter.h in Headers */, BCD81EA5194404EB007133DB /* GPUImageContrastFilter.h in Headers */, BCD81EA6194404EB007133DB /* GPUImageSaturationFilter.h in Headers */, BCD81EA7194404EB007133DB /* GPUImageGammaFilter.h in Headers */, BCD81EA8194404EB007133DB /* GPUImageColorMatrixFilter.h in Headers */, BCD81EA9194404EB007133DB /* GPUImageRGBFilter.h in Headers */, BCD81EAA194404EB007133DB /* GPUImageHSBFilter.h in Headers */, BCD81EAB194404EB007133DB /* GPUImageHueFilter.h in Headers */, BCD81EAC194404EB007133DB /* GPUImageMonochromeFilter.h in Headers */, BCD81EAD194404EB007133DB /* GPUImageFalseColorFilter.h in Headers */, BCD81EAE194404EB007133DB /* GPUImageHazeFilter.h in Headers */, BCD81EAF194404EB007133DB /* GPUImageSepiaFilter.h in Headers */, BCD81EB0194404EB007133DB /* GPUImageColorInvertFilter.h in Headers */, BCD81EB1194404EB007133DB /* GPUImageGrayscaleFilter.h in Headers */, BCD81EB2194404EB007133DB /* GPUImageLuminanceThresholdFilter.h in Headers */, BCD81EB3194404EB007133DB /* GPUImageAdaptiveThresholdFilter.h in Headers */, BCD81EB4194404EB007133DB /* GPUImageAverageLuminanceThresholdFilter.h in Headers */, BCD81EB5194404EB007133DB /* GPUImageHistogramFilter.h in Headers */, BCD81EB6194404EB007133DB /* GPUImageHistogramGenerator.h in Headers */, BCD81EB7194404EB007133DB /* GPUImageToneCurveFilter.h in Headers */, BCD81EB8194404EB007133DB /* GPUImageHighlightShadowFilter.h in Headers */, BCD81EB9194404EB007133DB /* GPUImageLookupFilter.h in Headers */, BCD81EBA194404EC007133DB /* GPUImageAmatorkaFilter.h in Headers */, BCD81EBB194404EC007133DB /* GPUImageMissEtikateFilter.h in Headers */, BCD81EBC194404EC007133DB /* GPUImageSoftEleganceFilter.h in Headers */, BCD81EBD194404EC007133DB /* GPUImageOpacityFilter.h in Headers */, BCD81EBE194404EC007133DB /* GPUImageAverageColor.h in Headers */, BCD81EBF194404EC007133DB /* GPUImageLuminosity.h in Headers */, BCD81EC0194404EC007133DB /* GPUImageSolidColorGenerator.h in Headers */, BCD81EC1194404EC007133DB /* GPUImageChromaKeyFilter.h in Headers */, BCD81EC2194404EC007133DB /* GPUImageWhiteBalanceFilter.h in Headers */, BCD81EC3194404EC007133DB /* GPUImageLuminanceRangeFilter.h in Headers */, BCD81EC4194404EC007133DB /* GPUImageTransformFilter.h in Headers */, BCD81EC5194404EC007133DB /* GPUImageCropFilter.h in Headers */, BCD81EC6194404EC007133DB /* GPUImageSharpenFilter.h in Headers */, BCD81EC7194404EC007133DB /* GPUImageUnsharpMaskFilter.h in Headers */, BCD81EC8194404EC007133DB /* GPUImageBoxBlurFilter.h in Headers */, BCD81EC9194404EC007133DB /* GPUImageGaussianBlurFilter.h in Headers */, BCD81ECA194404EC007133DB /* GPUImageGaussianSelectiveBlurFilter.h in Headers */, BCD81ECB194404EC007133DB /* GPUImageGaussianBlurPositionFilter.h in Headers */, BCD81ECC194404EC007133DB /* GPUImageSingleComponentGaussianBlurFilter.h in Headers */, BCD81ECD194404EC007133DB /* GPUImageMedianFilter.h in Headers */, BCD81ECE194404ED007133DB /* GPUImageBilateralFilter.h in Headers */, BCD81ECF194404ED007133DB /* GPUImageTiltShiftFilter.h in Headers */, BCD81ED0194404ED007133DB /* GPUImage3x3ConvolutionFilter.h in Headers */, BCD81ED1194404ED007133DB /* GPUImageLaplacianFilter.h in Headers */, BCD81ED2194404ED007133DB /* GPUImageSobelEdgeDetectionFilter.h in Headers */, BCD81ED3194404ED007133DB /* GPUImageThresholdEdgeDetectionFilter.h in Headers */, BCD81ED4194404ED007133DB /* GPUImageDirectionalSobelEdgeDetectionFilter.h in Headers */, BCD81ED5194404ED007133DB /* GPUImageDirectionalNonMaximumSuppressionFilter.h in Headers */, BCD81ED6194404ED007133DB /* GPUImageWeakPixelInclusionFilter.h in Headers */, BCD81ED7194404ED007133DB /* GPUImageCannyEdgeDetectionFilter.h in Headers */, BCD81ED8194404ED007133DB /* GPUImagePrewittEdgeDetectionFilter.h in Headers */, BCD81ED9194404ED007133DB /* GPUImageXYDerivativeFilter.h in Headers */, BCD81EDA194404ED007133DB /* GPUImageHarrisCornerDetectionFilter.h in Headers */, BCD81EDB194404ED007133DB /* GPUImageNobleCornerDetectionFilter.h in Headers */, BCD81EDC194404EE007133DB /* GPUImageShiTomasiFeatureDetectionFilter.h in Headers */, BCD81EDD194404EE007133DB /* GPUImageFASTCornerDetectionFilter.h in Headers */, BCD81EDE194404EE007133DB /* GPUImageNonMaximumSuppressionFilter.h in Headers */, BCD81EDF194404EE007133DB /* GPUImageThresholdedNonMaximumSuppressionFilter.h in Headers */, BCD81EE0194404EE007133DB /* GPUImageCrosshairGenerator.h in Headers */, BCD81EE1194404EE007133DB /* GPUImageDilationFilter.h in Headers */, BCD81EE2194404EE007133DB /* GPUImageRGBDilationFilter.h in Headers */, BCD81EE3194404EE007133DB /* GPUImageErosionFilter.h in Headers */, BCD81EE4194404EE007133DB /* GPUImageRGBErosionFilter.h in Headers */, BCD81EE5194404EE007133DB /* GPUImageOpeningFilter.h in Headers */, BCD81EE6194404EE007133DB /* GPUImageRGBOpeningFilter.h in Headers */, BCD81EE7194404EE007133DB /* GPUImageClosingFilter.h in Headers */, BCD81EE8194404EF007133DB /* GPUImageRGBClosingFilter.h in Headers */, BCD81EE9194404EF007133DB /* GPUImageColorPackingFilter.h in Headers */, BCD81EEA194404EF007133DB /* GPUImageLocalBinaryPatternFilter.h in Headers */, BCD81EEB194404EF007133DB /* GPUImageLanczosResamplingFilter.h in Headers */, BCD81EEC194404EF007133DB /* GPUImageLowPassFilter.h in Headers */, BCD81EED194404EF007133DB /* GPUImageHighPassFilter.h in Headers */, BCD81EEE194404EF007133DB /* GPUImageMotionDetector.h in Headers */, BCD81EEF194404EF007133DB /* GPUImageHoughTransformLineDetector.h in Headers */, BCD81EF0194404EF007133DB /* GPUImageParallelCoordinateLineTransformFilter.h in Headers */, BCD81EF1194404EF007133DB /* GPUImageLineGenerator.h in Headers */, BCD81EF2194404F0007133DB /* GPUImageMotionBlurFilter.h in Headers */, BCD81EF3194404F0007133DB /* GPUImageZoomBlurFilter.h in Headers */, BCD81EF4194404F0007133DB /* GPUImageiOSBlurFilter.h in Headers */, BCD81EF5194404F0007133DB /* GPUImageSourceOverBlendFilter.h in Headers */, BCD81EF6194404F0007133DB /* GPUImageColorBurnBlendFilter.h in Headers */, BCD81EF7194404F0007133DB /* GPUImageColorDodgeBlendFilter.h in Headers */, BCD81EF8194404F0007133DB /* GPUImageDarkenBlendFilter.h in Headers */, BCD81EF9194404F0007133DB /* GPUImageDifferenceBlendFilter.h in Headers */, BCD81EFA194404F0007133DB /* GPUImageDissolveBlendFilter.h in Headers */, BCD81EFB194404F1007133DB /* GPUImageExclusionBlendFilter.h in Headers */, BCD81EFC194404F1007133DB /* GPUImageHardLightBlendFilter.h in Headers */, BCD81EFD194404F1007133DB /* GPUImageSoftLightBlendFilter.h in Headers */, BCD81EFE194404F1007133DB /* GPUImageLightenBlendFilter.h in Headers */, BCD81EFF194404F1007133DB /* GPUImageAddBlendFilter.h in Headers */, BCD81F00194404F1007133DB /* GPUImageSubtractBlendFilter.h in Headers */, BCD81F01194404F1007133DB /* GPUImageDivideBlendFilter.h in Headers */, BCD81F02194404F1007133DB /* GPUImageMultiplyBlendFilter.h in Headers */, BCD81F03194404F2007133DB /* GPUImageOverlayBlendFilter.h in Headers */, BCD81F04194404F2007133DB /* GPUImageScreenBlendFilter.h in Headers */, BCD81F05194404F2007133DB /* GPUImageChromaKeyBlendFilter.h in Headers */, BCD81F06194404F2007133DB /* GPUImageAlphaBlendFilter.h in Headers */, BCD81F07194404F2007133DB /* GPUImageNormalBlendFilter.h in Headers */, BCD81F08194404F2007133DB /* GPUImageColorBlendFilter.h in Headers */, BCD81F09194404F2007133DB /* GPUImageHueBlendFilter.h in Headers */, BCD81F0A194404F2007133DB /* GPUImageSaturationBlendFilter.h in Headers */, BCD81F0B194404F3007133DB /* GPUImageLuminosityBlendFilter.h in Headers */, BCD81F0C194404F3007133DB /* GPUImageLinearBurnBlendFilter.h in Headers */, BCD81F0D194404F3007133DB /* GPUImagePoissonBlendFilter.h in Headers */, BCD81F0E194404F3007133DB /* GPUImageMaskFilter.h in Headers */, BCD81F0F194404F3007133DB /* GPUImagePerlinNoiseFilter.h in Headers */, BCD81F10194404F3007133DB /* GPUImagePixellateFilter.h in Headers */, BCD81F11194404F3007133DB /* GPUImagePixellatePositionFilter.h in Headers */, BCD81F12194404F4007133DB /* GPUImagePolkaDotFilter.h in Headers */, BCD81F13194404F4007133DB /* GPUImageHalftoneFilter.h in Headers */, BCFC5F681C18C3D300C7F43B /* GPUImageColorLocalBinaryPatternFilter.h in Headers */, BCD81F14194404F4007133DB /* GPUImagePolarPixellateFilter.h in Headers */, BCD81F15194404F4007133DB /* GPUImageCrosshatchFilter.h in Headers */, BCD81F16194404F4007133DB /* GPUImageSketchFilter.h in Headers */, BCD81F17194404F4007133DB /* GPUImageThresholdSketchFilter.h in Headers */, BCD81F18194404F4007133DB /* GPUImageEmbossFilter.h in Headers */, BCD81F19194404F5007133DB /* GPUImageToonFilter.h in Headers */, BCD81F1A194404F5007133DB /* GPUImageSmoothToonFilter.h in Headers */, BCD81F1B194404F5007133DB /* GPUImageCGAColorspaceFilter.h in Headers */, BCD81F1C194404F5007133DB /* GPUImagePosterizeFilter.h in Headers */, BCD81F1D194404F5007133DB /* GPUImageSwirlFilter.h in Headers */, BCD81F1E194404F5007133DB /* GPUImageBulgeDistortionFilter.h in Headers */, BCD81F1F194404F6007133DB /* GPUImagePinchDistortionFilter.h in Headers */, BCD81F20194404F6007133DB /* GPUImageStretchDistortionFilter.h in Headers */, BCD81F21194404F6007133DB /* GPUImageSphereRefractionFilter.h in Headers */, BCD81F22194404F6007133DB /* GPUImageGlassSphereFilter.h in Headers */, BCD81F23194404F6007133DB /* GPUImageKuwaharaFilter.h in Headers */, BCD81F24194404F6007133DB /* GPUImageKuwaharaRadius3Filter.h in Headers */, BCD81F25194404F7007133DB /* GPUImageVignetteFilter.h in Headers */, BCD81F26194404F7007133DB /* GPUImageJFAVoronoiFilter.h in Headers */, BCD81F27194404F7007133DB /* GPUImageMosaicFilter.h in Headers */, BCD81F28194404F7007133DB /* GPUImageVoronoiConsumerFilter.h in Headers */, BCAA73BE1C18E42D00BC2D31 /* GPUImageFourInputFilter.h in Headers */, BCD81F29194404F7007133DB /* GPUImageView.h in Headers */, BCD81F2A194404F7007133DB /* GPUImageMovieWriter.h in Headers */, BCD81F2B194404F8007133DB /* GPUImageTextureOutput.h in Headers */, 574B5D8E1BEA3E5B00F4EC5A /* GPUImageColorConversion.h in Headers */, BCD81F2C194404F8007133DB /* GPUImageRawDataOutput.h in Headers */, 79F8FD171C8B2AA00095AB3E /* GPUImageSolarizeFilter.h in Headers */, BC3AA4B21C11104B003B7561 /* GPUImageColourFASTFeatureDetector.h in Headers */, BC3AA4B31C11104E003B7561 /* GPUImageColourFASTSamplingOperation.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; BCF1A33214DDB1EC00852800 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( BC8A583C1813060F00E6B507 /* GPUImageiOSBlurFilter.h in Headers */, 79F8FD151C8B2A620095AB3E /* GPUImageSolarizeFilter.h in Headers */, BCF866C8172589A500912E34 /* GPUImage.h in Headers */, BC245DCA14DDBED7009FE7EB /* GPUImageFilter.h in Headers */, BCB5E75C14E2086300701302 /* GPUImageView.h in Headers */, BCB5E76514E208D700701302 /* GPUImageVideoCamera.h in Headers */, BCB5E76C14E20AD700701302 /* GPUImageContext.h in Headers */, BCB5E77F14E22E4300701302 /* GPUImageOutput.h in Headers */, BCB5E79414E3275200701302 /* GLProgram.h in Headers */, BCB5E7C214E4B6D400701302 /* GPUImageSepiaFilter.h in Headers */, BCB5E7DA14E6003400701302 /* GPUImagePicture.h in Headers */, BCB5DE0D14E87F32000AF3C2 /* GPUImagePixellateFilter.h in Headers */, BC982B5314F07F790001FF6F /* GPUImageColorInvertFilter.h in Headers */, BC982B5514F07F790001FF6F /* GPUImageSaturationFilter.h in Headers */, BC982B6714F092EF0001FF6F /* GPUImageContrastFilter.h in Headers */, BC982B7914F098CC0001FF6F /* GPUImageBrightnessFilter.h in Headers */, BC982B7E14F09F980001FF6F /* GPUImageGammaFilter.h in Headers */, BC982B9914F0B34E0001FF6F /* GPUImageSobelEdgeDetectionFilter.h in Headers */, B81521A214F1BA6A00F105F8 /* GPUImageColorMatrixFilter.h in Headers */, BC982BEB14F1CE600001FF6F /* GPUImageDissolveBlendFilter.h in Headers */, BC982BED14F1CE600001FF6F /* GPUImageMultiplyBlendFilter.h in Headers */, BC982C4714F29E580001FF6F /* GPUImageKuwaharaFilter.h in Headers */, BC982C6E14F33C2A0001FF6F /* GPUImageMovie.h in Headers */, BCAA73BC1C18E42400BC2D31 /* GPUImageFourInputFilter.h in Headers */, BC982C7014F33C2A0001FF6F /* GPUImageOverlayBlendFilter.h in Headers */, BC982C8114F34F0C0001FF6F /* GPUImageDarkenBlendFilter.h in Headers */, BC982C8314F34F0C0001FF6F /* GPUImageLightenBlendFilter.h in Headers */, BC982C9F14F35C2D0001FF6F /* GPUImageToonFilter.h in Headers */, BC1B715714F49DAA00ACA2AB /* GPUImageRawDataOutput.h in Headers */, BC1B717C14F566E200ACA2AB /* GPUImageSketchFilter.h in Headers */, BC1B718E14F56C1D00ACA2AB /* GPUImageSwirlFilter.h in Headers */, 0DF3FA2B14FA00C9006AF7D9 /* GPUImageVignetteFilter.h in Headers */, BC1A483E14FD1EF900D552E8 /* GPUImageGaussianBlurFilter.h in Headers */, BC1B728114FB16AF00ACA2AB /* GPUImageMovieWriter.h in Headers */, BCC93A1E1501E42F00958B26 /* GPUImageTwoPassFilter.h in Headers */, BCC93A321502A92100958B26 /* GPUImageGaussianSelectiveBlurFilter.h in Headers */, B81F2D751788C95500118374 /* GPUImageHSBFilter.h in Headers */, BCC93A331502A92A00958B26 /* GPUImageFilterPipeline.h in Headers */, BCB6B837150400030041703B /* GPUImageExposureFilter.h in Headers */, BCB6B839150400030041703B /* GPUImageSharpenFilter.h in Headers */, A4741D5019A91F87005EE1A4 /* GPUImageHistogramEqualizationFilter.h in Headers */, BCB6B85615041A920041703B /* GPUImageColorBurnBlendFilter.h in Headers */, BCB6B85815041A920041703B /* GPUImageColorDodgeBlendFilter.h in Headers */, BCB6B85A15041A920041703B /* GPUImageScreenBlendFilter.h in Headers */, BCB6B8701504234A0041703B /* GPUImageDifferenceBlendFilter.h in Headers */, BCB6B8721504234A0041703B /* GPUImageExclusionBlendFilter.h in Headers */, BCB6B8741504234A0041703B /* GPUImageHardLightBlendFilter.h in Headers */, BCB6B8761504234A0041703B /* GPUImageSoftLightBlendFilter.h in Headers */, BCB6B8BB1505BF940041703B /* GPUImageTextureOutput.h in Headers */, BCB6B9041507CA8D0041703B /* GPUImageCropFilter.h in Headers */, 83AE9F981540DFE500F7FC13 /* GPUImageSubtractBlendFilter.h in Headers */, 6EE27493150E8FC60040DDB6 /* GPUImageGrayscaleFilter.h in Headers */, BCC94CFA15101EB3002F9BC5 /* GPUImageTransformFilter.h in Headers */, BC54D563151904FF003F4A41 /* GPUImageChromaKeyBlendFilter.h in Headers */, 6D13DBE6151AA804000B23BA /* GPUImageHazeFilter.h in Headers */, BCC94ABB151E4FD6008554B4 /* GPUImageLuminanceThresholdFilter.h in Headers */, BCC1E5A8151E74B20006EFA5 /* GPUImagePosterizeFilter.h in Headers */, BCC1E5B8151E83700006EFA5 /* GPUImageFilterGroup.h in Headers */, BCC1E5C7151EA12B0006EFA5 /* GPUImageBoxBlurFilter.h in Headers */, BCC1E5CC151EA6610006EFA5 /* GPUImageAdaptiveThresholdFilter.h in Headers */, BCC1E610152156620006EFA5 /* GPUImageUnsharpMaskFilter.h in Headers */, BC73FC021944008500671325 /* GPUImageFramework.h in Headers */, BCC1E633152239090006EFA5 /* GPUImageBulgeDistortionFilter.h in Headers */, BCC1E638152243630006EFA5 /* GPUImagePinchDistortionFilter.h in Headers */, BCC1E66B152368130006EFA5 /* GPUImageCGAColorspaceFilter.h in Headers */, BCC1E66D152368130006EFA5 /* GPUImageCrosshatchFilter.h in Headers */, BC7D95D51523EE67000DF037 /* GPUImageStillCamera.h in Headers */, BCFC5F661C18C3B100C7F43B /* GPUImageColorLocalBinaryPatternFilter.h in Headers */, BCABED8E15263CF20098A93E /* GPUImagePolarPixellateFilter.h in Headers */, BCBF617A16E4F44600E2784A /* GPUImageKuwaharaRadius3Filter.h in Headers */, BCABED9015263CF20098A93E /* GPUImageStretchDistortionFilter.h in Headers */, BCF3D68B153CC124009A1FE5 /* GPUImageTextureInput.h in Headers */, BCF3D6DD153CFF61009A1FE5 /* GPUImageTiltShiftFilter.h in Headers */, BCF3D70A153DCC9A009A1FE5 /* GPUImage3x3ConvolutionFilter.h in Headers */, BCF3D70F153DF9E7009A1FE5 /* GPUImageEmbossFilter.h in Headers */, BCF3D71D153E06C3009A1FE5 /* GPUImageCannyEdgeDetectionFilter.h in Headers */, BCBF617D16E4F69B00E2784A /* GPUImagePoissonBlendFilter.h in Headers */, BCF3D722153E0E0C009A1FE5 /* GPUImageThresholdEdgeDetectionFilter.h in Headers */, BCF3D730153F0D6F009A1FE5 /* GPUImageSmoothToonFilter.h in Headers */, 83AE9FCD1540E92800F7FC13 /* GPUImageMaskFilter.h in Headers */, BC6ED9C21549CA0600966798 /* GPUImageHistogramFilter.h in Headers */, BCC11D72154B44DC0044F5A0 /* GPUImageHistogramGenerator.h in Headers */, BCAD0978154F39CA00278521 /* GPUImagePrewittEdgeDetectionFilter.h in Headers */, BC44A4321C110D4500B0DAA0 /* GPUImageColourFASTSamplingOperation.h in Headers */, BCAD097D154F3CB000278521 /* GPUImageXYDerivativeFilter.h in Headers */, BCAD0981154F7B2800278521 /* GPUImageHarrisCornerDetectionFilter.h in Headers */, BCAD0985154F931C00278521 /* GPUImageAlphaBlendFilter.h in Headers */, BCAD099F15506F6F00278521 /* GPUImageNonMaximumSuppressionFilter.h in Headers */, 4686952F155AACAC0060BA43 /* GPUImageSourceOverBlendFilter.h in Headers */, BC114898155AF65400F107AF /* GPUImageTwoInputFilter.h in Headers */, BEBE83B5155C092A00EEF8C3 /* GPUImageRGBFilter.h in Headers */, BC01E82D155CA3F1004C75C3 /* GPUImageMedianFilter.h in Headers */, BC01E832155CA5E2004C75C3 /* GPUImage3x3TextureSamplingFilter.h in Headers */, BC7CC63515605A3500468085 /* GPUImageBilateralFilter.h in Headers */, BC7CC69C1562C4BB00468085 /* GPUImageCrosshairGenerator.h in Headers */, BC27A3CB15654F5A004F2D45 /* GPUImagePerlinNoiseFilter.h in Headers */, BCF1E54015669907006B155F /* GPUImageJFAVoronoiFilter.h in Headers */, BCF1E54215669907006B155F /* GPUImageMosaicFilter.h in Headers */, BCF1E54415669907006B155F /* GPUImageVoronoiConsumerFilter.h in Headers */, BCF1E57B15673599006B155F /* GPUImageToneCurveFilter.h in Headers */, BCF1E642156AB332006B155F /* GPUImageRawDataInput.h in Headers */, BCAD4C9E156F0D8F001E50E1 /* GPUImageShiTomasiFeatureDetectionFilter.h in Headers */, BCAD4CA3156F0F35001E50E1 /* GPUImageNobleCornerDetectionFilter.h in Headers */, BCAD4D0F15718AD2001E50E1 /* GPUImageSingleComponentGaussianBlurFilter.h in Headers */, BCAD4D1415718F9E001E50E1 /* GPUImageDirectionalSobelEdgeDetectionFilter.h in Headers */, BCAD4D1C1571B410001E50E1 /* GPUImageDirectionalNonMaximumSuppressionFilter.h in Headers */, BCAD4D201571CB50001E50E1 /* GPUImageWeakPixelInclusionFilter.h in Headers */, BC56D82A1579779700CC9C1E /* GPUImageUIElement.h in Headers */, BC56D84A157ADA4F00CC9C1E /* GPUImageDilationFilter.h in Headers */, BC56D84F157ADA6F00CC9C1E /* GPUImageErosionFilter.h in Headers */, BC0690B8157C0C28009274F9 /* GPUImageTwoPassTextureSamplingFilter.h in Headers */, BC0690BD157C1B38009274F9 /* GPUImageOpeningFilter.h in Headers */, BC0690C1157C2368009274F9 /* GPUImageClosingFilter.h in Headers */, BC0690D0157C2EBA009274F9 /* GPUImageRGBDilationFilter.h in Headers */, BC1BBFA8193BC55B0025FC88 /* GPUImageFASTCornerDetectionFilter.h in Headers */, BC0690D5157C31C9009274F9 /* GPUImageRGBErosionFilter.h in Headers */, BC44A4301C110D4500B0DAA0 /* GPUImageColourFASTFeatureDetector.h in Headers */, BC0690D9157C33B9009274F9 /* GPUImageRGBOpeningFilter.h in Headers */, BC0690DD157C344D009274F9 /* GPUImageRGBClosingFilter.h in Headers */, BC0690F7157C5075009274F9 /* GPUImageColorPackingFilter.h in Headers */, BC76CE9B15813818008B45D3 /* GPUImageSphereRefractionFilter.h in Headers */, BCBCE9991595021B00E0ED33 /* GPUImageMonochromeFilter.h in Headers */, BCBCE9D5159944AC00E0ED33 /* GPUImageBuffer.h in Headers */, BCF6B41115A7849F00FC6F58 /* GPUImageOpacityFilter.h in Headers */, BCC46E5E15B9EFE8005519B9 /* GPUImageHighlightShadowFilter.h in Headers */, BCC46E6315BA095F005519B9 /* GPUImageFalseColorFilter.h in Headers */, C2EDA90615BB136D007CBA0F /* GPUImageHueFilter.h in Headers */, BC0147E415BEFE6800FC2B6D /* GPUImageGlassSphereFilter.h in Headers */, 96DD3C1415C2780500DF637E /* GPUImageLookupFilter.h in Headers */, 96781B2F15C38DCF005FA0D7 /* GPUImageAmatorkaFilter.h in Headers */, 96781B3415C39E80005FA0D7 /* GPUImageMissEtikateFilter.h in Headers */, 96781B4615C3A6F1005FA0D7 /* GPUImageSoftEleganceFilter.h in Headers */, BCD907CE15CDEE720019C556 /* GPUImageDivideBlendFilter.h in Headers */, BCD907D315CDEE930019C556 /* GPUImageAddBlendFilter.h in Headers */, BCF851BA15CF29B3000EBC8B /* GPUImagePolkaDotFilter.h in Headers */, BCF851BF15CF5D59000EBC8B /* GPUImageLocalBinaryPatternFilter.h in Headers */, BCFB588715E03E4F00750F12 /* GPUImageLanczosResamplingFilter.h in Headers */, BC3AC8B015E6F6170065144E /* GPUImageAverageColor.h in Headers */, BCB79E1015EBE1A700965D92 /* GPUImageSolidColorGenerator.h in Headers */, BCB79E5F15EC131A00965D92 /* GPUImageLuminosity.h in Headers */, BCB79E7A15EC2A8400965D92 /* GPUImageAverageLuminanceThresholdFilter.h in Headers */, BC99234E15EFFC8700ED2C8C /* GPUImageChromaKeyFilter.h in Headers */, BC99235315EFFC9700ED2C8C /* GPUImageWhiteBalanceFilter.h in Headers */, BCB3B46515F2BA9300EDA3BE /* GPUImageLowPassFilter.h in Headers */, BCB3B46A15F2FD1B00EDA3BE /* GPUImageHighPassFilter.h in Headers */, BCB3B47915F3108700EDA3BE /* GPUImageMotionDetector.h in Headers */, 4308B1D715F7EED30014437A /* GPUImageNormalBlendFilter.h in Headers */, BC4D03CF160919AE00F64358 /* GPUImageHalftoneFilter.h in Headers */, BC95C4081622763D002C4BC7 /* GPUImageHoughTransformLineDetector.h in Headers */, BCA632811623C80800EEB24F /* GPUImageThresholdedNonMaximumSuppressionFilter.h in Headers */, BCA632861623D18B00EEB24F /* GPUImageParallelCoordinateLineTransformFilter.h in Headers */, BCA6328A1623DD0E00EEB24F /* GPUImageThresholdSketchFilter.h in Headers */, BCA464CC1627C1BD00C0F68E /* GPUImageLineGenerator.h in Headers */, B8EF4E95162F85850036E5B3 /* GPUImageLevelsFilter.h in Headers */, BC8A584B18131E4B00E6B507 /* GPUImageLuminanceRangeFilter.h in Headers */, C04C8D1715F8059F00449601 /* GPUImageColorBlendFilter.h in Headers */, B80171E616311FCB001C8D16 /* GPUImageHueBlendFilter.h in Headers */, 84FFC80B1936408F00994258 /* GPUImagePicture+TextureSubimage.h in Headers */, B80171FE16312800001C8D16 /* GPUImageSaturationBlendFilter.h in Headers */, B801722F16313151001C8D16 /* GPUImageLuminosityBlendFilter.h in Headers */, BC185E7A16B866AD00EA01AD /* GPUImageLinearBurnBlendFilter.h in Headers */, BC185E7E16B866CE00EA01AD /* GPUImageGaussianBlurPositionFilter.h in Headers */, BC185E8216B866F000EA01AD /* GPUImagePixellatePositionFilter.h in Headers */, 46A8097816B8A48E000C29ED /* GPUImageTwoInputCrossTextureSamplingFilter.h in Headers */, BCBC604D16C58B0900B11741 /* GPUImageMotionBlurFilter.h in Headers */, D443237A17C81C0C00204484 /* GPUImageMovieComposition.h in Headers */, BCBC605716C8527C00B11741 /* GPUImageZoomBlurFilter.h in Headers */, BC6C55401730679D00EB222D /* GPUImageLaplacianFilter.h in Headers */, BCB030BE173400BC001A1A20 /* GPUImageThreeInputFilter.h in Headers */, BCC887CC18A1CEEB008DB37D /* GPUImageFramebuffer.h in Headers */, BCC887D018A1D3AD008DB37D /* GPUImageFramebufferCache.h in Headers */, 574B5D8D1BEA3E5B00F4EC5A /* GPUImageColorConversion.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ BCE209E41943F20C002FEED8 /* GPUImageFramework */ = { isa = PBXNativeTarget; buildConfigurationList = BCE209F81943F20D002FEED8 /* Build configuration list for PBXNativeTarget "GPUImageFramework" */; buildPhases = ( BCE209E01943F20C002FEED8 /* Sources */, BCE209E11943F20C002FEED8 /* Frameworks */, BCE209E21943F20C002FEED8 /* Headers */, BCE209E31943F20C002FEED8 /* Resources */, ); buildRules = ( ); dependencies = ( ); name = GPUImageFramework; productName = GPUImage; productReference = BCE209E51943F20C002FEED8 /* GPUImage.framework */; productType = "com.apple.product-type.framework"; }; BCF1A33314DDB1EC00852800 /* GPUImage */ = { isa = PBXNativeTarget; buildConfigurationList = BCF1A35814DDB1EC00852800 /* Build configuration list for PBXNativeTarget "GPUImage" */; buildPhases = ( BCF1A33014DDB1EC00852800 /* Sources */, BCF1A33114DDB1EC00852800 /* Frameworks */, BCF1A33214DDB1EC00852800 /* Headers */, ); buildRules = ( ); dependencies = ( ); name = GPUImage; productName = GPUImage; productReference = BCF1A33414DDB1EC00852800 /* libGPUImage.a */; productType = "com.apple.product-type.library.static"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ BCF1A32B14DDB1EC00852800 /* Project object */ = { isa = PBXProject; attributes = { LastTestingUpgradeCheck = 0510; LastUpgradeCheck = 0700; ORGANIZATIONNAME = "Brad Larson"; TargetAttributes = { BCE209E41943F20C002FEED8 = { CreatedOnToolsVersion = 6.0; }; }; }; buildConfigurationList = BCF1A32E14DDB1EC00852800 /* Build configuration list for PBXProject "GPUImage" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, ); mainGroup = BCF1A32914DDB1EC00852800; productRefGroup = BCF1A33514DDB1EC00852800 /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( BCF1A33314DDB1EC00852800 /* GPUImage */, BC552B361558C6F4001F3FFA /* Documentation */, BCE209E41943F20C002FEED8 /* GPUImageFramework */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ BCE209E31943F20C002FEED8 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ BC552B3A1558C6FC001F3FFA /* ShellScript */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "# docsetutil was moved in Xcode 4.3\n# if you're using Xcode 4.2 or earlier, remove --docsetutil-path\n\"${APPLEDOC_PATH}\" \\\n--project-name \"GPUImage\" \\\n--project-company \"Sunset Lake Software\" \\\n--company-id \"com.sunsetlakesoftware\" \\\n--output \"${SOURCE_ROOT}/../documentation\" \\\n--keep-undocumented-objects \\\n--keep-undocumented-members \\\n--create-html \\\n--install-docset \\\n--keep-intermediate-files \\\n--no-repeat-first-par \\\n--exit-threshold 9999 \\\n--clean-output \\\n--ignore .m \\\n--logformat xcode \\\n\"${SOURCE_ROOT}\""; }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ BCE209E01943F20C002FEED8 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( BC57608019441E610096FFA5 /* GPUImageContext.m in Sources */, BCD81F2D19440604007133DB /* GLProgram.m in Sources */, BCD81F2F19440604007133DB /* GPUImageFramebuffer.m in Sources */, BCD81F3019440604007133DB /* GPUImageFramebufferCache.m in Sources */, BCD81F3119440604007133DB /* GPUImageOutput.m in Sources */, BCD81F3219440604007133DB /* GPUImageVideoCamera.m in Sources */, BCD81F3319440604007133DB /* GPUImageStillCamera.m in Sources */, BCD81F3419440604007133DB /* GPUImagePicture.m in Sources */, BCD81F3519440604007133DB /* GPUImageMovie.m in Sources */, BCD81F3619440604007133DB /* GPUImageMovieComposition.m in Sources */, BCD81F3719440604007133DB /* GPUImageTextureInput.m in Sources */, BCD81F3819440604007133DB /* GPUImageRawDataInput.m in Sources */, BCD81F3919440604007133DB /* GPUImageUIElement.m in Sources */, BCD81F3A19440604007133DB /* GPUImageFilterPipeline.m in Sources */, BCD81F3B19440604007133DB /* GPUImageFilter.m in Sources */, BCD81F3C19440604007133DB /* GPUImageTwoInputFilter.m in Sources */, BCD81F3D19440604007133DB /* GPUImageThreeInputFilter.m in Sources */, BCD81F3E19440604007133DB /* GPUImageTwoPassFilter.m in Sources */, BCD81F3F19440604007133DB /* GPUImageTwoPassTextureSamplingFilter.m in Sources */, BCD81F4019440604007133DB /* GPUImageFilterGroup.m in Sources */, BCD81F4119440604007133DB /* GPUImage3x3TextureSamplingFilter.m in Sources */, BCD81F4219440604007133DB /* GPUImageTwoInputCrossTextureSamplingFilter.m in Sources */, BCD81F4319440604007133DB /* GPUImageBuffer.m in Sources */, BCD81F4419440604007133DB /* GPUImageBrightnessFilter.m in Sources */, BCD81F4519440604007133DB /* GPUImageLevelsFilter.m in Sources */, BCD81F4619440604007133DB /* GPUImageExposureFilter.m in Sources */, BCD81F4719440604007133DB /* GPUImageContrastFilter.m in Sources */, BCD81F4819440604007133DB /* GPUImageSaturationFilter.m in Sources */, BCD81F4919440604007133DB /* GPUImageGammaFilter.m in Sources */, BCD81F4A19440604007133DB /* GPUImageColorMatrixFilter.m in Sources */, BCD81F4B19440604007133DB /* GPUImageRGBFilter.m in Sources */, BCD81F4C19440604007133DB /* GPUImageHSBFilter.m in Sources */, BCD81F4D19440604007133DB /* GPUImageHueFilter.m in Sources */, 79F8FD181C8B2AA60095AB3E /* GPUImageSolarizeFilter.m in Sources */, BCD81F4E19440604007133DB /* GPUImageMonochromeFilter.m in Sources */, BCD81F4F19440604007133DB /* GPUImageFalseColorFilter.m in Sources */, BCD81F5019440604007133DB /* GPUImageHazeFilter.m in Sources */, BCD81F5119440604007133DB /* GPUImageSepiaFilter.m in Sources */, BCD81F5219440604007133DB /* GPUImageColorInvertFilter.m in Sources */, BCD81F5319440604007133DB /* GPUImageGrayscaleFilter.m in Sources */, BCD81F5419440604007133DB /* GPUImageLuminanceThresholdFilter.m in Sources */, BCD81F5519440604007133DB /* GPUImageAdaptiveThresholdFilter.m in Sources */, BCD81F5619440604007133DB /* GPUImageAverageLuminanceThresholdFilter.m in Sources */, BCD81F5719440604007133DB /* GPUImageHistogramFilter.m in Sources */, BCD81F5819440604007133DB /* GPUImageHistogramGenerator.m in Sources */, BCD81F5919440604007133DB /* GPUImageToneCurveFilter.m in Sources */, BCD81F5A19440604007133DB /* GPUImageHighlightShadowFilter.m in Sources */, BCD81F5B19440604007133DB /* GPUImageLookupFilter.m in Sources */, BCD81F5C19440604007133DB /* GPUImageAmatorkaFilter.m in Sources */, BCD81F5D19440604007133DB /* GPUImageMissEtikateFilter.m in Sources */, BCD81F5E19440604007133DB /* GPUImageSoftEleganceFilter.m in Sources */, BCD81F5F19440604007133DB /* GPUImageOpacityFilter.m in Sources */, BCD81F6019440604007133DB /* GPUImageAverageColor.m in Sources */, BCD81F6119440604007133DB /* GPUImageLuminosity.m in Sources */, BCD81F6219440604007133DB /* GPUImageSolidColorGenerator.m in Sources */, BCD81F6319440604007133DB /* GPUImageChromaKeyFilter.m in Sources */, BCD81F6419440604007133DB /* GPUImageWhiteBalanceFilter.m in Sources */, BCD81F6519440604007133DB /* GPUImageLuminanceRangeFilter.m in Sources */, BCD81F6619440604007133DB /* GPUImageTransformFilter.m in Sources */, BCD81F6719440604007133DB /* GPUImageCropFilter.m in Sources */, BCD81F6819440604007133DB /* GPUImageSharpenFilter.m in Sources */, BCD81F6919440604007133DB /* GPUImageUnsharpMaskFilter.m in Sources */, BCD81F6A19440604007133DB /* GPUImageBoxBlurFilter.m in Sources */, BCD81F6B19440604007133DB /* GPUImageGaussianBlurFilter.m in Sources */, BCD81F6C19440604007133DB /* GPUImageGaussianSelectiveBlurFilter.m in Sources */, BCD81F6D19440604007133DB /* GPUImageGaussianBlurPositionFilter.m in Sources */, BCD81F6E19440604007133DB /* GPUImageSingleComponentGaussianBlurFilter.m in Sources */, BCD81F6F19440604007133DB /* GPUImageMedianFilter.m in Sources */, BCD81F7019440604007133DB /* GPUImageBilateralFilter.m in Sources */, BCD81F7119440604007133DB /* GPUImageTiltShiftFilter.m in Sources */, BCD81F7219440604007133DB /* GPUImage3x3ConvolutionFilter.m in Sources */, BCD81F7319440604007133DB /* GPUImageLaplacianFilter.m in Sources */, BCD81F7419440604007133DB /* GPUImageSobelEdgeDetectionFilter.m in Sources */, BCD81F7519440604007133DB /* GPUImageThresholdEdgeDetectionFilter.m in Sources */, BCD81F7619440604007133DB /* GPUImageDirectionalSobelEdgeDetectionFilter.m in Sources */, BCD81F7719440604007133DB /* GPUImageDirectionalNonMaximumSuppressionFilter.m in Sources */, BCD81F7819440604007133DB /* GPUImageWeakPixelInclusionFilter.m in Sources */, BCD81F7919440604007133DB /* GPUImageCannyEdgeDetectionFilter.m in Sources */, BCD81F7A19440604007133DB /* GPUImagePrewittEdgeDetectionFilter.m in Sources */, BCD81F7B19440604007133DB /* GPUImageXYDerivativeFilter.m in Sources */, BCD81F7C19440604007133DB /* GPUImageHarrisCornerDetectionFilter.m in Sources */, BCD81F7D19440604007133DB /* GPUImageNobleCornerDetectionFilter.m in Sources */, BCD81F7E19440604007133DB /* GPUImageShiTomasiFeatureDetectionFilter.m in Sources */, BCD81F7F19440604007133DB /* GPUImageFASTCornerDetectionFilter.m in Sources */, BCD81F8019440604007133DB /* GPUImageNonMaximumSuppressionFilter.m in Sources */, BCD81F8119440604007133DB /* GPUImageThresholdedNonMaximumSuppressionFilter.m in Sources */, BCD81F8219440604007133DB /* GPUImageCrosshairGenerator.m in Sources */, BCD81F8319440604007133DB /* GPUImageDilationFilter.m in Sources */, BCD81F8419440604007133DB /* GPUImageRGBDilationFilter.m in Sources */, BCD81F8519440604007133DB /* GPUImageErosionFilter.m in Sources */, BCD81F8619440604007133DB /* GPUImageRGBErosionFilter.m in Sources */, BCD81F8719440604007133DB /* GPUImageOpeningFilter.m in Sources */, BCD81F8819440604007133DB /* GPUImageRGBOpeningFilter.m in Sources */, BCD81F8919440604007133DB /* GPUImageClosingFilter.m in Sources */, BCD81F8A19440604007133DB /* GPUImageRGBClosingFilter.m in Sources */, BCD81F8B19440604007133DB /* GPUImageColorPackingFilter.m in Sources */, BCD81F8C19440605007133DB /* GPUImageLocalBinaryPatternFilter.m in Sources */, BCD81F8D19440605007133DB /* GPUImageLanczosResamplingFilter.m in Sources */, BCD81F8E19440605007133DB /* GPUImageLowPassFilter.m in Sources */, BCD81F8F19440605007133DB /* GPUImageHighPassFilter.m in Sources */, BCD81F9019440605007133DB /* GPUImageMotionDetector.m in Sources */, BCD81F9119440605007133DB /* GPUImageHoughTransformLineDetector.m in Sources */, BCD81F9219440605007133DB /* GPUImageParallelCoordinateLineTransformFilter.m in Sources */, BCD81F9319440605007133DB /* GPUImageLineGenerator.m in Sources */, BCD81F9419440605007133DB /* GPUImageMotionBlurFilter.m in Sources */, BCD81F9519440605007133DB /* GPUImageZoomBlurFilter.m in Sources */, BCD81F9619440605007133DB /* GPUImageiOSBlurFilter.m in Sources */, BCD81F9719440605007133DB /* GPUImageSourceOverBlendFilter.m in Sources */, BCD81F9819440605007133DB /* GPUImageColorBurnBlendFilter.m in Sources */, BCD81F9919440605007133DB /* GPUImageColorDodgeBlendFilter.m in Sources */, BCD81F9A19440605007133DB /* GPUImageDarkenBlendFilter.m in Sources */, BCD81F9B19440605007133DB /* GPUImageDifferenceBlendFilter.m in Sources */, BCAA73BF1C18E43400BC2D31 /* GPUImageFourInputFilter.m in Sources */, BCD81F9C19440605007133DB /* GPUImageDissolveBlendFilter.m in Sources */, BCD81F9D19440605007133DB /* GPUImageExclusionBlendFilter.m in Sources */, BCD81F9E19440605007133DB /* GPUImageHardLightBlendFilter.m in Sources */, BCD81F9F19440605007133DB /* GPUImageSoftLightBlendFilter.m in Sources */, BCD81FA019440605007133DB /* GPUImageLightenBlendFilter.m in Sources */, BCD81FA119440605007133DB /* GPUImageAddBlendFilter.m in Sources */, BCD81FA219440605007133DB /* GPUImageSubtractBlendFilter.m in Sources */, BCD81FA319440605007133DB /* GPUImageDivideBlendFilter.m in Sources */, BCD81FA419440605007133DB /* GPUImageMultiplyBlendFilter.m in Sources */, BCD81FA519440605007133DB /* GPUImageOverlayBlendFilter.m in Sources */, BCD81FA619440605007133DB /* GPUImageScreenBlendFilter.m in Sources */, BCD81FA719440605007133DB /* GPUImageChromaKeyBlendFilter.m in Sources */, BCD81FA819440605007133DB /* GPUImageAlphaBlendFilter.m in Sources */, BCD81FA919440605007133DB /* GPUImageNormalBlendFilter.m in Sources */, BCD81FAA19440605007133DB /* GPUImageColorBlendFilter.m in Sources */, BCD81FAB19440605007133DB /* GPUImageHueBlendFilter.m in Sources */, BCD81FAC19440605007133DB /* GPUImageSaturationBlendFilter.m in Sources */, BCD81FAD19440605007133DB /* GPUImageLuminosityBlendFilter.m in Sources */, BCD81FAE19440605007133DB /* GPUImageLinearBurnBlendFilter.m in Sources */, BCD81FAF19440605007133DB /* GPUImagePoissonBlendFilter.m in Sources */, BCD81FB019440605007133DB /* GPUImageMaskFilter.m in Sources */, BCD81FB119440605007133DB /* GPUImagePerlinNoiseFilter.m in Sources */, BCD81FB219440605007133DB /* GPUImagePixellateFilter.m in Sources */, BCD81FB319440605007133DB /* GPUImagePixellatePositionFilter.m in Sources */, BCD81FB419440605007133DB /* GPUImagePolkaDotFilter.m in Sources */, BCD81FB519440605007133DB /* GPUImageHalftoneFilter.m in Sources */, BCD81FB619440605007133DB /* GPUImagePolarPixellateFilter.m in Sources */, BCD81FB719440605007133DB /* GPUImageCrosshatchFilter.m in Sources */, BCD81FB819440605007133DB /* GPUImageSketchFilter.m in Sources */, BCD81FB919440605007133DB /* GPUImageThresholdSketchFilter.m in Sources */, BCD81FBA19440605007133DB /* GPUImageEmbossFilter.m in Sources */, BCD81FBB19440605007133DB /* GPUImageToonFilter.m in Sources */, BCD81FBC19440605007133DB /* GPUImageSmoothToonFilter.m in Sources */, BCD81FBD19440605007133DB /* GPUImageCGAColorspaceFilter.m in Sources */, BCD81FBE19440605007133DB /* GPUImagePosterizeFilter.m in Sources */, BCD81FBF19440605007133DB /* GPUImageSwirlFilter.m in Sources */, BCD81FC019440605007133DB /* GPUImageBulgeDistortionFilter.m in Sources */, BCD81FC119440605007133DB /* GPUImagePinchDistortionFilter.m in Sources */, BCD81FC219440605007133DB /* GPUImageStretchDistortionFilter.m in Sources */, BCD81FC319440605007133DB /* GPUImageSphereRefractionFilter.m in Sources */, BCD81FC419440605007133DB /* GPUImageGlassSphereFilter.m in Sources */, BCD81FC519440606007133DB /* GPUImageKuwaharaFilter.m in Sources */, BCD81FC619440606007133DB /* GPUImageKuwaharaRadius3Filter.m in Sources */, BCD81FC719440606007133DB /* GPUImageVignetteFilter.m in Sources */, BCD81FC819440606007133DB /* GPUImageJFAVoronoiFilter.m in Sources */, BCD81FC919440606007133DB /* GPUImageMosaicFilter.m in Sources */, BCD81FCA19440606007133DB /* GPUImageVoronoiConsumerFilter.m in Sources */, BCFC5F691C18C3E200C7F43B /* GPUImageColorLocalBinaryPatternFilter.m in Sources */, BCD81FCB19440606007133DB /* GPUImageView.m in Sources */, BCD81FCC19440606007133DB /* GPUImageMovieWriter.m in Sources */, BCD81FCD19440606007133DB /* GPUImageTextureOutput.m in Sources */, BCD81FCE19440606007133DB /* GPUImageRawDataOutput.m in Sources */, 574B5D8B1BEA3CC000F4EC5A /* GPUImageColorConversion.m in Sources */, BC3AA4B41C111054003B7561 /* GPUImageColourFASTFeatureDetector.m in Sources */, BC3AA4B51C111057003B7561 /* GPUImageColourFASTSamplingOperation.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; BCF1A33014DDB1EC00852800 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( BC245DCB14DDBED7009FE7EB /* GPUImageFilter.m in Sources */, BCB5E75D14E2086300701302 /* GPUImageView.m in Sources */, BCB5E76614E208D700701302 /* GPUImageVideoCamera.m in Sources */, BCB5E76D14E20AD700701302 /* GPUImageContext.m in Sources */, BCB5E78014E22E4300701302 /* GPUImageOutput.m in Sources */, BCB5E79514E3275200701302 /* GLProgram.m in Sources */, BCB5E7C314E4B6D400701302 /* GPUImageSepiaFilter.m in Sources */, BCB5E7DB14E6003400701302 /* GPUImagePicture.m in Sources */, BCB5DE0E14E87F32000AF3C2 /* GPUImagePixellateFilter.m in Sources */, BC982B5414F07F790001FF6F /* GPUImageColorInvertFilter.m in Sources */, BC982B5614F07F790001FF6F /* GPUImageSaturationFilter.m in Sources */, BC982B6814F092EF0001FF6F /* GPUImageContrastFilter.m in Sources */, BCAA73BD1C18E42400BC2D31 /* GPUImageFourInputFilter.m in Sources */, BC982B7A14F098CC0001FF6F /* GPUImageBrightnessFilter.m in Sources */, BC982B7F14F09F980001FF6F /* GPUImageGammaFilter.m in Sources */, BC982B9A14F0B34E0001FF6F /* GPUImageSobelEdgeDetectionFilter.m in Sources */, B81521A314F1BA6A00F105F8 /* GPUImageColorMatrixFilter.m in Sources */, BC982BEC14F1CE600001FF6F /* GPUImageDissolveBlendFilter.m in Sources */, BC982BEE14F1CE600001FF6F /* GPUImageMultiplyBlendFilter.m in Sources */, BC982C4814F29E580001FF6F /* GPUImageKuwaharaFilter.m in Sources */, BC982C6F14F33C2A0001FF6F /* GPUImageMovie.m in Sources */, BC982C7114F33C2A0001FF6F /* GPUImageOverlayBlendFilter.m in Sources */, BC982C8214F34F0C0001FF6F /* GPUImageDarkenBlendFilter.m in Sources */, BC982C8414F34F0C0001FF6F /* GPUImageLightenBlendFilter.m in Sources */, BC982CA014F35C2D0001FF6F /* GPUImageToonFilter.m in Sources */, BC1B715814F49DAA00ACA2AB /* GPUImageRawDataOutput.m in Sources */, BC1B717D14F566E200ACA2AB /* GPUImageSketchFilter.m in Sources */, BC1B718F14F56C1D00ACA2AB /* GPUImageSwirlFilter.m in Sources */, 0DF3FA2C14FA00C9006AF7D9 /* GPUImageVignetteFilter.m in Sources */, BC1A47F514FC759D00D552E8 /* GPUImageGaussianBlurFilter.m in Sources */, BC1B728214FB16AF00ACA2AB /* GPUImageMovieWriter.m in Sources */, BCC93A1F1501E42F00958B26 /* GPUImageTwoPassFilter.m in Sources */, BCC93A301502A90F00958B26 /* GPUImageFilterPipeline.m in Sources */, BCC93A311502A91500958B26 /* GPUImageGaussianSelectiveBlurFilter.m in Sources */, A4741D5119A91F87005EE1A4 /* GPUImageHistogramEqualizationFilter.m in Sources */, BCB6B838150400030041703B /* GPUImageExposureFilter.m in Sources */, BCB6B83A150400030041703B /* GPUImageSharpenFilter.m in Sources */, BC8A584C18131E4B00E6B507 /* GPUImageLuminanceRangeFilter.m in Sources */, BCB6B85715041A920041703B /* GPUImageColorBurnBlendFilter.m in Sources */, BCB6B85915041A920041703B /* GPUImageColorDodgeBlendFilter.m in Sources */, BCB6B85B15041A920041703B /* GPUImageScreenBlendFilter.m in Sources */, BCB6B8711504234A0041703B /* GPUImageDifferenceBlendFilter.m in Sources */, BCB6B8731504234A0041703B /* GPUImageExclusionBlendFilter.m in Sources */, BCB6B8751504234A0041703B /* GPUImageHardLightBlendFilter.m in Sources */, BCB6B8771504234A0041703B /* GPUImageSoftLightBlendFilter.m in Sources */, BCB6B8BC1505BF940041703B /* GPUImageTextureOutput.m in Sources */, BCB6B9051507CA8D0041703B /* GPUImageCropFilter.m in Sources */, 83AE9F991540DFE500F7FC13 /* GPUImageSubtractBlendFilter.m in Sources */, 6EE27494150E8FC60040DDB6 /* GPUImageGrayscaleFilter.m in Sources */, BCC94CFB15101EB3002F9BC5 /* GPUImageTransformFilter.m in Sources */, BC54D564151904FF003F4A41 /* GPUImageChromaKeyBlendFilter.m in Sources */, BC44A4331C110D4500B0DAA0 /* GPUImageColourFASTSamplingOperation.m in Sources */, 6D13DBE7151AA804000B23BA /* GPUImageHazeFilter.m in Sources */, BCC94ABC151E4FD6008554B4 /* GPUImageLuminanceThresholdFilter.m in Sources */, BCC1E5A9151E74B20006EFA5 /* GPUImagePosterizeFilter.m in Sources */, BCC1E5B9151E83700006EFA5 /* GPUImageFilterGroup.m in Sources */, BCC1E5C8151EA12B0006EFA5 /* GPUImageBoxBlurFilter.m in Sources */, BCC1E5CD151EA6610006EFA5 /* GPUImageAdaptiveThresholdFilter.m in Sources */, BCC1E611152156620006EFA5 /* GPUImageUnsharpMaskFilter.m in Sources */, BCC1E634152239090006EFA5 /* GPUImageBulgeDistortionFilter.m in Sources */, BCC1E639152243630006EFA5 /* GPUImagePinchDistortionFilter.m in Sources */, BCC1E66E152368130006EFA5 /* GPUImageCrosshatchFilter.m in Sources */, BCC1E67C152368840006EFA5 /* GPUImageCGAColorspaceFilter.m in Sources */, BC7D95D61523EE67000DF037 /* GPUImageStillCamera.m in Sources */, BCABED8F15263CF20098A93E /* GPUImagePolarPixellateFilter.m in Sources */, BCABED9115263CF20098A93E /* GPUImageStretchDistortionFilter.m in Sources */, BCF3D68C153CC124009A1FE5 /* GPUImageTextureInput.m in Sources */, BC44A4311C110D4500B0DAA0 /* GPUImageColourFASTFeatureDetector.m in Sources */, BCF3D6DE153CFF61009A1FE5 /* GPUImageTiltShiftFilter.m in Sources */, BCF3D70B153DCC9A009A1FE5 /* GPUImage3x3ConvolutionFilter.m in Sources */, BCF3D710153DF9E7009A1FE5 /* GPUImageEmbossFilter.m in Sources */, BCF3D71E153E06C3009A1FE5 /* GPUImageCannyEdgeDetectionFilter.m in Sources */, BCF3D723153E0E0C009A1FE5 /* GPUImageThresholdEdgeDetectionFilter.m in Sources */, BCF3D731153F0D6F009A1FE5 /* GPUImageSmoothToonFilter.m in Sources */, 83AE9FCE1540E92800F7FC13 /* GPUImageMaskFilter.m in Sources */, BC6ED9C31549CA0600966798 /* GPUImageHistogramFilter.m in Sources */, BCC11D73154B44DC0044F5A0 /* GPUImageHistogramGenerator.m in Sources */, BCAD0979154F39CA00278521 /* GPUImagePrewittEdgeDetectionFilter.m in Sources */, BCAD097E154F3CB000278521 /* GPUImageXYDerivativeFilter.m in Sources */, BCAD0982154F7B2800278521 /* GPUImageHarrisCornerDetectionFilter.m in Sources */, BCAD0986154F931C00278521 /* GPUImageAlphaBlendFilter.m in Sources */, BCAD09A015506F6F00278521 /* GPUImageNonMaximumSuppressionFilter.m in Sources */, 46869530155AACAC0060BA43 /* GPUImageSourceOverBlendFilter.m in Sources */, BC114899155AF65400F107AF /* GPUImageTwoInputFilter.m in Sources */, BEBE83B6155C092A00EEF8C3 /* GPUImageRGBFilter.m in Sources */, BC01E82E155CA3F1004C75C3 /* GPUImageMedianFilter.m in Sources */, BC01E833155CA5E2004C75C3 /* GPUImage3x3TextureSamplingFilter.m in Sources */, BC7CC63615605A3500468085 /* GPUImageBilateralFilter.m in Sources */, BC7CC69D1562C4BB00468085 /* GPUImageCrosshairGenerator.m in Sources */, BC27A3CC15654F5A004F2D45 /* GPUImagePerlinNoiseFilter.m in Sources */, BCF1E54115669907006B155F /* GPUImageJFAVoronoiFilter.m in Sources */, BCF1E54315669907006B155F /* GPUImageMosaicFilter.m in Sources */, BCF1E54515669907006B155F /* GPUImageVoronoiConsumerFilter.m in Sources */, BCF1E57C15673599006B155F /* GPUImageToneCurveFilter.m in Sources */, BCF1E643156AB332006B155F /* GPUImageRawDataInput.m in Sources */, BCAD4C9F156F0D8F001E50E1 /* GPUImageShiTomasiFeatureDetectionFilter.m in Sources */, BCAD4CA4156F0F35001E50E1 /* GPUImageNobleCornerDetectionFilter.m in Sources */, BCAD4D1015718AD2001E50E1 /* GPUImageSingleComponentGaussianBlurFilter.m in Sources */, BCAD4D1515718F9E001E50E1 /* GPUImageDirectionalSobelEdgeDetectionFilter.m in Sources */, BCAD4D1D1571B410001E50E1 /* GPUImageDirectionalNonMaximumSuppressionFilter.m in Sources */, BCAD4D211571CB50001E50E1 /* GPUImageWeakPixelInclusionFilter.m in Sources */, BC56D82B1579779700CC9C1E /* GPUImageUIElement.m in Sources */, BC56D84B157ADA4F00CC9C1E /* GPUImageDilationFilter.m in Sources */, BC1BBFA9193BC55B0025FC88 /* GPUImageFASTCornerDetectionFilter.m in Sources */, BC56D850157ADA6F00CC9C1E /* GPUImageErosionFilter.m in Sources */, BC0690B9157C0C28009274F9 /* GPUImageTwoPassTextureSamplingFilter.m in Sources */, BC0690BE157C1B38009274F9 /* GPUImageOpeningFilter.m in Sources */, BC0690C2157C2368009274F9 /* GPUImageClosingFilter.m in Sources */, BC0690D1157C2EBA009274F9 /* GPUImageRGBDilationFilter.m in Sources */, BC0690D6157C31C9009274F9 /* GPUImageRGBErosionFilter.m in Sources */, BC0690DA157C33B9009274F9 /* GPUImageRGBOpeningFilter.m in Sources */, BC0690DE157C344D009274F9 /* GPUImageRGBClosingFilter.m in Sources */, BC0690F8157C5075009274F9 /* GPUImageColorPackingFilter.m in Sources */, BC76CE9C15813818008B45D3 /* GPUImageSphereRefractionFilter.m in Sources */, BCBCE99A1595021B00E0ED33 /* GPUImageMonochromeFilter.m in Sources */, BCBCE9D6159944AC00E0ED33 /* GPUImageBuffer.m in Sources */, BCF6B41215A7849F00FC6F58 /* GPUImageOpacityFilter.m in Sources */, BCC46E5F15B9EFE8005519B9 /* GPUImageHighlightShadowFilter.m in Sources */, BCC46E6415BA095F005519B9 /* GPUImageFalseColorFilter.m in Sources */, C2EDA90715BB136D007CBA0F /* GPUImageHueFilter.m in Sources */, B81F2D761788C95500118374 /* GPUImageHSBFilter.m in Sources */, BC0147E515BEFE6800FC2B6D /* GPUImageGlassSphereFilter.m in Sources */, 96DD3C1515C2780500DF637E /* GPUImageLookupFilter.m in Sources */, 96781B3015C38DCF005FA0D7 /* GPUImageAmatorkaFilter.m in Sources */, 96781B3515C39E80005FA0D7 /* GPUImageMissEtikateFilter.m in Sources */, 96781B4715C3A6F1005FA0D7 /* GPUImageSoftEleganceFilter.m in Sources */, BCD907CF15CDEE720019C556 /* GPUImageDivideBlendFilter.m in Sources */, BCD907D415CDEE930019C556 /* GPUImageAddBlendFilter.m in Sources */, BCF851BB15CF29B3000EBC8B /* GPUImagePolkaDotFilter.m in Sources */, BCF851C015CF5D59000EBC8B /* GPUImageLocalBinaryPatternFilter.m in Sources */, BCFB588815E03E4F00750F12 /* GPUImageLanczosResamplingFilter.m in Sources */, BC3AC8B115E6F6170065144E /* GPUImageAverageColor.m in Sources */, BCB79E1115EBE1A700965D92 /* GPUImageSolidColorGenerator.m in Sources */, BCFC5F671C18C3B100C7F43B /* GPUImageColorLocalBinaryPatternFilter.m in Sources */, BCB79E6015EC131A00965D92 /* GPUImageLuminosity.m in Sources */, BCB79E7B15EC2A8400965D92 /* GPUImageAverageLuminanceThresholdFilter.m in Sources */, BC99234F15EFFC8700ED2C8C /* GPUImageChromaKeyFilter.m in Sources */, BC99235415EFFC9700ED2C8C /* GPUImageWhiteBalanceFilter.m in Sources */, BCB3B46615F2BA9300EDA3BE /* GPUImageLowPassFilter.m in Sources */, BCB3B46B15F2FD1B00EDA3BE /* GPUImageHighPassFilter.m in Sources */, BCB3B47A15F3108700EDA3BE /* GPUImageMotionDetector.m in Sources */, 4308B1D815F7EED30014437A /* GPUImageNormalBlendFilter.m in Sources */, BC4D03D0160919AE00F64358 /* GPUImageHalftoneFilter.m in Sources */, BC95C4091622763D002C4BC7 /* GPUImageHoughTransformLineDetector.m in Sources */, BCA632821623C80800EEB24F /* GPUImageThresholdedNonMaximumSuppressionFilter.m in Sources */, BCA632871623D18B00EEB24F /* GPUImageParallelCoordinateLineTransformFilter.m in Sources */, BCA6328B1623DD0E00EEB24F /* GPUImageThresholdSketchFilter.m in Sources */, BCA464CD1627C1BD00C0F68E /* GPUImageLineGenerator.m in Sources */, B8EF4E96162F85850036E5B3 /* GPUImageLevelsFilter.m in Sources */, C04C8D1815F8059F00449601 /* GPUImageColorBlendFilter.m in Sources */, B80171E716311FCB001C8D16 /* GPUImageHueBlendFilter.m in Sources */, B80171FF16312800001C8D16 /* GPUImageSaturationBlendFilter.m in Sources */, B801723016313151001C8D16 /* GPUImageLuminosityBlendFilter.m in Sources */, BC185E7B16B866AD00EA01AD /* GPUImageLinearBurnBlendFilter.m in Sources */, BC185E7F16B866CE00EA01AD /* GPUImageGaussianBlurPositionFilter.m in Sources */, BC185E8316B866F000EA01AD /* GPUImagePixellatePositionFilter.m in Sources */, 46A8097916B8A48E000C29ED /* GPUImageTwoInputCrossTextureSamplingFilter.m in Sources */, BC61F4B116B9CAEB009F6234 /* GPUImagePoissonBlendFilter.m in Sources */, 84FFC80C1936408F00994258 /* GPUImagePicture+TextureSubimage.m in Sources */, BCBC604E16C58B0900B11741 /* GPUImageMotionBlurFilter.m in Sources */, BCBC605816C8527C00B11741 /* GPUImageZoomBlurFilter.m in Sources */, 79F8FD161C8B2A620095AB3E /* GPUImageSolarizeFilter.m in Sources */, BCBF617B16E4F44700E2784A /* GPUImageKuwaharaRadius3Filter.m in Sources */, BC6C55411730679D00EB222D /* GPUImageLaplacianFilter.m in Sources */, BCB030BF173400BC001A1A20 /* GPUImageThreeInputFilter.m in Sources */, D443237B17C81C0C00204484 /* GPUImageMovieComposition.m in Sources */, BC8A583D1813060F00E6B507 /* GPUImageiOSBlurFilter.m in Sources */, BCC887CD18A1CEEB008DB37D /* GPUImageFramebuffer.m in Sources */, BCC887D118A1D3AD008DB37D /* GPUImageFramebufferCache.m in Sources */, 574B5D8A1BEA3CC000F4EC5A /* GPUImageColorConversion.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin XCBuildConfiguration section */ BC552B381558C6F4001F3FFA /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { APPLEDOC_PATH = /usr/local/bin/appledoc; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; }; BC552B391558C6F4001F3FFA /* Release */ = { isa = XCBuildConfiguration; buildSettings = { APPLEDOC_PATH = /usr/local/bin/appledoc; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; }; BCE209F91943F20D002FEED8 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; INFOPLIST_FILE = Source/iOS/Framework/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MODULEMAP_FILE = Source/iOS/Framework/module.modulemap; PRODUCT_BUNDLE_IDENTIFIER = "com.sunsetlakesoftware.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_MODULE_NAME = GPUImage; PRODUCT_NAME = GPUImage; SKIP_INSTALL = YES; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; name = Debug; }; BCE209FA1943F20D002FEED8 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_NS_ASSERTIONS = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; INFOPLIST_FILE = Source/iOS/Framework/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MODULEMAP_FILE = Source/iOS/Framework/module.modulemap; PRODUCT_BUNDLE_IDENTIFIER = "com.sunsetlakesoftware.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_MODULE_NAME = GPUImage; PRODUCT_NAME = GPUImage; SKIP_INSTALL = YES; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; name = Release; }; BCF1A35614DDB1EC00852800 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_TREAT_WARNINGS_AS_ERRORS = YES; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 4.3; ONLY_ACTIVE_ARCH = YES; RUN_CLANG_STATIC_ANALYZER = YES; SDKROOT = iphoneos; SYMROOT = "$(PROJECT_DIR)/../build"; }; name = Debug; }; BCF1A35714DDB1EC00852800 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = YES; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_TREAT_WARNINGS_AS_ERRORS = YES; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 4.3; RUN_CLANG_STATIC_ANALYZER = YES; SDKROOT = iphoneos; SYMROOT = "$(PROJECT_DIR)/../build"; VALIDATE_PRODUCT = YES; }; name = Release; }; BCF1A35914DDB1EC00852800 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_OBJC_ARC = YES; DSTROOT = /tmp/GPUImage.dst; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "Source/iOS/GPUImage-Prefix.pch"; HEADER_SEARCH_PATHS = ""; OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; }; name = Debug; }; BCF1A35A14DDB1EC00852800 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_OBJC_ARC = YES; DSTROOT = /tmp/GPUImage.dst; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "Source/iOS/GPUImage-Prefix.pch"; HEADER_SEARCH_PATHS = ""; OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ BC552B371558C6F4001F3FFA /* Build configuration list for PBXAggregateTarget "Documentation" */ = { isa = XCConfigurationList; buildConfigurations = ( BC552B381558C6F4001F3FFA /* Debug */, BC552B391558C6F4001F3FFA /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; BCE209F81943F20D002FEED8 /* Build configuration list for PBXNativeTarget "GPUImageFramework" */ = { isa = XCConfigurationList; buildConfigurations = ( BCE209F91943F20D002FEED8 /* Debug */, BCE209FA1943F20D002FEED8 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; BCF1A32E14DDB1EC00852800 /* Build configuration list for PBXProject "GPUImage" */ = { isa = XCConfigurationList; buildConfigurations = ( BCF1A35614DDB1EC00852800 /* Debug */, BCF1A35714DDB1EC00852800 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; BCF1A35814DDB1EC00852800 /* Build configuration list for PBXNativeTarget "GPUImage" */ = { isa = XCConfigurationList; buildConfigurations = ( BCF1A35914DDB1EC00852800 /* Debug */, BCF1A35A14DDB1EC00852800 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = BCF1A32B14DDB1EC00852800 /* Project object */; } ================================================ FILE: framework/GPUImage.xcodeproj/xcshareddata/xcschemes/Documentation.xcscheme ================================================ ================================================ FILE: framework/GPUImage.xcodeproj/xcshareddata/xcschemes/GPUImage.xcscheme ================================================ ================================================ FILE: framework/GPUImage.xcodeproj/xcshareddata/xcschemes/GPUImageFramework.xcscheme ================================================ ================================================ FILE: framework/GPUImageMac.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ 574B5D861BE9346800F4EC5A /* GPUImageMovie.h in Headers */ = {isa = PBXBuildFile; fileRef = 574B5D841BE9346800F4EC5A /* GPUImageMovie.h */; settings = {ATTRIBUTES = (Public, ); }; }; 574B5D871BE9346800F4EC5A /* GPUImageMovie.m in Sources */ = {isa = PBXBuildFile; fileRef = 574B5D851BE9346800F4EC5A /* GPUImageMovie.m */; }; 574B5D911BEA3E7900F4EC5A /* GPUImageColorConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = 574B5D8F1BEA3E7900F4EC5A /* GPUImageColorConversion.h */; settings = {ATTRIBUTES = (Public, ); }; }; 574B5D921BEA3E7900F4EC5A /* GPUImageColorConversion.m in Sources */ = {isa = PBXBuildFile; fileRef = 574B5D901BEA3E7900F4EC5A /* GPUImageColorConversion.m */; }; 79840B831C8B29240079A83B /* GPUImageSolarizeFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 79840B811C8B29240079A83B /* GPUImageSolarizeFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; 79840B841C8B29240079A83B /* GPUImageSolarizeFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 79840B821C8B29240079A83B /* GPUImageSolarizeFilter.m */; }; A4741D5A19A92098005EE1A4 /* GPUImageHistogramEqualizationFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = A4741D5819A92098005EE1A4 /* GPUImageHistogramEqualizationFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; A4741D5B19A92098005EE1A4 /* GPUImageHistogramEqualizationFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = A4741D5919A92098005EE1A4 /* GPUImageHistogramEqualizationFilter.m */; }; A50607171C78BF7C0095D0BB /* GPUImageTextureOutput.h in Headers */ = {isa = PBXBuildFile; fileRef = A50607151C78BF7C0095D0BB /* GPUImageTextureOutput.h */; settings = {ATTRIBUTES = (Public, ); }; }; A50607181C78BF7C0095D0BB /* GPUImageTextureOutput.m in Sources */ = {isa = PBXBuildFile; fileRef = A50607161C78BF7C0095D0BB /* GPUImageTextureOutput.m */; }; A506071B1C78BF8E0095D0BB /* GPUImageTextureInput.h in Headers */ = {isa = PBXBuildFile; fileRef = A50607191C78BF8E0095D0BB /* GPUImageTextureInput.h */; settings = {ATTRIBUTES = (Public, ); }; }; A506071C1C78BF8E0095D0BB /* GPUImageTextureInput.m in Sources */ = {isa = PBXBuildFile; fileRef = A506071A1C78BF8E0095D0BB /* GPUImageTextureInput.m */; }; A87E5E12177648F3007FD5B1 /* GPUImageRawDataOutput.h in Headers */ = {isa = PBXBuildFile; fileRef = A87E5E10177648F3007FD5B1 /* GPUImageRawDataOutput.h */; settings = {ATTRIBUTES = (Public, ); }; }; A87E5E13177648F3007FD5B1 /* GPUImageRawDataOutput.m in Sources */ = {isa = PBXBuildFile; fileRef = A87E5E11177648F3007FD5B1 /* GPUImageRawDataOutput.m */; }; A87E5E1617764B16007FD5B1 /* GPUImageRawDataInput.h in Headers */ = {isa = PBXBuildFile; fileRef = A87E5E1417764B16007FD5B1 /* GPUImageRawDataInput.h */; settings = {ATTRIBUTES = (Public, ); }; }; A87E5E1717764B16007FD5B1 /* GPUImageRawDataInput.m in Sources */ = {isa = PBXBuildFile; fileRef = A87E5E1517764B16007FD5B1 /* GPUImageRawDataInput.m */; }; BC4DFD031C10D2FD0095A016 /* GPUImageColourFASTFeatureDetector.h in Headers */ = {isa = PBXBuildFile; fileRef = BC4DFD011C10D2FD0095A016 /* GPUImageColourFASTFeatureDetector.h */; settings = {ATTRIBUTES = (Public, ); }; }; BC4DFD041C10D2FD0095A016 /* GPUImageColourFASTFeatureDetector.m in Sources */ = {isa = PBXBuildFile; fileRef = BC4DFD021C10D2FD0095A016 /* GPUImageColourFASTFeatureDetector.m */; }; BC4DFD071C10D4860095A016 /* GPUImageColourFASTSamplingOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = BC4DFD051C10D4860095A016 /* GPUImageColourFASTSamplingOperation.h */; settings = {ATTRIBUTES = (Public, ); }; }; BC4DFD081C10D4860095A016 /* GPUImageColourFASTSamplingOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = BC4DFD061C10D4860095A016 /* GPUImageColourFASTSamplingOperation.m */; }; BC56957A174683620081491B /* GPUImageCrosshairGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = BC569576174683620081491B /* GPUImageCrosshairGenerator.h */; settings = {ATTRIBUTES = (Public, ); }; }; BC56957B174683620081491B /* GPUImageCrosshairGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = BC569577174683620081491B /* GPUImageCrosshairGenerator.m */; }; BC56957C174683620081491B /* GPUImageLineGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = BC569578174683620081491B /* GPUImageLineGenerator.h */; settings = {ATTRIBUTES = (Public, ); }; }; BC56957D174683620081491B /* GPUImageLineGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = BC569579174683620081491B /* GPUImageLineGenerator.m */; }; BC6C553C1730636600EB222D /* GPUImageLaplacianFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC6C553A1730636600EB222D /* GPUImageLaplacianFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BC6C553D1730636600EB222D /* GPUImageLaplacianFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC6C553B1730636600EB222D /* GPUImageLaplacianFilter.m */; }; BC6C55461730BDCF00EB222D /* GPUImageLanczosResamplingFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC6C55441730BDCF00EB222D /* GPUImageLanczosResamplingFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BC6C55471730BDCF00EB222D /* GPUImageLanczosResamplingFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC6C55451730BDCF00EB222D /* GPUImageLanczosResamplingFilter.m */; }; BC78B70E172DCCB800342C6A /* GPUImageAmatorkaFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC78B706172DCCB800342C6A /* GPUImageAmatorkaFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BC78B70F172DCCB800342C6A /* GPUImageAmatorkaFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC78B707172DCCB800342C6A /* GPUImageAmatorkaFilter.m */; }; BC78B710172DCCB800342C6A /* GPUImageLookupFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC78B708172DCCB800342C6A /* GPUImageLookupFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BC78B711172DCCB800342C6A /* GPUImageLookupFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC78B709172DCCB800342C6A /* GPUImageLookupFilter.m */; }; BC78B712172DCCB800342C6A /* GPUImageMissEtikateFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC78B70A172DCCB800342C6A /* GPUImageMissEtikateFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BC78B713172DCCB800342C6A /* GPUImageMissEtikateFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC78B70B172DCCB800342C6A /* GPUImageMissEtikateFilter.m */; }; BC78B714172DCCB800342C6A /* GPUImageSoftEleganceFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC78B70C172DCCB800342C6A /* GPUImageSoftEleganceFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BC78B715172DCCB800342C6A /* GPUImageSoftEleganceFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC78B70D172DCCB800342C6A /* GPUImageSoftEleganceFilter.m */; }; BC8A583218124ABD00E6B507 /* GPUImageSingleComponentGaussianBlurFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC8A583018124ABD00E6B507 /* GPUImageSingleComponentGaussianBlurFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BC8A583318124ABD00E6B507 /* GPUImageSingleComponentGaussianBlurFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC8A583118124ABD00E6B507 /* GPUImageSingleComponentGaussianBlurFilter.m */; }; BC96A4F1176563C300F215A2 /* GPUImageNonMaximumSuppressionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BC96A4EF176563C300F215A2 /* GPUImageNonMaximumSuppressionFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BC96A4F2176563C300F215A2 /* GPUImageNonMaximumSuppressionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC96A4F0176563C300F215A2 /* GPUImageNonMaximumSuppressionFilter.m */; }; BCA20B571746C9EC0097C84A /* GPUImageBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA20B4F1746C9EC0097C84A /* GPUImageBuffer.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCA20B581746C9EC0097C84A /* GPUImageBuffer.m in Sources */ = {isa = PBXBuildFile; fileRef = BCA20B501746C9EC0097C84A /* GPUImageBuffer.m */; }; BCA20B591746C9EC0097C84A /* GPUImageHighPassFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA20B511746C9EC0097C84A /* GPUImageHighPassFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCA20B5A1746C9EC0097C84A /* GPUImageHighPassFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCA20B521746C9EC0097C84A /* GPUImageHighPassFilter.m */; }; BCA20B5B1746C9EC0097C84A /* GPUImageLowPassFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA20B531746C9EC0097C84A /* GPUImageLowPassFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCA20B5C1746C9EC0097C84A /* GPUImageLowPassFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCA20B541746C9EC0097C84A /* GPUImageLowPassFilter.m */; }; BCA20B5D1746C9EC0097C84A /* GPUImageMotionDetector.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA20B551746C9EC0097C84A /* GPUImageMotionDetector.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCA20B5E1746C9EC0097C84A /* GPUImageMotionDetector.m in Sources */ = {isa = PBXBuildFile; fileRef = BCA20B561746C9EC0097C84A /* GPUImageMotionDetector.m */; }; BCA20B611746CFE60097C84A /* GPUImageThresholdSketchFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA20B5F1746CFE60097C84A /* GPUImageThresholdSketchFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCA20B621746CFE60097C84A /* GPUImageThresholdSketchFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCA20B601746CFE60097C84A /* GPUImageThresholdSketchFilter.m */; }; BCA20B651746D3C30097C84A /* GPUImageSmoothToonFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA20B631746D3C30097C84A /* GPUImageSmoothToonFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCA20B661746D3C30097C84A /* GPUImageSmoothToonFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCA20B641746D3C30097C84A /* GPUImageSmoothToonFilter.m */; }; BCA20B691746D3DD0097C84A /* GPUImageTiltShiftFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA20B671746D3DC0097C84A /* GPUImageTiltShiftFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCA20B6A1746D3DD0097C84A /* GPUImageTiltShiftFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCA20B681746D3DC0097C84A /* GPUImageTiltShiftFilter.m */; }; BCA20B6D1746D44B0097C84A /* GPUImageCGAColorspaceFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA20B6B1746D44A0097C84A /* GPUImageCGAColorspaceFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCA20B6E1746D44B0097C84A /* GPUImageCGAColorspaceFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCA20B6C1746D44A0097C84A /* GPUImageCGAColorspaceFilter.m */; }; BCA20B711746D4AC0097C84A /* GPUImagePosterizeFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA20B6F1746D4AC0097C84A /* GPUImagePosterizeFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCA20B721746D4AC0097C84A /* GPUImagePosterizeFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCA20B701746D4AC0097C84A /* GPUImagePosterizeFilter.m */; }; BCA20B751746DE850097C84A /* GPUImageKuwaharaRadius3Filter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA20B731746DE850097C84A /* GPUImageKuwaharaRadius3Filter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCA20B761746DE850097C84A /* GPUImageKuwaharaRadius3Filter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCA20B741746DE850097C84A /* GPUImageKuwaharaRadius3Filter.m */; }; BCA20B791746DEDE0097C84A /* GPUImageChromaKeyFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA20B771746DEDD0097C84A /* GPUImageChromaKeyFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCA20B7A1746DEDE0097C84A /* GPUImageChromaKeyFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCA20B781746DEDE0097C84A /* GPUImageChromaKeyFilter.m */; }; BCA20B7D1746DF210097C84A /* GPUImageVignetteFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA20B7B1746DF200097C84A /* GPUImageVignetteFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCA20B7E1746DF210097C84A /* GPUImageVignetteFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCA20B7C1746DF200097C84A /* GPUImageVignetteFilter.m */; }; BCA20B991747081D0097C84A /* GPUImageBulgeDistortionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA20B7F1747080E0097C84A /* GPUImageBulgeDistortionFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCA20B9A1747081D0097C84A /* GPUImageBulgeDistortionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCA20B801747080F0097C84A /* GPUImageBulgeDistortionFilter.m */; }; BCA20B9B1747081D0097C84A /* GPUImageClosingFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA20B811747080F0097C84A /* GPUImageClosingFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCA20B9C1747081D0097C84A /* GPUImageClosingFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCA20B82174708100097C84A /* GPUImageClosingFilter.m */; }; BCA20B9D1747081D0097C84A /* GPUImageDilationFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA20B83174708110097C84A /* GPUImageDilationFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCA20B9E1747081D0097C84A /* GPUImageDilationFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCA20B84174708120097C84A /* GPUImageDilationFilter.m */; }; BCA20B9F1747081D0097C84A /* GPUImageErosionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA20B85174708120097C84A /* GPUImageErosionFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCA20BA01747081D0097C84A /* GPUImageErosionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCA20B86174708130097C84A /* GPUImageErosionFilter.m */; }; BCA20BA11747081D0097C84A /* GPUImageGlassSphereFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA20B87174708140097C84A /* GPUImageGlassSphereFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCA20BA21747081D0097C84A /* GPUImageGlassSphereFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCA20B88174708150097C84A /* GPUImageGlassSphereFilter.m */; }; BCA20BA31747081D0097C84A /* GPUImagePinchDistortionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA20B89174708150097C84A /* GPUImagePinchDistortionFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCA20BA41747081D0097C84A /* GPUImagePinchDistortionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCA20B8A174708150097C84A /* GPUImagePinchDistortionFilter.m */; }; BCA20BA51747081D0097C84A /* GPUImageRGBClosingFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA20B8B174708160097C84A /* GPUImageRGBClosingFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCA20BA61747081D0097C84A /* GPUImageRGBClosingFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCA20B8C174708160097C84A /* GPUImageRGBClosingFilter.m */; }; BCA20BA71747081D0097C84A /* GPUImageRGBDilationFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA20B8D174708190097C84A /* GPUImageRGBDilationFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCA20BA81747081D0097C84A /* GPUImageRGBDilationFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCA20B8E174708190097C84A /* GPUImageRGBDilationFilter.m */; }; BCA20BA91747081D0097C84A /* GPUImageRGBErosionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA20B8F174708190097C84A /* GPUImageRGBErosionFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCA20BAA1747081D0097C84A /* GPUImageRGBErosionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCA20B901747081A0097C84A /* GPUImageRGBErosionFilter.m */; }; BCA20BAB1747081D0097C84A /* GPUImageRGBOpeningFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA20B911747081A0097C84A /* GPUImageRGBOpeningFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCA20BAC1747081D0097C84A /* GPUImageRGBOpeningFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCA20B921747081B0097C84A /* GPUImageRGBOpeningFilter.m */; }; BCA20BAD1747081D0097C84A /* GPUImageSphereRefractionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA20B931747081B0097C84A /* GPUImageSphereRefractionFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCA20BAE1747081D0097C84A /* GPUImageSphereRefractionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCA20B941747081B0097C84A /* GPUImageSphereRefractionFilter.m */; }; BCA20BAF1747081D0097C84A /* GPUImageStretchDistortionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA20B951747081C0097C84A /* GPUImageStretchDistortionFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCA20BB01747081D0097C84A /* GPUImageStretchDistortionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCA20B961747081C0097C84A /* GPUImageStretchDistortionFilter.m */; }; BCA20BB11747081D0097C84A /* GPUImageSwirlFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA20B971747081C0097C84A /* GPUImageSwirlFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCA20BB21747081D0097C84A /* GPUImageSwirlFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCA20B981747081D0097C84A /* GPUImageSwirlFilter.m */; }; BCA20BB5174708630097C84A /* GPUImageOpeningFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA20BB3174708610097C84A /* GPUImageOpeningFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCA20BB6174708630097C84A /* GPUImageOpeningFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCA20BB4174708620097C84A /* GPUImageOpeningFilter.m */; }; BCA20BC117471C4B0097C84A /* GPUImageJFAVoronoiFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA20BB717471C3A0097C84A /* GPUImageJFAVoronoiFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCA20BC217471C4B0097C84A /* GPUImageJFAVoronoiFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCA20BB817471C3C0097C84A /* GPUImageJFAVoronoiFilter.m */; }; BCA20BC317471C4B0097C84A /* GPUImageLocalBinaryPatternFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA20BB917471C3D0097C84A /* GPUImageLocalBinaryPatternFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCA20BC417471C4B0097C84A /* GPUImageLocalBinaryPatternFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCA20BBA17471C3F0097C84A /* GPUImageLocalBinaryPatternFilter.m */; }; BCA20BC517471C4B0097C84A /* GPUImageMosaicFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA20BBB17471C400097C84A /* GPUImageMosaicFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCA20BC617471C4B0097C84A /* GPUImageMosaicFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCA20BBC17471C420097C84A /* GPUImageMosaicFilter.m */; }; BCA20BC717471C4B0097C84A /* GPUImagePerlinNoiseFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA20BBD17471C440097C84A /* GPUImagePerlinNoiseFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCA20BC817471C4B0097C84A /* GPUImagePerlinNoiseFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCA20BBE17471C460097C84A /* GPUImagePerlinNoiseFilter.m */; }; BCA20BC917471C4B0097C84A /* GPUImageVoronoiConsumerFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA20BBF17471C480097C84A /* GPUImageVoronoiConsumerFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCA20BCA17471C4B0097C84A /* GPUImageVoronoiConsumerFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCA20BC017471C490097C84A /* GPUImageVoronoiConsumerFilter.m */; }; BCA3F32017239B6500E28AEC /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCA3F31F17239B6500E28AEC /* Cocoa.framework */; }; BCA3F3621723A8FA00E28AEC /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCA3F3601723A8FA00E28AEC /* OpenGL.framework */; }; BCA3F3631723A8FA00E28AEC /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCA3F3611723A8FA00E28AEC /* QuartzCore.framework */; }; BCA3F3651723A96600E28AEC /* GPUImage.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA3F3641723A96600E28AEC /* GPUImage.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCAA73B71C18E09100BC2D31 /* GPUImageFourInputFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCAA73B51C18E09100BC2D31 /* GPUImageFourInputFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCAA73B81C18E09100BC2D31 /* GPUImageFourInputFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCAA73B61C18E09100BC2D31 /* GPUImageFourInputFilter.m */; }; BCAE41E41731C3000020F80D /* GPUImageThreeInputFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCAE41E21731C3000020F80D /* GPUImageThreeInputFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCAE41E51731C3000020F80D /* GPUImageThreeInputFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCAE41E31731C3000020F80D /* GPUImageThreeInputFilter.m */; }; BCB009E6172A1BBD00DB804C /* GPUImageGammaFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB009E4172A1BBD00DB804C /* GPUImageGammaFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCB009E7172A1BBD00DB804C /* GPUImageGammaFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB009E5172A1BBD00DB804C /* GPUImageGammaFilter.m */; }; BCB009EA172A1BE800DB804C /* GPUImageToneCurveFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB009E8172A1BE800DB804C /* GPUImageToneCurveFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCB009EB172A1BE800DB804C /* GPUImageToneCurveFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB009E9172A1BE800DB804C /* GPUImageToneCurveFilter.m */; }; BCB009F0172A23AA00DB804C /* GPUImageHazeFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB009EC172A23A900DB804C /* GPUImageHazeFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCB009F1172A23AA00DB804C /* GPUImageHazeFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB009ED172A23A900DB804C /* GPUImageHazeFilter.m */; }; BCB009F2172A23AA00DB804C /* GPUImageHighlightShadowFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB009EE172A23AA00DB804C /* GPUImageHighlightShadowFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCB009F3172A23AA00DB804C /* GPUImageHighlightShadowFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB009EF172A23AA00DB804C /* GPUImageHighlightShadowFilter.m */; }; BCB009F6172A243400DB804C /* GPUImageSepiaFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB009F4172A243300DB804C /* GPUImageSepiaFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCB009F7172A243400DB804C /* GPUImageSepiaFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB009F5172A243400DB804C /* GPUImageSepiaFilter.m */; }; BCB009FA172A246E00DB804C /* GPUImageColorMatrixFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB009F8172A246D00DB804C /* GPUImageColorMatrixFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCB009FB172A246E00DB804C /* GPUImageColorMatrixFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB009F9172A246E00DB804C /* GPUImageColorMatrixFilter.m */; }; BCBF6931173061D200E5792A /* GPUImage3x3ConvolutionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCBF692F173061D200E5792A /* GPUImage3x3ConvolutionFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCBF6932173061D200E5792A /* GPUImage3x3ConvolutionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCBF6930173061D200E5792A /* GPUImage3x3ConvolutionFilter.m */; }; BCBF69351730623200E5792A /* GPUImageEmbossFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCBF69331730623200E5792A /* GPUImageEmbossFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCBF69361730623200E5792A /* GPUImageEmbossFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCBF69341730623200E5792A /* GPUImageEmbossFilter.m */; }; BCC0DF4217358315007C485F /* GPUImageColorInvertFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC0DF4017358315007C485F /* GPUImageColorInvertFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCC0DF4317358315007C485F /* GPUImageColorInvertFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC0DF4117358315007C485F /* GPUImageColorInvertFilter.m */; }; BCC0DF4817359529007C485F /* GPUImageHistogramFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC0DF4417359529007C485F /* GPUImageHistogramFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCC0DF4917359529007C485F /* GPUImageHistogramFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC0DF4517359529007C485F /* GPUImageHistogramFilter.m */; }; BCC0DF4A17359529007C485F /* GPUImageHistogramGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC0DF4617359529007C485F /* GPUImageHistogramGenerator.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCC0DF4B17359529007C485F /* GPUImageHistogramGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC0DF4717359529007C485F /* GPUImageHistogramGenerator.m */; }; BCC0DF52173595D3007C485F /* GPUImageAverageColor.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC0DF4C173595D3007C485F /* GPUImageAverageColor.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCC0DF53173595D3007C485F /* GPUImageAverageColor.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC0DF4D173595D3007C485F /* GPUImageAverageColor.m */; }; BCC0DF54173595D3007C485F /* GPUImageLuminosity.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC0DF4E173595D3007C485F /* GPUImageLuminosity.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCC0DF55173595D3007C485F /* GPUImageLuminosity.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC0DF4F173595D3007C485F /* GPUImageLuminosity.m */; }; BCC0DF56173595D3007C485F /* GPUImageSolidColorGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC0DF50173595D3007C485F /* GPUImageSolidColorGenerator.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCC0DF57173595D3007C485F /* GPUImageSolidColorGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC0DF51173595D3007C485F /* GPUImageSolidColorGenerator.m */; }; BCC0DF5A173596A8007C485F /* GPUImageAdaptiveThresholdFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC0DF58173596A8007C485F /* GPUImageAdaptiveThresholdFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCC0DF5B173596A8007C485F /* GPUImageAdaptiveThresholdFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC0DF59173596A8007C485F /* GPUImageAdaptiveThresholdFilter.m */; }; BCC0DF5E173596B9007C485F /* GPUImageAverageLuminanceThresholdFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC0DF5C173596B9007C485F /* GPUImageAverageLuminanceThresholdFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCC0DF5F173596B9007C485F /* GPUImageAverageLuminanceThresholdFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC0DF5D173596B9007C485F /* GPUImageAverageLuminanceThresholdFilter.m */; }; BCC0DF6217359F42007C485F /* GPUImageLuminanceThresholdFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC0DF6017359F42007C485F /* GPUImageLuminanceThresholdFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCC0DF6317359F43007C485F /* GPUImageLuminanceThresholdFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC0DF6117359F42007C485F /* GPUImageLuminanceThresholdFilter.m */; }; BCD8EB8C18D6AFC5005ED83C /* GPUImageFramebuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD8EB8818D6AFC5005ED83C /* GPUImageFramebuffer.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD8EB8D18D6AFC5005ED83C /* GPUImageFramebuffer.m in Sources */ = {isa = PBXBuildFile; fileRef = BCD8EB8918D6AFC5005ED83C /* GPUImageFramebuffer.m */; }; BCD8EB8E18D6AFC5005ED83C /* GPUImageFramebufferCache.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD8EB8A18D6AFC5005ED83C /* GPUImageFramebufferCache.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCD8EB8F18D6AFC5005ED83C /* GPUImageFramebufferCache.m in Sources */ = {isa = PBXBuildFile; fileRef = BCD8EB8B18D6AFC5005ED83C /* GPUImageFramebufferCache.m */; }; BCE2EF8817459D5B00C0628C /* GPUImageHarrisCornerDetectionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE2EF8217459D5B00C0628C /* GPUImageHarrisCornerDetectionFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCE2EF8917459D5B00C0628C /* GPUImageHarrisCornerDetectionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCE2EF8317459D5B00C0628C /* GPUImageHarrisCornerDetectionFilter.m */; }; BCE2EF8A17459D5B00C0628C /* GPUImageNobleCornerDetectionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE2EF8417459D5B00C0628C /* GPUImageNobleCornerDetectionFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCE2EF8B17459D5B00C0628C /* GPUImageNobleCornerDetectionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCE2EF8517459D5B00C0628C /* GPUImageNobleCornerDetectionFilter.m */; }; BCE2EF8C17459D5B00C0628C /* GPUImageShiTomasiFeatureDetectionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE2EF8617459D5B00C0628C /* GPUImageShiTomasiFeatureDetectionFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCE2EF8D17459D5B00C0628C /* GPUImageShiTomasiFeatureDetectionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCE2EF8717459D5B00C0628C /* GPUImageShiTomasiFeatureDetectionFilter.m */; }; BCE2EF9217459D9300C0628C /* GPUImageColorPackingFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE2EF8E17459D9300C0628C /* GPUImageColorPackingFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCE2EF9317459D9300C0628C /* GPUImageColorPackingFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCE2EF8F17459D9300C0628C /* GPUImageColorPackingFilter.m */; }; BCE2EF9417459D9300C0628C /* GPUImageThresholdedNonMaximumSuppressionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE2EF9017459D9300C0628C /* GPUImageThresholdedNonMaximumSuppressionFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCE2EF9517459D9300C0628C /* GPUImageThresholdedNonMaximumSuppressionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCE2EF9117459D9300C0628C /* GPUImageThresholdedNonMaximumSuppressionFilter.m */; }; BCE2EF9817459E2400C0628C /* GPUImageHoughTransformLineDetector.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE2EF9617459E2400C0628C /* GPUImageHoughTransformLineDetector.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCE2EF9917459E2400C0628C /* GPUImageHoughTransformLineDetector.m in Sources */ = {isa = PBXBuildFile; fileRef = BCE2EF9717459E2400C0628C /* GPUImageHoughTransformLineDetector.m */; }; BCE2EF9C17459E5100C0628C /* GPUImageParallelCoordinateLineTransformFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE2EF9A17459E5100C0628C /* GPUImageParallelCoordinateLineTransformFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCE2EF9D17459E5100C0628C /* GPUImageParallelCoordinateLineTransformFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCE2EF9B17459E5100C0628C /* GPUImageParallelCoordinateLineTransformFilter.m */; }; BCE817A81735FDC70071D084 /* GPUImageHalftoneFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE817A01735FDC60071D084 /* GPUImageHalftoneFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCE817A91735FDC70071D084 /* GPUImageHalftoneFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCE817A11735FDC60071D084 /* GPUImageHalftoneFilter.m */; }; BCE817AA1735FDC70071D084 /* GPUImagePixellatePositionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE817A21735FDC60071D084 /* GPUImagePixellatePositionFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCE817AB1735FDC70071D084 /* GPUImagePixellatePositionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCE817A31735FDC60071D084 /* GPUImagePixellatePositionFilter.m */; }; BCE817AC1735FDC70071D084 /* GPUImagePolarPixellateFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE817A41735FDC70071D084 /* GPUImagePolarPixellateFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCE817AD1735FDC70071D084 /* GPUImagePolarPixellateFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCE817A51735FDC70071D084 /* GPUImagePolarPixellateFilter.m */; }; BCE817AE1735FDC70071D084 /* GPUImagePolkaDotFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE817A61735FDC70071D084 /* GPUImagePolkaDotFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCE817AF1735FDC70071D084 /* GPUImagePolkaDotFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCE817A71735FDC70071D084 /* GPUImagePolkaDotFilter.m */; }; BCE817B21735FE150071D084 /* GPUImageCrosshatchFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE817B01735FE150071D084 /* GPUImageCrosshatchFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCE817B31735FE150071D084 /* GPUImageCrosshatchFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCE817B11735FE150071D084 /* GPUImageCrosshatchFilter.m */; }; BCE817BA173608690071D084 /* GPUImageCannyEdgeDetectionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE817B4173608690071D084 /* GPUImageCannyEdgeDetectionFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCE817BB173608690071D084 /* GPUImageCannyEdgeDetectionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCE817B5173608690071D084 /* GPUImageCannyEdgeDetectionFilter.m */; }; BCE817BC173608690071D084 /* GPUImagePrewittEdgeDetectionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE817B6173608690071D084 /* GPUImagePrewittEdgeDetectionFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCE817BD173608690071D084 /* GPUImagePrewittEdgeDetectionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCE817B7173608690071D084 /* GPUImagePrewittEdgeDetectionFilter.m */; }; BCE817BE173608690071D084 /* GPUImageThresholdEdgeDetectionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE817B8173608690071D084 /* GPUImageThresholdEdgeDetectionFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCE817BF173608690071D084 /* GPUImageThresholdEdgeDetectionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCE817B9173608690071D084 /* GPUImageThresholdEdgeDetectionFilter.m */; }; BCE817C21736092A0071D084 /* GPUImageXYDerivativeFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE817C01736092A0071D084 /* GPUImageXYDerivativeFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCE817C31736092A0071D084 /* GPUImageXYDerivativeFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCE817C11736092A0071D084 /* GPUImageXYDerivativeFilter.m */; }; BCE817CC17360BFD0071D084 /* GPUImageDirectionalNonMaximumSuppressionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE817C817360BFD0071D084 /* GPUImageDirectionalNonMaximumSuppressionFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCE817CD17360BFD0071D084 /* GPUImageDirectionalNonMaximumSuppressionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCE817C917360BFD0071D084 /* GPUImageDirectionalNonMaximumSuppressionFilter.m */; }; BCE817CE17360BFD0071D084 /* GPUImageDirectionalSobelEdgeDetectionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE817CA17360BFD0071D084 /* GPUImageDirectionalSobelEdgeDetectionFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCE817CF17360BFD0071D084 /* GPUImageDirectionalSobelEdgeDetectionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCE817CB17360BFD0071D084 /* GPUImageDirectionalSobelEdgeDetectionFilter.m */; }; BCE817D217360C6A0071D084 /* GPUImageWeakPixelInclusionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE817D017360C6A0071D084 /* GPUImageWeakPixelInclusionFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCE817D317360C6A0071D084 /* GPUImageWeakPixelInclusionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCE817D117360C6A0071D084 /* GPUImageWeakPixelInclusionFilter.m */; }; BCF40F1217247D68005AE36A /* GPUImageContext.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF40F1017247D68005AE36A /* GPUImageContext.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF40F1317247D68005AE36A /* GPUImageContext.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF40F1117247D68005AE36A /* GPUImageContext.m */; }; BCF40F1617247FD8005AE36A /* GLProgram.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF40F1417247FD8005AE36A /* GLProgram.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF40F1717247FD8005AE36A /* GLProgram.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF40F1517247FD8005AE36A /* GLProgram.m */; }; BCF40F1B1724829B005AE36A /* GPUImageOutput.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF40F191724829B005AE36A /* GPUImageOutput.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF40F1C1724829B005AE36A /* GPUImageOutput.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF40F1A1724829B005AE36A /* GPUImageOutput.m */; }; BCF40F2017248322005AE36A /* GPUImageFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF40F1E17248322005AE36A /* GPUImageFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF40F2117248322005AE36A /* GPUImageFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF40F1F17248322005AE36A /* GPUImageFilter.m */; }; BCF40F2517248836005AE36A /* GPUImageView.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF40F2317248836005AE36A /* GPUImageView.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF40F2617248836005AE36A /* GPUImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF40F2417248836005AE36A /* GPUImageView.m */; }; BCF40F29172488D3005AE36A /* GPUImageBrightnessFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF40F27172488D3005AE36A /* GPUImageBrightnessFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF40F2A172488D3005AE36A /* GPUImageBrightnessFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF40F28172488D3005AE36A /* GPUImageBrightnessFilter.m */; }; BCF867561725AF9300912E34 /* GPUImageMovieWriter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF867521725AF9300912E34 /* GPUImageMovieWriter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF867571725AF9300912E34 /* GPUImageMovieWriter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF867531725AF9300912E34 /* GPUImageMovieWriter.m */; }; BCF867581725AF9300912E34 /* GPUImagePicture.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF867541725AF9300912E34 /* GPUImagePicture.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF867591725AF9300912E34 /* GPUImagePicture.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF867551725AF9300912E34 /* GPUImagePicture.m */; }; BCF8675B1725BBE300912E34 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCF8675A1725BBE300912E34 /* AVFoundation.framework */; }; BCF8675D1725BBE900912E34 /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCF8675C1725BBE900912E34 /* CoreMedia.framework */; }; BCF8679D1727585D00912E34 /* GPUImageAVCamera.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF8679B1727585D00912E34 /* GPUImageAVCamera.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF8679E1727585D00912E34 /* GPUImageAVCamera.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF8679C1727585D00912E34 /* GPUImageAVCamera.m */; }; BCF867AD172778D500912E34 /* GPUImageContrastFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF867A3172778D500912E34 /* GPUImageContrastFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF867AE172778D500912E34 /* GPUImageContrastFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF867A4172778D500912E34 /* GPUImageContrastFilter.m */; }; BCF867AF172778D500912E34 /* GPUImageExposureFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF867A5172778D500912E34 /* GPUImageExposureFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF867B0172778D500912E34 /* GPUImageExposureFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF867A6172778D500912E34 /* GPUImageExposureFilter.m */; }; BCF867B1172778D500912E34 /* GPUImageHueFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF867A7172778D500912E34 /* GPUImageHueFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF867B2172778D500912E34 /* GPUImageHueFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF867A8172778D500912E34 /* GPUImageHueFilter.m */; }; BCF867B3172778D500912E34 /* GPUImageSaturationFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF867A9172778D500912E34 /* GPUImageSaturationFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF867B4172778D500912E34 /* GPUImageSaturationFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF867AA172778D500912E34 /* GPUImageSaturationFilter.m */; }; BCF867B5172778D500912E34 /* GPUImageWhiteBalanceFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF867AB172778D500912E34 /* GPUImageWhiteBalanceFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF867B6172778D500912E34 /* GPUImageWhiteBalanceFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF867AC172778D500912E34 /* GPUImageWhiteBalanceFilter.m */; }; BCF867B91727791200912E34 /* GPUImageLevelsFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF867B71727791200912E34 /* GPUImageLevelsFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF867BA1727791200912E34 /* GPUImageLevelsFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF867B81727791200912E34 /* GPUImageLevelsFilter.m */; }; BCF867BF1727794000912E34 /* GPUImageMonochromeFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF867BB1727794000912E34 /* GPUImageMonochromeFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF867C01727794000912E34 /* GPUImageMonochromeFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF867BC1727794000912E34 /* GPUImageMonochromeFilter.m */; }; BCF867C11727794000912E34 /* GPUImageRGBFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF867BD1727794000912E34 /* GPUImageRGBFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF867C21727794000912E34 /* GPUImageRGBFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF867BE1727794000912E34 /* GPUImageRGBFilter.m */; }; BCF867C71727872D00912E34 /* GPUImagePixellateFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF867C51727872D00912E34 /* GPUImagePixellateFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF867C81727872D00912E34 /* GPUImagePixellateFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF867C61727872D00912E34 /* GPUImagePixellateFilter.m */; }; BCF867CB172788F100912E34 /* GPUImage3x3TextureSamplingFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF867C9172788F100912E34 /* GPUImage3x3TextureSamplingFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF867CC172788F100912E34 /* GPUImage3x3TextureSamplingFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF867CA172788F100912E34 /* GPUImage3x3TextureSamplingFilter.m */; }; BCF867CF172789B200912E34 /* GPUImageSketchFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF867CD172789B200912E34 /* GPUImageSketchFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF867D0172789B200912E34 /* GPUImageSketchFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF867CE172789B200912E34 /* GPUImageSketchFilter.m */; }; BCF867D417278A5600912E34 /* GPUImageSobelEdgeDetectionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF867D217278A5600912E34 /* GPUImageSobelEdgeDetectionFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF867D517278A5600912E34 /* GPUImageSobelEdgeDetectionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF867D317278A5600912E34 /* GPUImageSobelEdgeDetectionFilter.m */; }; BCF867D817278A7A00912E34 /* GPUImageToonFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF867D617278A7900912E34 /* GPUImageToonFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF867D917278A7A00912E34 /* GPUImageToonFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF867D717278A7900912E34 /* GPUImageToonFilter.m */; }; BCF867DC17278C5A00912E34 /* GPUImageTwoPassFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF867DA17278C5800912E34 /* GPUImageTwoPassFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF867DD17278C5A00912E34 /* GPUImageTwoPassFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF867DB17278C5900912E34 /* GPUImageTwoPassFilter.m */; }; BCF867E017278D1900912E34 /* GPUImageGrayscaleFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF867DE17278D1900912E34 /* GPUImageGrayscaleFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF867E117278D1900912E34 /* GPUImageGrayscaleFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF867DF17278D1900912E34 /* GPUImageGrayscaleFilter.m */; }; BCF867E41727903D00912E34 /* GPUImageKuwaharaFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF867E21727903C00912E34 /* GPUImageKuwaharaFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF867E51727903D00912E34 /* GPUImageKuwaharaFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF867E31727903D00912E34 /* GPUImageKuwaharaFilter.m */; }; BCF867E81728477300912E34 /* GPUImageFalseColorFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF867E61728477200912E34 /* GPUImageFalseColorFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF867E91728477300912E34 /* GPUImageFalseColorFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF867E71728477200912E34 /* GPUImageFalseColorFilter.m */; }; BCF867EC172847A000912E34 /* GPUImageSharpenFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF867EA172847A000912E34 /* GPUImageSharpenFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF867ED172847A000912E34 /* GPUImageSharpenFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF867EB172847A000912E34 /* GPUImageSharpenFilter.m */; }; BCF867F01728487100912E34 /* GPUImageUnsharpMaskFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF867EE1728487000912E34 /* GPUImageUnsharpMaskFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF867F11728487100912E34 /* GPUImageUnsharpMaskFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF867EF1728487000912E34 /* GPUImageUnsharpMaskFilter.m */; }; BCF867F41728490600912E34 /* GPUImageTwoInputFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF867F21728490300912E34 /* GPUImageTwoInputFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF867F51728490600912E34 /* GPUImageTwoInputFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF867F31728490500912E34 /* GPUImageTwoInputFilter.m */; }; BCF867F81728494C00912E34 /* GPUImageGaussianBlurFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF867F61728494B00912E34 /* GPUImageGaussianBlurFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF867F91728494C00912E34 /* GPUImageGaussianBlurFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF867F71728494B00912E34 /* GPUImageGaussianBlurFilter.m */; }; BCF867FC1728496E00912E34 /* GPUImageTwoPassTextureSamplingFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF867FA1728496A00912E34 /* GPUImageTwoPassTextureSamplingFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF867FD1728496E00912E34 /* GPUImageTwoPassTextureSamplingFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF867FB1728496C00912E34 /* GPUImageTwoPassTextureSamplingFilter.m */; }; BCF8680017284C4000912E34 /* GPUImageFilterGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF867FE17284C3C00912E34 /* GPUImageFilterGroup.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF8680117284C4000912E34 /* GPUImageFilterGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF867FF17284C3E00912E34 /* GPUImageFilterGroup.m */; }; BCF8680417284CFC00912E34 /* GPUImageTransformFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF8680217284CFB00912E34 /* GPUImageTransformFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF8680517284CFC00912E34 /* GPUImageTransformFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF8680317284CFB00912E34 /* GPUImageTransformFilter.m */; }; BCF8680817284D0B00912E34 /* GPUImageCropFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF8680617284D0A00912E34 /* GPUImageCropFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF8680917284D0B00912E34 /* GPUImageCropFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF8680717284D0A00912E34 /* GPUImageCropFilter.m */; }; BCF86810172853AA00912E34 /* GPUImageGaussianBlurPositionFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF8680C172853A500912E34 /* GPUImageGaussianBlurPositionFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF86811172853AA00912E34 /* GPUImageGaussianBlurPositionFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF8680D172853A600912E34 /* GPUImageGaussianBlurPositionFilter.m */; }; BCF86812172853AA00912E34 /* GPUImageGaussianSelectiveBlurFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF8680E172853A700912E34 /* GPUImageGaussianSelectiveBlurFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF86813172853AA00912E34 /* GPUImageGaussianSelectiveBlurFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF8680F172853A800912E34 /* GPUImageGaussianSelectiveBlurFilter.m */; }; BCF8681C172854B900912E34 /* GPUImageBilateralFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF86814172854AA00912E34 /* GPUImageBilateralFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF8681D172854B900912E34 /* GPUImageBilateralFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF86815172854AC00912E34 /* GPUImageBilateralFilter.m */; }; BCF8681E172854B900912E34 /* GPUImageBoxBlurFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF86816172854AE00912E34 /* GPUImageBoxBlurFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF8681F172854B900912E34 /* GPUImageBoxBlurFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF86817172854B100912E34 /* GPUImageBoxBlurFilter.m */; }; BCF86822172854B900912E34 /* GPUImageMedianFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF8681A172854B600912E34 /* GPUImageMedianFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF86823172854B900912E34 /* GPUImageMedianFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF8681B172854B800912E34 /* GPUImageMedianFilter.m */; }; BCF86828172857B900912E34 /* GPUImageMotionBlurFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF86824172857AD00912E34 /* GPUImageMotionBlurFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF86829172857B900912E34 /* GPUImageMotionBlurFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF86825172857B000912E34 /* GPUImageMotionBlurFilter.m */; }; BCF8682A172857B900912E34 /* GPUImageZoomBlurFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF86826172857B200912E34 /* GPUImageZoomBlurFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF8682B172857B900912E34 /* GPUImageZoomBlurFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF86827172857B600912E34 /* GPUImageZoomBlurFilter.m */; }; BCF8683017286EDB00912E34 /* GPUImageAddBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF8682D17286EDB00912E34 /* GPUImageAddBlendFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF8683117286EDB00912E34 /* GPUImageAddBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF8682E17286EDB00912E34 /* GPUImageAddBlendFilter.m */; }; BCF8683F17286F2800912E34 /* GPUImageColorBurnBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF8683317286F2800912E34 /* GPUImageColorBurnBlendFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF8684017286F2800912E34 /* GPUImageColorBurnBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF8683417286F2800912E34 /* GPUImageColorBurnBlendFilter.m */; }; BCF8684117286F2800912E34 /* GPUImageDarkenBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF8683517286F2800912E34 /* GPUImageDarkenBlendFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF8684217286F2800912E34 /* GPUImageDarkenBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF8683617286F2800912E34 /* GPUImageDarkenBlendFilter.m */; }; BCF8684317286F2800912E34 /* GPUImageDivideBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF8683717286F2800912E34 /* GPUImageDivideBlendFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF8684417286F2800912E34 /* GPUImageDivideBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF8683817286F2800912E34 /* GPUImageDivideBlendFilter.m */; }; BCF8684517286F2800912E34 /* GPUImageLightenBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF8683917286F2800912E34 /* GPUImageLightenBlendFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF8684617286F2800912E34 /* GPUImageLightenBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF8683A17286F2800912E34 /* GPUImageLightenBlendFilter.m */; }; BCF8684717286F2800912E34 /* GPUImageMultiplyBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF8683B17286F2800912E34 /* GPUImageMultiplyBlendFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF8684817286F2800912E34 /* GPUImageMultiplyBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF8683C17286F2800912E34 /* GPUImageMultiplyBlendFilter.m */; }; BCF8684917286F2800912E34 /* GPUImageOverlayBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF8683D17286F2800912E34 /* GPUImageOverlayBlendFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF8684A17286F2800912E34 /* GPUImageOverlayBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF8683E17286F2800912E34 /* GPUImageOverlayBlendFilter.m */; }; BCF868531728716400912E34 /* GPUImageColorDodgeBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF8684B1728715800912E34 /* GPUImageColorDodgeBlendFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF868541728716400912E34 /* GPUImageColorDodgeBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF8684C1728715900912E34 /* GPUImageColorDodgeBlendFilter.m */; }; BCF868551728716400912E34 /* GPUImageDifferenceBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF8684D1728715C00912E34 /* GPUImageDifferenceBlendFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF868561728716400912E34 /* GPUImageDifferenceBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF8684E1728715D00912E34 /* GPUImageDifferenceBlendFilter.m */; }; BCF868571728716400912E34 /* GPUImageLinearBurnBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF8684F1728715F00912E34 /* GPUImageLinearBurnBlendFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF868581728716400912E34 /* GPUImageLinearBurnBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF868501728716000912E34 /* GPUImageLinearBurnBlendFilter.m */; }; BCF868591728716400912E34 /* GPUImageScreenBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF868511728716200912E34 /* GPUImageScreenBlendFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF8685A1728716400912E34 /* GPUImageScreenBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF868521728716300912E34 /* GPUImageScreenBlendFilter.m */; }; BCF8686F1728721300912E34 /* GPUImageColorBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF8685B172871EE00912E34 /* GPUImageColorBlendFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF868701728721300912E34 /* GPUImageColorBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF8685C172871F000912E34 /* GPUImageColorBlendFilter.m */; }; BCF868711728721300912E34 /* GPUImageExclusionBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF8685D172871F300912E34 /* GPUImageExclusionBlendFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF868721728721300912E34 /* GPUImageExclusionBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF8685E172871F500912E34 /* GPUImageExclusionBlendFilter.m */; }; BCF868731728721300912E34 /* GPUImageHardLightBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF8685F172871F800912E34 /* GPUImageHardLightBlendFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF868741728721300912E34 /* GPUImageHardLightBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF86860172871FB00912E34 /* GPUImageHardLightBlendFilter.m */; }; BCF868751728721300912E34 /* GPUImageHueBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF86861172871FC00912E34 /* GPUImageHueBlendFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF868761728721300912E34 /* GPUImageHueBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF86862172871FD00912E34 /* GPUImageHueBlendFilter.m */; }; BCF868771728721300912E34 /* GPUImageLuminosityBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF86863172871FF00912E34 /* GPUImageLuminosityBlendFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF868781728721300912E34 /* GPUImageLuminosityBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF868641728720100912E34 /* GPUImageLuminosityBlendFilter.m */; }; BCF868791728721300912E34 /* GPUImageNormalBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF868651728720200912E34 /* GPUImageNormalBlendFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF8687A1728721300912E34 /* GPUImageNormalBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF868661728720400912E34 /* GPUImageNormalBlendFilter.m */; }; BCF8687B1728721300912E34 /* GPUImagePoissonBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF868671728720600912E34 /* GPUImagePoissonBlendFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF8687C1728721300912E34 /* GPUImagePoissonBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF868681728720700912E34 /* GPUImagePoissonBlendFilter.m */; }; BCF8687D1728721300912E34 /* GPUImageSaturationBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF868691728720900912E34 /* GPUImageSaturationBlendFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF8687E1728721300912E34 /* GPUImageSaturationBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF8686A1728720B00912E34 /* GPUImageSaturationBlendFilter.m */; }; BCF8687F1728721300912E34 /* GPUImageSoftLightBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF8686B1728720C00912E34 /* GPUImageSoftLightBlendFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF868801728721300912E34 /* GPUImageSoftLightBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF8686C1728720E00912E34 /* GPUImageSoftLightBlendFilter.m */; }; BCF868811728721300912E34 /* GPUImageSubtractBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF8686D1728720F00912E34 /* GPUImageSubtractBlendFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF868821728721300912E34 /* GPUImageSubtractBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF8686E1728721100912E34 /* GPUImageSubtractBlendFilter.m */; }; BCF868851728773900912E34 /* GPUImageTwoInputCrossTextureSamplingFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF868831728771D00912E34 /* GPUImageTwoInputCrossTextureSamplingFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF868861728773900912E34 /* GPUImageTwoInputCrossTextureSamplingFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF868841728772600912E34 /* GPUImageTwoInputCrossTextureSamplingFilter.m */; }; BCF8688F17287ED000912E34 /* GPUImageChromaKeyBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF8688B17287EB500912E34 /* GPUImageChromaKeyBlendFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF8689017287ED000912E34 /* GPUImageChromaKeyBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF8688C17287EBB00912E34 /* GPUImageChromaKeyBlendFilter.m */; }; BCF8689117287ED000912E34 /* GPUImageDissolveBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF8688D17287EC400912E34 /* GPUImageDissolveBlendFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF8689217287ED000912E34 /* GPUImageDissolveBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF8688E17287ECC00912E34 /* GPUImageDissolveBlendFilter.m */; }; BCF86895172880B800912E34 /* GPUImageSourceOverBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF86893172880AB00912E34 /* GPUImageSourceOverBlendFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF86896172880B800912E34 /* GPUImageSourceOverBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF86894172880B100912E34 /* GPUImageSourceOverBlendFilter.m */; }; BCF86899172883A300912E34 /* GPUImageMaskFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF868971728839800912E34 /* GPUImageMaskFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF8689A172883A300912E34 /* GPUImageMaskFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF868981728839C00912E34 /* GPUImageMaskFilter.m */; }; BCF8689D1728862100912E34 /* GPUImageOpacityFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF8689B1728861E00912E34 /* GPUImageOpacityFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF8689E1728862100912E34 /* GPUImageOpacityFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF8689C1728861F00912E34 /* GPUImageOpacityFilter.m */; }; BCF868A11728866400912E34 /* GPUImageAlphaBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF8689F1728865500912E34 /* GPUImageAlphaBlendFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF868A21728866400912E34 /* GPUImageAlphaBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF868A01728865D00912E34 /* GPUImageAlphaBlendFilter.m */; }; BCFC5F611C18BDBA00C7F43B /* GPUImageColorLocalBinaryPatternFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = BCFC5F5F1C18BDBA00C7F43B /* GPUImageColorLocalBinaryPatternFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCFC5F621C18BDBA00C7F43B /* GPUImageColorLocalBinaryPatternFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = BCFC5F601C18BDBA00C7F43B /* GPUImageColorLocalBinaryPatternFilter.m */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ 574B5D841BE9346800F4EC5A /* GPUImageMovie.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageMovie.h; path = Source/GPUImageMovie.h; sourceTree = SOURCE_ROOT; }; 574B5D851BE9346800F4EC5A /* GPUImageMovie.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageMovie.m; path = Source/GPUImageMovie.m; sourceTree = SOURCE_ROOT; }; 574B5D8F1BEA3E7900F4EC5A /* GPUImageColorConversion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageColorConversion.h; path = Source/GPUImageColorConversion.h; sourceTree = SOURCE_ROOT; }; 574B5D901BEA3E7900F4EC5A /* GPUImageColorConversion.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageColorConversion.m; path = Source/GPUImageColorConversion.m; sourceTree = SOURCE_ROOT; }; 79840B811C8B29240079A83B /* GPUImageSolarizeFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageSolarizeFilter.h; path = Source/GPUImageSolarizeFilter.h; sourceTree = SOURCE_ROOT; }; 79840B821C8B29240079A83B /* GPUImageSolarizeFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageSolarizeFilter.m; path = Source/GPUImageSolarizeFilter.m; sourceTree = SOURCE_ROOT; }; A4741D5819A92098005EE1A4 /* GPUImageHistogramEqualizationFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageHistogramEqualizationFilter.h; path = Source/GPUImageHistogramEqualizationFilter.h; sourceTree = SOURCE_ROOT; }; A4741D5919A92098005EE1A4 /* GPUImageHistogramEqualizationFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageHistogramEqualizationFilter.m; path = Source/GPUImageHistogramEqualizationFilter.m; sourceTree = SOURCE_ROOT; }; A50607151C78BF7C0095D0BB /* GPUImageTextureOutput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageTextureOutput.h; path = Source/GPUImageTextureOutput.h; sourceTree = SOURCE_ROOT; }; A50607161C78BF7C0095D0BB /* GPUImageTextureOutput.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageTextureOutput.m; path = Source/GPUImageTextureOutput.m; sourceTree = SOURCE_ROOT; }; A50607191C78BF8E0095D0BB /* GPUImageTextureInput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageTextureInput.h; path = Source/GPUImageTextureInput.h; sourceTree = SOURCE_ROOT; }; A506071A1C78BF8E0095D0BB /* GPUImageTextureInput.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageTextureInput.m; path = Source/GPUImageTextureInput.m; sourceTree = SOURCE_ROOT; }; A87E5E10177648F3007FD5B1 /* GPUImageRawDataOutput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageRawDataOutput.h; path = Source/GPUImageRawDataOutput.h; sourceTree = SOURCE_ROOT; }; A87E5E11177648F3007FD5B1 /* GPUImageRawDataOutput.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageRawDataOutput.m; path = Source/GPUImageRawDataOutput.m; sourceTree = SOURCE_ROOT; }; A87E5E1417764B16007FD5B1 /* GPUImageRawDataInput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageRawDataInput.h; path = Source/GPUImageRawDataInput.h; sourceTree = SOURCE_ROOT; }; A87E5E1517764B16007FD5B1 /* GPUImageRawDataInput.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageRawDataInput.m; path = Source/GPUImageRawDataInput.m; sourceTree = SOURCE_ROOT; }; BC4DFD011C10D2FD0095A016 /* GPUImageColourFASTFeatureDetector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageColourFASTFeatureDetector.h; path = Source/GPUImageColourFASTFeatureDetector.h; sourceTree = SOURCE_ROOT; }; BC4DFD021C10D2FD0095A016 /* GPUImageColourFASTFeatureDetector.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageColourFASTFeatureDetector.m; path = Source/GPUImageColourFASTFeatureDetector.m; sourceTree = SOURCE_ROOT; }; BC4DFD051C10D4860095A016 /* GPUImageColourFASTSamplingOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageColourFASTSamplingOperation.h; path = Source/GPUImageColourFASTSamplingOperation.h; sourceTree = SOURCE_ROOT; }; BC4DFD061C10D4860095A016 /* GPUImageColourFASTSamplingOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageColourFASTSamplingOperation.m; path = Source/GPUImageColourFASTSamplingOperation.m; sourceTree = SOURCE_ROOT; }; BC569576174683620081491B /* GPUImageCrosshairGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageCrosshairGenerator.h; path = Source/GPUImageCrosshairGenerator.h; sourceTree = SOURCE_ROOT; }; BC569577174683620081491B /* GPUImageCrosshairGenerator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageCrosshairGenerator.m; path = Source/GPUImageCrosshairGenerator.m; sourceTree = SOURCE_ROOT; }; BC569578174683620081491B /* GPUImageLineGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageLineGenerator.h; path = Source/GPUImageLineGenerator.h; sourceTree = SOURCE_ROOT; }; BC569579174683620081491B /* GPUImageLineGenerator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageLineGenerator.m; path = Source/GPUImageLineGenerator.m; sourceTree = SOURCE_ROOT; }; BC6C553A1730636600EB222D /* GPUImageLaplacianFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageLaplacianFilter.h; path = Source/GPUImageLaplacianFilter.h; sourceTree = SOURCE_ROOT; }; BC6C553B1730636600EB222D /* GPUImageLaplacianFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageLaplacianFilter.m; path = Source/GPUImageLaplacianFilter.m; sourceTree = SOURCE_ROOT; }; BC6C55441730BDCF00EB222D /* GPUImageLanczosResamplingFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageLanczosResamplingFilter.h; path = Source/GPUImageLanczosResamplingFilter.h; sourceTree = SOURCE_ROOT; }; BC6C55451730BDCF00EB222D /* GPUImageLanczosResamplingFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageLanczosResamplingFilter.m; path = Source/GPUImageLanczosResamplingFilter.m; sourceTree = SOURCE_ROOT; }; BC78B706172DCCB800342C6A /* GPUImageAmatorkaFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageAmatorkaFilter.h; path = Source/GPUImageAmatorkaFilter.h; sourceTree = SOURCE_ROOT; }; BC78B707172DCCB800342C6A /* GPUImageAmatorkaFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageAmatorkaFilter.m; path = Source/GPUImageAmatorkaFilter.m; sourceTree = SOURCE_ROOT; }; BC78B708172DCCB800342C6A /* GPUImageLookupFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageLookupFilter.h; path = Source/GPUImageLookupFilter.h; sourceTree = SOURCE_ROOT; }; BC78B709172DCCB800342C6A /* GPUImageLookupFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageLookupFilter.m; path = Source/GPUImageLookupFilter.m; sourceTree = SOURCE_ROOT; }; BC78B70A172DCCB800342C6A /* GPUImageMissEtikateFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageMissEtikateFilter.h; path = Source/GPUImageMissEtikateFilter.h; sourceTree = SOURCE_ROOT; }; BC78B70B172DCCB800342C6A /* GPUImageMissEtikateFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageMissEtikateFilter.m; path = Source/GPUImageMissEtikateFilter.m; sourceTree = SOURCE_ROOT; }; BC78B70C172DCCB800342C6A /* GPUImageSoftEleganceFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageSoftEleganceFilter.h; path = Source/GPUImageSoftEleganceFilter.h; sourceTree = SOURCE_ROOT; }; BC78B70D172DCCB800342C6A /* GPUImageSoftEleganceFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageSoftEleganceFilter.m; path = Source/GPUImageSoftEleganceFilter.m; sourceTree = SOURCE_ROOT; }; BC8A583018124ABD00E6B507 /* GPUImageSingleComponentGaussianBlurFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageSingleComponentGaussianBlurFilter.h; path = Source/GPUImageSingleComponentGaussianBlurFilter.h; sourceTree = SOURCE_ROOT; }; BC8A583118124ABD00E6B507 /* GPUImageSingleComponentGaussianBlurFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageSingleComponentGaussianBlurFilter.m; path = Source/GPUImageSingleComponentGaussianBlurFilter.m; sourceTree = SOURCE_ROOT; }; BC96A4EF176563C300F215A2 /* GPUImageNonMaximumSuppressionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageNonMaximumSuppressionFilter.h; path = Source/GPUImageNonMaximumSuppressionFilter.h; sourceTree = SOURCE_ROOT; }; BC96A4F0176563C300F215A2 /* GPUImageNonMaximumSuppressionFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageNonMaximumSuppressionFilter.m; path = Source/GPUImageNonMaximumSuppressionFilter.m; sourceTree = SOURCE_ROOT; }; BCA20B4F1746C9EC0097C84A /* GPUImageBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageBuffer.h; path = Source/GPUImageBuffer.h; sourceTree = SOURCE_ROOT; }; BCA20B501746C9EC0097C84A /* GPUImageBuffer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageBuffer.m; path = Source/GPUImageBuffer.m; sourceTree = SOURCE_ROOT; }; BCA20B511746C9EC0097C84A /* GPUImageHighPassFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageHighPassFilter.h; path = Source/GPUImageHighPassFilter.h; sourceTree = SOURCE_ROOT; }; BCA20B521746C9EC0097C84A /* GPUImageHighPassFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageHighPassFilter.m; path = Source/GPUImageHighPassFilter.m; sourceTree = SOURCE_ROOT; }; BCA20B531746C9EC0097C84A /* GPUImageLowPassFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageLowPassFilter.h; path = Source/GPUImageLowPassFilter.h; sourceTree = SOURCE_ROOT; }; BCA20B541746C9EC0097C84A /* GPUImageLowPassFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageLowPassFilter.m; path = Source/GPUImageLowPassFilter.m; sourceTree = SOURCE_ROOT; }; BCA20B551746C9EC0097C84A /* GPUImageMotionDetector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageMotionDetector.h; path = Source/GPUImageMotionDetector.h; sourceTree = SOURCE_ROOT; }; BCA20B561746C9EC0097C84A /* GPUImageMotionDetector.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageMotionDetector.m; path = Source/GPUImageMotionDetector.m; sourceTree = SOURCE_ROOT; }; BCA20B5F1746CFE60097C84A /* GPUImageThresholdSketchFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageThresholdSketchFilter.h; path = Source/GPUImageThresholdSketchFilter.h; sourceTree = SOURCE_ROOT; }; BCA20B601746CFE60097C84A /* GPUImageThresholdSketchFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageThresholdSketchFilter.m; path = Source/GPUImageThresholdSketchFilter.m; sourceTree = SOURCE_ROOT; }; BCA20B631746D3C30097C84A /* GPUImageSmoothToonFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageSmoothToonFilter.h; path = Source/GPUImageSmoothToonFilter.h; sourceTree = SOURCE_ROOT; }; BCA20B641746D3C30097C84A /* GPUImageSmoothToonFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageSmoothToonFilter.m; path = Source/GPUImageSmoothToonFilter.m; sourceTree = SOURCE_ROOT; }; BCA20B671746D3DC0097C84A /* GPUImageTiltShiftFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageTiltShiftFilter.h; path = Source/GPUImageTiltShiftFilter.h; sourceTree = SOURCE_ROOT; }; BCA20B681746D3DC0097C84A /* GPUImageTiltShiftFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageTiltShiftFilter.m; path = Source/GPUImageTiltShiftFilter.m; sourceTree = SOURCE_ROOT; }; BCA20B6B1746D44A0097C84A /* GPUImageCGAColorspaceFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageCGAColorspaceFilter.h; path = Source/GPUImageCGAColorspaceFilter.h; sourceTree = SOURCE_ROOT; }; BCA20B6C1746D44A0097C84A /* GPUImageCGAColorspaceFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageCGAColorspaceFilter.m; path = Source/GPUImageCGAColorspaceFilter.m; sourceTree = SOURCE_ROOT; }; BCA20B6F1746D4AC0097C84A /* GPUImagePosterizeFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImagePosterizeFilter.h; path = Source/GPUImagePosterizeFilter.h; sourceTree = SOURCE_ROOT; }; BCA20B701746D4AC0097C84A /* GPUImagePosterizeFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImagePosterizeFilter.m; path = Source/GPUImagePosterizeFilter.m; sourceTree = SOURCE_ROOT; }; BCA20B731746DE850097C84A /* GPUImageKuwaharaRadius3Filter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageKuwaharaRadius3Filter.h; path = Source/GPUImageKuwaharaRadius3Filter.h; sourceTree = SOURCE_ROOT; }; BCA20B741746DE850097C84A /* GPUImageKuwaharaRadius3Filter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageKuwaharaRadius3Filter.m; path = Source/GPUImageKuwaharaRadius3Filter.m; sourceTree = SOURCE_ROOT; }; BCA20B771746DEDD0097C84A /* GPUImageChromaKeyFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageChromaKeyFilter.h; path = Source/GPUImageChromaKeyFilter.h; sourceTree = SOURCE_ROOT; }; BCA20B781746DEDE0097C84A /* GPUImageChromaKeyFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageChromaKeyFilter.m; path = Source/GPUImageChromaKeyFilter.m; sourceTree = SOURCE_ROOT; }; BCA20B7B1746DF200097C84A /* GPUImageVignetteFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageVignetteFilter.h; path = Source/GPUImageVignetteFilter.h; sourceTree = SOURCE_ROOT; }; BCA20B7C1746DF200097C84A /* GPUImageVignetteFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageVignetteFilter.m; path = Source/GPUImageVignetteFilter.m; sourceTree = SOURCE_ROOT; }; BCA20B7F1747080E0097C84A /* GPUImageBulgeDistortionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageBulgeDistortionFilter.h; path = Source/GPUImageBulgeDistortionFilter.h; sourceTree = SOURCE_ROOT; }; BCA20B801747080F0097C84A /* GPUImageBulgeDistortionFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageBulgeDistortionFilter.m; path = Source/GPUImageBulgeDistortionFilter.m; sourceTree = SOURCE_ROOT; }; BCA20B811747080F0097C84A /* GPUImageClosingFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageClosingFilter.h; path = Source/GPUImageClosingFilter.h; sourceTree = SOURCE_ROOT; }; BCA20B82174708100097C84A /* GPUImageClosingFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageClosingFilter.m; path = Source/GPUImageClosingFilter.m; sourceTree = SOURCE_ROOT; }; BCA20B83174708110097C84A /* GPUImageDilationFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageDilationFilter.h; path = Source/GPUImageDilationFilter.h; sourceTree = SOURCE_ROOT; }; BCA20B84174708120097C84A /* GPUImageDilationFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageDilationFilter.m; path = Source/GPUImageDilationFilter.m; sourceTree = SOURCE_ROOT; }; BCA20B85174708120097C84A /* GPUImageErosionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageErosionFilter.h; path = Source/GPUImageErosionFilter.h; sourceTree = SOURCE_ROOT; }; BCA20B86174708130097C84A /* GPUImageErosionFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageErosionFilter.m; path = Source/GPUImageErosionFilter.m; sourceTree = SOURCE_ROOT; }; BCA20B87174708140097C84A /* GPUImageGlassSphereFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageGlassSphereFilter.h; path = Source/GPUImageGlassSphereFilter.h; sourceTree = SOURCE_ROOT; }; BCA20B88174708150097C84A /* GPUImageGlassSphereFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageGlassSphereFilter.m; path = Source/GPUImageGlassSphereFilter.m; sourceTree = SOURCE_ROOT; }; BCA20B89174708150097C84A /* GPUImagePinchDistortionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImagePinchDistortionFilter.h; path = Source/GPUImagePinchDistortionFilter.h; sourceTree = SOURCE_ROOT; }; BCA20B8A174708150097C84A /* GPUImagePinchDistortionFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImagePinchDistortionFilter.m; path = Source/GPUImagePinchDistortionFilter.m; sourceTree = SOURCE_ROOT; }; BCA20B8B174708160097C84A /* GPUImageRGBClosingFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageRGBClosingFilter.h; path = Source/GPUImageRGBClosingFilter.h; sourceTree = SOURCE_ROOT; }; BCA20B8C174708160097C84A /* GPUImageRGBClosingFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageRGBClosingFilter.m; path = Source/GPUImageRGBClosingFilter.m; sourceTree = SOURCE_ROOT; }; BCA20B8D174708190097C84A /* GPUImageRGBDilationFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageRGBDilationFilter.h; path = Source/GPUImageRGBDilationFilter.h; sourceTree = SOURCE_ROOT; }; BCA20B8E174708190097C84A /* GPUImageRGBDilationFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageRGBDilationFilter.m; path = Source/GPUImageRGBDilationFilter.m; sourceTree = SOURCE_ROOT; }; BCA20B8F174708190097C84A /* GPUImageRGBErosionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageRGBErosionFilter.h; path = Source/GPUImageRGBErosionFilter.h; sourceTree = SOURCE_ROOT; }; BCA20B901747081A0097C84A /* GPUImageRGBErosionFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageRGBErosionFilter.m; path = Source/GPUImageRGBErosionFilter.m; sourceTree = SOURCE_ROOT; }; BCA20B911747081A0097C84A /* GPUImageRGBOpeningFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageRGBOpeningFilter.h; path = Source/GPUImageRGBOpeningFilter.h; sourceTree = SOURCE_ROOT; }; BCA20B921747081B0097C84A /* GPUImageRGBOpeningFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageRGBOpeningFilter.m; path = Source/GPUImageRGBOpeningFilter.m; sourceTree = SOURCE_ROOT; }; BCA20B931747081B0097C84A /* GPUImageSphereRefractionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageSphereRefractionFilter.h; path = Source/GPUImageSphereRefractionFilter.h; sourceTree = SOURCE_ROOT; }; BCA20B941747081B0097C84A /* GPUImageSphereRefractionFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageSphereRefractionFilter.m; path = Source/GPUImageSphereRefractionFilter.m; sourceTree = SOURCE_ROOT; }; BCA20B951747081C0097C84A /* GPUImageStretchDistortionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageStretchDistortionFilter.h; path = Source/GPUImageStretchDistortionFilter.h; sourceTree = SOURCE_ROOT; }; BCA20B961747081C0097C84A /* GPUImageStretchDistortionFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageStretchDistortionFilter.m; path = Source/GPUImageStretchDistortionFilter.m; sourceTree = SOURCE_ROOT; }; BCA20B971747081C0097C84A /* GPUImageSwirlFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageSwirlFilter.h; path = Source/GPUImageSwirlFilter.h; sourceTree = SOURCE_ROOT; }; BCA20B981747081D0097C84A /* GPUImageSwirlFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageSwirlFilter.m; path = Source/GPUImageSwirlFilter.m; sourceTree = SOURCE_ROOT; }; BCA20BB3174708610097C84A /* GPUImageOpeningFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageOpeningFilter.h; path = Source/GPUImageOpeningFilter.h; sourceTree = SOURCE_ROOT; }; BCA20BB4174708620097C84A /* GPUImageOpeningFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageOpeningFilter.m; path = Source/GPUImageOpeningFilter.m; sourceTree = SOURCE_ROOT; }; BCA20BB717471C3A0097C84A /* GPUImageJFAVoronoiFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageJFAVoronoiFilter.h; path = Source/GPUImageJFAVoronoiFilter.h; sourceTree = SOURCE_ROOT; }; BCA20BB817471C3C0097C84A /* GPUImageJFAVoronoiFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageJFAVoronoiFilter.m; path = Source/GPUImageJFAVoronoiFilter.m; sourceTree = SOURCE_ROOT; }; BCA20BB917471C3D0097C84A /* GPUImageLocalBinaryPatternFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageLocalBinaryPatternFilter.h; path = Source/GPUImageLocalBinaryPatternFilter.h; sourceTree = SOURCE_ROOT; }; BCA20BBA17471C3F0097C84A /* GPUImageLocalBinaryPatternFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageLocalBinaryPatternFilter.m; path = Source/GPUImageLocalBinaryPatternFilter.m; sourceTree = SOURCE_ROOT; }; BCA20BBB17471C400097C84A /* GPUImageMosaicFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageMosaicFilter.h; path = Source/GPUImageMosaicFilter.h; sourceTree = SOURCE_ROOT; }; BCA20BBC17471C420097C84A /* GPUImageMosaicFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageMosaicFilter.m; path = Source/GPUImageMosaicFilter.m; sourceTree = SOURCE_ROOT; }; BCA20BBD17471C440097C84A /* GPUImagePerlinNoiseFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImagePerlinNoiseFilter.h; path = Source/GPUImagePerlinNoiseFilter.h; sourceTree = SOURCE_ROOT; }; BCA20BBE17471C460097C84A /* GPUImagePerlinNoiseFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImagePerlinNoiseFilter.m; path = Source/GPUImagePerlinNoiseFilter.m; sourceTree = SOURCE_ROOT; }; BCA20BBF17471C480097C84A /* GPUImageVoronoiConsumerFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageVoronoiConsumerFilter.h; path = Source/GPUImageVoronoiConsumerFilter.h; sourceTree = SOURCE_ROOT; }; BCA20BC017471C490097C84A /* GPUImageVoronoiConsumerFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageVoronoiConsumerFilter.m; path = Source/GPUImageVoronoiConsumerFilter.m; sourceTree = SOURCE_ROOT; }; BCA3F31C17239B6500E28AEC /* GPUImage.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = GPUImage.framework; sourceTree = BUILT_PRODUCTS_DIR; }; BCA3F31F17239B6500E28AEC /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; BCA3F32217239B6500E28AEC /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; BCA3F32317239B6500E28AEC /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; BCA3F32417239B6500E28AEC /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; BCA3F32717239B6500E28AEC /* GPUImageMac-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; name = "GPUImageMac-Info.plist"; path = "Source/Mac/GPUImageMac-Info.plist"; sourceTree = ""; }; BCA3F32B17239B6500E28AEC /* GPUImageMac-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "GPUImageMac-Prefix.pch"; path = "Source/Mac/GPUImageMac-Prefix.pch"; sourceTree = ""; }; BCA3F3601723A8FA00E28AEC /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = System/Library/Frameworks/OpenGL.framework; sourceTree = SDKROOT; }; BCA3F3611723A8FA00E28AEC /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; BCA3F3641723A96600E28AEC /* GPUImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImage.h; path = Source/Mac/GPUImage.h; sourceTree = SOURCE_ROOT; }; BCAA73B51C18E09100BC2D31 /* GPUImageFourInputFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageFourInputFilter.h; path = Source/GPUImageFourInputFilter.h; sourceTree = SOURCE_ROOT; }; BCAA73B61C18E09100BC2D31 /* GPUImageFourInputFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageFourInputFilter.m; path = Source/GPUImageFourInputFilter.m; sourceTree = SOURCE_ROOT; }; BCAE41E21731C3000020F80D /* GPUImageThreeInputFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageThreeInputFilter.h; path = Source/GPUImageThreeInputFilter.h; sourceTree = SOURCE_ROOT; }; BCAE41E31731C3000020F80D /* GPUImageThreeInputFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageThreeInputFilter.m; path = Source/GPUImageThreeInputFilter.m; sourceTree = SOURCE_ROOT; }; BCB009E4172A1BBD00DB804C /* GPUImageGammaFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageGammaFilter.h; path = Source/GPUImageGammaFilter.h; sourceTree = SOURCE_ROOT; }; BCB009E5172A1BBD00DB804C /* GPUImageGammaFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageGammaFilter.m; path = Source/GPUImageGammaFilter.m; sourceTree = SOURCE_ROOT; }; BCB009E8172A1BE800DB804C /* GPUImageToneCurveFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageToneCurveFilter.h; path = Source/GPUImageToneCurveFilter.h; sourceTree = SOURCE_ROOT; }; BCB009E9172A1BE800DB804C /* GPUImageToneCurveFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageToneCurveFilter.m; path = Source/GPUImageToneCurveFilter.m; sourceTree = SOURCE_ROOT; }; BCB009EC172A23A900DB804C /* GPUImageHazeFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageHazeFilter.h; path = Source/GPUImageHazeFilter.h; sourceTree = SOURCE_ROOT; }; BCB009ED172A23A900DB804C /* GPUImageHazeFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageHazeFilter.m; path = Source/GPUImageHazeFilter.m; sourceTree = SOURCE_ROOT; }; BCB009EE172A23AA00DB804C /* GPUImageHighlightShadowFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageHighlightShadowFilter.h; path = Source/GPUImageHighlightShadowFilter.h; sourceTree = SOURCE_ROOT; }; BCB009EF172A23AA00DB804C /* GPUImageHighlightShadowFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageHighlightShadowFilter.m; path = Source/GPUImageHighlightShadowFilter.m; sourceTree = SOURCE_ROOT; }; BCB009F4172A243300DB804C /* GPUImageSepiaFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageSepiaFilter.h; path = Source/GPUImageSepiaFilter.h; sourceTree = SOURCE_ROOT; }; BCB009F5172A243400DB804C /* GPUImageSepiaFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageSepiaFilter.m; path = Source/GPUImageSepiaFilter.m; sourceTree = SOURCE_ROOT; }; BCB009F8172A246D00DB804C /* GPUImageColorMatrixFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageColorMatrixFilter.h; path = Source/GPUImageColorMatrixFilter.h; sourceTree = SOURCE_ROOT; }; BCB009F9172A246E00DB804C /* GPUImageColorMatrixFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageColorMatrixFilter.m; path = Source/GPUImageColorMatrixFilter.m; sourceTree = SOURCE_ROOT; }; BCBF692F173061D200E5792A /* GPUImage3x3ConvolutionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImage3x3ConvolutionFilter.h; path = Source/GPUImage3x3ConvolutionFilter.h; sourceTree = SOURCE_ROOT; }; BCBF6930173061D200E5792A /* GPUImage3x3ConvolutionFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImage3x3ConvolutionFilter.m; path = Source/GPUImage3x3ConvolutionFilter.m; sourceTree = SOURCE_ROOT; }; BCBF69331730623200E5792A /* GPUImageEmbossFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageEmbossFilter.h; path = Source/GPUImageEmbossFilter.h; sourceTree = SOURCE_ROOT; }; BCBF69341730623200E5792A /* GPUImageEmbossFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageEmbossFilter.m; path = Source/GPUImageEmbossFilter.m; sourceTree = SOURCE_ROOT; }; BCC0DF4017358315007C485F /* GPUImageColorInvertFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageColorInvertFilter.h; path = Source/GPUImageColorInvertFilter.h; sourceTree = SOURCE_ROOT; }; BCC0DF4117358315007C485F /* GPUImageColorInvertFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageColorInvertFilter.m; path = Source/GPUImageColorInvertFilter.m; sourceTree = SOURCE_ROOT; }; BCC0DF4417359529007C485F /* GPUImageHistogramFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageHistogramFilter.h; path = Source/GPUImageHistogramFilter.h; sourceTree = SOURCE_ROOT; }; BCC0DF4517359529007C485F /* GPUImageHistogramFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageHistogramFilter.m; path = Source/GPUImageHistogramFilter.m; sourceTree = SOURCE_ROOT; }; BCC0DF4617359529007C485F /* GPUImageHistogramGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageHistogramGenerator.h; path = Source/GPUImageHistogramGenerator.h; sourceTree = SOURCE_ROOT; }; BCC0DF4717359529007C485F /* GPUImageHistogramGenerator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageHistogramGenerator.m; path = Source/GPUImageHistogramGenerator.m; sourceTree = SOURCE_ROOT; }; BCC0DF4C173595D3007C485F /* GPUImageAverageColor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageAverageColor.h; path = Source/GPUImageAverageColor.h; sourceTree = SOURCE_ROOT; }; BCC0DF4D173595D3007C485F /* GPUImageAverageColor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageAverageColor.m; path = Source/GPUImageAverageColor.m; sourceTree = SOURCE_ROOT; }; BCC0DF4E173595D3007C485F /* GPUImageLuminosity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageLuminosity.h; path = Source/GPUImageLuminosity.h; sourceTree = SOURCE_ROOT; }; BCC0DF4F173595D3007C485F /* GPUImageLuminosity.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageLuminosity.m; path = Source/GPUImageLuminosity.m; sourceTree = SOURCE_ROOT; }; BCC0DF50173595D3007C485F /* GPUImageSolidColorGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageSolidColorGenerator.h; path = Source/GPUImageSolidColorGenerator.h; sourceTree = SOURCE_ROOT; }; BCC0DF51173595D3007C485F /* GPUImageSolidColorGenerator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageSolidColorGenerator.m; path = Source/GPUImageSolidColorGenerator.m; sourceTree = SOURCE_ROOT; }; BCC0DF58173596A8007C485F /* GPUImageAdaptiveThresholdFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageAdaptiveThresholdFilter.h; path = Source/GPUImageAdaptiveThresholdFilter.h; sourceTree = SOURCE_ROOT; }; BCC0DF59173596A8007C485F /* GPUImageAdaptiveThresholdFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageAdaptiveThresholdFilter.m; path = Source/GPUImageAdaptiveThresholdFilter.m; sourceTree = SOURCE_ROOT; }; BCC0DF5C173596B9007C485F /* GPUImageAverageLuminanceThresholdFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageAverageLuminanceThresholdFilter.h; path = Source/GPUImageAverageLuminanceThresholdFilter.h; sourceTree = SOURCE_ROOT; }; BCC0DF5D173596B9007C485F /* GPUImageAverageLuminanceThresholdFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageAverageLuminanceThresholdFilter.m; path = Source/GPUImageAverageLuminanceThresholdFilter.m; sourceTree = SOURCE_ROOT; }; BCC0DF6017359F42007C485F /* GPUImageLuminanceThresholdFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageLuminanceThresholdFilter.h; path = Source/GPUImageLuminanceThresholdFilter.h; sourceTree = SOURCE_ROOT; }; BCC0DF6117359F42007C485F /* GPUImageLuminanceThresholdFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageLuminanceThresholdFilter.m; path = Source/GPUImageLuminanceThresholdFilter.m; sourceTree = SOURCE_ROOT; }; BCD8EB8818D6AFC5005ED83C /* GPUImageFramebuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageFramebuffer.h; path = Source/GPUImageFramebuffer.h; sourceTree = SOURCE_ROOT; }; BCD8EB8918D6AFC5005ED83C /* GPUImageFramebuffer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageFramebuffer.m; path = Source/GPUImageFramebuffer.m; sourceTree = SOURCE_ROOT; }; BCD8EB8A18D6AFC5005ED83C /* GPUImageFramebufferCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageFramebufferCache.h; path = Source/GPUImageFramebufferCache.h; sourceTree = SOURCE_ROOT; }; BCD8EB8B18D6AFC5005ED83C /* GPUImageFramebufferCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageFramebufferCache.m; path = Source/GPUImageFramebufferCache.m; sourceTree = SOURCE_ROOT; }; BCE2EF8217459D5B00C0628C /* GPUImageHarrisCornerDetectionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageHarrisCornerDetectionFilter.h; path = Source/GPUImageHarrisCornerDetectionFilter.h; sourceTree = SOURCE_ROOT; }; BCE2EF8317459D5B00C0628C /* GPUImageHarrisCornerDetectionFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageHarrisCornerDetectionFilter.m; path = Source/GPUImageHarrisCornerDetectionFilter.m; sourceTree = SOURCE_ROOT; }; BCE2EF8417459D5B00C0628C /* GPUImageNobleCornerDetectionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageNobleCornerDetectionFilter.h; path = Source/GPUImageNobleCornerDetectionFilter.h; sourceTree = SOURCE_ROOT; }; BCE2EF8517459D5B00C0628C /* GPUImageNobleCornerDetectionFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageNobleCornerDetectionFilter.m; path = Source/GPUImageNobleCornerDetectionFilter.m; sourceTree = SOURCE_ROOT; }; BCE2EF8617459D5B00C0628C /* GPUImageShiTomasiFeatureDetectionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageShiTomasiFeatureDetectionFilter.h; path = Source/GPUImageShiTomasiFeatureDetectionFilter.h; sourceTree = SOURCE_ROOT; }; BCE2EF8717459D5B00C0628C /* GPUImageShiTomasiFeatureDetectionFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageShiTomasiFeatureDetectionFilter.m; path = Source/GPUImageShiTomasiFeatureDetectionFilter.m; sourceTree = SOURCE_ROOT; }; BCE2EF8E17459D9300C0628C /* GPUImageColorPackingFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageColorPackingFilter.h; path = Source/GPUImageColorPackingFilter.h; sourceTree = SOURCE_ROOT; }; BCE2EF8F17459D9300C0628C /* GPUImageColorPackingFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageColorPackingFilter.m; path = Source/GPUImageColorPackingFilter.m; sourceTree = SOURCE_ROOT; }; BCE2EF9017459D9300C0628C /* GPUImageThresholdedNonMaximumSuppressionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageThresholdedNonMaximumSuppressionFilter.h; path = Source/GPUImageThresholdedNonMaximumSuppressionFilter.h; sourceTree = SOURCE_ROOT; }; BCE2EF9117459D9300C0628C /* GPUImageThresholdedNonMaximumSuppressionFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageThresholdedNonMaximumSuppressionFilter.m; path = Source/GPUImageThresholdedNonMaximumSuppressionFilter.m; sourceTree = SOURCE_ROOT; }; BCE2EF9617459E2400C0628C /* GPUImageHoughTransformLineDetector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageHoughTransformLineDetector.h; path = Source/GPUImageHoughTransformLineDetector.h; sourceTree = SOURCE_ROOT; }; BCE2EF9717459E2400C0628C /* GPUImageHoughTransformLineDetector.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageHoughTransformLineDetector.m; path = Source/GPUImageHoughTransformLineDetector.m; sourceTree = SOURCE_ROOT; }; BCE2EF9A17459E5100C0628C /* GPUImageParallelCoordinateLineTransformFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageParallelCoordinateLineTransformFilter.h; path = Source/GPUImageParallelCoordinateLineTransformFilter.h; sourceTree = SOURCE_ROOT; }; BCE2EF9B17459E5100C0628C /* GPUImageParallelCoordinateLineTransformFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageParallelCoordinateLineTransformFilter.m; path = Source/GPUImageParallelCoordinateLineTransformFilter.m; sourceTree = SOURCE_ROOT; }; BCE817A01735FDC60071D084 /* GPUImageHalftoneFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageHalftoneFilter.h; path = Source/GPUImageHalftoneFilter.h; sourceTree = SOURCE_ROOT; }; BCE817A11735FDC60071D084 /* GPUImageHalftoneFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageHalftoneFilter.m; path = Source/GPUImageHalftoneFilter.m; sourceTree = SOURCE_ROOT; }; BCE817A21735FDC60071D084 /* GPUImagePixellatePositionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImagePixellatePositionFilter.h; path = Source/GPUImagePixellatePositionFilter.h; sourceTree = SOURCE_ROOT; }; BCE817A31735FDC60071D084 /* GPUImagePixellatePositionFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImagePixellatePositionFilter.m; path = Source/GPUImagePixellatePositionFilter.m; sourceTree = SOURCE_ROOT; }; BCE817A41735FDC70071D084 /* GPUImagePolarPixellateFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImagePolarPixellateFilter.h; path = Source/GPUImagePolarPixellateFilter.h; sourceTree = SOURCE_ROOT; }; BCE817A51735FDC70071D084 /* GPUImagePolarPixellateFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImagePolarPixellateFilter.m; path = Source/GPUImagePolarPixellateFilter.m; sourceTree = SOURCE_ROOT; }; BCE817A61735FDC70071D084 /* GPUImagePolkaDotFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImagePolkaDotFilter.h; path = Source/GPUImagePolkaDotFilter.h; sourceTree = SOURCE_ROOT; }; BCE817A71735FDC70071D084 /* GPUImagePolkaDotFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImagePolkaDotFilter.m; path = Source/GPUImagePolkaDotFilter.m; sourceTree = SOURCE_ROOT; }; BCE817B01735FE150071D084 /* GPUImageCrosshatchFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageCrosshatchFilter.h; path = Source/GPUImageCrosshatchFilter.h; sourceTree = SOURCE_ROOT; }; BCE817B11735FE150071D084 /* GPUImageCrosshatchFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageCrosshatchFilter.m; path = Source/GPUImageCrosshatchFilter.m; sourceTree = SOURCE_ROOT; }; BCE817B4173608690071D084 /* GPUImageCannyEdgeDetectionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageCannyEdgeDetectionFilter.h; path = Source/GPUImageCannyEdgeDetectionFilter.h; sourceTree = SOURCE_ROOT; }; BCE817B5173608690071D084 /* GPUImageCannyEdgeDetectionFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageCannyEdgeDetectionFilter.m; path = Source/GPUImageCannyEdgeDetectionFilter.m; sourceTree = SOURCE_ROOT; }; BCE817B6173608690071D084 /* GPUImagePrewittEdgeDetectionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImagePrewittEdgeDetectionFilter.h; path = Source/GPUImagePrewittEdgeDetectionFilter.h; sourceTree = SOURCE_ROOT; }; BCE817B7173608690071D084 /* GPUImagePrewittEdgeDetectionFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImagePrewittEdgeDetectionFilter.m; path = Source/GPUImagePrewittEdgeDetectionFilter.m; sourceTree = SOURCE_ROOT; }; BCE817B8173608690071D084 /* GPUImageThresholdEdgeDetectionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageThresholdEdgeDetectionFilter.h; path = Source/GPUImageThresholdEdgeDetectionFilter.h; sourceTree = SOURCE_ROOT; }; BCE817B9173608690071D084 /* GPUImageThresholdEdgeDetectionFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageThresholdEdgeDetectionFilter.m; path = Source/GPUImageThresholdEdgeDetectionFilter.m; sourceTree = SOURCE_ROOT; }; BCE817C01736092A0071D084 /* GPUImageXYDerivativeFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageXYDerivativeFilter.h; path = Source/GPUImageXYDerivativeFilter.h; sourceTree = SOURCE_ROOT; }; BCE817C11736092A0071D084 /* GPUImageXYDerivativeFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageXYDerivativeFilter.m; path = Source/GPUImageXYDerivativeFilter.m; sourceTree = SOURCE_ROOT; }; BCE817C817360BFD0071D084 /* GPUImageDirectionalNonMaximumSuppressionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageDirectionalNonMaximumSuppressionFilter.h; path = Source/GPUImageDirectionalNonMaximumSuppressionFilter.h; sourceTree = SOURCE_ROOT; }; BCE817C917360BFD0071D084 /* GPUImageDirectionalNonMaximumSuppressionFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageDirectionalNonMaximumSuppressionFilter.m; path = Source/GPUImageDirectionalNonMaximumSuppressionFilter.m; sourceTree = SOURCE_ROOT; }; BCE817CA17360BFD0071D084 /* GPUImageDirectionalSobelEdgeDetectionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageDirectionalSobelEdgeDetectionFilter.h; path = Source/GPUImageDirectionalSobelEdgeDetectionFilter.h; sourceTree = SOURCE_ROOT; }; BCE817CB17360BFD0071D084 /* GPUImageDirectionalSobelEdgeDetectionFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageDirectionalSobelEdgeDetectionFilter.m; path = Source/GPUImageDirectionalSobelEdgeDetectionFilter.m; sourceTree = SOURCE_ROOT; }; BCE817D017360C6A0071D084 /* GPUImageWeakPixelInclusionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageWeakPixelInclusionFilter.h; path = Source/GPUImageWeakPixelInclusionFilter.h; sourceTree = SOURCE_ROOT; }; BCE817D117360C6A0071D084 /* GPUImageWeakPixelInclusionFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageWeakPixelInclusionFilter.m; path = Source/GPUImageWeakPixelInclusionFilter.m; sourceTree = SOURCE_ROOT; }; BCF40F1017247D68005AE36A /* GPUImageContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageContext.h; path = Source/Mac/GPUImageContext.h; sourceTree = SOURCE_ROOT; }; BCF40F1117247D68005AE36A /* GPUImageContext.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageContext.m; path = Source/Mac/GPUImageContext.m; sourceTree = SOURCE_ROOT; }; BCF40F1417247FD8005AE36A /* GLProgram.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GLProgram.h; path = Source/GLProgram.h; sourceTree = SOURCE_ROOT; }; BCF40F1517247FD8005AE36A /* GLProgram.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GLProgram.m; path = Source/GLProgram.m; sourceTree = SOURCE_ROOT; }; BCF40F191724829B005AE36A /* GPUImageOutput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageOutput.h; path = Source/GPUImageOutput.h; sourceTree = SOURCE_ROOT; }; BCF40F1A1724829B005AE36A /* GPUImageOutput.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageOutput.m; path = Source/GPUImageOutput.m; sourceTree = SOURCE_ROOT; }; BCF40F1E17248322005AE36A /* GPUImageFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageFilter.h; path = Source/GPUImageFilter.h; sourceTree = SOURCE_ROOT; }; BCF40F1F17248322005AE36A /* GPUImageFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageFilter.m; path = Source/GPUImageFilter.m; sourceTree = SOURCE_ROOT; }; BCF40F2317248836005AE36A /* GPUImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageView.h; path = Source/Mac/GPUImageView.h; sourceTree = SOURCE_ROOT; }; BCF40F2417248836005AE36A /* GPUImageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageView.m; path = Source/Mac/GPUImageView.m; sourceTree = SOURCE_ROOT; }; BCF40F27172488D3005AE36A /* GPUImageBrightnessFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageBrightnessFilter.h; path = Source/GPUImageBrightnessFilter.h; sourceTree = SOURCE_ROOT; }; BCF40F28172488D3005AE36A /* GPUImageBrightnessFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageBrightnessFilter.m; path = Source/GPUImageBrightnessFilter.m; sourceTree = SOURCE_ROOT; }; BCF867521725AF9300912E34 /* GPUImageMovieWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageMovieWriter.h; path = Source/Mac/GPUImageMovieWriter.h; sourceTree = SOURCE_ROOT; }; BCF867531725AF9300912E34 /* GPUImageMovieWriter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageMovieWriter.m; path = Source/Mac/GPUImageMovieWriter.m; sourceTree = SOURCE_ROOT; }; BCF867541725AF9300912E34 /* GPUImagePicture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImagePicture.h; path = Source/Mac/GPUImagePicture.h; sourceTree = SOURCE_ROOT; }; BCF867551725AF9300912E34 /* GPUImagePicture.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImagePicture.m; path = Source/Mac/GPUImagePicture.m; sourceTree = SOURCE_ROOT; }; BCF8675A1725BBE300912E34 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; BCF8675C1725BBE900912E34 /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; }; BCF8679B1727585D00912E34 /* GPUImageAVCamera.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageAVCamera.h; path = Source/Mac/GPUImageAVCamera.h; sourceTree = SOURCE_ROOT; }; BCF8679C1727585D00912E34 /* GPUImageAVCamera.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageAVCamera.m; path = Source/Mac/GPUImageAVCamera.m; sourceTree = SOURCE_ROOT; }; BCF867A3172778D500912E34 /* GPUImageContrastFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageContrastFilter.h; path = Source/GPUImageContrastFilter.h; sourceTree = SOURCE_ROOT; }; BCF867A4172778D500912E34 /* GPUImageContrastFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageContrastFilter.m; path = Source/GPUImageContrastFilter.m; sourceTree = SOURCE_ROOT; }; BCF867A5172778D500912E34 /* GPUImageExposureFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageExposureFilter.h; path = Source/GPUImageExposureFilter.h; sourceTree = SOURCE_ROOT; }; BCF867A6172778D500912E34 /* GPUImageExposureFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageExposureFilter.m; path = Source/GPUImageExposureFilter.m; sourceTree = SOURCE_ROOT; }; BCF867A7172778D500912E34 /* GPUImageHueFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageHueFilter.h; path = Source/GPUImageHueFilter.h; sourceTree = SOURCE_ROOT; }; BCF867A8172778D500912E34 /* GPUImageHueFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageHueFilter.m; path = Source/GPUImageHueFilter.m; sourceTree = SOURCE_ROOT; }; BCF867A9172778D500912E34 /* GPUImageSaturationFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageSaturationFilter.h; path = Source/GPUImageSaturationFilter.h; sourceTree = SOURCE_ROOT; }; BCF867AA172778D500912E34 /* GPUImageSaturationFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageSaturationFilter.m; path = Source/GPUImageSaturationFilter.m; sourceTree = SOURCE_ROOT; }; BCF867AB172778D500912E34 /* GPUImageWhiteBalanceFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageWhiteBalanceFilter.h; path = Source/GPUImageWhiteBalanceFilter.h; sourceTree = SOURCE_ROOT; }; BCF867AC172778D500912E34 /* GPUImageWhiteBalanceFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageWhiteBalanceFilter.m; path = Source/GPUImageWhiteBalanceFilter.m; sourceTree = SOURCE_ROOT; }; BCF867B71727791200912E34 /* GPUImageLevelsFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageLevelsFilter.h; path = Source/GPUImageLevelsFilter.h; sourceTree = SOURCE_ROOT; }; BCF867B81727791200912E34 /* GPUImageLevelsFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageLevelsFilter.m; path = Source/GPUImageLevelsFilter.m; sourceTree = SOURCE_ROOT; }; BCF867BB1727794000912E34 /* GPUImageMonochromeFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageMonochromeFilter.h; path = Source/GPUImageMonochromeFilter.h; sourceTree = SOURCE_ROOT; }; BCF867BC1727794000912E34 /* GPUImageMonochromeFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageMonochromeFilter.m; path = Source/GPUImageMonochromeFilter.m; sourceTree = SOURCE_ROOT; }; BCF867BD1727794000912E34 /* GPUImageRGBFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageRGBFilter.h; path = Source/GPUImageRGBFilter.h; sourceTree = SOURCE_ROOT; }; BCF867BE1727794000912E34 /* GPUImageRGBFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageRGBFilter.m; path = Source/GPUImageRGBFilter.m; sourceTree = SOURCE_ROOT; }; BCF867C51727872D00912E34 /* GPUImagePixellateFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImagePixellateFilter.h; path = Source/GPUImagePixellateFilter.h; sourceTree = SOURCE_ROOT; }; BCF867C61727872D00912E34 /* GPUImagePixellateFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImagePixellateFilter.m; path = Source/GPUImagePixellateFilter.m; sourceTree = SOURCE_ROOT; }; BCF867C9172788F100912E34 /* GPUImage3x3TextureSamplingFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImage3x3TextureSamplingFilter.h; path = Source/GPUImage3x3TextureSamplingFilter.h; sourceTree = SOURCE_ROOT; }; BCF867CA172788F100912E34 /* GPUImage3x3TextureSamplingFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImage3x3TextureSamplingFilter.m; path = Source/GPUImage3x3TextureSamplingFilter.m; sourceTree = SOURCE_ROOT; }; BCF867CD172789B200912E34 /* GPUImageSketchFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageSketchFilter.h; path = Source/GPUImageSketchFilter.h; sourceTree = SOURCE_ROOT; }; BCF867CE172789B200912E34 /* GPUImageSketchFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageSketchFilter.m; path = Source/GPUImageSketchFilter.m; sourceTree = SOURCE_ROOT; }; BCF867D217278A5600912E34 /* GPUImageSobelEdgeDetectionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageSobelEdgeDetectionFilter.h; path = Source/GPUImageSobelEdgeDetectionFilter.h; sourceTree = SOURCE_ROOT; }; BCF867D317278A5600912E34 /* GPUImageSobelEdgeDetectionFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageSobelEdgeDetectionFilter.m; path = Source/GPUImageSobelEdgeDetectionFilter.m; sourceTree = SOURCE_ROOT; }; BCF867D617278A7900912E34 /* GPUImageToonFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageToonFilter.h; path = Source/GPUImageToonFilter.h; sourceTree = SOURCE_ROOT; }; BCF867D717278A7900912E34 /* GPUImageToonFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageToonFilter.m; path = Source/GPUImageToonFilter.m; sourceTree = SOURCE_ROOT; }; BCF867DA17278C5800912E34 /* GPUImageTwoPassFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageTwoPassFilter.h; path = Source/GPUImageTwoPassFilter.h; sourceTree = SOURCE_ROOT; }; BCF867DB17278C5900912E34 /* GPUImageTwoPassFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageTwoPassFilter.m; path = Source/GPUImageTwoPassFilter.m; sourceTree = SOURCE_ROOT; }; BCF867DE17278D1900912E34 /* GPUImageGrayscaleFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageGrayscaleFilter.h; path = Source/GPUImageGrayscaleFilter.h; sourceTree = SOURCE_ROOT; }; BCF867DF17278D1900912E34 /* GPUImageGrayscaleFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageGrayscaleFilter.m; path = Source/GPUImageGrayscaleFilter.m; sourceTree = SOURCE_ROOT; }; BCF867E21727903C00912E34 /* GPUImageKuwaharaFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageKuwaharaFilter.h; path = Source/GPUImageKuwaharaFilter.h; sourceTree = SOURCE_ROOT; }; BCF867E31727903D00912E34 /* GPUImageKuwaharaFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageKuwaharaFilter.m; path = Source/GPUImageKuwaharaFilter.m; sourceTree = SOURCE_ROOT; }; BCF867E61728477200912E34 /* GPUImageFalseColorFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageFalseColorFilter.h; path = Source/GPUImageFalseColorFilter.h; sourceTree = SOURCE_ROOT; }; BCF867E71728477200912E34 /* GPUImageFalseColorFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageFalseColorFilter.m; path = Source/GPUImageFalseColorFilter.m; sourceTree = SOURCE_ROOT; }; BCF867EA172847A000912E34 /* GPUImageSharpenFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageSharpenFilter.h; path = Source/GPUImageSharpenFilter.h; sourceTree = SOURCE_ROOT; }; BCF867EB172847A000912E34 /* GPUImageSharpenFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageSharpenFilter.m; path = Source/GPUImageSharpenFilter.m; sourceTree = SOURCE_ROOT; }; BCF867EE1728487000912E34 /* GPUImageUnsharpMaskFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageUnsharpMaskFilter.h; path = Source/GPUImageUnsharpMaskFilter.h; sourceTree = SOURCE_ROOT; }; BCF867EF1728487000912E34 /* GPUImageUnsharpMaskFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageUnsharpMaskFilter.m; path = Source/GPUImageUnsharpMaskFilter.m; sourceTree = SOURCE_ROOT; }; BCF867F21728490300912E34 /* GPUImageTwoInputFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageTwoInputFilter.h; path = Source/GPUImageTwoInputFilter.h; sourceTree = SOURCE_ROOT; }; BCF867F31728490500912E34 /* GPUImageTwoInputFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageTwoInputFilter.m; path = Source/GPUImageTwoInputFilter.m; sourceTree = SOURCE_ROOT; }; BCF867F61728494B00912E34 /* GPUImageGaussianBlurFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageGaussianBlurFilter.h; path = Source/GPUImageGaussianBlurFilter.h; sourceTree = SOURCE_ROOT; }; BCF867F71728494B00912E34 /* GPUImageGaussianBlurFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageGaussianBlurFilter.m; path = Source/GPUImageGaussianBlurFilter.m; sourceTree = SOURCE_ROOT; }; BCF867FA1728496A00912E34 /* GPUImageTwoPassTextureSamplingFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageTwoPassTextureSamplingFilter.h; path = Source/GPUImageTwoPassTextureSamplingFilter.h; sourceTree = SOURCE_ROOT; }; BCF867FB1728496C00912E34 /* GPUImageTwoPassTextureSamplingFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageTwoPassTextureSamplingFilter.m; path = Source/GPUImageTwoPassTextureSamplingFilter.m; sourceTree = SOURCE_ROOT; }; BCF867FE17284C3C00912E34 /* GPUImageFilterGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageFilterGroup.h; path = Source/GPUImageFilterGroup.h; sourceTree = SOURCE_ROOT; }; BCF867FF17284C3E00912E34 /* GPUImageFilterGroup.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageFilterGroup.m; path = Source/GPUImageFilterGroup.m; sourceTree = SOURCE_ROOT; }; BCF8680217284CFB00912E34 /* GPUImageTransformFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageTransformFilter.h; path = Source/GPUImageTransformFilter.h; sourceTree = SOURCE_ROOT; }; BCF8680317284CFB00912E34 /* GPUImageTransformFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageTransformFilter.m; path = Source/GPUImageTransformFilter.m; sourceTree = SOURCE_ROOT; }; BCF8680617284D0A00912E34 /* GPUImageCropFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageCropFilter.h; path = Source/GPUImageCropFilter.h; sourceTree = SOURCE_ROOT; }; BCF8680717284D0A00912E34 /* GPUImageCropFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageCropFilter.m; path = Source/GPUImageCropFilter.m; sourceTree = SOURCE_ROOT; }; BCF8680C172853A500912E34 /* GPUImageGaussianBlurPositionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageGaussianBlurPositionFilter.h; path = Source/GPUImageGaussianBlurPositionFilter.h; sourceTree = SOURCE_ROOT; }; BCF8680D172853A600912E34 /* GPUImageGaussianBlurPositionFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageGaussianBlurPositionFilter.m; path = Source/GPUImageGaussianBlurPositionFilter.m; sourceTree = SOURCE_ROOT; }; BCF8680E172853A700912E34 /* GPUImageGaussianSelectiveBlurFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageGaussianSelectiveBlurFilter.h; path = Source/GPUImageGaussianSelectiveBlurFilter.h; sourceTree = SOURCE_ROOT; }; BCF8680F172853A800912E34 /* GPUImageGaussianSelectiveBlurFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageGaussianSelectiveBlurFilter.m; path = Source/GPUImageGaussianSelectiveBlurFilter.m; sourceTree = SOURCE_ROOT; }; BCF86814172854AA00912E34 /* GPUImageBilateralFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageBilateralFilter.h; path = Source/GPUImageBilateralFilter.h; sourceTree = SOURCE_ROOT; }; BCF86815172854AC00912E34 /* GPUImageBilateralFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageBilateralFilter.m; path = Source/GPUImageBilateralFilter.m; sourceTree = SOURCE_ROOT; }; BCF86816172854AE00912E34 /* GPUImageBoxBlurFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageBoxBlurFilter.h; path = Source/GPUImageBoxBlurFilter.h; sourceTree = SOURCE_ROOT; }; BCF86817172854B100912E34 /* GPUImageBoxBlurFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageBoxBlurFilter.m; path = Source/GPUImageBoxBlurFilter.m; sourceTree = SOURCE_ROOT; }; BCF8681A172854B600912E34 /* GPUImageMedianFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageMedianFilter.h; path = Source/GPUImageMedianFilter.h; sourceTree = SOURCE_ROOT; }; BCF8681B172854B800912E34 /* GPUImageMedianFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageMedianFilter.m; path = Source/GPUImageMedianFilter.m; sourceTree = SOURCE_ROOT; }; BCF86824172857AD00912E34 /* GPUImageMotionBlurFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageMotionBlurFilter.h; path = Source/GPUImageMotionBlurFilter.h; sourceTree = SOURCE_ROOT; }; BCF86825172857B000912E34 /* GPUImageMotionBlurFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageMotionBlurFilter.m; path = Source/GPUImageMotionBlurFilter.m; sourceTree = SOURCE_ROOT; }; BCF86826172857B200912E34 /* GPUImageZoomBlurFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageZoomBlurFilter.h; path = Source/GPUImageZoomBlurFilter.h; sourceTree = SOURCE_ROOT; }; BCF86827172857B600912E34 /* GPUImageZoomBlurFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageZoomBlurFilter.m; path = Source/GPUImageZoomBlurFilter.m; sourceTree = SOURCE_ROOT; }; BCF8682D17286EDB00912E34 /* GPUImageAddBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageAddBlendFilter.h; path = Source/GPUImageAddBlendFilter.h; sourceTree = SOURCE_ROOT; }; BCF8682E17286EDB00912E34 /* GPUImageAddBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageAddBlendFilter.m; path = Source/GPUImageAddBlendFilter.m; sourceTree = SOURCE_ROOT; }; BCF8683317286F2800912E34 /* GPUImageColorBurnBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageColorBurnBlendFilter.h; path = Source/GPUImageColorBurnBlendFilter.h; sourceTree = SOURCE_ROOT; }; BCF8683417286F2800912E34 /* GPUImageColorBurnBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageColorBurnBlendFilter.m; path = Source/GPUImageColorBurnBlendFilter.m; sourceTree = SOURCE_ROOT; }; BCF8683517286F2800912E34 /* GPUImageDarkenBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageDarkenBlendFilter.h; path = Source/GPUImageDarkenBlendFilter.h; sourceTree = SOURCE_ROOT; }; BCF8683617286F2800912E34 /* GPUImageDarkenBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageDarkenBlendFilter.m; path = Source/GPUImageDarkenBlendFilter.m; sourceTree = SOURCE_ROOT; }; BCF8683717286F2800912E34 /* GPUImageDivideBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageDivideBlendFilter.h; path = Source/GPUImageDivideBlendFilter.h; sourceTree = SOURCE_ROOT; }; BCF8683817286F2800912E34 /* GPUImageDivideBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageDivideBlendFilter.m; path = Source/GPUImageDivideBlendFilter.m; sourceTree = SOURCE_ROOT; }; BCF8683917286F2800912E34 /* GPUImageLightenBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageLightenBlendFilter.h; path = Source/GPUImageLightenBlendFilter.h; sourceTree = SOURCE_ROOT; }; BCF8683A17286F2800912E34 /* GPUImageLightenBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageLightenBlendFilter.m; path = Source/GPUImageLightenBlendFilter.m; sourceTree = SOURCE_ROOT; }; BCF8683B17286F2800912E34 /* GPUImageMultiplyBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageMultiplyBlendFilter.h; path = Source/GPUImageMultiplyBlendFilter.h; sourceTree = SOURCE_ROOT; }; BCF8683C17286F2800912E34 /* GPUImageMultiplyBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageMultiplyBlendFilter.m; path = Source/GPUImageMultiplyBlendFilter.m; sourceTree = SOURCE_ROOT; }; BCF8683D17286F2800912E34 /* GPUImageOverlayBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageOverlayBlendFilter.h; path = Source/GPUImageOverlayBlendFilter.h; sourceTree = SOURCE_ROOT; }; BCF8683E17286F2800912E34 /* GPUImageOverlayBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageOverlayBlendFilter.m; path = Source/GPUImageOverlayBlendFilter.m; sourceTree = SOURCE_ROOT; }; BCF8684B1728715800912E34 /* GPUImageColorDodgeBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageColorDodgeBlendFilter.h; path = Source/GPUImageColorDodgeBlendFilter.h; sourceTree = SOURCE_ROOT; }; BCF8684C1728715900912E34 /* GPUImageColorDodgeBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageColorDodgeBlendFilter.m; path = Source/GPUImageColorDodgeBlendFilter.m; sourceTree = SOURCE_ROOT; }; BCF8684D1728715C00912E34 /* GPUImageDifferenceBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageDifferenceBlendFilter.h; path = Source/GPUImageDifferenceBlendFilter.h; sourceTree = SOURCE_ROOT; }; BCF8684E1728715D00912E34 /* GPUImageDifferenceBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageDifferenceBlendFilter.m; path = Source/GPUImageDifferenceBlendFilter.m; sourceTree = SOURCE_ROOT; }; BCF8684F1728715F00912E34 /* GPUImageLinearBurnBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageLinearBurnBlendFilter.h; path = Source/GPUImageLinearBurnBlendFilter.h; sourceTree = SOURCE_ROOT; }; BCF868501728716000912E34 /* GPUImageLinearBurnBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageLinearBurnBlendFilter.m; path = Source/GPUImageLinearBurnBlendFilter.m; sourceTree = SOURCE_ROOT; }; BCF868511728716200912E34 /* GPUImageScreenBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageScreenBlendFilter.h; path = Source/GPUImageScreenBlendFilter.h; sourceTree = SOURCE_ROOT; }; BCF868521728716300912E34 /* GPUImageScreenBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageScreenBlendFilter.m; path = Source/GPUImageScreenBlendFilter.m; sourceTree = SOURCE_ROOT; }; BCF8685B172871EE00912E34 /* GPUImageColorBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageColorBlendFilter.h; path = Source/GPUImageColorBlendFilter.h; sourceTree = SOURCE_ROOT; }; BCF8685C172871F000912E34 /* GPUImageColorBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageColorBlendFilter.m; path = Source/GPUImageColorBlendFilter.m; sourceTree = SOURCE_ROOT; }; BCF8685D172871F300912E34 /* GPUImageExclusionBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageExclusionBlendFilter.h; path = Source/GPUImageExclusionBlendFilter.h; sourceTree = SOURCE_ROOT; }; BCF8685E172871F500912E34 /* GPUImageExclusionBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageExclusionBlendFilter.m; path = Source/GPUImageExclusionBlendFilter.m; sourceTree = SOURCE_ROOT; }; BCF8685F172871F800912E34 /* GPUImageHardLightBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageHardLightBlendFilter.h; path = Source/GPUImageHardLightBlendFilter.h; sourceTree = SOURCE_ROOT; }; BCF86860172871FB00912E34 /* GPUImageHardLightBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageHardLightBlendFilter.m; path = Source/GPUImageHardLightBlendFilter.m; sourceTree = SOURCE_ROOT; }; BCF86861172871FC00912E34 /* GPUImageHueBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageHueBlendFilter.h; path = Source/GPUImageHueBlendFilter.h; sourceTree = SOURCE_ROOT; }; BCF86862172871FD00912E34 /* GPUImageHueBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageHueBlendFilter.m; path = Source/GPUImageHueBlendFilter.m; sourceTree = SOURCE_ROOT; }; BCF86863172871FF00912E34 /* GPUImageLuminosityBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageLuminosityBlendFilter.h; path = Source/GPUImageLuminosityBlendFilter.h; sourceTree = SOURCE_ROOT; }; BCF868641728720100912E34 /* GPUImageLuminosityBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageLuminosityBlendFilter.m; path = Source/GPUImageLuminosityBlendFilter.m; sourceTree = SOURCE_ROOT; }; BCF868651728720200912E34 /* GPUImageNormalBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageNormalBlendFilter.h; path = Source/GPUImageNormalBlendFilter.h; sourceTree = SOURCE_ROOT; }; BCF868661728720400912E34 /* GPUImageNormalBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageNormalBlendFilter.m; path = Source/GPUImageNormalBlendFilter.m; sourceTree = SOURCE_ROOT; }; BCF868671728720600912E34 /* GPUImagePoissonBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImagePoissonBlendFilter.h; path = Source/GPUImagePoissonBlendFilter.h; sourceTree = SOURCE_ROOT; }; BCF868681728720700912E34 /* GPUImagePoissonBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImagePoissonBlendFilter.m; path = Source/GPUImagePoissonBlendFilter.m; sourceTree = SOURCE_ROOT; }; BCF868691728720900912E34 /* GPUImageSaturationBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageSaturationBlendFilter.h; path = Source/GPUImageSaturationBlendFilter.h; sourceTree = SOURCE_ROOT; }; BCF8686A1728720B00912E34 /* GPUImageSaturationBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageSaturationBlendFilter.m; path = Source/GPUImageSaturationBlendFilter.m; sourceTree = SOURCE_ROOT; }; BCF8686B1728720C00912E34 /* GPUImageSoftLightBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageSoftLightBlendFilter.h; path = Source/GPUImageSoftLightBlendFilter.h; sourceTree = SOURCE_ROOT; }; BCF8686C1728720E00912E34 /* GPUImageSoftLightBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageSoftLightBlendFilter.m; path = Source/GPUImageSoftLightBlendFilter.m; sourceTree = SOURCE_ROOT; }; BCF8686D1728720F00912E34 /* GPUImageSubtractBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageSubtractBlendFilter.h; path = Source/GPUImageSubtractBlendFilter.h; sourceTree = SOURCE_ROOT; }; BCF8686E1728721100912E34 /* GPUImageSubtractBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageSubtractBlendFilter.m; path = Source/GPUImageSubtractBlendFilter.m; sourceTree = SOURCE_ROOT; }; BCF868831728771D00912E34 /* GPUImageTwoInputCrossTextureSamplingFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageTwoInputCrossTextureSamplingFilter.h; path = Source/GPUImageTwoInputCrossTextureSamplingFilter.h; sourceTree = SOURCE_ROOT; }; BCF868841728772600912E34 /* GPUImageTwoInputCrossTextureSamplingFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageTwoInputCrossTextureSamplingFilter.m; path = Source/GPUImageTwoInputCrossTextureSamplingFilter.m; sourceTree = SOURCE_ROOT; }; BCF8688B17287EB500912E34 /* GPUImageChromaKeyBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageChromaKeyBlendFilter.h; path = Source/GPUImageChromaKeyBlendFilter.h; sourceTree = SOURCE_ROOT; }; BCF8688C17287EBB00912E34 /* GPUImageChromaKeyBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageChromaKeyBlendFilter.m; path = Source/GPUImageChromaKeyBlendFilter.m; sourceTree = SOURCE_ROOT; }; BCF8688D17287EC400912E34 /* GPUImageDissolveBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageDissolveBlendFilter.h; path = Source/GPUImageDissolveBlendFilter.h; sourceTree = SOURCE_ROOT; }; BCF8688E17287ECC00912E34 /* GPUImageDissolveBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageDissolveBlendFilter.m; path = Source/GPUImageDissolveBlendFilter.m; sourceTree = SOURCE_ROOT; }; BCF86893172880AB00912E34 /* GPUImageSourceOverBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageSourceOverBlendFilter.h; path = Source/GPUImageSourceOverBlendFilter.h; sourceTree = SOURCE_ROOT; }; BCF86894172880B100912E34 /* GPUImageSourceOverBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageSourceOverBlendFilter.m; path = Source/GPUImageSourceOverBlendFilter.m; sourceTree = SOURCE_ROOT; }; BCF868971728839800912E34 /* GPUImageMaskFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageMaskFilter.h; path = Source/GPUImageMaskFilter.h; sourceTree = SOURCE_ROOT; }; BCF868981728839C00912E34 /* GPUImageMaskFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageMaskFilter.m; path = Source/GPUImageMaskFilter.m; sourceTree = SOURCE_ROOT; }; BCF8689B1728861E00912E34 /* GPUImageOpacityFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageOpacityFilter.h; path = Source/GPUImageOpacityFilter.h; sourceTree = SOURCE_ROOT; }; BCF8689C1728861F00912E34 /* GPUImageOpacityFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageOpacityFilter.m; path = Source/GPUImageOpacityFilter.m; sourceTree = SOURCE_ROOT; }; BCF8689F1728865500912E34 /* GPUImageAlphaBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageAlphaBlendFilter.h; path = Source/GPUImageAlphaBlendFilter.h; sourceTree = SOURCE_ROOT; }; BCF868A01728865D00912E34 /* GPUImageAlphaBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageAlphaBlendFilter.m; path = Source/GPUImageAlphaBlendFilter.m; sourceTree = SOURCE_ROOT; }; BCFC5F5F1C18BDBA00C7F43B /* GPUImageColorLocalBinaryPatternFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageColorLocalBinaryPatternFilter.h; path = Source/GPUImageColorLocalBinaryPatternFilter.h; sourceTree = SOURCE_ROOT; }; BCFC5F601C18BDBA00C7F43B /* GPUImageColorLocalBinaryPatternFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageColorLocalBinaryPatternFilter.m; path = Source/GPUImageColorLocalBinaryPatternFilter.m; sourceTree = SOURCE_ROOT; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ BCA3F31817239B6500E28AEC /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( BCF8675D1725BBE900912E34 /* CoreMedia.framework in Frameworks */, BCF8675B1725BBE300912E34 /* AVFoundation.framework in Frameworks */, BCA3F3621723A8FA00E28AEC /* OpenGL.framework in Frameworks */, BCA3F3631723A8FA00E28AEC /* QuartzCore.framework in Frameworks */, BCA3F32017239B6500E28AEC /* Cocoa.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ BCA3F31217239B6500E28AEC = { isa = PBXGroup; children = ( BCA3F32517239B6500E28AEC /* GPUImageMac */, BCA3F31E17239B6500E28AEC /* Frameworks */, BCA3F31D17239B6500E28AEC /* Products */, ); sourceTree = ""; }; BCA3F31D17239B6500E28AEC /* Products */ = { isa = PBXGroup; children = ( BCA3F31C17239B6500E28AEC /* GPUImage.framework */, ); name = Products; sourceTree = ""; }; BCA3F31E17239B6500E28AEC /* Frameworks */ = { isa = PBXGroup; children = ( BCA3F31F17239B6500E28AEC /* Cocoa.framework */, BCA3F3601723A8FA00E28AEC /* OpenGL.framework */, BCA3F3611723A8FA00E28AEC /* QuartzCore.framework */, BCF8675C1725BBE900912E34 /* CoreMedia.framework */, BCF8675A1725BBE300912E34 /* AVFoundation.framework */, BCA3F32117239B6500E28AEC /* Other Frameworks */, ); name = Frameworks; sourceTree = ""; }; BCA3F32117239B6500E28AEC /* Other Frameworks */ = { isa = PBXGroup; children = ( BCA3F32217239B6500E28AEC /* AppKit.framework */, BCA3F32317239B6500E28AEC /* CoreData.framework */, BCA3F32417239B6500E28AEC /* Foundation.framework */, ); name = "Other Frameworks"; sourceTree = ""; }; BCA3F32517239B6500E28AEC /* GPUImageMac */ = { isa = PBXGroup; children = ( BCA3F3641723A96600E28AEC /* GPUImage.h */, BCF40F1417247FD8005AE36A /* GLProgram.h */, BCF40F1517247FD8005AE36A /* GLProgram.m */, BCF40F1017247D68005AE36A /* GPUImageContext.h */, BCF40F1117247D68005AE36A /* GPUImageContext.m */, BCD8EB8818D6AFC5005ED83C /* GPUImageFramebuffer.h */, BCD8EB8918D6AFC5005ED83C /* GPUImageFramebuffer.m */, BCD8EB8A18D6AFC5005ED83C /* GPUImageFramebufferCache.h */, BCD8EB8B18D6AFC5005ED83C /* GPUImageFramebufferCache.m */, BCF40F1817248286005AE36A /* Sources */, BCF40F1D17248308005AE36A /* Filters */, BCF40F2217248811005AE36A /* Outputs */, BCA3F32617239B6500E28AEC /* Supporting Files */, ); path = GPUImageMac; sourceTree = ""; }; BCA3F32617239B6500E28AEC /* Supporting Files */ = { isa = PBXGroup; children = ( BCA3F32717239B6500E28AEC /* GPUImageMac-Info.plist */, BCA3F32B17239B6500E28AEC /* GPUImageMac-Prefix.pch */, ); name = "Supporting Files"; sourceTree = ""; }; BCF40F1817248286005AE36A /* Sources */ = { isa = PBXGroup; children = ( 574B5D8F1BEA3E7900F4EC5A /* GPUImageColorConversion.h */, 574B5D901BEA3E7900F4EC5A /* GPUImageColorConversion.m */, 574B5D841BE9346800F4EC5A /* GPUImageMovie.h */, 574B5D851BE9346800F4EC5A /* GPUImageMovie.m */, A87E5E1417764B16007FD5B1 /* GPUImageRawDataInput.h */, A87E5E1517764B16007FD5B1 /* GPUImageRawDataInput.m */, BCF40F191724829B005AE36A /* GPUImageOutput.h */, BCF40F1A1724829B005AE36A /* GPUImageOutput.m */, BCF8679B1727585D00912E34 /* GPUImageAVCamera.h */, BCF8679C1727585D00912E34 /* GPUImageAVCamera.m */, BCF867541725AF9300912E34 /* GPUImagePicture.h */, BCF867551725AF9300912E34 /* GPUImagePicture.m */, A50607191C78BF8E0095D0BB /* GPUImageTextureInput.h */, A506071A1C78BF8E0095D0BB /* GPUImageTextureInput.m */, ); name = Sources; sourceTree = ""; }; BCF40F1D17248308005AE36A /* Filters */ = { isa = PBXGroup; children = ( BCF40F1E17248322005AE36A /* GPUImageFilter.h */, BCF40F1F17248322005AE36A /* GPUImageFilter.m */, BCF867FE17284C3C00912E34 /* GPUImageFilterGroup.h */, BCF867FF17284C3E00912E34 /* GPUImageFilterGroup.m */, BCF867DA17278C5800912E34 /* GPUImageTwoPassFilter.h */, BCF867DB17278C5900912E34 /* GPUImageTwoPassFilter.m */, BCF867FA1728496A00912E34 /* GPUImageTwoPassTextureSamplingFilter.h */, BCF867FB1728496C00912E34 /* GPUImageTwoPassTextureSamplingFilter.m */, BCF868831728771D00912E34 /* GPUImageTwoInputCrossTextureSamplingFilter.h */, BCF868841728772600912E34 /* GPUImageTwoInputCrossTextureSamplingFilter.m */, BCF867F21728490300912E34 /* GPUImageTwoInputFilter.h */, BCF867F31728490500912E34 /* GPUImageTwoInputFilter.m */, BCAE41E21731C3000020F80D /* GPUImageThreeInputFilter.h */, BCAE41E31731C3000020F80D /* GPUImageThreeInputFilter.m */, BCAA73B51C18E09100BC2D31 /* GPUImageFourInputFilter.h */, BCAA73B61C18E09100BC2D31 /* GPUImageFourInputFilter.m */, BCF867C9172788F100912E34 /* GPUImage3x3TextureSamplingFilter.h */, BCF867CA172788F100912E34 /* GPUImage3x3TextureSamplingFilter.m */, BCF867C31727820100912E34 /* Color processing */, BCF867D1172789C800912E34 /* Image processing */, BCF867C4172786BA00912E34 /* Effects */, BCF8682C17286E5F00912E34 /* Blends */, ); name = Filters; sourceTree = ""; }; BCF40F2217248811005AE36A /* Outputs */ = { isa = PBXGroup; children = ( A87E5E10177648F3007FD5B1 /* GPUImageRawDataOutput.h */, A87E5E11177648F3007FD5B1 /* GPUImageRawDataOutput.m */, BCF40F2317248836005AE36A /* GPUImageView.h */, BCF40F2417248836005AE36A /* GPUImageView.m */, BCF867521725AF9300912E34 /* GPUImageMovieWriter.h */, BCF867531725AF9300912E34 /* GPUImageMovieWriter.m */, A50607151C78BF7C0095D0BB /* GPUImageTextureOutput.h */, A50607161C78BF7C0095D0BB /* GPUImageTextureOutput.m */, ); name = Outputs; sourceTree = ""; }; BCF867C31727820100912E34 /* Color processing */ = { isa = PBXGroup; children = ( BCF867A9172778D500912E34 /* GPUImageSaturationFilter.h */, BCF867AA172778D500912E34 /* GPUImageSaturationFilter.m */, BCF867A3172778D500912E34 /* GPUImageContrastFilter.h */, BCF867A4172778D500912E34 /* GPUImageContrastFilter.m */, BCF40F27172488D3005AE36A /* GPUImageBrightnessFilter.h */, BCF40F28172488D3005AE36A /* GPUImageBrightnessFilter.m */, BCF867B71727791200912E34 /* GPUImageLevelsFilter.h */, BCF867B81727791200912E34 /* GPUImageLevelsFilter.m */, BCF867A5172778D500912E34 /* GPUImageExposureFilter.h */, BCF867A6172778D500912E34 /* GPUImageExposureFilter.m */, BCF867BD1727794000912E34 /* GPUImageRGBFilter.h */, BCF867BE1727794000912E34 /* GPUImageRGBFilter.m */, BCF867A7172778D500912E34 /* GPUImageHueFilter.h */, BCF867A8172778D500912E34 /* GPUImageHueFilter.m */, BCF867AB172778D500912E34 /* GPUImageWhiteBalanceFilter.h */, BCF867AC172778D500912E34 /* GPUImageWhiteBalanceFilter.m */, BCF867BB1727794000912E34 /* GPUImageMonochromeFilter.h */, BCF867BC1727794000912E34 /* GPUImageMonochromeFilter.m */, BCF867DE17278D1900912E34 /* GPUImageGrayscaleFilter.h */, BCF867DF17278D1900912E34 /* GPUImageGrayscaleFilter.m */, BCF867E61728477200912E34 /* GPUImageFalseColorFilter.h */, BCF867E71728477200912E34 /* GPUImageFalseColorFilter.m */, BCB009E4172A1BBD00DB804C /* GPUImageGammaFilter.h */, BCB009E5172A1BBD00DB804C /* GPUImageGammaFilter.m */, BCB009E8172A1BE800DB804C /* GPUImageToneCurveFilter.h */, BCB009E9172A1BE800DB804C /* GPUImageToneCurveFilter.m */, BCB009EE172A23AA00DB804C /* GPUImageHighlightShadowFilter.h */, BCB009EF172A23AA00DB804C /* GPUImageHighlightShadowFilter.m */, BCB009EC172A23A900DB804C /* GPUImageHazeFilter.h */, BCB009ED172A23A900DB804C /* GPUImageHazeFilter.m */, BCB009F8172A246D00DB804C /* GPUImageColorMatrixFilter.h */, BCB009F9172A246E00DB804C /* GPUImageColorMatrixFilter.m */, BCB009F4172A243300DB804C /* GPUImageSepiaFilter.h */, BCB009F5172A243400DB804C /* GPUImageSepiaFilter.m */, BC78B708172DCCB800342C6A /* GPUImageLookupFilter.h */, BC78B709172DCCB800342C6A /* GPUImageLookupFilter.m */, BC78B706172DCCB800342C6A /* GPUImageAmatorkaFilter.h */, BC78B707172DCCB800342C6A /* GPUImageAmatorkaFilter.m */, BC78B70A172DCCB800342C6A /* GPUImageMissEtikateFilter.h */, BC78B70B172DCCB800342C6A /* GPUImageMissEtikateFilter.m */, BC78B70C172DCCB800342C6A /* GPUImageSoftEleganceFilter.h */, BC78B70D172DCCB800342C6A /* GPUImageSoftEleganceFilter.m */, BCC0DF4017358315007C485F /* GPUImageColorInvertFilter.h */, BCC0DF4117358315007C485F /* GPUImageColorInvertFilter.m */, BCC0DF4417359529007C485F /* GPUImageHistogramFilter.h */, BCC0DF4517359529007C485F /* GPUImageHistogramFilter.m */, BCC0DF4617359529007C485F /* GPUImageHistogramGenerator.h */, BCC0DF4717359529007C485F /* GPUImageHistogramGenerator.m */, A4741D5819A92098005EE1A4 /* GPUImageHistogramEqualizationFilter.h */, A4741D5919A92098005EE1A4 /* GPUImageHistogramEqualizationFilter.m */, BCC0DF4C173595D3007C485F /* GPUImageAverageColor.h */, BCC0DF4D173595D3007C485F /* GPUImageAverageColor.m */, BCC0DF4E173595D3007C485F /* GPUImageLuminosity.h */, BCC0DF4F173595D3007C485F /* GPUImageLuminosity.m */, BCC0DF50173595D3007C485F /* GPUImageSolidColorGenerator.h */, BCC0DF51173595D3007C485F /* GPUImageSolidColorGenerator.m */, BCC0DF58173596A8007C485F /* GPUImageAdaptiveThresholdFilter.h */, BCC0DF59173596A8007C485F /* GPUImageAdaptiveThresholdFilter.m */, BCC0DF6017359F42007C485F /* GPUImageLuminanceThresholdFilter.h */, BCC0DF6117359F42007C485F /* GPUImageLuminanceThresholdFilter.m */, BCC0DF5C173596B9007C485F /* GPUImageAverageLuminanceThresholdFilter.h */, BCC0DF5D173596B9007C485F /* GPUImageAverageLuminanceThresholdFilter.m */, 79840B811C8B29240079A83B /* GPUImageSolarizeFilter.h */, 79840B821C8B29240079A83B /* GPUImageSolarizeFilter.m */, BCE817A01735FDC60071D084 /* GPUImageHalftoneFilter.h */, BCE817A11735FDC60071D084 /* GPUImageHalftoneFilter.m */, BCE817A21735FDC60071D084 /* GPUImagePixellatePositionFilter.h */, BCE817A31735FDC60071D084 /* GPUImagePixellatePositionFilter.m */, BCE817A41735FDC70071D084 /* GPUImagePolarPixellateFilter.h */, BCE817A51735FDC70071D084 /* GPUImagePolarPixellateFilter.m */, BCE817A61735FDC70071D084 /* GPUImagePolkaDotFilter.h */, BCE817A71735FDC70071D084 /* GPUImagePolkaDotFilter.m */, BCE817B01735FE150071D084 /* GPUImageCrosshatchFilter.h */, BCE817B11735FE150071D084 /* GPUImageCrosshatchFilter.m */, BCF8689B1728861E00912E34 /* GPUImageOpacityFilter.h */, BCF8689C1728861F00912E34 /* GPUImageOpacityFilter.m */, BCA20B6B1746D44A0097C84A /* GPUImageCGAColorspaceFilter.h */, BCA20B6C1746D44A0097C84A /* GPUImageCGAColorspaceFilter.m */, ); name = "Color processing"; sourceTree = ""; }; BCF867C4172786BA00912E34 /* Effects */ = { isa = PBXGroup; children = ( BCF867C51727872D00912E34 /* GPUImagePixellateFilter.h */, BCF867C61727872D00912E34 /* GPUImagePixellateFilter.m */, BCF867CD172789B200912E34 /* GPUImageSketchFilter.h */, BCF867CE172789B200912E34 /* GPUImageSketchFilter.m */, BCA20B5F1746CFE60097C84A /* GPUImageThresholdSketchFilter.h */, BCA20B601746CFE60097C84A /* GPUImageThresholdSketchFilter.m */, BCF867D617278A7900912E34 /* GPUImageToonFilter.h */, BCF867D717278A7900912E34 /* GPUImageToonFilter.m */, BCA20B631746D3C30097C84A /* GPUImageSmoothToonFilter.h */, BCA20B641746D3C30097C84A /* GPUImageSmoothToonFilter.m */, BCA20B671746D3DC0097C84A /* GPUImageTiltShiftFilter.h */, BCA20B681746D3DC0097C84A /* GPUImageTiltShiftFilter.m */, BCBF69331730623200E5792A /* GPUImageEmbossFilter.h */, BCBF69341730623200E5792A /* GPUImageEmbossFilter.m */, BCA20B771746DEDD0097C84A /* GPUImageChromaKeyFilter.h */, BCA20B781746DEDE0097C84A /* GPUImageChromaKeyFilter.m */, BCF867E21727903C00912E34 /* GPUImageKuwaharaFilter.h */, BCF867E31727903D00912E34 /* GPUImageKuwaharaFilter.m */, BCA20B731746DE850097C84A /* GPUImageKuwaharaRadius3Filter.h */, BCA20B741746DE850097C84A /* GPUImageKuwaharaRadius3Filter.m */, BCA20B6F1746D4AC0097C84A /* GPUImagePosterizeFilter.h */, BCA20B701746D4AC0097C84A /* GPUImagePosterizeFilter.m */, BCA20B7B1746DF200097C84A /* GPUImageVignetteFilter.h */, BCA20B7C1746DF200097C84A /* GPUImageVignetteFilter.m */, BCA20B971747081C0097C84A /* GPUImageSwirlFilter.h */, BCA20B981747081D0097C84A /* GPUImageSwirlFilter.m */, BCA20B7F1747080E0097C84A /* GPUImageBulgeDistortionFilter.h */, BCA20B801747080F0097C84A /* GPUImageBulgeDistortionFilter.m */, BCA20B89174708150097C84A /* GPUImagePinchDistortionFilter.h */, BCA20B8A174708150097C84A /* GPUImagePinchDistortionFilter.m */, BCA20B951747081C0097C84A /* GPUImageStretchDistortionFilter.h */, BCA20B961747081C0097C84A /* GPUImageStretchDistortionFilter.m */, BCA20B811747080F0097C84A /* GPUImageClosingFilter.h */, BCA20B82174708100097C84A /* GPUImageClosingFilter.m */, BCA20B8B174708160097C84A /* GPUImageRGBClosingFilter.h */, BCA20B8C174708160097C84A /* GPUImageRGBClosingFilter.m */, BCA20B83174708110097C84A /* GPUImageDilationFilter.h */, BCA20B84174708120097C84A /* GPUImageDilationFilter.m */, BCA20B8D174708190097C84A /* GPUImageRGBDilationFilter.h */, BCA20B8E174708190097C84A /* GPUImageRGBDilationFilter.m */, BCA20B85174708120097C84A /* GPUImageErosionFilter.h */, BCA20B86174708130097C84A /* GPUImageErosionFilter.m */, BCA20B8F174708190097C84A /* GPUImageRGBErosionFilter.h */, BCA20B901747081A0097C84A /* GPUImageRGBErosionFilter.m */, BCA20BB3174708610097C84A /* GPUImageOpeningFilter.h */, BCA20BB4174708620097C84A /* GPUImageOpeningFilter.m */, BCA20B911747081A0097C84A /* GPUImageRGBOpeningFilter.h */, BCA20B921747081B0097C84A /* GPUImageRGBOpeningFilter.m */, BCA20B931747081B0097C84A /* GPUImageSphereRefractionFilter.h */, BCA20B941747081B0097C84A /* GPUImageSphereRefractionFilter.m */, BCA20B87174708140097C84A /* GPUImageGlassSphereFilter.h */, BCA20B88174708150097C84A /* GPUImageGlassSphereFilter.m */, BCA20BBB17471C400097C84A /* GPUImageMosaicFilter.h */, BCA20BBC17471C420097C84A /* GPUImageMosaicFilter.m */, BCA20BBD17471C440097C84A /* GPUImagePerlinNoiseFilter.h */, BCA20BBE17471C460097C84A /* GPUImagePerlinNoiseFilter.m */, BCA20BB717471C3A0097C84A /* GPUImageJFAVoronoiFilter.h */, BCA20BB817471C3C0097C84A /* GPUImageJFAVoronoiFilter.m */, BCA20BBF17471C480097C84A /* GPUImageVoronoiConsumerFilter.h */, BCA20BC017471C490097C84A /* GPUImageVoronoiConsumerFilter.m */, ); name = Effects; sourceTree = ""; }; BCF867D1172789C800912E34 /* Image processing */ = { isa = PBXGroup; children = ( BCF8680217284CFB00912E34 /* GPUImageTransformFilter.h */, BCF8680317284CFB00912E34 /* GPUImageTransformFilter.m */, BCF8680617284D0A00912E34 /* GPUImageCropFilter.h */, BCF8680717284D0A00912E34 /* GPUImageCropFilter.m */, BCBF692F173061D200E5792A /* GPUImage3x3ConvolutionFilter.h */, BCBF6930173061D200E5792A /* GPUImage3x3ConvolutionFilter.m */, BC6C553A1730636600EB222D /* GPUImageLaplacianFilter.h */, BC6C553B1730636600EB222D /* GPUImageLaplacianFilter.m */, BCF867D217278A5600912E34 /* GPUImageSobelEdgeDetectionFilter.h */, BCF867D317278A5600912E34 /* GPUImageSobelEdgeDetectionFilter.m */, BCE817B6173608690071D084 /* GPUImagePrewittEdgeDetectionFilter.h */, BCE817B7173608690071D084 /* GPUImagePrewittEdgeDetectionFilter.m */, BCE817B4173608690071D084 /* GPUImageCannyEdgeDetectionFilter.h */, BCE817B5173608690071D084 /* GPUImageCannyEdgeDetectionFilter.m */, BCE817D017360C6A0071D084 /* GPUImageWeakPixelInclusionFilter.h */, BCE817D117360C6A0071D084 /* GPUImageWeakPixelInclusionFilter.m */, BCE817C817360BFD0071D084 /* GPUImageDirectionalNonMaximumSuppressionFilter.h */, BCE817C917360BFD0071D084 /* GPUImageDirectionalNonMaximumSuppressionFilter.m */, BCE817CA17360BFD0071D084 /* GPUImageDirectionalSobelEdgeDetectionFilter.h */, BCE817CB17360BFD0071D084 /* GPUImageDirectionalSobelEdgeDetectionFilter.m */, BCE817B8173608690071D084 /* GPUImageThresholdEdgeDetectionFilter.h */, BCE817B9173608690071D084 /* GPUImageThresholdEdgeDetectionFilter.m */, BCE817C01736092A0071D084 /* GPUImageXYDerivativeFilter.h */, BCE817C11736092A0071D084 /* GPUImageXYDerivativeFilter.m */, BCE2EF8217459D5B00C0628C /* GPUImageHarrisCornerDetectionFilter.h */, BCE2EF8317459D5B00C0628C /* GPUImageHarrisCornerDetectionFilter.m */, BCE2EF8417459D5B00C0628C /* GPUImageNobleCornerDetectionFilter.h */, BCE2EF8517459D5B00C0628C /* GPUImageNobleCornerDetectionFilter.m */, BCE2EF8617459D5B00C0628C /* GPUImageShiTomasiFeatureDetectionFilter.h */, BCE2EF8717459D5B00C0628C /* GPUImageShiTomasiFeatureDetectionFilter.m */, BC569576174683620081491B /* GPUImageCrosshairGenerator.h */, BC569577174683620081491B /* GPUImageCrosshairGenerator.m */, BCE2EF8E17459D9300C0628C /* GPUImageColorPackingFilter.h */, BCE2EF8F17459D9300C0628C /* GPUImageColorPackingFilter.m */, BC96A4EF176563C300F215A2 /* GPUImageNonMaximumSuppressionFilter.h */, BC96A4F0176563C300F215A2 /* GPUImageNonMaximumSuppressionFilter.m */, BCE2EF9017459D9300C0628C /* GPUImageThresholdedNonMaximumSuppressionFilter.h */, BCE2EF9117459D9300C0628C /* GPUImageThresholdedNonMaximumSuppressionFilter.m */, BCE2EF9617459E2400C0628C /* GPUImageHoughTransformLineDetector.h */, BCE2EF9717459E2400C0628C /* GPUImageHoughTransformLineDetector.m */, BC569578174683620081491B /* GPUImageLineGenerator.h */, BC569579174683620081491B /* GPUImageLineGenerator.m */, BCE2EF9A17459E5100C0628C /* GPUImageParallelCoordinateLineTransformFilter.h */, BCE2EF9B17459E5100C0628C /* GPUImageParallelCoordinateLineTransformFilter.m */, BCA20B4F1746C9EC0097C84A /* GPUImageBuffer.h */, BCA20B501746C9EC0097C84A /* GPUImageBuffer.m */, BCA20B511746C9EC0097C84A /* GPUImageHighPassFilter.h */, BCA20B521746C9EC0097C84A /* GPUImageHighPassFilter.m */, BCA20B531746C9EC0097C84A /* GPUImageLowPassFilter.h */, BCA20B541746C9EC0097C84A /* GPUImageLowPassFilter.m */, BCA20B551746C9EC0097C84A /* GPUImageMotionDetector.h */, BCA20B561746C9EC0097C84A /* GPUImageMotionDetector.m */, BCF86816172854AE00912E34 /* GPUImageBoxBlurFilter.h */, BCF86817172854B100912E34 /* GPUImageBoxBlurFilter.m */, BCF867F61728494B00912E34 /* GPUImageGaussianBlurFilter.h */, BCF867F71728494B00912E34 /* GPUImageGaussianBlurFilter.m */, BC8A583018124ABD00E6B507 /* GPUImageSingleComponentGaussianBlurFilter.h */, BC8A583118124ABD00E6B507 /* GPUImageSingleComponentGaussianBlurFilter.m */, BCF8680E172853A700912E34 /* GPUImageGaussianSelectiveBlurFilter.h */, BCF8680F172853A800912E34 /* GPUImageGaussianSelectiveBlurFilter.m */, BCF8680C172853A500912E34 /* GPUImageGaussianBlurPositionFilter.h */, BCF8680D172853A600912E34 /* GPUImageGaussianBlurPositionFilter.m */, BCF8681A172854B600912E34 /* GPUImageMedianFilter.h */, BCF8681B172854B800912E34 /* GPUImageMedianFilter.m */, BCF86814172854AA00912E34 /* GPUImageBilateralFilter.h */, BCF86815172854AC00912E34 /* GPUImageBilateralFilter.m */, BCF867EA172847A000912E34 /* GPUImageSharpenFilter.h */, BCF867EB172847A000912E34 /* GPUImageSharpenFilter.m */, BCF867EE1728487000912E34 /* GPUImageUnsharpMaskFilter.h */, BCF867EF1728487000912E34 /* GPUImageUnsharpMaskFilter.m */, BCF86824172857AD00912E34 /* GPUImageMotionBlurFilter.h */, BCF86825172857B000912E34 /* GPUImageMotionBlurFilter.m */, BCF86826172857B200912E34 /* GPUImageZoomBlurFilter.h */, BCF86827172857B600912E34 /* GPUImageZoomBlurFilter.m */, BC6C55441730BDCF00EB222D /* GPUImageLanczosResamplingFilter.h */, BC6C55451730BDCF00EB222D /* GPUImageLanczosResamplingFilter.m */, BCA20BB917471C3D0097C84A /* GPUImageLocalBinaryPatternFilter.h */, BCA20BBA17471C3F0097C84A /* GPUImageLocalBinaryPatternFilter.m */, BCFC5F5F1C18BDBA00C7F43B /* GPUImageColorLocalBinaryPatternFilter.h */, BCFC5F601C18BDBA00C7F43B /* GPUImageColorLocalBinaryPatternFilter.m */, BC4DFD011C10D2FD0095A016 /* GPUImageColourFASTFeatureDetector.h */, BC4DFD021C10D2FD0095A016 /* GPUImageColourFASTFeatureDetector.m */, BC4DFD051C10D4860095A016 /* GPUImageColourFASTSamplingOperation.h */, BC4DFD061C10D4860095A016 /* GPUImageColourFASTSamplingOperation.m */, ); name = "Image processing"; sourceTree = ""; }; BCF8682C17286E5F00912E34 /* Blends */ = { isa = PBXGroup; children = ( BCF868971728839800912E34 /* GPUImageMaskFilter.h */, BCF868981728839C00912E34 /* GPUImageMaskFilter.m */, BCF8688D17287EC400912E34 /* GPUImageDissolveBlendFilter.h */, BCF8688E17287ECC00912E34 /* GPUImageDissolveBlendFilter.m */, BCF8688B17287EB500912E34 /* GPUImageChromaKeyBlendFilter.h */, BCF8688C17287EBB00912E34 /* GPUImageChromaKeyBlendFilter.m */, BCF8682D17286EDB00912E34 /* GPUImageAddBlendFilter.h */, BCF8682E17286EDB00912E34 /* GPUImageAddBlendFilter.m */, BCF8683717286F2800912E34 /* GPUImageDivideBlendFilter.h */, BCF8683817286F2800912E34 /* GPUImageDivideBlendFilter.m */, BCF8683B17286F2800912E34 /* GPUImageMultiplyBlendFilter.h */, BCF8683C17286F2800912E34 /* GPUImageMultiplyBlendFilter.m */, BCF8683D17286F2800912E34 /* GPUImageOverlayBlendFilter.h */, BCF8683E17286F2800912E34 /* GPUImageOverlayBlendFilter.m */, BCF8683917286F2800912E34 /* GPUImageLightenBlendFilter.h */, BCF8683A17286F2800912E34 /* GPUImageLightenBlendFilter.m */, BCF8683517286F2800912E34 /* GPUImageDarkenBlendFilter.h */, BCF8683617286F2800912E34 /* GPUImageDarkenBlendFilter.m */, BCF8683317286F2800912E34 /* GPUImageColorBurnBlendFilter.h */, BCF8683417286F2800912E34 /* GPUImageColorBurnBlendFilter.m */, BCF8684B1728715800912E34 /* GPUImageColorDodgeBlendFilter.h */, BCF8684C1728715900912E34 /* GPUImageColorDodgeBlendFilter.m */, BCF8684F1728715F00912E34 /* GPUImageLinearBurnBlendFilter.h */, BCF868501728716000912E34 /* GPUImageLinearBurnBlendFilter.m */, BCF868511728716200912E34 /* GPUImageScreenBlendFilter.h */, BCF868521728716300912E34 /* GPUImageScreenBlendFilter.m */, BCF8684D1728715C00912E34 /* GPUImageDifferenceBlendFilter.h */, BCF8684E1728715D00912E34 /* GPUImageDifferenceBlendFilter.m */, BCF8686D1728720F00912E34 /* GPUImageSubtractBlendFilter.h */, BCF8686E1728721100912E34 /* GPUImageSubtractBlendFilter.m */, BCF8685D172871F300912E34 /* GPUImageExclusionBlendFilter.h */, BCF8685E172871F500912E34 /* GPUImageExclusionBlendFilter.m */, BCF8685F172871F800912E34 /* GPUImageHardLightBlendFilter.h */, BCF86860172871FB00912E34 /* GPUImageHardLightBlendFilter.m */, BCF8686B1728720C00912E34 /* GPUImageSoftLightBlendFilter.h */, BCF8686C1728720E00912E34 /* GPUImageSoftLightBlendFilter.m */, BCF8685B172871EE00912E34 /* GPUImageColorBlendFilter.h */, BCF8685C172871F000912E34 /* GPUImageColorBlendFilter.m */, BCF86861172871FC00912E34 /* GPUImageHueBlendFilter.h */, BCF86862172871FD00912E34 /* GPUImageHueBlendFilter.m */, BCF868691728720900912E34 /* GPUImageSaturationBlendFilter.h */, BCF8686A1728720B00912E34 /* GPUImageSaturationBlendFilter.m */, BCF86863172871FF00912E34 /* GPUImageLuminosityBlendFilter.h */, BCF868641728720100912E34 /* GPUImageLuminosityBlendFilter.m */, BCF868651728720200912E34 /* GPUImageNormalBlendFilter.h */, BCF868661728720400912E34 /* GPUImageNormalBlendFilter.m */, BCF868671728720600912E34 /* GPUImagePoissonBlendFilter.h */, BCF868681728720700912E34 /* GPUImagePoissonBlendFilter.m */, BCF86893172880AB00912E34 /* GPUImageSourceOverBlendFilter.h */, BCF86894172880B100912E34 /* GPUImageSourceOverBlendFilter.m */, BCF8689F1728865500912E34 /* GPUImageAlphaBlendFilter.h */, BCF868A01728865D00912E34 /* GPUImageAlphaBlendFilter.m */, ); name = Blends; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ BCA3F31917239B6500E28AEC /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( BCA3F3651723A96600E28AEC /* GPUImage.h in Headers */, A87E5E1617764B16007FD5B1 /* GPUImageRawDataInput.h in Headers */, A87E5E12177648F3007FD5B1 /* GPUImageRawDataOutput.h in Headers */, BCF40F1217247D68005AE36A /* GPUImageContext.h in Headers */, BCF40F1617247FD8005AE36A /* GLProgram.h in Headers */, BCFC5F611C18BDBA00C7F43B /* GPUImageColorLocalBinaryPatternFilter.h in Headers */, BCF40F1B1724829B005AE36A /* GPUImageOutput.h in Headers */, BCF40F2017248322005AE36A /* GPUImageFilter.h in Headers */, BCF40F2517248836005AE36A /* GPUImageView.h in Headers */, BCF867561725AF9300912E34 /* GPUImageMovieWriter.h in Headers */, BCF867581725AF9300912E34 /* GPUImagePicture.h in Headers */, BCF8679D1727585D00912E34 /* GPUImageAVCamera.h in Headers */, BCF40F29172488D3005AE36A /* GPUImageBrightnessFilter.h in Headers */, BCF867AD172778D500912E34 /* GPUImageContrastFilter.h in Headers */, BCF867AF172778D500912E34 /* GPUImageExposureFilter.h in Headers */, BCF867B1172778D500912E34 /* GPUImageHueFilter.h in Headers */, BCF867B3172778D500912E34 /* GPUImageSaturationFilter.h in Headers */, BCF867B5172778D500912E34 /* GPUImageWhiteBalanceFilter.h in Headers */, BCAA73B71C18E09100BC2D31 /* GPUImageFourInputFilter.h in Headers */, BCF867B91727791200912E34 /* GPUImageLevelsFilter.h in Headers */, BCF867BF1727794000912E34 /* GPUImageMonochromeFilter.h in Headers */, BCF867C11727794000912E34 /* GPUImageRGBFilter.h in Headers */, BCF867C71727872D00912E34 /* GPUImagePixellateFilter.h in Headers */, BCF867CB172788F100912E34 /* GPUImage3x3TextureSamplingFilter.h in Headers */, BCF867CF172789B200912E34 /* GPUImageSketchFilter.h in Headers */, BCF867D417278A5600912E34 /* GPUImageSobelEdgeDetectionFilter.h in Headers */, BCF867D817278A7A00912E34 /* GPUImageToonFilter.h in Headers */, BCF867DC17278C5A00912E34 /* GPUImageTwoPassFilter.h in Headers */, BCF867E017278D1900912E34 /* GPUImageGrayscaleFilter.h in Headers */, BCF867E41727903D00912E34 /* GPUImageKuwaharaFilter.h in Headers */, BCF867E81728477300912E34 /* GPUImageFalseColorFilter.h in Headers */, BCF867EC172847A000912E34 /* GPUImageSharpenFilter.h in Headers */, BCF867F01728487100912E34 /* GPUImageUnsharpMaskFilter.h in Headers */, BCF867F41728490600912E34 /* GPUImageTwoInputFilter.h in Headers */, BCF867F81728494C00912E34 /* GPUImageGaussianBlurFilter.h in Headers */, BCF867FC1728496E00912E34 /* GPUImageTwoPassTextureSamplingFilter.h in Headers */, BCF8680017284C4000912E34 /* GPUImageFilterGroup.h in Headers */, BCF8680417284CFC00912E34 /* GPUImageTransformFilter.h in Headers */, BCF8680817284D0B00912E34 /* GPUImageCropFilter.h in Headers */, BCF86810172853AA00912E34 /* GPUImageGaussianBlurPositionFilter.h in Headers */, BCF86812172853AA00912E34 /* GPUImageGaussianSelectiveBlurFilter.h in Headers */, BCF8681C172854B900912E34 /* GPUImageBilateralFilter.h in Headers */, BCF8681E172854B900912E34 /* GPUImageBoxBlurFilter.h in Headers */, BCF86822172854B900912E34 /* GPUImageMedianFilter.h in Headers */, BCF86828172857B900912E34 /* GPUImageMotionBlurFilter.h in Headers */, BCF8682A172857B900912E34 /* GPUImageZoomBlurFilter.h in Headers */, BCF8683017286EDB00912E34 /* GPUImageAddBlendFilter.h in Headers */, BCF8683F17286F2800912E34 /* GPUImageColorBurnBlendFilter.h in Headers */, BCF8684117286F2800912E34 /* GPUImageDarkenBlendFilter.h in Headers */, BCF8684317286F2800912E34 /* GPUImageDivideBlendFilter.h in Headers */, BCF8684517286F2800912E34 /* GPUImageLightenBlendFilter.h in Headers */, BCF8684717286F2800912E34 /* GPUImageMultiplyBlendFilter.h in Headers */, BCF8684917286F2800912E34 /* GPUImageOverlayBlendFilter.h in Headers */, BCF868531728716400912E34 /* GPUImageColorDodgeBlendFilter.h in Headers */, BCF868551728716400912E34 /* GPUImageDifferenceBlendFilter.h in Headers */, BCF868571728716400912E34 /* GPUImageLinearBurnBlendFilter.h in Headers */, BCF868591728716400912E34 /* GPUImageScreenBlendFilter.h in Headers */, BCF8686F1728721300912E34 /* GPUImageColorBlendFilter.h in Headers */, BCF868711728721300912E34 /* GPUImageExclusionBlendFilter.h in Headers */, BCF868731728721300912E34 /* GPUImageHardLightBlendFilter.h in Headers */, BCF868751728721300912E34 /* GPUImageHueBlendFilter.h in Headers */, BCF868771728721300912E34 /* GPUImageLuminosityBlendFilter.h in Headers */, BCF868791728721300912E34 /* GPUImageNormalBlendFilter.h in Headers */, BCF8687B1728721300912E34 /* GPUImagePoissonBlendFilter.h in Headers */, BCF8687D1728721300912E34 /* GPUImageSaturationBlendFilter.h in Headers */, BCF8687F1728721300912E34 /* GPUImageSoftLightBlendFilter.h in Headers */, BCF868811728721300912E34 /* GPUImageSubtractBlendFilter.h in Headers */, BCF868851728773900912E34 /* GPUImageTwoInputCrossTextureSamplingFilter.h in Headers */, BCF8688F17287ED000912E34 /* GPUImageChromaKeyBlendFilter.h in Headers */, BCF8689117287ED000912E34 /* GPUImageDissolveBlendFilter.h in Headers */, BCF86895172880B800912E34 /* GPUImageSourceOverBlendFilter.h in Headers */, BCF86899172883A300912E34 /* GPUImageMaskFilter.h in Headers */, BCF8689D1728862100912E34 /* GPUImageOpacityFilter.h in Headers */, BCF868A11728866400912E34 /* GPUImageAlphaBlendFilter.h in Headers */, BCB009E6172A1BBD00DB804C /* GPUImageGammaFilter.h in Headers */, 79840B831C8B29240079A83B /* GPUImageSolarizeFilter.h in Headers */, BCB009EA172A1BE800DB804C /* GPUImageToneCurveFilter.h in Headers */, BCB009F0172A23AA00DB804C /* GPUImageHazeFilter.h in Headers */, BCB009F2172A23AA00DB804C /* GPUImageHighlightShadowFilter.h in Headers */, BCB009F6172A243400DB804C /* GPUImageSepiaFilter.h in Headers */, BCB009FA172A246E00DB804C /* GPUImageColorMatrixFilter.h in Headers */, BC78B710172DCCB800342C6A /* GPUImageLookupFilter.h in Headers */, BC78B70E172DCCB800342C6A /* GPUImageAmatorkaFilter.h in Headers */, BC78B712172DCCB800342C6A /* GPUImageMissEtikateFilter.h in Headers */, BC78B714172DCCB800342C6A /* GPUImageSoftEleganceFilter.h in Headers */, BCBF6931173061D200E5792A /* GPUImage3x3ConvolutionFilter.h in Headers */, BCBF69351730623200E5792A /* GPUImageEmbossFilter.h in Headers */, BC6C553C1730636600EB222D /* GPUImageLaplacianFilter.h in Headers */, BC6C55461730BDCF00EB222D /* GPUImageLanczosResamplingFilter.h in Headers */, BCAE41E41731C3000020F80D /* GPUImageThreeInputFilter.h in Headers */, BCC0DF4217358315007C485F /* GPUImageColorInvertFilter.h in Headers */, BCC0DF4817359529007C485F /* GPUImageHistogramFilter.h in Headers */, BCC0DF4A17359529007C485F /* GPUImageHistogramGenerator.h in Headers */, BCC0DF52173595D3007C485F /* GPUImageAverageColor.h in Headers */, BCC0DF54173595D3007C485F /* GPUImageLuminosity.h in Headers */, BCC0DF56173595D3007C485F /* GPUImageSolidColorGenerator.h in Headers */, BCC0DF5A173596A8007C485F /* GPUImageAdaptiveThresholdFilter.h in Headers */, BCC0DF5E173596B9007C485F /* GPUImageAverageLuminanceThresholdFilter.h in Headers */, BCC0DF6217359F42007C485F /* GPUImageLuminanceThresholdFilter.h in Headers */, BCE817A81735FDC70071D084 /* GPUImageHalftoneFilter.h in Headers */, BCE817AA1735FDC70071D084 /* GPUImagePixellatePositionFilter.h in Headers */, BCE817AC1735FDC70071D084 /* GPUImagePolarPixellateFilter.h in Headers */, BC4DFD031C10D2FD0095A016 /* GPUImageColourFASTFeatureDetector.h in Headers */, BCE817AE1735FDC70071D084 /* GPUImagePolkaDotFilter.h in Headers */, BCE817B21735FE150071D084 /* GPUImageCrosshatchFilter.h in Headers */, BCE817BA173608690071D084 /* GPUImageCannyEdgeDetectionFilter.h in Headers */, BCE817BC173608690071D084 /* GPUImagePrewittEdgeDetectionFilter.h in Headers */, BCE817BE173608690071D084 /* GPUImageThresholdEdgeDetectionFilter.h in Headers */, BCE817C21736092A0071D084 /* GPUImageXYDerivativeFilter.h in Headers */, BCE817CC17360BFD0071D084 /* GPUImageDirectionalNonMaximumSuppressionFilter.h in Headers */, BCE817CE17360BFD0071D084 /* GPUImageDirectionalSobelEdgeDetectionFilter.h in Headers */, BCE817D217360C6A0071D084 /* GPUImageWeakPixelInclusionFilter.h in Headers */, BCE2EF8817459D5B00C0628C /* GPUImageHarrisCornerDetectionFilter.h in Headers */, BCE2EF8A17459D5B00C0628C /* GPUImageNobleCornerDetectionFilter.h in Headers */, BCE2EF8C17459D5B00C0628C /* GPUImageShiTomasiFeatureDetectionFilter.h in Headers */, BCE2EF9217459D9300C0628C /* GPUImageColorPackingFilter.h in Headers */, BCE2EF9417459D9300C0628C /* GPUImageThresholdedNonMaximumSuppressionFilter.h in Headers */, BCE2EF9817459E2400C0628C /* GPUImageHoughTransformLineDetector.h in Headers */, BCE2EF9C17459E5100C0628C /* GPUImageParallelCoordinateLineTransformFilter.h in Headers */, BC56957A174683620081491B /* GPUImageCrosshairGenerator.h in Headers */, BC56957C174683620081491B /* GPUImageLineGenerator.h in Headers */, BCA20B571746C9EC0097C84A /* GPUImageBuffer.h in Headers */, BCA20B591746C9EC0097C84A /* GPUImageHighPassFilter.h in Headers */, BCA20B5B1746C9EC0097C84A /* GPUImageLowPassFilter.h in Headers */, BCA20B5D1746C9EC0097C84A /* GPUImageMotionDetector.h in Headers */, BCA20B611746CFE60097C84A /* GPUImageThresholdSketchFilter.h in Headers */, BCA20B651746D3C30097C84A /* GPUImageSmoothToonFilter.h in Headers */, BCA20B691746D3DD0097C84A /* GPUImageTiltShiftFilter.h in Headers */, A506071B1C78BF8E0095D0BB /* GPUImageTextureInput.h in Headers */, BCA20B6D1746D44B0097C84A /* GPUImageCGAColorspaceFilter.h in Headers */, BCA20B711746D4AC0097C84A /* GPUImagePosterizeFilter.h in Headers */, BCA20B751746DE850097C84A /* GPUImageKuwaharaRadius3Filter.h in Headers */, BCA20B791746DEDE0097C84A /* GPUImageChromaKeyFilter.h in Headers */, BCA20B7D1746DF210097C84A /* GPUImageVignetteFilter.h in Headers */, BCA20B991747081D0097C84A /* GPUImageBulgeDistortionFilter.h in Headers */, BCA20B9B1747081D0097C84A /* GPUImageClosingFilter.h in Headers */, BCA20B9D1747081D0097C84A /* GPUImageDilationFilter.h in Headers */, BCA20B9F1747081D0097C84A /* GPUImageErosionFilter.h in Headers */, BCA20BA11747081D0097C84A /* GPUImageGlassSphereFilter.h in Headers */, BCA20BA31747081D0097C84A /* GPUImagePinchDistortionFilter.h in Headers */, BCA20BA51747081D0097C84A /* GPUImageRGBClosingFilter.h in Headers */, BC4DFD071C10D4860095A016 /* GPUImageColourFASTSamplingOperation.h in Headers */, BCA20BA71747081D0097C84A /* GPUImageRGBDilationFilter.h in Headers */, BCA20BA91747081D0097C84A /* GPUImageRGBErosionFilter.h in Headers */, BCA20BAB1747081D0097C84A /* GPUImageRGBOpeningFilter.h in Headers */, BCA20BAD1747081D0097C84A /* GPUImageSphereRefractionFilter.h in Headers */, BCA20BAF1747081D0097C84A /* GPUImageStretchDistortionFilter.h in Headers */, BCA20BB11747081D0097C84A /* GPUImageSwirlFilter.h in Headers */, BCA20BB5174708630097C84A /* GPUImageOpeningFilter.h in Headers */, BCA20BC117471C4B0097C84A /* GPUImageJFAVoronoiFilter.h in Headers */, BCA20BC317471C4B0097C84A /* GPUImageLocalBinaryPatternFilter.h in Headers */, BCA20BC517471C4B0097C84A /* GPUImageMosaicFilter.h in Headers */, BCA20BC717471C4B0097C84A /* GPUImagePerlinNoiseFilter.h in Headers */, BC8A583218124ABD00E6B507 /* GPUImageSingleComponentGaussianBlurFilter.h in Headers */, BCD8EB8C18D6AFC5005ED83C /* GPUImageFramebuffer.h in Headers */, 574B5D911BEA3E7900F4EC5A /* GPUImageColorConversion.h in Headers */, BCA20BC917471C4B0097C84A /* GPUImageVoronoiConsumerFilter.h in Headers */, 574B5D861BE9346800F4EC5A /* GPUImageMovie.h in Headers */, BCD8EB8E18D6AFC5005ED83C /* GPUImageFramebufferCache.h in Headers */, A50607171C78BF7C0095D0BB /* GPUImageTextureOutput.h in Headers */, A4741D5A19A92098005EE1A4 /* GPUImageHistogramEqualizationFilter.h in Headers */, BC96A4F1176563C300F215A2 /* GPUImageNonMaximumSuppressionFilter.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ BCA3F31B17239B6500E28AEC /* GPUImage */ = { isa = PBXNativeTarget; buildConfigurationList = BCA3F33117239B6500E28AEC /* Build configuration list for PBXNativeTarget "GPUImage" */; buildPhases = ( BCA3F31717239B6500E28AEC /* Sources */, BCA3F31817239B6500E28AEC /* Frameworks */, BCA3F31917239B6500E28AEC /* Headers */, BCA3F31A17239B6500E28AEC /* Resources */, ); buildRules = ( ); dependencies = ( ); name = GPUImage; productName = GPUImageMac; productReference = BCA3F31C17239B6500E28AEC /* GPUImage.framework */; productType = "com.apple.product-type.framework"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ BCA3F31317239B6500E28AEC /* Project object */ = { isa = PBXProject; attributes = { LastUpgradeCheck = 0500; ORGANIZATIONNAME = "Sunset Lake Software LLC"; }; buildConfigurationList = BCA3F31617239B6500E28AEC /* Build configuration list for PBXProject "GPUImageMac" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, ); mainGroup = BCA3F31217239B6500E28AEC; productRefGroup = BCA3F31D17239B6500E28AEC /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( BCA3F31B17239B6500E28AEC /* GPUImage */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ BCA3F31A17239B6500E28AEC /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ BCA3F31717239B6500E28AEC /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( BCF40F1317247D68005AE36A /* GPUImageContext.m in Sources */, BCF40F1717247FD8005AE36A /* GLProgram.m in Sources */, BCF40F1C1724829B005AE36A /* GPUImageOutput.m in Sources */, BCF40F2117248322005AE36A /* GPUImageFilter.m in Sources */, BCF40F2617248836005AE36A /* GPUImageView.m in Sources */, BCF40F2A172488D3005AE36A /* GPUImageBrightnessFilter.m in Sources */, 574B5D921BEA3E7900F4EC5A /* GPUImageColorConversion.m in Sources */, BCF867571725AF9300912E34 /* GPUImageMovieWriter.m in Sources */, BCF867591725AF9300912E34 /* GPUImagePicture.m in Sources */, BCF8679E1727585D00912E34 /* GPUImageAVCamera.m in Sources */, BCF867AE172778D500912E34 /* GPUImageContrastFilter.m in Sources */, BCF867B0172778D500912E34 /* GPUImageExposureFilter.m in Sources */, BCF867B2172778D500912E34 /* GPUImageHueFilter.m in Sources */, BCF867B4172778D500912E34 /* GPUImageSaturationFilter.m in Sources */, BCF867B6172778D500912E34 /* GPUImageWhiteBalanceFilter.m in Sources */, BCF867BA1727791200912E34 /* GPUImageLevelsFilter.m in Sources */, BCF867C01727794000912E34 /* GPUImageMonochromeFilter.m in Sources */, BCF867C21727794000912E34 /* GPUImageRGBFilter.m in Sources */, 79840B841C8B29240079A83B /* GPUImageSolarizeFilter.m in Sources */, BCF867C81727872D00912E34 /* GPUImagePixellateFilter.m in Sources */, BCF867CC172788F100912E34 /* GPUImage3x3TextureSamplingFilter.m in Sources */, BCF867D0172789B200912E34 /* GPUImageSketchFilter.m in Sources */, BCF867D517278A5600912E34 /* GPUImageSobelEdgeDetectionFilter.m in Sources */, BCF867D917278A7A00912E34 /* GPUImageToonFilter.m in Sources */, BCF867DD17278C5A00912E34 /* GPUImageTwoPassFilter.m in Sources */, BCF867E117278D1900912E34 /* GPUImageGrayscaleFilter.m in Sources */, BCF867E51727903D00912E34 /* GPUImageKuwaharaFilter.m in Sources */, BCF867E91728477300912E34 /* GPUImageFalseColorFilter.m in Sources */, BCF867ED172847A000912E34 /* GPUImageSharpenFilter.m in Sources */, BCF867F11728487100912E34 /* GPUImageUnsharpMaskFilter.m in Sources */, BCF867F51728490600912E34 /* GPUImageTwoInputFilter.m in Sources */, BCF867F91728494C00912E34 /* GPUImageGaussianBlurFilter.m in Sources */, BCF867FD1728496E00912E34 /* GPUImageTwoPassTextureSamplingFilter.m in Sources */, BCF8680117284C4000912E34 /* GPUImageFilterGroup.m in Sources */, A506071C1C78BF8E0095D0BB /* GPUImageTextureInput.m in Sources */, BCF8680517284CFC00912E34 /* GPUImageTransformFilter.m in Sources */, BCF8680917284D0B00912E34 /* GPUImageCropFilter.m in Sources */, BCF86811172853AA00912E34 /* GPUImageGaussianBlurPositionFilter.m in Sources */, BCF86813172853AA00912E34 /* GPUImageGaussianSelectiveBlurFilter.m in Sources */, BC4DFD081C10D4860095A016 /* GPUImageColourFASTSamplingOperation.m in Sources */, BCF8681D172854B900912E34 /* GPUImageBilateralFilter.m in Sources */, BCF8681F172854B900912E34 /* GPUImageBoxBlurFilter.m in Sources */, BCF86823172854B900912E34 /* GPUImageMedianFilter.m in Sources */, BCF86829172857B900912E34 /* GPUImageMotionBlurFilter.m in Sources */, BCF8682B172857B900912E34 /* GPUImageZoomBlurFilter.m in Sources */, BCF8683117286EDB00912E34 /* GPUImageAddBlendFilter.m in Sources */, BCF8684017286F2800912E34 /* GPUImageColorBurnBlendFilter.m in Sources */, BCF8684217286F2800912E34 /* GPUImageDarkenBlendFilter.m in Sources */, BCF8684417286F2800912E34 /* GPUImageDivideBlendFilter.m in Sources */, BCF8684617286F2800912E34 /* GPUImageLightenBlendFilter.m in Sources */, BCF8684817286F2800912E34 /* GPUImageMultiplyBlendFilter.m in Sources */, BCF8684A17286F2800912E34 /* GPUImageOverlayBlendFilter.m in Sources */, BCF868541728716400912E34 /* GPUImageColorDodgeBlendFilter.m in Sources */, BCF868561728716400912E34 /* GPUImageDifferenceBlendFilter.m in Sources */, BCF868581728716400912E34 /* GPUImageLinearBurnBlendFilter.m in Sources */, BCF8685A1728716400912E34 /* GPUImageScreenBlendFilter.m in Sources */, BCF868701728721300912E34 /* GPUImageColorBlendFilter.m in Sources */, BCAA73B81C18E09100BC2D31 /* GPUImageFourInputFilter.m in Sources */, BCF868721728721300912E34 /* GPUImageExclusionBlendFilter.m in Sources */, BCF868741728721300912E34 /* GPUImageHardLightBlendFilter.m in Sources */, BCF868761728721300912E34 /* GPUImageHueBlendFilter.m in Sources */, BCF868781728721300912E34 /* GPUImageLuminosityBlendFilter.m in Sources */, BCF8687A1728721300912E34 /* GPUImageNormalBlendFilter.m in Sources */, BCF8687C1728721300912E34 /* GPUImagePoissonBlendFilter.m in Sources */, BCF8687E1728721300912E34 /* GPUImageSaturationBlendFilter.m in Sources */, BCF868801728721300912E34 /* GPUImageSoftLightBlendFilter.m in Sources */, BCF868821728721300912E34 /* GPUImageSubtractBlendFilter.m in Sources */, BCF868861728773900912E34 /* GPUImageTwoInputCrossTextureSamplingFilter.m in Sources */, BCF8689017287ED000912E34 /* GPUImageChromaKeyBlendFilter.m in Sources */, BCF8689217287ED000912E34 /* GPUImageDissolveBlendFilter.m in Sources */, A4741D5B19A92098005EE1A4 /* GPUImageHistogramEqualizationFilter.m in Sources */, BCF86896172880B800912E34 /* GPUImageSourceOverBlendFilter.m in Sources */, BCF8689A172883A300912E34 /* GPUImageMaskFilter.m in Sources */, BCF8689E1728862100912E34 /* GPUImageOpacityFilter.m in Sources */, BCF868A21728866400912E34 /* GPUImageAlphaBlendFilter.m in Sources */, BCB009E7172A1BBD00DB804C /* GPUImageGammaFilter.m in Sources */, BCB009EB172A1BE800DB804C /* GPUImageToneCurveFilter.m in Sources */, BCB009F1172A23AA00DB804C /* GPUImageHazeFilter.m in Sources */, BCB009F3172A23AA00DB804C /* GPUImageHighlightShadowFilter.m in Sources */, BCB009F7172A243400DB804C /* GPUImageSepiaFilter.m in Sources */, BCB009FB172A246E00DB804C /* GPUImageColorMatrixFilter.m in Sources */, BC78B70F172DCCB800342C6A /* GPUImageAmatorkaFilter.m in Sources */, BC78B711172DCCB800342C6A /* GPUImageLookupFilter.m in Sources */, BC78B713172DCCB800342C6A /* GPUImageMissEtikateFilter.m in Sources */, BC78B715172DCCB800342C6A /* GPUImageSoftEleganceFilter.m in Sources */, BCBF6932173061D200E5792A /* GPUImage3x3ConvolutionFilter.m in Sources */, BCBF69361730623200E5792A /* GPUImageEmbossFilter.m in Sources */, BC6C553D1730636600EB222D /* GPUImageLaplacianFilter.m in Sources */, BC6C55471730BDCF00EB222D /* GPUImageLanczosResamplingFilter.m in Sources */, BCAE41E51731C3000020F80D /* GPUImageThreeInputFilter.m in Sources */, BCC0DF4317358315007C485F /* GPUImageColorInvertFilter.m in Sources */, BCC0DF4917359529007C485F /* GPUImageHistogramFilter.m in Sources */, BCC0DF4B17359529007C485F /* GPUImageHistogramGenerator.m in Sources */, BCC0DF53173595D3007C485F /* GPUImageAverageColor.m in Sources */, BCC0DF55173595D3007C485F /* GPUImageLuminosity.m in Sources */, BCC0DF57173595D3007C485F /* GPUImageSolidColorGenerator.m in Sources */, BCC0DF5B173596A8007C485F /* GPUImageAdaptiveThresholdFilter.m in Sources */, BCC0DF5F173596B9007C485F /* GPUImageAverageLuminanceThresholdFilter.m in Sources */, BCC0DF6317359F43007C485F /* GPUImageLuminanceThresholdFilter.m in Sources */, BCE817A91735FDC70071D084 /* GPUImageHalftoneFilter.m in Sources */, BCE817AB1735FDC70071D084 /* GPUImagePixellatePositionFilter.m in Sources */, BCE817AD1735FDC70071D084 /* GPUImagePolarPixellateFilter.m in Sources */, BCE817AF1735FDC70071D084 /* GPUImagePolkaDotFilter.m in Sources */, BCE817B31735FE150071D084 /* GPUImageCrosshatchFilter.m in Sources */, BCE817BB173608690071D084 /* GPUImageCannyEdgeDetectionFilter.m in Sources */, BCE817BD173608690071D084 /* GPUImagePrewittEdgeDetectionFilter.m in Sources */, BCE817BF173608690071D084 /* GPUImageThresholdEdgeDetectionFilter.m in Sources */, BCE817C31736092A0071D084 /* GPUImageXYDerivativeFilter.m in Sources */, BCE817CD17360BFD0071D084 /* GPUImageDirectionalNonMaximumSuppressionFilter.m in Sources */, BCFC5F621C18BDBA00C7F43B /* GPUImageColorLocalBinaryPatternFilter.m in Sources */, BCE817CF17360BFD0071D084 /* GPUImageDirectionalSobelEdgeDetectionFilter.m in Sources */, BCE817D317360C6A0071D084 /* GPUImageWeakPixelInclusionFilter.m in Sources */, BCE2EF8917459D5B00C0628C /* GPUImageHarrisCornerDetectionFilter.m in Sources */, BCE2EF8B17459D5B00C0628C /* GPUImageNobleCornerDetectionFilter.m in Sources */, BCE2EF8D17459D5B00C0628C /* GPUImageShiTomasiFeatureDetectionFilter.m in Sources */, BCE2EF9317459D9300C0628C /* GPUImageColorPackingFilter.m in Sources */, BCE2EF9517459D9300C0628C /* GPUImageThresholdedNonMaximumSuppressionFilter.m in Sources */, BCE2EF9917459E2400C0628C /* GPUImageHoughTransformLineDetector.m in Sources */, BCE2EF9D17459E5100C0628C /* GPUImageParallelCoordinateLineTransformFilter.m in Sources */, BC56957B174683620081491B /* GPUImageCrosshairGenerator.m in Sources */, BC56957D174683620081491B /* GPUImageLineGenerator.m in Sources */, BCA20B581746C9EC0097C84A /* GPUImageBuffer.m in Sources */, BCA20B5A1746C9EC0097C84A /* GPUImageHighPassFilter.m in Sources */, BCA20B5C1746C9EC0097C84A /* GPUImageLowPassFilter.m in Sources */, BCA20B5E1746C9EC0097C84A /* GPUImageMotionDetector.m in Sources */, BCA20B621746CFE60097C84A /* GPUImageThresholdSketchFilter.m in Sources */, BCA20B661746D3C30097C84A /* GPUImageSmoothToonFilter.m in Sources */, BCA20B6A1746D3DD0097C84A /* GPUImageTiltShiftFilter.m in Sources */, BCA20B6E1746D44B0097C84A /* GPUImageCGAColorspaceFilter.m in Sources */, BCA20B721746D4AC0097C84A /* GPUImagePosterizeFilter.m in Sources */, BCA20B761746DE850097C84A /* GPUImageKuwaharaRadius3Filter.m in Sources */, BCA20B7A1746DEDE0097C84A /* GPUImageChromaKeyFilter.m in Sources */, BCA20B7E1746DF210097C84A /* GPUImageVignetteFilter.m in Sources */, BCA20B9A1747081D0097C84A /* GPUImageBulgeDistortionFilter.m in Sources */, BCA20B9C1747081D0097C84A /* GPUImageClosingFilter.m in Sources */, 574B5D871BE9346800F4EC5A /* GPUImageMovie.m in Sources */, BCA20B9E1747081D0097C84A /* GPUImageDilationFilter.m in Sources */, BCA20BA01747081D0097C84A /* GPUImageErosionFilter.m in Sources */, BCA20BA21747081D0097C84A /* GPUImageGlassSphereFilter.m in Sources */, BCA20BA41747081D0097C84A /* GPUImagePinchDistortionFilter.m in Sources */, BCA20BA61747081D0097C84A /* GPUImageRGBClosingFilter.m in Sources */, BCA20BA81747081D0097C84A /* GPUImageRGBDilationFilter.m in Sources */, BC4DFD041C10D2FD0095A016 /* GPUImageColourFASTFeatureDetector.m in Sources */, BCA20BAA1747081D0097C84A /* GPUImageRGBErosionFilter.m in Sources */, BCA20BAC1747081D0097C84A /* GPUImageRGBOpeningFilter.m in Sources */, BCA20BAE1747081D0097C84A /* GPUImageSphereRefractionFilter.m in Sources */, BCA20BB01747081D0097C84A /* GPUImageStretchDistortionFilter.m in Sources */, BCA20BB21747081D0097C84A /* GPUImageSwirlFilter.m in Sources */, BCA20BB6174708630097C84A /* GPUImageOpeningFilter.m in Sources */, BCA20BC217471C4B0097C84A /* GPUImageJFAVoronoiFilter.m in Sources */, BCA20BC417471C4B0097C84A /* GPUImageLocalBinaryPatternFilter.m in Sources */, BCA20BC617471C4B0097C84A /* GPUImageMosaicFilter.m in Sources */, BCA20BC817471C4B0097C84A /* GPUImagePerlinNoiseFilter.m in Sources */, BCA20BCA17471C4B0097C84A /* GPUImageVoronoiConsumerFilter.m in Sources */, BC96A4F2176563C300F215A2 /* GPUImageNonMaximumSuppressionFilter.m in Sources */, A87E5E13177648F3007FD5B1 /* GPUImageRawDataOutput.m in Sources */, A87E5E1717764B16007FD5B1 /* GPUImageRawDataInput.m in Sources */, BC8A583318124ABD00E6B507 /* GPUImageSingleComponentGaussianBlurFilter.m in Sources */, A50607181C78BF7C0095D0BB /* GPUImageTextureOutput.m in Sources */, BCD8EB8D18D6AFC5005ED83C /* GPUImageFramebuffer.m in Sources */, BCD8EB8F18D6AFC5005ED83C /* GPUImageFramebufferCache.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin XCBuildConfiguration section */ BCA3F32F17239B6500E28AEC /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; DEFINES_MODULE = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_VARIABLE = YES; INSTALL_PATH = "@loader_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.6; ONLY_ACTIVE_ARCH = YES; PRODUCT_MODULE_NAME = GPUImage; SDKROOT = macosx; }; name = Debug; }; BCA3F33017239B6500E28AEC /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_VARIABLE = YES; INSTALL_PATH = "@loader_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.6; PRODUCT_MODULE_NAME = GPUImage; SDKROOT = macosx; }; name = Release; }; BCA3F33217239B6500E28AEC /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { COMBINE_HIDPI_IMAGES = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; FRAMEWORK_VERSION = A; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "Source/Mac/GPUImageMac-Prefix.pch"; INFOPLIST_FILE = "Source/Mac/GPUImageMac-Info.plist"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = framework; }; name = Debug; }; BCA3F33317239B6500E28AEC /* Release */ = { isa = XCBuildConfiguration; buildSettings = { COMBINE_HIDPI_IMAGES = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; FRAMEWORK_VERSION = A; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "Source/Mac/GPUImageMac-Prefix.pch"; INFOPLIST_FILE = "Source/Mac/GPUImageMac-Info.plist"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = framework; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ BCA3F31617239B6500E28AEC /* Build configuration list for PBXProject "GPUImageMac" */ = { isa = XCConfigurationList; buildConfigurations = ( BCA3F32F17239B6500E28AEC /* Debug */, BCA3F33017239B6500E28AEC /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; BCA3F33117239B6500E28AEC /* Build configuration list for PBXNativeTarget "GPUImage" */ = { isa = XCConfigurationList; buildConfigurations = ( BCA3F33217239B6500E28AEC /* Debug */, BCA3F33317239B6500E28AEC /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = BCA3F31317239B6500E28AEC /* Project object */; } ================================================ FILE: framework/GPUImageMac.xcodeproj/xcshareddata/xcschemes/GPUImage.xcscheme ================================================ ================================================ FILE: framework/Source/GLProgram.h ================================================ // This is Jeff LaMarche's GLProgram OpenGL shader wrapper class from his OpenGL ES 2.0 book. // A description of this can be found at his page on the topic: // http://iphonedevelopment.blogspot.com/2010/11/opengl-es-20-for-ios-chapter-4.html // I've extended this to be able to take programs as NSStrings in addition to files, for baked-in shaders #import #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE #import #import #else #import #import #endif @interface GLProgram : NSObject { NSMutableArray *attributes; NSMutableArray *uniforms; GLuint program, vertShader, fragShader; } @property(readwrite, nonatomic) BOOL initialized; @property(readwrite, copy, nonatomic) NSString *vertexShaderLog; @property(readwrite, copy, nonatomic) NSString *fragmentShaderLog; @property(readwrite, copy, nonatomic) NSString *programLog; - (id)initWithVertexShaderString:(NSString *)vShaderString fragmentShaderString:(NSString *)fShaderString; - (id)initWithVertexShaderString:(NSString *)vShaderString fragmentShaderFilename:(NSString *)fShaderFilename; - (id)initWithVertexShaderFilename:(NSString *)vShaderFilename fragmentShaderFilename:(NSString *)fShaderFilename; - (void)addAttribute:(NSString *)attributeName; - (GLuint)attributeIndex:(NSString *)attributeName; - (GLuint)uniformIndex:(NSString *)uniformName; - (BOOL)link; - (void)use; - (void)validate; @end ================================================ FILE: framework/Source/GLProgram.m ================================================ // This is Jeff LaMarche's GLProgram OpenGL shader wrapper class from his OpenGL ES 2.0 book. // A description of this can be found at his page on the topic: // http://iphonedevelopment.blogspot.com/2010/11/opengl-es-20-for-ios-chapter-4.html #import "GLProgram.h" // START:typedefs #pragma mark Function Pointer Definitions typedef void (*GLInfoFunction)(GLuint program, GLenum pname, GLint* params); typedef void (*GLLogFunction) (GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog); // END:typedefs #pragma mark - #pragma mark Private Extension Method Declaration // START:extension @interface GLProgram() - (BOOL)compileShader:(GLuint *)shader type:(GLenum)type string:(NSString *)shaderString; @end // END:extension #pragma mark - @implementation GLProgram // START:init @synthesize initialized = _initialized; - (id)initWithVertexShaderString:(NSString *)vShaderString fragmentShaderString:(NSString *)fShaderString; { if ((self = [super init])) { _initialized = NO; attributes = [[NSMutableArray alloc] init]; uniforms = [[NSMutableArray alloc] init]; program = glCreateProgram(); if (![self compileShader:&vertShader type:GL_VERTEX_SHADER string:vShaderString]) { NSLog(@"Failed to compile vertex shader"); } // Create and compile fragment shader if (![self compileShader:&fragShader type:GL_FRAGMENT_SHADER string:fShaderString]) { NSLog(@"Failed to compile fragment shader"); } glAttachShader(program, vertShader); glAttachShader(program, fragShader); } return self; } - (id)initWithVertexShaderString:(NSString *)vShaderString fragmentShaderFilename:(NSString *)fShaderFilename; { NSString *fragShaderPathname = [[NSBundle mainBundle] pathForResource:fShaderFilename ofType:@"fsh"]; NSString *fragmentShaderString = [NSString stringWithContentsOfFile:fragShaderPathname encoding:NSUTF8StringEncoding error:nil]; if ((self = [self initWithVertexShaderString:vShaderString fragmentShaderString:fragmentShaderString])) { } return self; } - (id)initWithVertexShaderFilename:(NSString *)vShaderFilename fragmentShaderFilename:(NSString *)fShaderFilename; { NSString *vertShaderPathname = [[NSBundle mainBundle] pathForResource:vShaderFilename ofType:@"vsh"]; NSString *vertexShaderString = [NSString stringWithContentsOfFile:vertShaderPathname encoding:NSUTF8StringEncoding error:nil]; NSString *fragShaderPathname = [[NSBundle mainBundle] pathForResource:fShaderFilename ofType:@"fsh"]; NSString *fragmentShaderString = [NSString stringWithContentsOfFile:fragShaderPathname encoding:NSUTF8StringEncoding error:nil]; if ((self = [self initWithVertexShaderString:vertexShaderString fragmentShaderString:fragmentShaderString])) { } return self; } // END:init // START:compile - (BOOL)compileShader:(GLuint *)shader type:(GLenum)type string:(NSString *)shaderString { // CFAbsoluteTime startTime = CFAbsoluteTimeGetCurrent(); GLint status; const GLchar *source; source = (GLchar *)[shaderString UTF8String]; if (!source) { NSLog(@"Failed to load vertex shader"); return NO; } *shader = glCreateShader(type); glShaderSource(*shader, 1, &source, NULL); glCompileShader(*shader); glGetShaderiv(*shader, GL_COMPILE_STATUS, &status); if (status != GL_TRUE) { GLint logLength; glGetShaderiv(*shader, GL_INFO_LOG_LENGTH, &logLength); if (logLength > 0) { GLchar *log = (GLchar *)malloc(logLength); glGetShaderInfoLog(*shader, logLength, &logLength, log); if (shader == &vertShader) { self.vertexShaderLog = [NSString stringWithFormat:@"%s", log]; } else { self.fragmentShaderLog = [NSString stringWithFormat:@"%s", log]; } free(log); } } // CFAbsoluteTime linkTime = (CFAbsoluteTimeGetCurrent() - startTime); // NSLog(@"Compiled in %f ms", linkTime * 1000.0); return status == GL_TRUE; } // END:compile #pragma mark - // START:addattribute - (void)addAttribute:(NSString *)attributeName { if (![attributes containsObject:attributeName]) { [attributes addObject:attributeName]; glBindAttribLocation(program, (GLuint)[attributes indexOfObject:attributeName], [attributeName UTF8String]); } } // END:addattribute // START:indexmethods - (GLuint)attributeIndex:(NSString *)attributeName { return (GLuint)[attributes indexOfObject:attributeName]; } - (GLuint)uniformIndex:(NSString *)uniformName { return glGetUniformLocation(program, [uniformName UTF8String]); } // END:indexmethods #pragma mark - // START:link - (BOOL)link { // CFAbsoluteTime startTime = CFAbsoluteTimeGetCurrent(); GLint status; glLinkProgram(program); glGetProgramiv(program, GL_LINK_STATUS, &status); if (status == GL_FALSE) return NO; if (vertShader) { glDeleteShader(vertShader); vertShader = 0; } if (fragShader) { glDeleteShader(fragShader); fragShader = 0; } self.initialized = YES; // CFAbsoluteTime linkTime = (CFAbsoluteTimeGetCurrent() - startTime); // NSLog(@"Linked in %f ms", linkTime * 1000.0); return YES; } // END:link // START:use - (void)use { glUseProgram(program); } // END:use #pragma mark - - (void)validate; { GLint logLength; glValidateProgram(program); glGetProgramiv(program, GL_INFO_LOG_LENGTH, &logLength); if (logLength > 0) { GLchar *log = (GLchar *)malloc(logLength); glGetProgramInfoLog(program, logLength, &logLength, log); self.programLog = [NSString stringWithFormat:@"%s", log]; free(log); } } #pragma mark - // START:dealloc - (void)dealloc { if (vertShader) glDeleteShader(vertShader); if (fragShader) glDeleteShader(fragShader); if (program) glDeleteProgram(program); } // END:dealloc @end ================================================ FILE: framework/Source/GPUImage.h ================================================ #import "GLProgram.h" // Base classes #import "GPUImageContext.h" #import "GPUImageOutput.h" #import "GPUImageView.h" #import "GPUImageVideoCamera.h" #import "GPUImageStillCamera.h" #import "GPUImageMovie.h" #import "GPUImagePicture.h" #import "GPUImageRawDataInput.h" #import "GPUImageRawDataOutput.h" #import "GPUImageMovieWriter.h" #import "GPUImageFilterPipeline.h" #import "GPUImageTextureOutput.h" #import "GPUImageFilterGroup.h" #import "GPUImageTextureInput.h" #import "GPUImageUIElement.h" #import "GPUImageBuffer.h" #import "GPUImageFramebuffer.h" #import "GPUImageFramebufferCache.h" // Filters #import "GPUImageFilter.h" #import "GPUImageTwoInputFilter.h" #import "GPUImagePixellateFilter.h" #import "GPUImagePixellatePositionFilter.h" #import "GPUImageSepiaFilter.h" #import "GPUImageColorInvertFilter.h" #import "GPUImageSaturationFilter.h" #import "GPUImageContrastFilter.h" #import "GPUImageExposureFilter.h" #import "GPUImageBrightnessFilter.h" #import "GPUImageLevelsFilter.h" #import "GPUImageSharpenFilter.h" #import "GPUImageGammaFilter.h" #import "GPUImageSobelEdgeDetectionFilter.h" #import "GPUImageSketchFilter.h" #import "GPUImageToonFilter.h" #import "GPUImageSmoothToonFilter.h" #import "GPUImageMultiplyBlendFilter.h" #import "GPUImageDissolveBlendFilter.h" #import "GPUImageKuwaharaFilter.h" #import "GPUImageKuwaharaRadius3Filter.h" #import "GPUImageVignetteFilter.h" #import "GPUImageGaussianBlurFilter.h" #import "GPUImageGaussianBlurPositionFilter.h" #import "GPUImageGaussianSelectiveBlurFilter.h" #import "GPUImageOverlayBlendFilter.h" #import "GPUImageDarkenBlendFilter.h" #import "GPUImageLightenBlendFilter.h" #import "GPUImageSwirlFilter.h" #import "GPUImageSourceOverBlendFilter.h" #import "GPUImageColorBurnBlendFilter.h" #import "GPUImageColorDodgeBlendFilter.h" #import "GPUImageScreenBlendFilter.h" #import "GPUImageExclusionBlendFilter.h" #import "GPUImageDifferenceBlendFilter.h" #import "GPUImageSubtractBlendFilter.h" #import "GPUImageHardLightBlendFilter.h" #import "GPUImageSoftLightBlendFilter.h" #import "GPUImageColorBlendFilter.h" #import "GPUImageHueBlendFilter.h" #import "GPUImageSaturationBlendFilter.h" #import "GPUImageLuminosityBlendFilter.h" #import "GPUImageCropFilter.h" #import "GPUImageGrayscaleFilter.h" #import "GPUImageTransformFilter.h" #import "GPUImageChromaKeyBlendFilter.h" #import "GPUImageHazeFilter.h" #import "GPUImageLuminanceThresholdFilter.h" #import "GPUImagePosterizeFilter.h" #import "GPUImageBoxBlurFilter.h" #import "GPUImageAdaptiveThresholdFilter.h" #import "GPUImageSolarizeFilter.h" #import "GPUImageUnsharpMaskFilter.h" #import "GPUImageBulgeDistortionFilter.h" #import "GPUImagePinchDistortionFilter.h" #import "GPUImageCrosshatchFilter.h" #import "GPUImageCGAColorspaceFilter.h" #import "GPUImagePolarPixellateFilter.h" #import "GPUImageStretchDistortionFilter.h" #import "GPUImagePerlinNoiseFilter.h" #import "GPUImageJFAVoronoiFilter.h" #import "GPUImageVoronoiConsumerFilter.h" #import "GPUImageMosaicFilter.h" #import "GPUImageTiltShiftFilter.h" #import "GPUImage3x3ConvolutionFilter.h" #import "GPUImageEmbossFilter.h" #import "GPUImageCannyEdgeDetectionFilter.h" #import "GPUImageThresholdEdgeDetectionFilter.h" #import "GPUImageMaskFilter.h" #import "GPUImageHistogramFilter.h" #import "GPUImageHistogramGenerator.h" #import "GPUImageHistogramEqualizationFilter.h" #import "GPUImagePrewittEdgeDetectionFilter.h" #import "GPUImageXYDerivativeFilter.h" #import "GPUImageHarrisCornerDetectionFilter.h" #import "GPUImageAlphaBlendFilter.h" #import "GPUImageNormalBlendFilter.h" #import "GPUImageNonMaximumSuppressionFilter.h" #import "GPUImageRGBFilter.h" #import "GPUImageMedianFilter.h" #import "GPUImageBilateralFilter.h" #import "GPUImageCrosshairGenerator.h" #import "GPUImageToneCurveFilter.h" #import "GPUImageNobleCornerDetectionFilter.h" #import "GPUImageShiTomasiFeatureDetectionFilter.h" #import "GPUImageErosionFilter.h" #import "GPUImageRGBErosionFilter.h" #import "GPUImageDilationFilter.h" #import "GPUImageRGBDilationFilter.h" #import "GPUImageOpeningFilter.h" #import "GPUImageRGBOpeningFilter.h" #import "GPUImageClosingFilter.h" #import "GPUImageRGBClosingFilter.h" #import "GPUImageColorPackingFilter.h" #import "GPUImageSphereRefractionFilter.h" #import "GPUImageMonochromeFilter.h" #import "GPUImageOpacityFilter.h" #import "GPUImageHighlightShadowFilter.h" #import "GPUImageFalseColorFilter.h" #import "GPUImageHSBFilter.h" #import "GPUImageHueFilter.h" #import "GPUImageGlassSphereFilter.h" #import "GPUImageLookupFilter.h" #import "GPUImageAmatorkaFilter.h" #import "GPUImageMissEtikateFilter.h" #import "GPUImageSoftEleganceFilter.h" #import "GPUImageAddBlendFilter.h" #import "GPUImageDivideBlendFilter.h" #import "GPUImagePolkaDotFilter.h" #import "GPUImageLocalBinaryPatternFilter.h" #import "GPUImageColorLocalBinaryPatternFilter.h" #import "GPUImageLanczosResamplingFilter.h" #import "GPUImageAverageColor.h" #import "GPUImageSolidColorGenerator.h" #import "GPUImageLuminosity.h" #import "GPUImageAverageLuminanceThresholdFilter.h" #import "GPUImageWhiteBalanceFilter.h" #import "GPUImageChromaKeyFilter.h" #import "GPUImageLowPassFilter.h" #import "GPUImageHighPassFilter.h" #import "GPUImageMotionDetector.h" #import "GPUImageHalftoneFilter.h" #import "GPUImageThresholdedNonMaximumSuppressionFilter.h" #import "GPUImageHoughTransformLineDetector.h" #import "GPUImageParallelCoordinateLineTransformFilter.h" #import "GPUImageThresholdSketchFilter.h" #import "GPUImageLineGenerator.h" #import "GPUImageLinearBurnBlendFilter.h" #import "GPUImageGaussianBlurPositionFilter.h" #import "GPUImagePixellatePositionFilter.h" #import "GPUImageTwoInputCrossTextureSamplingFilter.h" #import "GPUImagePoissonBlendFilter.h" #import "GPUImageMotionBlurFilter.h" #import "GPUImageZoomBlurFilter.h" #import "GPUImageLaplacianFilter.h" #import "GPUImageiOSBlurFilter.h" #import "GPUImageLuminanceRangeFilter.h" #import "GPUImageDirectionalNonMaximumSuppressionFilter.h" #import "GPUImageDirectionalSobelEdgeDetectionFilter.h" #import "GPUImageSingleComponentGaussianBlurFilter.h" #import "GPUImageThreeInputFilter.h" #import "GPUImageFourInputFilter.h" #import "GPUImageWeakPixelInclusionFilter.h" #import "GPUImageColorConversion.h" #import "GPUImageColourFASTFeatureDetector.h" #import "GPUImageColourFASTSamplingOperation.h" ================================================ FILE: framework/Source/GPUImage3x3ConvolutionFilter.h ================================================ #import "GPUImage3x3TextureSamplingFilter.h" /** Runs a 3x3 convolution kernel against the image */ @interface GPUImage3x3ConvolutionFilter : GPUImage3x3TextureSamplingFilter { GLint convolutionMatrixUniform; } /** Convolution kernel to run against the image The convolution kernel is a 3x3 matrix of values to apply to the pixel and its 8 surrounding pixels. The matrix is specified in row-major order, with the top left pixel being one.one and the bottom right three.three If the values in the matrix don't add up to 1.0, the image could be brightened or darkened. */ @property(readwrite, nonatomic) GPUMatrix3x3 convolutionKernel; @end ================================================ FILE: framework/Source/GPUImage3x3ConvolutionFilter.m ================================================ #import "GPUImage3x3ConvolutionFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImage3x3ConvolutionFragmentShaderString = SHADER_STRING ( precision highp float; uniform sampler2D inputImageTexture; uniform mediump mat3 convolutionMatrix; varying vec2 textureCoordinate; varying vec2 leftTextureCoordinate; varying vec2 rightTextureCoordinate; varying vec2 topTextureCoordinate; varying vec2 topLeftTextureCoordinate; varying vec2 topRightTextureCoordinate; varying vec2 bottomTextureCoordinate; varying vec2 bottomLeftTextureCoordinate; varying vec2 bottomRightTextureCoordinate; void main() { mediump vec3 bottomColor = texture2D(inputImageTexture, bottomTextureCoordinate).rgb; mediump vec3 bottomLeftColor = texture2D(inputImageTexture, bottomLeftTextureCoordinate).rgb; mediump vec3 bottomRightColor = texture2D(inputImageTexture, bottomRightTextureCoordinate).rgb; mediump vec4 centerColor = texture2D(inputImageTexture, textureCoordinate); mediump vec3 leftColor = texture2D(inputImageTexture, leftTextureCoordinate).rgb; mediump vec3 rightColor = texture2D(inputImageTexture, rightTextureCoordinate).rgb; mediump vec3 topColor = texture2D(inputImageTexture, topTextureCoordinate).rgb; mediump vec3 topRightColor = texture2D(inputImageTexture, topRightTextureCoordinate).rgb; mediump vec3 topLeftColor = texture2D(inputImageTexture, topLeftTextureCoordinate).rgb; mediump vec3 resultColor = topLeftColor * convolutionMatrix[0][0] + topColor * convolutionMatrix[0][1] + topRightColor * convolutionMatrix[0][2]; resultColor += leftColor * convolutionMatrix[1][0] + centerColor.rgb * convolutionMatrix[1][1] + rightColor * convolutionMatrix[1][2]; resultColor += bottomLeftColor * convolutionMatrix[2][0] + bottomColor * convolutionMatrix[2][1] + bottomRightColor * convolutionMatrix[2][2]; gl_FragColor = vec4(resultColor, centerColor.a); } ); #else NSString *const kGPUImage3x3ConvolutionFragmentShaderString = SHADER_STRING ( uniform sampler2D inputImageTexture; uniform mat3 convolutionMatrix; varying vec2 textureCoordinate; varying vec2 leftTextureCoordinate; varying vec2 rightTextureCoordinate; varying vec2 topTextureCoordinate; varying vec2 topLeftTextureCoordinate; varying vec2 topRightTextureCoordinate; varying vec2 bottomTextureCoordinate; varying vec2 bottomLeftTextureCoordinate; varying vec2 bottomRightTextureCoordinate; void main() { vec3 bottomColor = texture2D(inputImageTexture, bottomTextureCoordinate).rgb; vec3 bottomLeftColor = texture2D(inputImageTexture, bottomLeftTextureCoordinate).rgb; vec3 bottomRightColor = texture2D(inputImageTexture, bottomRightTextureCoordinate).rgb; vec4 centerColor = texture2D(inputImageTexture, textureCoordinate); vec3 leftColor = texture2D(inputImageTexture, leftTextureCoordinate).rgb; vec3 rightColor = texture2D(inputImageTexture, rightTextureCoordinate).rgb; vec3 topColor = texture2D(inputImageTexture, topTextureCoordinate).rgb; vec3 topRightColor = texture2D(inputImageTexture, topRightTextureCoordinate).rgb; vec3 topLeftColor = texture2D(inputImageTexture, topLeftTextureCoordinate).rgb; vec3 resultColor = topLeftColor * convolutionMatrix[0][0] + topColor * convolutionMatrix[0][1] + topRightColor * convolutionMatrix[0][2]; resultColor += leftColor * convolutionMatrix[1][0] + centerColor.rgb * convolutionMatrix[1][1] + rightColor * convolutionMatrix[1][2]; resultColor += bottomLeftColor * convolutionMatrix[2][0] + bottomColor * convolutionMatrix[2][1] + bottomRightColor * convolutionMatrix[2][2]; gl_FragColor = vec4(resultColor, centerColor.a); } ); #endif @implementation GPUImage3x3ConvolutionFilter @synthesize convolutionKernel = _convolutionKernel; #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [self initWithFragmentShaderFromString:kGPUImage3x3ConvolutionFragmentShaderString])) { return nil; } self.convolutionKernel = (GPUMatrix3x3){ {0.f, 0.f, 0.f}, {0.f, 1.f, 0.f}, {0.f, 0.f, 0.f} }; return self; } - (id)initWithFragmentShaderFromString:(NSString *)fragmentShaderString; { if (!(self = [super initWithFragmentShaderFromString:fragmentShaderString])) { return nil; } convolutionMatrixUniform = [filterProgram uniformIndex:@"convolutionMatrix"]; return self; } #pragma mark - #pragma mark Accessors - (void)setConvolutionKernel:(GPUMatrix3x3)newValue; { _convolutionKernel = newValue; [self setMatrix3f:_convolutionKernel forUniform:convolutionMatrixUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImage3x3TextureSamplingFilter.h ================================================ #import "GPUImageFilter.h" extern NSString *const kGPUImageNearbyTexelSamplingVertexShaderString; @interface GPUImage3x3TextureSamplingFilter : GPUImageFilter { GLint texelWidthUniform, texelHeightUniform; CGFloat texelWidth, texelHeight; BOOL hasOverriddenImageSizeFactor; } // The texel width and height determines how far out to sample from this texel. By default, this is the normalized width of a pixel, but this can be overridden for different effects. @property(readwrite, nonatomic) CGFloat texelWidth; @property(readwrite, nonatomic) CGFloat texelHeight; @end ================================================ FILE: framework/Source/GPUImage3x3TextureSamplingFilter.m ================================================ #import "GPUImage3x3TextureSamplingFilter.h" // Override vertex shader to remove dependent texture reads NSString *const kGPUImageNearbyTexelSamplingVertexShaderString = SHADER_STRING ( attribute vec4 position; attribute vec4 inputTextureCoordinate; uniform float texelWidth; uniform float texelHeight; varying vec2 textureCoordinate; varying vec2 leftTextureCoordinate; varying vec2 rightTextureCoordinate; varying vec2 topTextureCoordinate; varying vec2 topLeftTextureCoordinate; varying vec2 topRightTextureCoordinate; varying vec2 bottomTextureCoordinate; varying vec2 bottomLeftTextureCoordinate; varying vec2 bottomRightTextureCoordinate; void main() { gl_Position = position; vec2 widthStep = vec2(texelWidth, 0.0); vec2 heightStep = vec2(0.0, texelHeight); vec2 widthHeightStep = vec2(texelWidth, texelHeight); vec2 widthNegativeHeightStep = vec2(texelWidth, -texelHeight); textureCoordinate = inputTextureCoordinate.xy; leftTextureCoordinate = inputTextureCoordinate.xy - widthStep; rightTextureCoordinate = inputTextureCoordinate.xy + widthStep; topTextureCoordinate = inputTextureCoordinate.xy - heightStep; topLeftTextureCoordinate = inputTextureCoordinate.xy - widthHeightStep; topRightTextureCoordinate = inputTextureCoordinate.xy + widthNegativeHeightStep; bottomTextureCoordinate = inputTextureCoordinate.xy + heightStep; bottomLeftTextureCoordinate = inputTextureCoordinate.xy - widthNegativeHeightStep; bottomRightTextureCoordinate = inputTextureCoordinate.xy + widthHeightStep; } ); @implementation GPUImage3x3TextureSamplingFilter @synthesize texelWidth = _texelWidth; @synthesize texelHeight = _texelHeight; #pragma mark - #pragma mark Initialization and teardown - (id)initWithVertexShaderFromString:(NSString *)vertexShaderString fragmentShaderFromString:(NSString *)fragmentShaderString; { if (!(self = [super initWithVertexShaderFromString:vertexShaderString fragmentShaderFromString:fragmentShaderString])) { return nil; } texelWidthUniform = [filterProgram uniformIndex:@"texelWidth"]; texelHeightUniform = [filterProgram uniformIndex:@"texelHeight"]; return self; } - (id)initWithFragmentShaderFromString:(NSString *)fragmentShaderString; { if (!(self = [self initWithVertexShaderFromString:kGPUImageNearbyTexelSamplingVertexShaderString fragmentShaderFromString:fragmentShaderString])) { return nil; } return self; } - (void)setupFilterForSize:(CGSize)filterFrameSize; { if (!hasOverriddenImageSizeFactor) { _texelWidth = 1.0 / filterFrameSize.width; _texelHeight = 1.0 / filterFrameSize.height; runSynchronouslyOnVideoProcessingQueue(^{ [GPUImageContext setActiveShaderProgram:filterProgram]; if (GPUImageRotationSwapsWidthAndHeight(inputRotation)) { glUniform1f(texelWidthUniform, _texelHeight); glUniform1f(texelHeightUniform, _texelWidth); } else { glUniform1f(texelWidthUniform, _texelWidth); glUniform1f(texelHeightUniform, _texelHeight); } }); } } #pragma mark - #pragma mark Accessors - (void)setTexelWidth:(CGFloat)newValue; { hasOverriddenImageSizeFactor = YES; _texelWidth = newValue; [self setFloat:_texelWidth forUniform:texelWidthUniform program:filterProgram]; } - (void)setTexelHeight:(CGFloat)newValue; { hasOverriddenImageSizeFactor = YES; _texelHeight = newValue; [self setFloat:_texelHeight forUniform:texelHeightUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImageAdaptiveThresholdFilter.h ================================================ #import "GPUImageFilterGroup.h" @interface GPUImageAdaptiveThresholdFilter : GPUImageFilterGroup /** A multiplier for the background averaging blur radius in pixels, with a default of 4 */ @property(readwrite, nonatomic) CGFloat blurRadiusInPixels; @end ================================================ FILE: framework/Source/GPUImageAdaptiveThresholdFilter.m ================================================ #import "GPUImageAdaptiveThresholdFilter.h" #import "GPUImageFilter.h" #import "GPUImageTwoInputFilter.h" #import "GPUImageGrayscaleFilter.h" #import "GPUImageBoxBlurFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageAdaptiveThresholdFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; varying highp vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; void main() { highp float blurredInput = texture2D(inputImageTexture, textureCoordinate).r; highp float localLuminance = texture2D(inputImageTexture2, textureCoordinate2).r; highp float thresholdResult = step(blurredInput - 0.05, localLuminance); gl_FragColor = vec4(vec3(thresholdResult), 1.0); } ); #else NSString *const kGPUImageAdaptiveThresholdFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; varying vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; void main() { float blurredInput = texture2D(inputImageTexture, textureCoordinate).r; float localLuminance = texture2D(inputImageTexture2, textureCoordinate2).r; float thresholdResult = step(blurredInput - 0.05, localLuminance); gl_FragColor = vec4(vec3(thresholdResult), 1.0); } ); #endif @interface GPUImageAdaptiveThresholdFilter() { GPUImageBoxBlurFilter *boxBlurFilter; } @end @implementation GPUImageAdaptiveThresholdFilter #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super init])) { return nil; } // First pass: reduce to luminance GPUImageGrayscaleFilter *luminanceFilter = [[GPUImageGrayscaleFilter alloc] init]; [self addFilter:luminanceFilter]; // Second pass: perform a box blur boxBlurFilter = [[GPUImageBoxBlurFilter alloc] init]; [self addFilter:boxBlurFilter]; // Third pass: compare the blurred background luminance to the local value GPUImageFilter *adaptiveThresholdFilter = [[GPUImageTwoInputFilter alloc] initWithFragmentShaderFromString:kGPUImageAdaptiveThresholdFragmentShaderString]; [self addFilter:adaptiveThresholdFilter]; [luminanceFilter addTarget:boxBlurFilter]; [boxBlurFilter addTarget:adaptiveThresholdFilter]; // To prevent double updating of this filter, disable updates from the sharp luminance image side [luminanceFilter addTarget:adaptiveThresholdFilter]; self.initialFilters = [NSArray arrayWithObject:luminanceFilter]; self.terminalFilter = adaptiveThresholdFilter; return self; } #pragma mark - #pragma mark Accessors - (void)setBlurRadiusInPixels:(CGFloat)newValue; { boxBlurFilter.blurRadiusInPixels = newValue; } - (CGFloat)blurRadiusInPixels; { return boxBlurFilter.blurRadiusInPixels; } @end ================================================ FILE: framework/Source/GPUImageAddBlendFilter.h ================================================ #import "GPUImageTwoInputFilter.h" @interface GPUImageAddBlendFilter : GPUImageTwoInputFilter @end ================================================ FILE: framework/Source/GPUImageAddBlendFilter.m ================================================ #import "GPUImageAddBlendFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageAddBlendFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; varying highp vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; void main() { lowp vec4 base = texture2D(inputImageTexture, textureCoordinate); lowp vec4 overlay = texture2D(inputImageTexture2, textureCoordinate2); mediump float r; if (overlay.r * base.a + base.r * overlay.a >= overlay.a * base.a) { r = overlay.a * base.a + overlay.r * (1.0 - base.a) + base.r * (1.0 - overlay.a); } else { r = overlay.r + base.r; } mediump float g; if (overlay.g * base.a + base.g * overlay.a >= overlay.a * base.a) { g = overlay.a * base.a + overlay.g * (1.0 - base.a) + base.g * (1.0 - overlay.a); } else { g = overlay.g + base.g; } mediump float b; if (overlay.b * base.a + base.b * overlay.a >= overlay.a * base.a) { b = overlay.a * base.a + overlay.b * (1.0 - base.a) + base.b * (1.0 - overlay.a); } else { b = overlay.b + base.b; } mediump float a = overlay.a + base.a - overlay.a * base.a; gl_FragColor = vec4(r, g, b, a); } ); #else NSString *const kGPUImageAddBlendFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; varying vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; void main() { vec4 base = texture2D(inputImageTexture, textureCoordinate); vec4 overlay = texture2D(inputImageTexture2, textureCoordinate2); float r; if (overlay.r * base.a + base.r * overlay.a >= overlay.a * base.a) { r = overlay.a * base.a + overlay.r * (1.0 - base.a) + base.r * (1.0 - overlay.a); } else { r = overlay.r + base.r; } float g; if (overlay.g * base.a + base.g * overlay.a >= overlay.a * base.a) { g = overlay.a * base.a + overlay.g * (1.0 - base.a) + base.g * (1.0 - overlay.a); } else { g = overlay.g + base.g; } float b; if (overlay.b * base.a + base.b * overlay.a >= overlay.a * base.a) { b = overlay.a * base.a + overlay.b * (1.0 - base.a) + base.b * (1.0 - overlay.a); } else { b = overlay.b + base.b; } float a = overlay.a + base.a - overlay.a * base.a; gl_FragColor = vec4(r, g, b, a); } ); #endif @implementation GPUImageAddBlendFilter - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageAddBlendFragmentShaderString])) { return nil; } return self; } @end ================================================ FILE: framework/Source/GPUImageAlphaBlendFilter.h ================================================ #import "GPUImageTwoInputFilter.h" @interface GPUImageAlphaBlendFilter : GPUImageTwoInputFilter { GLint mixUniform; } // Mix ranges from 0.0 (only image 1) to 1.0 (only image 2), with 1.0 as the normal level @property(readwrite, nonatomic) CGFloat mix; @end ================================================ FILE: framework/Source/GPUImageAlphaBlendFilter.m ================================================ #import "GPUImageAlphaBlendFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageAlphaBlendFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; varying highp vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; uniform lowp float mixturePercent; void main() { lowp vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); lowp vec4 textureColor2 = texture2D(inputImageTexture2, textureCoordinate2); gl_FragColor = vec4(mix(textureColor.rgb, textureColor2.rgb, textureColor2.a * mixturePercent), textureColor.a); } ); #else NSString *const kGPUImageAlphaBlendFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; varying vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; uniform float mixturePercent; void main() { vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); vec4 textureColor2 = texture2D(inputImageTexture2, textureCoordinate2); gl_FragColor = vec4(mix(textureColor.rgb, textureColor2.rgb, textureColor2.a * mixturePercent), textureColor.a); } ); #endif @implementation GPUImageAlphaBlendFilter @synthesize mix = _mix; - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageAlphaBlendFragmentShaderString])) { return nil; } mixUniform = [filterProgram uniformIndex:@"mixturePercent"]; self.mix = 0.5; return self; } #pragma mark - #pragma mark Accessors - (void)setMix:(CGFloat)newValue; { _mix = newValue; [self setFloat:_mix forUniform:mixUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImageAmatorkaFilter.h ================================================ #import "GPUImageFilterGroup.h" @class GPUImagePicture; /** A photo filter based on Photoshop action by Amatorka http://amatorka.deviantart.com/art/Amatorka-Action-2-121069631 */ // Note: If you want to use this effect you have to add lookup_amatorka.png // from Resources folder to your application bundle. @interface GPUImageAmatorkaFilter : GPUImageFilterGroup { GPUImagePicture *lookupImageSource; } @end ================================================ FILE: framework/Source/GPUImageAmatorkaFilter.m ================================================ #import "GPUImageAmatorkaFilter.h" #import "GPUImagePicture.h" #import "GPUImageLookupFilter.h" @implementation GPUImageAmatorkaFilter - (id)init; { if (!(self = [super init])) { return nil; } #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE UIImage *image = [UIImage imageNamed:@"lookup_amatorka.png"]; #else NSImage *image = [NSImage imageNamed:@"lookup_amatorka.png"]; #endif NSAssert(image, @"To use GPUImageAmatorkaFilter you need to add lookup_amatorka.png from GPUImage/framework/Resources to your application bundle."); lookupImageSource = [[GPUImagePicture alloc] initWithImage:image]; GPUImageLookupFilter *lookupFilter = [[GPUImageLookupFilter alloc] init]; [self addFilter:lookupFilter]; [lookupImageSource addTarget:lookupFilter atTextureLocation:1]; [lookupImageSource processImage]; self.initialFilters = [NSArray arrayWithObjects:lookupFilter, nil]; self.terminalFilter = lookupFilter; return self; } #pragma mark - #pragma mark Accessors @end ================================================ FILE: framework/Source/GPUImageAverageColor.h ================================================ #import "GPUImageFilter.h" extern NSString *const kGPUImageColorAveragingVertexShaderString; @interface GPUImageAverageColor : GPUImageFilter { GLint texelWidthUniform, texelHeightUniform; NSUInteger numberOfStages; GLubyte *rawImagePixels; CGSize finalStageSize; } // This block is called on the completion of color averaging for a frame @property(nonatomic, copy) void(^colorAverageProcessingFinishedBlock)(CGFloat redComponent, CGFloat greenComponent, CGFloat blueComponent, CGFloat alphaComponent, CMTime frameTime); - (void)extractAverageColorAtFrameTime:(CMTime)frameTime; @end ================================================ FILE: framework/Source/GPUImageAverageColor.m ================================================ #import "GPUImageAverageColor.h" NSString *const kGPUImageColorAveragingVertexShaderString = SHADER_STRING ( attribute vec4 position; attribute vec4 inputTextureCoordinate; uniform float texelWidth; uniform float texelHeight; varying vec2 upperLeftInputTextureCoordinate; varying vec2 upperRightInputTextureCoordinate; varying vec2 lowerLeftInputTextureCoordinate; varying vec2 lowerRightInputTextureCoordinate; void main() { gl_Position = position; upperLeftInputTextureCoordinate = inputTextureCoordinate.xy + vec2(-texelWidth, -texelHeight); upperRightInputTextureCoordinate = inputTextureCoordinate.xy + vec2(texelWidth, -texelHeight); lowerLeftInputTextureCoordinate = inputTextureCoordinate.xy + vec2(-texelWidth, texelHeight); lowerRightInputTextureCoordinate = inputTextureCoordinate.xy + vec2(texelWidth, texelHeight); } ); #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageColorAveragingFragmentShaderString = SHADER_STRING ( precision highp float; uniform sampler2D inputImageTexture; varying highp vec2 outputTextureCoordinate; varying highp vec2 upperLeftInputTextureCoordinate; varying highp vec2 upperRightInputTextureCoordinate; varying highp vec2 lowerLeftInputTextureCoordinate; varying highp vec2 lowerRightInputTextureCoordinate; void main() { highp vec4 upperLeftColor = texture2D(inputImageTexture, upperLeftInputTextureCoordinate); highp vec4 upperRightColor = texture2D(inputImageTexture, upperRightInputTextureCoordinate); highp vec4 lowerLeftColor = texture2D(inputImageTexture, lowerLeftInputTextureCoordinate); highp vec4 lowerRightColor = texture2D(inputImageTexture, lowerRightInputTextureCoordinate); gl_FragColor = 0.25 * (upperLeftColor + upperRightColor + lowerLeftColor + lowerRightColor); } ); #else NSString *const kGPUImageColorAveragingFragmentShaderString = SHADER_STRING ( uniform sampler2D inputImageTexture; varying vec2 outputTextureCoordinate; varying vec2 upperLeftInputTextureCoordinate; varying vec2 upperRightInputTextureCoordinate; varying vec2 lowerLeftInputTextureCoordinate; varying vec2 lowerRightInputTextureCoordinate; void main() { vec4 upperLeftColor = texture2D(inputImageTexture, upperLeftInputTextureCoordinate); vec4 upperRightColor = texture2D(inputImageTexture, upperRightInputTextureCoordinate); vec4 lowerLeftColor = texture2D(inputImageTexture, lowerLeftInputTextureCoordinate); vec4 lowerRightColor = texture2D(inputImageTexture, lowerRightInputTextureCoordinate); gl_FragColor = 0.25 * (upperLeftColor + upperRightColor + lowerLeftColor + lowerRightColor); } ); #endif @implementation GPUImageAverageColor @synthesize colorAverageProcessingFinishedBlock = _colorAverageProcessingFinishedBlock; #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super initWithVertexShaderFromString:kGPUImageColorAveragingVertexShaderString fragmentShaderFromString:kGPUImageColorAveragingFragmentShaderString])) { return nil; } texelWidthUniform = [filterProgram uniformIndex:@"texelWidth"]; texelHeightUniform = [filterProgram uniformIndex:@"texelHeight"]; finalStageSize = CGSizeMake(1.0, 1.0); __unsafe_unretained GPUImageAverageColor *weakSelf = self; [self setFrameProcessingCompletionBlock:^(GPUImageOutput *filter, CMTime frameTime) { [weakSelf extractAverageColorAtFrameTime:frameTime]; }]; return self; } - (void)dealloc; { if (rawImagePixels != NULL) { free(rawImagePixels); } } #pragma mark - #pragma mark Managing the display FBOs - (void)renderToTextureWithVertices:(const GLfloat *)vertices textureCoordinates:(const GLfloat *)textureCoordinates; { if (self.preventRendering) { [firstInputFramebuffer unlock]; return; } outputFramebuffer = nil; [GPUImageContext setActiveShaderProgram:filterProgram]; glVertexAttribPointer(filterPositionAttribute, 2, GL_FLOAT, 0, 0, vertices); glVertexAttribPointer(filterTextureCoordinateAttribute, 2, GL_FLOAT, 0, 0, textureCoordinates); GLuint currentTexture = [firstInputFramebuffer texture]; NSUInteger numberOfReductionsInX = floor(log(inputTextureSize.width) / log(4.0)); NSUInteger numberOfReductionsInY = floor(log(inputTextureSize.height) / log(4.0)); NSUInteger reductionsToHitSideLimit = MIN(numberOfReductionsInX, numberOfReductionsInY); for (NSUInteger currentReduction = 0; currentReduction < reductionsToHitSideLimit; currentReduction++) { CGSize currentStageSize = CGSizeMake(floor(inputTextureSize.width / pow(4.0, currentReduction + 1.0)), floor(inputTextureSize.height / pow(4.0, currentReduction + 1.0))); [outputFramebuffer unlock]; outputFramebuffer = [[GPUImageContext sharedFramebufferCache] fetchFramebufferForSize:currentStageSize textureOptions:self.outputTextureOptions onlyTexture:NO]; [outputFramebuffer activateFramebuffer]; glClearColor(0.0f, 0.0f, 0.0f, 1.0f); glClear(GL_COLOR_BUFFER_BIT); glActiveTexture(GL_TEXTURE2); glBindTexture(GL_TEXTURE_2D, currentTexture); glUniform1i(filterInputTextureUniform, 2); glUniform1f(texelWidthUniform, 0.25 / currentStageSize.width); glUniform1f(texelHeightUniform, 0.25 / currentStageSize.height); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); currentTexture = [outputFramebuffer texture]; finalStageSize = currentStageSize; } [firstInputFramebuffer unlock]; } - (void)setInputRotation:(GPUImageRotationMode)newInputRotation atIndex:(NSInteger)textureIndex; { inputRotation = kGPUImageNoRotation; } - (void)extractAverageColorAtFrameTime:(CMTime)frameTime; { runSynchronouslyOnVideoProcessingQueue(^{ // we need a normal color texture for averaging the color values NSAssert(self.outputTextureOptions.internalFormat == GL_RGBA, @"The output texture internal format for this filter must be GL_RGBA."); NSAssert(self.outputTextureOptions.type == GL_UNSIGNED_BYTE, @"The type of the output texture of this filter must be GL_UNSIGNED_BYTE."); NSUInteger totalNumberOfPixels = round(finalStageSize.width * finalStageSize.height); if (rawImagePixels == NULL) { rawImagePixels = (GLubyte *)malloc(totalNumberOfPixels * 4); } [GPUImageContext useImageProcessingContext]; [outputFramebuffer activateFramebuffer]; glReadPixels(0, 0, (int)finalStageSize.width, (int)finalStageSize.height, GL_RGBA, GL_UNSIGNED_BYTE, rawImagePixels); NSUInteger redTotal = 0, greenTotal = 0, blueTotal = 0, alphaTotal = 0; NSUInteger byteIndex = 0; for (NSUInteger currentPixel = 0; currentPixel < totalNumberOfPixels; currentPixel++) { redTotal += rawImagePixels[byteIndex++]; greenTotal += rawImagePixels[byteIndex++]; blueTotal += rawImagePixels[byteIndex++]; alphaTotal += rawImagePixels[byteIndex++]; } CGFloat normalizedRedTotal = (CGFloat)redTotal / (CGFloat)totalNumberOfPixels / 255.0; CGFloat normalizedGreenTotal = (CGFloat)greenTotal / (CGFloat)totalNumberOfPixels / 255.0; CGFloat normalizedBlueTotal = (CGFloat)blueTotal / (CGFloat)totalNumberOfPixels / 255.0; CGFloat normalizedAlphaTotal = (CGFloat)alphaTotal / (CGFloat)totalNumberOfPixels / 255.0; if (_colorAverageProcessingFinishedBlock != NULL) { _colorAverageProcessingFinishedBlock(normalizedRedTotal, normalizedGreenTotal, normalizedBlueTotal, normalizedAlphaTotal, frameTime); } }); } @end ================================================ FILE: framework/Source/GPUImageAverageLuminanceThresholdFilter.h ================================================ #import "GPUImageFilterGroup.h" @interface GPUImageAverageLuminanceThresholdFilter : GPUImageFilterGroup // This is multiplied by the continually calculated average image luminosity to arrive at the final threshold. Default is 1.0. @property(readwrite, nonatomic) CGFloat thresholdMultiplier; @end ================================================ FILE: framework/Source/GPUImageAverageLuminanceThresholdFilter.m ================================================ #import "GPUImageAverageLuminanceThresholdFilter.h" #import "GPUImageLuminosity.h" #import "GPUImageLuminanceThresholdFilter.h" @interface GPUImageAverageLuminanceThresholdFilter() { GPUImageLuminosity *luminosityFilter; GPUImageLuminanceThresholdFilter *luminanceThresholdFilter; } @end @implementation GPUImageAverageLuminanceThresholdFilter @synthesize thresholdMultiplier = _thresholdMultiplier; #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super init])) { return nil; } self.thresholdMultiplier = 1.0; luminosityFilter = [[GPUImageLuminosity alloc] init]; [self addFilter:luminosityFilter]; luminanceThresholdFilter = [[GPUImageLuminanceThresholdFilter alloc] init]; [self addFilter:luminanceThresholdFilter]; __unsafe_unretained GPUImageAverageLuminanceThresholdFilter *weakSelf = self; __unsafe_unretained GPUImageLuminanceThresholdFilter *weakThreshold = luminanceThresholdFilter; [luminosityFilter setLuminosityProcessingFinishedBlock:^(CGFloat luminosity, CMTime frameTime) { weakThreshold.threshold = luminosity * weakSelf.thresholdMultiplier; }]; self.initialFilters = [NSArray arrayWithObjects:luminosityFilter, luminanceThresholdFilter, nil]; self.terminalFilter = luminanceThresholdFilter; return self; } @end ================================================ FILE: framework/Source/GPUImageBilateralFilter.h ================================================ #import "GPUImageGaussianBlurFilter.h" @interface GPUImageBilateralFilter : GPUImageGaussianBlurFilter { CGFloat firstDistanceNormalizationFactorUniform; CGFloat secondDistanceNormalizationFactorUniform; } // A normalization factor for the distance between central color and sample color. @property(nonatomic, readwrite) CGFloat distanceNormalizationFactor; @end ================================================ FILE: framework/Source/GPUImageBilateralFilter.m ================================================ #import "GPUImageBilateralFilter.h" NSString *const kGPUImageBilateralBlurVertexShaderString = SHADER_STRING ( attribute vec4 position; attribute vec4 inputTextureCoordinate; const int GAUSSIAN_SAMPLES = 9; uniform float texelWidthOffset; uniform float texelHeightOffset; varying vec2 textureCoordinate; varying vec2 blurCoordinates[GAUSSIAN_SAMPLES]; void main() { gl_Position = position; textureCoordinate = inputTextureCoordinate.xy; // Calculate the positions for the blur int multiplier = 0; vec2 blurStep; vec2 singleStepOffset = vec2(texelWidthOffset, texelHeightOffset); for (int i = 0; i < GAUSSIAN_SAMPLES; i++) { multiplier = (i - ((GAUSSIAN_SAMPLES - 1) / 2)); // Blur in x (horizontal) blurStep = float(multiplier) * singleStepOffset; blurCoordinates[i] = inputTextureCoordinate.xy + blurStep; } } ); #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageBilateralFilterFragmentShaderString = SHADER_STRING ( uniform sampler2D inputImageTexture; const lowp int GAUSSIAN_SAMPLES = 9; varying highp vec2 textureCoordinate; varying highp vec2 blurCoordinates[GAUSSIAN_SAMPLES]; uniform mediump float distanceNormalizationFactor; void main() { lowp vec4 centralColor; lowp float gaussianWeightTotal; lowp vec4 sum; lowp vec4 sampleColor; lowp float distanceFromCentralColor; lowp float gaussianWeight; centralColor = texture2D(inputImageTexture, blurCoordinates[4]); gaussianWeightTotal = 0.18; sum = centralColor * 0.18; sampleColor = texture2D(inputImageTexture, blurCoordinates[0]); distanceFromCentralColor = min(distance(centralColor, sampleColor) * distanceNormalizationFactor, 1.0); gaussianWeight = 0.05 * (1.0 - distanceFromCentralColor); gaussianWeightTotal += gaussianWeight; sum += sampleColor * gaussianWeight; sampleColor = texture2D(inputImageTexture, blurCoordinates[1]); distanceFromCentralColor = min(distance(centralColor, sampleColor) * distanceNormalizationFactor, 1.0); gaussianWeight = 0.09 * (1.0 - distanceFromCentralColor); gaussianWeightTotal += gaussianWeight; sum += sampleColor * gaussianWeight; sampleColor = texture2D(inputImageTexture, blurCoordinates[2]); distanceFromCentralColor = min(distance(centralColor, sampleColor) * distanceNormalizationFactor, 1.0); gaussianWeight = 0.12 * (1.0 - distanceFromCentralColor); gaussianWeightTotal += gaussianWeight; sum += sampleColor * gaussianWeight; sampleColor = texture2D(inputImageTexture, blurCoordinates[3]); distanceFromCentralColor = min(distance(centralColor, sampleColor) * distanceNormalizationFactor, 1.0); gaussianWeight = 0.15 * (1.0 - distanceFromCentralColor); gaussianWeightTotal += gaussianWeight; sum += sampleColor * gaussianWeight; sampleColor = texture2D(inputImageTexture, blurCoordinates[5]); distanceFromCentralColor = min(distance(centralColor, sampleColor) * distanceNormalizationFactor, 1.0); gaussianWeight = 0.15 * (1.0 - distanceFromCentralColor); gaussianWeightTotal += gaussianWeight; sum += sampleColor * gaussianWeight; sampleColor = texture2D(inputImageTexture, blurCoordinates[6]); distanceFromCentralColor = min(distance(centralColor, sampleColor) * distanceNormalizationFactor, 1.0); gaussianWeight = 0.12 * (1.0 - distanceFromCentralColor); gaussianWeightTotal += gaussianWeight; sum += sampleColor * gaussianWeight; sampleColor = texture2D(inputImageTexture, blurCoordinates[7]); distanceFromCentralColor = min(distance(centralColor, sampleColor) * distanceNormalizationFactor, 1.0); gaussianWeight = 0.09 * (1.0 - distanceFromCentralColor); gaussianWeightTotal += gaussianWeight; sum += sampleColor * gaussianWeight; sampleColor = texture2D(inputImageTexture, blurCoordinates[8]); distanceFromCentralColor = min(distance(centralColor, sampleColor) * distanceNormalizationFactor, 1.0); gaussianWeight = 0.05 * (1.0 - distanceFromCentralColor); gaussianWeightTotal += gaussianWeight; sum += sampleColor * gaussianWeight; gl_FragColor = sum / gaussianWeightTotal; } ); #else NSString *const kGPUImageBilateralFilterFragmentShaderString = SHADER_STRING ( uniform sampler2D inputImageTexture; const int GAUSSIAN_SAMPLES = 9; varying vec2 textureCoordinate; varying vec2 blurCoordinates[GAUSSIAN_SAMPLES]; uniform float distanceNormalizationFactor; void main() { vec4 centralColor; float gaussianWeightTotal; vec4 sum; vec4 sampleColor; float distanceFromCentralColor; float gaussianWeight; centralColor = texture2D(inputImageTexture, blurCoordinates[4]); gaussianWeightTotal = 0.18; sum = centralColor * 0.18; sampleColor = texture2D(inputImageTexture, blurCoordinates[0]); distanceFromCentralColor = min(distance(centralColor, sampleColor) * distanceNormalizationFactor, 1.0); gaussianWeight = 0.05 * (1.0 - distanceFromCentralColor); gaussianWeightTotal += gaussianWeight; sum += sampleColor * gaussianWeight; sampleColor = texture2D(inputImageTexture, blurCoordinates[1]); distanceFromCentralColor = min(distance(centralColor, sampleColor) * distanceNormalizationFactor, 1.0); gaussianWeight = 0.09 * (1.0 - distanceFromCentralColor); gaussianWeightTotal += gaussianWeight; sum += sampleColor * gaussianWeight; sampleColor = texture2D(inputImageTexture, blurCoordinates[2]); distanceFromCentralColor = min(distance(centralColor, sampleColor) * distanceNormalizationFactor, 1.0); gaussianWeight = 0.12 * (1.0 - distanceFromCentralColor); gaussianWeightTotal += gaussianWeight; sum += sampleColor * gaussianWeight; sampleColor = texture2D(inputImageTexture, blurCoordinates[3]); distanceFromCentralColor = min(distance(centralColor, sampleColor) * distanceNormalizationFactor, 1.0); gaussianWeight = 0.15 * (1.0 - distanceFromCentralColor); gaussianWeightTotal += gaussianWeight; sum += sampleColor * gaussianWeight; sampleColor = texture2D(inputImageTexture, blurCoordinates[5]); distanceFromCentralColor = min(distance(centralColor, sampleColor) * distanceNormalizationFactor, 1.0); gaussianWeight = 0.15 * (1.0 - distanceFromCentralColor); gaussianWeightTotal += gaussianWeight; sum += sampleColor * gaussianWeight; sampleColor = texture2D(inputImageTexture, blurCoordinates[6]); distanceFromCentralColor = min(distance(centralColor, sampleColor) * distanceNormalizationFactor, 1.0); gaussianWeight = 0.12 * (1.0 - distanceFromCentralColor); gaussianWeightTotal += gaussianWeight; sum += sampleColor * gaussianWeight; sampleColor = texture2D(inputImageTexture, blurCoordinates[7]); distanceFromCentralColor = min(distance(centralColor, sampleColor) * distanceNormalizationFactor, 1.0); gaussianWeight = 0.09 * (1.0 - distanceFromCentralColor); gaussianWeightTotal += gaussianWeight; sum += sampleColor * gaussianWeight; sampleColor = texture2D(inputImageTexture, blurCoordinates[8]); distanceFromCentralColor = min(distance(centralColor, sampleColor) * distanceNormalizationFactor, 1.0); gaussianWeight = 0.05 * (1.0 - distanceFromCentralColor); gaussianWeightTotal += gaussianWeight; sum += sampleColor * gaussianWeight; gl_FragColor = sum / gaussianWeightTotal; } ); #endif @implementation GPUImageBilateralFilter @synthesize distanceNormalizationFactor = _distanceNormalizationFactor; - (id)init; { if (!(self = [super initWithFirstStageVertexShaderFromString:kGPUImageBilateralBlurVertexShaderString firstStageFragmentShaderFromString:kGPUImageBilateralFilterFragmentShaderString secondStageVertexShaderFromString:kGPUImageBilateralBlurVertexShaderString secondStageFragmentShaderFromString:kGPUImageBilateralFilterFragmentShaderString])) { return nil; } firstDistanceNormalizationFactorUniform = [filterProgram uniformIndex:@"distanceNormalizationFactor"]; secondDistanceNormalizationFactorUniform = [filterProgram uniformIndex:@"distanceNormalizationFactor"]; self.texelSpacingMultiplier = 4.0; self.distanceNormalizationFactor = 8.0; return self; } #pragma mark - #pragma mark Accessors - (void)setDistanceNormalizationFactor:(CGFloat)newValue { _distanceNormalizationFactor = newValue; [self setFloat:newValue forUniform:firstDistanceNormalizationFactorUniform program:filterProgram]; [self setFloat:newValue forUniform:secondDistanceNormalizationFactorUniform program:secondFilterProgram]; } @end ================================================ FILE: framework/Source/GPUImageBoxBlurFilter.h ================================================ #import "GPUImageGaussianBlurFilter.h" /** A hardware-accelerated box blur of an image */ @interface GPUImageBoxBlurFilter : GPUImageGaussianBlurFilter @end ================================================ FILE: framework/Source/GPUImageBoxBlurFilter.m ================================================ #import "GPUImageBoxBlurFilter.h" @implementation GPUImageBoxBlurFilter + (NSString *)vertexShaderForOptimizedBlurOfRadius:(NSUInteger)blurRadius sigma:(CGFloat)sigma; { if (blurRadius < 1) { return kGPUImageVertexShaderString; } // From these weights we calculate the offsets to read interpolated values from NSUInteger numberOfOptimizedOffsets = MIN(blurRadius / 2 + (blurRadius % 2), 7); NSMutableString *shaderString = [[NSMutableString alloc] init]; // Header [shaderString appendFormat:@"\ attribute vec4 position;\n\ attribute vec4 inputTextureCoordinate;\n\ \n\ uniform float texelWidthOffset;\n\ uniform float texelHeightOffset;\n\ \n\ varying vec2 blurCoordinates[%lu];\n\ \n\ void main()\n\ {\n\ gl_Position = position;\n\ \n\ vec2 singleStepOffset = vec2(texelWidthOffset, texelHeightOffset);\n", (unsigned long)(1 + (numberOfOptimizedOffsets * 2))]; // Inner offset loop [shaderString appendString:@"blurCoordinates[0] = inputTextureCoordinate.xy;\n"]; for (NSUInteger currentOptimizedOffset = 0; currentOptimizedOffset < numberOfOptimizedOffsets; currentOptimizedOffset++) { GLfloat optimizedOffset = (GLfloat)(currentOptimizedOffset * 2) + 1.5; [shaderString appendFormat:@"\ blurCoordinates[%lu] = inputTextureCoordinate.xy + singleStepOffset * %f;\n\ blurCoordinates[%lu] = inputTextureCoordinate.xy - singleStepOffset * %f;\n", (unsigned long)((currentOptimizedOffset * 2) + 1), optimizedOffset, (unsigned long)((currentOptimizedOffset * 2) + 2), optimizedOffset]; } // Footer [shaderString appendString:@"}\n"]; return shaderString; } + (NSString *)fragmentShaderForOptimizedBlurOfRadius:(NSUInteger)blurRadius sigma:(CGFloat)sigma; { if (blurRadius < 1) { return kGPUImagePassthroughFragmentShaderString; } NSUInteger numberOfOptimizedOffsets = MIN(blurRadius / 2 + (blurRadius % 2), 7); NSUInteger trueNumberOfOptimizedOffsets = blurRadius / 2 + (blurRadius % 2); NSMutableString *shaderString = [[NSMutableString alloc] init]; // Header #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE [shaderString appendFormat:@"\ uniform sampler2D inputImageTexture;\n\ uniform highp float texelWidthOffset;\n\ uniform highp float texelHeightOffset;\n\ \n\ varying highp vec2 blurCoordinates[%lu];\n\ \n\ void main()\n\ {\n\ lowp vec4 sum = vec4(0.0);\n", (unsigned long)(1 + (numberOfOptimizedOffsets * 2)) ]; #else [shaderString appendFormat:@"\ uniform sampler2D inputImageTexture;\n\ uniform float texelWidthOffset;\n\ uniform float texelHeightOffset;\n\ \n\ varying vec2 blurCoordinates[%lu];\n\ \n\ void main()\n\ {\n\ vec4 sum = vec4(0.0);\n", 1 + (numberOfOptimizedOffsets * 2) ]; #endif GLfloat boxWeight = 1.0 / (GLfloat)((blurRadius * 2) + 1); // Inner texture loop [shaderString appendFormat:@"sum += texture2D(inputImageTexture, blurCoordinates[0]) * %f;\n", boxWeight]; for (NSUInteger currentBlurCoordinateIndex = 0; currentBlurCoordinateIndex < numberOfOptimizedOffsets; currentBlurCoordinateIndex++) { [shaderString appendFormat:@"sum += texture2D(inputImageTexture, blurCoordinates[%lu]) * %f;\n", (unsigned long)((currentBlurCoordinateIndex * 2) + 1), boxWeight * 2.0]; [shaderString appendFormat:@"sum += texture2D(inputImageTexture, blurCoordinates[%lu]) * %f;\n", (unsigned long)((currentBlurCoordinateIndex * 2) + 2), boxWeight * 2.0]; } // If the number of required samples exceeds the amount we can pass in via varyings, we have to do dependent texture reads in the fragment shader if (trueNumberOfOptimizedOffsets > numberOfOptimizedOffsets) { #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE [shaderString appendString:@"highp vec2 singleStepOffset = vec2(texelWidthOffset, texelHeightOffset);\n"]; #else [shaderString appendString:@"vec2 singleStepOffset = vec2(texelWidthOffset, texelHeightOffset);\n"]; #endif for (NSUInteger currentOverlowTextureRead = numberOfOptimizedOffsets; currentOverlowTextureRead < trueNumberOfOptimizedOffsets; currentOverlowTextureRead++) { GLfloat optimizedOffset = (GLfloat)(currentOverlowTextureRead * 2) + 1.5; [shaderString appendFormat:@"sum += texture2D(inputImageTexture, blurCoordinates[0] + singleStepOffset * %f) * %f;\n", optimizedOffset, boxWeight * 2.0]; [shaderString appendFormat:@"sum += texture2D(inputImageTexture, blurCoordinates[0] - singleStepOffset * %f) * %f;\n", optimizedOffset, boxWeight * 2.0]; } } // Footer [shaderString appendString:@"\ gl_FragColor = sum;\n\ }\n"]; return shaderString; } - (void)setupFilterForSize:(CGSize)filterFrameSize; { [super setupFilterForSize:filterFrameSize]; if (shouldResizeBlurRadiusWithImageSize == YES) { } } #pragma mark - #pragma mark Initialization and teardown - (id)init; { // NSString *currentGaussianBlurVertexShader = [GPUImageGaussianBlurFilter vertexShaderForStandardGaussianOfRadius:4 sigma:2.0]; // NSString *currentGaussianBlurFragmentShader = [GPUImageGaussianBlurFilter fragmentShaderForStandardGaussianOfRadius:4 sigma:2.0]; NSString *currentBoxBlurVertexShader = [[self class] vertexShaderForOptimizedBlurOfRadius:4 sigma:0.0]; NSString *currentBoxBlurFragmentShader = [[self class] fragmentShaderForOptimizedBlurOfRadius:4 sigma:0.0]; if (!(self = [super initWithFirstStageVertexShaderFromString:currentBoxBlurVertexShader firstStageFragmentShaderFromString:currentBoxBlurFragmentShader secondStageVertexShaderFromString:currentBoxBlurVertexShader secondStageFragmentShaderFromString:currentBoxBlurFragmentShader])) { return nil; } _blurRadiusInPixels = 4.0; return self; } #pragma mark - #pragma mark Accessors - (void)setBlurRadiusInPixels:(CGFloat)newValue; { CGFloat newBlurRadius = round(round(newValue / 2.0) * 2.0); // For now, only do even radii if (newBlurRadius != _blurRadiusInPixels) { _blurRadiusInPixels = newBlurRadius; NSString *newGaussianBlurVertexShader = [[self class] vertexShaderForOptimizedBlurOfRadius:_blurRadiusInPixels sigma:0.0]; NSString *newGaussianBlurFragmentShader = [[self class] fragmentShaderForOptimizedBlurOfRadius:_blurRadiusInPixels sigma:0.0]; // NSLog(@"Optimized vertex shader: \n%@", newGaussianBlurVertexShader); // NSLog(@"Optimized fragment shader: \n%@", newGaussianBlurFragmentShader); // [self switchToVertexShader:newGaussianBlurVertexShader fragmentShader:newGaussianBlurFragmentShader]; } shouldResizeBlurRadiusWithImageSize = NO; } @end ================================================ FILE: framework/Source/GPUImageBrightnessFilter.h ================================================ #import "GPUImageFilter.h" @interface GPUImageBrightnessFilter : GPUImageFilter { GLint brightnessUniform; } // Brightness ranges from -1.0 to 1.0, with 0.0 as the normal level @property(readwrite, nonatomic) CGFloat brightness; @end ================================================ FILE: framework/Source/GPUImageBrightnessFilter.m ================================================ #import "GPUImageBrightnessFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageBrightnessFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform lowp float brightness; void main() { lowp vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); gl_FragColor = vec4((textureColor.rgb + vec3(brightness)), textureColor.w); } ); #else NSString *const kGPUImageBrightnessFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform float brightness; void main() { vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); gl_FragColor = vec4((textureColor.rgb + vec3(brightness)), textureColor.w); } ); #endif @implementation GPUImageBrightnessFilter @synthesize brightness = _brightness; #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageBrightnessFragmentShaderString])) { return nil; } brightnessUniform = [filterProgram uniformIndex:@"brightness"]; self.brightness = 0.0; return self; } #pragma mark - #pragma mark Accessors - (void)setBrightness:(CGFloat)newValue; { _brightness = newValue; [self setFloat:_brightness forUniform:brightnessUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImageBuffer.h ================================================ #import "GPUImageFilter.h" @interface GPUImageBuffer : GPUImageFilter { NSMutableArray *bufferedFramebuffers; } @property(readwrite, nonatomic) NSUInteger bufferSize; @end ================================================ FILE: framework/Source/GPUImageBuffer.m ================================================ #import "GPUImageBuffer.h" @interface GPUImageBuffer() @end @implementation GPUImageBuffer @synthesize bufferSize = _bufferSize; #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [self initWithFragmentShaderFromString:kGPUImagePassthroughFragmentShaderString])) { return nil; } bufferedFramebuffers = [[NSMutableArray alloc] init]; // [bufferedTextures addObject:[NSNumber numberWithInt:outputTexture]]; _bufferSize = 1; return self; } - (void)dealloc { for (GPUImageFramebuffer *currentFramebuffer in bufferedFramebuffers) { [currentFramebuffer unlock]; } } #pragma mark - #pragma mark GPUImageInput - (void)newFrameReadyAtTime:(CMTime)frameTime atIndex:(NSInteger)textureIndex; { if ([bufferedFramebuffers count] >= _bufferSize) { outputFramebuffer = [bufferedFramebuffers objectAtIndex:0]; [bufferedFramebuffers removeObjectAtIndex:0]; } else { // Nothing yet in the buffer, so don't process further until the buffer is full outputFramebuffer = firstInputFramebuffer; [firstInputFramebuffer lock]; } [bufferedFramebuffers addObject:firstInputFramebuffer]; // Need to pass along rotation information, as we're just holding on to buffered framebuffers and not rotating them ourselves for (id currentTarget in targets) { if (currentTarget != self.targetToIgnoreForUpdates) { NSInteger indexOfObject = [targets indexOfObject:currentTarget]; NSInteger textureIndex = [[targetTextureIndices objectAtIndex:indexOfObject] integerValue]; [currentTarget setInputRotation:inputRotation atIndex:textureIndex]; } } // Let the downstream video elements see the previous frame from the buffer before rendering a new one into place [self informTargetsAboutNewFrameAtTime:frameTime]; // [self renderToTextureWithVertices:imageVertices textureCoordinates:[[self class] textureCoordinatesForRotation:inputRotation]]; } - (void)renderToTextureWithVertices:(const GLfloat *)vertices textureCoordinates:(const GLfloat *)textureCoordinates; { // No need to render to another texture anymore, since we'll be hanging on to the textures in our buffer } #pragma mark - #pragma mark Accessors - (void)setBufferSize:(NSUInteger)newValue; { if ( (newValue == _bufferSize) || (newValue < 1) ) { return; } if (newValue > _bufferSize) { NSUInteger texturesToAdd = newValue - _bufferSize; for (NSUInteger currentTextureIndex = 0; currentTextureIndex < texturesToAdd; currentTextureIndex++) { // TODO: Deal with the growth of the size of the buffer by rotating framebuffers, no textures } } else { NSUInteger texturesToRemove = _bufferSize - newValue; for (NSUInteger currentTextureIndex = 0; currentTextureIndex < texturesToRemove; currentTextureIndex++) { GPUImageFramebuffer *lastFramebuffer = [bufferedFramebuffers lastObject]; [bufferedFramebuffers removeObjectAtIndex:([bufferedFramebuffers count] - 1)]; [lastFramebuffer unlock]; lastFramebuffer = nil; } } _bufferSize = newValue; } @end ================================================ FILE: framework/Source/GPUImageBulgeDistortionFilter.h ================================================ #import "GPUImageFilter.h" /// Creates a bulge distortion on the image @interface GPUImageBulgeDistortionFilter : GPUImageFilter { GLint aspectRatioUniform, radiusUniform, centerUniform, scaleUniform; } /// The center about which to apply the distortion, with a default of (0.5, 0.5) @property(readwrite, nonatomic) CGPoint center; /// The radius of the distortion, ranging from 0.0 to 1.0, with a default of 0.25 @property(readwrite, nonatomic) CGFloat radius; /// The amount of distortion to apply, from -1.0 to 1.0, with a default of 0.5 @property(readwrite, nonatomic) CGFloat scale; @end ================================================ FILE: framework/Source/GPUImageBulgeDistortionFilter.m ================================================ #import "GPUImageBulgeDistortionFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageBulgeDistortionFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform highp float aspectRatio; uniform highp vec2 center; uniform highp float radius; uniform highp float scale; void main() { highp vec2 textureCoordinateToUse = vec2(textureCoordinate.x, ((textureCoordinate.y - center.y) * aspectRatio) + center.y); highp float dist = distance(center, textureCoordinateToUse); textureCoordinateToUse = textureCoordinate; if (dist < radius) { textureCoordinateToUse -= center; highp float percent = 1.0 - ((radius - dist) / radius) * scale; percent = percent * percent; textureCoordinateToUse = textureCoordinateToUse * percent; textureCoordinateToUse += center; } gl_FragColor = texture2D(inputImageTexture, textureCoordinateToUse ); } ); #else NSString *const kGPUImageBulgeDistortionFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform float aspectRatio; uniform vec2 center; uniform float radius; uniform float scale; void main() { vec2 textureCoordinateToUse = vec2(textureCoordinate.x, ((textureCoordinate.y - center.y) * aspectRatio) + center.y); float dist = distance(center, textureCoordinateToUse); textureCoordinateToUse = textureCoordinate; if (dist < radius) { textureCoordinateToUse -= center; float percent = 1.0 - ((radius - dist) / radius) * scale; percent = percent * percent; textureCoordinateToUse = textureCoordinateToUse * percent; textureCoordinateToUse += center; } gl_FragColor = texture2D(inputImageTexture, textureCoordinateToUse ); } ); #endif @interface GPUImageBulgeDistortionFilter () - (void)adjustAspectRatio; @property (readwrite, nonatomic) CGFloat aspectRatio; @end @implementation GPUImageBulgeDistortionFilter @synthesize aspectRatio = _aspectRatio; @synthesize center = _center; @synthesize radius = _radius; @synthesize scale = _scale; #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageBulgeDistortionFragmentShaderString])) { return nil; } aspectRatioUniform = [filterProgram uniformIndex:@"aspectRatio"]; radiusUniform = [filterProgram uniformIndex:@"radius"]; scaleUniform = [filterProgram uniformIndex:@"scale"]; centerUniform = [filterProgram uniformIndex:@"center"]; self.radius = 0.25; self.scale = 0.5; self.center = CGPointMake(0.5, 0.5); return self; } #pragma mark - #pragma mark Accessors - (void)adjustAspectRatio; { if (GPUImageRotationSwapsWidthAndHeight(inputRotation)) { [self setAspectRatio:(inputTextureSize.width / inputTextureSize.height)]; } else { [self setAspectRatio:(inputTextureSize.height / inputTextureSize.width)]; } } - (void)forceProcessingAtSize:(CGSize)frameSize; { [super forceProcessingAtSize:frameSize]; [self adjustAspectRatio]; } - (void)setInputSize:(CGSize)newSize atIndex:(NSInteger)textureIndex; { CGSize oldInputSize = inputTextureSize; [super setInputSize:newSize atIndex:textureIndex]; if ( (!CGSizeEqualToSize(oldInputSize, inputTextureSize)) && (!CGSizeEqualToSize(newSize, CGSizeZero)) ) { [self adjustAspectRatio]; } } - (void)setAspectRatio:(CGFloat)newValue; { _aspectRatio = newValue; [self setFloat:_aspectRatio forUniform:aspectRatioUniform program:filterProgram]; } - (void)setInputRotation:(GPUImageRotationMode)newInputRotation atIndex:(NSInteger)textureIndex; { [super setInputRotation:newInputRotation atIndex:textureIndex]; [self setCenter:self.center]; [self adjustAspectRatio]; } - (void)setRadius:(CGFloat)newValue; { _radius = newValue; [self setFloat:_radius forUniform:radiusUniform program:filterProgram]; } - (void)setScale:(CGFloat)newValue; { _scale = newValue; [self setFloat:_scale forUniform:scaleUniform program:filterProgram]; } - (void)setCenter:(CGPoint)newValue; { _center = newValue; CGPoint rotatedPoint = [self rotatedPoint:_center forRotation:inputRotation]; [self setPoint:rotatedPoint forUniform:centerUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImageCGAColorspaceFilter.h ================================================ #import "GPUImageFilter.h" @interface GPUImageCGAColorspaceFilter : GPUImageFilter @end ================================================ FILE: framework/Source/GPUImageCGAColorspaceFilter.m ================================================ // // GPUImageCGAColorspaceFilter.m // #import "GPUImageCGAColorspaceFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageCGAColorspaceFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; void main() { highp vec2 sampleDivisor = vec2(1.0 / 200.0, 1.0 / 320.0); //highp vec4 colorDivisor = vec4(colorDepth); highp vec2 samplePos = textureCoordinate - mod(textureCoordinate, sampleDivisor); highp vec4 color = texture2D(inputImageTexture, samplePos ); //gl_FragColor = texture2D(inputImageTexture, samplePos ); mediump vec4 colorCyan = vec4(85.0 / 255.0, 1.0, 1.0, 1.0); mediump vec4 colorMagenta = vec4(1.0, 85.0 / 255.0, 1.0, 1.0); mediump vec4 colorWhite = vec4(1.0, 1.0, 1.0, 1.0); mediump vec4 colorBlack = vec4(0.0, 0.0, 0.0, 1.0); mediump vec4 endColor; highp float blackDistance = distance(color, colorBlack); highp float whiteDistance = distance(color, colorWhite); highp float magentaDistance = distance(color, colorMagenta); highp float cyanDistance = distance(color, colorCyan); mediump vec4 finalColor; highp float colorDistance = min(magentaDistance, cyanDistance); colorDistance = min(colorDistance, whiteDistance); colorDistance = min(colorDistance, blackDistance); if (colorDistance == blackDistance) { finalColor = colorBlack; } else if (colorDistance == whiteDistance) { finalColor = colorWhite; } else if (colorDistance == cyanDistance) { finalColor = colorCyan; } else { finalColor = colorMagenta; } gl_FragColor = finalColor; } ); #else NSString *const kGPUImageCGAColorspaceFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; void main() { vec2 sampleDivisor = vec2(1.0 / 200.0, 1.0 / 320.0); //highp vec4 colorDivisor = vec4(colorDepth); vec2 samplePos = textureCoordinate - mod(textureCoordinate, sampleDivisor); vec4 color = texture2D(inputImageTexture, samplePos ); //gl_FragColor = texture2D(inputImageTexture, samplePos ); vec4 colorCyan = vec4(85.0 / 255.0, 1.0, 1.0, 1.0); vec4 colorMagenta = vec4(1.0, 85.0 / 255.0, 1.0, 1.0); vec4 colorWhite = vec4(1.0, 1.0, 1.0, 1.0); vec4 colorBlack = vec4(0.0, 0.0, 0.0, 1.0); vec4 endColor; float blackDistance = distance(color, colorBlack); float whiteDistance = distance(color, colorWhite); float magentaDistance = distance(color, colorMagenta); float cyanDistance = distance(color, colorCyan); vec4 finalColor; float colorDistance = min(magentaDistance, cyanDistance); colorDistance = min(colorDistance, whiteDistance); colorDistance = min(colorDistance, blackDistance); if (colorDistance == blackDistance) { finalColor = colorBlack; } else if (colorDistance == whiteDistance) { finalColor = colorWhite; } else if (colorDistance == cyanDistance) { finalColor = colorCyan; } else { finalColor = colorMagenta; } gl_FragColor = finalColor; } ); #endif @implementation GPUImageCGAColorspaceFilter - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageCGAColorspaceFragmentShaderString])) { return nil; } return self; } @end ================================================ FILE: framework/Source/GPUImageCannyEdgeDetectionFilter.h ================================================ #import "GPUImageFilterGroup.h" @class GPUImageGrayscaleFilter; @class GPUImageSingleComponentGaussianBlurFilter; @class GPUImageDirectionalSobelEdgeDetectionFilter; @class GPUImageDirectionalNonMaximumSuppressionFilter; @class GPUImageWeakPixelInclusionFilter; /** This applies the edge detection process described by John Canny in Canny, J., A Computational Approach To Edge Detection, IEEE Trans. Pattern Analysis and Machine Intelligence, 8(6):679–698, 1986. and implemented in OpenGL ES by A. Ensor, S. Hall. GPU-based Image Analysis on Mobile Devices. Proceedings of Image and Vision Computing New Zealand 2011. It starts with a conversion to luminance, followed by an accelerated 9-hit Gaussian blur. A Sobel operator is applied to obtain the overall gradient strength in the blurred image, as well as the direction (in texture sampling steps) of the gradient. A non-maximum suppression filter acts along the direction of the gradient, highlighting strong edges that pass the threshold and completely removing those that fail the lower threshold. Finally, pixels from in-between these thresholds are either included in edges or rejected based on neighboring pixels. */ @interface GPUImageCannyEdgeDetectionFilter : GPUImageFilterGroup { GPUImageGrayscaleFilter *luminanceFilter; GPUImageSingleComponentGaussianBlurFilter *blurFilter; GPUImageDirectionalSobelEdgeDetectionFilter *edgeDetectionFilter; GPUImageDirectionalNonMaximumSuppressionFilter *nonMaximumSuppressionFilter; GPUImageWeakPixelInclusionFilter *weakPixelInclusionFilter; } /** The image width and height factors tweak the appearance of the edges. These parameters affect the visibility of the detected edges By default, they match the inverse of the filter size in pixels */ @property(readwrite, nonatomic) CGFloat texelWidth; /** The image width and height factors tweak the appearance of the edges. These parameters affect the visibility of the detected edges By default, they match the inverse of the filter size in pixels */ @property(readwrite, nonatomic) CGFloat texelHeight; /** The underlying blur radius for the Gaussian blur. Default is 2.0. */ @property (readwrite, nonatomic) CGFloat blurRadiusInPixels; /** The underlying blur texel spacing multiplier. Default is 1.0. */ @property (readwrite, nonatomic) CGFloat blurTexelSpacingMultiplier; /** Any edge with a gradient magnitude above this threshold will pass and show up in the final result. */ @property(readwrite, nonatomic) CGFloat upperThreshold; /** Any edge with a gradient magnitude below this threshold will fail and be removed from the final result. */ @property(readwrite, nonatomic) CGFloat lowerThreshold; @end ================================================ FILE: framework/Source/GPUImageCannyEdgeDetectionFilter.m ================================================ #import "GPUImageCannyEdgeDetectionFilter.h" #import "GPUImageGrayscaleFilter.h" #import "GPUImageDirectionalSobelEdgeDetectionFilter.h" #import "GPUImageDirectionalNonMaximumSuppressionFilter.h" #import "GPUImageWeakPixelInclusionFilter.h" #import "GPUImageSingleComponentGaussianBlurFilter.h" @implementation GPUImageCannyEdgeDetectionFilter @synthesize upperThreshold; @synthesize lowerThreshold; @synthesize blurRadiusInPixels; @synthesize blurTexelSpacingMultiplier; @synthesize texelWidth; @synthesize texelHeight; - (id)init; { if (!(self = [super init])) { return nil; } // First pass: convert image to luminance luminanceFilter = [[GPUImageGrayscaleFilter alloc] init]; [self addFilter:luminanceFilter]; // Second pass: apply a variable Gaussian blur blurFilter = [[GPUImageSingleComponentGaussianBlurFilter alloc] init]; [self addFilter:blurFilter]; // Third pass: run the Sobel edge detection, with calculated gradient directions, on this blurred image edgeDetectionFilter = [[GPUImageDirectionalSobelEdgeDetectionFilter alloc] init]; [self addFilter:edgeDetectionFilter]; // Fourth pass: apply non-maximum suppression nonMaximumSuppressionFilter = [[GPUImageDirectionalNonMaximumSuppressionFilter alloc] init]; [self addFilter:nonMaximumSuppressionFilter]; // Fifth pass: include weak pixels to complete edges weakPixelInclusionFilter = [[GPUImageWeakPixelInclusionFilter alloc] init]; [self addFilter:weakPixelInclusionFilter]; [luminanceFilter addTarget:blurFilter]; [blurFilter addTarget:edgeDetectionFilter]; [edgeDetectionFilter addTarget:nonMaximumSuppressionFilter]; [nonMaximumSuppressionFilter addTarget:weakPixelInclusionFilter]; self.initialFilters = [NSArray arrayWithObject:luminanceFilter]; // self.terminalFilter = nonMaximumSuppressionFilter; self.terminalFilter = weakPixelInclusionFilter; self.blurRadiusInPixels = 2.0; self.blurTexelSpacingMultiplier = 1.0; self.upperThreshold = 0.4; self.lowerThreshold = 0.1; return self; } #pragma mark - #pragma mark Accessors - (void)setBlurRadiusInPixels:(CGFloat)newValue; { blurFilter.blurRadiusInPixels = newValue; } - (CGFloat)blurRadiusInPixels; { return blurFilter.blurRadiusInPixels; } - (void)setBlurTexelSpacingMultiplier:(CGFloat)newValue; { blurFilter.texelSpacingMultiplier = newValue; } - (CGFloat)blurTexelSpacingMultiplier; { return blurFilter.texelSpacingMultiplier; } - (void)setTexelWidth:(CGFloat)newValue; { edgeDetectionFilter.texelWidth = newValue; } - (CGFloat)texelWidth; { return edgeDetectionFilter.texelWidth; } - (void)setTexelHeight:(CGFloat)newValue; { edgeDetectionFilter.texelHeight = newValue; } - (CGFloat)texelHeight; { return edgeDetectionFilter.texelHeight; } - (void)setUpperThreshold:(CGFloat)newValue; { nonMaximumSuppressionFilter.upperThreshold = newValue; } - (CGFloat)upperThreshold; { return nonMaximumSuppressionFilter.upperThreshold; } - (void)setLowerThreshold:(CGFloat)newValue; { nonMaximumSuppressionFilter.lowerThreshold = newValue; } - (CGFloat)lowerThreshold; { return nonMaximumSuppressionFilter.lowerThreshold; } @end ================================================ FILE: framework/Source/GPUImageChromaKeyBlendFilter.h ================================================ #import "GPUImageTwoInputFilter.h" /** Selectively replaces a color in the first image with the second image */ @interface GPUImageChromaKeyBlendFilter : GPUImageTwoInputFilter { GLint colorToReplaceUniform, thresholdSensitivityUniform, smoothingUniform; } /** The threshold sensitivity controls how similar pixels need to be colored to be replaced The default value is 0.3 */ @property(readwrite, nonatomic) CGFloat thresholdSensitivity; /** The degree of smoothing controls how gradually similar colors are replaced in the image The default value is 0.1 */ @property(readwrite, nonatomic) CGFloat smoothing; /** The color to be replaced is specified using individual red, green, and blue components (normalized to 1.0). The default is green: (0.0, 1.0, 0.0). @param redComponent Red component of color to be replaced @param greenComponent Green component of color to be replaced @param blueComponent Blue component of color to be replaced */ - (void)setColorToReplaceRed:(GLfloat)redComponent green:(GLfloat)greenComponent blue:(GLfloat)blueComponent; @end ================================================ FILE: framework/Source/GPUImageChromaKeyBlendFilter.m ================================================ #import "GPUImageChromaKeyBlendFilter.h" // Shader code based on Apple's CIChromaKeyFilter example: https://developer.apple.com/library/mac/#samplecode/CIChromaKeyFilter/Introduction/Intro.html #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageChromaKeyBlendFragmentShaderString = SHADER_STRING ( precision highp float; varying highp vec2 textureCoordinate; varying highp vec2 textureCoordinate2; uniform float thresholdSensitivity; uniform float smoothing; uniform vec3 colorToReplace; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; void main() { vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); vec4 textureColor2 = texture2D(inputImageTexture2, textureCoordinate2); float maskY = 0.2989 * colorToReplace.r + 0.5866 * colorToReplace.g + 0.1145 * colorToReplace.b; float maskCr = 0.7132 * (colorToReplace.r - maskY); float maskCb = 0.5647 * (colorToReplace.b - maskY); float Y = 0.2989 * textureColor.r + 0.5866 * textureColor.g + 0.1145 * textureColor.b; float Cr = 0.7132 * (textureColor.r - Y); float Cb = 0.5647 * (textureColor.b - Y); // float blendValue = 1.0 - smoothstep(thresholdSensitivity - smoothing, thresholdSensitivity , abs(Cr - maskCr) + abs(Cb - maskCb)); float blendValue = 1.0 - smoothstep(thresholdSensitivity, thresholdSensitivity + smoothing, distance(vec2(Cr, Cb), vec2(maskCr, maskCb))); gl_FragColor = mix(textureColor, textureColor2, blendValue); } ); #else NSString *const kGPUImageChromaKeyBlendFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; varying vec2 textureCoordinate2; uniform float thresholdSensitivity; uniform float smoothing; uniform vec3 colorToReplace; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; void main() { vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); vec4 textureColor2 = texture2D(inputImageTexture2, textureCoordinate2); float maskY = 0.2989 * colorToReplace.r + 0.5866 * colorToReplace.g + 0.1145 * colorToReplace.b; float maskCr = 0.7132 * (colorToReplace.r - maskY); float maskCb = 0.5647 * (colorToReplace.b - maskY); float Y = 0.2989 * textureColor.r + 0.5866 * textureColor.g + 0.1145 * textureColor.b; float Cr = 0.7132 * (textureColor.r - Y); float Cb = 0.5647 * (textureColor.b - Y); // float blendValue = 1.0 - smoothstep(thresholdSensitivity - smoothing, thresholdSensitivity , abs(Cr - maskCr) + abs(Cb - maskCb)); float blendValue = 1.0 - smoothstep(thresholdSensitivity, thresholdSensitivity + smoothing, distance(vec2(Cr, Cb), vec2(maskCr, maskCb))); gl_FragColor = mix(textureColor, textureColor2, blendValue); } ); #endif @implementation GPUImageChromaKeyBlendFilter @synthesize thresholdSensitivity = _thresholdSensitivity; @synthesize smoothing = _smoothing; - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageChromaKeyBlendFragmentShaderString])) { return nil; } thresholdSensitivityUniform = [filterProgram uniformIndex:@"thresholdSensitivity"]; smoothingUniform = [filterProgram uniformIndex:@"smoothing"]; colorToReplaceUniform = [filterProgram uniformIndex:@"colorToReplace"]; self.thresholdSensitivity = 0.4; self.smoothing = 0.1; [self setColorToReplaceRed:0.0 green:1.0 blue:0.0]; return self; } #pragma mark - #pragma mark Accessors - (void)setColorToReplaceRed:(GLfloat)redComponent green:(GLfloat)greenComponent blue:(GLfloat)blueComponent; { GPUVector3 colorToReplace = {redComponent, greenComponent, blueComponent}; [self setVec3:colorToReplace forUniform:colorToReplaceUniform program:filterProgram]; } - (void)setThresholdSensitivity:(CGFloat)newValue; { _thresholdSensitivity = newValue; [self setFloat:(GLfloat)_thresholdSensitivity forUniform:thresholdSensitivityUniform program:filterProgram]; } - (void)setSmoothing:(CGFloat)newValue; { _smoothing = newValue; [self setFloat:(GLfloat)_smoothing forUniform:smoothingUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImageChromaKeyFilter.h ================================================ #import "GPUImageFilter.h" @interface GPUImageChromaKeyFilter : GPUImageFilter { GLint colorToReplaceUniform, thresholdSensitivityUniform, smoothingUniform; } /** The threshold sensitivity controls how similar pixels need to be colored to be replaced The default value is 0.3 */ @property(readwrite, nonatomic) CGFloat thresholdSensitivity; /** The degree of smoothing controls how gradually similar colors are replaced in the image The default value is 0.1 */ @property(readwrite, nonatomic) CGFloat smoothing; /** The color to be replaced is specified using individual red, green, and blue components (normalized to 1.0). The default is green: (0.0, 1.0, 0.0). @param redComponent Red component of color to be replaced @param greenComponent Green component of color to be replaced @param blueComponent Blue component of color to be replaced */ - (void)setColorToReplaceRed:(GLfloat)redComponent green:(GLfloat)greenComponent blue:(GLfloat)blueComponent; @end ================================================ FILE: framework/Source/GPUImageChromaKeyFilter.m ================================================ #import "GPUImageChromaKeyFilter.h" // Shader code based on Apple's CIChromaKeyFilter example: https://developer.apple.com/library/mac/#samplecode/CIChromaKeyFilter/Introduction/Intro.html #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageChromaKeyFragmentShaderString = SHADER_STRING ( precision highp float; varying highp vec2 textureCoordinate; uniform float thresholdSensitivity; uniform float smoothing; uniform vec3 colorToReplace; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; void main() { vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); float maskY = 0.2989 * colorToReplace.r + 0.5866 * colorToReplace.g + 0.1145 * colorToReplace.b; float maskCr = 0.7132 * (colorToReplace.r - maskY); float maskCb = 0.5647 * (colorToReplace.b - maskY); float Y = 0.2989 * textureColor.r + 0.5866 * textureColor.g + 0.1145 * textureColor.b; float Cr = 0.7132 * (textureColor.r - Y); float Cb = 0.5647 * (textureColor.b - Y); // float blendValue = 1.0 - smoothstep(thresholdSensitivity - smoothing, thresholdSensitivity , abs(Cr - maskCr) + abs(Cb - maskCb)); float blendValue = smoothstep(thresholdSensitivity, thresholdSensitivity + smoothing, distance(vec2(Cr, Cb), vec2(maskCr, maskCb))); gl_FragColor = vec4(textureColor.rgb, textureColor.a * blendValue); } ); #else NSString *const kGPUImageChromaKeyFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform float thresholdSensitivity; uniform float smoothing; uniform vec3 colorToReplace; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; void main() { vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); float maskY = 0.2989 * colorToReplace.r + 0.5866 * colorToReplace.g + 0.1145 * colorToReplace.b; float maskCr = 0.7132 * (colorToReplace.r - maskY); float maskCb = 0.5647 * (colorToReplace.b - maskY); float Y = 0.2989 * textureColor.r + 0.5866 * textureColor.g + 0.1145 * textureColor.b; float Cr = 0.7132 * (textureColor.r - Y); float Cb = 0.5647 * (textureColor.b - Y); // float blendValue = 1.0 - smoothstep(thresholdSensitivity - smoothing, thresholdSensitivity , abs(Cr - maskCr) + abs(Cb - maskCb)); float blendValue = smoothstep(thresholdSensitivity, thresholdSensitivity + smoothing, distance(vec2(Cr, Cb), vec2(maskCr, maskCb))); gl_FragColor = vec4(textureColor.rgb, textureColor.a * blendValue); } ); #endif @implementation GPUImageChromaKeyFilter @synthesize thresholdSensitivity = _thresholdSensitivity; @synthesize smoothing = _smoothing; - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageChromaKeyFragmentShaderString])) { return nil; } thresholdSensitivityUniform = [filterProgram uniformIndex:@"thresholdSensitivity"]; smoothingUniform = [filterProgram uniformIndex:@"smoothing"]; colorToReplaceUniform = [filterProgram uniformIndex:@"colorToReplace"]; self.thresholdSensitivity = 0.4; self.smoothing = 0.1; [self setColorToReplaceRed:0.0 green:1.0 blue:0.0]; return self; } #pragma mark - #pragma mark Accessors - (void)setColorToReplaceRed:(GLfloat)redComponent green:(GLfloat)greenComponent blue:(GLfloat)blueComponent; { GPUVector3 colorToReplace = {redComponent, greenComponent, blueComponent}; [self setVec3:colorToReplace forUniform:colorToReplaceUniform program:filterProgram]; } - (void)setThresholdSensitivity:(CGFloat)newValue; { _thresholdSensitivity = newValue; [self setFloat:(GLfloat)_thresholdSensitivity forUniform:thresholdSensitivityUniform program:filterProgram]; } - (void)setSmoothing:(CGFloat)newValue; { _smoothing = newValue; [self setFloat:(GLfloat)_smoothing forUniform:smoothingUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImageClosingFilter.h ================================================ #import "GPUImageFilterGroup.h" @class GPUImageErosionFilter; @class GPUImageDilationFilter; // A filter that first performs a dilation on the red channel of an image, followed by an erosion of the same radius. // This helps to filter out smaller dark elements. @interface GPUImageClosingFilter : GPUImageFilterGroup { GPUImageErosionFilter *erosionFilter; GPUImageDilationFilter *dilationFilter; } @property(readwrite, nonatomic) CGFloat verticalTexelSpacing, horizontalTexelSpacing; - (id)initWithRadius:(NSUInteger)radius; @end ================================================ FILE: framework/Source/GPUImageClosingFilter.m ================================================ #import "GPUImageClosingFilter.h" #import "GPUImageErosionFilter.h" #import "GPUImageDilationFilter.h" @implementation GPUImageClosingFilter @synthesize verticalTexelSpacing = _verticalTexelSpacing; @synthesize horizontalTexelSpacing = _horizontalTexelSpacing; - (id)init; { if (!(self = [self initWithRadius:1])) { return nil; } return self; } - (id)initWithRadius:(NSUInteger)radius; { if (!(self = [super init])) { return nil; } // First pass: dilation dilationFilter = [[GPUImageDilationFilter alloc] initWithRadius:radius]; [self addFilter:dilationFilter]; // Second pass: erosion erosionFilter = [[GPUImageErosionFilter alloc] initWithRadius:radius]; [self addFilter:erosionFilter]; [dilationFilter addTarget:erosionFilter]; self.initialFilters = [NSArray arrayWithObjects:dilationFilter, nil]; self.terminalFilter = erosionFilter; return self; } - (void)setVerticalTexelSpacing:(CGFloat)newValue; { _verticalTexelSpacing = newValue; erosionFilter.verticalTexelSpacing = newValue; dilationFilter.verticalTexelSpacing = newValue; } - (void)setHorizontalTexelSpacing:(CGFloat)newValue; { _horizontalTexelSpacing = newValue; erosionFilter.horizontalTexelSpacing = newValue; dilationFilter.horizontalTexelSpacing = newValue; } @end ================================================ FILE: framework/Source/GPUImageColorBlendFilter.h ================================================ #import "GPUImageTwoInputFilter.h" @interface GPUImageColorBlendFilter : GPUImageTwoInputFilter @end ================================================ FILE: framework/Source/GPUImageColorBlendFilter.m ================================================ #import "GPUImageColorBlendFilter.h" /** * Color blend mode based upon pseudo code from the PDF specification. */ #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageColorBlendFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; varying highp vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; highp float lum(lowp vec3 c) { return dot(c, vec3(0.3, 0.59, 0.11)); } lowp vec3 clipcolor(lowp vec3 c) { highp float l = lum(c); lowp float n = min(min(c.r, c.g), c.b); lowp float x = max(max(c.r, c.g), c.b); if (n < 0.0) { c.r = l + ((c.r - l) * l) / (l - n); c.g = l + ((c.g - l) * l) / (l - n); c.b = l + ((c.b - l) * l) / (l - n); } if (x > 1.0) { c.r = l + ((c.r - l) * (1.0 - l)) / (x - l); c.g = l + ((c.g - l) * (1.0 - l)) / (x - l); c.b = l + ((c.b - l) * (1.0 - l)) / (x - l); } return c; } lowp vec3 setlum(lowp vec3 c, highp float l) { highp float d = l - lum(c); c = c + vec3(d); return clipcolor(c); } void main() { highp vec4 baseColor = texture2D(inputImageTexture, textureCoordinate); highp vec4 overlayColor = texture2D(inputImageTexture2, textureCoordinate2); gl_FragColor = vec4(baseColor.rgb * (1.0 - overlayColor.a) + setlum(overlayColor.rgb, lum(baseColor.rgb)) * overlayColor.a, baseColor.a); } ); #else NSString *const kGPUImageColorBlendFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; varying vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; float lum(vec3 c) { return dot(c, vec3(0.3, 0.59, 0.11)); } vec3 clipcolor(vec3 c) { float l = lum(c); float n = min(min(c.r, c.g), c.b); float x = max(max(c.r, c.g), c.b); if (n < 0.0) { c.r = l + ((c.r - l) * l) / (l - n); c.g = l + ((c.g - l) * l) / (l - n); c.b = l + ((c.b - l) * l) / (l - n); } if (x > 1.0) { c.r = l + ((c.r - l) * (1.0 - l)) / (x - l); c.g = l + ((c.g - l) * (1.0 - l)) / (x - l); c.b = l + ((c.b - l) * (1.0 - l)) / (x - l); } return c; } vec3 setlum(vec3 c, float l) { float d = l - lum(c); c = c + vec3(d); return clipcolor(c); } void main() { vec4 baseColor = texture2D(inputImageTexture, textureCoordinate); vec4 overlayColor = texture2D(inputImageTexture2, textureCoordinate2); gl_FragColor = vec4(baseColor.rgb * (1.0 - overlayColor.a) + setlum(overlayColor.rgb, lum(baseColor.rgb)) * overlayColor.a, baseColor.a); } ); #endif @implementation GPUImageColorBlendFilter - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageColorBlendFragmentShaderString])) { return nil; } return self; } @end ================================================ FILE: framework/Source/GPUImageColorBurnBlendFilter.h ================================================ #import "GPUImageTwoInputFilter.h" /** Applies a color burn blend of two images */ @interface GPUImageColorBurnBlendFilter : GPUImageTwoInputFilter { } @end ================================================ FILE: framework/Source/GPUImageColorBurnBlendFilter.m ================================================ #import "GPUImageColorBurnBlendFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageColorBurnBlendFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; varying highp vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; void main() { mediump vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); mediump vec4 textureColor2 = texture2D(inputImageTexture2, textureCoordinate2); mediump vec4 whiteColor = vec4(1.0); gl_FragColor = whiteColor - (whiteColor - textureColor) / textureColor2; } ); #else NSString *const kGPUImageColorBurnBlendFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; varying vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; void main() { vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); vec4 textureColor2 = texture2D(inputImageTexture2, textureCoordinate2); vec4 whiteColor = vec4(1.0); gl_FragColor = whiteColor - (whiteColor - textureColor) / textureColor2; } ); #endif @implementation GPUImageColorBurnBlendFilter - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageColorBurnBlendFragmentShaderString])) { return nil; } return self; } @end ================================================ FILE: framework/Source/GPUImageColorConversion.h ================================================ #ifndef GPUImageColorConversion_h #define GPUImageColorConversion_h extern GLfloat *kColorConversion601; extern GLfloat *kColorConversion601FullRange; extern GLfloat *kColorConversion709; extern NSString *const kGPUImageYUVVideoRangeConversionForRGFragmentShaderString; extern NSString *const kGPUImageYUVFullRangeConversionForLAFragmentShaderString; extern NSString *const kGPUImageYUVVideoRangeConversionForLAFragmentShaderString; #endif /* GPUImageColorConversion_h */ ================================================ FILE: framework/Source/GPUImageColorConversion.m ================================================ #import "GPUImageFilter.h" // Color Conversion Constants (YUV to RGB) including adjustment from 16-235/16-240 (video range) // BT.601, which is the standard for SDTV. GLfloat kColorConversion601Default[] = { 1.164, 1.164, 1.164, 0.0, -0.392, 2.017, 1.596, -0.813, 0.0, }; // BT.601 full range (ref: http://www.equasys.de/colorconversion.html) GLfloat kColorConversion601FullRangeDefault[] = { 1.0, 1.0, 1.0, 0.0, -0.343, 1.765, 1.4, -0.711, 0.0, }; // BT.709, which is the standard for HDTV. GLfloat kColorConversion709Default[] = { 1.164, 1.164, 1.164, 0.0, -0.213, 2.112, 1.793, -0.533, 0.0, }; GLfloat *kColorConversion601 = kColorConversion601Default; GLfloat *kColorConversion601FullRange = kColorConversion601FullRangeDefault; GLfloat *kColorConversion709 = kColorConversion709Default; #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageYUVVideoRangeConversionForRGFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; uniform sampler2D luminanceTexture; uniform sampler2D chrominanceTexture; uniform mediump mat3 colorConversionMatrix; void main() { mediump vec3 yuv; lowp vec3 rgb; yuv.x = texture2D(luminanceTexture, textureCoordinate).r; yuv.yz = texture2D(chrominanceTexture, textureCoordinate).rg - vec2(0.5, 0.5); rgb = colorConversionMatrix * yuv; gl_FragColor = vec4(rgb, 1); } ); #else NSString *const kGPUImageYUVVideoRangeConversionForRGFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D luminanceTexture; uniform sampler2D chrominanceTexture; void main() { vec3 yuv; vec3 rgb; yuv.x = texture2D(luminanceTexture, textureCoordinate).r; yuv.yz = texture2D(chrominanceTexture, textureCoordinate).rg - vec2(0.5, 0.5); // BT.601, which is the standard for SDTV is provided as a reference /* rgb = mat3( 1, 1, 1, 0, -.39465, 2.03211, 1.13983, -.58060, 0) * yuv; */ // Using BT.709 which is the standard for HDTV rgb = mat3( 1, 1, 1, 0, -.21482, 2.12798, 1.28033, -.38059, 0) * yuv; gl_FragColor = vec4(rgb, 1); } ); #endif NSString *const kGPUImageYUVFullRangeConversionForLAFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; uniform sampler2D luminanceTexture; uniform sampler2D chrominanceTexture; uniform mediump mat3 colorConversionMatrix; void main() { mediump vec3 yuv; lowp vec3 rgb; yuv.x = texture2D(luminanceTexture, textureCoordinate).r; yuv.yz = texture2D(chrominanceTexture, textureCoordinate).ra - vec2(0.5, 0.5); rgb = colorConversionMatrix * yuv; gl_FragColor = vec4(rgb, 1); } ); #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageYUVVideoRangeConversionForLAFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; uniform sampler2D luminanceTexture; uniform sampler2D chrominanceTexture; uniform mediump mat3 colorConversionMatrix; void main() { mediump vec3 yuv; lowp vec3 rgb; yuv.x = texture2D(luminanceTexture, textureCoordinate).r - (16.0/255.0); yuv.yz = texture2D(chrominanceTexture, textureCoordinate).ra - vec2(0.5, 0.5); rgb = colorConversionMatrix * yuv; gl_FragColor = vec4(rgb, 1); } ); #else NSString *const kGPUImageYUVVideoRangeConversionForLAFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D luminanceTexture; uniform sampler2D chrominanceTexture; void main() { vec3 yuv; vec3 rgb; yuv.x = texture2D(luminanceTexture, textureCoordinate).r; yuv.yz = texture2D(chrominanceTexture, textureCoordinate).ra - vec2(0.5, 0.5); // BT.601, which is the standard for SDTV is provided as a reference /* rgb = mat3( 1, 1, 1, 0, -.39465, 2.03211, 1.13983, -.58060, 0) * yuv; */ // Using BT.709 which is the standard for HDTV rgb = mat3( 1, 1, 1, 0, -.21482, 2.12798, 1.28033, -.38059, 0) * yuv; gl_FragColor = vec4(rgb, 1); } ); #endif ================================================ FILE: framework/Source/GPUImageColorDodgeBlendFilter.h ================================================ #import "GPUImageTwoInputFilter.h" /** Applies a color dodge blend of two images */ @interface GPUImageColorDodgeBlendFilter : GPUImageTwoInputFilter { } @end ================================================ FILE: framework/Source/GPUImageColorDodgeBlendFilter.m ================================================ #import "GPUImageColorDodgeBlendFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageColorDodgeBlendFragmentShaderString = SHADER_STRING ( precision mediump float; varying highp vec2 textureCoordinate; varying highp vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; void main() { vec4 base = texture2D(inputImageTexture, textureCoordinate); vec4 overlay = texture2D(inputImageTexture2, textureCoordinate2); vec3 baseOverlayAlphaProduct = vec3(overlay.a * base.a); vec3 rightHandProduct = overlay.rgb * (1.0 - base.a) + base.rgb * (1.0 - overlay.a); vec3 firstBlendColor = baseOverlayAlphaProduct + rightHandProduct; vec3 overlayRGB = clamp((overlay.rgb / clamp(overlay.a, 0.01, 1.0)) * step(0.0, overlay.a), 0.0, 0.99); vec3 secondBlendColor = (base.rgb * overlay.a) / (1.0 - overlayRGB) + rightHandProduct; vec3 colorChoice = step((overlay.rgb * base.a + base.rgb * overlay.a), baseOverlayAlphaProduct); gl_FragColor = vec4(mix(firstBlendColor, secondBlendColor, colorChoice), 1.0); } ); #else NSString *const kGPUImageColorDodgeBlendFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; varying vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; void main() { vec4 base = texture2D(inputImageTexture, textureCoordinate); vec4 overlay = texture2D(inputImageTexture2, textureCoordinate2); vec3 baseOverlayAlphaProduct = vec3(overlay.a * base.a); vec3 rightHandProduct = overlay.rgb * (1.0 - base.a) + base.rgb * (1.0 - overlay.a); vec3 firstBlendColor = baseOverlayAlphaProduct + rightHandProduct; vec3 overlayRGB = clamp((overlay.rgb / clamp(overlay.a, 0.01, 1.0)) * step(0.0, overlay.a), 0.0, 0.99); vec3 secondBlendColor = (base.rgb * overlay.a) / (1.0 - overlayRGB) + rightHandProduct; vec3 colorChoice = step((overlay.rgb * base.a + base.rgb * overlay.a), baseOverlayAlphaProduct); gl_FragColor = vec4(mix(firstBlendColor, secondBlendColor, colorChoice), 1.0); } ); #endif @implementation GPUImageColorDodgeBlendFilter - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageColorDodgeBlendFragmentShaderString])) { return nil; } return self; } @end ================================================ FILE: framework/Source/GPUImageColorInvertFilter.h ================================================ #import "GPUImageFilter.h" @interface GPUImageColorInvertFilter : GPUImageFilter { } @end ================================================ FILE: framework/Source/GPUImageColorInvertFilter.m ================================================ #import "GPUImageColorInvertFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageInvertFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; void main() { lowp vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); gl_FragColor = vec4((1.0 - textureColor.rgb), textureColor.w); } ); #else NSString *const kGPUImageInvertFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; void main() { vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); gl_FragColor = vec4((1.0 - textureColor.rgb), textureColor.w); } ); #endif @implementation GPUImageColorInvertFilter - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageInvertFragmentShaderString])) { return nil; } return self; } @end ================================================ FILE: framework/Source/GPUImageColorLocalBinaryPatternFilter.h ================================================ #import "GPUImage3x3TextureSamplingFilter.h" @interface GPUImageColorLocalBinaryPatternFilter : GPUImage3x3TextureSamplingFilter @end ================================================ FILE: framework/Source/GPUImageColorLocalBinaryPatternFilter.m ================================================ #import "GPUImageColorLocalBinaryPatternFilter.h" // This is based on "Accelerating image recognition on mobile devices using GPGPU" by Miguel Bordallo Lopez, Henri Nykanen, Jari Hannuksela, Olli Silven and Markku Vehvilainen // http://www.ee.oulu.fi/~jhannuks/publications/SPIE2011a.pdf // Right pixel is the most significant bit, traveling clockwise to get to the upper right, which is the least significant // If the external pixel is greater than or equal to the center, set to 1, otherwise 0 // // 2 1 0 // 3 7 // 4 5 6 // 01101101 // 76543210 @implementation GPUImageColorLocalBinaryPatternFilter #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageColorLocalBinaryPatternFragmentShaderString = SHADER_STRING ( precision highp float; varying vec2 textureCoordinate; varying vec2 leftTextureCoordinate; varying vec2 rightTextureCoordinate; varying vec2 topTextureCoordinate; varying vec2 topLeftTextureCoordinate; varying vec2 topRightTextureCoordinate; varying vec2 bottomTextureCoordinate; varying vec2 bottomLeftTextureCoordinate; varying vec2 bottomRightTextureCoordinate; uniform sampler2D inputImageTexture; void main() { lowp vec3 centerColor = texture2D(inputImageTexture, textureCoordinate).rgb; lowp vec3 bottomLeftColor = texture2D(inputImageTexture, bottomLeftTextureCoordinate).rgb; lowp vec3 topRightColor = texture2D(inputImageTexture, topRightTextureCoordinate).rgb; lowp vec3 topLeftColor = texture2D(inputImageTexture, topLeftTextureCoordinate).rgb; lowp vec3 bottomRightColor = texture2D(inputImageTexture, bottomRightTextureCoordinate).rgb; lowp vec3 leftColor = texture2D(inputImageTexture, leftTextureCoordinate).rgb; lowp vec3 rightColor = texture2D(inputImageTexture, rightTextureCoordinate).rgb; lowp vec3 bottomColor = texture2D(inputImageTexture, bottomTextureCoordinate).rgb; lowp vec3 topColor = texture2D(inputImageTexture, topTextureCoordinate).rgb; lowp float redByteTally = 1.0 / 255.0 * step(centerColor.r, topRightColor.r); redByteTally += 2.0 / 255.0 * step(centerColor.r, topColor.r); redByteTally += 4.0 / 255.0 * step(centerColor.r, topLeftColor.r); redByteTally += 8.0 / 255.0 * step(centerColor.r, leftColor.r); redByteTally += 16.0 / 255.0 * step(centerColor.r, bottomLeftColor.r); redByteTally += 32.0 / 255.0 * step(centerColor.r, bottomColor.r); redByteTally += 64.0 / 255.0 * step(centerColor.r, bottomRightColor.r); redByteTally += 128.0 / 255.0 * step(centerColor.r, rightColor.r); lowp float blueByteTally = 1.0 / 255.0 * step(centerColor.b, topRightColor.b); blueByteTally += 2.0 / 255.0 * step(centerColor.b, topColor.b); blueByteTally += 4.0 / 255.0 * step(centerColor.b, topLeftColor.b); blueByteTally += 8.0 / 255.0 * step(centerColor.b, leftColor.b); blueByteTally += 16.0 / 255.0 * step(centerColor.b, bottomLeftColor.b); blueByteTally += 32.0 / 255.0 * step(centerColor.b, bottomColor.b); blueByteTally += 64.0 / 255.0 * step(centerColor.b, bottomRightColor.b); blueByteTally += 128.0 / 255.0 * step(centerColor.b, rightColor.b); lowp float greenByteTally = 1.0 / 255.0 * step(centerColor.g, topRightColor.g); greenByteTally += 2.0 / 255.0 * step(centerColor.g, topColor.g); greenByteTally += 4.0 / 255.0 * step(centerColor.g, topLeftColor.g); greenByteTally += 8.0 / 255.0 * step(centerColor.g, leftColor.g); greenByteTally += 16.0 / 255.0 * step(centerColor.g, bottomLeftColor.g); greenByteTally += 32.0 / 255.0 * step(centerColor.g, bottomColor.g); greenByteTally += 64.0 / 255.0 * step(centerColor.g, bottomRightColor.g); greenByteTally += 128.0 / 255.0 * step(centerColor.g, rightColor.g); // TODO: Replace the above with a dot product and two vec4s // TODO: Apply step to a matrix, rather than individually gl_FragColor = vec4(redByteTally, blueByteTally, greenByteTally, 1.0); } ); #else NSString *const kGPUImageColorLocalBinaryPatternFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; varying vec2 leftTextureCoordinate; varying vec2 rightTextureCoordinate; varying vec2 topTextureCoordinate; varying vec2 topLeftTextureCoordinate; varying vec2 topRightTextureCoordinate; varying vec2 bottomTextureCoordinate; varying vec2 bottomLeftTextureCoordinate; varying vec2 bottomRightTextureCoordinate; uniform sampler2D inputImageTexture; void main() { vec3 centerColor = texture2D(inputImageTexture, textureCoordinate).rgb; vec3 bottomLeftColor = texture2D(inputImageTexture, bottomLeftTextureCoordinate).rgb; vec3 topRightColor = texture2D(inputImageTexture, topRightTextureCoordinate).rgb; vec3 topLeftColor = texture2D(inputImageTexture, topLeftTextureCoordinate).rgb; vec3 bottomRightColor = texture2D(inputImageTexture, bottomRightTextureCoordinate).rgb; vec3 leftColor = texture2D(inputImageTexture, leftTextureCoordinate).rgb; vec3 rightColor = texture2D(inputImageTexture, rightTextureCoordinate).rgb; vec3 bottomColor = texture2D(inputImageTexture, bottomTextureCoordinate).rgb; vec3 topColor = texture2D(inputImageTexture, topTextureCoordinate).rgb; float redByteTally = 1.0 / 255.0 * step(centerColor.r, topRightColor.r); redByteTally += 2.0 / 255.0 * step(centerColor.r, topColor.r); redByteTally += 4.0 / 255.0 * step(centerColor.r, topLeftColor.r); redByteTally += 8.0 / 255.0 * step(centerColor.r, leftColor.r); redByteTally += 16.0 / 255.0 * step(centerColor.r, bottomLeftColor.r); redByteTally += 32.0 / 255.0 * step(centerColor.r, bottomColor.r); redByteTally += 64.0 / 255.0 * step(centerColor.r, bottomRightColor.r); redByteTally += 128.0 / 255.0 * step(centerColor.r, rightColor.r); float blueByteTally = 1.0 / 255.0 * step(centerColor.b, topRightColor.b); blueByteTally += 2.0 / 255.0 * step(centerColor.b, topColor.b); blueByteTally += 4.0 / 255.0 * step(centerColor.b, topLeftColor.b); blueByteTally += 8.0 / 255.0 * step(centerColor.b, leftColor.b); blueByteTally += 16.0 / 255.0 * step(centerColor.b, bottomLeftColor.b); blueByteTally += 32.0 / 255.0 * step(centerColor.b, bottomColor.b); blueByteTally += 64.0 / 255.0 * step(centerColor.b, bottomRightColor.b); blueByteTally += 128.0 / 255.0 * step(centerColor.b, rightColor.b); float greenByteTally = 1.0 / 255.0 * step(centerColor.g, topRightColor.g); greenByteTally += 2.0 / 255.0 * step(centerColor.g, topColor.g); greenByteTally += 4.0 / 255.0 * step(centerColor.g, topLeftColor.g); greenByteTally += 8.0 / 255.0 * step(centerColor.g, leftColor.g); greenByteTally += 16.0 / 255.0 * step(centerColor.g, bottomLeftColor.g); greenByteTally += 32.0 / 255.0 * step(centerColor.g, bottomColor.g); greenByteTally += 64.0 / 255.0 * step(centerColor.g, bottomRightColor.g); greenByteTally += 128.0 / 255.0 * step(centerColor.g, rightColor.g); // TODO: Replace the above with a dot product and two vec4s // TODO: Apply step to a matrix, rather than individually gl_FragColor = vec4(redByteTally, blueByteTally, greenByteTally, 1.0); } ); #endif #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageColorLocalBinaryPatternFragmentShaderString])) { return nil; } return self; } @end ================================================ FILE: framework/Source/GPUImageColorMatrixFilter.h ================================================ #import "GPUImageFilter.h" /** Transforms the colors of an image by applying a matrix to them */ @interface GPUImageColorMatrixFilter : GPUImageFilter { GLint colorMatrixUniform; GLint intensityUniform; } /** A 4x4 matrix used to transform each color in an image */ @property(readwrite, nonatomic) GPUMatrix4x4 colorMatrix; /** The degree to which the new transformed color replaces the original color for each pixel */ @property(readwrite, nonatomic) CGFloat intensity; @end ================================================ FILE: framework/Source/GPUImageColorMatrixFilter.m ================================================ #import "GPUImageColorMatrixFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageColorMatrixFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform lowp mat4 colorMatrix; uniform lowp float intensity; void main() { lowp vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); lowp vec4 outputColor = textureColor * colorMatrix; gl_FragColor = (intensity * outputColor) + ((1.0 - intensity) * textureColor); } ); #else NSString *const kGPUImageColorMatrixFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform mat4 colorMatrix; uniform float intensity; void main() { vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); vec4 outputColor = textureColor * colorMatrix; gl_FragColor = (intensity * outputColor) + ((1.0 - intensity) * textureColor); } ); #endif @implementation GPUImageColorMatrixFilter @synthesize intensity = _intensity; @synthesize colorMatrix = _colorMatrix; #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageColorMatrixFragmentShaderString])) { return nil; } colorMatrixUniform = [filterProgram uniformIndex:@"colorMatrix"]; intensityUniform = [filterProgram uniformIndex:@"intensity"]; self.intensity = 1.f; self.colorMatrix = (GPUMatrix4x4){ {1.f, 0.f, 0.f, 0.f}, {0.f, 1.f, 0.f, 0.f}, {0.f, 0.f, 1.f, 0.f}, {0.f, 0.f, 0.f, 1.f} }; return self; } #pragma mark - #pragma mark Accessors - (void)setIntensity:(CGFloat)newIntensity; { _intensity = newIntensity; [self setFloat:_intensity forUniform:intensityUniform program:filterProgram]; } - (void)setColorMatrix:(GPUMatrix4x4)newColorMatrix; { _colorMatrix = newColorMatrix; [self setMatrix4f:_colorMatrix forUniform:colorMatrixUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImageColorPackingFilter.h ================================================ #import "GPUImageFilter.h" @interface GPUImageColorPackingFilter : GPUImageFilter { GLint texelWidthUniform, texelHeightUniform; CGFloat texelWidth, texelHeight; } @end ================================================ FILE: framework/Source/GPUImageColorPackingFilter.m ================================================ #import "GPUImageColorPackingFilter.h" NSString *const kGPUImageColorPackingVertexShaderString = SHADER_STRING ( attribute vec4 position; attribute vec4 inputTextureCoordinate; uniform float texelWidth; uniform float texelHeight; varying vec2 upperLeftInputTextureCoordinate; varying vec2 upperRightInputTextureCoordinate; varying vec2 lowerLeftInputTextureCoordinate; varying vec2 lowerRightInputTextureCoordinate; void main() { gl_Position = position; upperLeftInputTextureCoordinate = inputTextureCoordinate.xy + vec2(-texelWidth, -texelHeight); upperRightInputTextureCoordinate = inputTextureCoordinate.xy + vec2(texelWidth, -texelHeight); lowerLeftInputTextureCoordinate = inputTextureCoordinate.xy + vec2(-texelWidth, texelHeight); lowerRightInputTextureCoordinate = inputTextureCoordinate.xy + vec2(texelWidth, texelHeight); } ); #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageColorPackingFragmentShaderString = SHADER_STRING ( precision lowp float; uniform sampler2D inputImageTexture; uniform mediump mat3 convolutionMatrix; varying highp vec2 outputTextureCoordinate; varying highp vec2 upperLeftInputTextureCoordinate; varying highp vec2 upperRightInputTextureCoordinate; varying highp vec2 lowerLeftInputTextureCoordinate; varying highp vec2 lowerRightInputTextureCoordinate; void main() { float upperLeftIntensity = texture2D(inputImageTexture, upperLeftInputTextureCoordinate).r; float upperRightIntensity = texture2D(inputImageTexture, upperRightInputTextureCoordinate).r; float lowerLeftIntensity = texture2D(inputImageTexture, lowerLeftInputTextureCoordinate).r; float lowerRightIntensity = texture2D(inputImageTexture, lowerRightInputTextureCoordinate).r; gl_FragColor = vec4(upperLeftIntensity, upperRightIntensity, lowerLeftIntensity, lowerRightIntensity); } ); #else NSString *const kGPUImageColorPackingFragmentShaderString = SHADER_STRING ( uniform sampler2D inputImageTexture; uniform mat3 convolutionMatrix; varying vec2 outputTextureCoordinate; varying vec2 upperLeftInputTextureCoordinate; varying vec2 upperRightInputTextureCoordinate; varying vec2 lowerLeftInputTextureCoordinate; varying vec2 lowerRightInputTextureCoordinate; void main() { float upperLeftIntensity = texture2D(inputImageTexture, upperLeftInputTextureCoordinate).r; float upperRightIntensity = texture2D(inputImageTexture, upperRightInputTextureCoordinate).r; float lowerLeftIntensity = texture2D(inputImageTexture, lowerLeftInputTextureCoordinate).r; float lowerRightIntensity = texture2D(inputImageTexture, lowerRightInputTextureCoordinate).r; gl_FragColor = vec4(upperLeftIntensity, upperRightIntensity, lowerLeftIntensity, lowerRightIntensity); } ); #endif @implementation GPUImageColorPackingFilter #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super initWithVertexShaderFromString:kGPUImageColorPackingVertexShaderString fragmentShaderFromString:kGPUImageColorPackingFragmentShaderString])) { return nil; } texelWidthUniform = [filterProgram uniformIndex:@"texelWidth"]; texelHeightUniform = [filterProgram uniformIndex:@"texelHeight"]; return self; } - (void)setupFilterForSize:(CGSize)filterFrameSize; { texelWidth = 0.5 / inputTextureSize.width; texelHeight = 0.5 / inputTextureSize.height; runSynchronouslyOnVideoProcessingQueue(^{ [GPUImageContext setActiveShaderProgram:filterProgram]; glUniform1f(texelWidthUniform, texelWidth); glUniform1f(texelHeightUniform, texelHeight); }); } #pragma mark - #pragma mark Managing the display FBOs - (CGSize)sizeOfFBO; { CGSize outputSize = [self maximumOutputSize]; if ( (CGSizeEqualToSize(outputSize, CGSizeZero)) || (inputTextureSize.width < outputSize.width) ) { CGSize quarterSize; quarterSize.width = inputTextureSize.width / 2.0; quarterSize.height = inputTextureSize.height / 2.0; return quarterSize; } else { return outputSize; } } #pragma mark - #pragma mark Rendering - (CGSize)outputFrameSize; { CGSize quarterSize; quarterSize.width = inputTextureSize.width / 2.0; quarterSize.height = inputTextureSize.height / 2.0; return quarterSize; } @end ================================================ FILE: framework/Source/GPUImageColourFASTFeatureDetector.h ================================================ #import "GPUImageFilterGroup.h" // This generates image-wide feature descriptors using the ColourFAST process, as developed and described in // // A. Ensor and S. Hall. ColourFAST: GPU-based feature point detection and tracking on mobile devices. 28th International Conference of Image and Vision Computing, New Zealand, 2013, p. 124-129. // // Seth Hall, "GPU accelerated feature algorithms for mobile devices", PhD thesis, School of Computing and Mathematical Sciences, Auckland University of Technology 2014. // http://aut.researchgateway.ac.nz/handle/10292/7991 @class GPUImageColourFASTSamplingOperation; @class GPUImageBoxBlurFilter; @interface GPUImageColourFASTFeatureDetector : GPUImageFilterGroup { GPUImageBoxBlurFilter *blurFilter; GPUImageColourFASTSamplingOperation *colourFASTSamplingOperation; } // The blur radius of the underlying box blur. The default is 3.0. @property (readwrite, nonatomic) CGFloat blurRadiusInPixels; @end ================================================ FILE: framework/Source/GPUImageColourFASTFeatureDetector.m ================================================ #import "GPUImageColourFASTFeatureDetector.h" #import "GPUImageColourFASTSamplingOperation.h" #import "GPUImageBoxBlurFilter.h" @implementation GPUImageColourFASTFeatureDetector @synthesize blurRadiusInPixels; - (id)init; { if (!(self = [super init])) { return nil; } // First pass: apply a variable Gaussian blur blurFilter = [[GPUImageBoxBlurFilter alloc] init]; [self addFilter:blurFilter]; // Second pass: combine the blurred image with the original sharp one colourFASTSamplingOperation = [[GPUImageColourFASTSamplingOperation alloc] init]; [self addFilter:colourFASTSamplingOperation]; // Texture location 0 needs to be the sharp image for both the blur and the second stage processing [blurFilter addTarget:colourFASTSamplingOperation atTextureLocation:1]; self.initialFilters = [NSArray arrayWithObjects:blurFilter, colourFASTSamplingOperation, nil]; self.terminalFilter = colourFASTSamplingOperation; self.blurRadiusInPixels = 3.0; return self; } #pragma mark - #pragma mark Accessors - (void)setBlurRadiusInPixels:(CGFloat)newValue; { blurFilter.blurRadiusInPixels = newValue; } - (CGFloat)blurRadiusInPixels; { return blurFilter.blurRadiusInPixels; } @end ================================================ FILE: framework/Source/GPUImageColourFASTSamplingOperation.h ================================================ #import "GPUImageTwoInputFilter.h" // This is the feature extraction phase of the ColourFAST feature detector, as described in: // // A. Ensor and S. Hall. ColourFAST: GPU-based feature point detection and tracking on mobile devices. 28th International Conference of Image and Vision Computing, New Zealand, 2013, p. 124-129. // // Seth Hall, "GPU accelerated feature algorithms for mobile devices", PhD thesis, School of Computing and Mathematical Sciences, Auckland University of Technology 2014. // http://aut.researchgateway.ac.nz/handle/10292/7991 @interface GPUImageColourFASTSamplingOperation : GPUImageTwoInputFilter { GLint texelWidthUniform, texelHeightUniform; CGFloat texelWidth, texelHeight; BOOL hasOverriddenImageSizeFactor; } // The texel width and height determines how far out to sample from this texel. By default, this is the normalized width of a pixel, but this can be overridden for different effects. @property(readwrite, nonatomic) CGFloat texelWidth; @property(readwrite, nonatomic) CGFloat texelHeight; @end ================================================ FILE: framework/Source/GPUImageColourFASTSamplingOperation.m ================================================ #import "GPUImageColourFASTSamplingOperation.h" NSString *const kGPUImageColourFASTSamplingVertexShaderString = SHADER_STRING ( attribute vec4 position; attribute vec4 inputTextureCoordinate; attribute vec4 inputTextureCoordinate2; uniform float texelWidth; uniform float texelHeight; varying vec2 textureCoordinate; varying vec2 pointATextureCoordinate; varying vec2 pointBTextureCoordinate; varying vec2 pointCTextureCoordinate; varying vec2 pointDTextureCoordinate; varying vec2 pointETextureCoordinate; varying vec2 pointFTextureCoordinate; varying vec2 pointGTextureCoordinate; varying vec2 pointHTextureCoordinate; void main() { gl_Position = position; float tripleTexelWidth = 3.0 * texelWidth; float tripleTexelHeight = 3.0 * texelHeight; textureCoordinate = inputTextureCoordinate.xy; pointATextureCoordinate = vec2(textureCoordinate.x + tripleTexelWidth, textureCoordinate.y + texelHeight); pointBTextureCoordinate = vec2(textureCoordinate.x + texelWidth, textureCoordinate.y + tripleTexelHeight); pointCTextureCoordinate = vec2(textureCoordinate.x - texelWidth, textureCoordinate.y + tripleTexelHeight); pointDTextureCoordinate = vec2(textureCoordinate.x - tripleTexelWidth, textureCoordinate.y + texelHeight); pointETextureCoordinate = vec2(textureCoordinate.x - tripleTexelWidth, textureCoordinate.y - texelHeight); pointFTextureCoordinate = vec2(textureCoordinate.x - texelWidth, textureCoordinate.y - tripleTexelHeight); pointGTextureCoordinate = vec2(textureCoordinate.x + texelWidth, textureCoordinate.y - tripleTexelHeight); pointHTextureCoordinate = vec2(textureCoordinate.x + tripleTexelWidth, textureCoordinate.y - texelHeight); } ); #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageColourFASTSamplingFragmentShaderString = SHADER_STRING ( precision highp float; varying vec2 textureCoordinate; varying vec2 pointATextureCoordinate; varying vec2 pointBTextureCoordinate; varying vec2 pointCTextureCoordinate; varying vec2 pointDTextureCoordinate; varying vec2 pointETextureCoordinate; varying vec2 pointFTextureCoordinate; varying vec2 pointGTextureCoordinate; varying vec2 pointHTextureCoordinate; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; const float PITwo = 6.2832; const float PI = 3.1416; void main() { vec3 centerColor = texture2D(inputImageTexture, textureCoordinate).rgb; vec3 pointAColor = texture2D(inputImageTexture, pointATextureCoordinate).rgb; vec3 pointBColor = texture2D(inputImageTexture, pointBTextureCoordinate).rgb; vec3 pointCColor = texture2D(inputImageTexture, pointCTextureCoordinate).rgb; vec3 pointDColor = texture2D(inputImageTexture, pointDTextureCoordinate).rgb; vec3 pointEColor = texture2D(inputImageTexture, pointETextureCoordinate).rgb; vec3 pointFColor = texture2D(inputImageTexture, pointFTextureCoordinate).rgb; vec3 pointGColor = texture2D(inputImageTexture, pointGTextureCoordinate).rgb; vec3 pointHColor = texture2D(inputImageTexture, pointHTextureCoordinate).rgb; vec3 colorComparison = ((pointAColor + pointBColor + pointCColor + pointDColor + pointEColor + pointFColor + pointGColor + pointHColor) * 0.125) - centerColor; // Direction calculation drawn from Appendix B of Seth Hall's Ph.D. thesis vec3 dirX = (pointAColor*0.94868) + (pointBColor*0.316227) - (pointCColor*0.316227) - (pointDColor*0.94868) - (pointEColor*0.94868) - (pointFColor*0.316227) + (pointGColor*0.316227) + (pointHColor*0.94868); vec3 dirY = (pointAColor*0.316227) + (pointBColor*0.94868) + (pointCColor*0.94868) + (pointDColor*0.316227) - (pointEColor*0.316227) - (pointFColor*0.94868) - (pointGColor*0.94868) - (pointHColor*0.316227); vec3 absoluteDifference = abs(colorComparison); float componentLength = length(colorComparison); float avgX = dot(absoluteDifference, dirX) / componentLength; float avgY = dot(absoluteDifference, dirY) / componentLength; float angle = atan(avgY, avgX); vec3 normalizedColorComparison = (colorComparison + 1.0) * 0.5; gl_FragColor = vec4(normalizedColorComparison, (angle+PI)/PITwo); } ); #else NSString *const kGPUImageColourFASTSamplingFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; varying vec2 pointATextureCoordinate; varying vec2 pointBTextureCoordinate; varying vec2 pointCTextureCoordinate; varying vec2 pointDTextureCoordinate; varying vec2 pointETextureCoordinate; varying vec2 pointFTextureCoordinate; varying vec2 pointGTextureCoordinate; varying vec2 pointHTextureCoordinate; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; const float PITwo = 6.2832; const float PI = 3.1416; void main() { vec3 centerColor = texture2D(inputImageTexture, textureCoordinate).rgb; vec3 pointAColor = texture2D(inputImageTexture, pointATextureCoordinate).rgb; vec3 pointBColor = texture2D(inputImageTexture, pointBTextureCoordinate).rgb; vec3 pointCColor = texture2D(inputImageTexture, pointCTextureCoordinate).rgb; vec3 pointDColor = texture2D(inputImageTexture, pointDTextureCoordinate).rgb; vec3 pointEColor = texture2D(inputImageTexture, pointETextureCoordinate).rgb; vec3 pointFColor = texture2D(inputImageTexture, pointFTextureCoordinate).rgb; vec3 pointGColor = texture2D(inputImageTexture, pointGTextureCoordinate).rgb; vec3 pointHColor = texture2D(inputImageTexture, pointHTextureCoordinate).rgb; vec3 colorComparison = ((pointAColor + pointBColor + pointCColor + pointDColor + pointEColor + pointFColor + pointGColor + pointHColor) * 0.125) - centerColor; // Direction calculation drawn from Appendix B of Seth Hall's Ph.D. thesis vec3 dirX = (pointAColor*0.94868) + (pointBColor*0.316227) - (pointCColor*0.316227) - (pointDColor*0.94868) - (pointEColor*0.94868) - (pointFColor*0.316227) + (pointGColor*0.316227) + (pointHColor*0.94868); vec3 dirY = (pointAColor*0.316227) + (pointBColor*0.94868) + (pointCColor*0.94868) + (pointDColor*0.316227) - (pointEColor*0.316227) - (pointFColor*0.94868) - (pointGColor*0.94868) - (pointHColor*0.316227); vec3 absoluteDifference = abs(colorComparison); float componentLength = length(colorComparison); float avgX = dot(absoluteDifference, dirX) / componentLength; float avgY = dot(absoluteDifference, dirY) / componentLength; float angle = atan(avgY, avgX); vec3 normalizedColorComparison = (colorComparison + 1.0) * 0.5; gl_FragColor = vec4(normalizedColorComparison, (angle+PI)/PITwo); } ); #endif @implementation GPUImageColourFASTSamplingOperation @synthesize texelWidth = _texelWidth; @synthesize texelHeight = _texelHeight; #pragma mark - #pragma mark Initialization and teardown - (id)initWithFragmentShaderFromString:(NSString *)fragmentShaderString; { if (!(self = [super initWithVertexShaderFromString:kGPUImageColourFASTSamplingVertexShaderString fragmentShaderFromString:kGPUImageColourFASTSamplingFragmentShaderString])) { return nil; } texelWidthUniform = [filterProgram uniformIndex:@"texelWidth"]; texelHeightUniform = [filterProgram uniformIndex:@"texelHeight"]; return self; } - (void)setupFilterForSize:(CGSize)filterFrameSize; { if (!hasOverriddenImageSizeFactor) { _texelWidth = 1.0 / filterFrameSize.width; _texelHeight = 1.0 / filterFrameSize.height; runSynchronouslyOnVideoProcessingQueue(^{ [GPUImageContext setActiveShaderProgram:filterProgram]; if (GPUImageRotationSwapsWidthAndHeight(inputRotation)) { glUniform1f(texelWidthUniform, _texelHeight); glUniform1f(texelHeightUniform, _texelWidth); } else { glUniform1f(texelWidthUniform, _texelWidth); glUniform1f(texelHeightUniform, _texelHeight); } }); } } #pragma mark - #pragma mark Accessors - (void)setTexelWidth:(CGFloat)newValue; { hasOverriddenImageSizeFactor = YES; _texelWidth = newValue; [self setFloat:_texelWidth forUniform:texelWidthUniform program:filterProgram]; } - (void)setTexelHeight:(CGFloat)newValue; { hasOverriddenImageSizeFactor = YES; _texelHeight = newValue; [self setFloat:_texelHeight forUniform:texelHeightUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImageContrastFilter.h ================================================ #import "GPUImageFilter.h" /** Adjusts the contrast of the image */ @interface GPUImageContrastFilter : GPUImageFilter { GLint contrastUniform; } /** Contrast ranges from 0.0 to 4.0 (max contrast), with 1.0 as the normal level */ @property(readwrite, nonatomic) CGFloat contrast; @end ================================================ FILE: framework/Source/GPUImageContrastFilter.m ================================================ #import "GPUImageContrastFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageContrastFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform lowp float contrast; void main() { lowp vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); gl_FragColor = vec4(((textureColor.rgb - vec3(0.5)) * contrast + vec3(0.5)), textureColor.w); } ); #else NSString *const kGPUImageContrastFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform float contrast; void main() { vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); gl_FragColor = vec4(((textureColor.rgb - vec3(0.5)) * contrast + vec3(0.5)), textureColor.w); } ); #endif @implementation GPUImageContrastFilter @synthesize contrast = _contrast; #pragma mark - #pragma mark Initialization - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageContrastFragmentShaderString])) { return nil; } contrastUniform = [filterProgram uniformIndex:@"contrast"]; self.contrast = 1.0; return self; } #pragma mark - #pragma mark Accessors - (void)setContrast:(CGFloat)newValue; { _contrast = newValue; [self setFloat:_contrast forUniform:contrastUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImageCropFilter.h ================================================ #import "GPUImageFilter.h" @interface GPUImageCropFilter : GPUImageFilter { GLfloat cropTextureCoordinates[8]; } // The crop region is the rectangle within the image to crop. It is normalized to a coordinate space from 0.0 to 1.0, with 0.0, 0.0 being the upper left corner of the image @property(readwrite, nonatomic) CGRect cropRegion; // Initialization and teardown - (id)initWithCropRegion:(CGRect)newCropRegion; @end ================================================ FILE: framework/Source/GPUImageCropFilter.m ================================================ #import "GPUImageCropFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageCropFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; void main() { gl_FragColor = texture2D(inputImageTexture, textureCoordinate); } ); #else NSString *const kGPUImageCropFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; void main() { gl_FragColor = texture2D(inputImageTexture, textureCoordinate); } ); #endif @interface GPUImageCropFilter () - (void)calculateCropTextureCoordinates; @end @interface GPUImageCropFilter() { CGSize originallySuppliedInputSize; } @end @implementation GPUImageCropFilter @synthesize cropRegion = _cropRegion; #pragma mark - #pragma mark Initialization and teardown - (id)initWithCropRegion:(CGRect)newCropRegion; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageCropFragmentShaderString])) { return nil; } self.cropRegion = newCropRegion; return self; } - (id)init; { if (!(self = [self initWithCropRegion:CGRectMake(0.0, 0.0, 1.0, 1.0)])) { return nil; } return self; } #pragma mark - #pragma mark Rendering - (void)setInputSize:(CGSize)newSize atIndex:(NSInteger)textureIndex; { if (self.preventRendering) { return; } // if (overrideInputSize) // { // if (CGSizeEqualToSize(forcedMaximumSize, CGSizeZero)) // { // return; // } // else // { // CGRect insetRect = AVMakeRectWithAspectRatioInsideRect(newSize, CGRectMake(0.0, 0.0, forcedMaximumSize.width, forcedMaximumSize.height)); // inputTextureSize = insetRect.size; // return; // } // } CGSize rotatedSize = [self rotatedSize:newSize forIndex:textureIndex]; originallySuppliedInputSize = rotatedSize; CGSize scaledSize; scaledSize.width = rotatedSize.width * _cropRegion.size.width; scaledSize.height = rotatedSize.height * _cropRegion.size.height; if (CGSizeEqualToSize(scaledSize, CGSizeZero)) { inputTextureSize = scaledSize; } else if (!CGSizeEqualToSize(inputTextureSize, scaledSize)) { inputTextureSize = scaledSize; } } #pragma mark - #pragma mark GPUImageInput - (void)calculateCropTextureCoordinates; { CGFloat minX = _cropRegion.origin.x; CGFloat minY = _cropRegion.origin.y; CGFloat maxX = CGRectGetMaxX(_cropRegion); CGFloat maxY = CGRectGetMaxY(_cropRegion); switch(inputRotation) { case kGPUImageNoRotation: // Works { cropTextureCoordinates[0] = minX; // 0,0 cropTextureCoordinates[1] = minY; cropTextureCoordinates[2] = maxX; // 1,0 cropTextureCoordinates[3] = minY; cropTextureCoordinates[4] = minX; // 0,1 cropTextureCoordinates[5] = maxY; cropTextureCoordinates[6] = maxX; // 1,1 cropTextureCoordinates[7] = maxY; }; break; case kGPUImageRotateLeft: // Fixed { cropTextureCoordinates[0] = maxY; // 1,0 cropTextureCoordinates[1] = 1.0 - maxX; cropTextureCoordinates[2] = maxY; // 1,1 cropTextureCoordinates[3] = 1.0 - minX; cropTextureCoordinates[4] = minY; // 0,0 cropTextureCoordinates[5] = 1.0 - maxX; cropTextureCoordinates[6] = minY; // 0,1 cropTextureCoordinates[7] = 1.0 - minX; }; break; case kGPUImageRotateRight: // Fixed { cropTextureCoordinates[0] = minY; // 0,1 cropTextureCoordinates[1] = 1.0 - minX; cropTextureCoordinates[2] = minY; // 0,0 cropTextureCoordinates[3] = 1.0 - maxX; cropTextureCoordinates[4] = maxY; // 1,1 cropTextureCoordinates[5] = 1.0 - minX; cropTextureCoordinates[6] = maxY; // 1,0 cropTextureCoordinates[7] = 1.0 - maxX; }; break; case kGPUImageFlipVertical: // Works for me { cropTextureCoordinates[0] = minX; // 0,1 cropTextureCoordinates[1] = maxY; cropTextureCoordinates[2] = maxX; // 1,1 cropTextureCoordinates[3] = maxY; cropTextureCoordinates[4] = minX; // 0,0 cropTextureCoordinates[5] = minY; cropTextureCoordinates[6] = maxX; // 1,0 cropTextureCoordinates[7] = minY; }; break; case kGPUImageFlipHorizonal: // Works for me { cropTextureCoordinates[0] = maxX; // 1,0 cropTextureCoordinates[1] = minY; cropTextureCoordinates[2] = minX; // 0,0 cropTextureCoordinates[3] = minY; cropTextureCoordinates[4] = maxX; // 1,1 cropTextureCoordinates[5] = maxY; cropTextureCoordinates[6] = minX; // 0,1 cropTextureCoordinates[7] = maxY; }; break; case kGPUImageRotate180: // Fixed { cropTextureCoordinates[0] = maxX; // 1,1 cropTextureCoordinates[1] = maxY; cropTextureCoordinates[2] = minX; // 0,1 cropTextureCoordinates[3] = maxY; cropTextureCoordinates[4] = maxX; // 1,0 cropTextureCoordinates[5] = minY; cropTextureCoordinates[6] = minX; // 0,0 cropTextureCoordinates[7] = minY; }; break; case kGPUImageRotateRightFlipVertical: // Fixed { cropTextureCoordinates[0] = minY; // 0,0 cropTextureCoordinates[1] = 1.0 - maxX; cropTextureCoordinates[2] = minY; // 0,1 cropTextureCoordinates[3] = 1.0 - minX; cropTextureCoordinates[4] = maxY; // 1,0 cropTextureCoordinates[5] = 1.0 - maxX; cropTextureCoordinates[6] = maxY; // 1,1 cropTextureCoordinates[7] = 1.0 - minX; }; break; case kGPUImageRotateRightFlipHorizontal: // Fixed { cropTextureCoordinates[0] = maxY; // 1,1 cropTextureCoordinates[1] = 1.0 - minX; cropTextureCoordinates[2] = maxY; // 1,0 cropTextureCoordinates[3] = 1.0 - maxX; cropTextureCoordinates[4] = minY; // 0,1 cropTextureCoordinates[5] = 1.0 - minX; cropTextureCoordinates[6] = minY; // 0,0 cropTextureCoordinates[7] = 1.0 - maxX; }; break; } } - (void)newFrameReadyAtTime:(CMTime)frameTime atIndex:(NSInteger)textureIndex; { static const GLfloat cropSquareVertices[] = { -1.0f, -1.0f, 1.0f, -1.0f, -1.0f, 1.0f, 1.0f, 1.0f, }; [self renderToTextureWithVertices:cropSquareVertices textureCoordinates:cropTextureCoordinates]; [self informTargetsAboutNewFrameAtTime:frameTime]; } #pragma mark - #pragma mark Accessors - (void)setCropRegion:(CGRect)newValue; { NSParameterAssert(newValue.origin.x >= 0 && newValue.origin.x <= 1 && newValue.origin.y >= 0 && newValue.origin.y <= 1 && newValue.size.width >= 0 && newValue.size.width <= 1 && newValue.size.height >= 0 && newValue.size.height <= 1); _cropRegion = newValue; [self calculateCropTextureCoordinates]; } - (void)setInputRotation:(GPUImageRotationMode)newInputRotation atIndex:(NSInteger)textureIndex; { [super setInputRotation:newInputRotation atIndex:textureIndex]; [self calculateCropTextureCoordinates]; } @end ================================================ FILE: framework/Source/GPUImageCrosshairGenerator.h ================================================ #import "GPUImageFilter.h" @interface GPUImageCrosshairGenerator : GPUImageFilter { GLint crosshairWidthUniform, crosshairColorUniform; } // The width of the displayed crosshairs, in pixels. Currently this only works well for odd widths. The default is 5. @property(readwrite, nonatomic) CGFloat crosshairWidth; // The color of the crosshairs is specified using individual red, green, and blue components (normalized to 1.0). The default is green: (0.0, 1.0, 0.0). - (void)setCrosshairColorRed:(GLfloat)redComponent green:(GLfloat)greenComponent blue:(GLfloat)blueComponent; // Rendering - (void)renderCrosshairsFromArray:(GLfloat *)crosshairCoordinates count:(NSUInteger)numberOfCrosshairs frameTime:(CMTime)frameTime; @end ================================================ FILE: framework/Source/GPUImageCrosshairGenerator.m ================================================ #import "GPUImageCrosshairGenerator.h" NSString *const kGPUImageCrosshairVertexShaderString = SHADER_STRING ( attribute vec4 position; uniform float crosshairWidth; varying vec2 centerLocation; varying float pointSpacing; void main() { gl_Position = vec4(((position.xy * 2.0) - 1.0), 0.0, 1.0); gl_PointSize = crosshairWidth + 1.0; pointSpacing = 1.0 / crosshairWidth; centerLocation = vec2(pointSpacing * ceil(crosshairWidth / 2.0), pointSpacing * ceil(crosshairWidth / 2.0)); } ); #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageCrosshairFragmentShaderString = SHADER_STRING ( uniform lowp vec3 crosshairColor; varying highp vec2 centerLocation; varying highp float pointSpacing; void main() { lowp vec2 distanceFromCenter = abs(centerLocation - gl_PointCoord.xy); lowp float axisTest = step(pointSpacing, gl_PointCoord.y) * step(distanceFromCenter.x, 0.09) + step(pointSpacing, gl_PointCoord.x) * step(distanceFromCenter.y, 0.09); gl_FragColor = vec4(crosshairColor * axisTest, axisTest); // gl_FragColor = vec4(distanceFromCenterInX, distanceFromCenterInY, 0.0, 1.0); } ); #else NSString *const kGPUImageCrosshairFragmentShaderString = SHADER_STRING ( GPUImageEscapedHashIdentifier(version 120)\n uniform vec3 crosshairColor; varying vec2 centerLocation; varying float pointSpacing; void main() { vec2 distanceFromCenter = abs(centerLocation - gl_PointCoord.xy); float axisTest = step(pointSpacing, gl_PointCoord.y) * step(distanceFromCenter.x, 0.09) + step(pointSpacing, gl_PointCoord.x) * step(distanceFromCenter.y, 0.09); gl_FragColor = vec4(crosshairColor * axisTest, axisTest); // gl_FragColor = vec4(distanceFromCenterInX, distanceFromCenterInY, 0.0, 1.0); } ); #endif @implementation GPUImageCrosshairGenerator @synthesize crosshairWidth = _crosshairWidth; #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super initWithVertexShaderFromString:kGPUImageCrosshairVertexShaderString fragmentShaderFromString:kGPUImageCrosshairFragmentShaderString])) { return nil; } runSynchronouslyOnVideoProcessingQueue(^{ crosshairWidthUniform = [filterProgram uniformIndex:@"crosshairWidth"]; crosshairColorUniform = [filterProgram uniformIndex:@"crosshairColor"]; self.crosshairWidth = 5.0; [self setCrosshairColorRed:0.0 green:1.0 blue:0.0]; }); return self; } #pragma mark - #pragma mark Rendering - (void)renderCrosshairsFromArray:(GLfloat *)crosshairCoordinates count:(NSUInteger)numberOfCrosshairs frameTime:(CMTime)frameTime; { if (self.preventRendering) { return; } runSynchronouslyOnVideoProcessingQueue(^{ [GPUImageContext setActiveShaderProgram:filterProgram]; #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE #else glEnable(GL_POINT_SPRITE); glEnable(GL_VERTEX_PROGRAM_POINT_SIZE); #endif outputFramebuffer = [[GPUImageContext sharedFramebufferCache] fetchFramebufferForSize:[self sizeOfFBO] textureOptions:self.outputTextureOptions onlyTexture:NO]; [outputFramebuffer activateFramebuffer]; glClearColor(0.0, 0.0, 0.0, 0.0); glClear(GL_COLOR_BUFFER_BIT); glVertexAttribPointer(filterPositionAttribute, 2, GL_FLOAT, 0, 0, crosshairCoordinates); glDrawArrays(GL_POINTS, 0, (GLsizei)numberOfCrosshairs); [self informTargetsAboutNewFrameAtTime:frameTime]; }); } - (void)renderToTextureWithVertices:(const GLfloat *)vertices textureCoordinates:(const GLfloat *)textureCoordinates; { // Prevent rendering of the frame by normal means } #pragma mark - #pragma mark Accessors - (void)setCrosshairWidth:(CGFloat)newValue; { _crosshairWidth = newValue; [self setFloat:_crosshairWidth forUniform:crosshairWidthUniform program:filterProgram]; } - (void)setCrosshairColorRed:(GLfloat)redComponent green:(GLfloat)greenComponent blue:(GLfloat)blueComponent; { GPUVector3 crosshairColor = {redComponent, greenComponent, blueComponent}; [self setVec3:crosshairColor forUniform:crosshairColorUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImageCrosshatchFilter.h ================================================ #import "GPUImageFilter.h" @interface GPUImageCrosshatchFilter : GPUImageFilter { GLint crossHatchSpacingUniform, lineWidthUniform; } // The fractional width of the image to use as the spacing for the crosshatch. The default is 0.03. @property(readwrite, nonatomic) CGFloat crossHatchSpacing; // A relative width for the crosshatch lines. The default is 0.003. @property(readwrite, nonatomic) CGFloat lineWidth; @end ================================================ FILE: framework/Source/GPUImageCrosshatchFilter.m ================================================ #import "GPUImageCrosshatchFilter.h" // Shader code based on http://machinesdontcare.wordpress.com/ #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageCrosshatchFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform highp float crossHatchSpacing; uniform highp float lineWidth; const highp vec3 W = vec3(0.2125, 0.7154, 0.0721); void main() { highp float luminance = dot(texture2D(inputImageTexture, textureCoordinate).rgb, W); lowp vec4 colorToDisplay = vec4(1.0, 1.0, 1.0, 1.0); if (luminance < 1.00) { if (mod(textureCoordinate.x + textureCoordinate.y, crossHatchSpacing) <= lineWidth) { colorToDisplay = vec4(0.0, 0.0, 0.0, 1.0); } } if (luminance < 0.75) { if (mod(textureCoordinate.x - textureCoordinate.y, crossHatchSpacing) <= lineWidth) { colorToDisplay = vec4(0.0, 0.0, 0.0, 1.0); } } if (luminance < 0.50) { if (mod(textureCoordinate.x + textureCoordinate.y - (crossHatchSpacing / 2.0), crossHatchSpacing) <= lineWidth) { colorToDisplay = vec4(0.0, 0.0, 0.0, 1.0); } } if (luminance < 0.3) { if (mod(textureCoordinate.x - textureCoordinate.y - (crossHatchSpacing / 2.0), crossHatchSpacing) <= lineWidth) { colorToDisplay = vec4(0.0, 0.0, 0.0, 1.0); } } gl_FragColor = colorToDisplay; } ); #else NSString *const kGPUImageCrosshatchFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform float crossHatchSpacing; uniform float lineWidth; const vec3 W = vec3(0.2125, 0.7154, 0.0721); void main() { float luminance = dot(texture2D(inputImageTexture, textureCoordinate).rgb, W); vec4 colorToDisplay = vec4(1.0, 1.0, 1.0, 1.0); if (luminance < 1.00) { if (mod(textureCoordinate.x + textureCoordinate.y, crossHatchSpacing) <= lineWidth) { colorToDisplay = vec4(0.0, 0.0, 0.0, 1.0); } } if (luminance < 0.75) { if (mod(textureCoordinate.x - textureCoordinate.y, crossHatchSpacing) <= lineWidth) { colorToDisplay = vec4(0.0, 0.0, 0.0, 1.0); } } if (luminance < 0.50) { if (mod(textureCoordinate.x + textureCoordinate.y - (crossHatchSpacing / 2.0), crossHatchSpacing) <= lineWidth) { colorToDisplay = vec4(0.0, 0.0, 0.0, 1.0); } } if (luminance < 0.3) { if (mod(textureCoordinate.x - textureCoordinate.y - (crossHatchSpacing / 2.0), crossHatchSpacing) <= lineWidth) { colorToDisplay = vec4(0.0, 0.0, 0.0, 1.0); } } gl_FragColor = colorToDisplay; } ); #endif @implementation GPUImageCrosshatchFilter @synthesize crossHatchSpacing = _crossHatchSpacing; @synthesize lineWidth = _lineWidth; #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageCrosshatchFragmentShaderString])) { return nil; } crossHatchSpacingUniform = [filterProgram uniformIndex:@"crossHatchSpacing"]; lineWidthUniform = [filterProgram uniformIndex:@"lineWidth"]; self.crossHatchSpacing = 0.03; self.lineWidth = 0.003; return self; } #pragma mark - #pragma mark Accessors - (void)setCrossHatchSpacing:(CGFloat)newValue; { CGFloat singlePixelSpacing; if (inputTextureSize.width != 0.0) { singlePixelSpacing = 1.0 / inputTextureSize.width; } else { singlePixelSpacing = 1.0 / 2048.0; } if (newValue < singlePixelSpacing) { _crossHatchSpacing = singlePixelSpacing; } else { _crossHatchSpacing = newValue; } [self setFloat:_crossHatchSpacing forUniform:crossHatchSpacingUniform program:filterProgram]; } - (void)setLineWidth:(CGFloat)newValue; { _lineWidth = newValue; [self setFloat:_lineWidth forUniform:lineWidthUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImageDarkenBlendFilter.h ================================================ #import "GPUImageTwoInputFilter.h" @interface GPUImageDarkenBlendFilter : GPUImageTwoInputFilter { } @end ================================================ FILE: framework/Source/GPUImageDarkenBlendFilter.m ================================================ #import "GPUImageDarkenBlendFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageDarkenBlendFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; varying highp vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; void main() { lowp vec4 base = texture2D(inputImageTexture, textureCoordinate); lowp vec4 overlayer = texture2D(inputImageTexture2, textureCoordinate2); gl_FragColor = vec4(min(overlayer.rgb * base.a, base.rgb * overlayer.a) + overlayer.rgb * (1.0 - base.a) + base.rgb * (1.0 - overlayer.a), 1.0); } ); #else NSString *const kGPUImageDarkenBlendFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; varying vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; void main() { vec4 base = texture2D(inputImageTexture, textureCoordinate); vec4 overlayer = texture2D(inputImageTexture2, textureCoordinate2); gl_FragColor = vec4(min(overlayer.rgb * base.a, base.rgb * overlayer.a) + overlayer.rgb * (1.0 - base.a) + base.rgb * (1.0 - overlayer.a), 1.0); } ); #endif @implementation GPUImageDarkenBlendFilter - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageDarkenBlendFragmentShaderString])) { return nil; } return self; } @end ================================================ FILE: framework/Source/GPUImageDifferenceBlendFilter.h ================================================ #import "GPUImageTwoInputFilter.h" @interface GPUImageDifferenceBlendFilter : GPUImageTwoInputFilter { } @end ================================================ FILE: framework/Source/GPUImageDifferenceBlendFilter.m ================================================ #import "GPUImageDifferenceBlendFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageDifferenceBlendFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; varying highp vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; void main() { mediump vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); mediump vec4 textureColor2 = texture2D(inputImageTexture2, textureCoordinate2); gl_FragColor = vec4(abs(textureColor2.rgb - textureColor.rgb), textureColor.a); } ); #else NSString *const kGPUImageDifferenceBlendFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; varying vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; void main() { vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); vec4 textureColor2 = texture2D(inputImageTexture2, textureCoordinate2); gl_FragColor = vec4(abs(textureColor2.rgb - textureColor.rgb), textureColor.a); } ); #endif @implementation GPUImageDifferenceBlendFilter - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageDifferenceBlendFragmentShaderString])) { return nil; } return self; } @end ================================================ FILE: framework/Source/GPUImageDilationFilter.h ================================================ #import "GPUImageTwoPassTextureSamplingFilter.h" // For each pixel, this sets it to the maximum value of the red channel in a rectangular neighborhood extending out dilationRadius pixels from the center. // This extends out bright features, and is most commonly used with black-and-white thresholded images. extern NSString *const kGPUImageDilationRadiusOneVertexShaderString; extern NSString *const kGPUImageDilationRadiusTwoVertexShaderString; extern NSString *const kGPUImageDilationRadiusThreeVertexShaderString; extern NSString *const kGPUImageDilationRadiusFourVertexShaderString; @interface GPUImageDilationFilter : GPUImageTwoPassTextureSamplingFilter // Acceptable values for dilationRadius, which sets the distance in pixels to sample out from the center, are 1, 2, 3, and 4. - (id)initWithRadius:(NSUInteger)dilationRadius; @end ================================================ FILE: framework/Source/GPUImageDilationFilter.m ================================================ #import "GPUImageDilationFilter.h" @implementation GPUImageDilationFilter NSString *const kGPUImageDilationRadiusOneVertexShaderString = SHADER_STRING ( attribute vec4 position; attribute vec2 inputTextureCoordinate; uniform float texelWidthOffset; uniform float texelHeightOffset; varying vec2 centerTextureCoordinate; varying vec2 oneStepPositiveTextureCoordinate; varying vec2 oneStepNegativeTextureCoordinate; void main() { gl_Position = position; vec2 offset = vec2(texelWidthOffset, texelHeightOffset); centerTextureCoordinate = inputTextureCoordinate; oneStepNegativeTextureCoordinate = inputTextureCoordinate - offset; oneStepPositiveTextureCoordinate = inputTextureCoordinate + offset; } ); NSString *const kGPUImageDilationRadiusTwoVertexShaderString = SHADER_STRING ( attribute vec4 position; attribute vec2 inputTextureCoordinate; uniform float texelWidthOffset; uniform float texelHeightOffset; varying vec2 centerTextureCoordinate; varying vec2 oneStepPositiveTextureCoordinate; varying vec2 oneStepNegativeTextureCoordinate; varying vec2 twoStepsPositiveTextureCoordinate; varying vec2 twoStepsNegativeTextureCoordinate; void main() { gl_Position = position; vec2 offset = vec2(texelWidthOffset, texelHeightOffset); centerTextureCoordinate = inputTextureCoordinate; oneStepNegativeTextureCoordinate = inputTextureCoordinate - offset; oneStepPositiveTextureCoordinate = inputTextureCoordinate + offset; twoStepsNegativeTextureCoordinate = inputTextureCoordinate - (offset * 2.0); twoStepsPositiveTextureCoordinate = inputTextureCoordinate + (offset * 2.0); } ); NSString *const kGPUImageDilationRadiusThreeVertexShaderString = SHADER_STRING ( attribute vec4 position; attribute vec2 inputTextureCoordinate; uniform float texelWidthOffset; uniform float texelHeightOffset; varying vec2 centerTextureCoordinate; varying vec2 oneStepPositiveTextureCoordinate; varying vec2 oneStepNegativeTextureCoordinate; varying vec2 twoStepsPositiveTextureCoordinate; varying vec2 twoStepsNegativeTextureCoordinate; varying vec2 threeStepsPositiveTextureCoordinate; varying vec2 threeStepsNegativeTextureCoordinate; void main() { gl_Position = position; vec2 offset = vec2(texelWidthOffset, texelHeightOffset); centerTextureCoordinate = inputTextureCoordinate; oneStepNegativeTextureCoordinate = inputTextureCoordinate - offset; oneStepPositiveTextureCoordinate = inputTextureCoordinate + offset; twoStepsNegativeTextureCoordinate = inputTextureCoordinate - (offset * 2.0); twoStepsPositiveTextureCoordinate = inputTextureCoordinate + (offset * 2.0); threeStepsNegativeTextureCoordinate = inputTextureCoordinate - (offset * 3.0); threeStepsPositiveTextureCoordinate = inputTextureCoordinate + (offset * 3.0); } ); NSString *const kGPUImageDilationRadiusFourVertexShaderString = SHADER_STRING ( attribute vec4 position; attribute vec2 inputTextureCoordinate; uniform float texelWidthOffset; uniform float texelHeightOffset; varying vec2 centerTextureCoordinate; varying vec2 oneStepPositiveTextureCoordinate; varying vec2 oneStepNegativeTextureCoordinate; varying vec2 twoStepsPositiveTextureCoordinate; varying vec2 twoStepsNegativeTextureCoordinate; varying vec2 threeStepsPositiveTextureCoordinate; varying vec2 threeStepsNegativeTextureCoordinate; varying vec2 fourStepsPositiveTextureCoordinate; varying vec2 fourStepsNegativeTextureCoordinate; void main() { gl_Position = position; vec2 offset = vec2(texelWidthOffset, texelHeightOffset); centerTextureCoordinate = inputTextureCoordinate; oneStepNegativeTextureCoordinate = inputTextureCoordinate - offset; oneStepPositiveTextureCoordinate = inputTextureCoordinate + offset; twoStepsNegativeTextureCoordinate = inputTextureCoordinate - (offset * 2.0); twoStepsPositiveTextureCoordinate = inputTextureCoordinate + (offset * 2.0); threeStepsNegativeTextureCoordinate = inputTextureCoordinate - (offset * 3.0); threeStepsPositiveTextureCoordinate = inputTextureCoordinate + (offset * 3.0); fourStepsNegativeTextureCoordinate = inputTextureCoordinate - (offset * 4.0); fourStepsPositiveTextureCoordinate = inputTextureCoordinate + (offset * 4.0); } ); #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageDilationRadiusOneFragmentShaderString = SHADER_STRING ( precision lowp float; varying vec2 centerTextureCoordinate; varying vec2 oneStepPositiveTextureCoordinate; varying vec2 oneStepNegativeTextureCoordinate; uniform sampler2D inputImageTexture; void main() { float centerIntensity = texture2D(inputImageTexture, centerTextureCoordinate).r; float oneStepPositiveIntensity = texture2D(inputImageTexture, oneStepPositiveTextureCoordinate).r; float oneStepNegativeIntensity = texture2D(inputImageTexture, oneStepNegativeTextureCoordinate).r; lowp float maxValue = max(centerIntensity, oneStepPositiveIntensity); maxValue = max(maxValue, oneStepNegativeIntensity); gl_FragColor = vec4(vec3(maxValue), 1.0); } ); NSString *const kGPUImageDilationRadiusTwoFragmentShaderString = SHADER_STRING ( precision lowp float; varying vec2 centerTextureCoordinate; varying vec2 oneStepPositiveTextureCoordinate; varying vec2 oneStepNegativeTextureCoordinate; varying vec2 twoStepsPositiveTextureCoordinate; varying vec2 twoStepsNegativeTextureCoordinate; uniform sampler2D inputImageTexture; void main() { float centerIntensity = texture2D(inputImageTexture, centerTextureCoordinate).r; float oneStepPositiveIntensity = texture2D(inputImageTexture, oneStepPositiveTextureCoordinate).r; float oneStepNegativeIntensity = texture2D(inputImageTexture, oneStepNegativeTextureCoordinate).r; float twoStepsPositiveIntensity = texture2D(inputImageTexture, twoStepsPositiveTextureCoordinate).r; float twoStepsNegativeIntensity = texture2D(inputImageTexture, twoStepsNegativeTextureCoordinate).r; lowp float maxValue = max(centerIntensity, oneStepPositiveIntensity); maxValue = max(maxValue, oneStepNegativeIntensity); maxValue = max(maxValue, twoStepsPositiveIntensity); maxValue = max(maxValue, twoStepsNegativeIntensity); gl_FragColor = vec4(vec3(maxValue), 1.0); } ); NSString *const kGPUImageDilationRadiusThreeFragmentShaderString = SHADER_STRING ( precision lowp float; varying vec2 centerTextureCoordinate; varying vec2 oneStepPositiveTextureCoordinate; varying vec2 oneStepNegativeTextureCoordinate; varying vec2 twoStepsPositiveTextureCoordinate; varying vec2 twoStepsNegativeTextureCoordinate; varying vec2 threeStepsPositiveTextureCoordinate; varying vec2 threeStepsNegativeTextureCoordinate; uniform sampler2D inputImageTexture; void main() { float centerIntensity = texture2D(inputImageTexture, centerTextureCoordinate).r; float oneStepPositiveIntensity = texture2D(inputImageTexture, oneStepPositiveTextureCoordinate).r; float oneStepNegativeIntensity = texture2D(inputImageTexture, oneStepNegativeTextureCoordinate).r; float twoStepsPositiveIntensity = texture2D(inputImageTexture, twoStepsPositiveTextureCoordinate).r; float twoStepsNegativeIntensity = texture2D(inputImageTexture, twoStepsNegativeTextureCoordinate).r; float threeStepsPositiveIntensity = texture2D(inputImageTexture, threeStepsPositiveTextureCoordinate).r; float threeStepsNegativeIntensity = texture2D(inputImageTexture, threeStepsNegativeTextureCoordinate).r; lowp float maxValue = max(centerIntensity, oneStepPositiveIntensity); maxValue = max(maxValue, oneStepNegativeIntensity); maxValue = max(maxValue, twoStepsPositiveIntensity); maxValue = max(maxValue, twoStepsNegativeIntensity); maxValue = max(maxValue, threeStepsPositiveIntensity); maxValue = max(maxValue, threeStepsNegativeIntensity); gl_FragColor = vec4(vec3(maxValue), 1.0); } ); NSString *const kGPUImageDilationRadiusFourFragmentShaderString = SHADER_STRING ( precision lowp float; varying vec2 centerTextureCoordinate; varying vec2 oneStepPositiveTextureCoordinate; varying vec2 oneStepNegativeTextureCoordinate; varying vec2 twoStepsPositiveTextureCoordinate; varying vec2 twoStepsNegativeTextureCoordinate; varying vec2 threeStepsPositiveTextureCoordinate; varying vec2 threeStepsNegativeTextureCoordinate; varying vec2 fourStepsPositiveTextureCoordinate; varying vec2 fourStepsNegativeTextureCoordinate; uniform sampler2D inputImageTexture; void main() { float centerIntensity = texture2D(inputImageTexture, centerTextureCoordinate).r; float oneStepPositiveIntensity = texture2D(inputImageTexture, oneStepPositiveTextureCoordinate).r; float oneStepNegativeIntensity = texture2D(inputImageTexture, oneStepNegativeTextureCoordinate).r; float twoStepsPositiveIntensity = texture2D(inputImageTexture, twoStepsPositiveTextureCoordinate).r; float twoStepsNegativeIntensity = texture2D(inputImageTexture, twoStepsNegativeTextureCoordinate).r; float threeStepsPositiveIntensity = texture2D(inputImageTexture, threeStepsPositiveTextureCoordinate).r; float threeStepsNegativeIntensity = texture2D(inputImageTexture, threeStepsNegativeTextureCoordinate).r; float fourStepsPositiveIntensity = texture2D(inputImageTexture, fourStepsPositiveTextureCoordinate).r; float fourStepsNegativeIntensity = texture2D(inputImageTexture, fourStepsNegativeTextureCoordinate).r; lowp float maxValue = max(centerIntensity, oneStepPositiveIntensity); maxValue = max(maxValue, oneStepNegativeIntensity); maxValue = max(maxValue, twoStepsPositiveIntensity); maxValue = max(maxValue, twoStepsNegativeIntensity); maxValue = max(maxValue, threeStepsPositiveIntensity); maxValue = max(maxValue, threeStepsNegativeIntensity); maxValue = max(maxValue, fourStepsPositiveIntensity); maxValue = max(maxValue, fourStepsNegativeIntensity); gl_FragColor = vec4(vec3(maxValue), 1.0); } ); #else NSString *const kGPUImageDilationRadiusOneFragmentShaderString = SHADER_STRING ( varying vec2 centerTextureCoordinate; varying vec2 oneStepPositiveTextureCoordinate; varying vec2 oneStepNegativeTextureCoordinate; uniform sampler2D inputImageTexture; void main() { float centerIntensity = texture2D(inputImageTexture, centerTextureCoordinate).r; float oneStepPositiveIntensity = texture2D(inputImageTexture, oneStepPositiveTextureCoordinate).r; float oneStepNegativeIntensity = texture2D(inputImageTexture, oneStepNegativeTextureCoordinate).r; float maxValue = max(centerIntensity, oneStepPositiveIntensity); maxValue = max(maxValue, oneStepNegativeIntensity); gl_FragColor = vec4(vec3(maxValue), 1.0); } ); NSString *const kGPUImageDilationRadiusTwoFragmentShaderString = SHADER_STRING ( varying vec2 centerTextureCoordinate; varying vec2 oneStepPositiveTextureCoordinate; varying vec2 oneStepNegativeTextureCoordinate; varying vec2 twoStepsPositiveTextureCoordinate; varying vec2 twoStepsNegativeTextureCoordinate; uniform sampler2D inputImageTexture; void main() { float centerIntensity = texture2D(inputImageTexture, centerTextureCoordinate).r; float oneStepPositiveIntensity = texture2D(inputImageTexture, oneStepPositiveTextureCoordinate).r; float oneStepNegativeIntensity = texture2D(inputImageTexture, oneStepNegativeTextureCoordinate).r; float twoStepsPositiveIntensity = texture2D(inputImageTexture, twoStepsPositiveTextureCoordinate).r; float twoStepsNegativeIntensity = texture2D(inputImageTexture, twoStepsNegativeTextureCoordinate).r; float maxValue = max(centerIntensity, oneStepPositiveIntensity); maxValue = max(maxValue, oneStepNegativeIntensity); maxValue = max(maxValue, twoStepsPositiveIntensity); maxValue = max(maxValue, twoStepsNegativeIntensity); gl_FragColor = vec4(vec3(maxValue), 1.0); } ); NSString *const kGPUImageDilationRadiusThreeFragmentShaderString = SHADER_STRING ( varying vec2 centerTextureCoordinate; varying vec2 oneStepPositiveTextureCoordinate; varying vec2 oneStepNegativeTextureCoordinate; varying vec2 twoStepsPositiveTextureCoordinate; varying vec2 twoStepsNegativeTextureCoordinate; varying vec2 threeStepsPositiveTextureCoordinate; varying vec2 threeStepsNegativeTextureCoordinate; uniform sampler2D inputImageTexture; void main() { float centerIntensity = texture2D(inputImageTexture, centerTextureCoordinate).r; float oneStepPositiveIntensity = texture2D(inputImageTexture, oneStepPositiveTextureCoordinate).r; float oneStepNegativeIntensity = texture2D(inputImageTexture, oneStepNegativeTextureCoordinate).r; float twoStepsPositiveIntensity = texture2D(inputImageTexture, twoStepsPositiveTextureCoordinate).r; float twoStepsNegativeIntensity = texture2D(inputImageTexture, twoStepsNegativeTextureCoordinate).r; float threeStepsPositiveIntensity = texture2D(inputImageTexture, threeStepsPositiveTextureCoordinate).r; float threeStepsNegativeIntensity = texture2D(inputImageTexture, threeStepsNegativeTextureCoordinate).r; float maxValue = max(centerIntensity, oneStepPositiveIntensity); maxValue = max(maxValue, oneStepNegativeIntensity); maxValue = max(maxValue, twoStepsPositiveIntensity); maxValue = max(maxValue, twoStepsNegativeIntensity); maxValue = max(maxValue, threeStepsPositiveIntensity); maxValue = max(maxValue, threeStepsNegativeIntensity); gl_FragColor = vec4(vec3(maxValue), 1.0); } ); NSString *const kGPUImageDilationRadiusFourFragmentShaderString = SHADER_STRING ( varying vec2 centerTextureCoordinate; varying vec2 oneStepPositiveTextureCoordinate; varying vec2 oneStepNegativeTextureCoordinate; varying vec2 twoStepsPositiveTextureCoordinate; varying vec2 twoStepsNegativeTextureCoordinate; varying vec2 threeStepsPositiveTextureCoordinate; varying vec2 threeStepsNegativeTextureCoordinate; varying vec2 fourStepsPositiveTextureCoordinate; varying vec2 fourStepsNegativeTextureCoordinate; uniform sampler2D inputImageTexture; void main() { float centerIntensity = texture2D(inputImageTexture, centerTextureCoordinate).r; float oneStepPositiveIntensity = texture2D(inputImageTexture, oneStepPositiveTextureCoordinate).r; float oneStepNegativeIntensity = texture2D(inputImageTexture, oneStepNegativeTextureCoordinate).r; float twoStepsPositiveIntensity = texture2D(inputImageTexture, twoStepsPositiveTextureCoordinate).r; float twoStepsNegativeIntensity = texture2D(inputImageTexture, twoStepsNegativeTextureCoordinate).r; float threeStepsPositiveIntensity = texture2D(inputImageTexture, threeStepsPositiveTextureCoordinate).r; float threeStepsNegativeIntensity = texture2D(inputImageTexture, threeStepsNegativeTextureCoordinate).r; float fourStepsPositiveIntensity = texture2D(inputImageTexture, fourStepsPositiveTextureCoordinate).r; float fourStepsNegativeIntensity = texture2D(inputImageTexture, fourStepsNegativeTextureCoordinate).r; float maxValue = max(centerIntensity, oneStepPositiveIntensity); maxValue = max(maxValue, oneStepNegativeIntensity); maxValue = max(maxValue, twoStepsPositiveIntensity); maxValue = max(maxValue, twoStepsNegativeIntensity); maxValue = max(maxValue, threeStepsPositiveIntensity); maxValue = max(maxValue, threeStepsNegativeIntensity); maxValue = max(maxValue, fourStepsPositiveIntensity); maxValue = max(maxValue, fourStepsNegativeIntensity); gl_FragColor = vec4(vec3(maxValue), 1.0); } ); #endif #pragma mark - #pragma mark Initialization and teardown - (id)initWithRadius:(NSUInteger)dilationRadius; { NSString *fragmentShaderForThisRadius = nil; NSString *vertexShaderForThisRadius = nil; switch (dilationRadius) { case 0: case 1: { vertexShaderForThisRadius = kGPUImageDilationRadiusOneVertexShaderString; fragmentShaderForThisRadius = kGPUImageDilationRadiusOneFragmentShaderString; }; break; case 2: { vertexShaderForThisRadius = kGPUImageDilationRadiusTwoVertexShaderString; fragmentShaderForThisRadius = kGPUImageDilationRadiusTwoFragmentShaderString; }; break; case 3: { vertexShaderForThisRadius = kGPUImageDilationRadiusThreeVertexShaderString; fragmentShaderForThisRadius = kGPUImageDilationRadiusThreeFragmentShaderString; }; break; case 4: { vertexShaderForThisRadius = kGPUImageDilationRadiusFourVertexShaderString; fragmentShaderForThisRadius = kGPUImageDilationRadiusFourFragmentShaderString; }; break; default: { vertexShaderForThisRadius = kGPUImageDilationRadiusFourVertexShaderString; fragmentShaderForThisRadius = kGPUImageDilationRadiusFourFragmentShaderString; }; break; } if (!(self = [super initWithFirstStageVertexShaderFromString:vertexShaderForThisRadius firstStageFragmentShaderFromString:fragmentShaderForThisRadius secondStageVertexShaderFromString:vertexShaderForThisRadius secondStageFragmentShaderFromString:fragmentShaderForThisRadius])) { return nil; } return self; } - (id)init; { if (!(self = [self initWithRadius:1])) { return nil; } return self; } @end ================================================ FILE: framework/Source/GPUImageDirectionalNonMaximumSuppressionFilter.h ================================================ #import "GPUImageFilter.h" @interface GPUImageDirectionalNonMaximumSuppressionFilter : GPUImageFilter { GLint texelWidthUniform, texelHeightUniform; GLint upperThresholdUniform, lowerThresholdUniform; BOOL hasOverriddenImageSizeFactor; } // The texel width and height determines how far out to sample from this texel. By default, this is the normalized width of a pixel, but this can be overridden for different effects. @property(readwrite, nonatomic) CGFloat texelWidth; @property(readwrite, nonatomic) CGFloat texelHeight; // These thresholds set cutoffs for the intensities that definitely get registered (upper threshold) and those that definitely don't (lower threshold) @property(readwrite, nonatomic) CGFloat upperThreshold; @property(readwrite, nonatomic) CGFloat lowerThreshold; @end ================================================ FILE: framework/Source/GPUImageDirectionalNonMaximumSuppressionFilter.m ================================================ #import "GPUImageDirectionalNonMaximumSuppressionFilter.h" @implementation GPUImageDirectionalNonMaximumSuppressionFilter #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageDirectionalNonmaximumSuppressionFragmentShaderString = SHADER_STRING ( precision mediump float; varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform highp float texelWidth; uniform highp float texelHeight; uniform mediump float upperThreshold; uniform mediump float lowerThreshold; void main() { vec3 currentGradientAndDirection = texture2D(inputImageTexture, textureCoordinate).rgb; vec2 gradientDirection = ((currentGradientAndDirection.gb * 2.0) - 1.0) * vec2(texelWidth, texelHeight); float firstSampledGradientMagnitude = texture2D(inputImageTexture, textureCoordinate + gradientDirection).r; float secondSampledGradientMagnitude = texture2D(inputImageTexture, textureCoordinate - gradientDirection).r; float multiplier = step(firstSampledGradientMagnitude, currentGradientAndDirection.r); multiplier = multiplier * step(secondSampledGradientMagnitude, currentGradientAndDirection.r); float thresholdCompliance = smoothstep(lowerThreshold, upperThreshold, currentGradientAndDirection.r); multiplier = multiplier * thresholdCompliance; gl_FragColor = vec4(multiplier, multiplier, multiplier, 1.0); } ); #else NSString *const kGPUImageDirectionalNonmaximumSuppressionFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform float texelWidth; uniform float texelHeight; uniform float upperThreshold; uniform float lowerThreshold; void main() { vec3 currentGradientAndDirection = texture2D(inputImageTexture, textureCoordinate).rgb; vec2 gradientDirection = ((currentGradientAndDirection.gb * 2.0) - 1.0) * vec2(texelWidth, texelHeight); float firstSampledGradientMagnitude = texture2D(inputImageTexture, textureCoordinate + gradientDirection).r; float secondSampledGradientMagnitude = texture2D(inputImageTexture, textureCoordinate - gradientDirection).r; float multiplier = step(firstSampledGradientMagnitude, currentGradientAndDirection.r); multiplier = multiplier * step(secondSampledGradientMagnitude, currentGradientAndDirection.r); float thresholdCompliance = smoothstep(lowerThreshold, upperThreshold, currentGradientAndDirection.r); multiplier = multiplier * thresholdCompliance; gl_FragColor = vec4(multiplier, multiplier, multiplier, 1.0); } ); #endif @synthesize texelWidth = _texelWidth; @synthesize texelHeight = _texelHeight; @synthesize upperThreshold = _upperThreshold; @synthesize lowerThreshold = _lowerThreshold; #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageDirectionalNonmaximumSuppressionFragmentShaderString])) { return nil; } texelWidthUniform = [filterProgram uniformIndex:@"texelWidth"]; texelHeightUniform = [filterProgram uniformIndex:@"texelHeight"]; upperThresholdUniform = [filterProgram uniformIndex:@"upperThreshold"]; lowerThresholdUniform = [filterProgram uniformIndex:@"lowerThreshold"]; self.upperThreshold = 0.5; self.lowerThreshold = 0.1; return self; } - (void)setupFilterForSize:(CGSize)filterFrameSize; { if (!hasOverriddenImageSizeFactor) { _texelWidth = 1.0 / filterFrameSize.width; _texelHeight = 1.0 / filterFrameSize.height; runSynchronouslyOnVideoProcessingQueue(^{ [GPUImageContext setActiveShaderProgram:filterProgram]; glUniform1f(texelWidthUniform, _texelWidth); glUniform1f(texelHeightUniform, _texelHeight); }); } } #pragma mark - #pragma mark Accessors - (void)setTexelWidth:(CGFloat)newValue; { hasOverriddenImageSizeFactor = YES; _texelWidth = newValue; [self setFloat:_texelWidth forUniform:texelWidthUniform program:filterProgram]; } - (void)setTexelHeight:(CGFloat)newValue; { hasOverriddenImageSizeFactor = YES; _texelHeight = newValue; [self setFloat:_texelHeight forUniform:texelHeightUniform program:filterProgram]; } - (void)setLowerThreshold:(CGFloat)newValue; { _lowerThreshold = newValue; [self setFloat:_lowerThreshold forUniform:lowerThresholdUniform program:filterProgram]; } - (void)setUpperThreshold:(CGFloat)newValue; { _upperThreshold = newValue; [self setFloat:_upperThreshold forUniform:upperThresholdUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImageDirectionalSobelEdgeDetectionFilter.h ================================================ #import "GPUImage3x3TextureSamplingFilter.h" @interface GPUImageDirectionalSobelEdgeDetectionFilter : GPUImage3x3TextureSamplingFilter @end ================================================ FILE: framework/Source/GPUImageDirectionalSobelEdgeDetectionFilter.m ================================================ #import "GPUImageDirectionalSobelEdgeDetectionFilter.h" @implementation GPUImageDirectionalSobelEdgeDetectionFilter #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageDirectionalSobelEdgeDetectionFragmentShaderString = SHADER_STRING ( precision mediump float; varying vec2 textureCoordinate; varying vec2 leftTextureCoordinate; varying vec2 rightTextureCoordinate; varying vec2 topTextureCoordinate; varying vec2 topLeftTextureCoordinate; varying vec2 topRightTextureCoordinate; varying vec2 bottomTextureCoordinate; varying vec2 bottomLeftTextureCoordinate; varying vec2 bottomRightTextureCoordinate; uniform sampler2D inputImageTexture; void main() { float bottomLeftIntensity = texture2D(inputImageTexture, bottomLeftTextureCoordinate).r; float topRightIntensity = texture2D(inputImageTexture, topRightTextureCoordinate).r; float topLeftIntensity = texture2D(inputImageTexture, topLeftTextureCoordinate).r; float bottomRightIntensity = texture2D(inputImageTexture, bottomRightTextureCoordinate).r; float leftIntensity = texture2D(inputImageTexture, leftTextureCoordinate).r; float rightIntensity = texture2D(inputImageTexture, rightTextureCoordinate).r; float bottomIntensity = texture2D(inputImageTexture, bottomTextureCoordinate).r; float topIntensity = texture2D(inputImageTexture, topTextureCoordinate).r; vec2 gradientDirection; gradientDirection.x = -bottomLeftIntensity - 2.0 * leftIntensity - topLeftIntensity + bottomRightIntensity + 2.0 * rightIntensity + topRightIntensity; gradientDirection.y = -topLeftIntensity - 2.0 * topIntensity - topRightIntensity + bottomLeftIntensity + 2.0 * bottomIntensity + bottomRightIntensity; float gradientMagnitude = length(gradientDirection); vec2 normalizedDirection = normalize(gradientDirection); normalizedDirection = sign(normalizedDirection) * floor(abs(normalizedDirection) + 0.617316); // Offset by 1-sin(pi/8) to set to 0 if near axis, 1 if away normalizedDirection = (normalizedDirection + 1.0) * 0.5; // Place -1.0 - 1.0 within 0 - 1.0 gl_FragColor = vec4(gradientMagnitude, normalizedDirection.x, normalizedDirection.y, 1.0); } ); #else NSString *const kGPUImageDirectionalSobelEdgeDetectionFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; varying vec2 leftTextureCoordinate; varying vec2 rightTextureCoordinate; varying vec2 topTextureCoordinate; varying vec2 topLeftTextureCoordinate; varying vec2 topRightTextureCoordinate; varying vec2 bottomTextureCoordinate; varying vec2 bottomLeftTextureCoordinate; varying vec2 bottomRightTextureCoordinate; uniform sampler2D inputImageTexture; void main() { float bottomLeftIntensity = texture2D(inputImageTexture, bottomLeftTextureCoordinate).r; float topRightIntensity = texture2D(inputImageTexture, topRightTextureCoordinate).r; float topLeftIntensity = texture2D(inputImageTexture, topLeftTextureCoordinate).r; float bottomRightIntensity = texture2D(inputImageTexture, bottomRightTextureCoordinate).r; float leftIntensity = texture2D(inputImageTexture, leftTextureCoordinate).r; float rightIntensity = texture2D(inputImageTexture, rightTextureCoordinate).r; float bottomIntensity = texture2D(inputImageTexture, bottomTextureCoordinate).r; float topIntensity = texture2D(inputImageTexture, topTextureCoordinate).r; vec2 gradientDirection; gradientDirection.x = -bottomLeftIntensity - 2.0 * leftIntensity - topLeftIntensity + bottomRightIntensity + 2.0 * rightIntensity + topRightIntensity; gradientDirection.y = -topLeftIntensity - 2.0 * topIntensity - topRightIntensity + bottomLeftIntensity + 2.0 * bottomIntensity + bottomRightIntensity; float gradientMagnitude = length(gradientDirection); vec2 normalizedDirection = normalize(gradientDirection); normalizedDirection = sign(normalizedDirection) * floor(abs(normalizedDirection) + 0.617316); // Offset by 1-sin(pi/8) to set to 0 if near axis, 1 if away normalizedDirection = (normalizedDirection + 1.0) * 0.5; // Place -1.0 - 1.0 within 0 - 1.0 gl_FragColor = vec4(gradientMagnitude, normalizedDirection.x, normalizedDirection.y, 1.0); } ); #endif #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageDirectionalSobelEdgeDetectionFragmentShaderString])) { return nil; } return self; } @end ================================================ FILE: framework/Source/GPUImageDissolveBlendFilter.h ================================================ #import "GPUImageTwoInputFilter.h" @interface GPUImageDissolveBlendFilter : GPUImageTwoInputFilter { GLint mixUniform; } // Mix ranges from 0.0 (only image 1) to 1.0 (only image 2), with 0.5 (half of either) as the normal level @property(readwrite, nonatomic) CGFloat mix; @end ================================================ FILE: framework/Source/GPUImageDissolveBlendFilter.m ================================================ #import "GPUImageDissolveBlendFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageDissolveBlendFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; varying highp vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; uniform lowp float mixturePercent; void main() { lowp vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); lowp vec4 textureColor2 = texture2D(inputImageTexture2, textureCoordinate2); gl_FragColor = mix(textureColor, textureColor2, mixturePercent); } ); #else NSString *const kGPUImageDissolveBlendFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; varying vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; uniform float mixturePercent; void main() { vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); vec4 textureColor2 = texture2D(inputImageTexture2, textureCoordinate2); gl_FragColor = mix(textureColor, textureColor2, mixturePercent); } ); #endif @implementation GPUImageDissolveBlendFilter @synthesize mix = _mix; #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageDissolveBlendFragmentShaderString])) { return nil; } mixUniform = [filterProgram uniformIndex:@"mixturePercent"]; self.mix = 0.5; return self; } #pragma mark - #pragma mark Accessors - (void)setMix:(CGFloat)newValue; { _mix = newValue; [self setFloat:_mix forUniform:mixUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImageDivideBlendFilter.h ================================================ #import "GPUImageTwoInputFilter.h" @interface GPUImageDivideBlendFilter : GPUImageTwoInputFilter @end ================================================ FILE: framework/Source/GPUImageDivideBlendFilter.m ================================================ #import "GPUImageDivideBlendFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageDivideBlendFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; varying highp vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; void main() { mediump vec4 base = texture2D(inputImageTexture, textureCoordinate); mediump vec4 overlay = texture2D(inputImageTexture2, textureCoordinate2); mediump float ra; if (overlay.a == 0.0 || ((base.r / overlay.r) > (base.a / overlay.a))) ra = overlay.a * base.a + overlay.r * (1.0 - base.a) + base.r * (1.0 - overlay.a); else ra = (base.r * overlay.a * overlay.a) / overlay.r + overlay.r * (1.0 - base.a) + base.r * (1.0 - overlay.a); mediump float ga; if (overlay.a == 0.0 || ((base.g / overlay.g) > (base.a / overlay.a))) ga = overlay.a * base.a + overlay.g * (1.0 - base.a) + base.g * (1.0 - overlay.a); else ga = (base.g * overlay.a * overlay.a) / overlay.g + overlay.g * (1.0 - base.a) + base.g * (1.0 - overlay.a); mediump float ba; if (overlay.a == 0.0 || ((base.b / overlay.b) > (base.a / overlay.a))) ba = overlay.a * base.a + overlay.b * (1.0 - base.a) + base.b * (1.0 - overlay.a); else ba = (base.b * overlay.a * overlay.a) / overlay.b + overlay.b * (1.0 - base.a) + base.b * (1.0 - overlay.a); mediump float a = overlay.a + base.a - overlay.a * base.a; gl_FragColor = vec4(ra, ga, ba, a); } ); #else NSString *const kGPUImageDivideBlendFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; varying vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; void main() { vec4 base = texture2D(inputImageTexture, textureCoordinate); vec4 overlay = texture2D(inputImageTexture2, textureCoordinate2); float ra; if (overlay.a == 0.0 || ((base.r / overlay.r) > (base.a / overlay.a))) ra = overlay.a * base.a + overlay.r * (1.0 - base.a) + base.r * (1.0 - overlay.a); else ra = (base.r * overlay.a * overlay.a) / overlay.r + overlay.r * (1.0 - base.a) + base.r * (1.0 - overlay.a); float ga; if (overlay.a == 0.0 || ((base.g / overlay.g) > (base.a / overlay.a))) ga = overlay.a * base.a + overlay.g * (1.0 - base.a) + base.g * (1.0 - overlay.a); else ga = (base.g * overlay.a * overlay.a) / overlay.g + overlay.g * (1.0 - base.a) + base.g * (1.0 - overlay.a); float ba; if (overlay.a == 0.0 || ((base.b / overlay.b) > (base.a / overlay.a))) ba = overlay.a * base.a + overlay.b * (1.0 - base.a) + base.b * (1.0 - overlay.a); else ba = (base.b * overlay.a * overlay.a) / overlay.b + overlay.b * (1.0 - base.a) + base.b * (1.0 - overlay.a); float a = overlay.a + base.a - overlay.a * base.a; gl_FragColor = vec4(ra, ga, ba, a); } ); #endif @implementation GPUImageDivideBlendFilter - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageDivideBlendFragmentShaderString])) { return nil; } return self; } @end ================================================ FILE: framework/Source/GPUImageEmbossFilter.h ================================================ #import "GPUImage3x3ConvolutionFilter.h" @interface GPUImageEmbossFilter : GPUImage3x3ConvolutionFilter // The strength of the embossing, from 0.0 to 4.0, with 1.0 as the normal level @property(readwrite, nonatomic) CGFloat intensity; @end ================================================ FILE: framework/Source/GPUImageEmbossFilter.m ================================================ #import "GPUImageEmbossFilter.h" @implementation GPUImageEmbossFilter @synthesize intensity = _intensity; - (id)init; { if (!(self = [super init])) { return nil; } self.intensity = 1.0; return self; } #pragma mark - #pragma mark Accessors - (void)setIntensity:(CGFloat)newValue; { // [(GPUImage3x3ConvolutionFilter *)filter setConvolutionMatrix:(GPUMatrix3x3){ // {-2.0f, -1.0f, 0.0f}, // {-1.0f, 1.0f, 1.0f}, // { 0.0f, 1.0f, 2.0f} // }]; _intensity = newValue; GPUMatrix3x3 newConvolutionMatrix; newConvolutionMatrix.one.one = _intensity * (-2.0); newConvolutionMatrix.one.two = -_intensity; newConvolutionMatrix.one.three = 0.0f; newConvolutionMatrix.two.one = -_intensity; newConvolutionMatrix.two.two = 1.0; newConvolutionMatrix.two.three = _intensity; newConvolutionMatrix.three.one = 0.0f; newConvolutionMatrix.three.two = _intensity; newConvolutionMatrix.three.three = _intensity * 2.0; self.convolutionKernel = newConvolutionMatrix; } @end ================================================ FILE: framework/Source/GPUImageErosionFilter.h ================================================ #import "GPUImageTwoPassTextureSamplingFilter.h" // For each pixel, this sets it to the minimum value of the red channel in a rectangular neighborhood extending out dilationRadius pixels from the center. // This extends out dark features, and is most commonly used with black-and-white thresholded images. @interface GPUImageErosionFilter : GPUImageTwoPassTextureSamplingFilter // Acceptable values for erosionRadius, which sets the distance in pixels to sample out from the center, are 1, 2, 3, and 4. - (id)initWithRadius:(NSUInteger)erosionRadius; @end ================================================ FILE: framework/Source/GPUImageErosionFilter.m ================================================ #import "GPUImageErosionFilter.h" #import "GPUImageDilationFilter.h" @implementation GPUImageErosionFilter #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageErosionRadiusOneFragmentShaderString = SHADER_STRING ( precision lowp float; varying vec2 centerTextureCoordinate; varying vec2 oneStepPositiveTextureCoordinate; varying vec2 oneStepNegativeTextureCoordinate; uniform sampler2D inputImageTexture; void main() { float centerIntensity = texture2D(inputImageTexture, centerTextureCoordinate).r; float oneStepPositiveIntensity = texture2D(inputImageTexture, oneStepPositiveTextureCoordinate).r; float oneStepNegativeIntensity = texture2D(inputImageTexture, oneStepNegativeTextureCoordinate).r; lowp float minValue = min(centerIntensity, oneStepPositiveIntensity); minValue = min(minValue, oneStepNegativeIntensity); gl_FragColor = vec4(vec3(minValue), 1.0); } ); NSString *const kGPUImageErosionRadiusTwoFragmentShaderString = SHADER_STRING ( precision lowp float; varying vec2 centerTextureCoordinate; varying vec2 oneStepPositiveTextureCoordinate; varying vec2 oneStepNegativeTextureCoordinate; varying vec2 twoStepsPositiveTextureCoordinate; varying vec2 twoStepsNegativeTextureCoordinate; uniform sampler2D inputImageTexture; void main() { float centerIntensity = texture2D(inputImageTexture, centerTextureCoordinate).r; float oneStepPositiveIntensity = texture2D(inputImageTexture, oneStepPositiveTextureCoordinate).r; float oneStepNegativeIntensity = texture2D(inputImageTexture, oneStepNegativeTextureCoordinate).r; float twoStepsPositiveIntensity = texture2D(inputImageTexture, twoStepsPositiveTextureCoordinate).r; float twoStepsNegativeIntensity = texture2D(inputImageTexture, twoStepsNegativeTextureCoordinate).r; lowp float minValue = min(centerIntensity, oneStepPositiveIntensity); minValue = min(minValue, oneStepNegativeIntensity); minValue = min(minValue, twoStepsPositiveIntensity); minValue = min(minValue, twoStepsNegativeIntensity); gl_FragColor = vec4(vec3(minValue), 1.0); } ); NSString *const kGPUImageErosionRadiusThreeFragmentShaderString = SHADER_STRING ( precision lowp float; varying vec2 centerTextureCoordinate; varying vec2 oneStepPositiveTextureCoordinate; varying vec2 oneStepNegativeTextureCoordinate; varying vec2 twoStepsPositiveTextureCoordinate; varying vec2 twoStepsNegativeTextureCoordinate; varying vec2 threeStepsPositiveTextureCoordinate; varying vec2 threeStepsNegativeTextureCoordinate; uniform sampler2D inputImageTexture; void main() { float centerIntensity = texture2D(inputImageTexture, centerTextureCoordinate).r; float oneStepPositiveIntensity = texture2D(inputImageTexture, oneStepPositiveTextureCoordinate).r; float oneStepNegativeIntensity = texture2D(inputImageTexture, oneStepNegativeTextureCoordinate).r; float twoStepsPositiveIntensity = texture2D(inputImageTexture, twoStepsPositiveTextureCoordinate).r; float twoStepsNegativeIntensity = texture2D(inputImageTexture, twoStepsNegativeTextureCoordinate).r; float threeStepsPositiveIntensity = texture2D(inputImageTexture, threeStepsPositiveTextureCoordinate).r; float threeStepsNegativeIntensity = texture2D(inputImageTexture, threeStepsNegativeTextureCoordinate).r; lowp float minValue = min(centerIntensity, oneStepPositiveIntensity); minValue = min(minValue, oneStepNegativeIntensity); minValue = min(minValue, twoStepsPositiveIntensity); minValue = min(minValue, twoStepsNegativeIntensity); minValue = min(minValue, threeStepsPositiveIntensity); minValue = min(minValue, threeStepsNegativeIntensity); gl_FragColor = vec4(vec3(minValue), 1.0); } ); NSString *const kGPUImageErosionRadiusFourFragmentShaderString = SHADER_STRING ( precision lowp float; varying vec2 centerTextureCoordinate; varying vec2 oneStepPositiveTextureCoordinate; varying vec2 oneStepNegativeTextureCoordinate; varying vec2 twoStepsPositiveTextureCoordinate; varying vec2 twoStepsNegativeTextureCoordinate; varying vec2 threeStepsPositiveTextureCoordinate; varying vec2 threeStepsNegativeTextureCoordinate; varying vec2 fourStepsPositiveTextureCoordinate; varying vec2 fourStepsNegativeTextureCoordinate; uniform sampler2D inputImageTexture; void main() { float centerIntensity = texture2D(inputImageTexture, centerTextureCoordinate).r; float oneStepPositiveIntensity = texture2D(inputImageTexture, oneStepPositiveTextureCoordinate).r; float oneStepNegativeIntensity = texture2D(inputImageTexture, oneStepNegativeTextureCoordinate).r; float twoStepsPositiveIntensity = texture2D(inputImageTexture, twoStepsPositiveTextureCoordinate).r; float twoStepsNegativeIntensity = texture2D(inputImageTexture, twoStepsNegativeTextureCoordinate).r; float threeStepsPositiveIntensity = texture2D(inputImageTexture, threeStepsPositiveTextureCoordinate).r; float threeStepsNegativeIntensity = texture2D(inputImageTexture, threeStepsNegativeTextureCoordinate).r; float fourStepsPositiveIntensity = texture2D(inputImageTexture, fourStepsPositiveTextureCoordinate).r; float fourStepsNegativeIntensity = texture2D(inputImageTexture, fourStepsNegativeTextureCoordinate).r; lowp float minValue = min(centerIntensity, oneStepPositiveIntensity); minValue = min(minValue, oneStepNegativeIntensity); minValue = min(minValue, twoStepsPositiveIntensity); minValue = min(minValue, twoStepsNegativeIntensity); minValue = min(minValue, threeStepsPositiveIntensity); minValue = min(minValue, threeStepsNegativeIntensity); minValue = min(minValue, fourStepsPositiveIntensity); minValue = min(minValue, fourStepsNegativeIntensity); gl_FragColor = vec4(vec3(minValue), 1.0); } ); #else NSString *const kGPUImageErosionRadiusOneFragmentShaderString = SHADER_STRING ( varying vec2 centerTextureCoordinate; varying vec2 oneStepPositiveTextureCoordinate; varying vec2 oneStepNegativeTextureCoordinate; uniform sampler2D inputImageTexture; void main() { float centerIntensity = texture2D(inputImageTexture, centerTextureCoordinate).r; float oneStepPositiveIntensity = texture2D(inputImageTexture, oneStepPositiveTextureCoordinate).r; float oneStepNegativeIntensity = texture2D(inputImageTexture, oneStepNegativeTextureCoordinate).r; float minValue = min(centerIntensity, oneStepPositiveIntensity); minValue = min(minValue, oneStepNegativeIntensity); gl_FragColor = vec4(vec3(minValue), 1.0); } ); NSString *const kGPUImageErosionRadiusTwoFragmentShaderString = SHADER_STRING ( varying vec2 centerTextureCoordinate; varying vec2 oneStepPositiveTextureCoordinate; varying vec2 oneStepNegativeTextureCoordinate; varying vec2 twoStepsPositiveTextureCoordinate; varying vec2 twoStepsNegativeTextureCoordinate; uniform sampler2D inputImageTexture; void main() { float centerIntensity = texture2D(inputImageTexture, centerTextureCoordinate).r; float oneStepPositiveIntensity = texture2D(inputImageTexture, oneStepPositiveTextureCoordinate).r; float oneStepNegativeIntensity = texture2D(inputImageTexture, oneStepNegativeTextureCoordinate).r; float twoStepsPositiveIntensity = texture2D(inputImageTexture, twoStepsPositiveTextureCoordinate).r; float twoStepsNegativeIntensity = texture2D(inputImageTexture, twoStepsNegativeTextureCoordinate).r; float minValue = min(centerIntensity, oneStepPositiveIntensity); minValue = min(minValue, oneStepNegativeIntensity); minValue = min(minValue, twoStepsPositiveIntensity); minValue = min(minValue, twoStepsNegativeIntensity); gl_FragColor = vec4(vec3(minValue), 1.0); } ); NSString *const kGPUImageErosionRadiusThreeFragmentShaderString = SHADER_STRING ( varying vec2 centerTextureCoordinate; varying vec2 oneStepPositiveTextureCoordinate; varying vec2 oneStepNegativeTextureCoordinate; varying vec2 twoStepsPositiveTextureCoordinate; varying vec2 twoStepsNegativeTextureCoordinate; varying vec2 threeStepsPositiveTextureCoordinate; varying vec2 threeStepsNegativeTextureCoordinate; uniform sampler2D inputImageTexture; void main() { float centerIntensity = texture2D(inputImageTexture, centerTextureCoordinate).r; float oneStepPositiveIntensity = texture2D(inputImageTexture, oneStepPositiveTextureCoordinate).r; float oneStepNegativeIntensity = texture2D(inputImageTexture, oneStepNegativeTextureCoordinate).r; float twoStepsPositiveIntensity = texture2D(inputImageTexture, twoStepsPositiveTextureCoordinate).r; float twoStepsNegativeIntensity = texture2D(inputImageTexture, twoStepsNegativeTextureCoordinate).r; float threeStepsPositiveIntensity = texture2D(inputImageTexture, threeStepsPositiveTextureCoordinate).r; float threeStepsNegativeIntensity = texture2D(inputImageTexture, threeStepsNegativeTextureCoordinate).r; float minValue = min(centerIntensity, oneStepPositiveIntensity); minValue = min(minValue, oneStepNegativeIntensity); minValue = min(minValue, twoStepsPositiveIntensity); minValue = min(minValue, twoStepsNegativeIntensity); minValue = min(minValue, threeStepsPositiveIntensity); minValue = min(minValue, threeStepsNegativeIntensity); gl_FragColor = vec4(vec3(minValue), 1.0); } ); NSString *const kGPUImageErosionRadiusFourFragmentShaderString = SHADER_STRING ( varying vec2 centerTextureCoordinate; varying vec2 oneStepPositiveTextureCoordinate; varying vec2 oneStepNegativeTextureCoordinate; varying vec2 twoStepsPositiveTextureCoordinate; varying vec2 twoStepsNegativeTextureCoordinate; varying vec2 threeStepsPositiveTextureCoordinate; varying vec2 threeStepsNegativeTextureCoordinate; varying vec2 fourStepsPositiveTextureCoordinate; varying vec2 fourStepsNegativeTextureCoordinate; uniform sampler2D inputImageTexture; void main() { float centerIntensity = texture2D(inputImageTexture, centerTextureCoordinate).r; float oneStepPositiveIntensity = texture2D(inputImageTexture, oneStepPositiveTextureCoordinate).r; float oneStepNegativeIntensity = texture2D(inputImageTexture, oneStepNegativeTextureCoordinate).r; float twoStepsPositiveIntensity = texture2D(inputImageTexture, twoStepsPositiveTextureCoordinate).r; float twoStepsNegativeIntensity = texture2D(inputImageTexture, twoStepsNegativeTextureCoordinate).r; float threeStepsPositiveIntensity = texture2D(inputImageTexture, threeStepsPositiveTextureCoordinate).r; float threeStepsNegativeIntensity = texture2D(inputImageTexture, threeStepsNegativeTextureCoordinate).r; float fourStepsPositiveIntensity = texture2D(inputImageTexture, fourStepsPositiveTextureCoordinate).r; float fourStepsNegativeIntensity = texture2D(inputImageTexture, fourStepsNegativeTextureCoordinate).r; float minValue = min(centerIntensity, oneStepPositiveIntensity); minValue = min(minValue, oneStepNegativeIntensity); minValue = min(minValue, twoStepsPositiveIntensity); minValue = min(minValue, twoStepsNegativeIntensity); minValue = min(minValue, threeStepsPositiveIntensity); minValue = min(minValue, threeStepsNegativeIntensity); minValue = min(minValue, fourStepsPositiveIntensity); minValue = min(minValue, fourStepsNegativeIntensity); gl_FragColor = vec4(vec3(minValue), 1.0); } ); #endif #pragma mark - #pragma mark Initialization and teardown - (id)initWithRadius:(NSUInteger)dilationRadius; { NSString *fragmentShaderForThisRadius = nil; NSString *vertexShaderForThisRadius = nil; switch (dilationRadius) { case 0: case 1: { vertexShaderForThisRadius = kGPUImageDilationRadiusOneVertexShaderString; fragmentShaderForThisRadius = kGPUImageErosionRadiusOneFragmentShaderString; }; break; case 2: { vertexShaderForThisRadius = kGPUImageDilationRadiusTwoVertexShaderString; fragmentShaderForThisRadius = kGPUImageErosionRadiusTwoFragmentShaderString; }; break; case 3: { vertexShaderForThisRadius = kGPUImageDilationRadiusThreeVertexShaderString; fragmentShaderForThisRadius = kGPUImageErosionRadiusThreeFragmentShaderString; }; break; case 4: { vertexShaderForThisRadius = kGPUImageDilationRadiusFourVertexShaderString; fragmentShaderForThisRadius = kGPUImageErosionRadiusFourFragmentShaderString; }; break; default: { vertexShaderForThisRadius = kGPUImageDilationRadiusFourVertexShaderString; fragmentShaderForThisRadius = kGPUImageErosionRadiusFourFragmentShaderString; }; break; } if (!(self = [super initWithFirstStageVertexShaderFromString:vertexShaderForThisRadius firstStageFragmentShaderFromString:fragmentShaderForThisRadius secondStageVertexShaderFromString:vertexShaderForThisRadius secondStageFragmentShaderFromString:fragmentShaderForThisRadius])) { return nil; } return self; } - (id)init; { if (!(self = [self initWithRadius:1])) { return nil; } return self; } @end ================================================ FILE: framework/Source/GPUImageExclusionBlendFilter.h ================================================ #import "GPUImageTwoInputFilter.h" @interface GPUImageExclusionBlendFilter : GPUImageTwoInputFilter { } @end ================================================ FILE: framework/Source/GPUImageExclusionBlendFilter.m ================================================ #import "GPUImageExclusionBlendFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageExclusionBlendFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; varying highp vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; void main() { mediump vec4 base = texture2D(inputImageTexture, textureCoordinate); mediump vec4 overlay = texture2D(inputImageTexture2, textureCoordinate2); // Dca = (Sca.Da + Dca.Sa - 2.Sca.Dca) + Sca.(1 - Da) + Dca.(1 - Sa) gl_FragColor = vec4((overlay.rgb * base.a + base.rgb * overlay.a - 2.0 * overlay.rgb * base.rgb) + overlay.rgb * (1.0 - base.a) + base.rgb * (1.0 - overlay.a), base.a); } ); #else NSString *const kGPUImageExclusionBlendFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; varying vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; void main() { vec4 base = texture2D(inputImageTexture, textureCoordinate); vec4 overlay = texture2D(inputImageTexture2, textureCoordinate2); // Dca = (Sca.Da + Dca.Sa - 2.Sca.Dca) + Sca.(1 - Da) + Dca.(1 - Sa) gl_FragColor = vec4((overlay.rgb * base.a + base.rgb * overlay.a - 2.0 * overlay.rgb * base.rgb) + overlay.rgb * (1.0 - base.a) + base.rgb * (1.0 - overlay.a), base.a); } ); #endif @implementation GPUImageExclusionBlendFilter - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageExclusionBlendFragmentShaderString])) { return nil; } return self; } @end ================================================ FILE: framework/Source/GPUImageExposureFilter.h ================================================ #import "GPUImageFilter.h" @interface GPUImageExposureFilter : GPUImageFilter { GLint exposureUniform; } // Exposure ranges from -10.0 to 10.0, with 0.0 as the normal level @property(readwrite, nonatomic) CGFloat exposure; @end ================================================ FILE: framework/Source/GPUImageExposureFilter.m ================================================ #import "GPUImageExposureFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageExposureFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform highp float exposure; void main() { highp vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); gl_FragColor = vec4(textureColor.rgb * pow(2.0, exposure), textureColor.w); } ); #else NSString *const kGPUImageExposureFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform float exposure; void main() { vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); gl_FragColor = vec4(textureColor.rgb * pow(2.0, exposure), textureColor.w); } ); #endif @implementation GPUImageExposureFilter @synthesize exposure = _exposure; #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageExposureFragmentShaderString])) { return nil; } exposureUniform = [filterProgram uniformIndex:@"exposure"]; self.exposure = 0.0; return self; } #pragma mark - #pragma mark Accessors - (void)setExposure:(CGFloat)newValue; { _exposure = newValue; [self setFloat:_exposure forUniform:exposureUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImageFASTCornerDetectionFilter.h ================================================ #import "GPUImageFilterGroup.h" @class GPUImageGrayscaleFilter; @class GPUImage3x3TextureSamplingFilter; @class GPUImageNonMaximumSuppressionFilter; /* An implementation of the Features from Accelerated Segment Test (FAST) feature detector as described in the following publications: E. Rosten and T. Drummond. Fusing points and lines for high performance tracking. IEEE International Conference on Computer Vision, 2005. E. Rosten and T. Drummond. Machine learning for high-speed corner detection. European Conference on Computer Vision, 2006. For more about the FAST feature detector, see the resources here: http://www.edwardrosten.com/work/fast.html */ typedef enum { kGPUImageFAST12Contiguous, kGPUImageFAST12ContiguousNonMaximumSuppressed} GPUImageFASTDetectorType; @interface GPUImageFASTCornerDetectionFilter : GPUImageFilterGroup { GPUImageGrayscaleFilter *luminanceReductionFilter; GPUImage3x3TextureSamplingFilter *featureDetectionFilter; GPUImageNonMaximumSuppressionFilter *nonMaximumSuppressionFilter; // Generate a lookup texture based on the bit patterns // Step 1: convert to monochrome if necessary // Step 2: do a lookup at each pixel based on the Bresenham circle, encode comparison in two color components // Step 3: do non-maximum suppression of close corner points } - (id)initWithFASTDetectorVariant:(GPUImageFASTDetectorType)detectorType; @end ================================================ FILE: framework/Source/GPUImageFASTCornerDetectionFilter.m ================================================ #import "GPUImageFASTCornerDetectionFilter.h" #import "GPUImageGrayscaleFilter.h" #import "GPUImage3x3TextureSamplingFilter.h" #import "GPUImageNonMaximumSuppressionFilter.h" // 14 total texture coordinates from vertex shader for non-dependent reads // 3 texture coordinates for dependent reads, then NSString *const kGPUImageFASTDetectorFragmentShaderString = SHADER_STRING ( precision highp float; varying vec2 textureCoordinate; varying vec2 leftTextureCoordinate; varying vec2 rightTextureCoordinate; varying vec2 topTextureCoordinate; varying vec2 topLeftTextureCoordinate; varying vec2 topRightTextureCoordinate; varying vec2 bottomTextureCoordinate; varying vec2 bottomLeftTextureCoordinate; varying vec2 bottomRightTextureCoordinate; uniform sampler2D inputImageTexture; uniform sampler2D lookupTable; void main() { lowp float centerIntensity = texture2D(inputImageTexture, textureCoordinate).r; lowp float bottomLeftIntensity = texture2D(inputImageTexture, bottomLeftTextureCoordinate).r; lowp float topRightIntensity = texture2D(inputImageTexture, topRightTextureCoordinate).r; lowp float topLeftIntensity = texture2D(inputImageTexture, topLeftTextureCoordinate).r; lowp float bottomRightIntensity = texture2D(inputImageTexture, bottomRightTextureCoordinate).r; lowp float leftIntensity = texture2D(inputImageTexture, leftTextureCoordinate).r; lowp float rightIntensity = texture2D(inputImageTexture, rightTextureCoordinate).r; lowp float bottomIntensity = texture2D(inputImageTexture, bottomTextureCoordinate).r; lowp float topIntensity = texture2D(inputImageTexture, topTextureCoordinate).r; lowp float byteTally = 1.0 / 255.0 * step(centerIntensity, topRightIntensity); byteTally += 2.0 / 255.0 * step(centerIntensity, topIntensity); byteTally += 4.0 / 255.0 * step(centerIntensity, topLeftIntensity); byteTally += 8.0 / 255.0 * step(centerIntensity, leftIntensity); byteTally += 16.0 / 255.0 * step(centerIntensity, bottomLeftIntensity); byteTally += 32.0 / 255.0 * step(centerIntensity, bottomIntensity); byteTally += 64.0 / 255.0 * step(centerIntensity, bottomRightIntensity); byteTally += 128.0 / 255.0 * step(centerIntensity, rightIntensity); // TODO: Replace the above with a dot product and two vec4s // TODO: Apply step to a matrix, rather than individually gl_FragColor = vec4(byteTally, byteTally, byteTally, 1.0); } ); @implementation GPUImageFASTCornerDetectionFilter - (id)init; { if (!(self = [self initWithFASTDetectorVariant:kGPUImageFAST12ContiguousNonMaximumSuppressed])) { return nil; } return self; } - (id)initWithFASTDetectorVariant:(GPUImageFASTDetectorType)detectorType; { if (!(self = [super init])) { return nil; } // [derivativeFilter addTarget:blurFilter]; // [blurFilter addTarget:harrisCornerDetectionFilter]; // [harrisCornerDetectionFilter addTarget:nonMaximumSuppressionFilter]; // [simpleThresholdFilter addTarget:colorPackingFilter]; // self.initialFilters = [NSArray arrayWithObjects:derivativeFilter, nil]; // self.terminalFilter = colorPackingFilter; // self.terminalFilter = nonMaximumSuppressionFilter; return self; } @end ================================================ FILE: framework/Source/GPUImageFalseColorFilter.h ================================================ #import "GPUImageFilter.h" @interface GPUImageFalseColorFilter : GPUImageFilter { GLint firstColorUniform, secondColorUniform; } // The first and second colors specify what colors replace the dark and light areas of the image, respectively. The defaults are (0.0, 0.0, 0.5) amd (1.0, 0.0, 0.0). @property(readwrite, nonatomic) GPUVector4 firstColor; @property(readwrite, nonatomic) GPUVector4 secondColor; - (void)setFirstColorRed:(GLfloat)redComponent green:(GLfloat)greenComponent blue:(GLfloat)blueComponent; - (void)setSecondColorRed:(GLfloat)redComponent green:(GLfloat)greenComponent blue:(GLfloat)blueComponent; @end ================================================ FILE: framework/Source/GPUImageFalseColorFilter.m ================================================ #import "GPUImageFalseColorFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUFalseColorFragmentShaderString = SHADER_STRING ( precision lowp float; varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform float intensity; uniform vec3 firstColor; uniform vec3 secondColor; const mediump vec3 luminanceWeighting = vec3(0.2125, 0.7154, 0.0721); void main() { lowp vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); float luminance = dot(textureColor.rgb, luminanceWeighting); gl_FragColor = vec4( mix(firstColor.rgb, secondColor.rgb, luminance), textureColor.a); } ); #else NSString *const kGPUFalseColorFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform float intensity; uniform vec3 firstColor; uniform vec3 secondColor; const vec3 luminanceWeighting = vec3(0.2125, 0.7154, 0.0721); void main() { vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); float luminance = dot(textureColor.rgb, luminanceWeighting); gl_FragColor = vec4( mix(firstColor.rgb, secondColor.rgb, luminance), textureColor.a); } ); #endif @implementation GPUImageFalseColorFilter @synthesize secondColor = _secondColor; @synthesize firstColor = _firstColor; - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUFalseColorFragmentShaderString])) { return nil; } firstColorUniform = [filterProgram uniformIndex:@"firstColor"]; secondColorUniform = [filterProgram uniformIndex:@"secondColor"]; self.firstColor = (GPUVector4){0.0f, 0.0f, 0.5f, 1.0f}; self.secondColor = (GPUVector4){1.0f, 0.0f, 0.0f, 1.0f}; return self; } #pragma mark - #pragma mark Accessors - (void)setFirstColor:(GPUVector4)newValue; { _firstColor = newValue; [self setFirstColorRed:_firstColor.one green:_firstColor.two blue:_firstColor.three]; } - (void)setSecondColor:(GPUVector4)newValue; { _secondColor = newValue; [self setSecondColorRed:_secondColor.one green:_secondColor.two blue:_secondColor.three]; } - (void)setFirstColorRed:(GLfloat)redComponent green:(GLfloat)greenComponent blue:(GLfloat)blueComponent; { GPUVector3 firstColor = {redComponent, greenComponent, blueComponent}; [self setVec3:firstColor forUniform:firstColorUniform program:filterProgram]; } - (void)setSecondColorRed:(GLfloat)redComponent green:(GLfloat)greenComponent blue:(GLfloat)blueComponent; { GPUVector3 secondColor = {redComponent, greenComponent, blueComponent}; [self setVec3:secondColor forUniform:secondColorUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImageFilter.h ================================================ #import "GPUImageOutput.h" #define STRINGIZE(x) #x #define STRINGIZE2(x) STRINGIZE(x) #define SHADER_STRING(text) @ STRINGIZE2(text) #define GPUImageHashIdentifier # #define GPUImageWrappedLabel(x) x #define GPUImageEscapedHashIdentifier(a) GPUImageWrappedLabel(GPUImageHashIdentifier)a extern NSString *const kGPUImageVertexShaderString; extern NSString *const kGPUImagePassthroughFragmentShaderString; struct GPUVector4 { GLfloat one; GLfloat two; GLfloat three; GLfloat four; }; typedef struct GPUVector4 GPUVector4; struct GPUVector3 { GLfloat one; GLfloat two; GLfloat three; }; typedef struct GPUVector3 GPUVector3; struct GPUMatrix4x4 { GPUVector4 one; GPUVector4 two; GPUVector4 three; GPUVector4 four; }; typedef struct GPUMatrix4x4 GPUMatrix4x4; struct GPUMatrix3x3 { GPUVector3 one; GPUVector3 two; GPUVector3 three; }; typedef struct GPUMatrix3x3 GPUMatrix3x3; /** GPUImage's base filter class Filters and other subsequent elements in the chain conform to the GPUImageInput protocol, which lets them take in the supplied or processed texture from the previous link in the chain and do something with it. Objects one step further down the chain are considered targets, and processing can be branched by adding multiple targets to a single output or filter. */ @interface GPUImageFilter : GPUImageOutput { GPUImageFramebuffer *firstInputFramebuffer; GLProgram *filterProgram; GLint filterPositionAttribute, filterTextureCoordinateAttribute; GLint filterInputTextureUniform; GLfloat backgroundColorRed, backgroundColorGreen, backgroundColorBlue, backgroundColorAlpha; BOOL isEndProcessing; CGSize currentFilterSize; GPUImageRotationMode inputRotation; BOOL currentlyReceivingMonochromeInput; NSMutableDictionary *uniformStateRestorationBlocks; dispatch_semaphore_t imageCaptureSemaphore; } @property(readonly) CVPixelBufferRef renderTarget; @property(readwrite, nonatomic) BOOL preventRendering; @property(readwrite, nonatomic) BOOL currentlyReceivingMonochromeInput; /// @name Initialization and teardown /** Initialize with vertex and fragment shaders You make take advantage of the SHADER_STRING macro to write your shaders in-line. @param vertexShaderString Source code of the vertex shader to use @param fragmentShaderString Source code of the fragment shader to use */ - (id)initWithVertexShaderFromString:(NSString *)vertexShaderString fragmentShaderFromString:(NSString *)fragmentShaderString; /** Initialize with a fragment shader You may take advantage of the SHADER_STRING macro to write your shader in-line. @param fragmentShaderString Source code of fragment shader to use */ - (id)initWithFragmentShaderFromString:(NSString *)fragmentShaderString; /** Initialize with a fragment shader @param fragmentShaderFilename Filename of fragment shader to load */ - (id)initWithFragmentShaderFromFile:(NSString *)fragmentShaderFilename; - (void)initializeAttributes; - (void)setupFilterForSize:(CGSize)filterFrameSize; - (CGSize)rotatedSize:(CGSize)sizeToRotate forIndex:(NSInteger)textureIndex; - (CGPoint)rotatedPoint:(CGPoint)pointToRotate forRotation:(GPUImageRotationMode)rotation; /// @name Managing the display FBOs /** Size of the frame buffer object */ - (CGSize)sizeOfFBO; /// @name Rendering + (const GLfloat *)textureCoordinatesForRotation:(GPUImageRotationMode)rotationMode; - (void)renderToTextureWithVertices:(const GLfloat *)vertices textureCoordinates:(const GLfloat *)textureCoordinates; - (void)informTargetsAboutNewFrameAtTime:(CMTime)frameTime; - (CGSize)outputFrameSize; /// @name Input parameters - (void)setBackgroundColorRed:(GLfloat)redComponent green:(GLfloat)greenComponent blue:(GLfloat)blueComponent alpha:(GLfloat)alphaComponent; - (void)setInteger:(GLint)newInteger forUniformName:(NSString *)uniformName; - (void)setFloat:(GLfloat)newFloat forUniformName:(NSString *)uniformName; - (void)setSize:(CGSize)newSize forUniformName:(NSString *)uniformName; - (void)setPoint:(CGPoint)newPoint forUniformName:(NSString *)uniformName; - (void)setFloatVec3:(GPUVector3)newVec3 forUniformName:(NSString *)uniformName; - (void)setFloatVec4:(GPUVector4)newVec4 forUniform:(NSString *)uniformName; - (void)setFloatArray:(GLfloat *)array length:(GLsizei)count forUniform:(NSString*)uniformName; - (void)setMatrix3f:(GPUMatrix3x3)matrix forUniform:(GLint)uniform program:(GLProgram *)shaderProgram; - (void)setMatrix4f:(GPUMatrix4x4)matrix forUniform:(GLint)uniform program:(GLProgram *)shaderProgram; - (void)setFloat:(GLfloat)floatValue forUniform:(GLint)uniform program:(GLProgram *)shaderProgram; - (void)setPoint:(CGPoint)pointValue forUniform:(GLint)uniform program:(GLProgram *)shaderProgram; - (void)setSize:(CGSize)sizeValue forUniform:(GLint)uniform program:(GLProgram *)shaderProgram; - (void)setVec3:(GPUVector3)vectorValue forUniform:(GLint)uniform program:(GLProgram *)shaderProgram; - (void)setVec4:(GPUVector4)vectorValue forUniform:(GLint)uniform program:(GLProgram *)shaderProgram; - (void)setFloatArray:(GLfloat *)arrayValue length:(GLsizei)arrayLength forUniform:(GLint)uniform program:(GLProgram *)shaderProgram; - (void)setInteger:(GLint)intValue forUniform:(GLint)uniform program:(GLProgram *)shaderProgram; - (void)setAndExecuteUniformStateCallbackAtIndex:(GLint)uniform forProgram:(GLProgram *)shaderProgram toBlock:(dispatch_block_t)uniformStateBlock; - (void)setUniformsForProgramAtIndex:(NSUInteger)programIndex; @end ================================================ FILE: framework/Source/GPUImageFilter.m ================================================ #import "GPUImageFilter.h" #import "GPUImagePicture.h" #import // Hardcode the vertex shader for standard filters, but this can be overridden NSString *const kGPUImageVertexShaderString = SHADER_STRING ( attribute vec4 position; attribute vec4 inputTextureCoordinate; varying vec2 textureCoordinate; void main() { gl_Position = position; textureCoordinate = inputTextureCoordinate.xy; } ); #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImagePassthroughFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; void main() { gl_FragColor = texture2D(inputImageTexture, textureCoordinate); } ); #else NSString *const kGPUImagePassthroughFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; void main() { gl_FragColor = texture2D(inputImageTexture, textureCoordinate); } ); #endif @implementation GPUImageFilter @synthesize preventRendering = _preventRendering; @synthesize currentlyReceivingMonochromeInput; #pragma mark - #pragma mark Initialization and teardown - (id)initWithVertexShaderFromString:(NSString *)vertexShaderString fragmentShaderFromString:(NSString *)fragmentShaderString; { if (!(self = [super init])) { return nil; } uniformStateRestorationBlocks = [NSMutableDictionary dictionaryWithCapacity:10]; _preventRendering = NO; currentlyReceivingMonochromeInput = NO; inputRotation = kGPUImageNoRotation; backgroundColorRed = 0.0; backgroundColorGreen = 0.0; backgroundColorBlue = 0.0; backgroundColorAlpha = 0.0; imageCaptureSemaphore = dispatch_semaphore_create(0); dispatch_semaphore_signal(imageCaptureSemaphore); runSynchronouslyOnVideoProcessingQueue(^{ [GPUImageContext useImageProcessingContext]; filterProgram = [[GPUImageContext sharedImageProcessingContext] programForVertexShaderString:vertexShaderString fragmentShaderString:fragmentShaderString]; if (!filterProgram.initialized) { [self initializeAttributes]; if (![filterProgram link]) { NSString *progLog = [filterProgram programLog]; NSLog(@"Program link log: %@", progLog); NSString *fragLog = [filterProgram fragmentShaderLog]; NSLog(@"Fragment shader compile log: %@", fragLog); NSString *vertLog = [filterProgram vertexShaderLog]; NSLog(@"Vertex shader compile log: %@", vertLog); filterProgram = nil; NSAssert(NO, @"Filter shader link failed"); } } filterPositionAttribute = [filterProgram attributeIndex:@"position"]; filterTextureCoordinateAttribute = [filterProgram attributeIndex:@"inputTextureCoordinate"]; filterInputTextureUniform = [filterProgram uniformIndex:@"inputImageTexture"]; // This does assume a name of "inputImageTexture" for the fragment shader [GPUImageContext setActiveShaderProgram:filterProgram]; glEnableVertexAttribArray(filterPositionAttribute); glEnableVertexAttribArray(filterTextureCoordinateAttribute); }); return self; } - (id)initWithFragmentShaderFromString:(NSString *)fragmentShaderString; { if (!(self = [self initWithVertexShaderFromString:kGPUImageVertexShaderString fragmentShaderFromString:fragmentShaderString])) { return nil; } return self; } - (id)initWithFragmentShaderFromFile:(NSString *)fragmentShaderFilename; { NSString *fragmentShaderPathname = [[NSBundle mainBundle] pathForResource:fragmentShaderFilename ofType:@"fsh"]; NSString *fragmentShaderString = [NSString stringWithContentsOfFile:fragmentShaderPathname encoding:NSUTF8StringEncoding error:nil]; if (!(self = [self initWithFragmentShaderFromString:fragmentShaderString])) { return nil; } return self; } - (id)init; { if (!(self = [self initWithFragmentShaderFromString:kGPUImagePassthroughFragmentShaderString])) { return nil; } return self; } - (void)initializeAttributes; { [filterProgram addAttribute:@"position"]; [filterProgram addAttribute:@"inputTextureCoordinate"]; // Override this, calling back to this super method, in order to add new attributes to your vertex shader } - (void)setupFilterForSize:(CGSize)filterFrameSize; { // This is where you can override to provide some custom setup, if your filter has a size-dependent element } - (void)dealloc { #if !OS_OBJECT_USE_OBJC if (imageCaptureSemaphore != NULL) { dispatch_release(imageCaptureSemaphore); } #endif } #pragma mark - #pragma mark Still image processing - (void)useNextFrameForImageCapture; { usingNextFrameForImageCapture = YES; // Set the semaphore high, if it isn't already if (dispatch_semaphore_wait(imageCaptureSemaphore, DISPATCH_TIME_NOW) != 0) { return; } } - (CGImageRef)newCGImageFromCurrentlyProcessedOutput { // Give it three seconds to process, then abort if they forgot to set up the image capture properly double timeoutForImageCapture = 3.0; dispatch_time_t convertedTimeout = dispatch_time(DISPATCH_TIME_NOW, timeoutForImageCapture * NSEC_PER_SEC); if (dispatch_semaphore_wait(imageCaptureSemaphore, convertedTimeout) != 0) { return NULL; } GPUImageFramebuffer* framebuffer = [self framebufferForOutput]; usingNextFrameForImageCapture = NO; dispatch_semaphore_signal(imageCaptureSemaphore); CGImageRef image = [framebuffer newCGImageFromFramebufferContents]; return image; } #pragma mark - #pragma mark Managing the display FBOs - (CGSize)sizeOfFBO; { CGSize outputSize = [self maximumOutputSize]; if ( (CGSizeEqualToSize(outputSize, CGSizeZero)) || (inputTextureSize.width < outputSize.width) ) { return inputTextureSize; } else { return outputSize; } } #pragma mark - #pragma mark Rendering + (const GLfloat *)textureCoordinatesForRotation:(GPUImageRotationMode)rotationMode; { static const GLfloat noRotationTextureCoordinates[] = { 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, }; static const GLfloat rotateLeftTextureCoordinates[] = { 1.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f, }; static const GLfloat rotateRightTextureCoordinates[] = { 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, 0.0f, }; static const GLfloat verticalFlipTextureCoordinates[] = { 0.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, }; static const GLfloat horizontalFlipTextureCoordinates[] = { 1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f, }; static const GLfloat rotateRightVerticalFlipTextureCoordinates[] = { 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f, 1.0f, }; static const GLfloat rotateRightHorizontalFlipTextureCoordinates[] = { 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, }; static const GLfloat rotate180TextureCoordinates[] = { 1.0f, 1.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, }; switch(rotationMode) { case kGPUImageNoRotation: return noRotationTextureCoordinates; case kGPUImageRotateLeft: return rotateLeftTextureCoordinates; case kGPUImageRotateRight: return rotateRightTextureCoordinates; case kGPUImageFlipVertical: return verticalFlipTextureCoordinates; case kGPUImageFlipHorizonal: return horizontalFlipTextureCoordinates; case kGPUImageRotateRightFlipVertical: return rotateRightVerticalFlipTextureCoordinates; case kGPUImageRotateRightFlipHorizontal: return rotateRightHorizontalFlipTextureCoordinates; case kGPUImageRotate180: return rotate180TextureCoordinates; } } - (void)renderToTextureWithVertices:(const GLfloat *)vertices textureCoordinates:(const GLfloat *)textureCoordinates; { if (self.preventRendering) { [firstInputFramebuffer unlock]; return; } [GPUImageContext setActiveShaderProgram:filterProgram]; outputFramebuffer = [[GPUImageContext sharedFramebufferCache] fetchFramebufferForSize:[self sizeOfFBO] textureOptions:self.outputTextureOptions onlyTexture:NO]; [outputFramebuffer activateFramebuffer]; if (usingNextFrameForImageCapture) { [outputFramebuffer lock]; } [self setUniformsForProgramAtIndex:0]; glClearColor(backgroundColorRed, backgroundColorGreen, backgroundColorBlue, backgroundColorAlpha); glClear(GL_COLOR_BUFFER_BIT); glActiveTexture(GL_TEXTURE2); glBindTexture(GL_TEXTURE_2D, [firstInputFramebuffer texture]); glUniform1i(filterInputTextureUniform, 2); glVertexAttribPointer(filterPositionAttribute, 2, GL_FLOAT, 0, 0, vertices); glVertexAttribPointer(filterTextureCoordinateAttribute, 2, GL_FLOAT, 0, 0, textureCoordinates); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); [firstInputFramebuffer unlock]; if (usingNextFrameForImageCapture) { dispatch_semaphore_signal(imageCaptureSemaphore); } } - (void)informTargetsAboutNewFrameAtTime:(CMTime)frameTime; { if (self.frameProcessingCompletionBlock != NULL) { self.frameProcessingCompletionBlock(self, frameTime); } // Get all targets the framebuffer so they can grab a lock on it for (id currentTarget in targets) { if (currentTarget != self.targetToIgnoreForUpdates) { NSInteger indexOfObject = [targets indexOfObject:currentTarget]; NSInteger textureIndex = [[targetTextureIndices objectAtIndex:indexOfObject] integerValue]; [self setInputFramebufferForTarget:currentTarget atIndex:textureIndex]; [currentTarget setInputSize:[self outputFrameSize] atIndex:textureIndex]; } } // Release our hold so it can return to the cache immediately upon processing [[self framebufferForOutput] unlock]; if (usingNextFrameForImageCapture) { // usingNextFrameForImageCapture = NO; } else { [self removeOutputFramebuffer]; } // Trigger processing last, so that our unlock comes first in serial execution, avoiding the need for a callback for (id currentTarget in targets) { if (currentTarget != self.targetToIgnoreForUpdates) { NSInteger indexOfObject = [targets indexOfObject:currentTarget]; NSInteger textureIndex = [[targetTextureIndices objectAtIndex:indexOfObject] integerValue]; [currentTarget newFrameReadyAtTime:frameTime atIndex:textureIndex]; } } } - (CGSize)outputFrameSize; { return inputTextureSize; } #pragma mark - #pragma mark Input parameters - (void)setBackgroundColorRed:(GLfloat)redComponent green:(GLfloat)greenComponent blue:(GLfloat)blueComponent alpha:(GLfloat)alphaComponent; { backgroundColorRed = redComponent; backgroundColorGreen = greenComponent; backgroundColorBlue = blueComponent; backgroundColorAlpha = alphaComponent; } - (void)setInteger:(GLint)newInteger forUniformName:(NSString *)uniformName; { GLint uniformIndex = [filterProgram uniformIndex:uniformName]; [self setInteger:newInteger forUniform:uniformIndex program:filterProgram]; } - (void)setFloat:(GLfloat)newFloat forUniformName:(NSString *)uniformName; { GLint uniformIndex = [filterProgram uniformIndex:uniformName]; [self setFloat:newFloat forUniform:uniformIndex program:filterProgram]; } - (void)setSize:(CGSize)newSize forUniformName:(NSString *)uniformName; { GLint uniformIndex = [filterProgram uniformIndex:uniformName]; [self setSize:newSize forUniform:uniformIndex program:filterProgram]; } - (void)setPoint:(CGPoint)newPoint forUniformName:(NSString *)uniformName; { GLint uniformIndex = [filterProgram uniformIndex:uniformName]; [self setPoint:newPoint forUniform:uniformIndex program:filterProgram]; } - (void)setFloatVec3:(GPUVector3)newVec3 forUniformName:(NSString *)uniformName; { GLint uniformIndex = [filterProgram uniformIndex:uniformName]; [self setVec3:newVec3 forUniform:uniformIndex program:filterProgram]; } - (void)setFloatVec4:(GPUVector4)newVec4 forUniform:(NSString *)uniformName; { GLint uniformIndex = [filterProgram uniformIndex:uniformName]; [self setVec4:newVec4 forUniform:uniformIndex program:filterProgram]; } - (void)setFloatArray:(GLfloat *)array length:(GLsizei)count forUniform:(NSString*)uniformName { GLint uniformIndex = [filterProgram uniformIndex:uniformName]; [self setFloatArray:array length:count forUniform:uniformIndex program:filterProgram]; } - (void)setMatrix3f:(GPUMatrix3x3)matrix forUniform:(GLint)uniform program:(GLProgram *)shaderProgram; { runAsynchronouslyOnVideoProcessingQueue(^{ [GPUImageContext setActiveShaderProgram:shaderProgram]; [self setAndExecuteUniformStateCallbackAtIndex:uniform forProgram:shaderProgram toBlock:^{ glUniformMatrix3fv(uniform, 1, GL_FALSE, (GLfloat *)&matrix); }]; }); } - (void)setMatrix4f:(GPUMatrix4x4)matrix forUniform:(GLint)uniform program:(GLProgram *)shaderProgram; { runAsynchronouslyOnVideoProcessingQueue(^{ [GPUImageContext setActiveShaderProgram:shaderProgram]; [self setAndExecuteUniformStateCallbackAtIndex:uniform forProgram:shaderProgram toBlock:^{ glUniformMatrix4fv(uniform, 1, GL_FALSE, (GLfloat *)&matrix); }]; }); } - (void)setFloat:(GLfloat)floatValue forUniform:(GLint)uniform program:(GLProgram *)shaderProgram; { runAsynchronouslyOnVideoProcessingQueue(^{ [GPUImageContext setActiveShaderProgram:shaderProgram]; [self setAndExecuteUniformStateCallbackAtIndex:uniform forProgram:shaderProgram toBlock:^{ glUniform1f(uniform, floatValue); }]; }); } - (void)setPoint:(CGPoint)pointValue forUniform:(GLint)uniform program:(GLProgram *)shaderProgram; { runAsynchronouslyOnVideoProcessingQueue(^{ [GPUImageContext setActiveShaderProgram:shaderProgram]; [self setAndExecuteUniformStateCallbackAtIndex:uniform forProgram:shaderProgram toBlock:^{ GLfloat positionArray[2]; positionArray[0] = pointValue.x; positionArray[1] = pointValue.y; glUniform2fv(uniform, 1, positionArray); }]; }); } - (void)setSize:(CGSize)sizeValue forUniform:(GLint)uniform program:(GLProgram *)shaderProgram; { runAsynchronouslyOnVideoProcessingQueue(^{ [GPUImageContext setActiveShaderProgram:shaderProgram]; [self setAndExecuteUniformStateCallbackAtIndex:uniform forProgram:shaderProgram toBlock:^{ GLfloat sizeArray[2]; sizeArray[0] = sizeValue.width; sizeArray[1] = sizeValue.height; glUniform2fv(uniform, 1, sizeArray); }]; }); } - (void)setVec3:(GPUVector3)vectorValue forUniform:(GLint)uniform program:(GLProgram *)shaderProgram; { runAsynchronouslyOnVideoProcessingQueue(^{ [GPUImageContext setActiveShaderProgram:shaderProgram]; [self setAndExecuteUniformStateCallbackAtIndex:uniform forProgram:shaderProgram toBlock:^{ glUniform3fv(uniform, 1, (GLfloat *)&vectorValue); }]; }); } - (void)setVec4:(GPUVector4)vectorValue forUniform:(GLint)uniform program:(GLProgram *)shaderProgram; { runAsynchronouslyOnVideoProcessingQueue(^{ [GPUImageContext setActiveShaderProgram:shaderProgram]; [self setAndExecuteUniformStateCallbackAtIndex:uniform forProgram:shaderProgram toBlock:^{ glUniform4fv(uniform, 1, (GLfloat *)&vectorValue); }]; }); } - (void)setFloatArray:(GLfloat *)arrayValue length:(GLsizei)arrayLength forUniform:(GLint)uniform program:(GLProgram *)shaderProgram; { // Make a copy of the data, so it doesn't get overwritten before async call executes NSData* arrayData = [NSData dataWithBytes:arrayValue length:arrayLength * sizeof(arrayValue[0])]; runAsynchronouslyOnVideoProcessingQueue(^{ [GPUImageContext setActiveShaderProgram:shaderProgram]; [self setAndExecuteUniformStateCallbackAtIndex:uniform forProgram:shaderProgram toBlock:^{ glUniform1fv(uniform, arrayLength, [arrayData bytes]); }]; }); } - (void)setInteger:(GLint)intValue forUniform:(GLint)uniform program:(GLProgram *)shaderProgram; { runAsynchronouslyOnVideoProcessingQueue(^{ [GPUImageContext setActiveShaderProgram:shaderProgram]; [self setAndExecuteUniformStateCallbackAtIndex:uniform forProgram:shaderProgram toBlock:^{ glUniform1i(uniform, intValue); }]; }); } - (void)setAndExecuteUniformStateCallbackAtIndex:(GLint)uniform forProgram:(GLProgram *)shaderProgram toBlock:(dispatch_block_t)uniformStateBlock; { [uniformStateRestorationBlocks setObject:[uniformStateBlock copy] forKey:[NSNumber numberWithInt:uniform]]; uniformStateBlock(); } - (void)setUniformsForProgramAtIndex:(NSUInteger)programIndex; { [uniformStateRestorationBlocks enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop){ dispatch_block_t currentBlock = obj; currentBlock(); }]; } #pragma mark - #pragma mark GPUImageInput - (void)newFrameReadyAtTime:(CMTime)frameTime atIndex:(NSInteger)textureIndex; { static const GLfloat imageVertices[] = { -1.0f, -1.0f, 1.0f, -1.0f, -1.0f, 1.0f, 1.0f, 1.0f, }; [self renderToTextureWithVertices:imageVertices textureCoordinates:[[self class] textureCoordinatesForRotation:inputRotation]]; [self informTargetsAboutNewFrameAtTime:frameTime]; } - (NSInteger)nextAvailableTextureIndex; { return 0; } - (void)setInputFramebuffer:(GPUImageFramebuffer *)newInputFramebuffer atIndex:(NSInteger)textureIndex; { firstInputFramebuffer = newInputFramebuffer; [firstInputFramebuffer lock]; } - (CGSize)rotatedSize:(CGSize)sizeToRotate forIndex:(NSInteger)textureIndex; { CGSize rotatedSize = sizeToRotate; if (GPUImageRotationSwapsWidthAndHeight(inputRotation)) { rotatedSize.width = sizeToRotate.height; rotatedSize.height = sizeToRotate.width; } return rotatedSize; } - (CGPoint)rotatedPoint:(CGPoint)pointToRotate forRotation:(GPUImageRotationMode)rotation; { CGPoint rotatedPoint; switch(rotation) { case kGPUImageNoRotation: return pointToRotate; break; case kGPUImageFlipHorizonal: { rotatedPoint.x = 1.0 - pointToRotate.x; rotatedPoint.y = pointToRotate.y; }; break; case kGPUImageFlipVertical: { rotatedPoint.x = pointToRotate.x; rotatedPoint.y = 1.0 - pointToRotate.y; }; break; case kGPUImageRotateLeft: { rotatedPoint.x = 1.0 - pointToRotate.y; rotatedPoint.y = pointToRotate.x; }; break; case kGPUImageRotateRight: { rotatedPoint.x = pointToRotate.y; rotatedPoint.y = 1.0 - pointToRotate.x; }; break; case kGPUImageRotateRightFlipVertical: { rotatedPoint.x = pointToRotate.y; rotatedPoint.y = pointToRotate.x; }; break; case kGPUImageRotateRightFlipHorizontal: { rotatedPoint.x = 1.0 - pointToRotate.y; rotatedPoint.y = 1.0 - pointToRotate.x; }; break; case kGPUImageRotate180: { rotatedPoint.x = 1.0 - pointToRotate.x; rotatedPoint.y = 1.0 - pointToRotate.y; }; break; } return rotatedPoint; } - (void)setInputSize:(CGSize)newSize atIndex:(NSInteger)textureIndex; { if (self.preventRendering) { return; } if (overrideInputSize) { if (CGSizeEqualToSize(forcedMaximumSize, CGSizeZero)) { } else { CGRect insetRect = AVMakeRectWithAspectRatioInsideRect(newSize, CGRectMake(0.0, 0.0, forcedMaximumSize.width, forcedMaximumSize.height)); inputTextureSize = insetRect.size; } } else { CGSize rotatedSize = [self rotatedSize:newSize forIndex:textureIndex]; if (CGSizeEqualToSize(rotatedSize, CGSizeZero)) { inputTextureSize = rotatedSize; } else if (!CGSizeEqualToSize(inputTextureSize, rotatedSize)) { inputTextureSize = rotatedSize; } } [self setupFilterForSize:[self sizeOfFBO]]; } - (void)setInputRotation:(GPUImageRotationMode)newInputRotation atIndex:(NSInteger)textureIndex; { inputRotation = newInputRotation; } - (void)forceProcessingAtSize:(CGSize)frameSize; { if (CGSizeEqualToSize(frameSize, CGSizeZero)) { overrideInputSize = NO; } else { overrideInputSize = YES; inputTextureSize = frameSize; forcedMaximumSize = CGSizeZero; } } - (void)forceProcessingAtSizeRespectingAspectRatio:(CGSize)frameSize; { if (CGSizeEqualToSize(frameSize, CGSizeZero)) { overrideInputSize = NO; inputTextureSize = CGSizeZero; forcedMaximumSize = CGSizeZero; } else { overrideInputSize = YES; forcedMaximumSize = frameSize; } } - (CGSize)maximumOutputSize; { // I'm temporarily disabling adjustments for smaller output sizes until I figure out how to make this work better return CGSizeZero; /* if (CGSizeEqualToSize(cachedMaximumOutputSize, CGSizeZero)) { for (id currentTarget in targets) { if ([currentTarget maximumOutputSize].width > cachedMaximumOutputSize.width) { cachedMaximumOutputSize = [currentTarget maximumOutputSize]; } } } return cachedMaximumOutputSize; */ } - (void)endProcessing { if (!isEndProcessing) { isEndProcessing = YES; for (id currentTarget in targets) { [currentTarget endProcessing]; } } } - (BOOL)wantsMonochromeInput; { return NO; } #pragma mark - #pragma mark Accessors @end ================================================ FILE: framework/Source/GPUImageFilterGroup.h ================================================ #import "GPUImageOutput.h" #import "GPUImageFilter.h" @interface GPUImageFilterGroup : GPUImageOutput { NSMutableArray *filters; BOOL isEndProcessing; } @property(readwrite, nonatomic, strong) GPUImageOutput *terminalFilter; @property(readwrite, nonatomic, strong) NSArray *initialFilters; @property(readwrite, nonatomic, strong) GPUImageOutput *inputFilterToIgnoreForUpdates; // Filter management - (void)addFilter:(GPUImageOutput *)newFilter; - (GPUImageOutput *)filterAtIndex:(NSUInteger)filterIndex; - (NSUInteger)filterCount; @end ================================================ FILE: framework/Source/GPUImageFilterGroup.m ================================================ #import "GPUImageFilterGroup.h" #import "GPUImagePicture.h" @implementation GPUImageFilterGroup @synthesize terminalFilter = _terminalFilter; @synthesize initialFilters = _initialFilters; @synthesize inputFilterToIgnoreForUpdates = _inputFilterToIgnoreForUpdates; - (id)init; { if (!(self = [super init])) { return nil; } filters = [[NSMutableArray alloc] init]; return self; } #pragma mark - #pragma mark Filter management - (void)addFilter:(GPUImageOutput *)newFilter; { [filters addObject:newFilter]; } - (GPUImageOutput *)filterAtIndex:(NSUInteger)filterIndex; { return [filters objectAtIndex:filterIndex]; } - (NSUInteger)filterCount; { return [filters count]; } #pragma mark - #pragma mark Still image processing - (void)useNextFrameForImageCapture; { [self.terminalFilter useNextFrameForImageCapture]; } - (CGImageRef)newCGImageFromCurrentlyProcessedOutput; { return [self.terminalFilter newCGImageFromCurrentlyProcessedOutput]; } #pragma mark - #pragma mark GPUImageOutput overrides - (void)setTargetToIgnoreForUpdates:(id)targetToIgnoreForUpdates; { [_terminalFilter setTargetToIgnoreForUpdates:targetToIgnoreForUpdates]; } - (void)addTarget:(id)newTarget atTextureLocation:(NSInteger)textureLocation; { [_terminalFilter addTarget:newTarget atTextureLocation:textureLocation]; } - (void)removeTarget:(id)targetToRemove; { [_terminalFilter removeTarget:targetToRemove]; } - (void)removeAllTargets; { [_terminalFilter removeAllTargets]; } - (NSArray *)targets; { return [_terminalFilter targets]; } - (void)setFrameProcessingCompletionBlock:(void (^)(GPUImageOutput *, CMTime))frameProcessingCompletionBlock; { [_terminalFilter setFrameProcessingCompletionBlock:frameProcessingCompletionBlock]; } - (void (^)(GPUImageOutput *, CMTime))frameProcessingCompletionBlock; { return [_terminalFilter frameProcessingCompletionBlock]; } #pragma mark - #pragma mark GPUImageInput protocol - (void)newFrameReadyAtTime:(CMTime)frameTime atIndex:(NSInteger)textureIndex; { for (GPUImageOutput *currentFilter in _initialFilters) { if (currentFilter != self.inputFilterToIgnoreForUpdates) { [currentFilter newFrameReadyAtTime:frameTime atIndex:textureIndex]; } } } - (void)setInputFramebuffer:(GPUImageFramebuffer *)newInputFramebuffer atIndex:(NSInteger)textureIndex; { for (GPUImageOutput *currentFilter in _initialFilters) { [currentFilter setInputFramebuffer:newInputFramebuffer atIndex:textureIndex]; } } - (NSInteger)nextAvailableTextureIndex; { // if ([_initialFilters count] > 0) // { // return [[_initialFilters objectAtIndex:0] nextAvailableTextureIndex]; // } return 0; } - (void)setInputSize:(CGSize)newSize atIndex:(NSInteger)textureIndex; { for (GPUImageOutput *currentFilter in _initialFilters) { [currentFilter setInputSize:newSize atIndex:textureIndex]; } } - (void)setInputRotation:(GPUImageRotationMode)newInputRotation atIndex:(NSInteger)textureIndex; { for (GPUImageOutput *currentFilter in _initialFilters) { [currentFilter setInputRotation:newInputRotation atIndex:(NSInteger)textureIndex]; } } - (void)forceProcessingAtSize:(CGSize)frameSize; { for (GPUImageOutput *currentFilter in filters) { [currentFilter forceProcessingAtSize:frameSize]; } } - (void)forceProcessingAtSizeRespectingAspectRatio:(CGSize)frameSize; { for (GPUImageOutput *currentFilter in filters) { [currentFilter forceProcessingAtSizeRespectingAspectRatio:frameSize]; } } - (CGSize)maximumOutputSize; { // I'm temporarily disabling adjustments for smaller output sizes until I figure out how to make this work better return CGSizeZero; /* if (CGSizeEqualToSize(cachedMaximumOutputSize, CGSizeZero)) { for (id currentTarget in _initialFilters) { if ([currentTarget maximumOutputSize].width > cachedMaximumOutputSize.width) { cachedMaximumOutputSize = [currentTarget maximumOutputSize]; } } } return cachedMaximumOutputSize; */ } - (void)endProcessing; { if (!isEndProcessing) { isEndProcessing = YES; for (id currentTarget in _initialFilters) { [currentTarget endProcessing]; } } } - (BOOL)wantsMonochromeInput; { BOOL allInputsWantMonochromeInput = YES; for (GPUImageOutput *currentFilter in _initialFilters) { allInputsWantMonochromeInput = allInputsWantMonochromeInput && [currentFilter wantsMonochromeInput]; } return allInputsWantMonochromeInput; } - (void)setCurrentlyReceivingMonochromeInput:(BOOL)newValue; { for (GPUImageOutput *currentFilter in _initialFilters) { [currentFilter setCurrentlyReceivingMonochromeInput:newValue]; } } @end ================================================ FILE: framework/Source/GPUImageFilterPipeline.h ================================================ #import #import "GPUImageOutput.h" @interface GPUImageFilterPipeline : NSObject { NSString *stringValue; } @property (strong) NSMutableArray *filters; @property (strong) GPUImageOutput *input; @property (strong) id output; - (id) initWithOrderedFilters:(NSArray*) filters input:(GPUImageOutput*)input output:(id )output; - (id) initWithConfiguration:(NSDictionary*) configuration input:(GPUImageOutput*)input output:(id )output; - (id) initWithConfigurationFile:(NSURL*) configuration input:(GPUImageOutput*)input output:(id )output; - (void) addFilter:(GPUImageOutput *)filter; - (void) addFilter:(GPUImageOutput *)filter atIndex:(NSUInteger)insertIndex; - (void) replaceFilterAtIndex:(NSUInteger)index withFilter:(GPUImageOutput *)filter; - (void) replaceAllFilters:(NSArray *) newFilters; - (void) removeFilter:(GPUImageOutput *)filter; - (void) removeFilterAtIndex:(NSUInteger)index; - (void) removeAllFilters; - (UIImage *) currentFilteredFrame; - (UIImage *) currentFilteredFrameWithOrientation:(UIImageOrientation)imageOrientation; - (CGImageRef) newCGImageFromCurrentFilteredFrame; @end ================================================ FILE: framework/Source/GPUImageFilterPipeline.m ================================================ #import "GPUImageFilterPipeline.h" @interface GPUImageFilterPipeline () - (BOOL)_parseConfiguration:(NSDictionary *)configuration; - (void)_refreshFilters; @end @implementation GPUImageFilterPipeline @synthesize filters = _filters, input = _input, output = _output; #pragma mark Config file init - (id)initWithConfiguration:(NSDictionary *)configuration input:(GPUImageOutput *)input output:(id )output { self = [super init]; if (self) { self.input = input; self.output = output; if (![self _parseConfiguration:configuration]) { NSLog(@"Sorry, a parsing error occurred."); abort(); } [self _refreshFilters]; } return self; } - (id)initWithConfigurationFile:(NSURL *)configuration input:(GPUImageOutput *)input output:(id )output { return [self initWithConfiguration:[NSDictionary dictionaryWithContentsOfURL:configuration] input:input output:output]; } - (BOOL)_parseConfiguration:(NSDictionary *)configuration { NSArray *filters = [configuration objectForKey:@"Filters"]; if (!filters) { return NO; } NSError *regexError = nil; NSRegularExpression *parsingRegex = [NSRegularExpression regularExpressionWithPattern:@"(float|CGPoint|NSString)\\((.*?)(?:,\\s*(.*?))*\\)" options:0 error:®exError]; // It's faster to put them into an array and then pass it to the filters property than it is to call [self addFilter:] every time NSMutableArray *orderedFilters = [NSMutableArray arrayWithCapacity:[filters count]]; for (NSDictionary *filter in filters) { NSString *filterName = [filter objectForKey:@"FilterName"]; Class theClass = NSClassFromString(filterName); GPUImageOutput *genericFilter = [[theClass alloc] init]; // Set up the properties NSDictionary *filterAttributes; if ((filterAttributes = [filter objectForKey:@"Attributes"])) { for (NSString *propertyKey in filterAttributes) { // Set up the selector SEL theSelector = NSSelectorFromString(propertyKey); NSInvocation *inv = [NSInvocation invocationWithMethodSignature:[theClass instanceMethodSignatureForSelector:theSelector]]; [inv setSelector:theSelector]; [inv setTarget:genericFilter]; // check selector given with parameter if ([propertyKey hasSuffix:@":"]) { stringValue = nil; // Then parse the arguments NSMutableArray *parsedArray; if ([[filterAttributes objectForKey:propertyKey] isKindOfClass:[NSArray class]]) { NSArray *array = [filterAttributes objectForKey:propertyKey]; parsedArray = [NSMutableArray arrayWithCapacity:[array count]]; for (NSString *string in array) { NSTextCheckingResult *parse = [parsingRegex firstMatchInString:string options:0 range:NSMakeRange(0, [string length])]; NSString *modifier = [string substringWithRange:[parse rangeAtIndex:1]]; if ([modifier isEqualToString:@"float"]) { // Float modifier, one argument CGFloat value = [[string substringWithRange:[parse rangeAtIndex:2]] floatValue]; [parsedArray addObject:[NSNumber numberWithFloat:value]]; [inv setArgument:&value atIndex:2]; } else if ([modifier isEqualToString:@"CGPoint"]) { // CGPoint modifier, two float arguments CGFloat x = [[string substringWithRange:[parse rangeAtIndex:2]] floatValue]; CGFloat y = [[string substringWithRange:[parse rangeAtIndex:3]] floatValue]; CGPoint value = CGPointMake(x, y); [parsedArray addObject:[NSValue valueWithCGPoint:value]]; } else if ([modifier isEqualToString:@"NSString"]) { // NSString modifier, one string argument stringValue = [[string substringWithRange:[parse rangeAtIndex:2]] copy]; [inv setArgument:&stringValue atIndex:2]; } else { return NO; } } [inv setArgument:&parsedArray atIndex:2]; } else { NSString *string = [filterAttributes objectForKey:propertyKey]; NSTextCheckingResult *parse = [parsingRegex firstMatchInString:string options:0 range:NSMakeRange(0, [string length])]; NSString *modifier = [string substringWithRange:[parse rangeAtIndex:1]]; if ([modifier isEqualToString:@"float"]) { // Float modifier, one argument CGFloat value = [[string substringWithRange:[parse rangeAtIndex:2]] floatValue]; [inv setArgument:&value atIndex:2]; } else if ([modifier isEqualToString:@"CGPoint"]) { // CGPoint modifier, two float arguments CGFloat x = [[string substringWithRange:[parse rangeAtIndex:2]] floatValue]; CGFloat y = [[string substringWithRange:[parse rangeAtIndex:3]] floatValue]; CGPoint value = CGPointMake(x, y); [inv setArgument:&value atIndex:2]; } else if ([modifier isEqualToString:@"NSString"]) { // NSString modifier, one string argument stringValue = [[string substringWithRange:[parse rangeAtIndex:2]] copy]; [inv setArgument:&stringValue atIndex:2]; } else { return NO; } } } [inv invoke]; } } [orderedFilters addObject:genericFilter]; } self.filters = orderedFilters; return YES; } #pragma mark Regular init - (id)initWithOrderedFilters:(NSArray *)filters input:(GPUImageOutput *)input output:(id )output { self = [super init]; if (self) { self.input = input; self.output = output; self.filters = [NSMutableArray arrayWithArray:filters]; [self _refreshFilters]; } return self; } - (void)addFilter:(GPUImageOutput *)filter atIndex:(NSUInteger)insertIndex { [self.filters insertObject:filter atIndex:insertIndex]; [self _refreshFilters]; } - (void)addFilter:(GPUImageOutput *)filter { [self.filters addObject:filter]; [self _refreshFilters]; } - (void)replaceFilterAtIndex:(NSUInteger)index withFilter:(GPUImageOutput *)filter { [self.filters replaceObjectAtIndex:index withObject:filter]; [self _refreshFilters]; } - (void) removeFilter:(GPUImageOutput *)filter; { [self.filters removeObject:filter]; [self _refreshFilters]; } - (void)removeFilterAtIndex:(NSUInteger)index { [self.filters removeObjectAtIndex:index]; [self _refreshFilters]; } - (void)removeAllFilters { [self.filters removeAllObjects]; [self _refreshFilters]; } - (void)replaceAllFilters:(NSArray *)newFilters { self.filters = [NSMutableArray arrayWithArray:newFilters]; [self _refreshFilters]; } - (void)_refreshFilters { id prevFilter = self.input; GPUImageOutput *theFilter = nil; for (int i = 0; i < [self.filters count]; i++) { theFilter = [self.filters objectAtIndex:i]; [prevFilter removeAllTargets]; [prevFilter addTarget:theFilter]; prevFilter = theFilter; } [prevFilter removeAllTargets]; if (self.output != nil) { [prevFilter addTarget:self.output]; } } - (UIImage *)currentFilteredFrame { return [(GPUImageOutput *)[_filters lastObject] imageFromCurrentFramebuffer]; } - (UIImage *)currentFilteredFrameWithOrientation:(UIImageOrientation)imageOrientation { return [(GPUImageOutput *)[_filters lastObject] imageFromCurrentFramebufferWithOrientation:imageOrientation]; } - (CGImageRef)newCGImageFromCurrentFilteredFrame { return [(GPUImageOutput *)[_filters lastObject] newCGImageFromCurrentlyProcessedOutput]; } @end ================================================ FILE: framework/Source/GPUImageFourInputFilter.h ================================================ #import "GPUImageThreeInputFilter.h" extern NSString *const kGPUImageFourInputTextureVertexShaderString; @interface GPUImageFourInputFilter : GPUImageThreeInputFilter { GPUImageFramebuffer *fourthInputFramebuffer; GLint filterFourthTextureCoordinateAttribute; GLint filterInputTextureUniform4; GPUImageRotationMode inputRotation4; GLuint filterSourceTexture4; CMTime fourthFrameTime; BOOL hasSetThirdTexture, hasReceivedFourthFrame, fourthFrameWasVideo; BOOL fourthFrameCheckDisabled; } - (void)disableFourthFrameCheck; @end ================================================ FILE: framework/Source/GPUImageFourInputFilter.m ================================================ #import "GPUImageFourInputFilter.h" NSString *const kGPUImageFourInputTextureVertexShaderString = SHADER_STRING ( attribute vec4 position; attribute vec4 inputTextureCoordinate; attribute vec4 inputTextureCoordinate2; attribute vec4 inputTextureCoordinate3; attribute vec4 inputTextureCoordinate4; varying vec2 textureCoordinate; varying vec2 textureCoordinate2; varying vec2 textureCoordinate3; varying vec2 textureCoordinate4; void main() { gl_Position = position; textureCoordinate = inputTextureCoordinate.xy; textureCoordinate2 = inputTextureCoordinate2.xy; textureCoordinate3 = inputTextureCoordinate3.xy; textureCoordinate4 = inputTextureCoordinate4.xy; } ); @implementation GPUImageFourInputFilter #pragma mark - #pragma mark Initialization and teardown - (id)initWithFragmentShaderFromString:(NSString *)fragmentShaderString; { if (!(self = [self initWithVertexShaderFromString:kGPUImageFourInputTextureVertexShaderString fragmentShaderFromString:fragmentShaderString])) { return nil; } return self; } - (id)initWithVertexShaderFromString:(NSString *)vertexShaderString fragmentShaderFromString:(NSString *)fragmentShaderString; { if (!(self = [super initWithVertexShaderFromString:vertexShaderString fragmentShaderFromString:fragmentShaderString])) { return nil; } inputRotation4 = kGPUImageNoRotation; hasSetThirdTexture = NO; hasReceivedFourthFrame = NO; fourthFrameWasVideo = NO; fourthFrameCheckDisabled = NO; fourthFrameTime = kCMTimeInvalid; runSynchronouslyOnVideoProcessingQueue(^{ [GPUImageContext useImageProcessingContext]; filterFourthTextureCoordinateAttribute = [filterProgram attributeIndex:@"inputTextureCoordinate4"]; filterInputTextureUniform4 = [filterProgram uniformIndex:@"inputImageTexture4"]; // This does assume a name of "inputImageTexture3" for the third input texture in the fragment shader glEnableVertexAttribArray(filterFourthTextureCoordinateAttribute); }); return self; } - (void)initializeAttributes; { [super initializeAttributes]; [filterProgram addAttribute:@"inputTextureCoordinate4"]; } - (void)disableFourthFrameCheck; { fourthFrameCheckDisabled = YES; } #pragma mark - #pragma mark Rendering - (void)renderToTextureWithVertices:(const GLfloat *)vertices textureCoordinates:(const GLfloat *)textureCoordinates; { if (self.preventRendering) { [firstInputFramebuffer unlock]; [secondInputFramebuffer unlock]; [thirdInputFramebuffer unlock]; [fourthInputFramebuffer unlock]; return; } [GPUImageContext setActiveShaderProgram:filterProgram]; outputFramebuffer = [[GPUImageContext sharedFramebufferCache] fetchFramebufferForSize:[self sizeOfFBO] textureOptions:self.outputTextureOptions onlyTexture:NO]; [outputFramebuffer activateFramebuffer]; if (usingNextFrameForImageCapture) { [outputFramebuffer lock]; } [self setUniformsForProgramAtIndex:0]; glClearColor(backgroundColorRed, backgroundColorGreen, backgroundColorBlue, backgroundColorAlpha); glClear(GL_COLOR_BUFFER_BIT); glActiveTexture(GL_TEXTURE2); glBindTexture(GL_TEXTURE_2D, [firstInputFramebuffer texture]); glUniform1i(filterInputTextureUniform, 2); glActiveTexture(GL_TEXTURE3); glBindTexture(GL_TEXTURE_2D, [secondInputFramebuffer texture]); glUniform1i(filterInputTextureUniform2, 3); glActiveTexture(GL_TEXTURE4); glBindTexture(GL_TEXTURE_2D, [thirdInputFramebuffer texture]); glUniform1i(filterInputTextureUniform3, 4); glActiveTexture(GL_TEXTURE5); glBindTexture(GL_TEXTURE_2D, [fourthInputFramebuffer texture]); glUniform1i(filterInputTextureUniform4, 5); glVertexAttribPointer(filterPositionAttribute, 2, GL_FLOAT, 0, 0, vertices); glVertexAttribPointer(filterTextureCoordinateAttribute, 2, GL_FLOAT, 0, 0, textureCoordinates); glVertexAttribPointer(filterSecondTextureCoordinateAttribute, 2, GL_FLOAT, 0, 0, [[self class] textureCoordinatesForRotation:inputRotation2]); glVertexAttribPointer(filterThirdTextureCoordinateAttribute, 2, GL_FLOAT, 0, 0, [[self class] textureCoordinatesForRotation:inputRotation3]); glVertexAttribPointer(filterFourthTextureCoordinateAttribute, 2, GL_FLOAT, 0, 0, [[self class] textureCoordinatesForRotation:inputRotation4]); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); [firstInputFramebuffer unlock]; [secondInputFramebuffer unlock]; [thirdInputFramebuffer unlock]; [fourthInputFramebuffer unlock]; if (usingNextFrameForImageCapture) { dispatch_semaphore_signal(imageCaptureSemaphore); } } #pragma mark - #pragma mark GPUImageInput - (NSInteger)nextAvailableTextureIndex; { if (hasSetThirdTexture) { return 3; } else if (hasSetSecondTexture) { return 2; } else if (hasSetFirstTexture) { return 1; } else { return 0; } } - (void)setInputFramebuffer:(GPUImageFramebuffer *)newInputFramebuffer atIndex:(NSInteger)textureIndex; { if (textureIndex == 0) { firstInputFramebuffer = newInputFramebuffer; hasSetFirstTexture = YES; [firstInputFramebuffer lock]; } else if (textureIndex == 1) { secondInputFramebuffer = newInputFramebuffer; hasSetSecondTexture = YES; [secondInputFramebuffer lock]; } else if (textureIndex == 2) { thirdInputFramebuffer = newInputFramebuffer; hasSetThirdTexture = YES; [thirdInputFramebuffer lock]; } else { fourthInputFramebuffer = newInputFramebuffer; [fourthInputFramebuffer lock]; } } - (void)setInputSize:(CGSize)newSize atIndex:(NSInteger)textureIndex; { if (textureIndex == 0) { [super setInputSize:newSize atIndex:textureIndex]; if (CGSizeEqualToSize(newSize, CGSizeZero)) { hasSetFirstTexture = NO; } } else if (textureIndex == 1) { if (CGSizeEqualToSize(newSize, CGSizeZero)) { hasSetSecondTexture = NO; } } else if (textureIndex == 2) { if (CGSizeEqualToSize(newSize, CGSizeZero)) { hasSetThirdTexture = NO; } } } - (void)setInputRotation:(GPUImageRotationMode)newInputRotation atIndex:(NSInteger)textureIndex; { if (textureIndex == 0) { inputRotation = newInputRotation; } else if (textureIndex == 1) { inputRotation2 = newInputRotation; } else if (textureIndex == 2) { inputRotation3 = newInputRotation; } else { inputRotation4 = newInputRotation; } } - (CGSize)rotatedSize:(CGSize)sizeToRotate forIndex:(NSInteger)textureIndex; { CGSize rotatedSize = sizeToRotate; GPUImageRotationMode rotationToCheck; if (textureIndex == 0) { rotationToCheck = inputRotation; } else if (textureIndex == 1) { rotationToCheck = inputRotation2; } else if (textureIndex == 2) { rotationToCheck = inputRotation3; } else { rotationToCheck = inputRotation4; } if (GPUImageRotationSwapsWidthAndHeight(rotationToCheck)) { rotatedSize.width = sizeToRotate.height; rotatedSize.height = sizeToRotate.width; } return rotatedSize; } - (void)newFrameReadyAtTime:(CMTime)frameTime atIndex:(NSInteger)textureIndex; { // You can set up infinite update loops, so this helps to short circuit them if (hasReceivedFirstFrame && hasReceivedSecondFrame && hasReceivedThirdFrame) { return; } BOOL updatedMovieFrameOppositeStillImage = NO; if (textureIndex == 0) { hasReceivedFirstFrame = YES; firstFrameTime = frameTime; if (secondFrameCheckDisabled) { hasReceivedSecondFrame = YES; } if (thirdFrameCheckDisabled) { hasReceivedThirdFrame = YES; } if (fourthFrameCheckDisabled) { hasReceivedThirdFrame = YES; } if (!CMTIME_IS_INDEFINITE(frameTime)) { if CMTIME_IS_INDEFINITE(secondFrameTime) { updatedMovieFrameOppositeStillImage = YES; } } } else if (textureIndex == 1) { hasReceivedSecondFrame = YES; secondFrameTime = frameTime; if (firstFrameCheckDisabled) { hasReceivedFirstFrame = YES; } if (thirdFrameCheckDisabled) { hasReceivedThirdFrame = YES; } if (fourthFrameCheckDisabled) { hasReceivedFourthFrame = YES; } if (!CMTIME_IS_INDEFINITE(frameTime)) { if CMTIME_IS_INDEFINITE(firstFrameTime) { updatedMovieFrameOppositeStillImage = YES; } } } else if (textureIndex == 2) { hasReceivedThirdFrame = YES; thirdFrameTime = frameTime; if (firstFrameCheckDisabled) { hasReceivedFirstFrame = YES; } if (secondFrameCheckDisabled) { hasReceivedSecondFrame = YES; } if (fourthFrameCheckDisabled) { hasReceivedFourthFrame = YES; } if (!CMTIME_IS_INDEFINITE(frameTime)) { if CMTIME_IS_INDEFINITE(firstFrameTime) { updatedMovieFrameOppositeStillImage = YES; } } } else { hasReceivedFourthFrame = YES; fourthFrameTime = frameTime; if (firstFrameCheckDisabled) { hasReceivedFirstFrame = YES; } if (secondFrameCheckDisabled) { hasReceivedSecondFrame = YES; } if (thirdFrameCheckDisabled) { hasReceivedThirdFrame = YES; } if (!CMTIME_IS_INDEFINITE(frameTime)) { if CMTIME_IS_INDEFINITE(firstFrameTime) { updatedMovieFrameOppositeStillImage = YES; } } } // || (hasReceivedFirstFrame && secondFrameCheckDisabled) || (hasReceivedSecondFrame && firstFrameCheckDisabled) if ((hasReceivedFirstFrame && hasReceivedSecondFrame && hasReceivedThirdFrame && hasReceivedFourthFrame) || updatedMovieFrameOppositeStillImage) { static const GLfloat imageVertices[] = { -1.0f, -1.0f, 1.0f, -1.0f, -1.0f, 1.0f, 1.0f, 1.0f, }; [self renderToTextureWithVertices:imageVertices textureCoordinates:[[self class] textureCoordinatesForRotation:inputRotation]]; [self informTargetsAboutNewFrameAtTime:frameTime]; hasReceivedFirstFrame = NO; hasReceivedSecondFrame = NO; hasReceivedThirdFrame = NO; hasReceivedFourthFrame = NO; } } @end ================================================ FILE: framework/Source/GPUImageFramebuffer.h ================================================ #import #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE #import #import #import #else #import #import #endif #import #import typedef struct GPUTextureOptions { GLenum minFilter; GLenum magFilter; GLenum wrapS; GLenum wrapT; GLenum internalFormat; GLenum format; GLenum type; } GPUTextureOptions; @interface GPUImageFramebuffer : NSObject @property(readonly) CGSize size; @property(readonly) GPUTextureOptions textureOptions; @property(readonly) GLuint texture; @property(readonly) BOOL missingFramebuffer; // Initialization and teardown - (id)initWithSize:(CGSize)framebufferSize; - (id)initWithSize:(CGSize)framebufferSize textureOptions:(GPUTextureOptions)fboTextureOptions onlyTexture:(BOOL)onlyGenerateTexture; - (id)initWithSize:(CGSize)framebufferSize overriddenTexture:(GLuint)inputTexture; // Usage - (void)activateFramebuffer; // Reference counting - (void)lock; - (void)unlock; - (void)clearAllLocks; - (void)disableReferenceCounting; - (void)enableReferenceCounting; // Image capture - (CGImageRef)newCGImageFromFramebufferContents; - (void)restoreRenderTarget; // Raw data bytes - (void)lockForReading; - (void)unlockAfterReading; - (NSUInteger)bytesPerRow; - (GLubyte *)byteBuffer; - (CVPixelBufferRef)pixelBuffer; @end ================================================ FILE: framework/Source/GPUImageFramebuffer.m ================================================ #import "GPUImageFramebuffer.h" #import "GPUImageOutput.h" @interface GPUImageFramebuffer() { GLuint framebuffer; #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE CVPixelBufferRef renderTarget; CVOpenGLESTextureRef renderTexture; NSUInteger readLockCount; #else #endif NSUInteger framebufferReferenceCount; BOOL referenceCountingDisabled; } - (void)generateFramebuffer; - (void)generateTexture; - (void)destroyFramebuffer; @end void dataProviderReleaseCallback (void *info, const void *data, size_t size); void dataProviderUnlockCallback (void *info, const void *data, size_t size); @implementation GPUImageFramebuffer @synthesize size = _size; @synthesize textureOptions = _textureOptions; @synthesize texture = _texture; @synthesize missingFramebuffer = _missingFramebuffer; #pragma mark - #pragma mark Initialization and teardown - (id)initWithSize:(CGSize)framebufferSize textureOptions:(GPUTextureOptions)fboTextureOptions onlyTexture:(BOOL)onlyGenerateTexture; { if (!(self = [super init])) { return nil; } _textureOptions = fboTextureOptions; _size = framebufferSize; framebufferReferenceCount = 0; referenceCountingDisabled = NO; _missingFramebuffer = onlyGenerateTexture; if (_missingFramebuffer) { runSynchronouslyOnVideoProcessingQueue(^{ [GPUImageContext useImageProcessingContext]; [self generateTexture]; framebuffer = 0; }); } else { [self generateFramebuffer]; } return self; } - (id)initWithSize:(CGSize)framebufferSize overriddenTexture:(GLuint)inputTexture; { if (!(self = [super init])) { return nil; } GPUTextureOptions defaultTextureOptions; defaultTextureOptions.minFilter = GL_LINEAR; defaultTextureOptions.magFilter = GL_LINEAR; defaultTextureOptions.wrapS = GL_CLAMP_TO_EDGE; defaultTextureOptions.wrapT = GL_CLAMP_TO_EDGE; defaultTextureOptions.internalFormat = GL_RGBA; defaultTextureOptions.format = GL_BGRA; defaultTextureOptions.type = GL_UNSIGNED_BYTE; _textureOptions = defaultTextureOptions; _size = framebufferSize; framebufferReferenceCount = 0; referenceCountingDisabled = YES; _texture = inputTexture; return self; } - (id)initWithSize:(CGSize)framebufferSize; { GPUTextureOptions defaultTextureOptions; defaultTextureOptions.minFilter = GL_LINEAR; defaultTextureOptions.magFilter = GL_LINEAR; defaultTextureOptions.wrapS = GL_CLAMP_TO_EDGE; defaultTextureOptions.wrapT = GL_CLAMP_TO_EDGE; defaultTextureOptions.internalFormat = GL_RGBA; defaultTextureOptions.format = GL_BGRA; defaultTextureOptions.type = GL_UNSIGNED_BYTE; if (!(self = [self initWithSize:framebufferSize textureOptions:defaultTextureOptions onlyTexture:NO])) { return nil; } return self; } - (void)dealloc { [self destroyFramebuffer]; } #pragma mark - #pragma mark Internal - (void)generateTexture; { glActiveTexture(GL_TEXTURE1); glGenTextures(1, &_texture); glBindTexture(GL_TEXTURE_2D, _texture); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, _textureOptions.minFilter); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, _textureOptions.magFilter); // This is necessary for non-power-of-two textures glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, _textureOptions.wrapS); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, _textureOptions.wrapT); // TODO: Handle mipmaps } - (void)generateFramebuffer; { runSynchronouslyOnVideoProcessingQueue(^{ [GPUImageContext useImageProcessingContext]; glGenFramebuffers(1, &framebuffer); glBindFramebuffer(GL_FRAMEBUFFER, framebuffer); // By default, all framebuffers on iOS 5.0+ devices are backed by texture caches, using one shared cache if ([GPUImageContext supportsFastTextureUpload]) { #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE CVOpenGLESTextureCacheRef coreVideoTextureCache = [[GPUImageContext sharedImageProcessingContext] coreVideoTextureCache]; // Code originally sourced from http://allmybrain.com/2011/12/08/rendering-to-a-texture-with-ios-5-texture-cache-api/ CFDictionaryRef empty; // empty value for attr value. CFMutableDictionaryRef attrs; empty = CFDictionaryCreate(kCFAllocatorDefault, NULL, NULL, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); // our empty IOSurface properties dictionary attrs = CFDictionaryCreateMutable(kCFAllocatorDefault, 1, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); CFDictionarySetValue(attrs, kCVPixelBufferIOSurfacePropertiesKey, empty); CVReturn err = CVPixelBufferCreate(kCFAllocatorDefault, (int)_size.width, (int)_size.height, kCVPixelFormatType_32BGRA, attrs, &renderTarget); if (err) { NSLog(@"FBO size: %f, %f", _size.width, _size.height); NSAssert(NO, @"Error at CVPixelBufferCreate %d", err); } err = CVOpenGLESTextureCacheCreateTextureFromImage (kCFAllocatorDefault, coreVideoTextureCache, renderTarget, NULL, // texture attributes GL_TEXTURE_2D, _textureOptions.internalFormat, // opengl format (int)_size.width, (int)_size.height, _textureOptions.format, // native iOS format _textureOptions.type, 0, &renderTexture); if (err) { NSAssert(NO, @"Error at CVOpenGLESTextureCacheCreateTextureFromImage %d", err); } CFRelease(attrs); CFRelease(empty); glBindTexture(CVOpenGLESTextureGetTarget(renderTexture), CVOpenGLESTextureGetName(renderTexture)); _texture = CVOpenGLESTextureGetName(renderTexture); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, _textureOptions.wrapS); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, _textureOptions.wrapT); glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, CVOpenGLESTextureGetName(renderTexture), 0); #endif } else { [self generateTexture]; glBindTexture(GL_TEXTURE_2D, _texture); glTexImage2D(GL_TEXTURE_2D, 0, _textureOptions.internalFormat, (int)_size.width, (int)_size.height, 0, _textureOptions.format, _textureOptions.type, 0); glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, _texture, 0); } #ifndef NS_BLOCK_ASSERTIONS GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); NSAssert(status == GL_FRAMEBUFFER_COMPLETE, @"Incomplete filter FBO: %d", status); #endif glBindTexture(GL_TEXTURE_2D, 0); }); } - (void)destroyFramebuffer; { runSynchronouslyOnVideoProcessingQueue(^{ [GPUImageContext useImageProcessingContext]; if (framebuffer) { glDeleteFramebuffers(1, &framebuffer); framebuffer = 0; } if ([GPUImageContext supportsFastTextureUpload] && (!_missingFramebuffer)) { #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE if (renderTarget) { CFRelease(renderTarget); renderTarget = NULL; } if (renderTexture) { CFRelease(renderTexture); renderTexture = NULL; } #endif } else { glDeleteTextures(1, &_texture); } }); } #pragma mark - #pragma mark Usage - (void)activateFramebuffer; { glBindFramebuffer(GL_FRAMEBUFFER, framebuffer); glViewport(0, 0, (int)_size.width, (int)_size.height); } #pragma mark - #pragma mark Reference counting - (void)lock; { if (referenceCountingDisabled) { return; } framebufferReferenceCount++; } - (void)unlock; { if (referenceCountingDisabled) { return; } NSAssert(framebufferReferenceCount > 0, @"Tried to overrelease a framebuffer, did you forget to call -useNextFrameForImageCapture before using -imageFromCurrentFramebuffer?"); framebufferReferenceCount--; if (framebufferReferenceCount < 1) { [[GPUImageContext sharedFramebufferCache] returnFramebufferToCache:self]; } } - (void)clearAllLocks; { framebufferReferenceCount = 0; } - (void)disableReferenceCounting; { referenceCountingDisabled = YES; } - (void)enableReferenceCounting; { referenceCountingDisabled = NO; } #pragma mark - #pragma mark Image capture void dataProviderReleaseCallback (void *info, const void *data, size_t size) { free((void *)data); } void dataProviderUnlockCallback (void *info, const void *data, size_t size) { GPUImageFramebuffer *framebuffer = (__bridge_transfer GPUImageFramebuffer*)info; [framebuffer restoreRenderTarget]; [framebuffer unlock]; [[GPUImageContext sharedFramebufferCache] removeFramebufferFromActiveImageCaptureList:framebuffer]; } - (CGImageRef)newCGImageFromFramebufferContents; { // a CGImage can only be created from a 'normal' color texture NSAssert(self.textureOptions.internalFormat == GL_RGBA, @"For conversion to a CGImage the output texture format for this filter must be GL_RGBA."); NSAssert(self.textureOptions.type == GL_UNSIGNED_BYTE, @"For conversion to a CGImage the type of the output texture of this filter must be GL_UNSIGNED_BYTE."); __block CGImageRef cgImageFromBytes; runSynchronouslyOnVideoProcessingQueue(^{ [GPUImageContext useImageProcessingContext]; NSUInteger totalBytesForImage = (int)_size.width * (int)_size.height * 4; // It appears that the width of a texture must be padded out to be a multiple of 8 (32 bytes) if reading from it using a texture cache GLubyte *rawImagePixels; CGDataProviderRef dataProvider = NULL; if ([GPUImageContext supportsFastTextureUpload]) { #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSUInteger paddedWidthOfImage = CVPixelBufferGetBytesPerRow(renderTarget) / 4.0; NSUInteger paddedBytesForImage = paddedWidthOfImage * (int)_size.height * 4; glFinish(); CFRetain(renderTarget); // I need to retain the pixel buffer here and release in the data source callback to prevent its bytes from being prematurely deallocated during a photo write operation [self lockForReading]; rawImagePixels = (GLubyte *)CVPixelBufferGetBaseAddress(renderTarget); dataProvider = CGDataProviderCreateWithData((__bridge_retained void*)self, rawImagePixels, paddedBytesForImage, dataProviderUnlockCallback); [[GPUImageContext sharedFramebufferCache] addFramebufferToActiveImageCaptureList:self]; // In case the framebuffer is swapped out on the filter, need to have a strong reference to it somewhere for it to hang on while the image is in existence #else #endif } else { [self activateFramebuffer]; rawImagePixels = (GLubyte *)malloc(totalBytesForImage); glReadPixels(0, 0, (int)_size.width, (int)_size.height, GL_RGBA, GL_UNSIGNED_BYTE, rawImagePixels); dataProvider = CGDataProviderCreateWithData(NULL, rawImagePixels, totalBytesForImage, dataProviderReleaseCallback); [self unlock]; // Don't need to keep this around anymore } CGColorSpaceRef defaultRGBColorSpace = CGColorSpaceCreateDeviceRGB(); if ([GPUImageContext supportsFastTextureUpload]) { #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE cgImageFromBytes = CGImageCreate((int)_size.width, (int)_size.height, 8, 32, CVPixelBufferGetBytesPerRow(renderTarget), defaultRGBColorSpace, kCGBitmapByteOrder32Little | kCGImageAlphaPremultipliedFirst, dataProvider, NULL, NO, kCGRenderingIntentDefault); #else #endif } else { cgImageFromBytes = CGImageCreate((int)_size.width, (int)_size.height, 8, 32, 4 * (int)_size.width, defaultRGBColorSpace, kCGBitmapByteOrderDefault | kCGImageAlphaLast, dataProvider, NULL, NO, kCGRenderingIntentDefault); } // Capture image with current device orientation CGDataProviderRelease(dataProvider); CGColorSpaceRelease(defaultRGBColorSpace); }); return cgImageFromBytes; } - (void)restoreRenderTarget; { #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE [self unlockAfterReading]; CFRelease(renderTarget); #else #endif } #pragma mark - #pragma mark Raw data bytes - (void)lockForReading { #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE if ([GPUImageContext supportsFastTextureUpload]) { if (readLockCount == 0) { CVPixelBufferLockBaseAddress(renderTarget, 0); } readLockCount++; } #endif } - (void)unlockAfterReading { #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE if ([GPUImageContext supportsFastTextureUpload]) { NSAssert(readLockCount > 0, @"Unbalanced call to -[GPUImageFramebuffer unlockAfterReading]"); readLockCount--; if (readLockCount == 0) { CVPixelBufferUnlockBaseAddress(renderTarget, 0); } } #endif } - (NSUInteger)bytesPerRow; { if ([GPUImageContext supportsFastTextureUpload]) { #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE return CVPixelBufferGetBytesPerRow(renderTarget); #else return _size.width * 4; // TODO: do more with this on the non-texture-cache side #endif } else { return _size.width * 4; } } - (GLubyte *)byteBuffer; { #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE [self lockForReading]; GLubyte * bufferBytes = CVPixelBufferGetBaseAddress(renderTarget); [self unlockAfterReading]; return bufferBytes; #else return NULL; // TODO: do more with this on the non-texture-cache side #endif } - (CVPixelBufferRef )pixelBuffer; { #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE return renderTarget; #else return NULL; // TODO: do more with this on the non-texture-cache side #endif } - (GLuint)texture; { // NSLog(@"Accessing texture: %d from FB: %@", _texture, self); return _texture; } @end ================================================ FILE: framework/Source/GPUImageFramebufferCache.h ================================================ #import #import #import "GPUImageFramebuffer.h" @interface GPUImageFramebufferCache : NSObject // Framebuffer management - (GPUImageFramebuffer *)fetchFramebufferForSize:(CGSize)framebufferSize textureOptions:(GPUTextureOptions)textureOptions onlyTexture:(BOOL)onlyTexture; - (GPUImageFramebuffer *)fetchFramebufferForSize:(CGSize)framebufferSize onlyTexture:(BOOL)onlyTexture; - (void)returnFramebufferToCache:(GPUImageFramebuffer *)framebuffer; - (void)purgeAllUnassignedFramebuffers; - (void)addFramebufferToActiveImageCaptureList:(GPUImageFramebuffer *)framebuffer; - (void)removeFramebufferFromActiveImageCaptureList:(GPUImageFramebuffer *)framebuffer; @end ================================================ FILE: framework/Source/GPUImageFramebufferCache.m ================================================ #import "GPUImageFramebufferCache.h" #import "GPUImageContext.h" #import "GPUImageOutput.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE #import #else #endif @interface GPUImageFramebufferCache() { // NSCache *framebufferCache; NSMutableDictionary *framebufferCache; NSMutableDictionary *framebufferTypeCounts; NSMutableArray *activeImageCaptureList; // Where framebuffers that may be lost by a filter, but which are still needed for a UIImage, etc., are stored id memoryWarningObserver; dispatch_queue_t framebufferCacheQueue; } - (NSString *)hashForSize:(CGSize)size textureOptions:(GPUTextureOptions)textureOptions onlyTexture:(BOOL)onlyTexture; @end @implementation GPUImageFramebufferCache #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super init])) { return nil; } #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE __unsafe_unretained __typeof__ (self) weakSelf = self; memoryWarningObserver = [[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationDidReceiveMemoryWarningNotification object:nil queue:nil usingBlock:^(NSNotification *note) { __typeof__ (self) strongSelf = weakSelf; if (strongSelf) { [strongSelf purgeAllUnassignedFramebuffers]; } }]; #else #endif // framebufferCache = [[NSCache alloc] init]; framebufferCache = [[NSMutableDictionary alloc] init]; framebufferTypeCounts = [[NSMutableDictionary alloc] init]; activeImageCaptureList = [[NSMutableArray alloc] init]; framebufferCacheQueue = dispatch_queue_create("com.sunsetlakesoftware.GPUImage.framebufferCacheQueue", GPUImageDefaultQueueAttribute()); return self; } - (void)dealloc; { #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE [[NSNotificationCenter defaultCenter] removeObserver:self]; #else #endif } #pragma mark - #pragma mark Framebuffer management - (NSString *)hashForSize:(CGSize)size textureOptions:(GPUTextureOptions)textureOptions onlyTexture:(BOOL)onlyTexture; { if (onlyTexture) { return [NSString stringWithFormat:@"%.1fx%.1f-%d:%d:%d:%d:%d:%d:%d-NOFB", size.width, size.height, textureOptions.minFilter, textureOptions.magFilter, textureOptions.wrapS, textureOptions.wrapT, textureOptions.internalFormat, textureOptions.format, textureOptions.type]; } else { return [NSString stringWithFormat:@"%.1fx%.1f-%d:%d:%d:%d:%d:%d:%d", size.width, size.height, textureOptions.minFilter, textureOptions.magFilter, textureOptions.wrapS, textureOptions.wrapT, textureOptions.internalFormat, textureOptions.format, textureOptions.type]; } } - (GPUImageFramebuffer *)fetchFramebufferForSize:(CGSize)framebufferSize textureOptions:(GPUTextureOptions)textureOptions onlyTexture:(BOOL)onlyTexture; { __block GPUImageFramebuffer *framebufferFromCache = nil; // dispatch_sync(framebufferCacheQueue, ^{ runSynchronouslyOnVideoProcessingQueue(^{ NSString *lookupHash = [self hashForSize:framebufferSize textureOptions:textureOptions onlyTexture:onlyTexture]; NSNumber *numberOfMatchingTexturesInCache = [framebufferTypeCounts objectForKey:lookupHash]; NSInteger numberOfMatchingTextures = [numberOfMatchingTexturesInCache integerValue]; if ([numberOfMatchingTexturesInCache integerValue] < 1) { // Nothing in the cache, create a new framebuffer to use framebufferFromCache = [[GPUImageFramebuffer alloc] initWithSize:framebufferSize textureOptions:textureOptions onlyTexture:onlyTexture]; } else { // Something found, pull the old framebuffer and decrement the count NSInteger currentTextureID = (numberOfMatchingTextures - 1); while ((framebufferFromCache == nil) && (currentTextureID >= 0)) { NSString *textureHash = [NSString stringWithFormat:@"%@-%ld", lookupHash, (long)currentTextureID]; framebufferFromCache = [framebufferCache objectForKey:textureHash]; // Test the values in the cache first, to see if they got invalidated behind our back if (framebufferFromCache != nil) { // Withdraw this from the cache while it's in use [framebufferCache removeObjectForKey:textureHash]; } currentTextureID--; } currentTextureID++; [framebufferTypeCounts setObject:[NSNumber numberWithInteger:currentTextureID] forKey:lookupHash]; if (framebufferFromCache == nil) { framebufferFromCache = [[GPUImageFramebuffer alloc] initWithSize:framebufferSize textureOptions:textureOptions onlyTexture:onlyTexture]; } } }); [framebufferFromCache lock]; return framebufferFromCache; } - (GPUImageFramebuffer *)fetchFramebufferForSize:(CGSize)framebufferSize onlyTexture:(BOOL)onlyTexture; { GPUTextureOptions defaultTextureOptions; defaultTextureOptions.minFilter = GL_LINEAR; defaultTextureOptions.magFilter = GL_LINEAR; defaultTextureOptions.wrapS = GL_CLAMP_TO_EDGE; defaultTextureOptions.wrapT = GL_CLAMP_TO_EDGE; defaultTextureOptions.internalFormat = GL_RGBA; defaultTextureOptions.format = GL_BGRA; defaultTextureOptions.type = GL_UNSIGNED_BYTE; return [self fetchFramebufferForSize:framebufferSize textureOptions:defaultTextureOptions onlyTexture:onlyTexture]; } - (void)returnFramebufferToCache:(GPUImageFramebuffer *)framebuffer; { [framebuffer clearAllLocks]; // dispatch_async(framebufferCacheQueue, ^{ runAsynchronouslyOnVideoProcessingQueue(^{ CGSize framebufferSize = framebuffer.size; GPUTextureOptions framebufferTextureOptions = framebuffer.textureOptions; NSString *lookupHash = [self hashForSize:framebufferSize textureOptions:framebufferTextureOptions onlyTexture:framebuffer.missingFramebuffer]; NSNumber *numberOfMatchingTexturesInCache = [framebufferTypeCounts objectForKey:lookupHash]; NSInteger numberOfMatchingTextures = [numberOfMatchingTexturesInCache integerValue]; NSString *textureHash = [NSString stringWithFormat:@"%@-%ld", lookupHash, (long)numberOfMatchingTextures]; // [framebufferCache setObject:framebuffer forKey:textureHash cost:round(framebufferSize.width * framebufferSize.height * 4.0)]; [framebufferCache setObject:framebuffer forKey:textureHash]; [framebufferTypeCounts setObject:[NSNumber numberWithInteger:(numberOfMatchingTextures + 1)] forKey:lookupHash]; }); } - (void)purgeAllUnassignedFramebuffers; { runAsynchronouslyOnVideoProcessingQueue(^{ // dispatch_async(framebufferCacheQueue, ^{ [framebufferCache removeAllObjects]; [framebufferTypeCounts removeAllObjects]; #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE CVOpenGLESTextureCacheFlush([[GPUImageContext sharedImageProcessingContext] coreVideoTextureCache], 0); #else #endif }); } - (void)addFramebufferToActiveImageCaptureList:(GPUImageFramebuffer *)framebuffer; { runAsynchronouslyOnVideoProcessingQueue(^{ // dispatch_async(framebufferCacheQueue, ^{ [activeImageCaptureList addObject:framebuffer]; }); } - (void)removeFramebufferFromActiveImageCaptureList:(GPUImageFramebuffer *)framebuffer; { runAsynchronouslyOnVideoProcessingQueue(^{ // dispatch_async(framebufferCacheQueue, ^{ [activeImageCaptureList removeObject:framebuffer]; }); } @end ================================================ FILE: framework/Source/GPUImageGammaFilter.h ================================================ #import "GPUImageFilter.h" @interface GPUImageGammaFilter : GPUImageFilter { GLint gammaUniform; } // Gamma ranges from 0.0 to 3.0, with 1.0 as the normal level @property(readwrite, nonatomic) CGFloat gamma; @end ================================================ FILE: framework/Source/GPUImageGammaFilter.m ================================================ #import "GPUImageGammaFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageGammaFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform lowp float gamma; void main() { lowp vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); gl_FragColor = vec4(pow(textureColor.rgb, vec3(gamma)), textureColor.w); } ); #else NSString *const kGPUImageGammaFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform float gamma; void main() { vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); gl_FragColor = vec4(pow(textureColor.rgb, vec3(gamma)), textureColor.w); } ); #endif @implementation GPUImageGammaFilter @synthesize gamma = _gamma; #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageGammaFragmentShaderString])) { return nil; } gammaUniform = [filterProgram uniformIndex:@"gamma"]; self.gamma = 1.0; return self; } #pragma mark - #pragma mark Accessors - (void)setGamma:(CGFloat)newValue; { _gamma = newValue; [self setFloat:_gamma forUniform:gammaUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImageGaussianBlurFilter.h ================================================ #import "GPUImageTwoPassTextureSamplingFilter.h" /** A Gaussian blur filter Interpolated optimization based on Daniel Rákos' work at http://rastergrid.com/blog/2010/09/efficient-gaussian-blur-with-linear-sampling/ */ @interface GPUImageGaussianBlurFilter : GPUImageTwoPassTextureSamplingFilter { BOOL shouldResizeBlurRadiusWithImageSize; CGFloat _blurRadiusInPixels; } /** A multiplier for the spacing between texels, ranging from 0.0 on up, with a default of 1.0. Adjusting this may slightly increase the blur strength, but will introduce artifacts in the result. */ @property (readwrite, nonatomic) CGFloat texelSpacingMultiplier; /** A radius in pixels to use for the blur, with a default of 2.0. This adjusts the sigma variable in the Gaussian distribution function. */ @property (readwrite, nonatomic) CGFloat blurRadiusInPixels; /** Setting these properties will allow the blur radius to scale with the size of the image. These properties are mutually exclusive; setting either will set the other to 0. */ @property (readwrite, nonatomic) CGFloat blurRadiusAsFractionOfImageWidth; @property (readwrite, nonatomic) CGFloat blurRadiusAsFractionOfImageHeight; /// The number of times to sequentially blur the incoming image. The more passes, the slower the filter. @property(readwrite, nonatomic) NSUInteger blurPasses; + (NSString *)vertexShaderForStandardBlurOfRadius:(NSUInteger)blurRadius sigma:(CGFloat)sigma; + (NSString *)fragmentShaderForStandardBlurOfRadius:(NSUInteger)blurRadius sigma:(CGFloat)sigma; + (NSString *)vertexShaderForOptimizedBlurOfRadius:(NSUInteger)blurRadius sigma:(CGFloat)sigma; + (NSString *)fragmentShaderForOptimizedBlurOfRadius:(NSUInteger)blurRadius sigma:(CGFloat)sigma; - (void)switchToVertexShader:(NSString *)newVertexShader fragmentShader:(NSString *)newFragmentShader; @end ================================================ FILE: framework/Source/GPUImageGaussianBlurFilter.m ================================================ #import "GPUImageGaussianBlurFilter.h" @implementation GPUImageGaussianBlurFilter @synthesize texelSpacingMultiplier = _texelSpacingMultiplier; @synthesize blurRadiusInPixels = _blurRadiusInPixels; @synthesize blurRadiusAsFractionOfImageWidth = _blurRadiusAsFractionOfImageWidth; @synthesize blurRadiusAsFractionOfImageHeight = _blurRadiusAsFractionOfImageHeight; @synthesize blurPasses = _blurPasses; #pragma mark - #pragma mark Initialization and teardown - (id)initWithFirstStageVertexShaderFromString:(NSString *)firstStageVertexShaderString firstStageFragmentShaderFromString:(NSString *)firstStageFragmentShaderString secondStageVertexShaderFromString:(NSString *)secondStageVertexShaderString secondStageFragmentShaderFromString:(NSString *)secondStageFragmentShaderString { if (!(self = [super initWithFirstStageVertexShaderFromString:firstStageVertexShaderString firstStageFragmentShaderFromString:firstStageFragmentShaderString secondStageVertexShaderFromString:secondStageVertexShaderString secondStageFragmentShaderFromString:secondStageFragmentShaderString])) { return nil; } self.texelSpacingMultiplier = 1.0; _blurRadiusInPixels = 2.0; shouldResizeBlurRadiusWithImageSize = NO; return self; } - (id)init; { NSString *currentGaussianBlurVertexShader = [[self class] vertexShaderForOptimizedBlurOfRadius:4 sigma:2.0]; NSString *currentGaussianBlurFragmentShader = [[self class] fragmentShaderForOptimizedBlurOfRadius:4 sigma:2.0]; return [self initWithFirstStageVertexShaderFromString:currentGaussianBlurVertexShader firstStageFragmentShaderFromString:currentGaussianBlurFragmentShader secondStageVertexShaderFromString:currentGaussianBlurVertexShader secondStageFragmentShaderFromString:currentGaussianBlurFragmentShader]; } #pragma mark - #pragma mark Auto-generation of optimized Gaussian shaders // "Implementation limit of 32 varying components exceeded" - Max number of varyings for these GPUs + (NSString *)vertexShaderForStandardBlurOfRadius:(NSUInteger)blurRadius sigma:(CGFloat)sigma; { if (blurRadius < 1) { return kGPUImageVertexShaderString; } // NSLog(@"Max varyings: %d", [GPUImageContext maximumVaryingVectorsForThisDevice]); NSMutableString *shaderString = [[NSMutableString alloc] init]; // Header [shaderString appendFormat:@"\ attribute vec4 position;\n\ attribute vec4 inputTextureCoordinate;\n\ \n\ uniform float texelWidthOffset;\n\ uniform float texelHeightOffset;\n\ \n\ varying vec2 blurCoordinates[%lu];\n\ \n\ void main()\n\ {\n\ gl_Position = position;\n\ \n\ vec2 singleStepOffset = vec2(texelWidthOffset, texelHeightOffset);\n", (unsigned long)(blurRadius * 2 + 1) ]; // Inner offset loop for (NSUInteger currentBlurCoordinateIndex = 0; currentBlurCoordinateIndex < (blurRadius * 2 + 1); currentBlurCoordinateIndex++) { NSInteger offsetFromCenter = currentBlurCoordinateIndex - blurRadius; if (offsetFromCenter < 0) { [shaderString appendFormat:@"blurCoordinates[%ld] = inputTextureCoordinate.xy - singleStepOffset * %f;\n", (unsigned long)currentBlurCoordinateIndex, (GLfloat)(-offsetFromCenter)]; } else if (offsetFromCenter > 0) { [shaderString appendFormat:@"blurCoordinates[%ld] = inputTextureCoordinate.xy + singleStepOffset * %f;\n", (unsigned long)currentBlurCoordinateIndex, (GLfloat)(offsetFromCenter)]; } else { [shaderString appendFormat:@"blurCoordinates[%ld] = inputTextureCoordinate.xy;\n", (unsigned long)currentBlurCoordinateIndex]; } } // Footer [shaderString appendString:@"}\n"]; return shaderString; } + (NSString *)fragmentShaderForStandardBlurOfRadius:(NSUInteger)blurRadius sigma:(CGFloat)sigma; { if (blurRadius < 1) { return kGPUImagePassthroughFragmentShaderString; } // First, generate the normal Gaussian weights for a given sigma GLfloat *standardGaussianWeights = calloc(blurRadius + 1, sizeof(GLfloat)); GLfloat sumOfWeights = 0.0; for (NSUInteger currentGaussianWeightIndex = 0; currentGaussianWeightIndex < blurRadius + 1; currentGaussianWeightIndex++) { standardGaussianWeights[currentGaussianWeightIndex] = (1.0 / sqrt(2.0 * M_PI * pow(sigma, 2.0))) * exp(-pow(currentGaussianWeightIndex, 2.0) / (2.0 * pow(sigma, 2.0))); if (currentGaussianWeightIndex == 0) { sumOfWeights += standardGaussianWeights[currentGaussianWeightIndex]; } else { sumOfWeights += 2.0 * standardGaussianWeights[currentGaussianWeightIndex]; } } // Next, normalize these weights to prevent the clipping of the Gaussian curve at the end of the discrete samples from reducing luminance for (NSUInteger currentGaussianWeightIndex = 0; currentGaussianWeightIndex < blurRadius + 1; currentGaussianWeightIndex++) { standardGaussianWeights[currentGaussianWeightIndex] = standardGaussianWeights[currentGaussianWeightIndex] / sumOfWeights; } // Finally, generate the shader from these weights NSMutableString *shaderString = [[NSMutableString alloc] init]; // Header #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE [shaderString appendFormat:@"\ uniform sampler2D inputImageTexture;\n\ \n\ varying highp vec2 blurCoordinates[%lu];\n\ \n\ void main()\n\ {\n\ lowp vec4 sum = vec4(0.0);\n", (unsigned long)(blurRadius * 2 + 1) ]; #else [shaderString appendFormat:@"\ uniform sampler2D inputImageTexture;\n\ \n\ varying vec2 blurCoordinates[%lu];\n\ \n\ void main()\n\ {\n\ vec4 sum = vec4(0.0);\n", (blurRadius * 2 + 1) ]; #endif // Inner texture loop for (NSUInteger currentBlurCoordinateIndex = 0; currentBlurCoordinateIndex < (blurRadius * 2 + 1); currentBlurCoordinateIndex++) { NSInteger offsetFromCenter = currentBlurCoordinateIndex - blurRadius; if (offsetFromCenter < 0) { [shaderString appendFormat:@"sum += texture2D(inputImageTexture, blurCoordinates[%lu]) * %f;\n", (unsigned long)currentBlurCoordinateIndex, standardGaussianWeights[-offsetFromCenter]]; } else { [shaderString appendFormat:@"sum += texture2D(inputImageTexture, blurCoordinates[%lu]) * %f;\n", (unsigned long)currentBlurCoordinateIndex, standardGaussianWeights[offsetFromCenter]]; } } // Footer [shaderString appendString:@"\ gl_FragColor = sum;\n\ }\n"]; free(standardGaussianWeights); return shaderString; } + (NSString *)vertexShaderForOptimizedBlurOfRadius:(NSUInteger)blurRadius sigma:(CGFloat)sigma; { if (blurRadius < 1) { return kGPUImageVertexShaderString; } // First, generate the normal Gaussian weights for a given sigma GLfloat *standardGaussianWeights = calloc(blurRadius + 1, sizeof(GLfloat)); GLfloat sumOfWeights = 0.0; for (NSUInteger currentGaussianWeightIndex = 0; currentGaussianWeightIndex < blurRadius + 1; currentGaussianWeightIndex++) { standardGaussianWeights[currentGaussianWeightIndex] = (1.0 / sqrt(2.0 * M_PI * pow(sigma, 2.0))) * exp(-pow(currentGaussianWeightIndex, 2.0) / (2.0 * pow(sigma, 2.0))); if (currentGaussianWeightIndex == 0) { sumOfWeights += standardGaussianWeights[currentGaussianWeightIndex]; } else { sumOfWeights += 2.0 * standardGaussianWeights[currentGaussianWeightIndex]; } } // Next, normalize these weights to prevent the clipping of the Gaussian curve at the end of the discrete samples from reducing luminance for (NSUInteger currentGaussianWeightIndex = 0; currentGaussianWeightIndex < blurRadius + 1; currentGaussianWeightIndex++) { standardGaussianWeights[currentGaussianWeightIndex] = standardGaussianWeights[currentGaussianWeightIndex] / sumOfWeights; } // From these weights we calculate the offsets to read interpolated values from NSUInteger numberOfOptimizedOffsets = MIN(blurRadius / 2 + (blurRadius % 2), 7); GLfloat *optimizedGaussianOffsets = calloc(numberOfOptimizedOffsets, sizeof(GLfloat)); for (NSUInteger currentOptimizedOffset = 0; currentOptimizedOffset < numberOfOptimizedOffsets; currentOptimizedOffset++) { GLfloat firstWeight = standardGaussianWeights[currentOptimizedOffset*2 + 1]; GLfloat secondWeight = standardGaussianWeights[currentOptimizedOffset*2 + 2]; GLfloat optimizedWeight = firstWeight + secondWeight; optimizedGaussianOffsets[currentOptimizedOffset] = (firstWeight * (currentOptimizedOffset*2 + 1) + secondWeight * (currentOptimizedOffset*2 + 2)) / optimizedWeight; } NSMutableString *shaderString = [[NSMutableString alloc] init]; // Header [shaderString appendFormat:@"\ attribute vec4 position;\n\ attribute vec4 inputTextureCoordinate;\n\ \n\ uniform float texelWidthOffset;\n\ uniform float texelHeightOffset;\n\ \n\ varying vec2 blurCoordinates[%lu];\n\ \n\ void main()\n\ {\n\ gl_Position = position;\n\ \n\ vec2 singleStepOffset = vec2(texelWidthOffset, texelHeightOffset);\n", (unsigned long)(1 + (numberOfOptimizedOffsets * 2))]; // Inner offset loop [shaderString appendString:@"blurCoordinates[0] = inputTextureCoordinate.xy;\n"]; for (NSUInteger currentOptimizedOffset = 0; currentOptimizedOffset < numberOfOptimizedOffsets; currentOptimizedOffset++) { [shaderString appendFormat:@"\ blurCoordinates[%lu] = inputTextureCoordinate.xy + singleStepOffset * %f;\n\ blurCoordinates[%lu] = inputTextureCoordinate.xy - singleStepOffset * %f;\n", (unsigned long)((currentOptimizedOffset * 2) + 1), optimizedGaussianOffsets[currentOptimizedOffset], (unsigned long)((currentOptimizedOffset * 2) + 2), optimizedGaussianOffsets[currentOptimizedOffset]]; } // Footer [shaderString appendString:@"}\n"]; free(optimizedGaussianOffsets); free(standardGaussianWeights); return shaderString; } + (NSString *)fragmentShaderForOptimizedBlurOfRadius:(NSUInteger)blurRadius sigma:(CGFloat)sigma; { if (blurRadius < 1) { return kGPUImagePassthroughFragmentShaderString; } // First, generate the normal Gaussian weights for a given sigma GLfloat *standardGaussianWeights = calloc(blurRadius + 1, sizeof(GLfloat)); GLfloat sumOfWeights = 0.0; for (NSUInteger currentGaussianWeightIndex = 0; currentGaussianWeightIndex < blurRadius + 1; currentGaussianWeightIndex++) { standardGaussianWeights[currentGaussianWeightIndex] = (1.0 / sqrt(2.0 * M_PI * pow(sigma, 2.0))) * exp(-pow(currentGaussianWeightIndex, 2.0) / (2.0 * pow(sigma, 2.0))); if (currentGaussianWeightIndex == 0) { sumOfWeights += standardGaussianWeights[currentGaussianWeightIndex]; } else { sumOfWeights += 2.0 * standardGaussianWeights[currentGaussianWeightIndex]; } } // Next, normalize these weights to prevent the clipping of the Gaussian curve at the end of the discrete samples from reducing luminance for (NSUInteger currentGaussianWeightIndex = 0; currentGaussianWeightIndex < blurRadius + 1; currentGaussianWeightIndex++) { standardGaussianWeights[currentGaussianWeightIndex] = standardGaussianWeights[currentGaussianWeightIndex] / sumOfWeights; } // From these weights we calculate the offsets to read interpolated values from NSUInteger numberOfOptimizedOffsets = MIN(blurRadius / 2 + (blurRadius % 2), 7); NSUInteger trueNumberOfOptimizedOffsets = blurRadius / 2 + (blurRadius % 2); NSMutableString *shaderString = [[NSMutableString alloc] init]; // Header #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE [shaderString appendFormat:@"\ uniform sampler2D inputImageTexture;\n\ uniform highp float texelWidthOffset;\n\ uniform highp float texelHeightOffset;\n\ \n\ varying highp vec2 blurCoordinates[%lu];\n\ \n\ void main()\n\ {\n\ lowp vec4 sum = vec4(0.0);\n", (unsigned long)(1 + (numberOfOptimizedOffsets * 2)) ]; #else [shaderString appendFormat:@"\ uniform sampler2D inputImageTexture;\n\ uniform float texelWidthOffset;\n\ uniform float texelHeightOffset;\n\ \n\ varying vec2 blurCoordinates[%lu];\n\ \n\ void main()\n\ {\n\ vec4 sum = vec4(0.0);\n", 1 + (numberOfOptimizedOffsets * 2) ]; #endif // Inner texture loop [shaderString appendFormat:@"sum += texture2D(inputImageTexture, blurCoordinates[0]) * %f;\n", standardGaussianWeights[0]]; for (NSUInteger currentBlurCoordinateIndex = 0; currentBlurCoordinateIndex < numberOfOptimizedOffsets; currentBlurCoordinateIndex++) { GLfloat firstWeight = standardGaussianWeights[currentBlurCoordinateIndex * 2 + 1]; GLfloat secondWeight = standardGaussianWeights[currentBlurCoordinateIndex * 2 + 2]; GLfloat optimizedWeight = firstWeight + secondWeight; [shaderString appendFormat:@"sum += texture2D(inputImageTexture, blurCoordinates[%lu]) * %f;\n", (unsigned long)((currentBlurCoordinateIndex * 2) + 1), optimizedWeight]; [shaderString appendFormat:@"sum += texture2D(inputImageTexture, blurCoordinates[%lu]) * %f;\n", (unsigned long)((currentBlurCoordinateIndex * 2) + 2), optimizedWeight]; } // If the number of required samples exceeds the amount we can pass in via varyings, we have to do dependent texture reads in the fragment shader if (trueNumberOfOptimizedOffsets > numberOfOptimizedOffsets) { #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE [shaderString appendString:@"highp vec2 singleStepOffset = vec2(texelWidthOffset, texelHeightOffset);\n"]; #else [shaderString appendString:@"vec2 singleStepOffset = vec2(texelWidthOffset, texelHeightOffset);\n"]; #endif for (NSUInteger currentOverlowTextureRead = numberOfOptimizedOffsets; currentOverlowTextureRead < trueNumberOfOptimizedOffsets; currentOverlowTextureRead++) { GLfloat firstWeight = standardGaussianWeights[currentOverlowTextureRead * 2 + 1]; GLfloat secondWeight = standardGaussianWeights[currentOverlowTextureRead * 2 + 2]; GLfloat optimizedWeight = firstWeight + secondWeight; GLfloat optimizedOffset = (firstWeight * (currentOverlowTextureRead * 2 + 1) + secondWeight * (currentOverlowTextureRead * 2 + 2)) / optimizedWeight; [shaderString appendFormat:@"sum += texture2D(inputImageTexture, blurCoordinates[0] + singleStepOffset * %f) * %f;\n", optimizedOffset, optimizedWeight]; [shaderString appendFormat:@"sum += texture2D(inputImageTexture, blurCoordinates[0] - singleStepOffset * %f) * %f;\n", optimizedOffset, optimizedWeight]; } } // Footer [shaderString appendString:@"\ gl_FragColor = sum;\n\ }\n"]; free(standardGaussianWeights); return shaderString; } - (void)setupFilterForSize:(CGSize)filterFrameSize; { [super setupFilterForSize:filterFrameSize]; if (shouldResizeBlurRadiusWithImageSize) { if (self.blurRadiusAsFractionOfImageWidth > 0) { self.blurRadiusInPixels = filterFrameSize.width * self.blurRadiusAsFractionOfImageWidth; } else { self.blurRadiusInPixels = filterFrameSize.height * self.blurRadiusAsFractionOfImageHeight; } } } #pragma mark - #pragma mark Rendering - (void)renderToTextureWithVertices:(const GLfloat *)vertices textureCoordinates:(const GLfloat *)textureCoordinates; { [super renderToTextureWithVertices:vertices textureCoordinates:textureCoordinates]; for (NSUInteger currentAdditionalBlurPass = 1; currentAdditionalBlurPass < _blurPasses; currentAdditionalBlurPass++) { [super renderToTextureWithVertices:vertices textureCoordinates:[[self class] textureCoordinatesForRotation:kGPUImageNoRotation]]; } } - (void)switchToVertexShader:(NSString *)newVertexShader fragmentShader:(NSString *)newFragmentShader; { runSynchronouslyOnVideoProcessingQueue(^{ [GPUImageContext useImageProcessingContext]; filterProgram = [[GPUImageContext sharedImageProcessingContext] programForVertexShaderString:newVertexShader fragmentShaderString:newFragmentShader]; if (!filterProgram.initialized) { [self initializeAttributes]; if (![filterProgram link]) { NSString *progLog = [filterProgram programLog]; NSLog(@"Program link log: %@", progLog); NSString *fragLog = [filterProgram fragmentShaderLog]; NSLog(@"Fragment shader compile log: %@", fragLog); NSString *vertLog = [filterProgram vertexShaderLog]; NSLog(@"Vertex shader compile log: %@", vertLog); filterProgram = nil; NSAssert(NO, @"Filter shader link failed"); } } filterPositionAttribute = [filterProgram attributeIndex:@"position"]; filterTextureCoordinateAttribute = [filterProgram attributeIndex:@"inputTextureCoordinate"]; filterInputTextureUniform = [filterProgram uniformIndex:@"inputImageTexture"]; // This does assume a name of "inputImageTexture" for the fragment shader verticalPassTexelWidthOffsetUniform = [filterProgram uniformIndex:@"texelWidthOffset"]; verticalPassTexelHeightOffsetUniform = [filterProgram uniformIndex:@"texelHeightOffset"]; [GPUImageContext setActiveShaderProgram:filterProgram]; glEnableVertexAttribArray(filterPositionAttribute); glEnableVertexAttribArray(filterTextureCoordinateAttribute); secondFilterProgram = [[GPUImageContext sharedImageProcessingContext] programForVertexShaderString:newVertexShader fragmentShaderString:newFragmentShader]; if (!secondFilterProgram.initialized) { [self initializeSecondaryAttributes]; if (![secondFilterProgram link]) { NSString *progLog = [secondFilterProgram programLog]; NSLog(@"Program link log: %@", progLog); NSString *fragLog = [secondFilterProgram fragmentShaderLog]; NSLog(@"Fragment shader compile log: %@", fragLog); NSString *vertLog = [secondFilterProgram vertexShaderLog]; NSLog(@"Vertex shader compile log: %@", vertLog); secondFilterProgram = nil; NSAssert(NO, @"Filter shader link failed"); } } secondFilterPositionAttribute = [secondFilterProgram attributeIndex:@"position"]; secondFilterTextureCoordinateAttribute = [secondFilterProgram attributeIndex:@"inputTextureCoordinate"]; secondFilterInputTextureUniform = [secondFilterProgram uniformIndex:@"inputImageTexture"]; // This does assume a name of "inputImageTexture" for the fragment shader secondFilterInputTextureUniform2 = [secondFilterProgram uniformIndex:@"inputImageTexture2"]; // This does assume a name of "inputImageTexture2" for second input texture in the fragment shader horizontalPassTexelWidthOffsetUniform = [secondFilterProgram uniformIndex:@"texelWidthOffset"]; horizontalPassTexelHeightOffsetUniform = [secondFilterProgram uniformIndex:@"texelHeightOffset"]; [GPUImageContext setActiveShaderProgram:secondFilterProgram]; glEnableVertexAttribArray(secondFilterPositionAttribute); glEnableVertexAttribArray(secondFilterTextureCoordinateAttribute); [self setupFilterForSize:[self sizeOfFBO]]; glFinish(); }); } #pragma mark - #pragma mark Accessors - (void)setTexelSpacingMultiplier:(CGFloat)newValue; { _texelSpacingMultiplier = newValue; _verticalTexelSpacing = _texelSpacingMultiplier; _horizontalTexelSpacing = _texelSpacingMultiplier; [self setupFilterForSize:[self sizeOfFBO]]; } // inputRadius for Core Image's CIGaussianBlur is really sigma in the Gaussian equation, so I'm using that for my blur radius, to be consistent - (void)setBlurRadiusInPixels:(CGFloat)newValue; { // 7.0 is the limit for blur size for hardcoded varying offsets if (round(newValue) != _blurRadiusInPixels) { _blurRadiusInPixels = round(newValue); // For now, only do integral sigmas NSUInteger calculatedSampleRadius = 0; if (_blurRadiusInPixels >= 1) // Avoid a divide-by-zero error here { // Calculate the number of pixels to sample from by setting a bottom limit for the contribution of the outermost pixel CGFloat minimumWeightToFindEdgeOfSamplingArea = 1.0/256.0; calculatedSampleRadius = floor(sqrt(-2.0 * pow(_blurRadiusInPixels, 2.0) * log(minimumWeightToFindEdgeOfSamplingArea * sqrt(2.0 * M_PI * pow(_blurRadiusInPixels, 2.0))) )); calculatedSampleRadius += calculatedSampleRadius % 2; // There's nothing to gain from handling odd radius sizes, due to the optimizations I use } // NSLog(@"Blur radius: %f, calculated sample radius: %d", _blurRadiusInPixels, calculatedSampleRadius); // NSString *newGaussianBlurVertexShader = [[self class] vertexShaderForOptimizedBlurOfRadius:calculatedSampleRadius sigma:_blurRadiusInPixels]; NSString *newGaussianBlurFragmentShader = [[self class] fragmentShaderForOptimizedBlurOfRadius:calculatedSampleRadius sigma:_blurRadiusInPixels]; // NSLog(@"Optimized vertex shader: \n%@", newGaussianBlurVertexShader); // NSLog(@"Optimized fragment shader: \n%@", newGaussianBlurFragmentShader); // [self switchToVertexShader:newGaussianBlurVertexShader fragmentShader:newGaussianBlurFragmentShader]; } shouldResizeBlurRadiusWithImageSize = NO; } - (void)setBlurRadiusAsFractionOfImageWidth:(CGFloat)blurRadiusAsFractionOfImageWidth { if (blurRadiusAsFractionOfImageWidth < 0) return; shouldResizeBlurRadiusWithImageSize = _blurRadiusAsFractionOfImageWidth != blurRadiusAsFractionOfImageWidth && blurRadiusAsFractionOfImageWidth > 0; _blurRadiusAsFractionOfImageWidth = blurRadiusAsFractionOfImageWidth; _blurRadiusAsFractionOfImageHeight = 0; } - (void)setBlurRadiusAsFractionOfImageHeight:(CGFloat)blurRadiusAsFractionOfImageHeight { if (blurRadiusAsFractionOfImageHeight < 0) return; shouldResizeBlurRadiusWithImageSize = _blurRadiusAsFractionOfImageHeight != blurRadiusAsFractionOfImageHeight && blurRadiusAsFractionOfImageHeight > 0; _blurRadiusAsFractionOfImageHeight = blurRadiusAsFractionOfImageHeight; _blurRadiusAsFractionOfImageWidth = 0; } @end ================================================ FILE: framework/Source/GPUImageGaussianBlurPositionFilter.h ================================================ #import "GPUImageTwoPassTextureSamplingFilter.h" /** A more generalized 9x9 Gaussian blur filter */ @interface GPUImageGaussianBlurPositionFilter : GPUImageTwoPassTextureSamplingFilter { GLint blurCenterUniform, blurRadiusUniform, aspectRatioUniform; } /** A multiplier for the blur size, ranging from 0.0 on up, with a default of 1.0 */ @property (readwrite, nonatomic) CGFloat blurSize; /** Center for the blur, defaults to 0.5, 0.5 */ @property (readwrite, nonatomic) CGPoint blurCenter; /** Radius for the blur, defaults to 1.0 */ @property (readwrite, nonatomic) CGFloat blurRadius; @end ================================================ FILE: framework/Source/GPUImageGaussianBlurPositionFilter.m ================================================ #import "GPUImageGaussianBlurPositionFilter.h" NSString *const kGPUImageGaussianBlurPositionVertexShaderString = SHADER_STRING ( attribute vec4 position; attribute vec4 inputTextureCoordinate; const int GAUSSIAN_SAMPLES = 9; uniform float texelWidthOffset; uniform float texelHeightOffset; varying vec2 textureCoordinate; varying vec2 blurCoordinates[GAUSSIAN_SAMPLES]; void main() { gl_Position = position; textureCoordinate = inputTextureCoordinate.xy; // Calculate the positions for the blur int multiplier = 0; vec2 blurStep; vec2 singleStepOffset = vec2(texelWidthOffset, texelHeightOffset); for (int i = 0; i < GAUSSIAN_SAMPLES; i++) { multiplier = (i - ((GAUSSIAN_SAMPLES - 1) / 2)); // Blur in x (horizontal) blurStep = float(multiplier) * singleStepOffset; blurCoordinates[i] = inputTextureCoordinate.xy + blurStep; } } ); #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageGaussianBlurPositionFragmentShaderString = SHADER_STRING ( uniform sampler2D inputImageTexture; const lowp int GAUSSIAN_SAMPLES = 9; varying highp vec2 textureCoordinate; varying highp vec2 blurCoordinates[GAUSSIAN_SAMPLES]; uniform highp float aspectRatio; uniform lowp vec2 blurCenter; uniform highp float blurRadius; void main() { highp vec2 textureCoordinateToUse = vec2(textureCoordinate.x, (textureCoordinate.y * aspectRatio + 0.5 - 0.5 * aspectRatio)); highp float dist = distance(blurCenter, textureCoordinateToUse); if (dist < blurRadius) { lowp vec4 sum = vec4(0.0); sum += texture2D(inputImageTexture, blurCoordinates[0]) * 0.05; sum += texture2D(inputImageTexture, blurCoordinates[1]) * 0.09; sum += texture2D(inputImageTexture, blurCoordinates[2]) * 0.12; sum += texture2D(inputImageTexture, blurCoordinates[3]) * 0.15; sum += texture2D(inputImageTexture, blurCoordinates[4]) * 0.18; sum += texture2D(inputImageTexture, blurCoordinates[5]) * 0.15; sum += texture2D(inputImageTexture, blurCoordinates[6]) * 0.12; sum += texture2D(inputImageTexture, blurCoordinates[7]) * 0.09; sum += texture2D(inputImageTexture, blurCoordinates[8]) * 0.05; gl_FragColor = sum; } else { gl_FragColor = texture2D(inputImageTexture, textureCoordinate); } } ); #else NSString *const kGPUImageGaussianBlurPositionFragmentShaderString = SHADER_STRING ( uniform sampler2D inputImageTexture; const int GAUSSIAN_SAMPLES = 9; varying vec2 textureCoordinate; varying vec2 blurCoordinates[GAUSSIAN_SAMPLES]; uniform float aspectRatio; uniform vec2 blurCenter; uniform float blurRadius; void main() { vec2 textureCoordinateToUse = vec2(textureCoordinate.x, (textureCoordinate.y * aspectRatio + 0.5 - 0.5 * aspectRatio)); float dist = distance(blurCenter, textureCoordinateToUse); if (dist < blurRadius) { vec4 sum = vec4(0.0); sum += texture2D(inputImageTexture, blurCoordinates[0]) * 0.05; sum += texture2D(inputImageTexture, blurCoordinates[1]) * 0.09; sum += texture2D(inputImageTexture, blurCoordinates[2]) * 0.12; sum += texture2D(inputImageTexture, blurCoordinates[3]) * 0.15; sum += texture2D(inputImageTexture, blurCoordinates[4]) * 0.18; sum += texture2D(inputImageTexture, blurCoordinates[5]) * 0.15; sum += texture2D(inputImageTexture, blurCoordinates[6]) * 0.12; sum += texture2D(inputImageTexture, blurCoordinates[7]) * 0.09; sum += texture2D(inputImageTexture, blurCoordinates[8]) * 0.05; gl_FragColor = sum; } else { gl_FragColor = texture2D(inputImageTexture, textureCoordinate); } } ); #endif @interface GPUImageGaussianBlurPositionFilter () - (void)adjustAspectRatio; @property (readwrite, nonatomic) CGFloat aspectRatio; @end @implementation GPUImageGaussianBlurPositionFilter @synthesize blurSize = _blurSize; @synthesize blurCenter = _blurCenter; @synthesize aspectRatio = _aspectRatio; - (id) initWithFirstStageVertexShaderFromString:(NSString *)firstStageVertexShaderString firstStageFragmentShaderFromString:(NSString *)firstStageFragmentShaderString secondStageVertexShaderFromString:(NSString *)secondStageVertexShaderString secondStageFragmentShaderFromString:(NSString *)secondStageFragmentShaderString { if (!(self = [super initWithFirstStageVertexShaderFromString:firstStageVertexShaderString ? firstStageVertexShaderString : kGPUImageGaussianBlurPositionVertexShaderString firstStageFragmentShaderFromString:firstStageFragmentShaderString ? firstStageFragmentShaderString : kGPUImageGaussianBlurPositionFragmentShaderString secondStageVertexShaderFromString:secondStageVertexShaderString ? secondStageVertexShaderString : kGPUImageGaussianBlurPositionVertexShaderString secondStageFragmentShaderFromString:secondStageFragmentShaderString ? secondStageFragmentShaderString : kGPUImageGaussianBlurPositionFragmentShaderString])) { return nil; } aspectRatioUniform = [secondFilterProgram uniformIndex:@"aspectRatio"]; blurCenterUniform = [secondFilterProgram uniformIndex:@"blurCenter"]; blurRadiusUniform = [secondFilterProgram uniformIndex:@"blurRadius"]; self.blurSize = 1.0; self.blurRadius = 1.0; self.blurCenter = CGPointMake(0.5, 0.5); return self; } - (id)init; { return [self initWithFirstStageVertexShaderFromString:nil firstStageFragmentShaderFromString:nil secondStageVertexShaderFromString:nil secondStageFragmentShaderFromString:nil]; } - (void)adjustAspectRatio; { if (GPUImageRotationSwapsWidthAndHeight(inputRotation)) { [self setAspectRatio:(inputTextureSize.width / inputTextureSize.height)]; } else { [self setAspectRatio:(inputTextureSize.height / inputTextureSize.width)]; } } - (void)forceProcessingAtSize:(CGSize)frameSize; { [super forceProcessingAtSize:frameSize]; [self adjustAspectRatio]; } - (void)setInputSize:(CGSize)newSize atIndex:(NSInteger)textureIndex; { CGSize oldInputSize = inputTextureSize; [super setInputSize:newSize atIndex:textureIndex]; if ( (!CGSizeEqualToSize(oldInputSize, inputTextureSize)) && (!CGSizeEqualToSize(newSize, CGSizeZero)) ) { [self adjustAspectRatio]; } } - (void)setInputRotation:(GPUImageRotationMode)newInputRotation atIndex:(NSInteger)textureIndex; { [super setInputRotation:newInputRotation atIndex:textureIndex]; [self setBlurCenter:self.blurCenter]; [self adjustAspectRatio]; } #pragma mark - #pragma mark Accessors - (void)setBlurSize:(CGFloat)newValue; { _blurSize = newValue; _verticalTexelSpacing = _blurSize; _horizontalTexelSpacing = _blurSize; [self setupFilterForSize:[self sizeOfFBO]]; } - (void) setBlurCenter:(CGPoint)blurCenter; { _blurCenter = blurCenter; CGPoint rotatedPoint = [self rotatedPoint:blurCenter forRotation:inputRotation]; [self setPoint:rotatedPoint forUniform:blurCenterUniform program:secondFilterProgram]; } - (void) setBlurRadius:(CGFloat)blurRadius; { _blurRadius = blurRadius; [self setFloat:_blurRadius forUniform:blurRadiusUniform program:secondFilterProgram]; } - (void) setAspectRatio:(CGFloat)newValue; { _aspectRatio = newValue; [self setFloat:_aspectRatio forUniform:aspectRatioUniform program:secondFilterProgram]; } @end ================================================ FILE: framework/Source/GPUImageGaussianSelectiveBlurFilter.h ================================================ #import "GPUImageFilterGroup.h" @class GPUImageGaussianBlurFilter; /** A Gaussian blur that preserves focus within a circular region */ @interface GPUImageGaussianSelectiveBlurFilter : GPUImageFilterGroup { GPUImageGaussianBlurFilter *blurFilter; GPUImageFilter *selectiveFocusFilter; BOOL hasOverriddenAspectRatio; } /** The radius of the circular area being excluded from the blur */ @property (readwrite, nonatomic) CGFloat excludeCircleRadius; /** The center of the circular area being excluded from the blur */ @property (readwrite, nonatomic) CGPoint excludeCirclePoint; /** The size of the area between the blurred portion and the clear circle */ @property (readwrite, nonatomic) CGFloat excludeBlurSize; /** A radius in pixels to use for the blur, with a default of 5.0. This adjusts the sigma variable in the Gaussian distribution function. */ @property (readwrite, nonatomic) CGFloat blurRadiusInPixels; /** The aspect ratio of the image, used to adjust the circularity of the in-focus region. By default, this matches the image aspect ratio, but you can override this value. */ @property (readwrite, nonatomic) CGFloat aspectRatio; @end ================================================ FILE: framework/Source/GPUImageGaussianSelectiveBlurFilter.m ================================================ #import "GPUImageGaussianSelectiveBlurFilter.h" #import "GPUImageGaussianBlurFilter.h" #import "GPUImageTwoInputFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageGaussianSelectiveBlurFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; varying highp vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; uniform lowp float excludeCircleRadius; uniform lowp vec2 excludeCirclePoint; uniform lowp float excludeBlurSize; uniform highp float aspectRatio; void main() { lowp vec4 sharpImageColor = texture2D(inputImageTexture, textureCoordinate); lowp vec4 blurredImageColor = texture2D(inputImageTexture2, textureCoordinate2); highp vec2 textureCoordinateToUse = vec2(textureCoordinate2.x, (textureCoordinate2.y * aspectRatio + 0.5 - 0.5 * aspectRatio)); highp float distanceFromCenter = distance(excludeCirclePoint, textureCoordinateToUse); gl_FragColor = mix(sharpImageColor, blurredImageColor, smoothstep(excludeCircleRadius - excludeBlurSize, excludeCircleRadius, distanceFromCenter)); } ); #else NSString *const kGPUImageGaussianSelectiveBlurFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; varying vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; uniform float excludeCircleRadius; uniform vec2 excludeCirclePoint; uniform float excludeBlurSize; uniform float aspectRatio; void main() { vec4 sharpImageColor = texture2D(inputImageTexture, textureCoordinate); vec4 blurredImageColor = texture2D(inputImageTexture2, textureCoordinate2); vec2 textureCoordinateToUse = vec2(textureCoordinate2.x, (textureCoordinate2.y * aspectRatio + 0.5 - 0.5 * aspectRatio)); float distanceFromCenter = distance(excludeCirclePoint, textureCoordinateToUse); gl_FragColor = mix(sharpImageColor, blurredImageColor, smoothstep(excludeCircleRadius - excludeBlurSize, excludeCircleRadius, distanceFromCenter)); } ); #endif @implementation GPUImageGaussianSelectiveBlurFilter @synthesize excludeCirclePoint = _excludeCirclePoint, excludeCircleRadius = _excludeCircleRadius, excludeBlurSize = _excludeBlurSize; @synthesize blurRadiusInPixels = _blurRadiusInPixels; @synthesize aspectRatio = _aspectRatio; - (id)init; { if (!(self = [super init])) { return nil; } hasOverriddenAspectRatio = NO; // First pass: apply a variable Gaussian blur blurFilter = [[GPUImageGaussianBlurFilter alloc] init]; [self addFilter:blurFilter]; // Second pass: combine the blurred image with the original sharp one selectiveFocusFilter = [[GPUImageTwoInputFilter alloc] initWithFragmentShaderFromString:kGPUImageGaussianSelectiveBlurFragmentShaderString]; [self addFilter:selectiveFocusFilter]; // Texture location 0 needs to be the sharp image for both the blur and the second stage processing [blurFilter addTarget:selectiveFocusFilter atTextureLocation:1]; // To prevent double updating of this filter, disable updates from the sharp image side self.initialFilters = [NSArray arrayWithObjects:blurFilter, selectiveFocusFilter, nil]; self.terminalFilter = selectiveFocusFilter; self.blurRadiusInPixels = 5.0; self.excludeCircleRadius = 60.0/320.0; self.excludeCirclePoint = CGPointMake(0.5f, 0.5f); self.excludeBlurSize = 30.0/320.0; return self; } - (void)setInputSize:(CGSize)newSize atIndex:(NSInteger)textureIndex; { CGSize oldInputSize = inputTextureSize; [super setInputSize:newSize atIndex:textureIndex]; inputTextureSize = newSize; if ( (!CGSizeEqualToSize(oldInputSize, inputTextureSize)) && (!hasOverriddenAspectRatio) && (!CGSizeEqualToSize(newSize, CGSizeZero)) ) { _aspectRatio = (inputTextureSize.width / inputTextureSize.height); [selectiveFocusFilter setFloat:_aspectRatio forUniformName:@"aspectRatio"]; } } #pragma mark - #pragma mark Accessors - (void)setBlurRadiusInPixels:(CGFloat)newValue; { blurFilter.blurRadiusInPixels = newValue; } - (CGFloat)blurRadiusInPixels; { return blurFilter.blurRadiusInPixels; } - (void)setExcludeCirclePoint:(CGPoint)newValue; { _excludeCirclePoint = newValue; [selectiveFocusFilter setPoint:newValue forUniformName:@"excludeCirclePoint"]; } - (void)setExcludeCircleRadius:(CGFloat)newValue; { _excludeCircleRadius = newValue; [selectiveFocusFilter setFloat:newValue forUniformName:@"excludeCircleRadius"]; } - (void)setExcludeBlurSize:(CGFloat)newValue; { _excludeBlurSize = newValue; [selectiveFocusFilter setFloat:newValue forUniformName:@"excludeBlurSize"]; } - (void)setAspectRatio:(CGFloat)newValue; { hasOverriddenAspectRatio = YES; _aspectRatio = newValue; [selectiveFocusFilter setFloat:_aspectRatio forUniformName:@"aspectRatio"]; } @end ================================================ FILE: framework/Source/GPUImageGlassSphereFilter.h ================================================ #import "GPUImageSphereRefractionFilter.h" @interface GPUImageGlassSphereFilter : GPUImageSphereRefractionFilter @end ================================================ FILE: framework/Source/GPUImageGlassSphereFilter.m ================================================ #import "GPUImageGlassSphereFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageGlassSphereFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform highp vec2 center; uniform highp float radius; uniform highp float aspectRatio; uniform highp float refractiveIndex; // uniform vec3 lightPosition; const highp vec3 lightPosition = vec3(-0.5, 0.5, 1.0); const highp vec3 ambientLightPosition = vec3(0.0, 0.0, 1.0); void main() { highp vec2 textureCoordinateToUse = vec2(textureCoordinate.x, (textureCoordinate.y * aspectRatio + 0.5 - 0.5 * aspectRatio)); highp float distanceFromCenter = distance(center, textureCoordinateToUse); lowp float checkForPresenceWithinSphere = step(distanceFromCenter, radius); distanceFromCenter = distanceFromCenter / radius; highp float normalizedDepth = radius * sqrt(1.0 - distanceFromCenter * distanceFromCenter); highp vec3 sphereNormal = normalize(vec3(textureCoordinateToUse - center, normalizedDepth)); highp vec3 refractedVector = 2.0 * refract(vec3(0.0, 0.0, -1.0), sphereNormal, refractiveIndex); refractedVector.xy = -refractedVector.xy; highp vec3 finalSphereColor = texture2D(inputImageTexture, (refractedVector.xy + 1.0) * 0.5).rgb; // Grazing angle lighting highp float lightingIntensity = 2.5 * (1.0 - pow(clamp(dot(ambientLightPosition, sphereNormal), 0.0, 1.0), 0.25)); finalSphereColor += lightingIntensity; // Specular lighting lightingIntensity = clamp(dot(normalize(lightPosition), sphereNormal), 0.0, 1.0); lightingIntensity = pow(lightingIntensity, 15.0); finalSphereColor += vec3(0.8, 0.8, 0.8) * lightingIntensity; gl_FragColor = vec4(finalSphereColor, 1.0) * checkForPresenceWithinSphere; } ); #else NSString *const kGPUImageGlassSphereFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform vec2 center; uniform float radius; uniform float aspectRatio; uniform float refractiveIndex; // uniform vec3 lightPosition; const vec3 lightPosition = vec3(-0.5, 0.5, 1.0); const vec3 ambientLightPosition = vec3(0.0, 0.0, 1.0); void main() { vec2 textureCoordinateToUse = vec2(textureCoordinate.x, (textureCoordinate.y * aspectRatio + 0.5 - 0.5 * aspectRatio)); float distanceFromCenter = distance(center, textureCoordinateToUse); float checkForPresenceWithinSphere = step(distanceFromCenter, radius); distanceFromCenter = distanceFromCenter / radius; float normalizedDepth = radius * sqrt(1.0 - distanceFromCenter * distanceFromCenter); vec3 sphereNormal = normalize(vec3(textureCoordinateToUse - center, normalizedDepth)); vec3 refractedVector = 2.0 * refract(vec3(0.0, 0.0, -1.0), sphereNormal, refractiveIndex); refractedVector.xy = -refractedVector.xy; vec3 finalSphereColor = texture2D(inputImageTexture, (refractedVector.xy + 1.0) * 0.5).rgb; // Grazing angle lighting float lightingIntensity = 2.5 * (1.0 - pow(clamp(dot(ambientLightPosition, sphereNormal), 0.0, 1.0), 0.25)); finalSphereColor += lightingIntensity; // Specular lighting lightingIntensity = clamp(dot(normalize(lightPosition), sphereNormal), 0.0, 1.0); lightingIntensity = pow(lightingIntensity, 15.0); finalSphereColor += vec3(0.8, 0.8, 0.8) * lightingIntensity; gl_FragColor = vec4(finalSphereColor, 1.0) * checkForPresenceWithinSphere; } ); #endif @implementation GPUImageGlassSphereFilter #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageGlassSphereFragmentShaderString])) { return nil; } return self; } @end ================================================ FILE: framework/Source/GPUImageGrayscaleFilter.h ================================================ #import "GPUImageFilter.h" extern NSString *const kGPUImageLuminanceFragmentShaderString; /** Converts an image to grayscale (a slightly faster implementation of the saturation filter, without the ability to vary the color contribution) */ @interface GPUImageGrayscaleFilter : GPUImageFilter @end ================================================ FILE: framework/Source/GPUImageGrayscaleFilter.m ================================================ #import "GPUImageGrayscaleFilter.h" @implementation GPUImageGrayscaleFilter #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageLuminanceFragmentShaderString = SHADER_STRING ( precision highp float; varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; const highp vec3 W = vec3(0.2125, 0.7154, 0.0721); void main() { lowp vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); float luminance = dot(textureColor.rgb, W); gl_FragColor = vec4(vec3(luminance), textureColor.a); } ); #else NSString *const kGPUImageLuminanceFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; const vec3 W = vec3(0.2125, 0.7154, 0.0721); void main() { vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); float luminance = dot(textureColor.rgb, W); gl_FragColor = vec4(vec3(luminance), textureColor.a); } ); #endif - (void)renderToTextureWithVertices:(const GLfloat *)vertices textureCoordinates:(const GLfloat *)textureCoordinates; { if (!currentlyReceivingMonochromeInput) { [super renderToTextureWithVertices:vertices textureCoordinates:textureCoordinates]; } } //- (void)setInputTexture:(GLuint)newInputTexture atIndex:(NSInteger)textureIndex; //{ // [super setInputTexture:newInputTexture atIndex:textureIndex]; // if (currentlyReceivingMonochromeInput) // { // [self notifyTargetsAboutNewOutputTexture]; // } //} //- (GLuint)textureForOutput; //{ // if (currentlyReceivingMonochromeInput) // { // return filterSourceTexture; // } // else // { // return outputTexture; // } //} - (BOOL)wantsMonochromeInput; { // return YES; return NO; } - (BOOL)providesMonochromeOutput; { // return YES; return NO; } // TODO: Rewrite this based on the new GPUImageFilter implementation //- (void)informTargetsAboutNewFrameAtTime:(CMTime)frameTime; //{ // if (self.frameProcessingCompletionBlock != NULL) // { // self.frameProcessingCompletionBlock(self, frameTime); // } // // for (id currentTarget in targets) // { // if (currentTarget != self.targetToIgnoreForUpdates) // { // NSInteger indexOfObject = [targets indexOfObject:currentTarget]; // NSInteger textureIndex = [[targetTextureIndices objectAtIndex:indexOfObject] integerValue]; // // if ([GPUImageContext supportsFastTextureUpload] && preparedToCaptureImage) // { // [self setInputTextureForTarget:currentTarget atIndex:textureIndex]; // } // // if (currentlyReceivingMonochromeInput) // { // [currentTarget setInputRotation:inputRotation atIndex:textureIndex]; // // CGSize sizeToRotate = [self outputFrameSize]; // CGSize rotatedSize = sizeToRotate; // if (GPUImageRotationSwapsWidthAndHeight(inputRotation)) // { // rotatedSize.width = sizeToRotate.height; // rotatedSize.height = sizeToRotate.width; // } // [currentTarget setInputSize:rotatedSize atIndex:textureIndex]; // } // else // { // [currentTarget setInputSize:[self outputFrameSize] atIndex:textureIndex]; // } // [currentTarget newFrameReadyAtTime:frameTime atIndex:textureIndex]; // } // } //} #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageLuminanceFragmentShaderString])) { return nil; } return self; } @end ================================================ FILE: framework/Source/GPUImageHSBFilter.h ================================================ #import "GPUImageColorMatrixFilter.h" @interface GPUImageHSBFilter : GPUImageColorMatrixFilter /** Reset the filter to have no transformations. */ - (void)reset; /** Add a hue rotation to the filter. The hue rotation is in the range [-360, 360] with 0 being no-change. Note that this adjustment is additive, so use the reset method if you need to. */ - (void)rotateHue:(float)h; /** Add a saturation adjustment to the filter. The saturation adjustment is in the range [0.0, 2.0] with 1.0 being no-change. Note that this adjustment is additive, so use the reset method if you need to. */ - (void)adjustSaturation:(float)s; /** Add a brightness adjustment to the filter. The brightness adjustment is in the range [0.0, 2.0] with 1.0 being no-change. Note that this adjustment is additive, so use the reset method if you need to. */ - (void)adjustBrightness:(float)b; @end ================================================ FILE: framework/Source/GPUImageHSBFilter.m ================================================ #import "GPUImageHSBFilter.h" @implementation GPUImageHSBFilter { float matrix[4][4]; } - (id)init { self = [super init]; if (self) { [self reset]; } return self; } - (void)reset { identmat(matrix); [self _updateColorMatrix]; } - (void)rotateHue:(float)h { huerotatemat(matrix, h); [self _updateColorMatrix]; } - (void)adjustSaturation:(float)s { saturatemat(matrix, s); [self _updateColorMatrix]; } - (void)adjustBrightness:(float)b { cscalemat(matrix, b, b, b); [self _updateColorMatrix]; } - (void)_updateColorMatrix { GPUMatrix4x4 gpuMatrix; gpuMatrix.one.one = matrix[0][0]; gpuMatrix.one.two = matrix[1][0]; gpuMatrix.one.three = matrix[2][0]; gpuMatrix.one.four = matrix[3][0]; gpuMatrix.two.one = matrix[0][1]; gpuMatrix.two.two = matrix[1][1]; gpuMatrix.two.three = matrix[2][1]; gpuMatrix.two.four = matrix[3][1]; gpuMatrix.three.one = matrix[0][2]; gpuMatrix.three.two = matrix[1][2]; gpuMatrix.three.three = matrix[2][2]; gpuMatrix.three.four = matrix[3][2]; gpuMatrix.four.one = matrix[0][3]; gpuMatrix.four.two = matrix[1][3]; gpuMatrix.four.three = matrix[2][3]; gpuMatrix.four.four = matrix[3][3]; self.colorMatrix = gpuMatrix; } #pragma mark - Matrix algorithms /* Matrix algorithms adapted from http://www.graficaobscura.com/matrix/index.html Note about luminance vector values below from that page: Where rwgt is 0.3086, gwgt is 0.6094, and bwgt is 0.0820. This is the luminance vector. Notice here that we do not use the standard NTSC weights of 0.299, 0.587, and 0.114. The NTSC weights are only applicable to RGB colors in a gamma 2.2 color space. For linear RGB colors the values above are better. */ //#define RLUM (0.3086f) //#define GLUM (0.6094f) //#define BLUM (0.0820f) /* This is the vector value from the PDF specification, and may be closer to what Photoshop uses */ #define RLUM (0.3f) #define GLUM (0.59f) #define BLUM (0.11f) /* * matrixmult - * multiply two matricies */ static void matrixmult(a,b,c) float a[4][4], b[4][4], c[4][4]; { int x, y; float temp[4][4]; for(y=0; y<4 ; y++) for(x=0 ; x<4 ; x++) { temp[y][x] = b[y][0] * a[0][x] + b[y][1] * a[1][x] + b[y][2] * a[2][x] + b[y][3] * a[3][x]; } for(y=0; y<4; y++) for(x=0; x<4; x++) c[y][x] = temp[y][x]; } /* * identmat - * make an identity matrix */ static void identmat(matrix) float matrix[4][4]; { memset(matrix, 0, sizeof(float[4][4])); matrix[0][0] = 1.0f; matrix[1][1] = 1.0f; matrix[2][2] = 1.0f; matrix[3][3] = 1.0f; } /* * xformpnt - * transform a 3D point using a matrix */ static void xformpnt(matrix,x,y,z,tx,ty,tz) float matrix[4][4]; float x,y,z; float *tx,*ty,*tz; { *tx = x*matrix[0][0] + y*matrix[1][0] + z*matrix[2][0] + matrix[3][0]; *ty = x*matrix[0][1] + y*matrix[1][1] + z*matrix[2][1] + matrix[3][1]; *tz = x*matrix[0][2] + y*matrix[1][2] + z*matrix[2][2] + matrix[3][2]; } /* * cscalemat - * make a color scale marix */ static void cscalemat(mat,rscale,gscale,bscale) float mat[4][4]; float rscale, gscale, bscale; { float mmat[4][4]; mmat[0][0] = rscale; mmat[0][1] = 0.0; mmat[0][2] = 0.0; mmat[0][3] = 0.0; mmat[1][0] = 0.0; mmat[1][1] = gscale; mmat[1][2] = 0.0; mmat[1][3] = 0.0; mmat[2][0] = 0.0; mmat[2][1] = 0.0; mmat[2][2] = bscale; mmat[2][3] = 0.0; mmat[3][0] = 0.0; mmat[3][1] = 0.0; mmat[3][2] = 0.0; mmat[3][3] = 1.0; matrixmult(mmat,mat,mat); } /* * saturatemat - * make a saturation marix */ static void saturatemat(mat,sat) float mat[4][4]; float sat; { float mmat[4][4]; float a, b, c, d, e, f, g, h, i; float rwgt, gwgt, bwgt; rwgt = RLUM; gwgt = GLUM; bwgt = BLUM; a = (1.0-sat)*rwgt + sat; b = (1.0-sat)*rwgt; c = (1.0-sat)*rwgt; d = (1.0-sat)*gwgt; e = (1.0-sat)*gwgt + sat; f = (1.0-sat)*gwgt; g = (1.0-sat)*bwgt; h = (1.0-sat)*bwgt; i = (1.0-sat)*bwgt + sat; mmat[0][0] = a; mmat[0][1] = b; mmat[0][2] = c; mmat[0][3] = 0.0; mmat[1][0] = d; mmat[1][1] = e; mmat[1][2] = f; mmat[1][3] = 0.0; mmat[2][0] = g; mmat[2][1] = h; mmat[2][2] = i; mmat[2][3] = 0.0; mmat[3][0] = 0.0; mmat[3][1] = 0.0; mmat[3][2] = 0.0; mmat[3][3] = 1.0; matrixmult(mmat,mat,mat); } /* * xrotate - * rotate about the x (red) axis */ static void xrotatemat(mat,rs,rc) float mat[4][4]; float rs, rc; { float mmat[4][4]; mmat[0][0] = 1.0; mmat[0][1] = 0.0; mmat[0][2] = 0.0; mmat[0][3] = 0.0; mmat[1][0] = 0.0; mmat[1][1] = rc; mmat[1][2] = rs; mmat[1][3] = 0.0; mmat[2][0] = 0.0; mmat[2][1] = -rs; mmat[2][2] = rc; mmat[2][3] = 0.0; mmat[3][0] = 0.0; mmat[3][1] = 0.0; mmat[3][2] = 0.0; mmat[3][3] = 1.0; matrixmult(mmat,mat,mat); } /* * yrotate - * rotate about the y (green) axis */ static void yrotatemat(mat,rs,rc) float mat[4][4]; float rs, rc; { float mmat[4][4]; mmat[0][0] = rc; mmat[0][1] = 0.0; mmat[0][2] = -rs; mmat[0][3] = 0.0; mmat[1][0] = 0.0; mmat[1][1] = 1.0; mmat[1][2] = 0.0; mmat[1][3] = 0.0; mmat[2][0] = rs; mmat[2][1] = 0.0; mmat[2][2] = rc; mmat[2][3] = 0.0; mmat[3][0] = 0.0; mmat[3][1] = 0.0; mmat[3][2] = 0.0; mmat[3][3] = 1.0; matrixmult(mmat,mat,mat); } /* * zrotate - * rotate about the z (blue) axis */ static void zrotatemat(mat,rs,rc) float mat[4][4]; float rs, rc; { float mmat[4][4]; mmat[0][0] = rc; mmat[0][1] = rs; mmat[0][2] = 0.0; mmat[0][3] = 0.0; mmat[1][0] = -rs; mmat[1][1] = rc; mmat[1][2] = 0.0; mmat[1][3] = 0.0; mmat[2][0] = 0.0; mmat[2][1] = 0.0; mmat[2][2] = 1.0; mmat[2][3] = 0.0; mmat[3][0] = 0.0; mmat[3][1] = 0.0; mmat[3][2] = 0.0; mmat[3][3] = 1.0; matrixmult(mmat,mat,mat); } /* * zshear - * shear z using x and y. */ static void zshearmat(mat,dx,dy) float mat[4][4]; float dx, dy; { float mmat[4][4]; mmat[0][0] = 1.0; mmat[0][1] = 0.0; mmat[0][2] = dx; mmat[0][3] = 0.0; mmat[1][0] = 0.0; mmat[1][1] = 1.0; mmat[1][2] = dy; mmat[1][3] = 0.0; mmat[2][0] = 0.0; mmat[2][1] = 0.0; mmat[2][2] = 1.0; mmat[2][3] = 0.0; mmat[3][0] = 0.0; mmat[3][1] = 0.0; mmat[3][2] = 0.0; mmat[3][3] = 1.0; matrixmult(mmat,mat,mat); } /* * simplehuerotatemat - * simple hue rotation. This changes luminance */ //static void simplehuerotatemat(mat,rot) //float mat[4][4]; //float rot; //{ // float mag; // float xrs, xrc; // float yrs, yrc; // float zrs, zrc; // // /* rotate the grey vector into positive Z */ // mag = sqrt(2.0); // xrs = 1.0/mag; // xrc = 1.0/mag; // xrotatemat(mat,xrs,xrc); // // mag = sqrt(3.0); // yrs = -1.0/mag; // yrc = sqrt(2.0)/mag; // yrotatemat(mat,yrs,yrc); // // /* rotate the hue */ // zrs = sin(rot*M_PI/180.0); // zrc = cos(rot*M_PI/180.0); // zrotatemat(mat,zrs,zrc); // // /* rotate the grey vector back into place */ // yrotatemat(mat,-yrs,yrc); // xrotatemat(mat,-xrs,xrc); //} /* * huerotatemat - * rotate the hue, while maintaining luminance. */ static void huerotatemat(mat,rot) float mat[4][4]; float rot; { float mmat[4][4]; float mag; float lx, ly, lz; float xrs, xrc; float yrs, yrc; float zrs, zrc; float zsx, zsy; identmat(mmat); /* rotate the grey vector into positive Z */ mag = sqrt(2.0); xrs = 1.0/mag; xrc = 1.0/mag; xrotatemat(mmat,xrs,xrc); mag = sqrt(3.0); yrs = -1.0/mag; yrc = sqrt(2.0)/mag; yrotatemat(mmat,yrs,yrc); /* shear the space to make the luminance plane horizontal */ xformpnt(mmat,RLUM,GLUM,BLUM,&lx,&ly,&lz); zsx = lx/lz; zsy = ly/lz; zshearmat(mmat,zsx,zsy); /* rotate the hue */ zrs = sin(rot*M_PI/180.0); zrc = cos(rot*M_PI/180.0); zrotatemat(mmat,zrs,zrc); /* unshear the space to put the luminance plane back */ zshearmat(mmat,-zsx,-zsy); /* rotate the grey vector back into place */ yrotatemat(mmat,-yrs,yrc); xrotatemat(mmat,-xrs,xrc); matrixmult(mmat,mat,mat); } @end ================================================ FILE: framework/Source/GPUImageHalftoneFilter.h ================================================ #import "GPUImagePixellateFilter.h" @interface GPUImageHalftoneFilter : GPUImagePixellateFilter @end ================================================ FILE: framework/Source/GPUImageHalftoneFilter.m ================================================ #import "GPUImageHalftoneFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageHalftoneFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform highp float fractionalWidthOfPixel; uniform highp float aspectRatio; uniform highp float dotScaling; const highp vec3 W = vec3(0.2125, 0.7154, 0.0721); void main() { highp vec2 sampleDivisor = vec2(fractionalWidthOfPixel, fractionalWidthOfPixel / aspectRatio); highp vec2 samplePos = textureCoordinate - mod(textureCoordinate, sampleDivisor) + 0.5 * sampleDivisor; highp vec2 textureCoordinateToUse = vec2(textureCoordinate.x, (textureCoordinate.y * aspectRatio + 0.5 - 0.5 * aspectRatio)); highp vec2 adjustedSamplePos = vec2(samplePos.x, (samplePos.y * aspectRatio + 0.5 - 0.5 * aspectRatio)); highp float distanceFromSamplePoint = distance(adjustedSamplePos, textureCoordinateToUse); lowp vec3 sampledColor = texture2D(inputImageTexture, samplePos ).rgb; highp float dotScaling = 1.0 - dot(sampledColor, W); lowp float checkForPresenceWithinDot = 1.0 - step(distanceFromSamplePoint, (fractionalWidthOfPixel * 0.5) * dotScaling); gl_FragColor = vec4(vec3(checkForPresenceWithinDot), 1.0); } ); #else NSString *const kGPUImageHalftoneFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform float fractionalWidthOfPixel; uniform float aspectRatio; uniform float dotScaling; const vec3 W = vec3(0.2125, 0.7154, 0.0721); void main() { vec2 sampleDivisor = vec2(fractionalWidthOfPixel, fractionalWidthOfPixel / aspectRatio); vec2 samplePos = textureCoordinate - mod(textureCoordinate, sampleDivisor) + 0.5 * sampleDivisor; vec2 textureCoordinateToUse = vec2(textureCoordinate.x, (textureCoordinate.y * aspectRatio + 0.5 - 0.5 * aspectRatio)); vec2 adjustedSamplePos = vec2(samplePos.x, (samplePos.y * aspectRatio + 0.5 - 0.5 * aspectRatio)); float distanceFromSamplePoint = distance(adjustedSamplePos, textureCoordinateToUse); vec3 sampledColor = texture2D(inputImageTexture, samplePos ).rgb; float dotScaling = 1.0 - dot(sampledColor, W); float checkForPresenceWithinDot = 1.0 - step(distanceFromSamplePoint, (fractionalWidthOfPixel * 0.5) * dotScaling); gl_FragColor = vec4(vec3(checkForPresenceWithinDot), 1.0); } ); #endif @implementation GPUImageHalftoneFilter - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageHalftoneFragmentShaderString])) { return nil; } self.fractionalWidthOfAPixel = 0.01; return self; } @end ================================================ FILE: framework/Source/GPUImageHardLightBlendFilter.h ================================================ #import "GPUImageTwoInputFilter.h" @interface GPUImageHardLightBlendFilter : GPUImageTwoInputFilter { } @end ================================================ FILE: framework/Source/GPUImageHardLightBlendFilter.m ================================================ #import "GPUImageHardLightBlendFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageHardLightBlendFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; varying highp vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; const highp vec3 W = vec3(0.2125, 0.7154, 0.0721); void main() { mediump vec4 base = texture2D(inputImageTexture, textureCoordinate); mediump vec4 overlay = texture2D(inputImageTexture2, textureCoordinate2); highp float ra; if (2.0 * overlay.r < overlay.a) { ra = 2.0 * overlay.r * base.r + overlay.r * (1.0 - base.a) + base.r * (1.0 - overlay.a); } else { ra = overlay.a * base.a - 2.0 * (base.a - base.r) * (overlay.a - overlay.r) + overlay.r * (1.0 - base.a) + base.r * (1.0 - overlay.a); } highp float ga; if (2.0 * overlay.g < overlay.a) { ga = 2.0 * overlay.g * base.g + overlay.g * (1.0 - base.a) + base.g * (1.0 - overlay.a); } else { ga = overlay.a * base.a - 2.0 * (base.a - base.g) * (overlay.a - overlay.g) + overlay.g * (1.0 - base.a) + base.g * (1.0 - overlay.a); } highp float ba; if (2.0 * overlay.b < overlay.a) { ba = 2.0 * overlay.b * base.b + overlay.b * (1.0 - base.a) + base.b * (1.0 - overlay.a); } else { ba = overlay.a * base.a - 2.0 * (base.a - base.b) * (overlay.a - overlay.b) + overlay.b * (1.0 - base.a) + base.b * (1.0 - overlay.a); } gl_FragColor = vec4(ra, ga, ba, 1.0); } ); #else NSString *const kGPUImageHardLightBlendFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; varying vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; const vec3 W = vec3(0.2125, 0.7154, 0.0721); void main() { vec4 base = texture2D(inputImageTexture, textureCoordinate); vec4 overlay = texture2D(inputImageTexture2, textureCoordinate2); float ra; if (2.0 * overlay.r < overlay.a) { ra = 2.0 * overlay.r * base.r + overlay.r * (1.0 - base.a) + base.r * (1.0 - overlay.a); } else { ra = overlay.a * base.a - 2.0 * (base.a - base.r) * (overlay.a - overlay.r) + overlay.r * (1.0 - base.a) + base.r * (1.0 - overlay.a); } float ga; if (2.0 * overlay.g < overlay.a) { ga = 2.0 * overlay.g * base.g + overlay.g * (1.0 - base.a) + base.g * (1.0 - overlay.a); } else { ga = overlay.a * base.a - 2.0 * (base.a - base.g) * (overlay.a - overlay.g) + overlay.g * (1.0 - base.a) + base.g * (1.0 - overlay.a); } float ba; if (2.0 * overlay.b < overlay.a) { ba = 2.0 * overlay.b * base.b + overlay.b * (1.0 - base.a) + base.b * (1.0 - overlay.a); } else { ba = overlay.a * base.a - 2.0 * (base.a - base.b) * (overlay.a - overlay.b) + overlay.b * (1.0 - base.a) + base.b * (1.0 - overlay.a); } gl_FragColor = vec4(ra, ga, ba, 1.0); } ); #endif @implementation GPUImageHardLightBlendFilter - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageHardLightBlendFragmentShaderString])) { return nil; } return self; } @end ================================================ FILE: framework/Source/GPUImageHarrisCornerDetectionFilter.h ================================================ #import "GPUImageFilterGroup.h" @class GPUImageGaussianBlurFilter; @class GPUImageXYDerivativeFilter; @class GPUImageGrayscaleFilter; @class GPUImageGaussianBlurFilter; @class GPUImageThresholdedNonMaximumSuppressionFilter; @class GPUImageColorPackingFilter; //#define DEBUGFEATUREDETECTION /** Harris corner detector First pass: reduce to luminance and take the derivative of the luminance texture (GPUImageXYDerivativeFilter) Second pass: blur the derivative (GPUImageGaussianBlurFilter) Third pass: apply the Harris corner detection calculation This is the Harris corner detector, as described in C. Harris and M. Stephens. A Combined Corner and Edge Detector. Proc. Alvey Vision Conf., Univ. Manchester, pp. 147-151, 1988. */ @interface GPUImageHarrisCornerDetectionFilter : GPUImageFilterGroup { GPUImageXYDerivativeFilter *derivativeFilter; GPUImageGaussianBlurFilter *blurFilter; GPUImageFilter *harrisCornerDetectionFilter; GPUImageThresholdedNonMaximumSuppressionFilter *nonMaximumSuppressionFilter; GPUImageColorPackingFilter *colorPackingFilter; GLfloat *cornersArray; GLubyte *rawImagePixels; } /** The radius of the underlying Gaussian blur. The default is 2.0. */ @property(readwrite, nonatomic) CGFloat blurRadiusInPixels; // This changes the dynamic range of the Harris corner detector by amplifying small cornerness values. Default is 5.0. @property(readwrite, nonatomic) CGFloat sensitivity; // A threshold value at which a point is recognized as being a corner after the non-maximum suppression. Default is 0.20. @property(readwrite, nonatomic) CGFloat threshold; // This block is called on the detection of new corner points, usually on every processed frame. A C array containing normalized coordinates in X, Y pairs is passed in, along with a count of the number of corners detected and the current timestamp of the video frame @property(nonatomic, copy) void(^cornersDetectedBlock)(GLfloat* cornerArray, NSUInteger cornersDetected, CMTime frameTime); // These images are only enabled when built with DEBUGFEATUREDETECTION defined, and are used to examine the intermediate states of the feature detector @property(nonatomic, readonly, strong) NSMutableArray *intermediateImages; // Initialization and teardown - (id)initWithCornerDetectionFragmentShader:(NSString *)cornerDetectionFragmentShader; @end ================================================ FILE: framework/Source/GPUImageHarrisCornerDetectionFilter.m ================================================ #import "GPUImageHarrisCornerDetectionFilter.h" #import "GPUImageGaussianBlurFilter.h" #import "GPUImageXYDerivativeFilter.h" #import "GPUImageGrayscaleFilter.h" #import "GPUImageThresholdedNonMaximumSuppressionFilter.h" #import "GPUImageColorPackingFilter.h" #import "GPUImageGaussianBlurFilter.h" @interface GPUImageHarrisCornerDetectionFilter() - (void)extractCornerLocationsFromImageAtFrameTime:(CMTime)frameTime; @end // This is the Harris corner detector, as described in // C. Harris and M. Stephens. A Combined Corner and Edge Detector. Proc. Alvey Vision Conf., Univ. Manchester, pp. 147-151, 1988. @implementation GPUImageHarrisCornerDetectionFilter #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageHarrisCornerDetectionFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform lowp float sensitivity; const mediump float harrisConstant = 0.04; void main() { mediump vec3 derivativeElements = texture2D(inputImageTexture, textureCoordinate).rgb; mediump float derivativeSum = derivativeElements.x + derivativeElements.y; mediump float zElement = (derivativeElements.z * 2.0) - 1.0; // R = Ix^2 * Iy^2 - Ixy * Ixy - k * (Ix^2 + Iy^2)^2 mediump float cornerness = derivativeElements.x * derivativeElements.y - (zElement * zElement) - harrisConstant * derivativeSum * derivativeSum; gl_FragColor = vec4(vec3(cornerness * sensitivity), 1.0); } ); #else NSString *const kGPUImageHarrisCornerDetectionFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform float sensitivity; const float harrisConstant = 0.04; void main() { vec3 derivativeElements = texture2D(inputImageTexture, textureCoordinate).rgb; float derivativeSum = derivativeElements.x + derivativeElements.y; float zElement = (derivativeElements.z * 2.0) - 1.0; // R = Ix^2 * Iy^2 - Ixy * Ixy - k * (Ix^2 + Iy^2)^2 float cornerness = derivativeElements.x * derivativeElements.y - (zElement * zElement) - harrisConstant * derivativeSum * derivativeSum; gl_FragColor = vec4(vec3(cornerness * sensitivity), 1.0); } ); #endif @synthesize blurRadiusInPixels; @synthesize cornersDetectedBlock; @synthesize sensitivity = _sensitivity; @synthesize threshold = _threshold; @synthesize intermediateImages = _intermediateImages; #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [self initWithCornerDetectionFragmentShader:kGPUImageHarrisCornerDetectionFragmentShaderString])) { return nil; } return self; } - (id)initWithCornerDetectionFragmentShader:(NSString *)cornerDetectionFragmentShader; { if (!(self = [super init])) { return nil; } #ifdef DEBUGFEATUREDETECTION _intermediateImages = [[NSMutableArray alloc] init]; #endif // First pass: reduce to luminance and take the derivative of the luminance texture derivativeFilter = [[GPUImageXYDerivativeFilter alloc] init]; [self addFilter:derivativeFilter]; #ifdef DEBUGFEATUREDETECTION __unsafe_unretained NSMutableArray *weakIntermediateImages = _intermediateImages; __unsafe_unretained GPUImageFilter *weakFilter = derivativeFilter; [derivativeFilter setFrameProcessingCompletionBlock:^(GPUImageOutput *filter, CMTime frameTime){ UIImage *intermediateImage = [weakFilter imageFromCurrentlyProcessedOutput]; [weakIntermediateImages addObject:intermediateImage]; }]; #endif // Second pass: blur the derivative blurFilter = [[GPUImageGaussianBlurFilter alloc] init]; [self addFilter:blurFilter]; #ifdef DEBUGFEATUREDETECTION weakFilter = blurFilter; [blurFilter setFrameProcessingCompletionBlock:^(GPUImageOutput *filter, CMTime frameTime){ UIImage *intermediateImage = [weakFilter imageFromCurrentlyProcessedOutput]; [weakIntermediateImages addObject:intermediateImage]; }]; #endif // Third pass: apply the Harris corner detection calculation harrisCornerDetectionFilter = [[GPUImageFilter alloc] initWithFragmentShaderFromString:cornerDetectionFragmentShader]; [self addFilter:harrisCornerDetectionFilter]; #ifdef DEBUGFEATUREDETECTION weakFilter = harrisCornerDetectionFilter; [harrisCornerDetectionFilter setFrameProcessingCompletionBlock:^(GPUImageOutput *filter, CMTime frameTime){ UIImage *intermediateImage = [weakFilter imageFromCurrentlyProcessedOutput]; [weakIntermediateImages addObject:intermediateImage]; }]; #endif // Fourth pass: apply non-maximum suppression and thresholding to find the local maxima nonMaximumSuppressionFilter = [[GPUImageThresholdedNonMaximumSuppressionFilter alloc] init]; [self addFilter:nonMaximumSuppressionFilter]; __unsafe_unretained GPUImageHarrisCornerDetectionFilter *weakSelf = self; #ifdef DEBUGFEATUREDETECTION weakFilter = nonMaximumSuppressionFilter; [nonMaximumSuppressionFilter setFrameProcessingCompletionBlock:^(GPUImageOutput *filter, CMTime frameTime){ UIImage *intermediateImage = [weakFilter imageFromCurrentlyProcessedOutput]; [weakIntermediateImages addObject:intermediateImage]; [weakSelf extractCornerLocationsFromImageAtFrameTime:frameTime]; }]; #else [nonMaximumSuppressionFilter setFrameProcessingCompletionBlock:^(GPUImageOutput *filter, CMTime frameTime) { [weakSelf extractCornerLocationsFromImageAtFrameTime:frameTime]; }]; #endif // Sixth pass: compress the thresholded points into the RGBA channels // colorPackingFilter = [[GPUImageColorPackingFilter alloc] init]; // [self addFilter:colorPackingFilter]; // // //#ifdef DEBUGFEATUREDETECTION // __unsafe_unretained GPUImageHarrisCornerDetectionFilter *weakSelf = self; // weakFilter = colorPackingFilter; // [colorPackingFilter setFrameProcessingCompletionBlock:^(GPUImageOutput *filter, CMTime frameTime){ // NSLog(@"Triggered response from compaction filter"); // // UIImage *intermediateImage = [weakFilter imageFromCurrentlyProcessedOutput]; // [weakIntermediateImages addObject:intermediateImage]; // // [weakSelf extractCornerLocationsFromImageAtFrameTime:frameTime]; // }]; //#else // __unsafe_unretained GPUImageHarrisCornerDetectionFilter *weakSelf = self; // [colorPackingFilter setFrameProcessingCompletionBlock:^(GPUImageOutput *filter, CMTime frameTime) { // [weakSelf extractCornerLocationsFromImageAtFrameTime:frameTime]; // }]; //#endif [derivativeFilter addTarget:blurFilter]; [blurFilter addTarget:harrisCornerDetectionFilter]; [harrisCornerDetectionFilter addTarget:nonMaximumSuppressionFilter]; // [simpleThresholdFilter addTarget:colorPackingFilter]; self.initialFilters = [NSArray arrayWithObjects:derivativeFilter, nil]; // self.terminalFilter = colorPackingFilter; self.terminalFilter = nonMaximumSuppressionFilter; self.blurRadiusInPixels = 2.0; self.sensitivity = 5.0; self.threshold = 0.20; return self; } - (void)dealloc; { free(rawImagePixels); free(cornersArray); } #pragma mark - #pragma mark Corner extraction - (void)extractCornerLocationsFromImageAtFrameTime:(CMTime)frameTime; { // we need a normal color texture for this filter NSAssert(self.outputTextureOptions.internalFormat == GL_RGBA, @"The output texture format for this filter must be GL_RGBA."); NSAssert(self.outputTextureOptions.type == GL_UNSIGNED_BYTE, @"The type of the output texture of this filter must be GL_UNSIGNED_BYTE."); NSUInteger numberOfCorners = 0; CGSize imageSize = nonMaximumSuppressionFilter.outputFrameSize; unsigned int imageByteSize = imageSize.width * imageSize.height * 4; if (rawImagePixels == NULL) { rawImagePixels = (GLubyte *)malloc(imageByteSize); cornersArray = calloc(512 * 2, sizeof(GLfloat)); } glReadPixels(0, 0, (int)imageSize.width, (int)imageSize.height, GL_RGBA, GL_UNSIGNED_BYTE, rawImagePixels); CFAbsoluteTime startTime = CFAbsoluteTimeGetCurrent(); unsigned int imageWidth = imageSize.width * 4; unsigned int currentByte = 0; unsigned int cornerStorageIndex = 0; while (currentByte < imageByteSize) { GLubyte colorByte = rawImagePixels[currentByte]; if (colorByte > 0) { unsigned int xCoordinate = currentByte % imageWidth; unsigned int yCoordinate = currentByte / imageWidth; cornersArray[cornerStorageIndex++] = (CGFloat)(xCoordinate / 4) / imageSize.width; cornersArray[cornerStorageIndex++] = (CGFloat)(yCoordinate) / imageSize.height; numberOfCorners++; numberOfCorners = MIN(numberOfCorners, 511); cornerStorageIndex = MIN(cornerStorageIndex, 1021); } currentByte +=4; } CFAbsoluteTime currentFrameTime = (CFAbsoluteTimeGetCurrent() - startTime); NSLog(@"Processing time : %f ms", 1000.0 * currentFrameTime); if (cornersDetectedBlock != NULL) { cornersDetectedBlock(cornersArray, numberOfCorners, frameTime); } } - (BOOL)wantsMonochromeInput; { // return YES; return NO; } #pragma mark - #pragma mark Accessors - (void)setBlurRadiusInPixels:(CGFloat)newValue; { blurFilter.blurRadiusInPixels = newValue; } - (CGFloat)blurRadiusInPixels; { return blurFilter.blurRadiusInPixels; } - (void)setSensitivity:(CGFloat)newValue; { _sensitivity = newValue; [harrisCornerDetectionFilter setFloat:newValue forUniformName:@"sensitivity"]; } - (void)setThreshold:(CGFloat)newValue; { nonMaximumSuppressionFilter.threshold = newValue; } - (CGFloat)threshold; { return nonMaximumSuppressionFilter.threshold; } @end ================================================ FILE: framework/Source/GPUImageHazeFilter.h ================================================ #import "GPUImageFilter.h" /* * The haze filter can be used to add or remove haze (similar to a UV filter) * * @author Alaric Cole * @creationDate 03/10/12 * */ /** The haze filter can be used to add or remove haze This is similar to a UV filter */ @interface GPUImageHazeFilter : GPUImageFilter { GLint distanceUniform; GLint slopeUniform; } /** Strength of the color applied. Default 0. Values between -.3 and .3 are best */ @property(readwrite, nonatomic) CGFloat distance; /** Amount of color change. Default 0. Values between -.3 and .3 are best */ @property(readwrite, nonatomic) CGFloat slope; @end ================================================ FILE: framework/Source/GPUImageHazeFilter.m ================================================ #import "GPUImageHazeFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageHazeFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform lowp float hazeDistance; uniform highp float slope; void main() { //todo reconsider precision modifiers highp vec4 color = vec4(1.0);//todo reimplement as a parameter highp float d = textureCoordinate.y * slope + hazeDistance; highp vec4 c = texture2D(inputImageTexture, textureCoordinate) ; // consider using unpremultiply c = (c - d * color) / (1.0 -d); gl_FragColor = c; //consider using premultiply(c); } ); #else NSString *const kGPUImageHazeFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform float hazeDistance; uniform float slope; void main() { //todo reconsider precision modifiers vec4 color = vec4(1.0);//todo reimplement as a parameter float d = textureCoordinate.y * slope + hazeDistance; vec4 c = texture2D(inputImageTexture, textureCoordinate) ; // consider using unpremultiply c = (c - d * color) / (1.0 -d); gl_FragColor = c; //consider using premultiply(c); } ); #endif @implementation GPUImageHazeFilter @synthesize distance = _distance; @synthesize slope = _slope; #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageHazeFragmentShaderString])) { return nil; } distanceUniform = [filterProgram uniformIndex:@"hazeDistance"]; slopeUniform = [filterProgram uniformIndex:@"slope"]; self.distance = 0.2; self.slope = 0.0; return self; } #pragma mark - #pragma mark Accessors - (void)setDistance:(CGFloat)newValue; { _distance = newValue; [self setFloat:_distance forUniform:distanceUniform program:filterProgram]; } - (void)setSlope:(CGFloat)newValue; { _slope = newValue; [self setFloat:_slope forUniform:slopeUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImageHighPassFilter.h ================================================ #import "GPUImageFilterGroup.h" #import "GPUImageLowPassFilter.h" #import "GPUImageDifferenceBlendFilter.h" @interface GPUImageHighPassFilter : GPUImageFilterGroup { GPUImageLowPassFilter *lowPassFilter; GPUImageDifferenceBlendFilter *differenceBlendFilter; } // This controls the degree by which the previous accumulated frames are blended and then subtracted from the current one. This ranges from 0.0 to 1.0, with a default of 0.5. @property(readwrite, nonatomic) CGFloat filterStrength; @end ================================================ FILE: framework/Source/GPUImageHighPassFilter.m ================================================ #import "GPUImageHighPassFilter.h" @implementation GPUImageHighPassFilter @synthesize filterStrength; - (id)init; { if (!(self = [super init])) { return nil; } // Start with a low pass filter to define the component to be removed lowPassFilter = [[GPUImageLowPassFilter alloc] init]; [self addFilter:lowPassFilter]; // Take the difference of the current frame from the low pass filtered result to get the high pass differenceBlendFilter = [[GPUImageDifferenceBlendFilter alloc] init]; [self addFilter:differenceBlendFilter]; // Texture location 0 needs to be the original image for the difference blend [lowPassFilter addTarget:differenceBlendFilter atTextureLocation:1]; self.initialFilters = [NSArray arrayWithObjects:lowPassFilter, differenceBlendFilter, nil]; self.terminalFilter = differenceBlendFilter; self.filterStrength = 0.5; return self; } #pragma mark - #pragma mark Accessors - (void)setFilterStrength:(CGFloat)newValue; { lowPassFilter.filterStrength = newValue; } - (CGFloat)filterStrength; { return lowPassFilter.filterStrength; } @end ================================================ FILE: framework/Source/GPUImageHighlightShadowFilter.h ================================================ #import "GPUImageFilter.h" @interface GPUImageHighlightShadowFilter : GPUImageFilter { GLint shadowsUniform, highlightsUniform; } /** * 0 - 1, increase to lighten shadows. * @default 0 */ @property(readwrite, nonatomic) CGFloat shadows; /** * 0 - 1, decrease to darken highlights. * @default 1 */ @property(readwrite, nonatomic) CGFloat highlights; @end ================================================ FILE: framework/Source/GPUImageHighlightShadowFilter.m ================================================ #import "GPUImageHighlightShadowFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageHighlightShadowFragmentShaderString = SHADER_STRING ( uniform sampler2D inputImageTexture; varying highp vec2 textureCoordinate; uniform lowp float shadows; uniform lowp float highlights; const mediump vec3 luminanceWeighting = vec3(0.3, 0.3, 0.3); void main() { lowp vec4 source = texture2D(inputImageTexture, textureCoordinate); mediump float luminance = dot(source.rgb, luminanceWeighting); mediump float shadow = clamp((pow(luminance, 1.0/(shadows+1.0)) + (-0.76)*pow(luminance, 2.0/(shadows+1.0))) - luminance, 0.0, 1.0); mediump float highlight = clamp((1.0 - (pow(1.0-luminance, 1.0/(2.0-highlights)) + (-0.8)*pow(1.0-luminance, 2.0/(2.0-highlights)))) - luminance, -1.0, 0.0); lowp vec3 result = vec3(0.0, 0.0, 0.0) + ((luminance + shadow + highlight) - 0.0) * ((source.rgb - vec3(0.0, 0.0, 0.0))/(luminance - 0.0)); gl_FragColor = vec4(result.rgb, source.a); } ); #else NSString *const kGPUImageHighlightShadowFragmentShaderString = SHADER_STRING ( uniform sampler2D inputImageTexture; varying vec2 textureCoordinate; uniform float shadows; uniform float highlights; const vec3 luminanceWeighting = vec3(0.3, 0.3, 0.3); void main() { vec4 source = texture2D(inputImageTexture, textureCoordinate); float luminance = dot(source.rgb, luminanceWeighting); float shadow = clamp((pow(luminance, 1.0/(shadows+1.0)) + (-0.76)*pow(luminance, 2.0/(shadows+1.0))) - luminance, 0.0, 1.0); float highlight = clamp((1.0 - (pow(1.0-luminance, 1.0/(2.0-highlights)) + (-0.8)*pow(1.0-luminance, 2.0/(2.0-highlights)))) - luminance, -1.0, 0.0); vec3 result = vec3(0.0, 0.0, 0.0) + ((luminance + shadow + highlight) - 0.0) * ((source.rgb - vec3(0.0, 0.0, 0.0))/(luminance - 0.0)); gl_FragColor = vec4(result.rgb, source.a); } ); #endif @implementation GPUImageHighlightShadowFilter @synthesize shadows = _shadows; @synthesize highlights = _highlights; #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageHighlightShadowFragmentShaderString])) { return nil; } shadowsUniform = [filterProgram uniformIndex:@"shadows"]; highlightsUniform = [filterProgram uniformIndex:@"highlights"]; self.shadows = 0.0; self.highlights = 1.0; return self; } #pragma mark - #pragma mark Accessors - (void)setShadows:(CGFloat)newValue; { _shadows = newValue; [self setFloat:_shadows forUniform:shadowsUniform program:filterProgram]; } - (void)setHighlights:(CGFloat)newValue; { _highlights = newValue; [self setFloat:_highlights forUniform:highlightsUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImageHighlightShadowTintFilter.h ================================================ // // GPUImageHighlightShadowTintFilter.h // // // Created by github.com/r3mus on 8/14/15. // // #import "GPUImageFilter.h" @interface GPUImageHighlightShadowTintFilter : GPUImageFilter { GLint shadowTintIntensityUniform, highlightTintIntensityUniform, shadowTintColorUniform, highlightTintColorUniform; } // The shadowTint and highlightTint colors specify what colors replace the dark and light areas of the image, respectively. The defaults for shadows are black, highlighs white. @property(readwrite, nonatomic) GLfloat shadowTintIntensity; @property(readwrite, nonatomic) GPUVector4 shadowTintColor; @property(readwrite, nonatomic) GLfloat highlightTintIntensity; @property(readwrite, nonatomic) GPUVector4 highlightTintColor; - (void)setShadowTintColorRed:(GLfloat)redComponent green:(GLfloat)greenComponent blue:(GLfloat)blueComponent alpha:(GLfloat)alphaComponent; - (void)setHighlightTintColorRed:(GLfloat)redComponent green:(GLfloat)greenComponent blue:(GLfloat)blueComponent alpha:(GLfloat)alphaComponent; @end ================================================ FILE: framework/Source/GPUImageHighlightShadowTintFilter.m ================================================ // // GPUImageHighlightShadowTintFilter.m // // Created by github.com/r3mus on 8/14/15. // // #import "GPUImageHighlightShadowTintFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUHighlightShadowTintFragmentShaderString = SHADER_STRING ( precision lowp float; varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform lowp float shadowTintIntensity; uniform lowp float highlightTintIntensity; uniform highp vec4 shadowTintColor; uniform highp vec4 highlightTintColor; const mediump vec3 luminanceWeighting = vec3(0.2125, 0.7154, 0.0721); void main() { lowp vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); highp float luminance = dot(textureColor.rgb, luminanceWeighting); highp vec4 shadowResult = mix(textureColor, max(textureColor, vec4( mix(shadowTintColor.rgb, textureColor.rgb, luminance), textureColor.a)), shadowTintIntensity); highp vec4 highlightResult = mix(textureColor, min(shadowResult, vec4( mix(shadowResult.rgb, highlightTintColor.rgb, luminance), textureColor.a)), highlightTintIntensity); gl_FragColor = vec4( mix(shadowResult.rgb, highlightResult.rgb, luminance), textureColor.a); } ); #else NSString *const kGPUHighlightShadowTintFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform float shadowTintIntensity; uniform float highlightTintIntensity; uniform vec3 shadowTintColor; uniform vec3 highlightTintColor; const vec3 luminanceWeighting = vec3(0.2125, 0.7154, 0.0721); void main() { vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); float luminance = dot(textureColor.rgb, luminanceWeighting); vec4 shadowResult = mix(textureColor, max(textureColor, vec4( mix(shadowTintColor.rgb, textureColor.rgb, luminance), textureColor.a)), shadowTintIntensity); vec4 highlightResult = mix(textureColor, min(shadowResult, vec4( mix(shadowResult.rgb, highlightTintColor.rgb, luminance), textureColor.a)), highlightTintIntensity); gl_FragColor = vec4( mix(shadowResult.rgb, highlightResult.rgb, luminance), textureColor.a); } ); #endif @implementation GPUImageHighlightShadowTintFilter @synthesize shadowTintIntensity = _shadowTintIntensity; @synthesize highlightTintIntensity = _highlightTintIntensity; @synthesize shadowTintColor = _shadowTintColor; @synthesize highlightTintColor = _highlightTintColor; - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUHighlightShadowTintFragmentShaderString])) { return nil; } shadowTintIntensityUniform = [filterProgram uniformIndex:@"shadowTintIntensity"]; highlightTintIntensityUniform = [filterProgram uniformIndex:@"highlightTintIntensity"]; shadowTintColorUniform = [filterProgram uniformIndex:@"shadowTintColor"]; highlightTintColorUniform = [filterProgram uniformIndex:@"highlightTintColor"]; self.shadowTintIntensity = 0.0f; self.highlightTintIntensity = 0.0f; self.shadowTintColor = (GPUVector4){1.0f, 0.0f, 0.0f, 1.0f}; self.highlightTintColor = (GPUVector4){0.0f, 0.0f, 1.0f, 1.0f}; return self; } #pragma mark - #pragma mark Accessors - (void)setShadowTintIntensity:(GLfloat)newValue { _shadowTintIntensity = newValue; [self setFloat:_shadowTintIntensity forUniform:shadowTintIntensityUniform program:filterProgram]; } - (void)setHighlightTintIntensity:(GLfloat)newValue { _highlightTintIntensity = newValue; [self setFloat:_highlightTintIntensity forUniform:highlightTintIntensityUniform program:filterProgram]; } - (void)setShadowTintColor:(GPUVector4)newValue; { _shadowTintColor = newValue; [self setShadowTintColorRed:_shadowTintColor.one green:_shadowTintColor.two blue:_shadowTintColor.three alpha:_shadowTintColor.four]; } - (void)setHighlightTintColor:(GPUVector4)newValue; { _highlightTintColor = newValue; [self setHighlightTintColorRed:_highlightTintColor.one green:_highlightTintColor.two blue:_highlightTintColor.three alpha:_highlightTintColor.four]; } - (void)setShadowTintColorRed:(GLfloat)redComponent green:(GLfloat)greenComponent blue:(GLfloat)blueComponent alpha:(GLfloat)alphaComponent; { GPUVector4 shadowTintColor = {redComponent, greenComponent, blueComponent, alphaComponent}; [self setVec4:shadowTintColor forUniform:shadowTintColorUniform program:filterProgram]; } - (void)setHighlightTintColorRed:(GLfloat)redComponent green:(GLfloat)greenComponent blue:(GLfloat)blueComponent alpha:(GLfloat)alphaComponent; { GPUVector4 highlightTintColor = {redComponent, greenComponent, blueComponent, alphaComponent}; [self setVec4:highlightTintColor forUniform:highlightTintColorUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImageHistogramEqualizationFilter.h ================================================ // // GPUImageHistogramEqualizationFilter.h // FilterShowcase // // Created by Adam Marcus on 19/08/2014. // Copyright (c) 2014 Sunset Lake Software LLC. All rights reserved. // #import "GPUImageFilterGroup.h" #import "GPUImageHistogramFilter.h" #import "GPUImageRawDataOutput.h" #import "GPUImageRawDataInput.h" #import "GPUImageTwoInputFilter.h" @interface GPUImageHistogramEqualizationFilter : GPUImageFilterGroup { GPUImageHistogramFilter *histogramFilter; GPUImageRawDataOutput *rawDataOutputFilter; GPUImageRawDataInput *rawDataInputFilter; } @property(readwrite, nonatomic) NSUInteger downsamplingFactor; - (id)initWithHistogramType:(GPUImageHistogramType)newHistogramType; @end ================================================ FILE: framework/Source/GPUImageHistogramEqualizationFilter.m ================================================ // // GPUImageHistogramEqualizationFilter.m // FilterShowcase // // Created by Adam Marcus on 19/08/2014. // Copyright (c) 2014 Sunset Lake Software LLC. All rights reserved. // #import "GPUImageHistogramEqualizationFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageRedHistogramEqualizationFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; void main() { lowp vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); lowp float redCurveValue = texture2D(inputImageTexture2, vec2(textureColor.r, 0.0)).r; gl_FragColor = vec4(redCurveValue, textureColor.g, textureColor.b, textureColor.a); } ); #else NSString *const kGPUImageRedHistogramEqualizationFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; void main() { vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); float redCurveValue = texture2D(inputImageTexture2, vec2(textureColor.r, 0.0)).r; gl_FragColor = vec4(redCurveValue, textureColor.g, textureColor.b, textureColor.a); } ); #endif #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageGreenHistogramEqualizationFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; void main() { lowp vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); lowp float greenCurveValue = texture2D(inputImageTexture2, vec2(textureColor.g, 0.0)).g; gl_FragColor = vec4(textureColor.r, greenCurveValue, textureColor.b, textureColor.a); } ); #else NSString *const kGPUImageGreenHistogramEqualizationFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; void main() { vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); float greenCurveValue = texture2D(inputImageTexture2, vec2(textureColor.g, 0.0)).g; gl_FragColor = vec4(textureColor.r, greenCurveValue, textureColor.b, textureColor.a); } ); #endif #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageBlueHistogramEqualizationFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; void main() { lowp vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); lowp float blueCurveValue = texture2D(inputImageTexture2, vec2(textureColor.b, 0.0)).b; gl_FragColor = vec4(textureColor.r, textureColor.g, blueCurveValue, textureColor.a); } ); #else NSString *const kGPUImageBlueHistogramEqualizationFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; void main() { vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); float blueCurveValue = texture2D(inputImageTexture2, vec2(textureColor.b, 0.0)).b; gl_FragColor = vec4(textureColor.r, textureColor.g, blueCurveValue, textureColor.a); } ); #endif #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageRGBHistogramEqualizationFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; void main() { lowp vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); lowp float redCurveValue = texture2D(inputImageTexture2, vec2(textureColor.r, 0.0)).r; lowp float greenCurveValue = texture2D(inputImageTexture2, vec2(textureColor.g, 0.0)).g; lowp float blueCurveValue = texture2D(inputImageTexture2, vec2(textureColor.b, 0.0)).b; gl_FragColor = vec4(redCurveValue, greenCurveValue, blueCurveValue, textureColor.a); } ); #else NSString *const kGPUImageRGBHistogramEqualizationFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; void main() { vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); float redCurveValue = texture2D(inputImageTexture2, vec2(textureColor.r, 0.0)).r; float greenCurveValue = texture2D(inputImageTexture2, vec2(textureColor.g, 0.0)).g; float blueCurveValue = texture2D(inputImageTexture2, vec2(textureColor.b, 0.0)).b; gl_FragColor = vec4(redCurveValue, greenCurveValue, blueCurveValue, textureColor.a); } ); #endif #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageLuminanceHistogramEqualizationFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; const lowp vec3 W = vec3(0.2125, 0.7154, 0.0721); void main() { lowp vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); lowp float luminance = dot(textureColor.rgb, W); lowp float newLuminance = texture2D(inputImageTexture2, vec2(luminance, 0.0)).r; lowp float deltaLuminance = newLuminance - luminance; lowp float red = clamp(textureColor.r + deltaLuminance, 0.0, 1.0); lowp float green = clamp(textureColor.g + deltaLuminance, 0.0, 1.0); lowp float blue = clamp(textureColor.b + deltaLuminance, 0.0, 1.0); gl_FragColor = vec4(red, green, blue, textureColor.a); } ); #else NSString *const kGPUImageLuminanceHistogramEqualizationFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; const vec3 W = vec3(0.2125, 0.7154, 0.0721); void main() { vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); float luminance = dot(textureColor.rgb, W); float newLuminance = texture2D(inputImageTexture2, vec2(luminance, 0.0)).r; float deltaLuminance = newLuminance - luminance; float red = clamp(textureColor.r + deltaLuminance, 0.0, 1.0); float green = clamp(textureColor.g + deltaLuminance, 0.0, 1.0); float blue = clamp(textureColor.b + deltaLuminance, 0.0, 1.0); gl_FragColor = vec4(red, green, blue, textureColor.a); } ); #endif @implementation GPUImageHistogramEqualizationFilter @synthesize downsamplingFactor = _downsamplingFactor; #pragma mark - #pragma mark Initialization - (id)init; { if (!(self = [self initWithHistogramType:kGPUImageHistogramRGB])) { return nil; } return self; } - (id)initWithHistogramType:(GPUImageHistogramType)newHistogramType { if (!(self = [super init])) { return nil; } histogramFilter = [[GPUImageHistogramFilter alloc] initWithHistogramType:newHistogramType]; [self addFilter:histogramFilter]; GLubyte dummyInput[4 * 256]; // NB: No way to initialise GPUImageRawDataInput without providing bytes rawDataInputFilter = [[GPUImageRawDataInput alloc] initWithBytes:dummyInput size:CGSizeMake(256.0, 1.0) pixelFormat:GPUPixelFormatBGRA type:GPUPixelTypeUByte]; rawDataOutputFilter = [[GPUImageRawDataOutput alloc] initWithImageSize:CGSizeMake(256.0, 3.0) resultsInBGRAFormat:YES]; __unsafe_unretained GPUImageRawDataOutput *_rawDataOutputFilter = rawDataOutputFilter; __unsafe_unretained GPUImageRawDataInput *_rawDataInputFilter = rawDataInputFilter; [rawDataOutputFilter setNewFrameAvailableBlock:^{ unsigned int histogramBins[3][256]; [_rawDataOutputFilter lockFramebufferForReading]; GLubyte *data = [_rawDataOutputFilter rawBytesForImage]; data += [_rawDataOutputFilter bytesPerRowInOutput]; histogramBins[0][0] = *data++; histogramBins[1][0] = *data++; histogramBins[2][0] = *data++; data++; for (unsigned int x = 1; x < 256; x++) { histogramBins[0][x] = histogramBins[0][x-1] + *data++; histogramBins[1][x] = histogramBins[1][x-1] + *data++; histogramBins[2][x] = histogramBins[2][x-1] + *data++; data++; } [_rawDataOutputFilter unlockFramebufferAfterReading]; GLubyte colorMapping[4 * 256]; GLubyte *_colorMapping = colorMapping; for (unsigned int x = 0; x < 256; x++) { *_colorMapping++ = (GLubyte) (((histogramBins[0][x] - histogramBins[0][0]) * 255) / histogramBins[0][255]); *_colorMapping++ = (GLubyte) (((histogramBins[1][x] - histogramBins[1][0]) * 255) / histogramBins[1][255]); *_colorMapping++ = (GLubyte) (((histogramBins[2][x] - histogramBins[2][0]) * 255) / histogramBins[2][255]); *_colorMapping++ = 255; } _colorMapping = colorMapping; [_rawDataInputFilter updateDataFromBytes:_colorMapping size:CGSizeMake(256.0, 1.0)]; [_rawDataInputFilter processData]; }]; [histogramFilter addTarget:rawDataOutputFilter]; NSString *fragmentShader = nil; switch (newHistogramType) { case kGPUImageHistogramRed: fragmentShader = kGPUImageRedHistogramEqualizationFragmentShaderString; break; case kGPUImageHistogramGreen: fragmentShader = kGPUImageGreenHistogramEqualizationFragmentShaderString; break; case kGPUImageHistogramBlue: fragmentShader = kGPUImageBlueHistogramEqualizationFragmentShaderString; break; default: case kGPUImageHistogramRGB: fragmentShader = kGPUImageRGBHistogramEqualizationFragmentShaderString; break; case kGPUImageHistogramLuminance: fragmentShader = kGPUImageLuminanceHistogramEqualizationFragmentShaderString; break; } GPUImageFilter *equalizationFilter = [[GPUImageTwoInputFilter alloc] initWithFragmentShaderFromString:fragmentShader]; [rawDataInputFilter addTarget:equalizationFilter atTextureLocation:1]; [self addFilter:equalizationFilter]; self.initialFilters = [NSArray arrayWithObjects:histogramFilter, equalizationFilter, nil]; self.terminalFilter = equalizationFilter; self.downsamplingFactor = 16; return self; } #pragma mark - #pragma mark Accessors - (void)setDownsamplingFactor:(NSUInteger)newValue; { if (_downsamplingFactor != newValue) { _downsamplingFactor = newValue; histogramFilter.downsamplingFactor = newValue; } } @end ================================================ FILE: framework/Source/GPUImageHistogramFilter.h ================================================ #import "GPUImageFilter.h" typedef enum { kGPUImageHistogramRed, kGPUImageHistogramGreen, kGPUImageHistogramBlue, kGPUImageHistogramRGB, kGPUImageHistogramLuminance} GPUImageHistogramType; @interface GPUImageHistogramFilter : GPUImageFilter { GPUImageHistogramType histogramType; GLubyte *vertexSamplingCoordinates; GLProgram *secondFilterProgram, *thirdFilterProgram; GLint secondFilterPositionAttribute, thirdFilterPositionAttribute; } // Rather than sampling every pixel, this dictates what fraction of the image is sampled. By default, this is 16 with a minimum of 1. @property(readwrite, nonatomic) NSUInteger downsamplingFactor; // Initialization and teardown - (id)initWithHistogramType:(GPUImageHistogramType)newHistogramType; - (void)initializeSecondaryAttributes; @end ================================================ FILE: framework/Source/GPUImageHistogramFilter.m ================================================ #import "GPUImageHistogramFilter.h" // Unlike other filters, this one uses a grid of GL_POINTs to sample the incoming image in a grid. A custom vertex shader reads the color in the texture at its position // and outputs a bin position in the final histogram as the vertex position. That point is then written into the image of the histogram using translucent pixels. // The degree of translucency is controlled by the scalingFactor, which lets you adjust the dynamic range of the histogram. The histogram can only be generated for one // color channel or luminance value at a time. // // This is based on this implementation: http://www.shaderwrangler.com/publications/histogram/histogram_cameraready.pdf // // Or at least that's how it would work if iOS could read from textures in a vertex shader, which it can't. Therefore, I read the texture data down from the // incoming frame and process the texture colors as vertices. NSString *const kGPUImageRedHistogramSamplingVertexShaderString = SHADER_STRING ( attribute vec4 position; varying vec3 colorFactor; void main() { colorFactor = vec3(1.0, 0.0, 0.0); gl_Position = vec4(-1.0 + (position.x * 0.0078125), 0.0, 0.0, 1.0); gl_PointSize = 1.0; } ); NSString *const kGPUImageGreenHistogramSamplingVertexShaderString = SHADER_STRING ( attribute vec4 position; varying vec3 colorFactor; void main() { colorFactor = vec3(0.0, 1.0, 0.0); gl_Position = vec4(-1.0 + (position.y * 0.0078125), 0.0, 0.0, 1.0); gl_PointSize = 1.0; } ); NSString *const kGPUImageBlueHistogramSamplingVertexShaderString = SHADER_STRING ( attribute vec4 position; varying vec3 colorFactor; void main() { colorFactor = vec3(0.0, 0.0, 1.0); gl_Position = vec4(-1.0 + (position.z * 0.0078125), 0.0, 0.0, 1.0); gl_PointSize = 1.0; } ); NSString *const kGPUImageLuminanceHistogramSamplingVertexShaderString = SHADER_STRING ( attribute vec4 position; varying vec3 colorFactor; const vec3 W = vec3(0.2125, 0.7154, 0.0721); void main() { float luminance = dot(position.xyz, W); colorFactor = vec3(1.0, 1.0, 1.0); gl_Position = vec4(-1.0 + (luminance * 0.0078125), 0.0, 0.0, 1.0); gl_PointSize = 1.0; } ); #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageHistogramAccumulationFragmentShaderString = SHADER_STRING ( const lowp float scalingFactor = 1.0 / 256.0; varying lowp vec3 colorFactor; void main() { gl_FragColor = vec4(colorFactor * scalingFactor , 1.0); } ); #else NSString *const kGPUImageHistogramAccumulationFragmentShaderString = SHADER_STRING ( const float scalingFactor = 1.0 / 256.0; varying vec3 colorFactor; void main() { gl_FragColor = vec4(colorFactor * scalingFactor , 1.0); } ); #endif @implementation GPUImageHistogramFilter @synthesize downsamplingFactor = _downsamplingFactor; #pragma mark - #pragma mark Initialization and teardown - (id)initWithHistogramType:(GPUImageHistogramType)newHistogramType; { switch (newHistogramType) { case kGPUImageHistogramRed: { if (!(self = [super initWithVertexShaderFromString:kGPUImageRedHistogramSamplingVertexShaderString fragmentShaderFromString:kGPUImageHistogramAccumulationFragmentShaderString])) { return nil; } }; break; case kGPUImageHistogramGreen: { if (!(self = [super initWithVertexShaderFromString:kGPUImageGreenHistogramSamplingVertexShaderString fragmentShaderFromString:kGPUImageHistogramAccumulationFragmentShaderString])) { return nil; } }; break; case kGPUImageHistogramBlue: { if (!(self = [super initWithVertexShaderFromString:kGPUImageBlueHistogramSamplingVertexShaderString fragmentShaderFromString:kGPUImageHistogramAccumulationFragmentShaderString])) { return nil; } }; break; case kGPUImageHistogramLuminance: { if (!(self = [super initWithVertexShaderFromString:kGPUImageLuminanceHistogramSamplingVertexShaderString fragmentShaderFromString:kGPUImageHistogramAccumulationFragmentShaderString])) { return nil; } }; break; case kGPUImageHistogramRGB: { if (!(self = [super initWithVertexShaderFromString:kGPUImageRedHistogramSamplingVertexShaderString fragmentShaderFromString:kGPUImageHistogramAccumulationFragmentShaderString])) { return nil; } runSynchronouslyOnVideoProcessingQueue(^{ [GPUImageContext useImageProcessingContext]; secondFilterProgram = [[GPUImageContext sharedImageProcessingContext] programForVertexShaderString:kGPUImageGreenHistogramSamplingVertexShaderString fragmentShaderString:kGPUImageHistogramAccumulationFragmentShaderString]; thirdFilterProgram = [[GPUImageContext sharedImageProcessingContext] programForVertexShaderString:kGPUImageBlueHistogramSamplingVertexShaderString fragmentShaderString:kGPUImageHistogramAccumulationFragmentShaderString]; if (!secondFilterProgram.initialized) { [self initializeSecondaryAttributes]; if (![secondFilterProgram link]) { NSString *progLog = [secondFilterProgram programLog]; NSLog(@"Program link log: %@", progLog); NSString *fragLog = [secondFilterProgram fragmentShaderLog]; NSLog(@"Fragment shader compile log: %@", fragLog); NSString *vertLog = [secondFilterProgram vertexShaderLog]; NSLog(@"Vertex shader compile log: %@", vertLog); filterProgram = nil; NSAssert(NO, @"Filter shader link failed"); } [GPUImageContext setActiveShaderProgram:secondFilterProgram]; glEnableVertexAttribArray(secondFilterPositionAttribute); if (![thirdFilterProgram link]) { NSString *progLog = [secondFilterProgram programLog]; NSLog(@"Program link log: %@", progLog); NSString *fragLog = [secondFilterProgram fragmentShaderLog]; NSLog(@"Fragment shader compile log: %@", fragLog); NSString *vertLog = [secondFilterProgram vertexShaderLog]; NSLog(@"Vertex shader compile log: %@", vertLog); filterProgram = nil; NSAssert(NO, @"Filter shader link failed"); } } secondFilterPositionAttribute = [secondFilterProgram attributeIndex:@"position"]; thirdFilterPositionAttribute = [thirdFilterProgram attributeIndex:@"position"]; [GPUImageContext setActiveShaderProgram:thirdFilterProgram]; glEnableVertexAttribArray(thirdFilterPositionAttribute); }); }; break; } histogramType = newHistogramType; self.downsamplingFactor = 16; return self; } - (id)init; { if (!(self = [self initWithHistogramType:kGPUImageHistogramRGB])) { return nil; } return self; } - (void)initializeSecondaryAttributes; { [secondFilterProgram addAttribute:@"position"]; [thirdFilterProgram addAttribute:@"position"]; } - (void)dealloc; { if (vertexSamplingCoordinates != NULL && ![GPUImageContext supportsFastTextureUpload]) { free(vertexSamplingCoordinates); } } #pragma mark - #pragma mark Rendering - (CGSize)sizeOfFBO; { return CGSizeMake(256.0, 3.0); } - (void)newFrameReadyAtTime:(CMTime)frameTime atIndex:(NSInteger)textureIndex; { [self renderToTextureWithVertices:NULL textureCoordinates:NULL]; [self informTargetsAboutNewFrameAtTime:frameTime]; } - (CGSize)outputFrameSize; { return [self sizeOfFBO]; } - (void)setInputSize:(CGSize)newSize atIndex:(NSInteger)textureIndex; { if (self.preventRendering) { return; } inputTextureSize = newSize; } - (void)setInputRotation:(GPUImageRotationMode)newInputRotation atIndex:(NSInteger)textureIndex; { inputRotation = kGPUImageNoRotation; } - (void)renderToTextureWithVertices:(const GLfloat *)vertices textureCoordinates:(const GLfloat *)textureCoordinates; { // we need a normal color texture for this filter NSAssert(self.outputTextureOptions.internalFormat == GL_RGBA, @"The output texture format for this filter must be GL_RGBA."); NSAssert(self.outputTextureOptions.type == GL_UNSIGNED_BYTE, @"The type of the output texture of this filter must be GL_UNSIGNED_BYTE."); if (self.preventRendering) { [firstInputFramebuffer unlock]; return; } [GPUImageContext useImageProcessingContext]; if ([GPUImageContext supportsFastTextureUpload]) { glFinish(); vertexSamplingCoordinates = [firstInputFramebuffer byteBuffer]; } else { if (vertexSamplingCoordinates == NULL) { vertexSamplingCoordinates = calloc(inputTextureSize.width * inputTextureSize.height * 4, sizeof(GLubyte)); } glReadPixels(0, 0, inputTextureSize.width, inputTextureSize.height, GL_RGBA, GL_UNSIGNED_BYTE, vertexSamplingCoordinates); } outputFramebuffer = [[GPUImageContext sharedFramebufferCache] fetchFramebufferForSize:[self sizeOfFBO] textureOptions:self.outputTextureOptions onlyTexture:NO]; [outputFramebuffer activateFramebuffer]; if (usingNextFrameForImageCapture) { [outputFramebuffer lock]; } [GPUImageContext setActiveShaderProgram:filterProgram]; glClearColor(0.0, 0.0, 0.0, 1.0); glClear(GL_COLOR_BUFFER_BIT); glBlendEquation(GL_FUNC_ADD); glBlendFunc(GL_ONE, GL_ONE); glEnable(GL_BLEND); glVertexAttribPointer(filterPositionAttribute, 4, GL_UNSIGNED_BYTE, 0, ((unsigned int)_downsamplingFactor - 1) * 4, vertexSamplingCoordinates); glDrawArrays(GL_POINTS, 0, inputTextureSize.width * inputTextureSize.height / (CGFloat)_downsamplingFactor); if (histogramType == kGPUImageHistogramRGB) { [GPUImageContext setActiveShaderProgram:secondFilterProgram]; glVertexAttribPointer(secondFilterPositionAttribute, 4, GL_UNSIGNED_BYTE, 0, ((unsigned int)_downsamplingFactor - 1) * 4, vertexSamplingCoordinates); glDrawArrays(GL_POINTS, 0, inputTextureSize.width * inputTextureSize.height / (CGFloat)_downsamplingFactor); [GPUImageContext setActiveShaderProgram:thirdFilterProgram]; glVertexAttribPointer(thirdFilterPositionAttribute, 4, GL_UNSIGNED_BYTE, 0, ((unsigned int)_downsamplingFactor - 1) * 4, vertexSamplingCoordinates); glDrawArrays(GL_POINTS, 0, inputTextureSize.width * inputTextureSize.height / (CGFloat)_downsamplingFactor); } glDisable(GL_BLEND); [firstInputFramebuffer unlock]; if (usingNextFrameForImageCapture) { dispatch_semaphore_signal(imageCaptureSemaphore); } } #pragma mark - #pragma mark Accessors //- (void)setScalingFactor:(CGFloat)newValue; //{ // _scalingFactor = newValue; // // [GPUImageContext useImageProcessingContext]; // [filterProgram use]; // glUniform1f(scalingFactorUniform, _scalingFactor); //} @end ================================================ FILE: framework/Source/GPUImageHistogramGenerator.h ================================================ #import "GPUImageFilter.h" @interface GPUImageHistogramGenerator : GPUImageFilter { GLint backgroundColorUniform; } @end ================================================ FILE: framework/Source/GPUImageHistogramGenerator.m ================================================ #import "GPUImageHistogramGenerator.h" NSString *const kGPUImageHistogramGeneratorVertexShaderString = SHADER_STRING ( attribute vec4 position; attribute vec4 inputTextureCoordinate; varying vec2 textureCoordinate; varying float height; void main() { gl_Position = position; textureCoordinate = vec2(inputTextureCoordinate.x, 0.5); height = 1.0 - inputTextureCoordinate.y; } ); #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageHistogramGeneratorFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; varying highp float height; uniform sampler2D inputImageTexture; uniform lowp vec4 backgroundColor; void main() { lowp vec3 colorChannels = texture2D(inputImageTexture, textureCoordinate).rgb; lowp vec4 heightTest = vec4(step(height, colorChannels), 1.0); gl_FragColor = mix(backgroundColor, heightTest, heightTest.r + heightTest.g + heightTest.b); } ); #else NSString *const kGPUImageHistogramGeneratorFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; varying float height; uniform sampler2D inputImageTexture; uniform vec4 backgroundColor; void main() { vec3 colorChannels = texture2D(inputImageTexture, textureCoordinate).rgb; vec4 heightTest = vec4(step(height, colorChannels), 1.0); gl_FragColor = mix(backgroundColor, heightTest, heightTest.r + heightTest.g + heightTest.b); } ); #endif @implementation GPUImageHistogramGenerator #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super initWithVertexShaderFromString:kGPUImageHistogramGeneratorVertexShaderString fragmentShaderFromString:kGPUImageHistogramGeneratorFragmentShaderString])) { return nil; } backgroundColorUniform = [filterProgram uniformIndex:@"backgroundColor"]; [self setBackgroundColorRed:0.0 green:0.0 blue:0.0 alpha:0.0]; return self; } #pragma mark - #pragma mark Accessors - (void)setBackgroundColorRed:(GLfloat)redComponent green:(GLfloat)greenComponent blue:(GLfloat)blueComponent alpha:(GLfloat)alphaComponent; { // GLfloat backgroundColor[4]; // backgroundColor[0] = redComponent; // backgroundColor[1] = greenComponent; // backgroundColor[2] = blueComponent; // backgroundColor[3] = alphaComponent; GPUVector4 backgroundColor = {redComponent, greenComponent, blueComponent, alphaComponent}; [self setVec4:backgroundColor forUniform:backgroundColorUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImageHoughTransformLineDetector.h ================================================ #import "GPUImageFilterGroup.h" #import "GPUImageThresholdEdgeDetectionFilter.h" #import "GPUImageParallelCoordinateLineTransformFilter.h" #import "GPUImageThresholdedNonMaximumSuppressionFilter.h" #import "GPUImageCannyEdgeDetectionFilter.h" // This applies a Hough transform to detect lines in a scene. It starts with a thresholded Sobel edge detection pass, // then takes those edge points in and applies a Hough transform to convert them to lines. The intersection of these lines // is then determined via blending and accumulation, and a non-maximum suppression filter is applied to find local maxima. // These local maxima are then converted back into lines in normal space and returned via a callback block. // // Rather than using one of the standard Hough transform types, this filter uses parallel coordinate space which is far more efficient // to rasterize on a GPU. // // This approach is based entirely on the PC lines process developed by the Graph@FIT research group at the Brno University of Technology // and described in their publications: // // M. Dubská, J. Havel, and A. Herout. Real-Time Detection of Lines using Parallel Coordinates and OpenGL. Proceedings of SCCG 2011, Bratislava, SK, p. 7. // http://medusa.fit.vutbr.cz/public/data/papers/2011-SCCG-Dubska-Real-Time-Line-Detection-Using-PC-and-OpenGL.pdf // M. Dubská, J. Havel, and A. Herout. PClines — Line detection using parallel coordinates. 2011 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), p. 1489- 1494. // http://medusa.fit.vutbr.cz/public/data/papers/2011-CVPR-Dubska-PClines.pdf //#define DEBUGLINEDETECTION @interface GPUImageHoughTransformLineDetector : GPUImageFilterGroup { GPUImageOutput *thresholdEdgeDetectionFilter; // GPUImageThresholdEdgeDetectionFilter *thresholdEdgeDetectionFilter; GPUImageParallelCoordinateLineTransformFilter *parallelCoordinateLineTransformFilter; GPUImageThresholdedNonMaximumSuppressionFilter *nonMaximumSuppressionFilter; GLfloat *linesArray; GLubyte *rawImagePixels; } // A threshold value for which a point is detected as belonging to an edge for determining lines. Default is 0.9. @property(readwrite, nonatomic) CGFloat edgeThreshold; // A threshold value for which a local maximum is detected as belonging to a line in parallel coordinate space. Default is 0.20. @property(readwrite, nonatomic) CGFloat lineDetectionThreshold; // This block is called on the detection of lines, usually on every processed frame. A C array containing normalized slopes and intercepts in m, b pairs (y=mx+b) is passed in, along with a count of the number of lines detected and the current timestamp of the video frame @property(nonatomic, copy) void(^linesDetectedBlock)(GLfloat* lineArray, NSUInteger linesDetected, CMTime frameTime); // These images are only enabled when built with DEBUGLINEDETECTION defined, and are used to examine the intermediate states of the Hough transform @property(nonatomic, readonly, strong) NSMutableArray *intermediateImages; @end ================================================ FILE: framework/Source/GPUImageHoughTransformLineDetector.m ================================================ #import "GPUImageHoughTransformLineDetector.h" @interface GPUImageHoughTransformLineDetector() - (void)extractLineParametersFromImageAtFrameTime:(CMTime)frameTime; @end @implementation GPUImageHoughTransformLineDetector @synthesize linesDetectedBlock; @synthesize edgeThreshold; @synthesize lineDetectionThreshold; @synthesize intermediateImages = _intermediateImages; - (id)init; { if (!(self = [super init])) { return nil; } // First pass: do edge detection and threshold that to just have white pixels for edges // if ([GPUImageContext deviceSupportsFramebufferReads]) // if ([GPUImageContext deviceSupportsFramebufferReads]) // { // thresholdEdgeDetectionFilter = [[GPUImageThresholdEdgeDetectionFilter alloc] init]; // thresholdEdgeDetectionFilter = [[GPUImageSobelEdgeDetectionFilter alloc] init]; // [(GPUImageThresholdEdgeDetectionFilter *)thresholdEdgeDetectionFilter setThreshold:0.07]; // [(GPUImageThresholdEdgeDetectionFilter *)thresholdEdgeDetectionFilter setEdgeStrength:0.25]; // [(GPUImageThresholdEdgeDetectionFilter *)thresholdEdgeDetectionFilter setEdgeStrength:1.0]; // thresholdEdgeDetectionFilter = [[GPUImageCannyEdgeDetectionFilter alloc] init]; // } // else // { thresholdEdgeDetectionFilter = [[GPUImageCannyEdgeDetectionFilter alloc] init]; // } [self addFilter:thresholdEdgeDetectionFilter]; // Second pass: extract the white points and draw representative lines in parallel coordinate space parallelCoordinateLineTransformFilter = [[GPUImageParallelCoordinateLineTransformFilter alloc] init]; [self addFilter:parallelCoordinateLineTransformFilter]; // Third pass: apply non-maximum suppression if ([GPUImageContext deviceSupportsFramebufferReads]) { nonMaximumSuppressionFilter = [[GPUImageThresholdedNonMaximumSuppressionFilter alloc] initWithPackedColorspace:YES]; } else { nonMaximumSuppressionFilter = [[GPUImageThresholdedNonMaximumSuppressionFilter alloc] initWithPackedColorspace:NO]; } [self addFilter:nonMaximumSuppressionFilter]; __unsafe_unretained GPUImageHoughTransformLineDetector *weakSelf = self; #ifdef DEBUGLINEDETECTION _intermediateImages = [[NSMutableArray alloc] init]; __unsafe_unretained NSMutableArray *weakIntermediateImages = _intermediateImages; // __unsafe_unretained GPUImageOutput *weakEdgeDetectionFilter = thresholdEdgeDetectionFilter; // [thresholdEdgeDetectionFilter setFrameProcessingCompletionBlock:^(GPUImageOutput *filter, CMTime frameTime){ // [weakIntermediateImages removeAllObjects]; // UIImage *intermediateImage = [weakEdgeDetectionFilter imageFromCurrentFramebuffer]; // [weakIntermediateImages addObject:intermediateImage]; // }]; // // __unsafe_unretained GPUImageOutput *weakParallelCoordinateLineTransformFilter = parallelCoordinateLineTransformFilter; // [parallelCoordinateLineTransformFilter setFrameProcessingCompletionBlock:^(GPUImageOutput *filter, CMTime frameTime){ // UIImage *intermediateImage = [weakParallelCoordinateLineTransformFilter imageFromCurrentFramebuffer]; // [weakIntermediateImages addObject:intermediateImage]; // }]; __unsafe_unretained GPUImageOutput *weakNonMaximumSuppressionFilter = nonMaximumSuppressionFilter; [nonMaximumSuppressionFilter setFrameProcessingCompletionBlock:^(GPUImageOutput *filter, CMTime frameTime){ UIImage *intermediateImage = [weakNonMaximumSuppressionFilter imageFromCurrentFramebuffer]; [weakIntermediateImages addObject:intermediateImage]; [weakSelf extractLineParametersFromImageAtFrameTime:frameTime]; }]; #else [nonMaximumSuppressionFilter setFrameProcessingCompletionBlock:^(GPUImageOutput *filter, CMTime frameTime) { [weakSelf extractLineParametersFromImageAtFrameTime:frameTime]; }]; #endif [thresholdEdgeDetectionFilter addTarget:parallelCoordinateLineTransformFilter]; [parallelCoordinateLineTransformFilter addTarget:nonMaximumSuppressionFilter]; self.initialFilters = [NSArray arrayWithObjects:thresholdEdgeDetectionFilter, nil]; // self.terminalFilter = colorPackingFilter; self.terminalFilter = nonMaximumSuppressionFilter; // self.edgeThreshold = 0.95; self.lineDetectionThreshold = 0.12; return self; } - (void)dealloc; { free(rawImagePixels); free(linesArray); } #pragma mark - #pragma mark Corner extraction - (void)extractLineParametersFromImageAtFrameTime:(CMTime)frameTime; { // we need a normal color texture for this filter NSAssert(self.outputTextureOptions.internalFormat == GL_RGBA, @"The output texture format for this filter must be GL_RGBA."); NSAssert(self.outputTextureOptions.type == GL_UNSIGNED_BYTE, @"The type of the output texture of this filter must be GL_UNSIGNED_BYTE."); NSUInteger numberOfLines = 0; CGSize imageSize = nonMaximumSuppressionFilter.outputFrameSize; unsigned int imageByteSize = imageSize.width * imageSize.height * 4; if (rawImagePixels == NULL) { rawImagePixels = (GLubyte *)malloc(imageByteSize); linesArray = calloc(1024 * 2, sizeof(GLfloat)); } glReadPixels(0, 0, (int)imageSize.width, (int)imageSize.height, GL_RGBA, GL_UNSIGNED_BYTE, rawImagePixels); // CFAbsoluteTime startTime = CFAbsoluteTimeGetCurrent(); unsigned int imageWidth = imageSize.width * 4; unsigned int currentByte = 0; unsigned int cornerStorageIndex = 0; unsigned long lineStrengthCounter = 0; while (currentByte < imageByteSize) { GLubyte colorByte = rawImagePixels[currentByte]; // NSLog(@"(%d,%d): [%d,%d,%d,%d]", xCoordinate, yCoordinate, rawImagePixels[currentByte], rawImagePixels[currentByte+1], rawImagePixels[currentByte+2], rawImagePixels[currentByte+3]); // NSLog(@"[%d,%d,%d,%d]", rawImagePixels[currentByte], rawImagePixels[currentByte+1], rawImagePixels[currentByte+2], rawImagePixels[currentByte+3]); if (colorByte > 0) { unsigned int xCoordinate = currentByte % imageWidth; unsigned int yCoordinate = currentByte / imageWidth; lineStrengthCounter += colorByte; // NSLog(@"(%d,%d): [%d,%d,%d,%d]", xCoordinate, yCoordinate, rawImagePixels[currentByte], rawImagePixels[currentByte+1], rawImagePixels[currentByte+2], rawImagePixels[currentByte+3]); CGFloat normalizedXCoordinate = -1.0 + 2.0 * (CGFloat)(xCoordinate / 4) / imageSize.width; CGFloat normalizedYCoordinate = -1.0 + 2.0 * (CGFloat)(yCoordinate) / imageSize.height; if (normalizedXCoordinate < 0.0) { // T space // m = -1 - d/u // b = d * v/u if (normalizedXCoordinate > -0.05) // Test for the case right near the X axis, stamp the X intercept instead of the Y { linesArray[cornerStorageIndex++] = 100000.0; linesArray[cornerStorageIndex++] = normalizedYCoordinate; } else { linesArray[cornerStorageIndex++] = -1.0 - 1.0 / normalizedXCoordinate; linesArray[cornerStorageIndex++] = 1.0 * normalizedYCoordinate / normalizedXCoordinate; } } else { // S space // m = 1 - d/u // b = d * v/u if (normalizedXCoordinate < 0.05) // Test for the case right near the X axis, stamp the X intercept instead of the Y { linesArray[cornerStorageIndex++] = 100000.0; linesArray[cornerStorageIndex++] = normalizedYCoordinate; } else { linesArray[cornerStorageIndex++] = 1.0 - 1.0 / normalizedXCoordinate; linesArray[cornerStorageIndex++] = 1.0 * normalizedYCoordinate / normalizedXCoordinate; } } numberOfLines++; numberOfLines = MIN(numberOfLines, 1023); cornerStorageIndex = MIN(cornerStorageIndex, 2040); } currentByte +=4; } // CFAbsoluteTime currentFrameTime = (CFAbsoluteTimeGetCurrent() - startTime); // NSLog(@"Processing time : %f ms", 1000.0 * currentFrameTime); if (linesDetectedBlock != NULL) { linesDetectedBlock(linesArray, numberOfLines, frameTime); } } - (BOOL)wantsMonochromeInput; { // return YES; return NO; } #pragma mark - #pragma mark Accessors //- (void)setEdgeThreshold:(CGFloat)newValue; //{ // [(GPUImageCannyEdgeDetectionFilter *)thresholdEdgeDetectionFilter setThreshold:newValue]; //} // //- (CGFloat)edgeThreshold; //{ // return [(GPUImageCannyEdgeDetectionFilter *)thresholdEdgeDetectionFilter threshold]; //} - (void)setLineDetectionThreshold:(CGFloat)newValue; { nonMaximumSuppressionFilter.threshold = newValue; } - (CGFloat)lineDetectionThreshold; { return nonMaximumSuppressionFilter.threshold; } #ifdef DEBUGLINEDETECTION - (void)newFrameReadyAtTime:(CMTime)frameTime atIndex:(NSInteger)textureIndex; { // [thresholdEdgeDetectionFilter useNextFrameForImageCapture]; // [parallelCoordinateLineTransformFilter useNextFrameForImageCapture]; [nonMaximumSuppressionFilter useNextFrameForImageCapture]; [super newFrameReadyAtTime:frameTime atIndex:textureIndex]; } #endif @end ================================================ FILE: framework/Source/GPUImageHueBlendFilter.h ================================================ #import "GPUImageTwoInputFilter.h" @interface GPUImageHueBlendFilter : GPUImageTwoInputFilter @end ================================================ FILE: framework/Source/GPUImageHueBlendFilter.m ================================================ #import "GPUImageHueBlendFilter.h" /** * Hue blend mode based upon pseudo code from the PDF specification. */ #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageHueBlendFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; varying highp vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; highp float lum(lowp vec3 c) { return dot(c, vec3(0.3, 0.59, 0.11)); } lowp vec3 clipcolor(lowp vec3 c) { highp float l = lum(c); lowp float n = min(min(c.r, c.g), c.b); lowp float x = max(max(c.r, c.g), c.b); if (n < 0.0) { c.r = l + ((c.r - l) * l) / (l - n); c.g = l + ((c.g - l) * l) / (l - n); c.b = l + ((c.b - l) * l) / (l - n); } if (x > 1.0) { c.r = l + ((c.r - l) * (1.0 - l)) / (x - l); c.g = l + ((c.g - l) * (1.0 - l)) / (x - l); c.b = l + ((c.b - l) * (1.0 - l)) / (x - l); } return c; } lowp vec3 setlum(lowp vec3 c, highp float l) { highp float d = l - lum(c); c = c + vec3(d); return clipcolor(c); } highp float sat(lowp vec3 c) { lowp float n = min(min(c.r, c.g), c.b); lowp float x = max(max(c.r, c.g), c.b); return x - n; } lowp float mid(lowp float cmin, lowp float cmid, lowp float cmax, highp float s) { return ((cmid - cmin) * s) / (cmax - cmin); } lowp vec3 setsat(lowp vec3 c, highp float s) { if (c.r > c.g) { if (c.r > c.b) { if (c.g > c.b) { /* g is mid, b is min */ c.g = mid(c.b, c.g, c.r, s); c.b = 0.0; } else { /* b is mid, g is min */ c.b = mid(c.g, c.b, c.r, s); c.g = 0.0; } c.r = s; } else { /* b is max, r is mid, g is min */ c.r = mid(c.g, c.r, c.b, s); c.b = s; c.r = 0.0; } } else if (c.r > c.b) { /* g is max, r is mid, b is min */ c.r = mid(c.b, c.r, c.g, s); c.g = s; c.b = 0.0; } else if (c.g > c.b) { /* g is max, b is mid, r is min */ c.b = mid(c.r, c.b, c.g, s); c.g = s; c.r = 0.0; } else if (c.b > c.g) { /* b is max, g is mid, r is min */ c.g = mid(c.r, c.g, c.b, s); c.b = s; c.r = 0.0; } else { c = vec3(0.0); } return c; } void main() { highp vec4 baseColor = texture2D(inputImageTexture, textureCoordinate); highp vec4 overlayColor = texture2D(inputImageTexture2, textureCoordinate2); gl_FragColor = vec4(baseColor.rgb * (1.0 - overlayColor.a) + setlum(setsat(overlayColor.rgb, sat(baseColor.rgb)), lum(baseColor.rgb)) * overlayColor.a, baseColor.a); } ); #else NSString *const kGPUImageHueBlendFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; varying vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; float lum(vec3 c) { return dot(c, vec3(0.3, 0.59, 0.11)); } vec3 clipcolor(vec3 c) { float l = lum(c); float n = min(min(c.r, c.g), c.b); float x = max(max(c.r, c.g), c.b); if (n < 0.0) { c.r = l + ((c.r - l) * l) / (l - n); c.g = l + ((c.g - l) * l) / (l - n); c.b = l + ((c.b - l) * l) / (l - n); } if (x > 1.0) { c.r = l + ((c.r - l) * (1.0 - l)) / (x - l); c.g = l + ((c.g - l) * (1.0 - l)) / (x - l); c.b = l + ((c.b - l) * (1.0 - l)) / (x - l); } return c; } vec3 setlum(vec3 c, float l) { float d = l - lum(c); c = c + vec3(d); return clipcolor(c); } float sat(vec3 c) { float n = min(min(c.r, c.g), c.b); float x = max(max(c.r, c.g), c.b); return x - n; } float mid(float cmin, float cmid, float cmax, float s) { return ((cmid - cmin) * s) / (cmax - cmin); } vec3 setsat(vec3 c, float s) { if (c.r > c.g) { if (c.r > c.b) { if (c.g > c.b) { /* g is mid, b is min */ c.g = mid(c.b, c.g, c.r, s); c.b = 0.0; } else { /* b is mid, g is min */ c.b = mid(c.g, c.b, c.r, s); c.g = 0.0; } c.r = s; } else { /* b is max, r is mid, g is min */ c.r = mid(c.g, c.r, c.b, s); c.b = s; c.r = 0.0; } } else if (c.r > c.b) { /* g is max, r is mid, b is min */ c.r = mid(c.b, c.r, c.g, s); c.g = s; c.b = 0.0; } else if (c.g > c.b) { /* g is max, b is mid, r is min */ c.b = mid(c.r, c.b, c.g, s); c.g = s; c.r = 0.0; } else if (c.b > c.g) { /* b is max, g is mid, r is min */ c.g = mid(c.r, c.g, c.b, s); c.b = s; c.r = 0.0; } else { c = vec3(0.0); } return c; } void main() { vec4 baseColor = texture2D(inputImageTexture, textureCoordinate); vec4 overlayColor = texture2D(inputImageTexture2, textureCoordinate2); gl_FragColor = vec4(baseColor.rgb * (1.0 - overlayColor.a) + setlum(setsat(overlayColor.rgb, sat(baseColor.rgb)), lum(baseColor.rgb)) * overlayColor.a, baseColor.a); } ); #endif @implementation GPUImageHueBlendFilter - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageHueBlendFragmentShaderString])) { return nil; } return self; } @end ================================================ FILE: framework/Source/GPUImageHueFilter.h ================================================ #import "GPUImageFilter.h" @interface GPUImageHueFilter : GPUImageFilter { GLint hueAdjustUniform; } @property (nonatomic, readwrite) CGFloat hue; @end ================================================ FILE: framework/Source/GPUImageHueFilter.m ================================================ #import "GPUImageHueFilter.h" // Adapted from http://stackoverflow.com/questions/9234724/how-to-change-hue-of-a-texture-with-glsl - see for code and discussion #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageHueFragmentShaderString = SHADER_STRING ( precision highp float; varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform mediump float hueAdjust; const highp vec4 kRGBToYPrime = vec4 (0.299, 0.587, 0.114, 0.0); const highp vec4 kRGBToI = vec4 (0.595716, -0.274453, -0.321263, 0.0); const highp vec4 kRGBToQ = vec4 (0.211456, -0.522591, 0.31135, 0.0); const highp vec4 kYIQToR = vec4 (1.0, 0.9563, 0.6210, 0.0); const highp vec4 kYIQToG = vec4 (1.0, -0.2721, -0.6474, 0.0); const highp vec4 kYIQToB = vec4 (1.0, -1.1070, 1.7046, 0.0); void main () { // Sample the input pixel highp vec4 color = texture2D(inputImageTexture, textureCoordinate); // Convert to YIQ highp float YPrime = dot (color, kRGBToYPrime); highp float I = dot (color, kRGBToI); highp float Q = dot (color, kRGBToQ); // Calculate the hue and chroma highp float hue = atan (Q, I); highp float chroma = sqrt (I * I + Q * Q); // Make the user's adjustments hue += (-hueAdjust); //why negative rotation? // Convert back to YIQ Q = chroma * sin (hue); I = chroma * cos (hue); // Convert back to RGB highp vec4 yIQ = vec4 (YPrime, I, Q, 0.0); color.r = dot (yIQ, kYIQToR); color.g = dot (yIQ, kYIQToG); color.b = dot (yIQ, kYIQToB); // Save the result gl_FragColor = color; } ); #else NSString *const kGPUImageHueFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform float hueAdjust; const vec4 kRGBToYPrime = vec4 (0.299, 0.587, 0.114, 0.0); const vec4 kRGBToI = vec4 (0.595716, -0.274453, -0.321263, 0.0); const vec4 kRGBToQ = vec4 (0.211456, -0.522591, 0.31135, 0.0); const vec4 kYIQToR = vec4 (1.0, 0.9563, 0.6210, 0.0); const vec4 kYIQToG = vec4 (1.0, -0.2721, -0.6474, 0.0); const vec4 kYIQToB = vec4 (1.0, -1.1070, 1.7046, 0.0); void main () { // Sample the input pixel vec4 color = texture2D(inputImageTexture, textureCoordinate); // Convert to YIQ float YPrime = dot (color, kRGBToYPrime); float I = dot (color, kRGBToI); float Q = dot (color, kRGBToQ); // Calculate the hue and chroma float hue = atan (Q, I); float chroma = sqrt (I * I + Q * Q); // Make the user's adjustments hue += (-hueAdjust); //why negative rotation? // Convert back to YIQ Q = chroma * sin (hue); I = chroma * cos (hue); // Convert back to RGB vec4 yIQ = vec4 (YPrime, I, Q, 0.0); color.r = dot (yIQ, kYIQToR); color.g = dot (yIQ, kYIQToG); color.b = dot (yIQ, kYIQToB); // Save the result gl_FragColor = color; } ); #endif @implementation GPUImageHueFilter @synthesize hue; - (id)init { if(! (self = [super initWithFragmentShaderFromString:kGPUImageHueFragmentShaderString]) ) { return nil; } hueAdjustUniform = [filterProgram uniformIndex:@"hueAdjust"]; self.hue = 90; return self; } - (void)setHue:(CGFloat)newHue { // Convert degrees to radians for hue rotation hue = fmodf(newHue, 360.0) * M_PI/180; [self setFloat:hue forUniform:hueAdjustUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImageJFAVoronoiFilter.h ================================================ #import "GPUImageFilter.h" @interface GPUImageJFAVoronoiFilter : GPUImageFilter { GLuint secondFilterOutputTexture; GLuint secondFilterFramebuffer; GLint sampleStepUniform; GLint sizeUniform; NSUInteger numPasses; } @property (nonatomic, readwrite) CGSize sizeInPixels; @end ================================================ FILE: framework/Source/GPUImageJFAVoronoiFilter.m ================================================ // adapted from unitzeroone - http://unitzeroone.com/labs/jfavoronoi/ #import "GPUImageJFAVoronoiFilter.h" // The shaders are mostly taken from UnitZeroOne's WebGL example here: // http://unitzeroone.com/blog/2011/03/22/jump-flood-voronoi-for-webgl/ NSString *const kGPUImageJFAVoronoiVertexShaderString = SHADER_STRING ( attribute vec4 position; attribute vec4 inputTextureCoordinate; uniform float sampleStep; varying vec2 textureCoordinate; varying vec2 leftTextureCoordinate; varying vec2 rightTextureCoordinate; varying vec2 topTextureCoordinate; varying vec2 topLeftTextureCoordinate; varying vec2 topRightTextureCoordinate; varying vec2 bottomTextureCoordinate; varying vec2 bottomLeftTextureCoordinate; varying vec2 bottomRightTextureCoordinate; void main() { gl_Position = position; vec2 widthStep = vec2(sampleStep, 0.0); vec2 heightStep = vec2(0.0, sampleStep); vec2 widthHeightStep = vec2(sampleStep); vec2 widthNegativeHeightStep = vec2(sampleStep, -sampleStep); textureCoordinate = inputTextureCoordinate.xy; leftTextureCoordinate = inputTextureCoordinate.xy - widthStep; rightTextureCoordinate = inputTextureCoordinate.xy + widthStep; topTextureCoordinate = inputTextureCoordinate.xy - heightStep; topLeftTextureCoordinate = inputTextureCoordinate.xy - widthHeightStep; topRightTextureCoordinate = inputTextureCoordinate.xy + widthNegativeHeightStep; bottomTextureCoordinate = inputTextureCoordinate.xy + heightStep; bottomLeftTextureCoordinate = inputTextureCoordinate.xy - widthNegativeHeightStep; bottomRightTextureCoordinate = inputTextureCoordinate.xy + widthHeightStep; } ); #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageJFAVoronoiFragmentShaderString = SHADER_STRING ( precision highp float; varying vec2 textureCoordinate; varying vec2 leftTextureCoordinate; varying vec2 rightTextureCoordinate; varying vec2 topTextureCoordinate; varying vec2 topLeftTextureCoordinate; varying vec2 topRightTextureCoordinate; varying vec2 bottomTextureCoordinate; varying vec2 bottomLeftTextureCoordinate; varying vec2 bottomRightTextureCoordinate; uniform sampler2D inputImageTexture; uniform vec2 size; //varying vec2 textureCoordinate; //uniform float sampleStep; vec2 getCoordFromColor(vec4 color) { float z = color.z * 256.0; float yoff = floor(z / 8.0); float xoff = mod(z, 8.0); float x = color.x*256.0 + xoff*256.0; float y = color.y*256.0 + yoff*256.0; return vec2(x,y) / size; } void main(void) { vec2 sub; vec4 dst; vec4 local = texture2D(inputImageTexture, textureCoordinate); vec4 sam; float l; float smallestDist; if(local.a == 0.0){ smallestDist = dot(1.0,1.0); }else{ sub = getCoordFromColor(local)-textureCoordinate; smallestDist = dot(sub,sub); } dst = local; sam = texture2D(inputImageTexture, topRightTextureCoordinate); if(sam.a == 1.0){ sub = (getCoordFromColor(sam)-textureCoordinate); l = dot(sub,sub); if(l < smallestDist){ smallestDist = l; dst = sam; } } sam = texture2D(inputImageTexture, topTextureCoordinate); if(sam.a == 1.0){ sub = (getCoordFromColor(sam)-textureCoordinate); l = dot(sub,sub); if(l < smallestDist){ smallestDist = l; dst = sam; } } sam = texture2D(inputImageTexture, topLeftTextureCoordinate); if(sam.a == 1.0){ sub = (getCoordFromColor(sam)-textureCoordinate); l = dot(sub,sub); if(l < smallestDist){ smallestDist = l; dst = sam; } } sam = texture2D(inputImageTexture, bottomRightTextureCoordinate); if(sam.a == 1.0){ sub = (getCoordFromColor(sam)-textureCoordinate); l = dot(sub,sub); if(l < smallestDist){ smallestDist = l; dst = sam; } } sam = texture2D(inputImageTexture, bottomTextureCoordinate); if(sam.a == 1.0){ sub = (getCoordFromColor(sam)-textureCoordinate); l = dot(sub,sub); if(l < smallestDist){ smallestDist = l; dst = sam; } } sam = texture2D(inputImageTexture, bottomLeftTextureCoordinate); if(sam.a == 1.0){ sub = (getCoordFromColor(sam)-textureCoordinate); l = dot(sub,sub); if(l < smallestDist){ smallestDist = l; dst = sam; } } sam = texture2D(inputImageTexture, leftTextureCoordinate); if(sam.a == 1.0){ sub = (getCoordFromColor(sam)-textureCoordinate); l = dot(sub,sub); if(l < smallestDist){ smallestDist = l; dst = sam; } } sam = texture2D(inputImageTexture, rightTextureCoordinate); if(sam.a == 1.0){ sub = (getCoordFromColor(sam)-textureCoordinate); l = dot(sub,sub); if(l < smallestDist){ smallestDist = l; dst = sam; } } gl_FragColor = dst; } ); #else NSString *const kGPUImageJFAVoronoiFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; varying vec2 leftTextureCoordinate; varying vec2 rightTextureCoordinate; varying vec2 topTextureCoordinate; varying vec2 topLeftTextureCoordinate; varying vec2 topRightTextureCoordinate; varying vec2 bottomTextureCoordinate; varying vec2 bottomLeftTextureCoordinate; varying vec2 bottomRightTextureCoordinate; uniform sampler2D inputImageTexture; uniform vec2 size; //varying vec2 textureCoordinate; //uniform float sampleStep; vec2 getCoordFromColor(vec4 color) { float z = color.z * 256.0; float yoff = floor(z / 8.0); float xoff = mod(z, 8.0); float x = color.x*256.0 + xoff*256.0; float y = color.y*256.0 + yoff*256.0; return vec2(x,y) / size; } void main(void) { vec2 sub; vec4 dst; vec4 local = texture2D(inputImageTexture, textureCoordinate); vec4 sam; float l; float smallestDist; if(local.a == 0.0){ smallestDist = dot(1.0,1.0); }else{ sub = getCoordFromColor(local)-textureCoordinate; smallestDist = dot(sub,sub); } dst = local; sam = texture2D(inputImageTexture, topRightTextureCoordinate); if(sam.a == 1.0){ sub = (getCoordFromColor(sam)-textureCoordinate); l = dot(sub,sub); if(l < smallestDist){ smallestDist = l; dst = sam; } } sam = texture2D(inputImageTexture, topTextureCoordinate); if(sam.a == 1.0){ sub = (getCoordFromColor(sam)-textureCoordinate); l = dot(sub,sub); if(l < smallestDist){ smallestDist = l; dst = sam; } } sam = texture2D(inputImageTexture, topLeftTextureCoordinate); if(sam.a == 1.0){ sub = (getCoordFromColor(sam)-textureCoordinate); l = dot(sub,sub); if(l < smallestDist){ smallestDist = l; dst = sam; } } sam = texture2D(inputImageTexture, bottomRightTextureCoordinate); if(sam.a == 1.0){ sub = (getCoordFromColor(sam)-textureCoordinate); l = dot(sub,sub); if(l < smallestDist){ smallestDist = l; dst = sam; } } sam = texture2D(inputImageTexture, bottomTextureCoordinate); if(sam.a == 1.0){ sub = (getCoordFromColor(sam)-textureCoordinate); l = dot(sub,sub); if(l < smallestDist){ smallestDist = l; dst = sam; } } sam = texture2D(inputImageTexture, bottomLeftTextureCoordinate); if(sam.a == 1.0){ sub = (getCoordFromColor(sam)-textureCoordinate); l = dot(sub,sub); if(l < smallestDist){ smallestDist = l; dst = sam; } } sam = texture2D(inputImageTexture, leftTextureCoordinate); if(sam.a == 1.0){ sub = (getCoordFromColor(sam)-textureCoordinate); l = dot(sub,sub); if(l < smallestDist){ smallestDist = l; dst = sam; } } sam = texture2D(inputImageTexture, rightTextureCoordinate); if(sam.a == 1.0){ sub = (getCoordFromColor(sam)-textureCoordinate); l = dot(sub,sub); if(l < smallestDist){ smallestDist = l; dst = sam; } } gl_FragColor = dst; } ); #endif @interface GPUImageJFAVoronoiFilter() { int currentPass; } @end @implementation GPUImageJFAVoronoiFilter @synthesize sizeInPixels = _sizeInPixels; - (id)init; { if (!(self = [super initWithVertexShaderFromString:kGPUImageJFAVoronoiVertexShaderString fragmentShaderFromString:kGPUImageJFAVoronoiFragmentShaderString])) { NSLog(@"nil returned"); return nil; } sampleStepUniform = [filterProgram uniformIndex:@"sampleStep"]; sizeUniform = [filterProgram uniformIndex:@"size"]; //[self disableSecondFrameCheck]; return self; } -(void)setSizeInPixels:(CGSize)sizeInPixels { _sizeInPixels = sizeInPixels; //validate that it's a power of 2 float width = log2(sizeInPixels.width); float height = log2(sizeInPixels.height); if (width != height) { NSLog(@"Voronoi point texture must be square"); return; } if (width != floor(width) || height != floor(height)) { NSLog(@"Voronoi point texture must be a power of 2. Texture size: %f, %f", sizeInPixels.width, sizeInPixels.height); return; } glUniform2f(sizeUniform, _sizeInPixels.width, _sizeInPixels.height); } #pragma mark - #pragma mark Managing the display FBOs -(NSUInteger)nextPowerOfTwo:(CGPoint)input { NSUInteger val; if (input.x > input.y) { val = (NSUInteger)input.x; } else { val = (NSUInteger)input.y; } val--; val = (val >> 1) | val; val = (val >> 2) | val; val = (val >> 4) | val; val = (val >> 8) | val; val = (val >> 16) | val; val++; return val; } //- (void)setOutputFBO; //{ // if (currentPass % 2 == 1) { // [self setSecondFilterFBO]; // } else { // [self setFilterFBO]; // } // //} - (void)renderToTextureWithVertices:(const GLfloat *)vertices textureCoordinates:(const GLfloat *)textureCoordinates; { // Run the first stage of the two-pass filter [GPUImageContext setActiveShaderProgram:filterProgram]; currentPass = 0; outputFramebuffer = [[GPUImageContext sharedFramebufferCache] fetchFramebufferForSize:[self sizeOfFBO] textureOptions:self.outputTextureOptions onlyTexture:NO]; [outputFramebuffer activateFramebuffer]; glActiveTexture(GL_TEXTURE2); glClearColor(0.0f, 0.0f, 0.0f, 1.0f); glClear(GL_COLOR_BUFFER_BIT); glUniform1f(sampleStepUniform, 0.5); glUniform2f(sizeUniform, _sizeInPixels.width, _sizeInPixels.height); glBindTexture(GL_TEXTURE_2D, [firstInputFramebuffer texture]); glUniform1i(filterInputTextureUniform, 2); glVertexAttribPointer(filterPositionAttribute, 2, GL_FLOAT, 0, 0, vertices); glVertexAttribPointer(filterTextureCoordinateAttribute, 2, GL_FLOAT, 0, 0, textureCoordinates); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); for (int pass = 1; pass <= numPasses + 1; pass++) { currentPass = pass; // [self setOutputFBO]; //glClearColor(0.0f, 0.0f, 0.0f, 1.0f); glClear(GL_COLOR_BUFFER_BIT); glActiveTexture(GL_TEXTURE2); if (pass % 2 == 0) { glBindTexture(GL_TEXTURE_2D, secondFilterOutputTexture); } else { glBindTexture(GL_TEXTURE_2D, [outputFramebuffer texture]); } glUniform1i(filterInputTextureUniform, 2); float step = pow(2.0, numPasses - pass) / pow(2.0, numPasses); glUniform1f(sampleStepUniform, step); glUniform2f(sizeUniform, _sizeInPixels.width, _sizeInPixels.height); glVertexAttribPointer(filterPositionAttribute, 2, GL_FLOAT, 0, 0, vertices); glVertexAttribPointer(filterTextureCoordinateAttribute, 2, GL_FLOAT, 0, 0, textureCoordinates); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); } } @end ================================================ FILE: framework/Source/GPUImageKuwaharaFilter.h ================================================ #import "GPUImageFilter.h" /** 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. */ @interface GPUImageKuwaharaFilter : GPUImageFilter { GLint radiusUniform; } /// The radius to sample from when creating the brush-stroke effect, with a default of 3. The larger the radius, the slower the filter. @property(readwrite, nonatomic) NSUInteger radius; @end ================================================ FILE: framework/Source/GPUImageKuwaharaFilter.m ================================================ #import "GPUImageKuwaharaFilter.h" // Sourced from Kyprianidis, J. E., Kang, H., and Doellner, J. "Anisotropic Kuwahara Filtering on the GPU," GPU Pro p.247 (2010). // // Original header: // // Anisotropic Kuwahara Filtering on the GPU // by Jan Eric Kyprianidis #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageKuwaharaFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform int radius; precision highp float; const vec2 src_size = vec2 (1.0 / 768.0, 1.0 / 1024.0); void main (void) { vec2 uv = textureCoordinate; float n = float((radius + 1) * (radius + 1)); int i; int j; vec3 m0 = vec3(0.0); vec3 m1 = vec3(0.0); vec3 m2 = vec3(0.0); vec3 m3 = vec3(0.0); vec3 s0 = vec3(0.0); vec3 s1 = vec3(0.0); vec3 s2 = vec3(0.0); vec3 s3 = vec3(0.0); vec3 c; for (j = -radius; j <= 0; ++j) { for (i = -radius; i <= 0; ++i) { c = texture2D(inputImageTexture, uv + vec2(i,j) * src_size).rgb; m0 += c; s0 += c * c; } } for (j = -radius; j <= 0; ++j) { for (i = 0; i <= radius; ++i) { c = texture2D(inputImageTexture, uv + vec2(i,j) * src_size).rgb; m1 += c; s1 += c * c; } } for (j = 0; j <= radius; ++j) { for (i = 0; i <= radius; ++i) { c = texture2D(inputImageTexture, uv + vec2(i,j) * src_size).rgb; m2 += c; s2 += c * c; } } for (j = 0; j <= radius; ++j) { for (i = -radius; i <= 0; ++i) { c = texture2D(inputImageTexture, uv + vec2(i,j) * src_size).rgb; m3 += c; s3 += c * c; } } float min_sigma2 = 1e+2; m0 /= n; s0 = abs(s0 / n - m0 * m0); float sigma2 = s0.r + s0.g + s0.b; if (sigma2 < min_sigma2) { min_sigma2 = sigma2; gl_FragColor = vec4(m0, 1.0); } m1 /= n; s1 = abs(s1 / n - m1 * m1); sigma2 = s1.r + s1.g + s1.b; if (sigma2 < min_sigma2) { min_sigma2 = sigma2; gl_FragColor = vec4(m1, 1.0); } m2 /= n; s2 = abs(s2 / n - m2 * m2); sigma2 = s2.r + s2.g + s2.b; if (sigma2 < min_sigma2) { min_sigma2 = sigma2; gl_FragColor = vec4(m2, 1.0); } m3 /= n; s3 = abs(s3 / n - m3 * m3); sigma2 = s3.r + s3.g + s3.b; if (sigma2 < min_sigma2) { min_sigma2 = sigma2; gl_FragColor = vec4(m3, 1.0); } } ); #else NSString *const kGPUImageKuwaharaFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform int radius; const vec2 src_size = vec2 (1.0 / 768.0, 1.0 / 1024.0); void main (void) { vec2 uv = textureCoordinate; float n = float((radius + 1) * (radius + 1)); int i; int j; vec3 m0 = vec3(0.0); vec3 m1 = vec3(0.0); vec3 m2 = vec3(0.0); vec3 m3 = vec3(0.0); vec3 s0 = vec3(0.0); vec3 s1 = vec3(0.0); vec3 s2 = vec3(0.0); vec3 s3 = vec3(0.0); vec3 c; for (j = -radius; j <= 0; ++j) { for (i = -radius; i <= 0; ++i) { c = texture2D(inputImageTexture, uv + vec2(i,j) * src_size).rgb; m0 += c; s0 += c * c; } } for (j = -radius; j <= 0; ++j) { for (i = 0; i <= radius; ++i) { c = texture2D(inputImageTexture, uv + vec2(i,j) * src_size).rgb; m1 += c; s1 += c * c; } } for (j = 0; j <= radius; ++j) { for (i = 0; i <= radius; ++i) { c = texture2D(inputImageTexture, uv + vec2(i,j) * src_size).rgb; m2 += c; s2 += c * c; } } for (j = 0; j <= radius; ++j) { for (i = -radius; i <= 0; ++i) { c = texture2D(inputImageTexture, uv + vec2(i,j) * src_size).rgb; m3 += c; s3 += c * c; } } float min_sigma2 = 1e+2; m0 /= n; s0 = abs(s0 / n - m0 * m0); float sigma2 = s0.r + s0.g + s0.b; if (sigma2 < min_sigma2) { min_sigma2 = sigma2; gl_FragColor = vec4(m0, 1.0); } m1 /= n; s1 = abs(s1 / n - m1 * m1); sigma2 = s1.r + s1.g + s1.b; if (sigma2 < min_sigma2) { min_sigma2 = sigma2; gl_FragColor = vec4(m1, 1.0); } m2 /= n; s2 = abs(s2 / n - m2 * m2); sigma2 = s2.r + s2.g + s2.b; if (sigma2 < min_sigma2) { min_sigma2 = sigma2; gl_FragColor = vec4(m2, 1.0); } m3 /= n; s3 = abs(s3 / n - m3 * m3); sigma2 = s3.r + s3.g + s3.b; if (sigma2 < min_sigma2) { min_sigma2 = sigma2; gl_FragColor = vec4(m3, 1.0); } } ); #endif @implementation GPUImageKuwaharaFilter @synthesize radius = _radius; #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageKuwaharaFragmentShaderString])) { return nil; } radiusUniform = [filterProgram uniformIndex:@"radius"]; self.radius = 3; return self; } #pragma mark - #pragma mark Accessors - (void)setRadius:(NSUInteger)newValue; { _radius = newValue; [self setInteger:(GLint)_radius forUniform:radiusUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImageKuwaharaRadius3Filter.h ================================================ // // GPUImageKuwaharaRadius3Filter.h #import "GPUImageFilter.h" @interface GPUImageKuwaharaRadius3Filter : GPUImageFilter @end ================================================ FILE: framework/Source/GPUImageKuwaharaRadius3Filter.m ================================================ #import "GPUImageKuwaharaRadius3Filter.h" // Sourced from Kyprianidis, J. E., Kang, H., and Doellner, J. "Anisotropic Kuwahara Filtering on the GPU," GPU Pro p.247 (2010). // // Original header: // // Anisotropic Kuwahara Filtering on the GPU // by Jan Eric Kyprianidis #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageKuwaharaRadius3FragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; precision highp float; const vec2 src_size = vec2 (1.0 / 768.0, 1.0 / 1024.0); void main (void) { vec2 uv = textureCoordinate; float n = float(16); // radius is assumed to be 3 vec3 m0 = vec3(0.0); vec3 m1 = vec3(0.0); vec3 m2 = vec3(0.0); vec3 m3 = vec3(0.0); vec3 s0 = vec3(0.0); vec3 s1 = vec3(0.0); vec3 s2 = vec3(0.0); vec3 s3 = vec3(0.0); vec3 c; vec3 cSq; c = texture2D(inputImageTexture, uv + vec2(-3,-3) * src_size).rgb; m0 += c; s0 += c * c; c = texture2D(inputImageTexture, uv + vec2(-3,-2) * src_size).rgb; m0 += c; s0 += c * c; c = texture2D(inputImageTexture, uv + vec2(-3,-1) * src_size).rgb; m0 += c; s0 += c * c; c = texture2D(inputImageTexture, uv + vec2(-3,0) * src_size).rgb; cSq = c * c; m0 += c; s0 += cSq; m1 += c; s1 += cSq; c = texture2D(inputImageTexture, uv + vec2(-2,-3) * src_size).rgb; m0 += c; s0 += c * c; c = texture2D(inputImageTexture, uv + vec2(-2,-2) * src_size).rgb; m0 += c; s0 += c * c; c = texture2D(inputImageTexture, uv + vec2(-2,-1) * src_size).rgb; m0 += c; s0 += c * c; c = texture2D(inputImageTexture, uv + vec2(-2,0) * src_size).rgb; cSq = c * c; m0 += c; s0 += cSq; m1 += c; s1 += cSq; c = texture2D(inputImageTexture, uv + vec2(-1,-3) * src_size).rgb; m0 += c; s0 += c * c; c = texture2D(inputImageTexture, uv + vec2(-1,-2) * src_size).rgb; m0 += c; s0 += c * c; c = texture2D(inputImageTexture, uv + vec2(-1,-1) * src_size).rgb; m0 += c; s0 += c * c; c = texture2D(inputImageTexture, uv + vec2(-1,0) * src_size).rgb; cSq = c * c; m0 += c; s0 += cSq; m1 += c; s1 += cSq; c = texture2D(inputImageTexture, uv + vec2(0,-3) * src_size).rgb; cSq = c * c; m0 += c; s0 += cSq; m3 += c; s3 += cSq; c = texture2D(inputImageTexture, uv + vec2(0,-2) * src_size).rgb; cSq = c * c; m0 += c; s0 += cSq; m3 += c; s3 += cSq; c = texture2D(inputImageTexture, uv + vec2(0,-1) * src_size).rgb; cSq = c * c; m0 += c; s0 += cSq; m3 += c; s3 += cSq; c = texture2D(inputImageTexture, uv + vec2(0,0) * src_size).rgb; cSq = c * c; m0 += c; s0 += cSq; m1 += c; s1 += cSq; m2 += c; s2 += cSq; m3 += c; s3 += cSq; c = texture2D(inputImageTexture, uv + vec2(-3,3) * src_size).rgb; m1 += c; s1 += c * c; c = texture2D(inputImageTexture, uv + vec2(-3,2) * src_size).rgb; m1 += c; s1 += c * c; c = texture2D(inputImageTexture, uv + vec2(-3,1) * src_size).rgb; m1 += c; s1 += c * c; c = texture2D(inputImageTexture, uv + vec2(-2,3) * src_size).rgb; m1 += c; s1 += c * c; c = texture2D(inputImageTexture, uv + vec2(-2,2) * src_size).rgb; m1 += c; s1 += c * c; c = texture2D(inputImageTexture, uv + vec2(-2,1) * src_size).rgb; m1 += c; s1 += c * c; c = texture2D(inputImageTexture, uv + vec2(-1,3) * src_size).rgb; m1 += c; s1 += c * c; c = texture2D(inputImageTexture, uv + vec2(-1,2) * src_size).rgb; m1 += c; s1 += c * c; c = texture2D(inputImageTexture, uv + vec2(-1,1) * src_size).rgb; m1 += c; s1 += c * c; c = texture2D(inputImageTexture, uv + vec2(0,3) * src_size).rgb; cSq = c * c; m1 += c; s1 += cSq; m2 += c; s2 += cSq; c = texture2D(inputImageTexture, uv + vec2(0,2) * src_size).rgb; cSq = c * c; m1 += c; s1 += cSq; m2 += c; s2 += cSq; c = texture2D(inputImageTexture, uv + vec2(0,1) * src_size).rgb; cSq = c * c; m1 += c; s1 += cSq; m2 += c; s2 += cSq; c = texture2D(inputImageTexture, uv + vec2(3,3) * src_size).rgb; m2 += c; s2 += c * c; c = texture2D(inputImageTexture, uv + vec2(3,2) * src_size).rgb; m2 += c; s2 += c * c; c = texture2D(inputImageTexture, uv + vec2(3,1) * src_size).rgb; m2 += c; s2 += c * c; c = texture2D(inputImageTexture, uv + vec2(3,0) * src_size).rgb; cSq = c * c; m2 += c; s2 += cSq; m3 += c; s3 += cSq; c = texture2D(inputImageTexture, uv + vec2(2,3) * src_size).rgb; m2 += c; s2 += c * c; c = texture2D(inputImageTexture, uv + vec2(2,2) * src_size).rgb; m2 += c; s2 += c * c; c = texture2D(inputImageTexture, uv + vec2(2,1) * src_size).rgb; m2 += c; s2 += c * c; c = texture2D(inputImageTexture, uv + vec2(2,0) * src_size).rgb; cSq = c * c; m2 += c; s2 += cSq; m3 += c; s3 += cSq; c = texture2D(inputImageTexture, uv + vec2(1,3) * src_size).rgb; m2 += c; s2 += c * c; c = texture2D(inputImageTexture, uv + vec2(1,2) * src_size).rgb; m2 += c; s2 += c * c; c = texture2D(inputImageTexture, uv + vec2(1,1) * src_size).rgb; m2 += c; s2 += c * c; c = texture2D(inputImageTexture, uv + vec2(1,0) * src_size).rgb; cSq = c * c; m2 += c; s2 += cSq; m3 += c; s3 += cSq; c = texture2D(inputImageTexture, uv + vec2(3,-3) * src_size).rgb; m3 += c; s3 += c * c; c = texture2D(inputImageTexture, uv + vec2(3,-2) * src_size).rgb; m3 += c; s3 += c * c; c = texture2D(inputImageTexture, uv + vec2(3,-1) * src_size).rgb; m3 += c; s3 += c * c; c = texture2D(inputImageTexture, uv + vec2(2,-3) * src_size).rgb; m3 += c; s3 += c * c; c = texture2D(inputImageTexture, uv + vec2(2,-2) * src_size).rgb; m3 += c; s3 += c * c; c = texture2D(inputImageTexture, uv + vec2(2,-1) * src_size).rgb; m3 += c; s3 += c * c; c = texture2D(inputImageTexture, uv + vec2(1,-3) * src_size).rgb; m3 += c; s3 += c * c; c = texture2D(inputImageTexture, uv + vec2(1,-2) * src_size).rgb; m3 += c; s3 += c * c; c = texture2D(inputImageTexture, uv + vec2(1,-1) * src_size).rgb; m3 += c; s3 += c * c; float min_sigma2 = 1e+2; m0 /= n; s0 = abs(s0 / n - m0 * m0); float sigma2 = s0.r + s0.g + s0.b; if (sigma2 < min_sigma2) { min_sigma2 = sigma2; gl_FragColor = vec4(m0, 1.0); } m1 /= n; s1 = abs(s1 / n - m1 * m1); sigma2 = s1.r + s1.g + s1.b; if (sigma2 < min_sigma2) { min_sigma2 = sigma2; gl_FragColor = vec4(m1, 1.0); } m2 /= n; s2 = abs(s2 / n - m2 * m2); sigma2 = s2.r + s2.g + s2.b; if (sigma2 < min_sigma2) { min_sigma2 = sigma2; gl_FragColor = vec4(m2, 1.0); } m3 /= n; s3 = abs(s3 / n - m3 * m3); sigma2 = s3.r + s3.g + s3.b; if (sigma2 < min_sigma2) { min_sigma2 = sigma2; gl_FragColor = vec4(m3, 1.0); } } ); #else NSString *const kGPUImageKuwaharaRadius3FragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; const vec2 src_size = vec2 (1.0 / 768.0, 1.0 / 1024.0); void main (void) { vec2 uv = textureCoordinate; float n = float(16); // radius is assumed to be 3 vec3 m0 = vec3(0.0); vec3 m1 = vec3(0.0); vec3 m2 = vec3(0.0); vec3 m3 = vec3(0.0); vec3 s0 = vec3(0.0); vec3 s1 = vec3(0.0); vec3 s2 = vec3(0.0); vec3 s3 = vec3(0.0); vec3 c; vec3 cSq; c = texture2D(inputImageTexture, uv + vec2(-3,-3) * src_size).rgb; m0 += c; s0 += c * c; c = texture2D(inputImageTexture, uv + vec2(-3,-2) * src_size).rgb; m0 += c; s0 += c * c; c = texture2D(inputImageTexture, uv + vec2(-3,-1) * src_size).rgb; m0 += c; s0 += c * c; c = texture2D(inputImageTexture, uv + vec2(-3,0) * src_size).rgb; cSq = c * c; m0 += c; s0 += cSq; m1 += c; s1 += cSq; c = texture2D(inputImageTexture, uv + vec2(-2,-3) * src_size).rgb; m0 += c; s0 += c * c; c = texture2D(inputImageTexture, uv + vec2(-2,-2) * src_size).rgb; m0 += c; s0 += c * c; c = texture2D(inputImageTexture, uv + vec2(-2,-1) * src_size).rgb; m0 += c; s0 += c * c; c = texture2D(inputImageTexture, uv + vec2(-2,0) * src_size).rgb; cSq = c * c; m0 += c; s0 += cSq; m1 += c; s1 += cSq; c = texture2D(inputImageTexture, uv + vec2(-1,-3) * src_size).rgb; m0 += c; s0 += c * c; c = texture2D(inputImageTexture, uv + vec2(-1,-2) * src_size).rgb; m0 += c; s0 += c * c; c = texture2D(inputImageTexture, uv + vec2(-1,-1) * src_size).rgb; m0 += c; s0 += c * c; c = texture2D(inputImageTexture, uv + vec2(-1,0) * src_size).rgb; cSq = c * c; m0 += c; s0 += cSq; m1 += c; s1 += cSq; c = texture2D(inputImageTexture, uv + vec2(0,-3) * src_size).rgb; cSq = c * c; m0 += c; s0 += cSq; m3 += c; s3 += cSq; c = texture2D(inputImageTexture, uv + vec2(0,-2) * src_size).rgb; cSq = c * c; m0 += c; s0 += cSq; m3 += c; s3 += cSq; c = texture2D(inputImageTexture, uv + vec2(0,-1) * src_size).rgb; cSq = c * c; m0 += c; s0 += cSq; m3 += c; s3 += cSq; c = texture2D(inputImageTexture, uv + vec2(0,0) * src_size).rgb; cSq = c * c; m0 += c; s0 += cSq; m1 += c; s1 += cSq; m2 += c; s2 += cSq; m3 += c; s3 += cSq; c = texture2D(inputImageTexture, uv + vec2(-3,3) * src_size).rgb; m1 += c; s1 += c * c; c = texture2D(inputImageTexture, uv + vec2(-3,2) * src_size).rgb; m1 += c; s1 += c * c; c = texture2D(inputImageTexture, uv + vec2(-3,1) * src_size).rgb; m1 += c; s1 += c * c; c = texture2D(inputImageTexture, uv + vec2(-2,3) * src_size).rgb; m1 += c; s1 += c * c; c = texture2D(inputImageTexture, uv + vec2(-2,2) * src_size).rgb; m1 += c; s1 += c * c; c = texture2D(inputImageTexture, uv + vec2(-2,1) * src_size).rgb; m1 += c; s1 += c * c; c = texture2D(inputImageTexture, uv + vec2(-1,3) * src_size).rgb; m1 += c; s1 += c * c; c = texture2D(inputImageTexture, uv + vec2(-1,2) * src_size).rgb; m1 += c; s1 += c * c; c = texture2D(inputImageTexture, uv + vec2(-1,1) * src_size).rgb; m1 += c; s1 += c * c; c = texture2D(inputImageTexture, uv + vec2(0,3) * src_size).rgb; cSq = c * c; m1 += c; s1 += cSq; m2 += c; s2 += cSq; c = texture2D(inputImageTexture, uv + vec2(0,2) * src_size).rgb; cSq = c * c; m1 += c; s1 += cSq; m2 += c; s2 += cSq; c = texture2D(inputImageTexture, uv + vec2(0,1) * src_size).rgb; cSq = c * c; m1 += c; s1 += cSq; m2 += c; s2 += cSq; c = texture2D(inputImageTexture, uv + vec2(3,3) * src_size).rgb; m2 += c; s2 += c * c; c = texture2D(inputImageTexture, uv + vec2(3,2) * src_size).rgb; m2 += c; s2 += c * c; c = texture2D(inputImageTexture, uv + vec2(3,1) * src_size).rgb; m2 += c; s2 += c * c; c = texture2D(inputImageTexture, uv + vec2(3,0) * src_size).rgb; cSq = c * c; m2 += c; s2 += cSq; m3 += c; s3 += cSq; c = texture2D(inputImageTexture, uv + vec2(2,3) * src_size).rgb; m2 += c; s2 += c * c; c = texture2D(inputImageTexture, uv + vec2(2,2) * src_size).rgb; m2 += c; s2 += c * c; c = texture2D(inputImageTexture, uv + vec2(2,1) * src_size).rgb; m2 += c; s2 += c * c; c = texture2D(inputImageTexture, uv + vec2(2,0) * src_size).rgb; cSq = c * c; m2 += c; s2 += cSq; m3 += c; s3 += cSq; c = texture2D(inputImageTexture, uv + vec2(1,3) * src_size).rgb; m2 += c; s2 += c * c; c = texture2D(inputImageTexture, uv + vec2(1,2) * src_size).rgb; m2 += c; s2 += c * c; c = texture2D(inputImageTexture, uv + vec2(1,1) * src_size).rgb; m2 += c; s2 += c * c; c = texture2D(inputImageTexture, uv + vec2(1,0) * src_size).rgb; cSq = c * c; m2 += c; s2 += cSq; m3 += c; s3 += cSq; c = texture2D(inputImageTexture, uv + vec2(3,-3) * src_size).rgb; m3 += c; s3 += c * c; c = texture2D(inputImageTexture, uv + vec2(3,-2) * src_size).rgb; m3 += c; s3 += c * c; c = texture2D(inputImageTexture, uv + vec2(3,-1) * src_size).rgb; m3 += c; s3 += c * c; c = texture2D(inputImageTexture, uv + vec2(2,-3) * src_size).rgb; m3 += c; s3 += c * c; c = texture2D(inputImageTexture, uv + vec2(2,-2) * src_size).rgb; m3 += c; s3 += c * c; c = texture2D(inputImageTexture, uv + vec2(2,-1) * src_size).rgb; m3 += c; s3 += c * c; c = texture2D(inputImageTexture, uv + vec2(1,-3) * src_size).rgb; m3 += c; s3 += c * c; c = texture2D(inputImageTexture, uv + vec2(1,-2) * src_size).rgb; m3 += c; s3 += c * c; c = texture2D(inputImageTexture, uv + vec2(1,-1) * src_size).rgb; m3 += c; s3 += c * c; float min_sigma2 = 1e+2; m0 /= n; s0 = abs(s0 / n - m0 * m0); float sigma2 = s0.r + s0.g + s0.b; if (sigma2 < min_sigma2) { min_sigma2 = sigma2; gl_FragColor = vec4(m0, 1.0); } m1 /= n; s1 = abs(s1 / n - m1 * m1); sigma2 = s1.r + s1.g + s1.b; if (sigma2 < min_sigma2) { min_sigma2 = sigma2; gl_FragColor = vec4(m1, 1.0); } m2 /= n; s2 = abs(s2 / n - m2 * m2); sigma2 = s2.r + s2.g + s2.b; if (sigma2 < min_sigma2) { min_sigma2 = sigma2; gl_FragColor = vec4(m2, 1.0); } m3 /= n; s3 = abs(s3 / n - m3 * m3); sigma2 = s3.r + s3.g + s3.b; if (sigma2 < min_sigma2) { min_sigma2 = sigma2; gl_FragColor = vec4(m3, 1.0); } } ); #endif @implementation GPUImageKuwaharaRadius3Filter #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageKuwaharaRadius3FragmentShaderString])) { return nil; } return self; } @end ================================================ FILE: framework/Source/GPUImageLanczosResamplingFilter.h ================================================ #import "GPUImageTwoPassTextureSamplingFilter.h" @interface GPUImageLanczosResamplingFilter : GPUImageTwoPassTextureSamplingFilter @property(readwrite, nonatomic) CGSize originalImageSize; @end ================================================ FILE: framework/Source/GPUImageLanczosResamplingFilter.m ================================================ #import "GPUImageLanczosResamplingFilter.h" NSString *const kGPUImageLanczosVertexShaderString = SHADER_STRING ( attribute vec4 position; attribute vec2 inputTextureCoordinate; uniform float texelWidthOffset; uniform float texelHeightOffset; varying vec2 centerTextureCoordinate; varying vec2 oneStepLeftTextureCoordinate; varying vec2 twoStepsLeftTextureCoordinate; varying vec2 threeStepsLeftTextureCoordinate; varying vec2 fourStepsLeftTextureCoordinate; varying vec2 oneStepRightTextureCoordinate; varying vec2 twoStepsRightTextureCoordinate; varying vec2 threeStepsRightTextureCoordinate; varying vec2 fourStepsRightTextureCoordinate; void main() { gl_Position = position; vec2 firstOffset = vec2(texelWidthOffset, texelHeightOffset); vec2 secondOffset = vec2(2.0 * texelWidthOffset, 2.0 * texelHeightOffset); vec2 thirdOffset = vec2(3.0 * texelWidthOffset, 3.0 * texelHeightOffset); vec2 fourthOffset = vec2(4.0 * texelWidthOffset, 4.0 * texelHeightOffset); centerTextureCoordinate = inputTextureCoordinate; oneStepLeftTextureCoordinate = inputTextureCoordinate - firstOffset; twoStepsLeftTextureCoordinate = inputTextureCoordinate - secondOffset; threeStepsLeftTextureCoordinate = inputTextureCoordinate - thirdOffset; fourStepsLeftTextureCoordinate = inputTextureCoordinate - fourthOffset; oneStepRightTextureCoordinate = inputTextureCoordinate + firstOffset; twoStepsRightTextureCoordinate = inputTextureCoordinate + secondOffset; threeStepsRightTextureCoordinate = inputTextureCoordinate + thirdOffset; fourStepsRightTextureCoordinate = inputTextureCoordinate + fourthOffset; } ); #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageLanczosFragmentShaderString = SHADER_STRING ( precision highp float; uniform sampler2D inputImageTexture; varying vec2 centerTextureCoordinate; varying vec2 oneStepLeftTextureCoordinate; varying vec2 twoStepsLeftTextureCoordinate; varying vec2 threeStepsLeftTextureCoordinate; varying vec2 fourStepsLeftTextureCoordinate; varying vec2 oneStepRightTextureCoordinate; varying vec2 twoStepsRightTextureCoordinate; varying vec2 threeStepsRightTextureCoordinate; varying vec2 fourStepsRightTextureCoordinate; // sinc(x) * sinc(x/a) = (a * sin(pi * x) * sin(pi * x / a)) / (pi^2 * x^2) // Assuming a Lanczos constant of 2.0, and scaling values to max out at x = +/- 1.5 void main() { lowp vec4 fragmentColor = texture2D(inputImageTexture, centerTextureCoordinate) * 0.38026; fragmentColor += texture2D(inputImageTexture, oneStepLeftTextureCoordinate) * 0.27667; fragmentColor += texture2D(inputImageTexture, oneStepRightTextureCoordinate) * 0.27667; fragmentColor += texture2D(inputImageTexture, twoStepsLeftTextureCoordinate) * 0.08074; fragmentColor += texture2D(inputImageTexture, twoStepsRightTextureCoordinate) * 0.08074; fragmentColor += texture2D(inputImageTexture, threeStepsLeftTextureCoordinate) * -0.02612; fragmentColor += texture2D(inputImageTexture, threeStepsRightTextureCoordinate) * -0.02612; fragmentColor += texture2D(inputImageTexture, fourStepsLeftTextureCoordinate) * -0.02143; fragmentColor += texture2D(inputImageTexture, fourStepsRightTextureCoordinate) * -0.02143; gl_FragColor = fragmentColor; } ); #else NSString *const kGPUImageLanczosFragmentShaderString = SHADER_STRING ( uniform sampler2D inputImageTexture; varying vec2 centerTextureCoordinate; varying vec2 oneStepLeftTextureCoordinate; varying vec2 twoStepsLeftTextureCoordinate; varying vec2 threeStepsLeftTextureCoordinate; varying vec2 fourStepsLeftTextureCoordinate; varying vec2 oneStepRightTextureCoordinate; varying vec2 twoStepsRightTextureCoordinate; varying vec2 threeStepsRightTextureCoordinate; varying vec2 fourStepsRightTextureCoordinate; // sinc(x) * sinc(x/a) = (a * sin(pi * x) * sin(pi * x / a)) / (pi^2 * x^2) // Assuming a Lanczos constant of 2.0, and scaling values to max out at x = +/- 1.5 void main() { vec4 fragmentColor = texture2D(inputImageTexture, centerTextureCoordinate) * 0.38026; fragmentColor += texture2D(inputImageTexture, oneStepLeftTextureCoordinate) * 0.27667; fragmentColor += texture2D(inputImageTexture, oneStepRightTextureCoordinate) * 0.27667; fragmentColor += texture2D(inputImageTexture, twoStepsLeftTextureCoordinate) * 0.08074; fragmentColor += texture2D(inputImageTexture, twoStepsRightTextureCoordinate) * 0.08074; fragmentColor += texture2D(inputImageTexture, threeStepsLeftTextureCoordinate) * -0.02612; fragmentColor += texture2D(inputImageTexture, threeStepsRightTextureCoordinate) * -0.02612; fragmentColor += texture2D(inputImageTexture, fourStepsLeftTextureCoordinate) * -0.02143; fragmentColor += texture2D(inputImageTexture, fourStepsRightTextureCoordinate) * -0.02143; gl_FragColor = fragmentColor; } ); #endif @implementation GPUImageLanczosResamplingFilter @synthesize originalImageSize = _originalImageSize; #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super initWithFirstStageVertexShaderFromString:kGPUImageLanczosVertexShaderString firstStageFragmentShaderFromString:kGPUImageLanczosFragmentShaderString secondStageVertexShaderFromString:kGPUImageLanczosVertexShaderString secondStageFragmentShaderFromString:kGPUImageLanczosFragmentShaderString])) { return nil; } return self; } // Base texture sampling offset on the input image, not the final size - (void)setInputSize:(CGSize)newSize atIndex:(NSInteger)textureIndex; { self.originalImageSize = newSize; [super setInputSize:newSize atIndex:textureIndex]; } - (void)setupFilterForSize:(CGSize)filterFrameSize; { runSynchronouslyOnVideoProcessingQueue(^{ // The first pass through the framebuffer may rotate the inbound image, so need to account for that by changing up the kernel ordering for that pass if (GPUImageRotationSwapsWidthAndHeight(inputRotation)) { verticalPassTexelWidthOffset = 1.0 / _originalImageSize.height; verticalPassTexelHeightOffset = 0.0; } else { verticalPassTexelWidthOffset = 0.0; verticalPassTexelHeightOffset = 1.0 / _originalImageSize.height; } horizontalPassTexelWidthOffset = 1.0 / _originalImageSize.width; horizontalPassTexelHeightOffset = 0.0; }); } - (void)renderToTextureWithVertices:(const GLfloat *)vertices textureCoordinates:(const GLfloat *)textureCoordinates; { if (self.preventRendering) { [firstInputFramebuffer unlock]; return; } [GPUImageContext setActiveShaderProgram:filterProgram]; CGSize currentFBOSize = [self sizeOfFBO]; if (GPUImageRotationSwapsWidthAndHeight(inputRotation)) { currentFBOSize.height = self.originalImageSize.height; } else { currentFBOSize.width = self.originalImageSize.width; } outputFramebuffer = [[GPUImageContext sharedFramebufferCache] fetchFramebufferForSize:currentFBOSize textureOptions:self.outputTextureOptions onlyTexture:NO]; [outputFramebuffer activateFramebuffer]; [self setUniformsForProgramAtIndex:0]; glClearColor(backgroundColorRed, backgroundColorGreen, backgroundColorBlue, backgroundColorAlpha); glClear(GL_COLOR_BUFFER_BIT); glActiveTexture(GL_TEXTURE2); glBindTexture(GL_TEXTURE_2D, [firstInputFramebuffer texture]); glUniform1i(filterInputTextureUniform, 2); glVertexAttribPointer(filterPositionAttribute, 2, GL_FLOAT, 0, 0, vertices); glVertexAttribPointer(filterTextureCoordinateAttribute, 2, GL_FLOAT, 0, 0, textureCoordinates); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); [firstInputFramebuffer unlock]; // Run the second stage of the two-pass filter [GPUImageContext setActiveShaderProgram:secondFilterProgram]; glActiveTexture(GL_TEXTURE2); glBindTexture(GL_TEXTURE_2D, 0); glActiveTexture(GL_TEXTURE3); glBindTexture(GL_TEXTURE_2D, 0); secondOutputFramebuffer = [[GPUImageContext sharedFramebufferCache] fetchFramebufferForSize:[self sizeOfFBO] textureOptions:self.outputTextureOptions onlyTexture:NO]; [secondOutputFramebuffer activateFramebuffer]; if (usingNextFrameForImageCapture) { [secondOutputFramebuffer lock]; } [self setUniformsForProgramAtIndex:1]; glActiveTexture(GL_TEXTURE3); glBindTexture(GL_TEXTURE_2D, [outputFramebuffer texture]); glVertexAttribPointer(secondFilterTextureCoordinateAttribute, 2, GL_FLOAT, 0, 0, [[self class] textureCoordinatesForRotation:kGPUImageNoRotation]); glUniform1i(secondFilterInputTextureUniform, 3); glVertexAttribPointer(secondFilterPositionAttribute, 2, GL_FLOAT, 0, 0, vertices); glClearColor(0.0f, 0.0f, 0.0f, 1.0f); glClear(GL_COLOR_BUFFER_BIT); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); [outputFramebuffer unlock]; outputFramebuffer = nil; if (usingNextFrameForImageCapture) { dispatch_semaphore_signal(imageCaptureSemaphore); } } @end ================================================ FILE: framework/Source/GPUImageLaplacianFilter.h ================================================ #import "GPUImage3x3ConvolutionFilter.h" @interface GPUImageLaplacianFilter : GPUImage3x3ConvolutionFilter @end ================================================ FILE: framework/Source/GPUImageLaplacianFilter.m ================================================ #import "GPUImageLaplacianFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageLaplacianFragmentShaderString = SHADER_STRING ( precision highp float; uniform sampler2D inputImageTexture; uniform mediump mat3 convolutionMatrix; varying vec2 textureCoordinate; varying vec2 leftTextureCoordinate; varying vec2 rightTextureCoordinate; varying vec2 topTextureCoordinate; varying vec2 topLeftTextureCoordinate; varying vec2 topRightTextureCoordinate; varying vec2 bottomTextureCoordinate; varying vec2 bottomLeftTextureCoordinate; varying vec2 bottomRightTextureCoordinate; void main() { mediump vec3 bottomColor = texture2D(inputImageTexture, bottomTextureCoordinate).rgb; mediump vec3 bottomLeftColor = texture2D(inputImageTexture, bottomLeftTextureCoordinate).rgb; mediump vec3 bottomRightColor = texture2D(inputImageTexture, bottomRightTextureCoordinate).rgb; mediump vec4 centerColor = texture2D(inputImageTexture, textureCoordinate); mediump vec3 leftColor = texture2D(inputImageTexture, leftTextureCoordinate).rgb; mediump vec3 rightColor = texture2D(inputImageTexture, rightTextureCoordinate).rgb; mediump vec3 topColor = texture2D(inputImageTexture, topTextureCoordinate).rgb; mediump vec3 topRightColor = texture2D(inputImageTexture, topRightTextureCoordinate).rgb; mediump vec3 topLeftColor = texture2D(inputImageTexture, topLeftTextureCoordinate).rgb; mediump vec3 resultColor = topLeftColor * convolutionMatrix[0][0] + topColor * convolutionMatrix[0][1] + topRightColor * convolutionMatrix[0][2]; resultColor += leftColor * convolutionMatrix[1][0] + centerColor.rgb * convolutionMatrix[1][1] + rightColor * convolutionMatrix[1][2]; resultColor += bottomLeftColor * convolutionMatrix[2][0] + bottomColor * convolutionMatrix[2][1] + bottomRightColor * convolutionMatrix[2][2]; // Normalize the results to allow for negative gradients in the 0.0-1.0 colorspace resultColor = resultColor + 0.5; gl_FragColor = vec4(resultColor, centerColor.a); } ); #else NSString *const kGPUImageLaplacianFragmentShaderString = SHADER_STRING ( uniform sampler2D inputImageTexture; uniform mat3 convolutionMatrix; varying vec2 textureCoordinate; varying vec2 leftTextureCoordinate; varying vec2 rightTextureCoordinate; varying vec2 topTextureCoordinate; varying vec2 topLeftTextureCoordinate; varying vec2 topRightTextureCoordinate; varying vec2 bottomTextureCoordinate; varying vec2 bottomLeftTextureCoordinate; varying vec2 bottomRightTextureCoordinate; void main() { vec3 bottomColor = texture2D(inputImageTexture, bottomTextureCoordinate).rgb; vec3 bottomLeftColor = texture2D(inputImageTexture, bottomLeftTextureCoordinate).rgb; vec3 bottomRightColor = texture2D(inputImageTexture, bottomRightTextureCoordinate).rgb; vec4 centerColor = texture2D(inputImageTexture, textureCoordinate); vec3 leftColor = texture2D(inputImageTexture, leftTextureCoordinate).rgb; vec3 rightColor = texture2D(inputImageTexture, rightTextureCoordinate).rgb; vec3 topColor = texture2D(inputImageTexture, topTextureCoordinate).rgb; vec3 topRightColor = texture2D(inputImageTexture, topRightTextureCoordinate).rgb; vec3 topLeftColor = texture2D(inputImageTexture, topLeftTextureCoordinate).rgb; vec3 resultColor = topLeftColor * convolutionMatrix[0][0] + topColor * convolutionMatrix[0][1] + topRightColor * convolutionMatrix[0][2]; resultColor += leftColor * convolutionMatrix[1][0] + centerColor.rgb * convolutionMatrix[1][1] + rightColor * convolutionMatrix[1][2]; resultColor += bottomLeftColor * convolutionMatrix[2][0] + bottomColor * convolutionMatrix[2][1] + bottomRightColor * convolutionMatrix[2][2]; // Normalize the results to allow for negative gradients in the 0.0-1.0 colorspace resultColor = resultColor + 0.5; gl_FragColor = vec4(resultColor, centerColor.a); } ); #endif @implementation GPUImageLaplacianFilter - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageLaplacianFragmentShaderString])) { return nil; } GPUMatrix3x3 newConvolutionMatrix; newConvolutionMatrix.one.one = 0.5; newConvolutionMatrix.one.two = 1.0; newConvolutionMatrix.one.three = 0.5; newConvolutionMatrix.two.one = 1.0; newConvolutionMatrix.two.two = -6.0; newConvolutionMatrix.two.three = 1.0; newConvolutionMatrix.three.one = 0.5; newConvolutionMatrix.three.two = 1.0; newConvolutionMatrix.three.three = 0.5; self.convolutionKernel = newConvolutionMatrix; return self; } @end ================================================ FILE: framework/Source/GPUImageLevelsFilter.h ================================================ #import "GPUImageFilter.h" /** * Levels like Photoshop. * * The min, max, minOut and maxOut parameters are floats in the range [0, 1]. * If you have parameters from Photoshop in the range [0, 255] you must first * convert them to be [0, 1]. * The gamma/mid parameter is a float >= 0. This matches the value from Photoshop. * * If you want to apply levels to RGB as well as individual channels you need to use * this filter twice - first for the individual channels and then for all channels. */ @interface GPUImageLevelsFilter : GPUImageFilter { GLint minUniform; GLint midUniform; GLint maxUniform; GLint minOutputUniform; GLint maxOutputUniform; GPUVector3 minVector, midVector, maxVector, minOutputVector, maxOutputVector; } /** Set levels for the red channel */ - (void)setRedMin:(CGFloat)min gamma:(CGFloat)mid max:(CGFloat)max minOut:(CGFloat)minOut maxOut:(CGFloat)maxOut; - (void)setRedMin:(CGFloat)min gamma:(CGFloat)mid max:(CGFloat)max; /** Set levels for the green channel */ - (void)setGreenMin:(CGFloat)min gamma:(CGFloat)mid max:(CGFloat)max minOut:(CGFloat)minOut maxOut:(CGFloat)maxOut; - (void)setGreenMin:(CGFloat)min gamma:(CGFloat)mid max:(CGFloat)max; /** Set levels for the blue channel */ - (void)setBlueMin:(CGFloat)min gamma:(CGFloat)mid max:(CGFloat)max minOut:(CGFloat)minOut maxOut:(CGFloat)maxOut; - (void)setBlueMin:(CGFloat)min gamma:(CGFloat)mid max:(CGFloat)max; /** Set levels for all channels at once */ - (void)setMin:(CGFloat)min gamma:(CGFloat)mid max:(CGFloat)max minOut:(CGFloat)minOut maxOut:(CGFloat)maxOut; - (void)setMin:(CGFloat)min gamma:(CGFloat)mid max:(CGFloat)max; @end ================================================ FILE: framework/Source/GPUImageLevelsFilter.m ================================================ #import "GPUImageLevelsFilter.h" /* ** Gamma correction ** Details: http://blog.mouaif.org/2009/01/22/photoshop-gamma-correction-shader/ */ #define GammaCorrection(color, gamma) pow(color, 1.0 / gamma) /* ** Levels control (input (+gamma), output) ** Details: http://blog.mouaif.org/2009/01/28/levels-control-shader/ */ #define LevelsControlInputRange(color, minInput, maxInput) min(max(color - minInput, vec3(0.0)) / (maxInput - minInput), vec3(1.0)) #define LevelsControlInput(color, minInput, gamma, maxInput) GammaCorrection(LevelsControlInputRange(color, minInput, maxInput), gamma) #define LevelsControlOutputRange(color, minOutput, maxOutput) mix(minOutput, maxOutput, color) #define LevelsControl(color, minInput, gamma, maxInput, minOutput, maxOutput) LevelsControlOutputRange(LevelsControlInput(color, minInput, gamma, maxInput), minOutput, maxOutput) #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageLevelsFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform mediump vec3 levelMinimum; uniform mediump vec3 levelMiddle; uniform mediump vec3 levelMaximum; uniform mediump vec3 minOutput; uniform mediump vec3 maxOutput; void main() { mediump vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); gl_FragColor = vec4(LevelsControl(textureColor.rgb, levelMinimum, levelMiddle, levelMaximum, minOutput, maxOutput), textureColor.a); } ); #else NSString *const kGPUImageLevelsFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform vec3 levelMinimum; uniform vec3 levelMiddle; uniform vec3 levelMaximum; uniform vec3 minOutput; uniform vec3 maxOutput; void main() { vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); gl_FragColor = vec4(LevelsControl(textureColor.rgb, levelMinimum, levelMiddle, levelMaximum, minOutput, maxOutput), textureColor.a); } ); #endif @implementation GPUImageLevelsFilter #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageLevelsFragmentShaderString])) { return nil; } minUniform = [filterProgram uniformIndex:@"levelMinimum"]; midUniform = [filterProgram uniformIndex:@"levelMiddle"]; maxUniform = [filterProgram uniformIndex:@"levelMaximum"]; minOutputUniform = [filterProgram uniformIndex:@"minOutput"]; maxOutputUniform = [filterProgram uniformIndex:@"maxOutput"]; [self setRedMin:0.0 gamma:1.0 max:1.0 minOut:0.0 maxOut:1.0]; [self setGreenMin:0.0 gamma:1.0 max:1.0 minOut:0.0 maxOut:1.0]; [self setBlueMin:0.0 gamma:1.0 max:1.0 minOut:0.0 maxOut:1.0]; return self; } #pragma mark - #pragma mark Helpers - (void)updateUniforms { [self setVec3:minVector forUniform:minUniform program:filterProgram]; [self setVec3:midVector forUniform:midUniform program:filterProgram]; [self setVec3:maxVector forUniform:maxUniform program:filterProgram]; [self setVec3:minOutputVector forUniform:minOutputUniform program:filterProgram]; [self setVec3:maxOutputVector forUniform:maxOutputUniform program:filterProgram]; } #pragma mark - #pragma mark Accessors - (void)setMin:(CGFloat)min gamma:(CGFloat)mid max:(CGFloat)max minOut:(CGFloat)minOut maxOut:(CGFloat)maxOut { [self setRedMin:min gamma:mid max:max minOut:minOut maxOut:maxOut]; [self setGreenMin:min gamma:mid max:max minOut:minOut maxOut:maxOut]; [self setBlueMin:min gamma:mid max:max minOut:minOut maxOut:maxOut]; } - (void)setMin:(CGFloat)min gamma:(CGFloat)mid max:(CGFloat)max { [self setMin:min gamma:mid max:max minOut:0.0 maxOut:1.0]; } - (void)setRedMin:(CGFloat)min gamma:(CGFloat)mid max:(CGFloat)max minOut:(CGFloat)minOut maxOut:(CGFloat)maxOut { minVector.one = min; midVector.one = mid; maxVector.one = max; minOutputVector.one = minOut; maxOutputVector.one = maxOut; [self updateUniforms]; } - (void)setRedMin:(CGFloat)min gamma:(CGFloat)mid max:(CGFloat)max { [self setRedMin:min gamma:mid max:max minOut:0.0 maxOut:1.0]; } - (void)setGreenMin:(CGFloat)min gamma:(CGFloat)mid max:(CGFloat)max minOut:(CGFloat)minOut maxOut:(CGFloat)maxOut { minVector.two = min; midVector.two = mid; maxVector.two = max; minOutputVector.two = minOut; maxOutputVector.two = maxOut; [self updateUniforms]; } - (void)setGreenMin:(CGFloat)min gamma:(CGFloat)mid max:(CGFloat)max { [self setGreenMin:min gamma:mid max:max minOut:0.0 maxOut:1.0]; } - (void)setBlueMin:(CGFloat)min gamma:(CGFloat)mid max:(CGFloat)max minOut:(CGFloat)minOut maxOut:(CGFloat)maxOut { minVector.three = min; midVector.three = mid; maxVector.three = max; minOutputVector.three = minOut; maxOutputVector.three = maxOut; [self updateUniforms]; } - (void)setBlueMin:(CGFloat)min gamma:(CGFloat)mid max:(CGFloat)max { [self setBlueMin:min gamma:mid max:max minOut:0.0 maxOut:1.0]; } @end ================================================ FILE: framework/Source/GPUImageLightenBlendFilter.h ================================================ #import "GPUImageTwoInputFilter.h" /// Blends two images by taking the maximum value of each color component between the images @interface GPUImageLightenBlendFilter : GPUImageTwoInputFilter { } @end ================================================ FILE: framework/Source/GPUImageLightenBlendFilter.m ================================================ #import "GPUImageLightenBlendFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageLightenBlendFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; varying highp vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; void main() { lowp vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); lowp vec4 textureColor2 = texture2D(inputImageTexture2, textureCoordinate2); gl_FragColor = max(textureColor, textureColor2); } ); #else NSString *const kGPUImageLightenBlendFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; varying vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; void main() { vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); vec4 textureColor2 = texture2D(inputImageTexture2, textureCoordinate2); gl_FragColor = max(textureColor, textureColor2); } ); #endif @implementation GPUImageLightenBlendFilter - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageLightenBlendFragmentShaderString])) { return nil; } return self; } @end ================================================ FILE: framework/Source/GPUImageLineGenerator.h ================================================ #import "GPUImageFilter.h" @interface GPUImageLineGenerator : GPUImageFilter { GLint lineWidthUniform, lineColorUniform; GLfloat *lineCoordinates; } // The width of the displayed lines, in pixels. The default is 1. @property(readwrite, nonatomic) CGFloat lineWidth; // The color of the lines is specified using individual red, green, and blue components (normalized to 1.0). The default is green: (0.0, 1.0, 0.0). - (void)setLineColorRed:(GLfloat)redComponent green:(GLfloat)greenComponent blue:(GLfloat)blueComponent; // Rendering - (void)renderLinesFromArray:(GLfloat *)lineSlopeAndIntercepts count:(NSUInteger)numberOfLines frameTime:(CMTime)frameTime; @end ================================================ FILE: framework/Source/GPUImageLineGenerator.m ================================================ #import "GPUImageLineGenerator.h" NSString *const kGPUImageLineGeneratorVertexShaderString = SHADER_STRING ( attribute vec4 position; void main() { gl_Position = position; } ); #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageLineGeneratorFragmentShaderString = SHADER_STRING ( uniform lowp vec3 lineColor; void main() { gl_FragColor = vec4(lineColor, 1.0); } ); #else NSString *const kGPUImageLineGeneratorFragmentShaderString = SHADER_STRING ( uniform vec3 lineColor; void main() { gl_FragColor = vec4(lineColor, 1.0); } ); #endif @interface GPUImageLineGenerator() - (void)generateLineCoordinates; @end @implementation GPUImageLineGenerator @synthesize lineWidth = _lineWidth; #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super initWithVertexShaderFromString:kGPUImageLineGeneratorVertexShaderString fragmentShaderFromString:kGPUImageLineGeneratorFragmentShaderString])) { return nil; } runSynchronouslyOnVideoProcessingQueue(^{ lineWidthUniform = [filterProgram uniformIndex:@"lineWidth"]; lineColorUniform = [filterProgram uniformIndex:@"lineColor"]; self.lineWidth = 1.0; [self setLineColorRed:0.0 green:1.0 blue:0.0]; }); return self; } - (void)dealloc { if (lineCoordinates) { free(lineCoordinates); } } #pragma mark - #pragma mark Rendering - (void)generateLineCoordinates; { lineCoordinates = calloc(1024 * 4, sizeof(GLfloat)); } - (void)renderLinesFromArray:(GLfloat *)lineSlopeAndIntercepts count:(NSUInteger)numberOfLines frameTime:(CMTime)frameTime; { if (self.preventRendering) { return; } if (lineCoordinates == NULL) { [self generateLineCoordinates]; } // Iterate through and generate vertices from the slopes and intercepts NSUInteger currentVertexIndex = 0; NSUInteger currentLineIndex = 0; NSUInteger maxLineIndex = numberOfLines *2; while(currentLineIndex < maxLineIndex) { GLfloat slope = lineSlopeAndIntercepts[currentLineIndex++]; GLfloat intercept = lineSlopeAndIntercepts[currentLineIndex++]; if (slope > 9000.0) // Vertical line { lineCoordinates[currentVertexIndex++] = intercept; lineCoordinates[currentVertexIndex++] = -1.0; lineCoordinates[currentVertexIndex++] = intercept; lineCoordinates[currentVertexIndex++] = 1.0; } else { lineCoordinates[currentVertexIndex++] = -1.0; lineCoordinates[currentVertexIndex++] = slope * -1.0 + intercept; lineCoordinates[currentVertexIndex++] = 1.0; lineCoordinates[currentVertexIndex++] = slope * 1.0 + intercept; } } runSynchronouslyOnVideoProcessingQueue(^{ [GPUImageContext setActiveShaderProgram:filterProgram]; outputFramebuffer = [[GPUImageContext sharedFramebufferCache] fetchFramebufferForSize:[self sizeOfFBO] textureOptions:self.outputTextureOptions onlyTexture:NO]; [outputFramebuffer activateFramebuffer]; glClearColor(0.0, 0.0, 0.0, 0.0); glClear(GL_COLOR_BUFFER_BIT); glBlendEquation(GL_FUNC_ADD); glBlendFunc(GL_ONE, GL_ONE); glEnable(GL_BLEND); glVertexAttribPointer(filterPositionAttribute, 2, GL_FLOAT, 0, 0, lineCoordinates); glDrawArrays(GL_LINES, 0, ((unsigned int)numberOfLines * 2)); glDisable(GL_BLEND); [self informTargetsAboutNewFrameAtTime:frameTime]; }); } - (void)renderToTextureWithVertices:(const GLfloat *)vertices textureCoordinates:(const GLfloat *)textureCoordinates; { // Prevent rendering of the frame by normal means } #pragma mark - #pragma mark Accessors - (void)setLineWidth:(CGFloat)newValue; { _lineWidth = newValue; [GPUImageContext setActiveShaderProgram:filterProgram]; glLineWidth(newValue); } - (void)setLineColorRed:(GLfloat)redComponent green:(GLfloat)greenComponent blue:(GLfloat)blueComponent; { GPUVector3 lineColor = {redComponent, greenComponent, blueComponent}; [self setVec3:lineColor forUniform:lineColorUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImageLinearBurnBlendFilter.h ================================================ #import "GPUImageTwoInputFilter.h" @interface GPUImageLinearBurnBlendFilter : GPUImageTwoInputFilter @end ================================================ FILE: framework/Source/GPUImageLinearBurnBlendFilter.m ================================================ #import "GPUImageLinearBurnBlendFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageLinearBurnBlendFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; varying highp vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; void main() { mediump vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); mediump vec4 textureColor2 = texture2D(inputImageTexture2, textureCoordinate2); gl_FragColor = vec4(clamp(textureColor.rgb + textureColor2.rgb - vec3(1.0), vec3(0.0), vec3(1.0)), textureColor.a); } ); #else NSString *const kGPUImageLinearBurnBlendFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; varying vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; void main() { vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); vec4 textureColor2 = texture2D(inputImageTexture2, textureCoordinate2); gl_FragColor = vec4(clamp(textureColor.rgb + textureColor2.rgb - vec3(1.0), vec3(0.0), vec3(1.0)), textureColor.a); } ); #endif @implementation GPUImageLinearBurnBlendFilter - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageLinearBurnBlendFragmentShaderString])) { return nil; } return self; } @end ================================================ FILE: framework/Source/GPUImageLocalBinaryPatternFilter.h ================================================ #import "GPUImage3x3TextureSamplingFilter.h" @interface GPUImageLocalBinaryPatternFilter : GPUImage3x3TextureSamplingFilter @end ================================================ FILE: framework/Source/GPUImageLocalBinaryPatternFilter.m ================================================ #import "GPUImageLocalBinaryPatternFilter.h" // This is based on "Accelerating image recognition on mobile devices using GPGPU" by Miguel Bordallo Lopez, Henri Nykanen, Jari Hannuksela, Olli Silven and Markku Vehvilainen // http://www.ee.oulu.fi/~jhannuks/publications/SPIE2011a.pdf // Right pixel is the most significant bit, traveling clockwise to get to the upper right, which is the least significant // If the external pixel is greater than or equal to the center, set to 1, otherwise 0 // // 2 1 0 // 3 7 // 4 5 6 // 01101101 // 76543210 @implementation GPUImageLocalBinaryPatternFilter #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageLocalBinaryPatternFragmentShaderString = SHADER_STRING ( precision highp float; varying vec2 textureCoordinate; varying vec2 leftTextureCoordinate; varying vec2 rightTextureCoordinate; varying vec2 topTextureCoordinate; varying vec2 topLeftTextureCoordinate; varying vec2 topRightTextureCoordinate; varying vec2 bottomTextureCoordinate; varying vec2 bottomLeftTextureCoordinate; varying vec2 bottomRightTextureCoordinate; uniform sampler2D inputImageTexture; void main() { lowp float centerIntensity = texture2D(inputImageTexture, textureCoordinate).r; lowp float bottomLeftIntensity = texture2D(inputImageTexture, bottomLeftTextureCoordinate).r; lowp float topRightIntensity = texture2D(inputImageTexture, topRightTextureCoordinate).r; lowp float topLeftIntensity = texture2D(inputImageTexture, topLeftTextureCoordinate).r; lowp float bottomRightIntensity = texture2D(inputImageTexture, bottomRightTextureCoordinate).r; lowp float leftIntensity = texture2D(inputImageTexture, leftTextureCoordinate).r; lowp float rightIntensity = texture2D(inputImageTexture, rightTextureCoordinate).r; lowp float bottomIntensity = texture2D(inputImageTexture, bottomTextureCoordinate).r; lowp float topIntensity = texture2D(inputImageTexture, topTextureCoordinate).r; lowp float byteTally = 1.0 / 255.0 * step(centerIntensity, topRightIntensity); byteTally += 2.0 / 255.0 * step(centerIntensity, topIntensity); byteTally += 4.0 / 255.0 * step(centerIntensity, topLeftIntensity); byteTally += 8.0 / 255.0 * step(centerIntensity, leftIntensity); byteTally += 16.0 / 255.0 * step(centerIntensity, bottomLeftIntensity); byteTally += 32.0 / 255.0 * step(centerIntensity, bottomIntensity); byteTally += 64.0 / 255.0 * step(centerIntensity, bottomRightIntensity); byteTally += 128.0 / 255.0 * step(centerIntensity, rightIntensity); // TODO: Replace the above with a dot product and two vec4s // TODO: Apply step to a matrix, rather than individually gl_FragColor = vec4(byteTally, byteTally, byteTally, 1.0); } ); #else NSString *const kGPUImageLocalBinaryPatternFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; varying vec2 leftTextureCoordinate; varying vec2 rightTextureCoordinate; varying vec2 topTextureCoordinate; varying vec2 topLeftTextureCoordinate; varying vec2 topRightTextureCoordinate; varying vec2 bottomTextureCoordinate; varying vec2 bottomLeftTextureCoordinate; varying vec2 bottomRightTextureCoordinate; uniform sampler2D inputImageTexture; void main() { float centerIntensity = texture2D(inputImageTexture, textureCoordinate).r; float bottomLeftIntensity = texture2D(inputImageTexture, bottomLeftTextureCoordinate).r; float topRightIntensity = texture2D(inputImageTexture, topRightTextureCoordinate).r; float topLeftIntensity = texture2D(inputImageTexture, topLeftTextureCoordinate).r; float bottomRightIntensity = texture2D(inputImageTexture, bottomRightTextureCoordinate).r; float leftIntensity = texture2D(inputImageTexture, leftTextureCoordinate).r; float rightIntensity = texture2D(inputImageTexture, rightTextureCoordinate).r; float bottomIntensity = texture2D(inputImageTexture, bottomTextureCoordinate).r; float topIntensity = texture2D(inputImageTexture, topTextureCoordinate).r; float byteTally = 1.0 / 255.0 * step(centerIntensity, topRightIntensity); byteTally += 2.0 / 255.0 * step(centerIntensity, topIntensity); byteTally += 4.0 / 255.0 * step(centerIntensity, topLeftIntensity); byteTally += 8.0 / 255.0 * step(centerIntensity, leftIntensity); byteTally += 16.0 / 255.0 * step(centerIntensity, bottomLeftIntensity); byteTally += 32.0 / 255.0 * step(centerIntensity, bottomIntensity); byteTally += 64.0 / 255.0 * step(centerIntensity, bottomRightIntensity); byteTally += 128.0 / 255.0 * step(centerIntensity, rightIntensity); // TODO: Replace the above with a dot product and two vec4s // TODO: Apply step to a matrix, rather than individually gl_FragColor = vec4(byteTally, byteTally, byteTally, 1.0); } ); #endif #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageLocalBinaryPatternFragmentShaderString])) { return nil; } return self; } @end ================================================ FILE: framework/Source/GPUImageLookupFilter.h ================================================ #import "GPUImageTwoInputFilter.h" @interface GPUImageLookupFilter : GPUImageTwoInputFilter { GLint intensityUniform; } // How To Use: // 1) Use your favourite photo editing application to apply a filter to lookup.png from GPUImage/framework/Resources. // For this to work properly each pixel color must not depend on other pixels (e.g. blur will not work). // If you need more complex filter you can create as many lookup tables as required. // E.g. color_balance_lookup_1.png -> GPUImageGaussianBlurFilter -> color_balance_lookup_2.png // 2) Use you new lookup.png file as a second input for GPUImageLookupFilter. // See GPUImageAmatorkaFilter, GPUImageMissEtikateFilter, and GPUImageSoftEleganceFilter for example. // Additional Info: // Lookup texture is organised as 8x8 quads of 64x64 pixels representing all possible RGB colors: //for (int by = 0; by < 8; by++) { // for (int bx = 0; bx < 8; bx++) { // for (int g = 0; g < 64; g++) { // for (int r = 0; r < 64; r++) { // image.setPixel(r + bx * 64, g + by * 64, qRgb((int)(r * 255.0 / 63.0 + 0.5), // (int)(g * 255.0 / 63.0 + 0.5), // (int)((bx + by * 8.0) * 255.0 / 63.0 + 0.5))); // } // } // } //} // Opacity/intensity of lookup filter ranges from 0.0 to 1.0, with 1.0 as the normal setting @property(readwrite, nonatomic) CGFloat intensity; @end ================================================ FILE: framework/Source/GPUImageLookupFilter.m ================================================ #import "GPUImageLookupFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageLookupFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; varying highp vec2 textureCoordinate2; // TODO: This is not used uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; // lookup texture uniform lowp float intensity; void main() { highp vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); highp float blueColor = textureColor.b * 63.0; highp vec2 quad1; quad1.y = floor(floor(blueColor) / 8.0); quad1.x = floor(blueColor) - (quad1.y * 8.0); highp vec2 quad2; quad2.y = floor(ceil(blueColor) / 8.0); quad2.x = ceil(blueColor) - (quad2.y * 8.0); highp vec2 texPos1; texPos1.x = (quad1.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * textureColor.r); texPos1.y = (quad1.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * textureColor.g); highp vec2 texPos2; texPos2.x = (quad2.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * textureColor.r); texPos2.y = (quad2.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * textureColor.g); lowp vec4 newColor1 = texture2D(inputImageTexture2, texPos1); lowp vec4 newColor2 = texture2D(inputImageTexture2, texPos2); lowp vec4 newColor = mix(newColor1, newColor2, fract(blueColor)); gl_FragColor = mix(textureColor, vec4(newColor.rgb, textureColor.w), intensity); } ); #else NSString *const kGPUImageLookupFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; varying vec2 textureCoordinate2; // TODO: This is not used uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; // lookup texture uniform float intensity; void main() { vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); float blueColor = textureColor.b * 63.0; vec2 quad1; quad1.y = floor(floor(blueColor) / 8.0); quad1.x = floor(blueColor) - (quad1.y * 8.0); vec2 quad2; quad2.y = floor(ceil(blueColor) / 8.0); quad2.x = ceil(blueColor) - (quad2.y * 8.0); vec2 texPos1; texPos1.x = (quad1.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * textureColor.r); texPos1.y = (quad1.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * textureColor.g); vec2 texPos2; texPos2.x = (quad2.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * textureColor.r); texPos2.y = (quad2.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * textureColor.g); vec4 newColor1 = texture2D(inputImageTexture2, texPos1); vec4 newColor2 = texture2D(inputImageTexture2, texPos2); vec4 newColor = mix(newColor1, newColor2, fract(blueColor)); gl_FragColor = mix(textureColor, vec4(newColor.rgb, textureColor.w), intensity); } ); #endif @implementation GPUImageLookupFilter @synthesize intensity = _intensity; #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageLookupFragmentShaderString])) { return nil; } intensityUniform = [filterProgram uniformIndex:@"intensity"]; self.intensity = 1.0f; return self; } #pragma mark - #pragma mark Accessors - (void)setIntensity:(CGFloat)intensity { _intensity = intensity; [self setFloat:_intensity forUniform:intensityUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImageLowPassFilter.h ================================================ #import "GPUImageFilterGroup.h" #import "GPUImageBuffer.h" #import "GPUImageDissolveBlendFilter.h" @interface GPUImageLowPassFilter : GPUImageFilterGroup { GPUImageBuffer *bufferFilter; GPUImageDissolveBlendFilter *dissolveBlendFilter; } // This controls the degree by which the previous accumulated frames are blended with the current one. This ranges from 0.0 to 1.0, with a default of 0.5. @property(readwrite, nonatomic) CGFloat filterStrength; @end ================================================ FILE: framework/Source/GPUImageLowPassFilter.m ================================================ #import "GPUImageLowPassFilter.h" @implementation GPUImageLowPassFilter @synthesize filterStrength; - (id)init; { if (!(self = [super init])) { return nil; } // Take in the frame and blend it with the previous one dissolveBlendFilter = [[GPUImageDissolveBlendFilter alloc] init]; [self addFilter:dissolveBlendFilter]; // Buffer the result to be fed back into the blend bufferFilter = [[GPUImageBuffer alloc] init]; [self addFilter:bufferFilter]; // Texture location 0 needs to be the original image for the dissolve blend [bufferFilter addTarget:dissolveBlendFilter atTextureLocation:1]; [dissolveBlendFilter addTarget:bufferFilter]; [dissolveBlendFilter disableSecondFrameCheck]; // To prevent double updating of this filter, disable updates from the sharp image side // self.inputFilterToIgnoreForUpdates = unsharpMaskFilter; self.initialFilters = [NSArray arrayWithObject:dissolveBlendFilter]; self.terminalFilter = dissolveBlendFilter; self.filterStrength = 0.5; return self; } #pragma mark - #pragma mark Accessors - (void)setFilterStrength:(CGFloat)newValue; { dissolveBlendFilter.mix = newValue; } - (CGFloat)filterStrength; { return dissolveBlendFilter.mix; } - (void)addTarget:(id)newTarget atTextureLocation:(NSInteger)textureLocation; { [self.terminalFilter addTarget:newTarget atTextureLocation:textureLocation]; //if use GPUImagePipline,will cause self.termainlFilter removeAllTargets,so need add bufferFilter back if (self.terminalFilter == dissolveBlendFilter && ![self.terminalFilter.targets containsObject:bufferFilter]) { [self.terminalFilter addTarget:bufferFilter atTextureLocation:1]; } } @end ================================================ FILE: framework/Source/GPUImageLuminanceRangeFilter.h ================================================ #import "GPUImageFilter.h" @interface GPUImageLuminanceRangeFilter : GPUImageFilter { GLint rangeReductionUniform; } /** The degree to reduce the luminance range, from 0.0 to 1.0. Default is 0.6. */ @property(readwrite, nonatomic) CGFloat rangeReductionFactor; @end ================================================ FILE: framework/Source/GPUImageLuminanceRangeFilter.m ================================================ #import "GPUImageLuminanceRangeFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageLuminanceRangeFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform lowp float rangeReduction; // Values from "Graphics Shaders: Theory and Practice" by Bailey and Cunningham const mediump vec3 luminanceWeighting = vec3(0.2125, 0.7154, 0.0721); void main() { lowp vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); mediump float luminance = dot(textureColor.rgb, luminanceWeighting); mediump float luminanceRatio = ((0.5 - luminance) * rangeReduction); gl_FragColor = vec4((textureColor.rgb) + (luminanceRatio), textureColor.w); } ); #else NSString *const kGPUImageLuminanceRangeFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform float rangeReduction; // Values from "Graphics Shaders: Theory and Practice" by Bailey and Cunningham const vec3 luminanceWeighting = vec3(0.2125, 0.7154, 0.0721); void main() { vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); float luminance = dot(textureColor.rgb, luminanceWeighting); float luminanceRatio = ((0.5 - luminance) * rangeReduction); gl_FragColor = vec4((textureColor.rgb) + (luminanceRatio), textureColor.w); } ); #endif @implementation GPUImageLuminanceRangeFilter @synthesize rangeReductionFactor = _rangeReductionFactor; #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageLuminanceRangeFragmentShaderString])) { return nil; } rangeReductionUniform = [filterProgram uniformIndex:@"rangeReduction"]; self.rangeReductionFactor = 0.6; return self; } #pragma mark - #pragma mark Accessors - (void)setRangeReductionFactor:(CGFloat)newValue; { _rangeReductionFactor = newValue; [self setFloat:_rangeReductionFactor forUniform:rangeReductionUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImageLuminanceThresholdFilter.h ================================================ #import "GPUImageFilter.h" /** Pixels with a luminance above the threshold will appear white, and those below will be black */ @interface GPUImageLuminanceThresholdFilter : GPUImageFilter { GLint thresholdUniform; } /** Anything above this luminance will be white, and anything below black. Ranges from 0.0 to 1.0, with 0.5 as the default */ @property(readwrite, nonatomic) CGFloat threshold; @end ================================================ FILE: framework/Source/GPUImageLuminanceThresholdFilter.m ================================================ #import "GPUImageLuminanceThresholdFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageLuminanceThresholdFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform highp float threshold; const highp vec3 W = vec3(0.2125, 0.7154, 0.0721); void main() { highp vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); highp float luminance = dot(textureColor.rgb, W); highp float thresholdResult = step(threshold, luminance); gl_FragColor = vec4(vec3(thresholdResult), textureColor.w); } ); #else NSString *const kGPUImageLuminanceThresholdFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform float threshold; const vec3 W = vec3(0.2125, 0.7154, 0.0721); void main() { vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); float luminance = dot(textureColor.rgb, W); float thresholdResult = step(threshold, luminance); gl_FragColor = vec4(vec3(thresholdResult), textureColor.w); } ); #endif @implementation GPUImageLuminanceThresholdFilter @synthesize threshold = _threshold; #pragma mark - #pragma mark Initialization - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageLuminanceThresholdFragmentShaderString])) { return nil; } thresholdUniform = [filterProgram uniformIndex:@"threshold"]; self.threshold = 0.5; return self; } #pragma mark - #pragma mark Accessors - (void)setThreshold:(CGFloat)newValue; { _threshold = newValue; [self setFloat:_threshold forUniform:thresholdUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImageLuminosity.h ================================================ #import "GPUImageAverageColor.h" @interface GPUImageLuminosity : GPUImageAverageColor { GLProgram *secondFilterProgram; GLint secondFilterPositionAttribute, secondFilterTextureCoordinateAttribute; GLint secondFilterInputTextureUniform, secondFilterInputTextureUniform2; GLint secondFilterTexelWidthUniform, secondFilterTexelHeightUniform; } // This block is called on the completion of color averaging for a frame @property(nonatomic, copy) void(^luminosityProcessingFinishedBlock)(CGFloat luminosity, CMTime frameTime); - (void)extractLuminosityAtFrameTime:(CMTime)frameTime; - (void)initializeSecondaryAttributes; @end ================================================ FILE: framework/Source/GPUImageLuminosity.m ================================================ #import "GPUImageLuminosity.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageInitialLuminosityFragmentShaderString = SHADER_STRING ( precision highp float; uniform sampler2D inputImageTexture; varying highp vec2 outputTextureCoordinate; varying highp vec2 upperLeftInputTextureCoordinate; varying highp vec2 upperRightInputTextureCoordinate; varying highp vec2 lowerLeftInputTextureCoordinate; varying highp vec2 lowerRightInputTextureCoordinate; const highp vec3 W = vec3(0.2125, 0.7154, 0.0721); void main() { highp float upperLeftLuminance = dot(texture2D(inputImageTexture, upperLeftInputTextureCoordinate).rgb, W); highp float upperRightLuminance = dot(texture2D(inputImageTexture, upperRightInputTextureCoordinate).rgb, W); highp float lowerLeftLuminance = dot(texture2D(inputImageTexture, lowerLeftInputTextureCoordinate).rgb, W); highp float lowerRightLuminance = dot(texture2D(inputImageTexture, lowerRightInputTextureCoordinate).rgb, W); highp float luminosity = 0.25 * (upperLeftLuminance + upperRightLuminance + lowerLeftLuminance + lowerRightLuminance); gl_FragColor = vec4(luminosity, luminosity, luminosity, 1.0); } ); NSString *const kGPUImageLuminosityFragmentShaderString = SHADER_STRING ( precision highp float; uniform sampler2D inputImageTexture; varying highp vec2 outputTextureCoordinate; varying highp vec2 upperLeftInputTextureCoordinate; varying highp vec2 upperRightInputTextureCoordinate; varying highp vec2 lowerLeftInputTextureCoordinate; varying highp vec2 lowerRightInputTextureCoordinate; void main() { highp float upperLeftLuminance = texture2D(inputImageTexture, upperLeftInputTextureCoordinate).r; highp float upperRightLuminance = texture2D(inputImageTexture, upperRightInputTextureCoordinate).r; highp float lowerLeftLuminance = texture2D(inputImageTexture, lowerLeftInputTextureCoordinate).r; highp float lowerRightLuminance = texture2D(inputImageTexture, lowerRightInputTextureCoordinate).r; highp float luminosity = 0.25 * (upperLeftLuminance + upperRightLuminance + lowerLeftLuminance + lowerRightLuminance); gl_FragColor = vec4(luminosity, luminosity, luminosity, 1.0); } ); #else NSString *const kGPUImageInitialLuminosityFragmentShaderString = SHADER_STRING ( uniform sampler2D inputImageTexture; varying vec2 outputTextureCoordinate; varying vec2 upperLeftInputTextureCoordinate; varying vec2 upperRightInputTextureCoordinate; varying vec2 lowerLeftInputTextureCoordinate; varying vec2 lowerRightInputTextureCoordinate; const vec3 W = vec3(0.2125, 0.7154, 0.0721); void main() { float upperLeftLuminance = dot(texture2D(inputImageTexture, upperLeftInputTextureCoordinate).rgb, W); float upperRightLuminance = dot(texture2D(inputImageTexture, upperRightInputTextureCoordinate).rgb, W); float lowerLeftLuminance = dot(texture2D(inputImageTexture, lowerLeftInputTextureCoordinate).rgb, W); float lowerRightLuminance = dot(texture2D(inputImageTexture, lowerRightInputTextureCoordinate).rgb, W); float luminosity = 0.25 * (upperLeftLuminance + upperRightLuminance + lowerLeftLuminance + lowerRightLuminance); gl_FragColor = vec4(luminosity, luminosity, luminosity, 1.0); } ); NSString *const kGPUImageLuminosityFragmentShaderString = SHADER_STRING ( uniform sampler2D inputImageTexture; varying vec2 outputTextureCoordinate; varying vec2 upperLeftInputTextureCoordinate; varying vec2 upperRightInputTextureCoordinate; varying vec2 lowerLeftInputTextureCoordinate; varying vec2 lowerRightInputTextureCoordinate; void main() { float upperLeftLuminance = texture2D(inputImageTexture, upperLeftInputTextureCoordinate).r; float upperRightLuminance = texture2D(inputImageTexture, upperRightInputTextureCoordinate).r; float lowerLeftLuminance = texture2D(inputImageTexture, lowerLeftInputTextureCoordinate).r; float lowerRightLuminance = texture2D(inputImageTexture, lowerRightInputTextureCoordinate).r; float luminosity = 0.25 * (upperLeftLuminance + upperRightLuminance + lowerLeftLuminance + lowerRightLuminance); gl_FragColor = vec4(luminosity, luminosity, luminosity, 1.0); } ); #endif @implementation GPUImageLuminosity @synthesize luminosityProcessingFinishedBlock = _luminosityProcessingFinishedBlock; #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super initWithVertexShaderFromString:kGPUImageColorAveragingVertexShaderString fragmentShaderFromString:kGPUImageInitialLuminosityFragmentShaderString])) { return nil; } texelWidthUniform = [filterProgram uniformIndex:@"texelWidth"]; texelHeightUniform = [filterProgram uniformIndex:@"texelHeight"]; __unsafe_unretained GPUImageLuminosity *weakSelf = self; [self setFrameProcessingCompletionBlock:^(GPUImageOutput *filter, CMTime frameTime) { [weakSelf extractLuminosityAtFrameTime:frameTime]; }]; runSynchronouslyOnVideoProcessingQueue(^{ [GPUImageContext useImageProcessingContext]; secondFilterProgram = [[GPUImageContext sharedImageProcessingContext] programForVertexShaderString:kGPUImageColorAveragingVertexShaderString fragmentShaderString:kGPUImageLuminosityFragmentShaderString]; if (!secondFilterProgram.initialized) { [self initializeSecondaryAttributes]; if (![secondFilterProgram link]) { NSString *progLog = [secondFilterProgram programLog]; NSLog(@"Program link log: %@", progLog); NSString *fragLog = [secondFilterProgram fragmentShaderLog]; NSLog(@"Fragment shader compile log: %@", fragLog); NSString *vertLog = [secondFilterProgram vertexShaderLog]; NSLog(@"Vertex shader compile log: %@", vertLog); filterProgram = nil; NSAssert(NO, @"Filter shader link failed"); } } secondFilterPositionAttribute = [secondFilterProgram attributeIndex:@"position"]; secondFilterTextureCoordinateAttribute = [secondFilterProgram attributeIndex:@"inputTextureCoordinate"]; secondFilterInputTextureUniform = [secondFilterProgram uniformIndex:@"inputImageTexture"]; // This does assume a name of "inputImageTexture" for the fragment shader secondFilterInputTextureUniform2 = [secondFilterProgram uniformIndex:@"inputImageTexture2"]; // This does assume a name of "inputImageTexture2" for second input texture in the fragment shader secondFilterTexelWidthUniform = [secondFilterProgram uniformIndex:@"texelWidth"]; secondFilterTexelHeightUniform = [secondFilterProgram uniformIndex:@"texelHeight"]; [GPUImageContext setActiveShaderProgram:secondFilterProgram]; glEnableVertexAttribArray(secondFilterPositionAttribute); glEnableVertexAttribArray(secondFilterTextureCoordinateAttribute); }); return self; } - (void)initializeSecondaryAttributes; { [secondFilterProgram addAttribute:@"position"]; [secondFilterProgram addAttribute:@"inputTextureCoordinate"]; } /* - (void)renderToTextureWithVertices:(const GLfloat *)vertices textureCoordinates:(const GLfloat *)textureCoordinates; { if (self.preventRendering) { [firstInputFramebuffer unlock]; return; } // Do an initial render pass that both convert to luminance and reduces [GPUImageContext setActiveShaderProgram:filterProgram]; glVertexAttribPointer(filterPositionAttribute, 2, GL_FLOAT, 0, 0, vertices); glVertexAttribPointer(filterTextureCoordinateAttribute, 2, GL_FLOAT, 0, 0, textureCoordinates); GLuint currentFramebuffer = [[stageFramebuffers objectAtIndex:0] intValue]; glBindFramebuffer(GL_FRAMEBUFFER, currentFramebuffer); #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE CGSize currentStageSize = [[stageSizes objectAtIndex:0] CGSizeValue]; #else NSSize currentStageSize = [[stageSizes objectAtIndex:0] sizeValue]; #endif glViewport(0, 0, (int)currentStageSize.width, (int)currentStageSize.height); GLuint currentTexture = [firstInputFramebuffer texture]; glClearColor(0.0f, 0.0f, 0.0f, 1.0f); glClear(GL_COLOR_BUFFER_BIT); glActiveTexture(GL_TEXTURE2); glBindTexture(GL_TEXTURE_2D, currentTexture); glUniform1i(filterInputTextureUniform, 2); glUniform1f(texelWidthUniform, 0.5 / currentStageSize.width); glUniform1f(texelHeightUniform, 0.5 / currentStageSize.height); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); currentTexture = [[stageTextures objectAtIndex:0] intValue]; // Just perform reductions from this point on [GPUImageContext setActiveShaderProgram:secondFilterProgram]; glVertexAttribPointer(secondFilterPositionAttribute, 2, GL_FLOAT, 0, 0, vertices); glVertexAttribPointer(secondFilterTextureCoordinateAttribute, 2, GL_FLOAT, 0, 0, textureCoordinates); NSUInteger numberOfStageFramebuffers = [stageFramebuffers count]; for (NSUInteger currentStage = 1; currentStage < numberOfStageFramebuffers; currentStage++) { currentFramebuffer = [[stageFramebuffers objectAtIndex:currentStage] intValue]; glBindFramebuffer(GL_FRAMEBUFFER, currentFramebuffer); #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE currentStageSize = [[stageSizes objectAtIndex:currentStage] CGSizeValue]; #else currentStageSize = [[stageSizes objectAtIndex:currentStage] sizeValue]; #endif glViewport(0, 0, (int)currentStageSize.width, (int)currentStageSize.height); glClearColor(0.0f, 0.0f, 0.0f, 1.0f); glClear(GL_COLOR_BUFFER_BIT); glActiveTexture(GL_TEXTURE2); glBindTexture(GL_TEXTURE_2D, currentTexture); glUniform1i(secondFilterInputTextureUniform, 2); glUniform1f(secondFilterTexelWidthUniform, 0.5 / currentStageSize.width); glUniform1f(secondFilterTexelHeightUniform, 0.5 / currentStageSize.height); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); currentTexture = [[stageTextures objectAtIndex:currentStage] intValue]; // NSUInteger totalBytesForImage = (int)currentStageSize.width * (int)currentStageSize.height * 4; // GLubyte *rawImagePixels2 = (GLubyte *)malloc(totalBytesForImage); // glReadPixels(0, 0, (int)currentStageSize.width, (int)currentStageSize.height, GL_RGBA, GL_UNSIGNED_BYTE, rawImagePixels2); // CGDataProviderRef dataProvider = CGDataProviderCreateWithData(NULL, rawImagePixels2, totalBytesForImage, NULL); // CGColorSpaceRef defaultRGBColorSpace = CGColorSpaceCreateDeviceRGB(); // // CGFloat currentRedTotal = 0.0f, currentGreenTotal = 0.0f, currentBlueTotal = 0.0f, currentAlphaTotal = 0.0f; // NSUInteger totalNumberOfPixels = totalBytesForImage / 4; // // for (NSUInteger currentPixel = 0; currentPixel < totalNumberOfPixels; currentPixel++) // { // currentRedTotal += (CGFloat)rawImagePixels2[(currentPixel * 4)] / 255.0f; // currentGreenTotal += (CGFloat)rawImagePixels2[(currentPixel * 4) + 1] / 255.0f; // currentBlueTotal += (CGFloat)rawImagePixels2[(currentPixel * 4 + 2)] / 255.0f; // currentAlphaTotal += (CGFloat)rawImagePixels2[(currentPixel * 4) + 3] / 255.0f; // } // // NSLog(@"Stage %d average image red: %f, green: %f, blue: %f, alpha: %f", currentStage, currentRedTotal / (CGFloat)totalNumberOfPixels, currentGreenTotal / (CGFloat)totalNumberOfPixels, currentBlueTotal / (CGFloat)totalNumberOfPixels, currentAlphaTotal / (CGFloat)totalNumberOfPixels); // // // CGImageRef cgImageFromBytes = CGImageCreate((int)currentStageSize.width, (int)currentStageSize.height, 8, 32, 4 * (int)currentStageSize.width, defaultRGBColorSpace, kCGBitmapByteOrderDefault | kCGImageAlphaLast, dataProvider, NULL, NO, kCGRenderingIntentDefault); // // UIImage *imageToSave = [UIImage imageWithCGImage:cgImageFromBytes]; // // NSData *dataForPNGFile = UIImagePNGRepresentation(imageToSave); // // NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); // NSString *documentsDirectory = [paths objectAtIndex:0]; // // NSString *imageName = [NSString stringWithFormat:@"AverageLevel%d.png", currentStage]; // NSError *error = nil; // if (![dataForPNGFile writeToFile:[documentsDirectory stringByAppendingPathComponent:imageName] options:NSAtomicWrite error:&error]) // { // return; // } } [firstInputFramebuffer unlock]; } */ #pragma mark - #pragma mark Callbacks - (void)extractLuminosityAtFrameTime:(CMTime)frameTime; { runSynchronouslyOnVideoProcessingQueue(^{ // we need a normal color texture for this filter NSAssert(self.outputTextureOptions.internalFormat == GL_RGBA, @"The output texture format for this filter must be GL_RGBA."); NSAssert(self.outputTextureOptions.type == GL_UNSIGNED_BYTE, @"The type of the output texture of this filter must be GL_UNSIGNED_BYTE."); NSUInteger totalNumberOfPixels = round(finalStageSize.width * finalStageSize.height); if (rawImagePixels == NULL) { rawImagePixels = (GLubyte *)malloc(totalNumberOfPixels * 4); } [GPUImageContext useImageProcessingContext]; [outputFramebuffer activateFramebuffer]; glReadPixels(0, 0, (int)finalStageSize.width, (int)finalStageSize.height, GL_RGBA, GL_UNSIGNED_BYTE, rawImagePixels); NSUInteger luminanceTotal = 0; NSUInteger byteIndex = 0; for (NSUInteger currentPixel = 0; currentPixel < totalNumberOfPixels; currentPixel++) { luminanceTotal += rawImagePixels[byteIndex]; byteIndex += 4; } CGFloat normalizedLuminosityTotal = (CGFloat)luminanceTotal / (CGFloat)totalNumberOfPixels / 255.0; if (_luminosityProcessingFinishedBlock != NULL) { _luminosityProcessingFinishedBlock(normalizedLuminosityTotal, frameTime); } }); } @end ================================================ FILE: framework/Source/GPUImageLuminosityBlendFilter.h ================================================ #import "GPUImageTwoInputFilter.h" @interface GPUImageLuminosityBlendFilter : GPUImageTwoInputFilter @end ================================================ FILE: framework/Source/GPUImageLuminosityBlendFilter.m ================================================ #import "GPUImageLuminosityBlendFilter.h" /** * Luminosity blend mode based upon pseudo code from the PDF specification. */ #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageLuminosityBlendFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; varying highp vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; highp float lum(lowp vec3 c) { return dot(c, vec3(0.3, 0.59, 0.11)); } lowp vec3 clipcolor(lowp vec3 c) { highp float l = lum(c); lowp float n = min(min(c.r, c.g), c.b); lowp float x = max(max(c.r, c.g), c.b); if (n < 0.0) { c.r = l + ((c.r - l) * l) / (l - n); c.g = l + ((c.g - l) * l) / (l - n); c.b = l + ((c.b - l) * l) / (l - n); } if (x > 1.0) { c.r = l + ((c.r - l) * (1.0 - l)) / (x - l); c.g = l + ((c.g - l) * (1.0 - l)) / (x - l); c.b = l + ((c.b - l) * (1.0 - l)) / (x - l); } return c; } lowp vec3 setlum(lowp vec3 c, highp float l) { highp float d = l - lum(c); c = c + vec3(d); return clipcolor(c); } void main() { highp vec4 baseColor = texture2D(inputImageTexture, textureCoordinate); highp vec4 overlayColor = texture2D(inputImageTexture2, textureCoordinate2); gl_FragColor = vec4(baseColor.rgb * (1.0 - overlayColor.a) + setlum(baseColor.rgb, lum(overlayColor.rgb)) * overlayColor.a, baseColor.a); } ); #else NSString *const kGPUImageLuminosityBlendFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; varying vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; float lum(vec3 c) { return dot(c, vec3(0.3, 0.59, 0.11)); } vec3 clipcolor(vec3 c) { float l = lum(c); float n = min(min(c.r, c.g), c.b); float x = max(max(c.r, c.g), c.b); if (n < 0.0) { c.r = l + ((c.r - l) * l) / (l - n); c.g = l + ((c.g - l) * l) / (l - n); c.b = l + ((c.b - l) * l) / (l - n); } if (x > 1.0) { c.r = l + ((c.r - l) * (1.0 - l)) / (x - l); c.g = l + ((c.g - l) * (1.0 - l)) / (x - l); c.b = l + ((c.b - l) * (1.0 - l)) / (x - l); } return c; } vec3 setlum(vec3 c, float l) { float d = l - lum(c); c = c + vec3(d); return clipcolor(c); } void main() { vec4 baseColor = texture2D(inputImageTexture, textureCoordinate); vec4 overlayColor = texture2D(inputImageTexture2, textureCoordinate2); gl_FragColor = vec4(baseColor.rgb * (1.0 - overlayColor.a) + setlum(baseColor.rgb, lum(overlayColor.rgb)) * overlayColor.a, baseColor.a); } ); #endif @implementation GPUImageLuminosityBlendFilter - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageLuminosityBlendFragmentShaderString])) { return nil; } return self; } @end ================================================ FILE: framework/Source/GPUImageMaskFilter.h ================================================ #import "GPUImageTwoInputFilter.h" @interface GPUImageMaskFilter : GPUImageTwoInputFilter @end ================================================ FILE: framework/Source/GPUImageMaskFilter.m ================================================ #import "GPUImageMaskFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageMaskShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; varying highp vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; void main() { lowp vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); lowp vec4 textureColor2 = texture2D(inputImageTexture2, textureCoordinate2); //Averages mask's the RGB values, and scales that value by the mask's alpha // //The dot product should take fewer cycles than doing an average normally // //Typical/ideal case, R,G, and B will be the same, and Alpha will be 1.0 lowp float newAlpha = dot(textureColor2.rgb, vec3(.33333334, .33333334, .33333334)) * textureColor2.a; gl_FragColor = vec4(textureColor.xyz, newAlpha); // gl_FragColor = vec4(textureColor2); } ); #else NSString *const kGPUImageMaskShaderString = SHADER_STRING ( varying vec2 textureCoordinate; varying vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; void main() { vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); vec4 textureColor2 = texture2D(inputImageTexture2, textureCoordinate2); //Averages mask's the RGB values, and scales that value by the mask's alpha // //The dot product should take fewer cycles than doing an average normally // //Typical/ideal case, R,G, and B will be the same, and Alpha will be 1.0 float newAlpha = dot(textureColor2.rgb, vec3(.33333334, .33333334, .33333334)) * textureColor2.a; gl_FragColor = vec4(textureColor.xyz, newAlpha); // gl_FragColor = vec4(textureColor2); } ); #endif @implementation GPUImageMaskFilter - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageMaskShaderString])) { return nil; } return self; } - (void)renderToTextureWithVertices:(const GLfloat *)vertices textureCoordinates:(const GLfloat *)textureCoordinates; { glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); [super renderToTextureWithVertices:vertices textureCoordinates:textureCoordinates]; glDisable(GL_BLEND); } @end ================================================ FILE: framework/Source/GPUImageMedianFilter.h ================================================ #import "GPUImage3x3TextureSamplingFilter.h" @interface GPUImageMedianFilter : GPUImage3x3TextureSamplingFilter @end ================================================ FILE: framework/Source/GPUImageMedianFilter.m ================================================ #import "GPUImageMedianFilter.h" /* 3x3 median filter, adapted from "A Fast, Small-Radius GPU Median Filter" by Morgan McGuire in ShaderX6 http://graphics.cs.williams.edu/papers/MedianShaderX6/ Morgan McGuire and Kyle Whitson Williams College Register allocation tips by Victor Huang Xiaohuang University of Illinois at Urbana-Champaign http://graphics.cs.williams.edu Copyright (c) Morgan McGuire and Williams College, 2006 All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageMedianFragmentShaderString = SHADER_STRING ( precision highp float; varying vec2 textureCoordinate; varying vec2 leftTextureCoordinate; varying vec2 rightTextureCoordinate; varying vec2 topTextureCoordinate; varying vec2 topLeftTextureCoordinate; varying vec2 topRightTextureCoordinate; varying vec2 bottomTextureCoordinate; varying vec2 bottomLeftTextureCoordinate; varying vec2 bottomRightTextureCoordinate; uniform sampler2D inputImageTexture; #define s2(a, b) temp = a; a = min(a, b); b = max(temp, b); #define mn3(a, b, c) s2(a, b); s2(a, c); #define mx3(a, b, c) s2(b, c); s2(a, c); #define mnmx3(a, b, c) mx3(a, b, c); s2(a, b); // 3 exchanges #define mnmx4(a, b, c, d) s2(a, b); s2(c, d); s2(a, c); s2(b, d); // 4 exchanges #define mnmx5(a, b, c, d, e) s2(a, b); s2(c, d); mn3(a, c, e); mx3(b, d, e); // 6 exchanges #define mnmx6(a, b, c, d, e, f) s2(a, d); s2(b, e); s2(c, f); mn3(a, b, c); mx3(d, e, f); // 7 exchanges void main() { vec3 v[6]; v[0] = texture2D(inputImageTexture, bottomLeftTextureCoordinate).rgb; v[1] = texture2D(inputImageTexture, topRightTextureCoordinate).rgb; v[2] = texture2D(inputImageTexture, topLeftTextureCoordinate).rgb; v[3] = texture2D(inputImageTexture, bottomRightTextureCoordinate).rgb; v[4] = texture2D(inputImageTexture, leftTextureCoordinate).rgb; v[5] = texture2D(inputImageTexture, rightTextureCoordinate).rgb; // v[6] = texture2D(inputImageTexture, bottomTextureCoordinate).rgb; // v[7] = texture2D(inputImageTexture, topTextureCoordinate).rgb; vec3 temp; mnmx6(v[0], v[1], v[2], v[3], v[4], v[5]); v[5] = texture2D(inputImageTexture, bottomTextureCoordinate).rgb; mnmx5(v[1], v[2], v[3], v[4], v[5]); v[5] = texture2D(inputImageTexture, topTextureCoordinate).rgb; mnmx4(v[2], v[3], v[4], v[5]); v[5] = texture2D(inputImageTexture, textureCoordinate).rgb; mnmx3(v[3], v[4], v[5]); gl_FragColor = vec4(v[4], 1.0); } ); #else NSString *const kGPUImageMedianFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; varying vec2 leftTextureCoordinate; varying vec2 rightTextureCoordinate; varying vec2 topTextureCoordinate; varying vec2 topLeftTextureCoordinate; varying vec2 topRightTextureCoordinate; varying vec2 bottomTextureCoordinate; varying vec2 bottomLeftTextureCoordinate; varying vec2 bottomRightTextureCoordinate; uniform sampler2D inputImageTexture; #define s2(a, b) temp = a; a = min(a, b); b = max(temp, b); #define mn3(a, b, c) s2(a, b); s2(a, c); #define mx3(a, b, c) s2(b, c); s2(a, c); #define mnmx3(a, b, c) mx3(a, b, c); s2(a, b); // 3 exchanges #define mnmx4(a, b, c, d) s2(a, b); s2(c, d); s2(a, c); s2(b, d); // 4 exchanges #define mnmx5(a, b, c, d, e) s2(a, b); s2(c, d); mn3(a, c, e); mx3(b, d, e); // 6 exchanges #define mnmx6(a, b, c, d, e, f) s2(a, d); s2(b, e); s2(c, f); mn3(a, b, c); mx3(d, e, f); // 7 exchanges void main() { vec3 v[6]; v[0] = texture2D(inputImageTexture, bottomLeftTextureCoordinate).rgb; v[1] = texture2D(inputImageTexture, topRightTextureCoordinate).rgb; v[2] = texture2D(inputImageTexture, topLeftTextureCoordinate).rgb; v[3] = texture2D(inputImageTexture, bottomRightTextureCoordinate).rgb; v[4] = texture2D(inputImageTexture, leftTextureCoordinate).rgb; v[5] = texture2D(inputImageTexture, rightTextureCoordinate).rgb; // v[6] = texture2D(inputImageTexture, bottomTextureCoordinate).rgb; // v[7] = texture2D(inputImageTexture, topTextureCoordinate).rgb; vec3 temp; mnmx6(v[0], v[1], v[2], v[3], v[4], v[5]); v[5] = texture2D(inputImageTexture, bottomTextureCoordinate).rgb; mnmx5(v[1], v[2], v[3], v[4], v[5]); v[5] = texture2D(inputImageTexture, topTextureCoordinate).rgb; mnmx4(v[2], v[3], v[4], v[5]); v[5] = texture2D(inputImageTexture, textureCoordinate).rgb; mnmx3(v[3], v[4], v[5]); gl_FragColor = vec4(v[4], 1.0); } ); #endif @implementation GPUImageMedianFilter #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageMedianFragmentShaderString])) { return nil; } hasOverriddenImageSizeFactor = NO; return self; } @end ================================================ FILE: framework/Source/GPUImageMissEtikateFilter.h ================================================ #import "GPUImageFilterGroup.h" @class GPUImagePicture; /** A photo filter based on Photoshop action by Miss Etikate: http://miss-etikate.deviantart.com/art/Photoshop-Action-15-120151961 */ // Note: If you want to use this effect you have to add lookup_miss_etikate.png // from Resources folder to your application bundle. @interface GPUImageMissEtikateFilter : GPUImageFilterGroup { GPUImagePicture *lookupImageSource; } @end ================================================ FILE: framework/Source/GPUImageMissEtikateFilter.m ================================================ #import "GPUImageMissEtikateFilter.h" #import "GPUImagePicture.h" #import "GPUImageLookupFilter.h" @implementation GPUImageMissEtikateFilter - (id)init; { if (!(self = [super init])) { return nil; } #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE UIImage *image = [UIImage imageNamed:@"lookup_miss_etikate.png"]; #else NSImage *image = [NSImage imageNamed:@"lookup_miss_etikate.png"]; #endif NSAssert(image, @"To use GPUImageMissEtikateFilter you need to add lookup_miss_etikate.png from GPUImage/framework/Resources to your application bundle."); lookupImageSource = [[GPUImagePicture alloc] initWithImage:image]; GPUImageLookupFilter *lookupFilter = [[GPUImageLookupFilter alloc] init]; [self addFilter:lookupFilter]; [lookupImageSource addTarget:lookupFilter atTextureLocation:1]; [lookupImageSource processImage]; self.initialFilters = [NSArray arrayWithObjects:lookupFilter, nil]; self.terminalFilter = lookupFilter; return self; } #pragma mark - #pragma mark Accessors @end ================================================ FILE: framework/Source/GPUImageMonochromeFilter.h ================================================ #import "GPUImageFilter.h" @interface GPUImageMonochromeFilter : GPUImageFilter { GLint intensityUniform, filterColorUniform; } @property(readwrite, nonatomic) CGFloat intensity; @property(readwrite, nonatomic) GPUVector4 color; - (void)setColorRed:(GLfloat)redComponent green:(GLfloat)greenComponent blue:(GLfloat)blueComponent; @end ================================================ FILE: framework/Source/GPUImageMonochromeFilter.m ================================================ #import "GPUImageMonochromeFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUMonochromeFragmentShaderString = SHADER_STRING ( precision lowp float; varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform float intensity; uniform vec3 filterColor; const mediump vec3 luminanceWeighting = vec3(0.2125, 0.7154, 0.0721); void main() { //desat, then apply overlay blend lowp vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); float luminance = dot(textureColor.rgb, luminanceWeighting); lowp vec4 desat = vec4(vec3(luminance), 1.0); //overlay lowp vec4 outputColor = vec4( (desat.r < 0.5 ? (2.0 * desat.r * filterColor.r) : (1.0 - 2.0 * (1.0 - desat.r) * (1.0 - filterColor.r))), (desat.g < 0.5 ? (2.0 * desat.g * filterColor.g) : (1.0 - 2.0 * (1.0 - desat.g) * (1.0 - filterColor.g))), (desat.b < 0.5 ? (2.0 * desat.b * filterColor.b) : (1.0 - 2.0 * (1.0 - desat.b) * (1.0 - filterColor.b))), 1.0 ); //which is better, or are they equal? gl_FragColor = vec4( mix(textureColor.rgb, outputColor.rgb, intensity), textureColor.a); } ); #else NSString *const kGPUMonochromeFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform float intensity; uniform vec3 filterColor; const vec3 luminanceWeighting = vec3(0.2125, 0.7154, 0.0721); void main() { //desat, then apply overlay blend vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); float luminance = dot(textureColor.rgb, luminanceWeighting); vec4 desat = vec4(vec3(luminance), 1.0); //overlay vec4 outputColor = vec4( (desat.r < 0.5 ? (2.0 * desat.r * filterColor.r) : (1.0 - 2.0 * (1.0 - desat.r) * (1.0 - filterColor.r))), (desat.g < 0.5 ? (2.0 * desat.g * filterColor.g) : (1.0 - 2.0 * (1.0 - desat.g) * (1.0 - filterColor.g))), (desat.b < 0.5 ? (2.0 * desat.b * filterColor.b) : (1.0 - 2.0 * (1.0 - desat.b) * (1.0 - filterColor.b))), 1.0 ); //which is better, or are they equal? gl_FragColor = vec4( mix(textureColor.rgb, outputColor.rgb, intensity), textureColor.a); } ); #endif @implementation GPUImageMonochromeFilter @synthesize intensity = _intensity; @synthesize color = _color; - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUMonochromeFragmentShaderString])) { return nil; } intensityUniform = [filterProgram uniformIndex:@"intensity"]; filterColorUniform = [filterProgram uniformIndex:@"filterColor"]; self.intensity = 1.0; self.color = (GPUVector4){0.6f, 0.45f, 0.3f, 1.f}; //self.color = [CIColor colorWithRed:0.6 green:0.45 blue:0.3 alpha:1.]; return self; } #pragma mark - #pragma mark Accessors - (void)setColor:(GPUVector4)color; { _color = color; [self setColorRed:color.one green:color.two blue:color.three]; } - (void)setColorRed:(GLfloat)redComponent green:(GLfloat)greenComponent blue:(GLfloat)blueComponent; { GPUVector3 filterColor = {redComponent, greenComponent, blueComponent}; [self setVec3:filterColor forUniform:filterColorUniform program:filterProgram]; } - (void)setIntensity:(CGFloat)newValue; { _intensity = newValue; [self setFloat:_intensity forUniform:intensityUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImageMosaicFilter.h ================================================ // This needs a little more work, it's rotating the input tileset and there are some artifacts (I think from GL_LINEAR interpolation), but it's working #import "GPUImageTwoInputFilter.h" #import "GPUImagePicture.h" @interface GPUImageMosaicFilter : GPUImageTwoInputFilter { GLint inputTileSizeUniform, numTilesUniform, displayTileSizeUniform, colorOnUniform; GPUImagePicture *pic; } // This filter takes an input tileset, the tiles must ascend in luminance // It looks at the input image and replaces each display tile with an input tile // according to the luminance of that tile. The idea was to replicate the ASCII // video filters seen in other apps, but the tileset can be anything. @property(readwrite, nonatomic) CGSize inputTileSize; @property(readwrite, nonatomic) float numTiles; @property(readwrite, nonatomic) CGSize displayTileSize; @property(readwrite, nonatomic) BOOL colorOn; @property(readwrite, nonatomic, copy) NSString *tileSet; @end ================================================ FILE: framework/Source/GPUImageMosaicFilter.m ================================================ // // GPUImageMosaicFilter.m #import "GPUImageMosaicFilter.h" #import "GPUImagePicture.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageMosaicFragmentShaderString = SHADER_STRING ( precision highp float; varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; uniform vec2 inputTileSize; uniform vec2 displayTileSize; uniform float numTiles; uniform int colorOn; void main() { vec2 xy = textureCoordinate; xy = xy - mod(xy, displayTileSize); vec4 lumcoeff = vec4(0.299,0.587,0.114,0.0); vec4 inputColor = texture2D(inputImageTexture2, xy); float lum = dot(inputColor,lumcoeff); lum = 1.0 - lum; float stepsize = 1.0 / numTiles; float lumStep = (lum - mod(lum, stepsize)) / stepsize; float rowStep = 1.0 / inputTileSize.x; float x = mod(lumStep, rowStep); float y = floor(lumStep / rowStep); vec2 startCoord = vec2(float(x) * inputTileSize.x, float(y) * inputTileSize.y); vec2 finalCoord = startCoord + ((textureCoordinate - xy) * (inputTileSize / displayTileSize)); vec4 color = texture2D(inputImageTexture, finalCoord); if (colorOn == 1) { color = color * inputColor; } gl_FragColor = color; } ); #else NSString *const kGPUImageMosaicFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; uniform vec2 inputTileSize; uniform vec2 displayTileSize; uniform float numTiles; uniform int colorOn; void main() { vec2 xy = textureCoordinate; xy = xy - mod(xy, displayTileSize); vec4 lumcoeff = vec4(0.299,0.587,0.114,0.0); vec4 inputColor = texture2D(inputImageTexture2, xy); float lum = dot(inputColor,lumcoeff); lum = 1.0 - lum; float stepsize = 1.0 / numTiles; float lumStep = (lum - mod(lum, stepsize)) / stepsize; float rowStep = 1.0 / inputTileSize.x; float x = mod(lumStep, rowStep); float y = floor(lumStep / rowStep); vec2 startCoord = vec2(float(x) * inputTileSize.x, float(y) * inputTileSize.y); vec2 finalCoord = startCoord + ((textureCoordinate - xy) * (inputTileSize / displayTileSize)); vec4 color = texture2D(inputImageTexture, finalCoord); if (colorOn == 1) { color = color * inputColor; } gl_FragColor = color; } ); #endif @implementation GPUImageMosaicFilter @synthesize inputTileSize = _inputTileSize, numTiles = _numTiles, displayTileSize = _displayTileSize, colorOn = _colorOn; @synthesize tileSet = _tileSet; - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageMosaicFragmentShaderString])) { return nil; } inputTileSizeUniform = [filterProgram uniformIndex:@"inputTileSize"]; displayTileSizeUniform = [filterProgram uniformIndex:@"displayTileSize"]; numTilesUniform = [filterProgram uniformIndex:@"numTiles"]; colorOnUniform = [filterProgram uniformIndex:@"colorOn"]; CGSize its = CGSizeMake(0.125, 0.125); CGSize dts = CGSizeMake(0.025, 0.025); [self setDisplayTileSize:dts]; [self setInputTileSize:its]; [self setNumTiles:64.0]; [self setColorOn:YES]; //[self setTileSet:@"squares.png"]; return self; } - (void)setColorOn:(BOOL)yes { glUniform1i(colorOnUniform, yes); } - (void)setNumTiles:(float)numTiles { _numTiles = numTiles; [self setFloat:_numTiles forUniformName:@"numTiles"]; } - (void)setInputTileSize:(CGSize)inputTileSize { if (inputTileSize.width > 1.0) { _inputTileSize.width = 1.0; } if (inputTileSize.height > 1.0) { _inputTileSize.height = 1.0; } if (inputTileSize.width < 0.0) { _inputTileSize.width = 0.0; } if (inputTileSize.height < 0.0) { _inputTileSize.height = 0.0; } _inputTileSize = inputTileSize; [self setSize:_inputTileSize forUniform:inputTileSizeUniform program:filterProgram]; } -(void)setDisplayTileSize:(CGSize)displayTileSize { if (displayTileSize.width > 1.0) { _displayTileSize.width = 1.0; } if (displayTileSize.height > 1.0) { _displayTileSize.height = 1.0; } if (displayTileSize.width < 0.0) { _displayTileSize.width = 0.0; } if (displayTileSize.height < 0.0) { _displayTileSize.height = 0.0; } _displayTileSize = displayTileSize; [self setSize:_displayTileSize forUniform:displayTileSizeUniform program:filterProgram]; } -(void)setTileSet:(NSString *)tileSet { #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE UIImage *img = [UIImage imageNamed:tileSet]; #else NSImage *img = [NSImage imageNamed:tileSet]; #endif pic = [[GPUImagePicture alloc] initWithImage:img smoothlyScaleOutput:YES]; [pic addTarget:self]; [pic processImage]; } @end ================================================ FILE: framework/Source/GPUImageMotionBlurFilter.h ================================================ #import "GPUImageFilter.h" @interface GPUImageMotionBlurFilter : GPUImageFilter /** A multiplier for the blur size, ranging from 0.0 on up, with a default of 1.0 */ @property (readwrite, nonatomic) CGFloat blurSize; /** The angular direction of the blur, in degrees. 0 degrees by default */ @property (readwrite, nonatomic) CGFloat blurAngle; @end ================================================ FILE: framework/Source/GPUImageMotionBlurFilter.m ================================================ #import "GPUImageMotionBlurFilter.h" // Override vertex shader to remove dependent texture reads NSString *const kGPUImageTiltedTexelSamplingVertexShaderString = SHADER_STRING ( attribute vec4 position; attribute vec4 inputTextureCoordinate; uniform vec2 directionalTexelStep; varying vec2 textureCoordinate; varying vec2 oneStepBackTextureCoordinate; varying vec2 twoStepsBackTextureCoordinate; varying vec2 threeStepsBackTextureCoordinate; varying vec2 fourStepsBackTextureCoordinate; varying vec2 oneStepForwardTextureCoordinate; varying vec2 twoStepsForwardTextureCoordinate; varying vec2 threeStepsForwardTextureCoordinate; varying vec2 fourStepsForwardTextureCoordinate; void main() { gl_Position = position; textureCoordinate = inputTextureCoordinate.xy; oneStepBackTextureCoordinate = inputTextureCoordinate.xy - directionalTexelStep; twoStepsBackTextureCoordinate = inputTextureCoordinate.xy - 2.0 * directionalTexelStep; threeStepsBackTextureCoordinate = inputTextureCoordinate.xy - 3.0 * directionalTexelStep; fourStepsBackTextureCoordinate = inputTextureCoordinate.xy - 4.0 * directionalTexelStep; oneStepForwardTextureCoordinate = inputTextureCoordinate.xy + directionalTexelStep; twoStepsForwardTextureCoordinate = inputTextureCoordinate.xy + 2.0 * directionalTexelStep; threeStepsForwardTextureCoordinate = inputTextureCoordinate.xy + 3.0 * directionalTexelStep; fourStepsForwardTextureCoordinate = inputTextureCoordinate.xy + 4.0 * directionalTexelStep; } ); #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageMotionBlurFragmentShaderString = SHADER_STRING ( precision highp float; uniform sampler2D inputImageTexture; varying vec2 textureCoordinate; varying vec2 oneStepBackTextureCoordinate; varying vec2 twoStepsBackTextureCoordinate; varying vec2 threeStepsBackTextureCoordinate; varying vec2 fourStepsBackTextureCoordinate; varying vec2 oneStepForwardTextureCoordinate; varying vec2 twoStepsForwardTextureCoordinate; varying vec2 threeStepsForwardTextureCoordinate; varying vec2 fourStepsForwardTextureCoordinate; void main() { // Box weights // lowp vec4 fragmentColor = texture2D(inputImageTexture, textureCoordinate) * 0.1111111; // fragmentColor += texture2D(inputImageTexture, oneStepBackTextureCoordinate) * 0.1111111; // fragmentColor += texture2D(inputImageTexture, twoStepsBackTextureCoordinate) * 0.1111111; // fragmentColor += texture2D(inputImageTexture, threeStepsBackTextureCoordinate) * 0.1111111; // fragmentColor += texture2D(inputImageTexture, fourStepsBackTextureCoordinate) * 0.1111111; // fragmentColor += texture2D(inputImageTexture, oneStepForwardTextureCoordinate) * 0.1111111; // fragmentColor += texture2D(inputImageTexture, twoStepsForwardTextureCoordinate) * 0.1111111; // fragmentColor += texture2D(inputImageTexture, threeStepsForwardTextureCoordinate) * 0.1111111; // fragmentColor += texture2D(inputImageTexture, fourStepsForwardTextureCoordinate) * 0.1111111; lowp vec4 fragmentColor = texture2D(inputImageTexture, textureCoordinate) * 0.18; fragmentColor += texture2D(inputImageTexture, oneStepBackTextureCoordinate) * 0.15; fragmentColor += texture2D(inputImageTexture, twoStepsBackTextureCoordinate) * 0.12; fragmentColor += texture2D(inputImageTexture, threeStepsBackTextureCoordinate) * 0.09; fragmentColor += texture2D(inputImageTexture, fourStepsBackTextureCoordinate) * 0.05; fragmentColor += texture2D(inputImageTexture, oneStepForwardTextureCoordinate) * 0.15; fragmentColor += texture2D(inputImageTexture, twoStepsForwardTextureCoordinate) * 0.12; fragmentColor += texture2D(inputImageTexture, threeStepsForwardTextureCoordinate) * 0.09; fragmentColor += texture2D(inputImageTexture, fourStepsForwardTextureCoordinate) * 0.05; gl_FragColor = fragmentColor; } ); #else NSString *const kGPUImageMotionBlurFragmentShaderString = SHADER_STRING ( uniform sampler2D inputImageTexture; varying vec2 textureCoordinate; varying vec2 oneStepBackTextureCoordinate; varying vec2 twoStepsBackTextureCoordinate; varying vec2 threeStepsBackTextureCoordinate; varying vec2 fourStepsBackTextureCoordinate; varying vec2 oneStepForwardTextureCoordinate; varying vec2 twoStepsForwardTextureCoordinate; varying vec2 threeStepsForwardTextureCoordinate; varying vec2 fourStepsForwardTextureCoordinate; void main() { // Box weights // vec4 fragmentColor = texture2D(inputImageTexture, textureCoordinate) * 0.1111111; // fragmentColor += texture2D(inputImageTexture, oneStepBackTextureCoordinate) * 0.1111111; // fragmentColor += texture2D(inputImageTexture, twoStepsBackTextureCoordinate) * 0.1111111; // fragmentColor += texture2D(inputImageTexture, threeStepsBackTextureCoordinate) * 0.1111111; // fragmentColor += texture2D(inputImageTexture, fourStepsBackTextureCoordinate) * 0.1111111; // fragmentColor += texture2D(inputImageTexture, oneStepForwardTextureCoordinate) * 0.1111111; // fragmentColor += texture2D(inputImageTexture, twoStepsForwardTextureCoordinate) * 0.1111111; // fragmentColor += texture2D(inputImageTexture, threeStepsForwardTextureCoordinate) * 0.1111111; // fragmentColor += texture2D(inputImageTexture, fourStepsForwardTextureCoordinate) * 0.1111111; vec4 fragmentColor = texture2D(inputImageTexture, textureCoordinate) * 0.18; fragmentColor += texture2D(inputImageTexture, oneStepBackTextureCoordinate) * 0.15; fragmentColor += texture2D(inputImageTexture, twoStepsBackTextureCoordinate) * 0.12; fragmentColor += texture2D(inputImageTexture, threeStepsBackTextureCoordinate) * 0.09; fragmentColor += texture2D(inputImageTexture, fourStepsBackTextureCoordinate) * 0.05; fragmentColor += texture2D(inputImageTexture, oneStepForwardTextureCoordinate) * 0.15; fragmentColor += texture2D(inputImageTexture, twoStepsForwardTextureCoordinate) * 0.12; fragmentColor += texture2D(inputImageTexture, threeStepsForwardTextureCoordinate) * 0.09; fragmentColor += texture2D(inputImageTexture, fourStepsForwardTextureCoordinate) * 0.05; gl_FragColor = fragmentColor; } ); #endif @interface GPUImageMotionBlurFilter() { GLint directionalTexelStepUniform; } - (void)recalculateTexelOffsets; @end @implementation GPUImageMotionBlurFilter @synthesize blurSize = _blurSize; @synthesize blurAngle = _blurAngle; #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super initWithVertexShaderFromString:kGPUImageTiltedTexelSamplingVertexShaderString fragmentShaderFromString:kGPUImageMotionBlurFragmentShaderString])) { return nil; } directionalTexelStepUniform = [filterProgram uniformIndex:@"directionalTexelStep"]; self.blurSize = 2.5; self.blurAngle = 0.0; return self; } - (void)setInputSize:(CGSize)newSize atIndex:(NSInteger)textureIndex; { CGSize oldInputSize = inputTextureSize; [super setInputSize:newSize atIndex:textureIndex]; if (!CGSizeEqualToSize(oldInputSize, inputTextureSize) && (!CGSizeEqualToSize(newSize, CGSizeZero)) ) { [self recalculateTexelOffsets]; } } - (void)recalculateTexelOffsets; { CGFloat aspectRatio = 1.0; CGPoint texelOffsets; if (GPUImageRotationSwapsWidthAndHeight(inputRotation)) { aspectRatio = (inputTextureSize.width / inputTextureSize.height); texelOffsets.x = _blurSize * sin(_blurAngle * M_PI / 180.0) * aspectRatio / inputTextureSize.height; texelOffsets.y = _blurSize * cos(_blurAngle * M_PI / 180.0) / inputTextureSize.height; } else { aspectRatio = (inputTextureSize.height / inputTextureSize.width); texelOffsets.x = _blurSize * cos(_blurAngle * M_PI / 180.0) * aspectRatio / inputTextureSize.width; texelOffsets.y = _blurSize * sin(_blurAngle * M_PI / 180.0) / inputTextureSize.width; } [self setPoint:texelOffsets forUniform:directionalTexelStepUniform program:filterProgram]; } #pragma mark - #pragma mark Accessors - (void)setInputRotation:(GPUImageRotationMode)newInputRotation atIndex:(NSInteger)textureIndex; { [super setInputRotation:newInputRotation atIndex:textureIndex]; [self recalculateTexelOffsets]; } - (void)setBlurAngle:(CGFloat)newValue; { _blurAngle = newValue; [self recalculateTexelOffsets]; } - (void)setBlurSize:(CGFloat)newValue; { _blurSize = newValue; [self recalculateTexelOffsets]; } @end ================================================ FILE: framework/Source/GPUImageMotionDetector.h ================================================ #import "GPUImageFilterGroup.h" #import "GPUImageLowPassFilter.h" #import "GPUImageAverageColor.h" @interface GPUImageMotionDetector : GPUImageFilterGroup { GPUImageLowPassFilter *lowPassFilter; GPUImageTwoInputFilter *frameComparisonFilter; GPUImageAverageColor *averageColor; } // This controls the low pass filter strength used to compare the current frame with previous ones to detect motion. This ranges from 0.0 to 1.0, with a default of 0.5. @property(readwrite, nonatomic) CGFloat lowPassFilterStrength; // For every frame, this will feed back the calculated centroid of the motion, as well as a relative intensity. @property(nonatomic, copy) void(^motionDetectionBlock)(CGPoint motionCentroid, CGFloat motionIntensity, CMTime frameTime); @end ================================================ FILE: framework/Source/GPUImageMotionDetector.m ================================================ #import "GPUImageMotionDetector.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageMotionComparisonFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; varying highp vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; uniform highp float intensity; void main() { lowp vec3 currentImageColor = texture2D(inputImageTexture, textureCoordinate).rgb; lowp vec3 lowPassImageColor = texture2D(inputImageTexture2, textureCoordinate2).rgb; mediump float colorDistance = distance(currentImageColor, lowPassImageColor); // * 0.57735 lowp float movementThreshold = step(0.2, colorDistance); gl_FragColor = movementThreshold * vec4(textureCoordinate2.x, textureCoordinate2.y, 1.0, 1.0); } ); #else NSString *const kGPUImageMotionComparisonFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; varying vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; uniform float intensity; void main() { vec3 currentImageColor = texture2D(inputImageTexture, textureCoordinate).rgb; vec3 lowPassImageColor = texture2D(inputImageTexture2, textureCoordinate2).rgb; float colorDistance = distance(currentImageColor, lowPassImageColor); // * 0.57735 float movementThreshold = step(0.2, colorDistance); gl_FragColor = movementThreshold * vec4(textureCoordinate2.x, textureCoordinate2.y, 1.0, 1.0); } ); #endif @implementation GPUImageMotionDetector @synthesize lowPassFilterStrength, motionDetectionBlock; #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super init])) { return nil; } // Start with a low pass filter to define the component to be removed lowPassFilter = [[GPUImageLowPassFilter alloc] init]; [self addFilter:lowPassFilter]; // Take the difference of the current frame from the low pass filtered result to get the high pass frameComparisonFilter = [[GPUImageTwoInputFilter alloc] initWithFragmentShaderFromString:kGPUImageMotionComparisonFragmentShaderString]; [self addFilter:frameComparisonFilter]; // Texture location 0 needs to be the original image for the difference blend [lowPassFilter addTarget:frameComparisonFilter atTextureLocation:1]; // End with the average color for the scene to determine the centroid averageColor = [[GPUImageAverageColor alloc] init]; __unsafe_unretained GPUImageMotionDetector *weakSelf = self; [averageColor setColorAverageProcessingFinishedBlock:^(CGFloat redComponent, CGFloat greenComponent, CGFloat blueComponent, CGFloat alphaComponent, CMTime frameTime) { if (weakSelf.motionDetectionBlock != NULL) { weakSelf.motionDetectionBlock(CGPointMake(redComponent / alphaComponent, greenComponent / alphaComponent), alphaComponent, frameTime); } // NSLog(@"Average X: %f, Y: %f total: %f", redComponent / alphaComponent, greenComponent / alphaComponent, alphaComponent); }]; [frameComparisonFilter addTarget:averageColor]; self.initialFilters = [NSArray arrayWithObjects:lowPassFilter, frameComparisonFilter, nil]; self.terminalFilter = frameComparisonFilter; self.lowPassFilterStrength = 0.5; return self; } #pragma mark - #pragma mark Accessors - (void)setLowPassFilterStrength:(CGFloat)newValue; { lowPassFilter.filterStrength = newValue; } - (CGFloat)lowPassFilterStrength; { return lowPassFilter.filterStrength; } @end ================================================ FILE: framework/Source/GPUImageMovie.h ================================================ #import #import #import "GPUImageContext.h" #import "GPUImageOutput.h" /** Protocol for getting Movie played callback. */ @protocol GPUImageMovieDelegate - (void)didCompletePlayingMovie; @end /** Source object for filtering movies */ @interface GPUImageMovie : GPUImageOutput @property (readwrite, retain) AVAsset *asset; @property (readwrite, retain) AVPlayerItem *playerItem; @property(readwrite, retain) NSURL *url; /** This enables the benchmarking mode, which logs out instantaneous and average frame times to the console */ @property(readwrite, nonatomic) BOOL runBenchmark; /** This determines whether to play back a movie as fast as the frames can be processed, or if the original speed of the movie should be respected. Defaults to NO. */ @property(readwrite, nonatomic) BOOL playAtActualSpeed; /** This determines whether the video should repeat (loop) at the end and restart from the beginning. Defaults to NO. */ @property(readwrite, nonatomic) BOOL shouldRepeat; /** This specifies the progress of the process on a scale from 0 to 1.0. A value of 0 means the process has not yet begun, A value of 1.0 means the conversaion is complete. This property is not key-value observable. */ @property(readonly, nonatomic) float progress; /** This is used to send the delete Movie did complete playing alert */ @property (readwrite, nonatomic, assign) id delegate; @property (readonly, nonatomic) AVAssetReader *assetReader; @property (readonly, nonatomic) BOOL audioEncodingIsFinished; @property (readonly, nonatomic) BOOL videoEncodingIsFinished; /// @name Initialization and teardown - (id)initWithAsset:(AVAsset *)asset; - (id)initWithPlayerItem:(AVPlayerItem *)playerItem; - (id)initWithURL:(NSURL *)url; - (void)yuvConversionSetup; /// @name Movie processing - (void)enableSynchronizedEncodingUsingMovieWriter:(GPUImageMovieWriter *)movieWriter; - (BOOL)readNextVideoFrameFromOutput:(AVAssetReaderOutput *)readerVideoTrackOutput; - (BOOL)readNextAudioSampleFromOutput:(AVAssetReaderOutput *)readerAudioTrackOutput; - (void)startProcessing; - (void)endProcessing; - (void)cancelProcessing; - (void)processMovieFrame:(CMSampleBufferRef)movieSampleBuffer; @end ================================================ FILE: framework/Source/GPUImageMovie.m ================================================ #import "GPUImageMovie.h" #import "GPUImageMovieWriter.h" #import "GPUImageFilter.h" #import "GPUImageColorConversion.h" @interface GPUImageMovie () { BOOL audioEncodingIsFinished, videoEncodingIsFinished; GPUImageMovieWriter *synchronizedMovieWriter; AVAssetReader *reader; AVPlayerItemVideoOutput *playerItemOutput; #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE CADisplayLink *displayLink; #else CVDisplayLinkRef displayLink; #endif CMTime previousFrameTime, processingFrameTime; CFAbsoluteTime previousActualFrameTime; BOOL keepLooping; GLuint luminanceTexture, chrominanceTexture; GLProgram *yuvConversionProgram; GLint yuvConversionPositionAttribute, yuvConversionTextureCoordinateAttribute; GLint yuvConversionLuminanceTextureUniform, yuvConversionChrominanceTextureUniform; GLint yuvConversionMatrixUniform; const GLfloat *_preferredConversion; BOOL isFullYUVRange; int imageBufferWidth, imageBufferHeight; } - (void)processAsset; @end @implementation GPUImageMovie @synthesize url = _url; @synthesize asset = _asset; @synthesize runBenchmark = _runBenchmark; @synthesize playAtActualSpeed = _playAtActualSpeed; @synthesize delegate = _delegate; @synthesize shouldRepeat = _shouldRepeat; #pragma mark - #pragma mark Initialization and teardown - (id)initWithURL:(NSURL *)url; { if (!(self = [super init])) { return nil; } [self yuvConversionSetup]; self.url = url; self.asset = nil; return self; } - (id)initWithAsset:(AVAsset *)asset; { if (!(self = [super init])) { return nil; } [self yuvConversionSetup]; self.url = nil; self.asset = asset; return self; } - (id)initWithPlayerItem:(AVPlayerItem *)playerItem; { if (!(self = [super init])) { return nil; } [self yuvConversionSetup]; self.url = nil; self.asset = nil; self.playerItem = playerItem; return self; } - (void)yuvConversionSetup; { if ([GPUImageContext supportsFastTextureUpload]) { runSynchronouslyOnVideoProcessingQueue(^{ [GPUImageContext useImageProcessingContext]; _preferredConversion = kColorConversion709; isFullYUVRange = YES; yuvConversionProgram = [[GPUImageContext sharedImageProcessingContext] programForVertexShaderString:kGPUImageVertexShaderString fragmentShaderString:kGPUImageYUVFullRangeConversionForLAFragmentShaderString]; if (!yuvConversionProgram.initialized) { [yuvConversionProgram addAttribute:@"position"]; [yuvConversionProgram addAttribute:@"inputTextureCoordinate"]; if (![yuvConversionProgram link]) { NSString *progLog = [yuvConversionProgram programLog]; NSLog(@"Program link log: %@", progLog); NSString *fragLog = [yuvConversionProgram fragmentShaderLog]; NSLog(@"Fragment shader compile log: %@", fragLog); NSString *vertLog = [yuvConversionProgram vertexShaderLog]; NSLog(@"Vertex shader compile log: %@", vertLog); yuvConversionProgram = nil; NSAssert(NO, @"Filter shader link failed"); } } yuvConversionPositionAttribute = [yuvConversionProgram attributeIndex:@"position"]; yuvConversionTextureCoordinateAttribute = [yuvConversionProgram attributeIndex:@"inputTextureCoordinate"]; yuvConversionLuminanceTextureUniform = [yuvConversionProgram uniformIndex:@"luminanceTexture"]; yuvConversionChrominanceTextureUniform = [yuvConversionProgram uniformIndex:@"chrominanceTexture"]; yuvConversionMatrixUniform = [yuvConversionProgram uniformIndex:@"colorConversionMatrix"]; [GPUImageContext setActiveShaderProgram:yuvConversionProgram]; glEnableVertexAttribArray(yuvConversionPositionAttribute); glEnableVertexAttribArray(yuvConversionTextureCoordinateAttribute); }); } } - (void)dealloc { [playerItemOutput setDelegate:nil queue:nil]; // Moved into endProcessing //if (self.playerItem && (displayLink != nil)) //{ // [displayLink invalidate]; // remove from all run loops // displayLink = nil; //} } #pragma mark - #pragma mark Movie processing - (void)enableSynchronizedEncodingUsingMovieWriter:(GPUImageMovieWriter *)movieWriter; { synchronizedMovieWriter = movieWriter; movieWriter.encodingLiveVideo = NO; } - (void)startProcessing { if( self.playerItem ) { [self processPlayerItem]; return; } if(self.url == nil) { [self processAsset]; return; } if (_shouldRepeat) keepLooping = YES; previousFrameTime = kCMTimeZero; previousActualFrameTime = CFAbsoluteTimeGetCurrent(); NSDictionary *inputOptions = [NSDictionary dictionaryWithObject:[NSNumber numberWithBool:YES] forKey:AVURLAssetPreferPreciseDurationAndTimingKey]; AVURLAsset *inputAsset = [[AVURLAsset alloc] initWithURL:self.url options:inputOptions]; GPUImageMovie __block *blockSelf = self; [inputAsset loadValuesAsynchronouslyForKeys:[NSArray arrayWithObject:@"tracks"] completionHandler: ^{ dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ NSError *error = nil; AVKeyValueStatus tracksStatus = [inputAsset statusOfValueForKey:@"tracks" error:&error]; if (tracksStatus != AVKeyValueStatusLoaded) { return; } blockSelf.asset = inputAsset; [blockSelf processAsset]; blockSelf = nil; }); }]; } - (AVAssetReader*)createAssetReader { NSError *error = nil; AVAssetReader *assetReader = [AVAssetReader assetReaderWithAsset:self.asset error:&error]; NSMutableDictionary *outputSettings = [NSMutableDictionary dictionary]; if ([GPUImageContext supportsFastTextureUpload]) { [outputSettings setObject:@(kCVPixelFormatType_420YpCbCr8BiPlanarFullRange) forKey:(id)kCVPixelBufferPixelFormatTypeKey]; isFullYUVRange = YES; } else { [outputSettings setObject:@(kCVPixelFormatType_32BGRA) forKey:(id)kCVPixelBufferPixelFormatTypeKey]; isFullYUVRange = NO; } // Maybe set alwaysCopiesSampleData to NO on iOS 5.0 for faster video decoding AVAssetReaderTrackOutput *readerVideoTrackOutput = [AVAssetReaderTrackOutput assetReaderTrackOutputWithTrack:[[self.asset tracksWithMediaType:AVMediaTypeVideo] objectAtIndex:0] outputSettings:outputSettings]; readerVideoTrackOutput.alwaysCopiesSampleData = NO; [assetReader addOutput:readerVideoTrackOutput]; NSArray *audioTracks = [self.asset tracksWithMediaType:AVMediaTypeAudio]; BOOL shouldRecordAudioTrack = (([audioTracks count] > 0) && (self.audioEncodingTarget != nil) ); AVAssetReaderTrackOutput *readerAudioTrackOutput = nil; if (shouldRecordAudioTrack) { #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE [self.audioEncodingTarget setShouldInvalidateAudioSampleWhenDone:YES]; #else #warning Missing OSX implementation #endif // This might need to be extended to handle movies with more than one audio track AVAssetTrack* audioTrack = [audioTracks objectAtIndex:0]; readerAudioTrackOutput = [AVAssetReaderTrackOutput assetReaderTrackOutputWithTrack:audioTrack outputSettings:nil]; readerAudioTrackOutput.alwaysCopiesSampleData = NO; [assetReader addOutput:readerAudioTrackOutput]; } return assetReader; } - (void)processAsset { reader = [self createAssetReader]; AVAssetReaderOutput *readerVideoTrackOutput = nil; AVAssetReaderOutput *readerAudioTrackOutput = nil; audioEncodingIsFinished = YES; for( AVAssetReaderOutput *output in reader.outputs ) { if( [output.mediaType isEqualToString:AVMediaTypeAudio] ) { audioEncodingIsFinished = NO; readerAudioTrackOutput = output; } else if( [output.mediaType isEqualToString:AVMediaTypeVideo] ) { readerVideoTrackOutput = output; } } if ([reader startReading] == NO) { NSLog(@"Error reading from file at URL: %@", self.url); return; } __unsafe_unretained GPUImageMovie *weakSelf = self; if (synchronizedMovieWriter != nil) { [synchronizedMovieWriter setVideoInputReadyCallback:^{ BOOL success = [weakSelf readNextVideoFrameFromOutput:readerVideoTrackOutput]; #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE return success; #endif }]; [synchronizedMovieWriter setAudioInputReadyCallback:^{ BOOL success = [weakSelf readNextAudioSampleFromOutput:readerAudioTrackOutput]; #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE return success; #endif }]; [synchronizedMovieWriter enableSynchronizationCallbacks]; } else { while (reader.status == AVAssetReaderStatusReading && (!_shouldRepeat || keepLooping)) { [weakSelf readNextVideoFrameFromOutput:readerVideoTrackOutput]; if ( (readerAudioTrackOutput) && (!audioEncodingIsFinished) ) { [weakSelf readNextAudioSampleFromOutput:readerAudioTrackOutput]; } } if (reader.status == AVAssetReaderStatusCompleted) { [reader cancelReading]; if (keepLooping) { reader = nil; dispatch_async(dispatch_get_main_queue(), ^{ [self startProcessing]; }); } else { [weakSelf endProcessing]; } } } } - (void)processPlayerItem { runSynchronouslyOnVideoProcessingQueue(^{ #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(displayLinkCallback:)]; [displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes]; [displayLink setPaused:YES]; #else // Suggested implementation: use CVDisplayLink http://stackoverflow.com/questions/14158743/alternative-of-cadisplaylink-for-mac-os-x CGDirectDisplayID displayID = CGMainDisplayID(); CVReturn error = kCVReturnSuccess; error = CVDisplayLinkCreateWithCGDisplay(displayID, &displayLink); if (error) { NSLog(@"DisplayLink created with error:%d", error); displayLink = NULL; } CVDisplayLinkSetOutputCallback(displayLink, renderCallback, (__bridge void *)self); CVDisplayLinkStop(displayLink); #endif dispatch_queue_t videoProcessingQueue = [GPUImageContext sharedContextQueue]; NSMutableDictionary *pixBuffAttributes = [NSMutableDictionary dictionary]; if ([GPUImageContext supportsFastTextureUpload]) { [pixBuffAttributes setObject:@(kCVPixelFormatType_420YpCbCr8BiPlanarFullRange) forKey:(id)kCVPixelBufferPixelFormatTypeKey]; } else { [pixBuffAttributes setObject:@(kCVPixelFormatType_32BGRA) forKey:(id)kCVPixelBufferPixelFormatTypeKey]; } playerItemOutput = [[AVPlayerItemVideoOutput alloc] initWithPixelBufferAttributes:pixBuffAttributes]; [playerItemOutput setDelegate:self queue:videoProcessingQueue]; [_playerItem addOutput:playerItemOutput]; [playerItemOutput requestNotificationOfMediaDataChangeWithAdvanceInterval:0.1]; }); } - (void)outputMediaDataWillChange:(AVPlayerItemOutput *)sender { #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE // Restart display link. [displayLink setPaused:NO]; #else CVDisplayLinkStart(displayLink); #endif } #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE - (void)displayLinkCallback:(CADisplayLink *)sender { /* The callback gets called once every Vsync. Using the display link's timestamp and duration we can compute the next time the screen will be refreshed, and copy the pixel buffer for that time This pixel buffer can then be processed and later rendered on screen. */ // Calculate the nextVsync time which is when the screen will be refreshed next. CFTimeInterval nextVSync = ([sender timestamp] + [sender duration]); CMTime outputItemTime = [playerItemOutput itemTimeForHostTime:nextVSync]; [self processPixelBufferAtTime:outputItemTime]; } #else static CVReturn renderCallback(CVDisplayLinkRef displayLink, const CVTimeStamp *inNow, const CVTimeStamp *inOutputTime, CVOptionFlags flagsIn, CVOptionFlags *flagsOut, void *displayLinkContext) { // Sample code taken from here https://developer.apple.com/library/mac/samplecode/AVGreenScreenPlayer/Listings/AVGreenScreenPlayer_GSPlayerView_m.html GPUImageMovie *self = (__bridge GPUImageMovie *)displayLinkContext; AVPlayerItemVideoOutput *playerItemOutput = self->playerItemOutput; // The displayLink calls back at every vsync (screen refresh) // Compute itemTime for the next vsync CMTime outputItemTime = [playerItemOutput itemTimeForCVTimeStamp:*inOutputTime]; [self processPixelBufferAtTime:outputItemTime]; return kCVReturnSuccess; } #endif - (void)processPixelBufferAtTime:(CMTime)outputItemTime { if ([playerItemOutput hasNewPixelBufferForItemTime:outputItemTime]) { __unsafe_unretained GPUImageMovie *weakSelf = self; CVPixelBufferRef pixelBuffer = [playerItemOutput copyPixelBufferForItemTime:outputItemTime itemTimeForDisplay:NULL]; if( pixelBuffer ) runSynchronouslyOnVideoProcessingQueue(^{ [weakSelf processMovieFrame:pixelBuffer withSampleTime:outputItemTime]; CFRelease(pixelBuffer); }); } } - (BOOL)readNextVideoFrameFromOutput:(AVAssetReaderOutput *)readerVideoTrackOutput; { if (reader.status == AVAssetReaderStatusReading && ! videoEncodingIsFinished) { CMSampleBufferRef sampleBufferRef = [readerVideoTrackOutput copyNextSampleBuffer]; if (sampleBufferRef) { //NSLog(@"read a video frame: %@", CFBridgingRelease(CMTimeCopyDescription(kCFAllocatorDefault, CMSampleBufferGetOutputPresentationTimeStamp(sampleBufferRef)))); if (_playAtActualSpeed) { // Do this outside of the video processing queue to not slow that down while waiting CMTime currentSampleTime = CMSampleBufferGetOutputPresentationTimeStamp(sampleBufferRef); CMTime differenceFromLastFrame = CMTimeSubtract(currentSampleTime, previousFrameTime); CFAbsoluteTime currentActualTime = CFAbsoluteTimeGetCurrent(); CGFloat frameTimeDifference = CMTimeGetSeconds(differenceFromLastFrame); CGFloat actualTimeDifference = currentActualTime - previousActualFrameTime; if (frameTimeDifference > actualTimeDifference) { usleep(1000000.0 * (frameTimeDifference - actualTimeDifference)); } previousFrameTime = currentSampleTime; previousActualFrameTime = CFAbsoluteTimeGetCurrent(); } __unsafe_unretained GPUImageMovie *weakSelf = self; runSynchronouslyOnVideoProcessingQueue(^{ [weakSelf processMovieFrame:sampleBufferRef]; CMSampleBufferInvalidate(sampleBufferRef); CFRelease(sampleBufferRef); }); return YES; } else { if (!keepLooping) { videoEncodingIsFinished = YES; if( videoEncodingIsFinished && audioEncodingIsFinished ) [self endProcessing]; } } } else if (synchronizedMovieWriter != nil) { if (reader.status == AVAssetReaderStatusCompleted) { [self endProcessing]; } } return NO; } - (BOOL)readNextAudioSampleFromOutput:(AVAssetReaderOutput *)readerAudioTrackOutput; { if (reader.status == AVAssetReaderStatusReading && ! audioEncodingIsFinished) { CMSampleBufferRef audioSampleBufferRef = [readerAudioTrackOutput copyNextSampleBuffer]; if (audioSampleBufferRef) { //NSLog(@"read an audio frame: %@", CFBridgingRelease(CMTimeCopyDescription(kCFAllocatorDefault, CMSampleBufferGetOutputPresentationTimeStamp(audioSampleBufferRef)))); [self.audioEncodingTarget processAudioBuffer:audioSampleBufferRef]; CFRelease(audioSampleBufferRef); return YES; } else { if (!keepLooping) { audioEncodingIsFinished = YES; if( videoEncodingIsFinished && audioEncodingIsFinished ) [self endProcessing]; } } } else if (synchronizedMovieWriter != nil) { if (reader.status == AVAssetReaderStatusCompleted || reader.status == AVAssetReaderStatusFailed || reader.status == AVAssetReaderStatusCancelled) { [self endProcessing]; } } return NO; } - (void)processMovieFrame:(CMSampleBufferRef)movieSampleBuffer; { // CMTimeGetSeconds // CMTimeSubtract CMTime currentSampleTime = CMSampleBufferGetOutputPresentationTimeStamp(movieSampleBuffer); CVImageBufferRef movieFrame = CMSampleBufferGetImageBuffer(movieSampleBuffer); processingFrameTime = currentSampleTime; [self processMovieFrame:movieFrame withSampleTime:currentSampleTime]; } - (float)progress { if ( AVAssetReaderStatusReading == reader.status ) { float current = processingFrameTime.value * 1.0f / processingFrameTime.timescale; float duration = self.asset.duration.value * 1.0f / self.asset.duration.timescale; return current / duration; } else if ( AVAssetReaderStatusCompleted == reader.status ) { return 1.f; } else { return 0.f; } } - (void)processMovieFrame:(CVPixelBufferRef)movieFrame withSampleTime:(CMTime)currentSampleTime { int bufferHeight = (int) CVPixelBufferGetHeight(movieFrame); int bufferWidth = (int) CVPixelBufferGetWidth(movieFrame); CFTypeRef colorAttachments = CVBufferGetAttachment(movieFrame, kCVImageBufferYCbCrMatrixKey, NULL); if (colorAttachments != NULL) { if(CFStringCompare(colorAttachments, kCVImageBufferYCbCrMatrix_ITU_R_601_4, 0) == kCFCompareEqualTo) { if (isFullYUVRange) { _preferredConversion = kColorConversion601FullRange; } else { _preferredConversion = kColorConversion601; } } else { _preferredConversion = kColorConversion709; } } else { if (isFullYUVRange) { _preferredConversion = kColorConversion601FullRange; } else { _preferredConversion = kColorConversion601; } } CFAbsoluteTime startTime = CFAbsoluteTimeGetCurrent(); // Fix issue 1580 [GPUImageContext useImageProcessingContext]; if ([GPUImageContext supportsFastTextureUpload]) { #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE CVOpenGLESTextureRef luminanceTextureRef = NULL; CVOpenGLESTextureRef chrominanceTextureRef = NULL; #else CVOpenGLTextureRef luminanceTextureRef = NULL; CVOpenGLTextureRef chrominanceTextureRef = NULL; #endif // if (captureAsYUV && [GPUImageContext deviceSupportsRedTextures]) if (CVPixelBufferGetPlaneCount(movieFrame) > 0) // Check for YUV planar inputs to do RGB conversion { // fix issue 2221 CVPixelBufferLockBaseAddress(movieFrame,0); if ( (imageBufferWidth != bufferWidth) && (imageBufferHeight != bufferHeight) ) { imageBufferWidth = bufferWidth; imageBufferHeight = bufferHeight; } CVReturn err; // Y-plane glActiveTexture(GL_TEXTURE4); if ([GPUImageContext deviceSupportsRedTextures]) { #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE err = CVOpenGLESTextureCacheCreateTextureFromImage(kCFAllocatorDefault, [[GPUImageContext sharedImageProcessingContext] coreVideoTextureCache], movieFrame, NULL, GL_TEXTURE_2D, GL_LUMINANCE, bufferWidth, bufferHeight, GL_LUMINANCE, GL_UNSIGNED_BYTE, 0, &luminanceTextureRef); #else err = CVOpenGLTextureCacheCreateTextureFromImage(kCFAllocatorDefault, [[GPUImageContext sharedImageProcessingContext] coreVideoTextureCache], movieFrame, NULL, &luminanceTextureRef); #endif } else { #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE err = CVOpenGLESTextureCacheCreateTextureFromImage(kCFAllocatorDefault, [[GPUImageContext sharedImageProcessingContext] coreVideoTextureCache], movieFrame, NULL, GL_TEXTURE_2D, GL_LUMINANCE, bufferWidth, bufferHeight, GL_LUMINANCE, GL_UNSIGNED_BYTE, 0, &luminanceTextureRef); #else err = CVOpenGLTextureCacheCreateTextureFromImage(kCFAllocatorDefault, [[GPUImageContext sharedImageProcessingContext] coreVideoTextureCache], movieFrame, NULL, &luminanceTextureRef); #endif } if (err) { NSLog(@"Error at CVOpenGLESTextureCacheCreateTextureFromImage %d", err); } #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE luminanceTexture = CVOpenGLESTextureGetName(luminanceTextureRef); #else luminanceTexture = CVOpenGLTextureGetName(luminanceTextureRef); #endif glBindTexture(GL_TEXTURE_2D, luminanceTexture); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); // UV-plane glActiveTexture(GL_TEXTURE5); if ([GPUImageContext deviceSupportsRedTextures]) { #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE err = CVOpenGLESTextureCacheCreateTextureFromImage(kCFAllocatorDefault, [[GPUImageContext sharedImageProcessingContext] coreVideoTextureCache], movieFrame, NULL, GL_TEXTURE_2D, GL_LUMINANCE_ALPHA, bufferWidth/2, bufferHeight/2, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, 1, &chrominanceTextureRef); #else err = CVOpenGLTextureCacheCreateTextureFromImage(kCFAllocatorDefault, [[GPUImageContext sharedImageProcessingContext] coreVideoTextureCache], movieFrame, NULL, &chrominanceTextureRef); #endif } else { #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE err = CVOpenGLESTextureCacheCreateTextureFromImage(kCFAllocatorDefault, [[GPUImageContext sharedImageProcessingContext] coreVideoTextureCache], movieFrame, NULL, GL_TEXTURE_2D, GL_LUMINANCE_ALPHA, bufferWidth/2, bufferHeight/2, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, 1, &chrominanceTextureRef); #else err = CVOpenGLTextureCacheCreateTextureFromImage(kCFAllocatorDefault, [[GPUImageContext sharedImageProcessingContext] coreVideoTextureCache], movieFrame, NULL, &chrominanceTextureRef); #endif } if (err) { NSLog(@"Error at CVOpenGLESTextureCacheCreateTextureFromImage %d", err); } #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE chrominanceTexture = CVOpenGLESTextureGetName(chrominanceTextureRef); #else chrominanceTexture = CVOpenGLTextureGetName(chrominanceTextureRef); #endif glBindTexture(GL_TEXTURE_2D, chrominanceTexture); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); // if (!allTargetsWantMonochromeData) // { [self convertYUVToRGBOutput]; // } for (id currentTarget in targets) { NSInteger indexOfObject = [targets indexOfObject:currentTarget]; NSInteger targetTextureIndex = [[targetTextureIndices objectAtIndex:indexOfObject] integerValue]; [currentTarget setInputSize:CGSizeMake(bufferWidth, bufferHeight) atIndex:targetTextureIndex]; [currentTarget setInputFramebuffer:outputFramebuffer atIndex:targetTextureIndex]; } [outputFramebuffer unlock]; for (id currentTarget in targets) { NSInteger indexOfObject = [targets indexOfObject:currentTarget]; NSInteger targetTextureIndex = [[targetTextureIndices objectAtIndex:indexOfObject] integerValue]; [currentTarget newFrameReadyAtTime:currentSampleTime atIndex:targetTextureIndex]; } CVPixelBufferUnlockBaseAddress(movieFrame, 0); CFRelease(luminanceTextureRef); CFRelease(chrominanceTextureRef); } else { // TODO: Mesh this with the new framebuffer cache // CVPixelBufferLockBaseAddress(movieFrame, 0); // // CVReturn err = CVOpenGLESTextureCacheCreateTextureFromImage(kCFAllocatorDefault, coreVideoTextureCache, movieFrame, NULL, GL_TEXTURE_2D, GL_RGBA, bufferWidth, bufferHeight, GL_BGRA, GL_UNSIGNED_BYTE, 0, &texture); // // if (!texture || err) { // NSLog(@"Movie CVOpenGLESTextureCacheCreateTextureFromImage failed (error: %d)", err); // NSAssert(NO, @"Camera failure"); // return; // } // // outputTexture = CVOpenGLESTextureGetName(texture); // // glBindTexture(CVOpenGLESTextureGetTarget(texture), outputTexture); // glBindTexture(GL_TEXTURE_2D, outputTexture); // glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); // glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); // glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); // glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); // // for (id currentTarget in targets) // { // NSInteger indexOfObject = [targets indexOfObject:currentTarget]; // NSInteger targetTextureIndex = [[targetTextureIndices objectAtIndex:indexOfObject] integerValue]; // // [currentTarget setInputSize:CGSizeMake(bufferWidth, bufferHeight) atIndex:targetTextureIndex]; // [currentTarget setInputTexture:outputTexture atIndex:targetTextureIndex]; // // [currentTarget newFrameReadyAtTime:currentSampleTime atIndex:targetTextureIndex]; // } // // CVPixelBufferUnlockBaseAddress(movieFrame, 0); // CVOpenGLESTextureCacheFlush(coreVideoTextureCache, 0); // CFRelease(texture); // // outputTexture = 0; } } else { // Upload to texture CVPixelBufferLockBaseAddress(movieFrame, 0); outputFramebuffer = [[GPUImageContext sharedFramebufferCache] fetchFramebufferForSize:CGSizeMake(bufferWidth, bufferHeight) textureOptions:self.outputTextureOptions onlyTexture:YES]; glBindTexture(GL_TEXTURE_2D, [outputFramebuffer texture]); // Using BGRA extension to pull in video frame data directly glTexImage2D(GL_TEXTURE_2D, 0, self.outputTextureOptions.internalFormat, bufferWidth, bufferHeight, 0, self.outputTextureOptions.format, self.outputTextureOptions.type, CVPixelBufferGetBaseAddress(movieFrame)); for (id currentTarget in targets) { NSInteger indexOfObject = [targets indexOfObject:currentTarget]; NSInteger targetTextureIndex = [[targetTextureIndices objectAtIndex:indexOfObject] integerValue]; [currentTarget setInputSize:CGSizeMake(bufferWidth, bufferHeight) atIndex:targetTextureIndex]; [currentTarget setInputFramebuffer:outputFramebuffer atIndex:targetTextureIndex]; } [outputFramebuffer unlock]; for (id currentTarget in targets) { NSInteger indexOfObject = [targets indexOfObject:currentTarget]; NSInteger targetTextureIndex = [[targetTextureIndices objectAtIndex:indexOfObject] integerValue]; [currentTarget newFrameReadyAtTime:currentSampleTime atIndex:targetTextureIndex]; } CVPixelBufferUnlockBaseAddress(movieFrame, 0); } if (_runBenchmark) { CFAbsoluteTime currentFrameTime = (CFAbsoluteTimeGetCurrent() - startTime); NSLog(@"Current frame time : %f ms", 1000.0 * currentFrameTime); } } - (void)endProcessing; { keepLooping = NO; #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE [displayLink setPaused:YES]; #else CVDisplayLinkStop(displayLink); #endif for (id currentTarget in targets) { [currentTarget endProcessing]; } if (synchronizedMovieWriter != nil) { #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE [synchronizedMovieWriter setVideoInputReadyCallback:^{return NO;}]; [synchronizedMovieWriter setAudioInputReadyCallback:^{return NO;}]; #else // I'm not sure about this, meybe setting a nil will be more appropriate then an empty block [synchronizedMovieWriter setVideoInputReadyCallback:^{}]; [synchronizedMovieWriter setAudioInputReadyCallback:^{}]; #endif } if (self.playerItem && (displayLink != nil)) { #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE [displayLink invalidate]; // remove from all run loops displayLink = nil; #else CVDisplayLinkStop(displayLink); displayLink = NULL; #endif } if ([self.delegate respondsToSelector:@selector(didCompletePlayingMovie)]) { [self.delegate didCompletePlayingMovie]; } self.delegate = nil; } - (void)cancelProcessing { if (reader) { [reader cancelReading]; } [self endProcessing]; } - (void)convertYUVToRGBOutput; { [GPUImageContext setActiveShaderProgram:yuvConversionProgram]; outputFramebuffer = [[GPUImageContext sharedFramebufferCache] fetchFramebufferForSize:CGSizeMake(imageBufferWidth, imageBufferHeight) onlyTexture:NO]; [outputFramebuffer activateFramebuffer]; glClearColor(0.0f, 0.0f, 0.0f, 1.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); static const GLfloat squareVertices[] = { -1.0f, -1.0f, 1.0f, -1.0f, -1.0f, 1.0f, 1.0f, 1.0f, }; static const GLfloat textureCoordinates[] = { 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, }; glActiveTexture(GL_TEXTURE4); glBindTexture(GL_TEXTURE_2D, luminanceTexture); glUniform1i(yuvConversionLuminanceTextureUniform, 4); glActiveTexture(GL_TEXTURE5); glBindTexture(GL_TEXTURE_2D, chrominanceTexture); glUniform1i(yuvConversionChrominanceTextureUniform, 5); glUniformMatrix3fv(yuvConversionMatrixUniform, 1, GL_FALSE, _preferredConversion); glVertexAttribPointer(yuvConversionPositionAttribute, 2, GL_FLOAT, 0, 0, squareVertices); glVertexAttribPointer(yuvConversionTextureCoordinateAttribute, 2, GL_FLOAT, 0, 0, textureCoordinates); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); } - (AVAssetReader*)assetReader { return reader; } - (BOOL)audioEncodingIsFinished { return audioEncodingIsFinished; } - (BOOL)videoEncodingIsFinished { return videoEncodingIsFinished; } @end ================================================ FILE: framework/Source/GPUImageMovieComposition.h ================================================ // // GPUImageMovieComposition.h // Givit // // Created by Sean Meiners on 2013/01/25. // // #import "GPUImageMovie.h" @interface GPUImageMovieComposition : GPUImageMovie @property (readwrite, retain) AVComposition *compositon; @property (readwrite, retain) AVVideoComposition *videoComposition; @property (readwrite, retain) AVAudioMix *audioMix; - (id)initWithComposition:(AVComposition*)compositon andVideoComposition:(AVVideoComposition*)videoComposition andAudioMix:(AVAudioMix*)audioMix; @end ================================================ FILE: framework/Source/GPUImageMovieComposition.m ================================================ // // GPUImageMovieComposition.m // Givit // // Created by Sean Meiners on 2013/01/25. // // #import "GPUImageMovieComposition.h" #import "GPUImageMovieWriter.h" @implementation GPUImageMovieComposition @synthesize compositon = _compositon; @synthesize videoComposition = _videoComposition; @synthesize audioMix = _audioMix; - (id)initWithComposition:(AVComposition*)compositon andVideoComposition:(AVVideoComposition*)videoComposition andAudioMix:(AVAudioMix*)audioMix { if (!(self = [super init])) { return nil; } [self yuvConversionSetup]; self.compositon = compositon; self.videoComposition = videoComposition; self.audioMix = audioMix; return self; } - (AVAssetReader*)createAssetReader { //NSLog(@"creating reader from composition: %@, video: %@, audio: %@ with duration: %@", _compositon, _videoComposition, _audioMix, CFBridgingRelease(CMTimeCopyDescription(kCFAllocatorDefault, _compositon.duration))); NSError *error = nil; AVAssetReader *assetReader = [AVAssetReader assetReaderWithAsset:self.compositon error:&error]; NSDictionary *outputSettings = @{(id)kCVPixelBufferPixelFormatTypeKey: @(kCVPixelFormatType_420YpCbCr8BiPlanarFullRange)}; AVAssetReaderVideoCompositionOutput *readerVideoOutput = [AVAssetReaderVideoCompositionOutput assetReaderVideoCompositionOutputWithVideoTracks:[_compositon tracksWithMediaType:AVMediaTypeVideo] videoSettings:outputSettings]; #if ! TARGET_IPHONE_SIMULATOR if( [_videoComposition isKindOfClass:[AVMutableVideoComposition class]] ) [(AVMutableVideoComposition*)_videoComposition setRenderScale:1.0]; #endif readerVideoOutput.videoComposition = self.videoComposition; readerVideoOutput.alwaysCopiesSampleData = NO; [assetReader addOutput:readerVideoOutput]; NSArray *audioTracks = [_compositon tracksWithMediaType:AVMediaTypeAudio]; BOOL shouldRecordAudioTrack = (([audioTracks count] > 0) && (self.audioEncodingTarget != nil) ); AVAssetReaderAudioMixOutput *readerAudioOutput = nil; if (shouldRecordAudioTrack) { [self.audioEncodingTarget setShouldInvalidateAudioSampleWhenDone:YES]; readerAudioOutput = [AVAssetReaderAudioMixOutput assetReaderAudioMixOutputWithAudioTracks:audioTracks audioSettings:nil]; readerAudioOutput.audioMix = self.audioMix; readerAudioOutput.alwaysCopiesSampleData = NO; [assetReader addOutput:readerAudioOutput]; } return assetReader; } @end ================================================ FILE: framework/Source/GPUImageMultiplyBlendFilter.h ================================================ #import "GPUImageTwoInputFilter.h" @interface GPUImageMultiplyBlendFilter : GPUImageTwoInputFilter { } @end ================================================ FILE: framework/Source/GPUImageMultiplyBlendFilter.m ================================================ #import "GPUImageMultiplyBlendFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageMultiplyBlendFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; varying highp vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; void main() { lowp vec4 base = texture2D(inputImageTexture, textureCoordinate); lowp vec4 overlayer = texture2D(inputImageTexture2, textureCoordinate2); gl_FragColor = overlayer * base + overlayer * (1.0 - base.a) + base * (1.0 - overlayer.a); } ); #else NSString *const kGPUImageMultiplyBlendFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; varying vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; void main() { vec4 base = texture2D(inputImageTexture, textureCoordinate); vec4 overlayer = texture2D(inputImageTexture2, textureCoordinate2); gl_FragColor = overlayer * base + overlayer * (1.0 - base.a) + base * (1.0 - overlayer.a); } ); #endif @implementation GPUImageMultiplyBlendFilter - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageMultiplyBlendFragmentShaderString])) { return nil; } return self; } @end ================================================ FILE: framework/Source/GPUImageNobleCornerDetectionFilter.h ================================================ #import "GPUImageHarrisCornerDetectionFilter.h" /** Noble corner detector This is the Noble variant on the Harris detector, from Alison Noble, "Descriptions of Image Surfaces", PhD thesis, Department of Engineering Science, Oxford University 1989, p45. */ @interface GPUImageNobleCornerDetectionFilter : GPUImageHarrisCornerDetectionFilter @end ================================================ FILE: framework/Source/GPUImageNobleCornerDetectionFilter.m ================================================ #import "GPUImageNobleCornerDetectionFilter.h" @implementation GPUImageNobleCornerDetectionFilter #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageNobleCornerDetectionFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform lowp float sensitivity; void main() { mediump vec3 derivativeElements = texture2D(inputImageTexture, textureCoordinate).rgb; mediump float derivativeSum = derivativeElements.x + derivativeElements.y; // R = (Ix^2 * Iy^2 - Ixy * Ixy) / (Ix^2 + Iy^2) mediump float zElement = (derivativeElements.z * 2.0) - 1.0; // mediump float harrisIntensity = (derivativeElements.x * derivativeElements.y - (derivativeElements.z * derivativeElements.z)) / (derivativeSum); mediump float cornerness = (derivativeElements.x * derivativeElements.y - (zElement * zElement)) / (derivativeSum); // Original Harris detector // R = Ix^2 * Iy^2 - Ixy * Ixy - k * (Ix^2 + Iy^2)^2 // highp float harrisIntensity = derivativeElements.x * derivativeElements.y - (derivativeElements.z * derivativeElements.z) - harrisConstant * derivativeSum * derivativeSum; // gl_FragColor = vec4(vec3(harrisIntensity * 7.0), 1.0); gl_FragColor = vec4(vec3(cornerness * sensitivity), 1.0); } ); #else NSString *const kGPUImageNobleCornerDetectionFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform float sensitivity; void main() { vec3 derivativeElements = texture2D(inputImageTexture, textureCoordinate).rgb; float derivativeSum = derivativeElements.x + derivativeElements.y; // R = (Ix^2 * Iy^2 - Ixy * Ixy) / (Ix^2 + Iy^2) float zElement = (derivativeElements.z * 2.0) - 1.0; // mediump float harrisIntensity = (derivativeElements.x * derivativeElements.y - (derivativeElements.z * derivativeElements.z)) / (derivativeSum); float cornerness = (derivativeElements.x * derivativeElements.y - (zElement * zElement)) / (derivativeSum); // Original Harris detector // R = Ix^2 * Iy^2 - Ixy * Ixy - k * (Ix^2 + Iy^2)^2 // highp float harrisIntensity = derivativeElements.x * derivativeElements.y - (derivativeElements.z * derivativeElements.z) - harrisConstant * derivativeSum * derivativeSum; // gl_FragColor = vec4(vec3(harrisIntensity * 7.0), 1.0); gl_FragColor = vec4(vec3(cornerness * sensitivity), 1.0); } ); #endif #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [self initWithCornerDetectionFragmentShader:kGPUImageNobleCornerDetectionFragmentShaderString])) { return nil; } return self; } @end ================================================ FILE: framework/Source/GPUImageNonMaximumSuppressionFilter.h ================================================ #import "GPUImage3x3TextureSamplingFilter.h" @interface GPUImageNonMaximumSuppressionFilter : GPUImage3x3TextureSamplingFilter @end ================================================ FILE: framework/Source/GPUImageNonMaximumSuppressionFilter.m ================================================ #import "GPUImageNonMaximumSuppressionFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageNonMaximumSuppressionFragmentShaderString = SHADER_STRING ( uniform sampler2D inputImageTexture; varying highp vec2 textureCoordinate; varying highp vec2 leftTextureCoordinate; varying highp vec2 rightTextureCoordinate; varying highp vec2 topTextureCoordinate; varying highp vec2 topLeftTextureCoordinate; varying highp vec2 topRightTextureCoordinate; varying highp vec2 bottomTextureCoordinate; varying highp vec2 bottomLeftTextureCoordinate; varying highp vec2 bottomRightTextureCoordinate; void main() { lowp float bottomColor = texture2D(inputImageTexture, bottomTextureCoordinate).r; lowp float bottomLeftColor = texture2D(inputImageTexture, bottomLeftTextureCoordinate).r; lowp float bottomRightColor = texture2D(inputImageTexture, bottomRightTextureCoordinate).r; lowp vec4 centerColor = texture2D(inputImageTexture, textureCoordinate); lowp float leftColor = texture2D(inputImageTexture, leftTextureCoordinate).r; lowp float rightColor = texture2D(inputImageTexture, rightTextureCoordinate).r; lowp float topColor = texture2D(inputImageTexture, topTextureCoordinate).r; lowp float topRightColor = texture2D(inputImageTexture, topRightTextureCoordinate).r; lowp float topLeftColor = texture2D(inputImageTexture, topLeftTextureCoordinate).r; // Use a tiebreaker for pixels to the left and immediately above this one lowp float multiplier = 1.0 - step(centerColor.r, topColor); multiplier = multiplier * (1.0 - step(centerColor.r, topLeftColor)); multiplier = multiplier * (1.0 - step(centerColor.r, leftColor)); multiplier = multiplier * (1.0 - step(centerColor.r, bottomLeftColor)); lowp float maxValue = max(centerColor.r, bottomColor); maxValue = max(maxValue, bottomRightColor); maxValue = max(maxValue, rightColor); maxValue = max(maxValue, topRightColor); gl_FragColor = vec4((centerColor.rgb * step(maxValue, centerColor.r) * multiplier), 1.0); } ); #else NSString *const kGPUImageNonMaximumSuppressionFragmentShaderString = SHADER_STRING ( uniform sampler2D inputImageTexture; varying vec2 textureCoordinate; varying vec2 leftTextureCoordinate; varying vec2 rightTextureCoordinate; varying vec2 topTextureCoordinate; varying vec2 topLeftTextureCoordinate; varying vec2 topRightTextureCoordinate; varying vec2 bottomTextureCoordinate; varying vec2 bottomLeftTextureCoordinate; varying vec2 bottomRightTextureCoordinate; void main() { float bottomColor = texture2D(inputImageTexture, bottomTextureCoordinate).r; float bottomLeftColor = texture2D(inputImageTexture, bottomLeftTextureCoordinate).r; float bottomRightColor = texture2D(inputImageTexture, bottomRightTextureCoordinate).r; vec4 centerColor = texture2D(inputImageTexture, textureCoordinate); float leftColor = texture2D(inputImageTexture, leftTextureCoordinate).r; float rightColor = texture2D(inputImageTexture, rightTextureCoordinate).r; float topColor = texture2D(inputImageTexture, topTextureCoordinate).r; float topRightColor = texture2D(inputImageTexture, topRightTextureCoordinate).r; float topLeftColor = texture2D(inputImageTexture, topLeftTextureCoordinate).r; // Use a tiebreaker for pixels to the left and immediately above this one float multiplier = 1.0 - step(centerColor.r, topColor); multiplier = multiplier * (1.0 - step(centerColor.r, topLeftColor)); multiplier = multiplier * (1.0 - step(centerColor.r, leftColor)); multiplier = multiplier * (1.0 - step(centerColor.r, bottomLeftColor)); float maxValue = max(centerColor.r, bottomColor); maxValue = max(maxValue, bottomRightColor); maxValue = max(maxValue, rightColor); maxValue = max(maxValue, topRightColor); gl_FragColor = vec4((centerColor.rgb * step(maxValue, centerColor.r) * multiplier), 1.0); } ); #endif @implementation GPUImageNonMaximumSuppressionFilter #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageNonMaximumSuppressionFragmentShaderString])) { return nil; } return self; } @end ================================================ FILE: framework/Source/GPUImageNormalBlendFilter.h ================================================ // Created by Jorge Garcia on 9/5/12. // #import "GPUImageTwoInputFilter.h" @interface GPUImageNormalBlendFilter : GPUImageTwoInputFilter @end ================================================ FILE: framework/Source/GPUImageNormalBlendFilter.m ================================================ // Created by Jorge Garcia on 9/5/12. #import "GPUImageNormalBlendFilter.h" /* This equation is a simplification of the general blending equation. It assumes the destination color is opaque, and therefore drops the destination color's alpha term. D = C1 * C1a + C2 * C2a * (1 - C1a) where D is the resultant color, C1 is the color of the first element, C1a is the alpha of the first element, C2 is the second element color, C2a is the alpha of the second element. The destination alpha is calculated with: Da = C1a + C2a * (1 - C1a) The resultant color is premultiplied with the alpha. To restore the color to the unmultiplied values, just divide by Da, the resultant alpha. http://stackoverflow.com/questions/1724946/blend-mode-on-a-transparent-and-semi-transparent-background For some reason Photoshop behaves D = C1 + C2 * C2a * (1 - C1a) */ #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageNormalBlendFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; varying highp vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; void main() { lowp vec4 c2 = texture2D(inputImageTexture, textureCoordinate); lowp vec4 c1 = texture2D(inputImageTexture2, textureCoordinate2); lowp vec4 outputColor; // outputColor.r = c1.r + c2.r * c2.a * (1.0 - c1.a); // outputColor.g = c1.g + c2.g * c2.a * (1.0 - c1.a); // outputColor.b = c1.b + c2.b * c2.a * (1.0 - c1.a); // outputColor.a = c1.a + c2.a * (1.0 - c1.a); lowp float a = c1.a + c2.a * (1.0 - c1.a); lowp float alphaDivisor = a + step(a, 0.0); // Protect against a divide-by-zero blacking out things in the output outputColor.r = (c1.r * c1.a + c2.r * c2.a * (1.0 - c1.a))/alphaDivisor; outputColor.g = (c1.g * c1.a + c2.g * c2.a * (1.0 - c1.a))/alphaDivisor; outputColor.b = (c1.b * c1.a + c2.b * c2.a * (1.0 - c1.a))/alphaDivisor; outputColor.a = a; gl_FragColor = outputColor; } ); #else NSString *const kGPUImageNormalBlendFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; varying vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; void main() { vec4 c2 = texture2D(inputImageTexture, textureCoordinate); vec4 c1 = texture2D(inputImageTexture2, textureCoordinate2); vec4 outputColor; // outputColor.r = c1.r + c2.r * c2.a * (1.0 - c1.a); // outputColor.g = c1.g + c2.g * c2.a * (1.0 - c1.a); // outputColor.b = c1.b + c2.b * c2.a * (1.0 - c1.a); // outputColor.a = c1.a + c2.a * (1.0 - c1.a); float a = c1.a + c2.a * (1.0 - c1.a); float alphaDivisor = a + step(a, 0.0); // Protect against a divide-by-zero blacking out things in the output outputColor.r = (c1.r * c1.a + c2.r * c2.a * (1.0 - c1.a))/alphaDivisor; outputColor.g = (c1.g * c1.a + c2.g * c2.a * (1.0 - c1.a))/alphaDivisor; outputColor.b = (c1.b * c1.a + c2.b * c2.a * (1.0 - c1.a))/alphaDivisor; outputColor.a = a; gl_FragColor = outputColor; } ); #endif @implementation GPUImageNormalBlendFilter - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageNormalBlendFragmentShaderString])) { return nil; } return self; } @end ================================================ FILE: framework/Source/GPUImageOpacityFilter.h ================================================ #import "GPUImageFilter.h" @interface GPUImageOpacityFilter : GPUImageFilter { GLint opacityUniform; } // Opacity ranges from 0.0 to 1.0, with 1.0 as the normal setting @property(readwrite, nonatomic) CGFloat opacity; @end ================================================ FILE: framework/Source/GPUImageOpacityFilter.m ================================================ #import "GPUImageOpacityFilter.h" @implementation GPUImageOpacityFilter @synthesize opacity = _opacity; #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageOpacityFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform lowp float opacity; void main() { lowp vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); gl_FragColor = vec4(textureColor.rgb, textureColor.a * opacity); } ); #else NSString *const kGPUImageOpacityFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform float opacity; void main() { vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); gl_FragColor = vec4(textureColor.rgb, textureColor.a * opacity); } ); #endif #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageOpacityFragmentShaderString])) { return nil; } opacityUniform = [filterProgram uniformIndex:@"opacity"]; self.opacity = 1.0; return self; } #pragma mark - #pragma mark Accessors - (void)setOpacity:(CGFloat)newValue; { _opacity = newValue; [self setFloat:_opacity forUniform:opacityUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImageOpeningFilter.h ================================================ #import "GPUImageFilterGroup.h" @class GPUImageErosionFilter; @class GPUImageDilationFilter; // A filter that first performs an erosion on the red channel of an image, followed by a dilation of the same radius. // This helps to filter out smaller bright elements. @interface GPUImageOpeningFilter : GPUImageFilterGroup { GPUImageErosionFilter *erosionFilter; GPUImageDilationFilter *dilationFilter; } @property(readwrite, nonatomic) CGFloat verticalTexelSpacing, horizontalTexelSpacing; - (id)initWithRadius:(NSUInteger)radius; @end ================================================ FILE: framework/Source/GPUImageOpeningFilter.m ================================================ #import "GPUImageOpeningFilter.h" #import "GPUImageErosionFilter.h" #import "GPUImageDilationFilter.h" @implementation GPUImageOpeningFilter @synthesize verticalTexelSpacing = _verticalTexelSpacing; @synthesize horizontalTexelSpacing = _horizontalTexelSpacing; - (id)init; { if (!(self = [self initWithRadius:1])) { return nil; } return self; } - (id)initWithRadius:(NSUInteger)radius; { if (!(self = [super init])) { return nil; } // First pass: erosion erosionFilter = [[GPUImageErosionFilter alloc] initWithRadius:radius]; [self addFilter:erosionFilter]; // Second pass: dilation dilationFilter = [[GPUImageDilationFilter alloc] initWithRadius:radius]; [self addFilter:dilationFilter]; [erosionFilter addTarget:dilationFilter]; self.initialFilters = [NSArray arrayWithObjects:erosionFilter, nil]; self.terminalFilter = dilationFilter; return self; } - (void)setVerticalTexelSpacing:(CGFloat)newValue; { _verticalTexelSpacing = newValue; erosionFilter.verticalTexelSpacing = newValue; dilationFilter.verticalTexelSpacing = newValue; } - (void)setHorizontalTexelSpacing:(CGFloat)newValue; { _horizontalTexelSpacing = newValue; erosionFilter.horizontalTexelSpacing = newValue; dilationFilter.horizontalTexelSpacing = newValue; } @end ================================================ FILE: framework/Source/GPUImageOutput.h ================================================ #import "GPUImageContext.h" #import "GPUImageFramebuffer.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE #import #else // For now, just redefine this on the Mac typedef NS_ENUM(NSInteger, UIImageOrientation) { UIImageOrientationUp, // default orientation UIImageOrientationDown, // 180 deg rotation UIImageOrientationLeft, // 90 deg CCW UIImageOrientationRight, // 90 deg CW UIImageOrientationUpMirrored, // as above but image mirrored along other axis. horizontal flip UIImageOrientationDownMirrored, // horizontal flip UIImageOrientationLeftMirrored, // vertical flip UIImageOrientationRightMirrored, // vertical flip }; #endif dispatch_queue_attr_t GPUImageDefaultQueueAttribute(void); void runOnMainQueueWithoutDeadlocking(void (^block)(void)); void runSynchronouslyOnVideoProcessingQueue(void (^block)(void)); void runAsynchronouslyOnVideoProcessingQueue(void (^block)(void)); void runSynchronouslyOnContextQueue(GPUImageContext *context, void (^block)(void)); void runAsynchronouslyOnContextQueue(GPUImageContext *context, void (^block)(void)); void reportAvailableMemoryForGPUImage(NSString *tag); @class GPUImageMovieWriter; /** GPUImage's base source object Images or frames of video are uploaded from source objects, which are subclasses of GPUImageOutput. These include: - GPUImageVideoCamera (for live video from an iOS camera) - GPUImageStillCamera (for taking photos with the camera) - GPUImagePicture (for still images) - GPUImageMovie (for movies) Source objects upload still image frames to OpenGL ES as textures, then hand those textures off to the next objects in the processing chain. */ @interface GPUImageOutput : NSObject { GPUImageFramebuffer *outputFramebuffer; NSMutableArray *targets, *targetTextureIndices; CGSize inputTextureSize, cachedMaximumOutputSize, forcedMaximumSize; BOOL overrideInputSize; BOOL allTargetsWantMonochromeData; BOOL usingNextFrameForImageCapture; } @property(readwrite, nonatomic) BOOL shouldSmoothlyScaleOutput; @property(readwrite, nonatomic) BOOL shouldIgnoreUpdatesToThisTarget; @property(readwrite, nonatomic, retain) GPUImageMovieWriter *audioEncodingTarget; @property(readwrite, nonatomic, unsafe_unretained) id targetToIgnoreForUpdates; @property(nonatomic, copy) void(^frameProcessingCompletionBlock)(GPUImageOutput*, CMTime); @property(nonatomic) BOOL enabled; @property(readwrite, nonatomic) GPUTextureOptions outputTextureOptions; /// @name Managing targets - (void)setInputFramebufferForTarget:(id)target atIndex:(NSInteger)inputTextureIndex; - (GPUImageFramebuffer *)framebufferForOutput; - (void)removeOutputFramebuffer; - (void)notifyTargetsAboutNewOutputTexture; /** Returns an array of the current targets. */ - (NSArray*)targets; /** Adds a target to receive notifications when new frames are available. The target will be asked for its next available texture. See [GPUImageInput newFrameReadyAtTime:] @param newTarget Target to be added */ - (void)addTarget:(id)newTarget; /** Adds a target to receive notifications when new frames are available. See [GPUImageInput newFrameReadyAtTime:] @param newTarget Target to be added */ - (void)addTarget:(id)newTarget atTextureLocation:(NSInteger)textureLocation; /** Removes a target. The target will no longer receive notifications when new frames are available. @param targetToRemove Target to be removed */ - (void)removeTarget:(id)targetToRemove; /** Removes all targets. */ - (void)removeAllTargets; /// @name Manage the output texture - (void)forceProcessingAtSize:(CGSize)frameSize; - (void)forceProcessingAtSizeRespectingAspectRatio:(CGSize)frameSize; /// @name Still image processing - (void)useNextFrameForImageCapture; - (CGImageRef)newCGImageFromCurrentlyProcessedOutput; - (CGImageRef)newCGImageByFilteringCGImage:(CGImageRef)imageToFilter; // Platform-specific image output methods // If you're trying to use these methods, remember that you need to set -useNextFrameForImageCapture before running -processImage or running video and calling any of these methods, or you will get a nil image #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE - (UIImage *)imageFromCurrentFramebuffer; - (UIImage *)imageFromCurrentFramebufferWithOrientation:(UIImageOrientation)imageOrientation; - (UIImage *)imageByFilteringImage:(UIImage *)imageToFilter; - (CGImageRef)newCGImageByFilteringImage:(UIImage *)imageToFilter; #else - (NSImage *)imageFromCurrentFramebuffer; - (NSImage *)imageFromCurrentFramebufferWithOrientation:(UIImageOrientation)imageOrientation; - (NSImage *)imageByFilteringImage:(NSImage *)imageToFilter; - (CGImageRef)newCGImageByFilteringImage:(NSImage *)imageToFilter; #endif - (BOOL)providesMonochromeOutput; @end ================================================ FILE: framework/Source/GPUImageOutput.m ================================================ #import "GPUImageOutput.h" #import "GPUImageMovieWriter.h" #import "GPUImagePicture.h" #import dispatch_queue_attr_t GPUImageDefaultQueueAttribute(void) { #if TARGET_OS_IPHONE if ([[[UIDevice currentDevice] systemVersion] compare:@"9.0" options:NSNumericSearch] != NSOrderedAscending) { return dispatch_queue_attr_make_with_qos_class(DISPATCH_QUEUE_SERIAL, QOS_CLASS_DEFAULT, 0); } #endif return nil; } void runOnMainQueueWithoutDeadlocking(void (^block)(void)) { if ([NSThread isMainThread]) { block(); } else { dispatch_sync(dispatch_get_main_queue(), block); } } void runSynchronouslyOnVideoProcessingQueue(void (^block)(void)) { dispatch_queue_t videoProcessingQueue = [GPUImageContext sharedContextQueue]; #if !OS_OBJECT_USE_OBJC #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" if (dispatch_get_current_queue() == videoProcessingQueue) #pragma clang diagnostic pop #else if (dispatch_get_specific([GPUImageContext contextKey])) #endif { block(); }else { dispatch_sync(videoProcessingQueue, block); } } void runAsynchronouslyOnVideoProcessingQueue(void (^block)(void)) { dispatch_queue_t videoProcessingQueue = [GPUImageContext sharedContextQueue]; #if !OS_OBJECT_USE_OBJC #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" if (dispatch_get_current_queue() == videoProcessingQueue) #pragma clang diagnostic pop #else if (dispatch_get_specific([GPUImageContext contextKey])) #endif { block(); }else { dispatch_async(videoProcessingQueue, block); } } void runSynchronouslyOnContextQueue(GPUImageContext *context, void (^block)(void)) { dispatch_queue_t videoProcessingQueue = [context contextQueue]; #if !OS_OBJECT_USE_OBJC #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" if (dispatch_get_current_queue() == videoProcessingQueue) #pragma clang diagnostic pop #else if (dispatch_get_specific([GPUImageContext contextKey])) #endif { block(); }else { dispatch_sync(videoProcessingQueue, block); } } void runAsynchronouslyOnContextQueue(GPUImageContext *context, void (^block)(void)) { dispatch_queue_t videoProcessingQueue = [context contextQueue]; #if !OS_OBJECT_USE_OBJC #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" if (dispatch_get_current_queue() == videoProcessingQueue) #pragma clang diagnostic pop #else if (dispatch_get_specific([GPUImageContext contextKey])) #endif { block(); }else { dispatch_async(videoProcessingQueue, block); } } void reportAvailableMemoryForGPUImage(NSString *tag) { if (!tag) tag = @"Default"; struct task_basic_info info; mach_msg_type_number_t size = sizeof(info); kern_return_t kerr = task_info(mach_task_self(), TASK_BASIC_INFO, (task_info_t)&info, &size); if( kerr == KERN_SUCCESS ) { NSLog(@"%@ - Memory used: %u", tag, (unsigned int)info.resident_size); //in bytes } else { NSLog(@"%@ - Error: %s", tag, mach_error_string(kerr)); } } @implementation GPUImageOutput @synthesize shouldSmoothlyScaleOutput = _shouldSmoothlyScaleOutput; @synthesize shouldIgnoreUpdatesToThisTarget = _shouldIgnoreUpdatesToThisTarget; @synthesize audioEncodingTarget = _audioEncodingTarget; @synthesize targetToIgnoreForUpdates = _targetToIgnoreForUpdates; @synthesize frameProcessingCompletionBlock = _frameProcessingCompletionBlock; @synthesize enabled = _enabled; @synthesize outputTextureOptions = _outputTextureOptions; #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super init])) { return nil; } targets = [[NSMutableArray alloc] init]; targetTextureIndices = [[NSMutableArray alloc] init]; _enabled = YES; allTargetsWantMonochromeData = YES; usingNextFrameForImageCapture = NO; // set default texture options _outputTextureOptions.minFilter = GL_LINEAR; _outputTextureOptions.magFilter = GL_LINEAR; _outputTextureOptions.wrapS = GL_CLAMP_TO_EDGE; _outputTextureOptions.wrapT = GL_CLAMP_TO_EDGE; _outputTextureOptions.internalFormat = GL_RGBA; _outputTextureOptions.format = GL_BGRA; _outputTextureOptions.type = GL_UNSIGNED_BYTE; return self; } - (void)dealloc { [self removeAllTargets]; } #pragma mark - #pragma mark Managing targets - (void)setInputFramebufferForTarget:(id)target atIndex:(NSInteger)inputTextureIndex; { [target setInputFramebuffer:[self framebufferForOutput] atIndex:inputTextureIndex]; } - (GPUImageFramebuffer *)framebufferForOutput; { return outputFramebuffer; } - (void)removeOutputFramebuffer; { outputFramebuffer = nil; } - (void)notifyTargetsAboutNewOutputTexture; { for (id currentTarget in targets) { NSInteger indexOfObject = [targets indexOfObject:currentTarget]; NSInteger textureIndex = [[targetTextureIndices objectAtIndex:indexOfObject] integerValue]; [self setInputFramebufferForTarget:currentTarget atIndex:textureIndex]; } } - (NSArray*)targets; { return [NSArray arrayWithArray:targets]; } - (void)addTarget:(id)newTarget; { NSInteger nextAvailableTextureIndex = [newTarget nextAvailableTextureIndex]; [self addTarget:newTarget atTextureLocation:nextAvailableTextureIndex]; if ([newTarget shouldIgnoreUpdatesToThisTarget]) { _targetToIgnoreForUpdates = newTarget; } } - (void)addTarget:(id)newTarget atTextureLocation:(NSInteger)textureLocation; { if([targets containsObject:newTarget]) { return; } cachedMaximumOutputSize = CGSizeZero; runSynchronouslyOnVideoProcessingQueue(^{ [self setInputFramebufferForTarget:newTarget atIndex:textureLocation]; [targets addObject:newTarget]; [targetTextureIndices addObject:[NSNumber numberWithInteger:textureLocation]]; allTargetsWantMonochromeData = allTargetsWantMonochromeData && [newTarget wantsMonochromeInput]; }); } - (void)removeTarget:(id)targetToRemove; { if(![targets containsObject:targetToRemove]) { return; } if (_targetToIgnoreForUpdates == targetToRemove) { _targetToIgnoreForUpdates = nil; } cachedMaximumOutputSize = CGSizeZero; NSInteger indexOfObject = [targets indexOfObject:targetToRemove]; NSInteger textureIndexOfTarget = [[targetTextureIndices objectAtIndex:indexOfObject] integerValue]; runSynchronouslyOnVideoProcessingQueue(^{ [targetToRemove setInputSize:CGSizeZero atIndex:textureIndexOfTarget]; [targetToRemove setInputRotation:kGPUImageNoRotation atIndex:textureIndexOfTarget]; [targetTextureIndices removeObjectAtIndex:indexOfObject]; [targets removeObject:targetToRemove]; [targetToRemove endProcessing]; }); } - (void)removeAllTargets; { cachedMaximumOutputSize = CGSizeZero; runSynchronouslyOnVideoProcessingQueue(^{ for (id targetToRemove in targets) { NSInteger indexOfObject = [targets indexOfObject:targetToRemove]; NSInteger textureIndexOfTarget = [[targetTextureIndices objectAtIndex:indexOfObject] integerValue]; [targetToRemove setInputSize:CGSizeZero atIndex:textureIndexOfTarget]; [targetToRemove setInputRotation:kGPUImageNoRotation atIndex:textureIndexOfTarget]; } [targets removeAllObjects]; [targetTextureIndices removeAllObjects]; allTargetsWantMonochromeData = YES; }); } #pragma mark - #pragma mark Manage the output texture - (void)forceProcessingAtSize:(CGSize)frameSize; { } - (void)forceProcessingAtSizeRespectingAspectRatio:(CGSize)frameSize; { } #pragma mark - #pragma mark Still image processing - (void)useNextFrameForImageCapture; { } - (CGImageRef)newCGImageFromCurrentlyProcessedOutput; { return nil; } - (CGImageRef)newCGImageByFilteringCGImage:(CGImageRef)imageToFilter; { GPUImagePicture *stillImageSource = [[GPUImagePicture alloc] initWithCGImage:imageToFilter]; [self useNextFrameForImageCapture]; [stillImageSource addTarget:(id)self]; [stillImageSource processImage]; CGImageRef processedImage = [self newCGImageFromCurrentlyProcessedOutput]; [stillImageSource removeTarget:(id)self]; return processedImage; } - (BOOL)providesMonochromeOutput; { return NO; } #pragma mark - #pragma mark Platform-specific image output methods #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE - (UIImage *)imageFromCurrentFramebuffer; { UIDeviceOrientation deviceOrientation = [[UIDevice currentDevice] orientation]; UIImageOrientation imageOrientation = UIImageOrientationLeft; switch (deviceOrientation) { case UIDeviceOrientationPortrait: imageOrientation = UIImageOrientationUp; break; case UIDeviceOrientationPortraitUpsideDown: imageOrientation = UIImageOrientationDown; break; case UIDeviceOrientationLandscapeLeft: imageOrientation = UIImageOrientationLeft; break; case UIDeviceOrientationLandscapeRight: imageOrientation = UIImageOrientationRight; break; default: imageOrientation = UIImageOrientationUp; break; } return [self imageFromCurrentFramebufferWithOrientation:imageOrientation]; } - (UIImage *)imageFromCurrentFramebufferWithOrientation:(UIImageOrientation)imageOrientation; { CGImageRef cgImageFromBytes = [self newCGImageFromCurrentlyProcessedOutput]; UIImage *finalImage = [UIImage imageWithCGImage:cgImageFromBytes scale:1.0 orientation:imageOrientation]; CGImageRelease(cgImageFromBytes); return finalImage; } - (UIImage *)imageByFilteringImage:(UIImage *)imageToFilter; { CGImageRef image = [self newCGImageByFilteringCGImage:[imageToFilter CGImage]]; UIImage *processedImage = [UIImage imageWithCGImage:image scale:[imageToFilter scale] orientation:[imageToFilter imageOrientation]]; CGImageRelease(image); return processedImage; } - (CGImageRef)newCGImageByFilteringImage:(UIImage *)imageToFilter { return [self newCGImageByFilteringCGImage:[imageToFilter CGImage]]; } #else - (NSImage *)imageFromCurrentFramebuffer; { return [self imageFromCurrentFramebufferWithOrientation:UIImageOrientationLeft]; } - (NSImage *)imageFromCurrentFramebufferWithOrientation:(UIImageOrientation)imageOrientation; { CGImageRef cgImageFromBytes = [self newCGImageFromCurrentlyProcessedOutput]; NSImage *finalImage = [[NSImage alloc] initWithCGImage:cgImageFromBytes size:NSZeroSize]; CGImageRelease(cgImageFromBytes); return finalImage; } - (NSImage *)imageByFilteringImage:(NSImage *)imageToFilter; { CGImageRef image = [self newCGImageByFilteringCGImage:[imageToFilter CGImageForProposedRect:NULL context:[NSGraphicsContext currentContext] hints:nil]]; NSImage *processedImage = [[NSImage alloc] initWithCGImage:image size:NSZeroSize]; CGImageRelease(image); return processedImage; } - (CGImageRef)newCGImageByFilteringImage:(NSImage *)imageToFilter { return [self newCGImageByFilteringCGImage:[imageToFilter CGImageForProposedRect:NULL context:[NSGraphicsContext currentContext] hints:nil]]; } #endif #pragma mark - #pragma mark Accessors - (void)setAudioEncodingTarget:(GPUImageMovieWriter *)newValue; { _audioEncodingTarget = newValue; if( ! _audioEncodingTarget.hasAudioTrack ) { _audioEncodingTarget.hasAudioTrack = YES; } } -(void)setOutputTextureOptions:(GPUTextureOptions)outputTextureOptions { _outputTextureOptions = outputTextureOptions; if( outputFramebuffer.texture ) { glBindTexture(GL_TEXTURE_2D, outputFramebuffer.texture); //_outputTextureOptions.format //_outputTextureOptions.internalFormat //_outputTextureOptions.magFilter //_outputTextureOptions.minFilter //_outputTextureOptions.type glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, _outputTextureOptions.wrapS); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, _outputTextureOptions.wrapT); glBindTexture(GL_TEXTURE_2D, 0); } } @end ================================================ FILE: framework/Source/GPUImageOverlayBlendFilter.h ================================================ #import "GPUImageTwoInputFilter.h" @interface GPUImageOverlayBlendFilter : GPUImageTwoInputFilter @end ================================================ FILE: framework/Source/GPUImageOverlayBlendFilter.m ================================================ #import "GPUImageOverlayBlendFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageOverlayBlendFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; varying highp vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; void main() { mediump vec4 base = texture2D(inputImageTexture, textureCoordinate); mediump vec4 overlay = texture2D(inputImageTexture2, textureCoordinate2); mediump float ra; if (2.0 * base.r < base.a) { ra = 2.0 * overlay.r * base.r + overlay.r * (1.0 - base.a) + base.r * (1.0 - overlay.a); } else { ra = overlay.a * base.a - 2.0 * (base.a - base.r) * (overlay.a - overlay.r) + overlay.r * (1.0 - base.a) + base.r * (1.0 - overlay.a); } mediump float ga; if (2.0 * base.g < base.a) { ga = 2.0 * overlay.g * base.g + overlay.g * (1.0 - base.a) + base.g * (1.0 - overlay.a); } else { ga = overlay.a * base.a - 2.0 * (base.a - base.g) * (overlay.a - overlay.g) + overlay.g * (1.0 - base.a) + base.g * (1.0 - overlay.a); } mediump float ba; if (2.0 * base.b < base.a) { ba = 2.0 * overlay.b * base.b + overlay.b * (1.0 - base.a) + base.b * (1.0 - overlay.a); } else { ba = overlay.a * base.a - 2.0 * (base.a - base.b) * (overlay.a - overlay.b) + overlay.b * (1.0 - base.a) + base.b * (1.0 - overlay.a); } gl_FragColor = vec4(ra, ga, ba, 1.0); } ); #else NSString *const kGPUImageOverlayBlendFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; varying vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; void main() { vec4 base = texture2D(inputImageTexture, textureCoordinate); vec4 overlay = texture2D(inputImageTexture2, textureCoordinate2); float ra; if (2.0 * base.r < base.a) { ra = 2.0 * overlay.r * base.r + overlay.r * (1.0 - base.a) + base.r * (1.0 - overlay.a); } else { ra = overlay.a * base.a - 2.0 * (base.a - base.r) * (overlay.a - overlay.r) + overlay.r * (1.0 - base.a) + base.r * (1.0 - overlay.a); } float ga; if (2.0 * base.g < base.a) { ga = 2.0 * overlay.g * base.g + overlay.g * (1.0 - base.a) + base.g * (1.0 - overlay.a); } else { ga = overlay.a * base.a - 2.0 * (base.a - base.g) * (overlay.a - overlay.g) + overlay.g * (1.0 - base.a) + base.g * (1.0 - overlay.a); } float ba; if (2.0 * base.b < base.a) { ba = 2.0 * overlay.b * base.b + overlay.b * (1.0 - base.a) + base.b * (1.0 - overlay.a); } else { ba = overlay.a * base.a - 2.0 * (base.a - base.b) * (overlay.a - overlay.b) + overlay.b * (1.0 - base.a) + base.b * (1.0 - overlay.a); } gl_FragColor = vec4(ra, ga, ba, 1.0); } ); #endif @implementation GPUImageOverlayBlendFilter - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageOverlayBlendFragmentShaderString])) { return nil; } return self; } @end ================================================ FILE: framework/Source/GPUImageParallelCoordinateLineTransformFilter.h ================================================ #import "GPUImageFilter.h" // This is an accumulator that uses a Hough transform in parallel coordinate space to identify probable lines in a scene. // // It is entirely based on the work of the Graph@FIT research group at the Brno University of Technology and their publications: // M. Dubská, J. Havel, and A. Herout. Real-Time Detection of Lines using Parallel Coordinates and OpenGL. Proceedings of SCCG 2011, Bratislava, SK, p. 7. // M. Dubská, J. Havel, and A. Herout. PClines — Line detection using parallel coordinates. 2011 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), p. 1489- 1494. @interface GPUImageParallelCoordinateLineTransformFilter : GPUImageFilter { GLubyte *rawImagePixels; GLfloat *lineCoordinates; unsigned int maxLinePairsToRender, linePairsToRender; } @end ================================================ FILE: framework/Source/GPUImageParallelCoordinateLineTransformFilter.m ================================================ #import "GPUImageParallelCoordinateLineTransformFilter.h" NSString *const kGPUImageHoughAccumulationVertexShaderString = SHADER_STRING ( attribute vec4 position; void main() { gl_Position = position; } ); #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageHoughAccumulationFragmentShaderString = SHADER_STRING ( const lowp float scalingFactor = 1.0 / 256.0; void main() { gl_FragColor = vec4(0.004, 0.004, 0.004, 1.0); } ); // highp - 16-bit, floating point range: -2^62 to 2^62, integer range: -2^16 to 2^16 // NOTE: See below for where I'm tacking on the required extension as a prefix NSString *const kGPUImageHoughAccumulationFBOReadFragmentShaderString = SHADER_STRING ( const lowp float scalingFactor = 0.004; // const lowp float scalingFactor = 0.1; void main() { mediump vec4 fragmentData = gl_LastFragData[0]; fragmentData.r = fragmentData.r + scalingFactor; fragmentData.g = scalingFactor * floor(fragmentData.r) + fragmentData.g; fragmentData.b = scalingFactor * floor(fragmentData.g) + fragmentData.b; fragmentData.a = scalingFactor * floor(fragmentData.b) + fragmentData.a; fragmentData = fract(fragmentData); gl_FragColor = vec4(fragmentData.rgb, 1.0); } ); #else NSString *const kGPUImageHoughAccumulationFragmentShaderString = SHADER_STRING ( const float scalingFactor = 1.0 / 256.0; void main() { gl_FragColor = vec4(0.004, 0.004, 0.004, 1.0); } ); NSString *const kGPUImageHoughAccumulationFBOReadFragmentShaderString = SHADER_STRING ( const float scalingFactor = 1.0 / 256.0; void main() { // gl_FragColor = vec4(scalingFactor, scalingFactor, scalingFactor, 1.0); gl_FragColor = vec4(0.004, 0.004, 0.004, 1.0); } ); #endif @interface GPUImageParallelCoordinateLineTransformFilter() // Rendering - (void)generateLineCoordinates; @end @implementation GPUImageParallelCoordinateLineTransformFilter #pragma mark - #pragma mark Initialization and teardown - (id)init; { NSString *fragmentShaderToUse = nil; if ([GPUImageContext deviceSupportsFramebufferReads]) { fragmentShaderToUse = [NSString stringWithFormat:@"#extension GL_EXT_shader_framebuffer_fetch : require\n %@",kGPUImageHoughAccumulationFBOReadFragmentShaderString]; } else { fragmentShaderToUse = kGPUImageHoughAccumulationFragmentShaderString; } if (!(self = [super initWithVertexShaderFromString:kGPUImageHoughAccumulationVertexShaderString fragmentShaderFromString:fragmentShaderToUse])) { return nil; } return self; } // TODO: have this be regenerated on change of image size - (void)dealloc; { free(rawImagePixels); free(lineCoordinates); } - (void)initializeAttributes; { [filterProgram addAttribute:@"position"]; } #pragma mark - #pragma mark Rendering #define MAXLINESCALINGFACTOR 4 - (void)generateLineCoordinates; { unsigned int imageByteSize = inputTextureSize.width * inputTextureSize.height * 4; rawImagePixels = (GLubyte *)malloc(imageByteSize); maxLinePairsToRender = (inputTextureSize.width * inputTextureSize.height) / MAXLINESCALINGFACTOR; lineCoordinates = calloc(maxLinePairsToRender * 8, sizeof(GLfloat)); } - (void)newFrameReadyAtTime:(CMTime)frameTime atIndex:(NSInteger)textureIndex; { if (lineCoordinates == NULL) { [self generateLineCoordinates]; } [self renderToTextureWithVertices:NULL textureCoordinates:NULL]; [self informTargetsAboutNewFrameAtTime:frameTime]; } - (void)renderToTextureWithVertices:(const GLfloat *)vertices textureCoordinates:(const GLfloat *)textureCoordinates; { // we need a normal color texture for this filter NSAssert(self.outputTextureOptions.internalFormat == GL_RGBA, @"The output texture format for this filter must be GL_RGBA."); NSAssert(self.outputTextureOptions.type == GL_UNSIGNED_BYTE, @"The type of the output texture of this filter must be GL_UNSIGNED_BYTE."); if (self.preventRendering) { [firstInputFramebuffer unlock]; return; } // Grab the edge points from the previous frame and create the parallel coordinate lines for them // This would be a great place to have a working histogram pyramid implementation [GPUImageContext useImageProcessingContext]; [firstInputFramebuffer activateFramebuffer]; glFinish(); glReadPixels(0, 0, inputTextureSize.width, inputTextureSize.height, GL_RGBA, GL_UNSIGNED_BYTE, rawImagePixels); CGFloat xAspectMultiplier = 1.0, yAspectMultiplier = 1.0; // if (inputTextureSize.width > inputTextureSize.height) // { // yAspectMultiplier = inputTextureSize.height / inputTextureSize.width; // } // else // { // xAspectMultiplier = inputTextureSize.width / inputTextureSize.height; // } // CFAbsoluteTime startTime = CFAbsoluteTimeGetCurrent(); unsigned int imageByteSize = inputTextureSize.width * inputTextureSize.height * 4; unsigned int imageWidth = inputTextureSize.width * 4; linePairsToRender = 0; unsigned int currentByte = 0; unsigned int lineStorageIndex = 0; unsigned int maxLineStorageIndex = maxLinePairsToRender * 8 - 8; GLfloat minY = 100, maxY = -100, minX = 100, maxX = -100; while (currentByte < imageByteSize) { GLubyte colorByte = rawImagePixels[currentByte]; if (colorByte > 0) { unsigned int xCoordinate = currentByte % imageWidth; unsigned int yCoordinate = currentByte / imageWidth; CGFloat normalizedXCoordinate = (-1.0 + 2.0 * (CGFloat)(xCoordinate / 4) / inputTextureSize.width) * xAspectMultiplier; CGFloat normalizedYCoordinate = (-1.0 + 2.0 * (CGFloat)(yCoordinate) / inputTextureSize.height) * yAspectMultiplier; minY = MIN(minY, normalizedYCoordinate); maxY = MAX(maxY, normalizedYCoordinate); minX = MIN(minX, normalizedXCoordinate); maxX = MAX(maxX, normalizedXCoordinate); // NSLog(@"Parallel line coordinates: (%f, %f) - (%f, %f) - (%f, %f)", -1.0, -normalizedYCoordinate, 0.0, normalizedXCoordinate, 1.0, normalizedYCoordinate); // T space coordinates, (-d, -y) to (0, x) lineCoordinates[lineStorageIndex++] = -1.0; lineCoordinates[lineStorageIndex++] = -normalizedYCoordinate; lineCoordinates[lineStorageIndex++] = 0.0; lineCoordinates[lineStorageIndex++] = normalizedXCoordinate; // S space coordinates, (0, x) to (d, y) lineCoordinates[lineStorageIndex++] = 0.0; lineCoordinates[lineStorageIndex++] = normalizedXCoordinate; lineCoordinates[lineStorageIndex++] = 1.0; lineCoordinates[lineStorageIndex++] = normalizedYCoordinate; linePairsToRender++; linePairsToRender = MIN(linePairsToRender, maxLinePairsToRender); lineStorageIndex = MIN(lineStorageIndex, maxLineStorageIndex); } currentByte +=8; } // NSLog(@"Line pairs to render: %d out of max: %d", linePairsToRender, maxLinePairsToRender); // CFAbsoluteTime currentFrameTime = (CFAbsoluteTimeGetCurrent() - startTime); // NSLog(@"Line generation processing time : %f ms", 1000.0 * currentFrameTime); outputFramebuffer = [[GPUImageContext sharedFramebufferCache] fetchFramebufferForSize:[self sizeOfFBO] textureOptions:self.outputTextureOptions onlyTexture:NO]; [outputFramebuffer activateFramebuffer]; if (usingNextFrameForImageCapture) { [outputFramebuffer lock]; } [GPUImageContext setActiveShaderProgram:filterProgram]; [self setUniformsForProgramAtIndex:0]; glClearColor(0.0, 0.0, 0.0, 1.0); glClear(GL_COLOR_BUFFER_BIT); if (![GPUImageContext deviceSupportsFramebufferReads]) { glBlendEquation(GL_FUNC_ADD); glBlendFunc(GL_ONE, GL_ONE); glEnable(GL_BLEND); } else { } glLineWidth(1); glVertexAttribPointer(filterPositionAttribute, 2, GL_FLOAT, 0, 0, lineCoordinates); glDrawArrays(GL_LINES, 0, (linePairsToRender * 4)); if (![GPUImageContext deviceSupportsFramebufferReads]) { glDisable(GL_BLEND); } [firstInputFramebuffer unlock]; if (usingNextFrameForImageCapture) { dispatch_semaphore_signal(imageCaptureSemaphore); } } @end ================================================ FILE: framework/Source/GPUImagePerlinNoiseFilter.h ================================================ #import "GPUImageFilter.h" @interface GPUImagePerlinNoiseFilter : GPUImageFilter { GLint scaleUniform, colorStartUniform, colorFinishUniform; } @property (readwrite, nonatomic) GPUVector4 colorStart; @property (readwrite, nonatomic) GPUVector4 colorFinish; @property (readwrite, nonatomic) float scale; @end ================================================ FILE: framework/Source/GPUImagePerlinNoiseFilter.m ================================================ #import "GPUImagePerlinNoiseFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImagePerlinNoiseFragmentShaderString = SHADER_STRING ( precision highp float; varying highp vec2 textureCoordinate; uniform float scale; uniform vec4 colorStart; uniform vec4 colorFinish; // // Description : Array and textureless GLSL 2D/3D/4D simplex // noise functions. // Author : Ian McEwan, Ashima Arts. // Maintainer : ijm // Lastmod : 20110822 (ijm) // License : Copyright (C) 2011 Ashima Arts. All rights reserved. // Distributed under the MIT License. See LICENSE file. // https://github.com/ashima/webgl-noise // vec4 mod289(vec4 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; } vec4 permute(vec4 x) { return mod289(((x*34.0)+1.0)*x); } vec4 taylorInvSqrt(vec4 r) { return 1.79284291400159 - 0.85373472095314 * r; } vec2 fade(vec2 t) { return t*t*t*(t*(t*6.0-15.0)+10.0); } // Classic Perlin noise float cnoise(vec2 P) { vec4 Pi = floor(P.xyxy) + vec4(0.0, 0.0, 1.0, 1.0); vec4 Pf = fract(P.xyxy) - vec4(0.0, 0.0, 1.0, 1.0); Pi = mod289(Pi); // To avoid truncation effects in permutation vec4 ix = Pi.xzxz; vec4 iy = Pi.yyww; vec4 fx = Pf.xzxz; vec4 fy = Pf.yyww; vec4 i = permute(permute(ix) + iy); vec4 gx = fract(i * (1.0 / 41.0)) * 2.0 - 1.0 ; vec4 gy = abs(gx) - 0.5 ; vec4 tx = floor(gx + 0.5); gx = gx - tx; vec2 g00 = vec2(gx.x,gy.x); vec2 g10 = vec2(gx.y,gy.y); vec2 g01 = vec2(gx.z,gy.z); vec2 g11 = vec2(gx.w,gy.w); vec4 norm = taylorInvSqrt(vec4(dot(g00, g00), dot(g01, g01), dot(g10, g10), dot(g11, g11))); g00 *= norm.x; g01 *= norm.y; g10 *= norm.z; g11 *= norm.w; float n00 = dot(g00, vec2(fx.x, fy.x)); float n10 = dot(g10, vec2(fx.y, fy.y)); float n01 = dot(g01, vec2(fx.z, fy.z)); float n11 = dot(g11, vec2(fx.w, fy.w)); vec2 fade_xy = fade(Pf.xy); vec2 n_x = mix(vec2(n00, n01), vec2(n10, n11), fade_xy.x); float n_xy = mix(n_x.x, n_x.y, fade_xy.y); return 2.3 * n_xy; } void main() { float n1 = (cnoise(textureCoordinate * scale) + 1.0) / 2.0; vec4 colorDiff = colorFinish - colorStart; vec4 color = colorStart + colorDiff * n1; gl_FragColor = color; } ); #else NSString *const kGPUImagePerlinNoiseFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform float scale; uniform vec4 colorStart; uniform vec4 colorFinish; // // Description : Array and textureless GLSL 2D/3D/4D simplex // noise functions. // Author : Ian McEwan, Ashima Arts. // Maintainer : ijm // Lastmod : 20110822 (ijm) // License : Copyright (C) 2011 Ashima Arts. All rights reserved. // Distributed under the MIT License. See LICENSE file. // https://github.com/ashima/webgl-noise // vec4 mod289(vec4 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; } vec4 permute(vec4 x) { return mod289(((x*34.0)+1.0)*x); } vec4 taylorInvSqrt(vec4 r) { return 1.79284291400159 - 0.85373472095314 * r; } vec2 fade(vec2 t) { return t*t*t*(t*(t*6.0-15.0)+10.0); } // Classic Perlin noise float cnoise(vec2 P) { vec4 Pi = floor(P.xyxy) + vec4(0.0, 0.0, 1.0, 1.0); vec4 Pf = fract(P.xyxy) - vec4(0.0, 0.0, 1.0, 1.0); Pi = mod289(Pi); // To avoid truncation effects in permutation vec4 ix = Pi.xzxz; vec4 iy = Pi.yyww; vec4 fx = Pf.xzxz; vec4 fy = Pf.yyww; vec4 i = permute(permute(ix) + iy); vec4 gx = fract(i * (1.0 / 41.0)) * 2.0 - 1.0 ; vec4 gy = abs(gx) - 0.5 ; vec4 tx = floor(gx + 0.5); gx = gx - tx; vec2 g00 = vec2(gx.x,gy.x); vec2 g10 = vec2(gx.y,gy.y); vec2 g01 = vec2(gx.z,gy.z); vec2 g11 = vec2(gx.w,gy.w); vec4 norm = taylorInvSqrt(vec4(dot(g00, g00), dot(g01, g01), dot(g10, g10), dot(g11, g11))); g00 *= norm.x; g01 *= norm.y; g10 *= norm.z; g11 *= norm.w; float n00 = dot(g00, vec2(fx.x, fy.x)); float n10 = dot(g10, vec2(fx.y, fy.y)); float n01 = dot(g01, vec2(fx.z, fy.z)); float n11 = dot(g11, vec2(fx.w, fy.w)); vec2 fade_xy = fade(Pf.xy); vec2 n_x = mix(vec2(n00, n01), vec2(n10, n11), fade_xy.x); float n_xy = mix(n_x.x, n_x.y, fade_xy.y); return 2.3 * n_xy; } void main() { float n1 = (cnoise(textureCoordinate * scale) + 1.0) / 2.0; vec4 colorDiff = colorFinish - colorStart; vec4 color = colorStart + colorDiff * n1; gl_FragColor = color; } ); #endif @implementation GPUImagePerlinNoiseFilter @synthesize scale = _scale, colorStart = _colorStart, colorFinish = _colorFinish; #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImagePerlinNoiseFragmentShaderString])) { return nil; } scaleUniform = [filterProgram uniformIndex:@"scale"]; colorStartUniform = [filterProgram uniformIndex:@"colorStart"]; colorFinishUniform = [filterProgram uniformIndex:@"colorFinish"]; [self setScale:8.0]; [self setColorStart:(GPUVector4){0.0, 0.0, 0.0, 1.0}]; [self setColorFinish:(GPUVector4){1.0, 1.0, 1.0, 1.0}]; return self; } #pragma mark - #pragma mark Accessors - (void)setScale:(float)scale { _scale = scale; [self setFloat:_scale forUniform:scaleUniform program:filterProgram]; } - (void)setColorStart:(GPUVector4)colorStart { _colorStart = colorStart; [self setVec4:_colorStart forUniform:colorStartUniform program:filterProgram]; } - (void)setColorFinish:(GPUVector4)colorFinish { _colorFinish = colorFinish; [self setVec4:_colorFinish forUniform:colorFinishUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImagePinchDistortionFilter.h ================================================ #import "GPUImageFilter.h" /** Creates a pinch distortion of the image */ @interface GPUImagePinchDistortionFilter : GPUImageFilter { GLint aspectRatioUniform, radiusUniform, centerUniform, scaleUniform; } /** The center about which to apply the distortion, with a default of (0.5, 0.5) */ @property(readwrite, nonatomic) CGPoint center; /** The radius of the distortion, ranging from 0.0 to 2.0, with a default of 1.0 */ @property(readwrite, nonatomic) CGFloat radius; /** The amount of distortion to apply, from -2.0 to 2.0, with a default of 0.5 */ @property(readwrite, nonatomic) CGFloat scale; @end ================================================ FILE: framework/Source/GPUImagePinchDistortionFilter.m ================================================ #import "GPUImagePinchDistortionFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImagePinchDistortionFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform highp float aspectRatio; uniform highp vec2 center; uniform highp float radius; uniform highp float scale; void main() { highp vec2 textureCoordinateToUse = vec2(textureCoordinate.x, (textureCoordinate.y * aspectRatio + 0.5 - 0.5 * aspectRatio)); highp float dist = distance(center, textureCoordinateToUse); textureCoordinateToUse = textureCoordinate; if (dist < radius) { textureCoordinateToUse -= center; highp float percent = 1.0 + ((0.5 - dist) / 0.5) * scale; textureCoordinateToUse = textureCoordinateToUse * percent; textureCoordinateToUse += center; gl_FragColor = texture2D(inputImageTexture, textureCoordinateToUse ); } else { gl_FragColor = texture2D(inputImageTexture, textureCoordinate ); } } ); #else NSString *const kGPUImagePinchDistortionFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform float aspectRatio; uniform vec2 center; uniform float radius; uniform float scale; void main() { vec2 textureCoordinateToUse = vec2(textureCoordinate.x, (textureCoordinate.y * aspectRatio + 0.5 - 0.5 * aspectRatio)); float dist = distance(center, textureCoordinateToUse); textureCoordinateToUse = textureCoordinate; if (dist < radius) { textureCoordinateToUse -= center; float percent = 1.0 + ((0.5 - dist) / 0.5) * scale; textureCoordinateToUse = textureCoordinateToUse * percent; textureCoordinateToUse += center; gl_FragColor = texture2D(inputImageTexture, textureCoordinateToUse ); } else { gl_FragColor = texture2D(inputImageTexture, textureCoordinate ); } } ); #endif @interface GPUImagePinchDistortionFilter () - (void)adjustAspectRatio; @property (readwrite, nonatomic) CGFloat aspectRatio; @end @implementation GPUImagePinchDistortionFilter @synthesize aspectRatio = _aspectRatio; @synthesize center = _center; @synthesize radius = _radius; @synthesize scale = _scale; #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImagePinchDistortionFragmentShaderString])) { return nil; } aspectRatioUniform = [filterProgram uniformIndex:@"aspectRatio"]; radiusUniform = [filterProgram uniformIndex:@"radius"]; scaleUniform = [filterProgram uniformIndex:@"scale"]; centerUniform = [filterProgram uniformIndex:@"center"]; self.radius = 1.0; self.scale = 0.5; self.center = CGPointMake(0.5, 0.5); return self; } #pragma mark - #pragma mark Accessors - (void)adjustAspectRatio; { if (GPUImageRotationSwapsWidthAndHeight(inputRotation)) { [self setAspectRatio:(inputTextureSize.width / inputTextureSize.height)]; } else { [self setAspectRatio:(inputTextureSize.height / inputTextureSize.width)]; } } - (void)forceProcessingAtSize:(CGSize)frameSize; { [super forceProcessingAtSize:frameSize]; [self adjustAspectRatio]; } - (void)setInputSize:(CGSize)newSize atIndex:(NSInteger)textureIndex; { CGSize oldInputSize = inputTextureSize; [super setInputSize:newSize atIndex:textureIndex]; if ( (!CGSizeEqualToSize(oldInputSize, inputTextureSize)) && (!CGSizeEqualToSize(newSize, CGSizeZero)) ) { [self adjustAspectRatio]; } } - (void)setInputRotation:(GPUImageRotationMode)newInputRotation atIndex:(NSInteger)textureIndex; { [super setInputRotation:newInputRotation atIndex:textureIndex]; [self setCenter:self.center]; [self adjustAspectRatio]; } - (void)setAspectRatio:(CGFloat)newValue; { _aspectRatio = newValue; [self setFloat:_aspectRatio forUniform:aspectRatioUniform program:filterProgram]; } - (void)setRadius:(CGFloat)newValue; { _radius = newValue; [self setFloat:_radius forUniform:radiusUniform program:filterProgram]; } - (void)setScale:(CGFloat)newValue; { _scale = newValue; [self setFloat:_scale forUniform:scaleUniform program:filterProgram]; } - (void)setCenter:(CGPoint)newValue; { _center = newValue; CGPoint rotatedPoint = [self rotatedPoint:_center forRotation:inputRotation]; [self setPoint:rotatedPoint forUniform:centerUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImagePixellateFilter.h ================================================ #import "GPUImageFilter.h" @interface GPUImagePixellateFilter : GPUImageFilter { GLint fractionalWidthOfAPixelUniform, aspectRatioUniform; } // The fractional width of the image to use as a size for the pixels in the resulting image. Values below one pixel width in the source image are ignored. @property(readwrite, nonatomic) CGFloat fractionalWidthOfAPixel; @end ================================================ FILE: framework/Source/GPUImagePixellateFilter.m ================================================ #import "GPUImagePixellateFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImagePixellationFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform highp float fractionalWidthOfPixel; uniform highp float aspectRatio; void main() { highp vec2 sampleDivisor = vec2(fractionalWidthOfPixel, fractionalWidthOfPixel / aspectRatio); highp vec2 samplePos = textureCoordinate - mod(textureCoordinate, sampleDivisor) + 0.5 * sampleDivisor; gl_FragColor = texture2D(inputImageTexture, samplePos ); } ); #else NSString *const kGPUImagePixellationFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform float fractionalWidthOfPixel; uniform float aspectRatio; void main() { vec2 sampleDivisor = vec2(fractionalWidthOfPixel, fractionalWidthOfPixel / aspectRatio); vec2 samplePos = textureCoordinate - mod(textureCoordinate, sampleDivisor) + 0.5 * sampleDivisor; gl_FragColor = texture2D(inputImageTexture, samplePos ); } ); #endif @interface GPUImagePixellateFilter () @property (readwrite, nonatomic) CGFloat aspectRatio; - (void)adjustAspectRatio; @end @implementation GPUImagePixellateFilter @synthesize fractionalWidthOfAPixel = _fractionalWidthOfAPixel; @synthesize aspectRatio = _aspectRatio; #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [self initWithFragmentShaderFromString:kGPUImagePixellationFragmentShaderString])) { return nil; } return self; } - (id)initWithFragmentShaderFromString:(NSString *)fragmentShaderString; { if (!(self = [super initWithFragmentShaderFromString:fragmentShaderString])) { return nil; } fractionalWidthOfAPixelUniform = [filterProgram uniformIndex:@"fractionalWidthOfPixel"]; aspectRatioUniform = [filterProgram uniformIndex:@"aspectRatio"]; self.fractionalWidthOfAPixel = 0.05; return self; } - (void)adjustAspectRatio; { if (GPUImageRotationSwapsWidthAndHeight(inputRotation)) { [self setAspectRatio:(inputTextureSize.width / inputTextureSize.height)]; } else { [self setAspectRatio:(inputTextureSize.height / inputTextureSize.width)]; } } - (void)setInputRotation:(GPUImageRotationMode)newInputRotation atIndex:(NSInteger)textureIndex; { [super setInputRotation:newInputRotation atIndex:textureIndex]; [self adjustAspectRatio]; } - (void)forceProcessingAtSize:(CGSize)frameSize; { [super forceProcessingAtSize:frameSize]; [self adjustAspectRatio]; } - (void)setInputSize:(CGSize)newSize atIndex:(NSInteger)textureIndex; { CGSize oldInputSize = inputTextureSize; [super setInputSize:newSize atIndex:textureIndex]; if ( (!CGSizeEqualToSize(oldInputSize, inputTextureSize)) && (!CGSizeEqualToSize(newSize, CGSizeZero)) ) { [self adjustAspectRatio]; } } #pragma mark - #pragma mark Accessors - (void)setFractionalWidthOfAPixel:(CGFloat)newValue; { CGFloat singlePixelSpacing; if (inputTextureSize.width != 0.0) { singlePixelSpacing = 1.0 / inputTextureSize.width; } else { singlePixelSpacing = 1.0 / 2048.0; } if (newValue < singlePixelSpacing) { _fractionalWidthOfAPixel = singlePixelSpacing; } else { _fractionalWidthOfAPixel = newValue; } [self setFloat:_fractionalWidthOfAPixel forUniform:fractionalWidthOfAPixelUniform program:filterProgram]; } - (void)setAspectRatio:(CGFloat)newValue; { _aspectRatio = newValue; [self setFloat:_aspectRatio forUniform:aspectRatioUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImagePixellatePositionFilter.h ================================================ #import "GPUImageFilter.h" @interface GPUImagePixellatePositionFilter : GPUImageFilter { GLint fractionalWidthOfAPixelUniform, aspectRatioUniform, centerUniform, radiusUniform; } // The fractional width of the image to use as a size for the pixels in the resulting image. Values below one pixel width in the source image are ignored. @property(readwrite, nonatomic) CGFloat fractionalWidthOfAPixel; // the center point to start pixelation in texture coordinates, default 0.5, 0.5 @property(readwrite, nonatomic) CGPoint center; // the radius (0.0 - 1.0) in which to pixelate, default 1.0 @property(readwrite, nonatomic) CGFloat radius; @end ================================================ FILE: framework/Source/GPUImagePixellatePositionFilter.m ================================================ #import "GPUImagePixellatePositionFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImagePixellationPositionFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform highp float fractionalWidthOfPixel; uniform highp float aspectRatio; uniform lowp vec2 pixelateCenter; uniform highp float pixelateRadius; void main() { highp vec2 textureCoordinateToUse = vec2(textureCoordinate.x, (textureCoordinate.y * aspectRatio + 0.5 - 0.5 * aspectRatio)); highp float dist = distance(pixelateCenter, textureCoordinateToUse); if (dist < pixelateRadius) { highp vec2 sampleDivisor = vec2(fractionalWidthOfPixel, fractionalWidthOfPixel / aspectRatio); highp vec2 samplePos = textureCoordinate - mod(textureCoordinate, sampleDivisor) + 0.5 * sampleDivisor; gl_FragColor = texture2D(inputImageTexture, samplePos ); } else { gl_FragColor = texture2D(inputImageTexture, textureCoordinate ); } } ); #else NSString *const kGPUImagePixellationPositionFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform float fractionalWidthOfPixel; uniform float aspectRatio; uniform vec2 pixelateCenter; uniform float pixelateRadius; void main() { vec2 textureCoordinateToUse = vec2(textureCoordinate.x, (textureCoordinate.y * aspectRatio + 0.5 - 0.5 * aspectRatio)); float dist = distance(pixelateCenter, textureCoordinateToUse); if (dist < pixelateRadius) { vec2 sampleDivisor = vec2(fractionalWidthOfPixel, fractionalWidthOfPixel / aspectRatio); vec2 samplePos = textureCoordinate - mod(textureCoordinate, sampleDivisor) + 0.5 * sampleDivisor; gl_FragColor = texture2D(inputImageTexture, samplePos ); } else { gl_FragColor = texture2D(inputImageTexture, textureCoordinate ); } } ); #endif @interface GPUImagePixellatePositionFilter () - (void)adjustAspectRatio; @property (readwrite, nonatomic) CGFloat aspectRatio; @end @implementation GPUImagePixellatePositionFilter @synthesize fractionalWidthOfAPixel = _fractionalWidthOfAPixel; @synthesize aspectRatio = _aspectRatio; @synthesize center = _center; @synthesize radius = _radius; #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [self initWithFragmentShaderFromString:kGPUImagePixellationPositionFragmentShaderString])) { return nil; } return self; } - (id)initWithFragmentShaderFromString:(NSString *)fragmentShaderString; { if (!(self = [super initWithFragmentShaderFromString:fragmentShaderString])) { return nil; } fractionalWidthOfAPixelUniform = [filterProgram uniformIndex:@"fractionalWidthOfPixel"]; aspectRatioUniform = [filterProgram uniformIndex:@"aspectRatio"]; centerUniform = [filterProgram uniformIndex:@"pixelateCenter"]; radiusUniform = [filterProgram uniformIndex:@"pixelateRadius"]; self.fractionalWidthOfAPixel = 0.05; self.center = CGPointMake(0.5f, 0.5f); self.radius = 0.25f; return self; } - (void)setInputSize:(CGSize)newSize atIndex:(NSInteger)textureIndex; { CGSize oldInputSize = inputTextureSize; [super setInputSize:newSize atIndex:textureIndex]; if ( (!CGSizeEqualToSize(oldInputSize, inputTextureSize)) && (!CGSizeEqualToSize(newSize, CGSizeZero)) ) { [self adjustAspectRatio]; } } #pragma mark - #pragma mark Accessors - (void)setInputRotation:(GPUImageRotationMode)newInputRotation atIndex:(NSInteger)textureIndex; { [super setInputRotation:newInputRotation atIndex:textureIndex]; [self setCenter:self.center]; [self adjustAspectRatio]; } - (void)adjustAspectRatio; { if (GPUImageRotationSwapsWidthAndHeight(inputRotation)) { [self setAspectRatio:(inputTextureSize.width / inputTextureSize.height)]; } else { [self setAspectRatio:(inputTextureSize.height / inputTextureSize.width)]; } } - (void)forceProcessingAtSize:(CGSize)frameSize; { [super forceProcessingAtSize:frameSize]; [self adjustAspectRatio]; } - (void)setFractionalWidthOfAPixel:(CGFloat)newValue; { CGFloat singlePixelSpacing; if (inputTextureSize.width != 0.0) { singlePixelSpacing = 1.0 / inputTextureSize.width; } else { singlePixelSpacing = 1.0 / 2048.0; } if (newValue < singlePixelSpacing) { _fractionalWidthOfAPixel = singlePixelSpacing; } else { _fractionalWidthOfAPixel = newValue; } [self setFloat:_fractionalWidthOfAPixel forUniform:fractionalWidthOfAPixelUniform program:filterProgram]; } - (void)setAspectRatio:(CGFloat)newValue; { _aspectRatio = newValue; [self setFloat:_aspectRatio forUniform:aspectRatioUniform program:filterProgram]; } - (void)setCenter:(CGPoint)center { _center = center; CGPoint rotatedPoint = [self rotatedPoint:center forRotation:inputRotation]; [self setPoint:rotatedPoint forUniform:centerUniform program:filterProgram]; } - (void)setRadius:(CGFloat)radius { _radius = radius; [self setFloat:_radius forUniform:radiusUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImagePoissonBlendFilter.h ================================================ #import "GPUImageTwoInputCrossTextureSamplingFilter.h" #import "GPUImageFilterGroup.h" @interface GPUImagePoissonBlendFilter : GPUImageTwoInputCrossTextureSamplingFilter { GLint mixUniform; GPUImageFramebuffer *secondOutputFramebuffer; } // Mix ranges from 0.0 (only image 1) to 1.0 (only image 2 gradients), with 1.0 as the normal level @property(readwrite, nonatomic) CGFloat mix; // The number of times to propagate the gradients. // Crank this up to 100 or even 1000 if you want to get anywhere near convergence. Yes, this will be slow. @property(readwrite, nonatomic) NSUInteger numIterations; @end ================================================ FILE: framework/Source/GPUImagePoissonBlendFilter.m ================================================ #import "GPUImagePoissonBlendFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImagePoissonBlendFragmentShaderString = SHADER_STRING ( precision mediump float; varying vec2 textureCoordinate; varying vec2 leftTextureCoordinate; varying vec2 rightTextureCoordinate; varying vec2 topTextureCoordinate; varying vec2 bottomTextureCoordinate; varying vec2 textureCoordinate2; varying vec2 leftTextureCoordinate2; varying vec2 rightTextureCoordinate2; varying vec2 topTextureCoordinate2; varying vec2 bottomTextureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; uniform lowp float mixturePercent; void main() { vec4 centerColor = texture2D(inputImageTexture, textureCoordinate); vec3 bottomColor = texture2D(inputImageTexture, bottomTextureCoordinate).rgb; vec3 leftColor = texture2D(inputImageTexture, leftTextureCoordinate).rgb; vec3 rightColor = texture2D(inputImageTexture, rightTextureCoordinate).rgb; vec3 topColor = texture2D(inputImageTexture, topTextureCoordinate).rgb; vec4 centerColor2 = texture2D(inputImageTexture2, textureCoordinate2); vec3 bottomColor2 = texture2D(inputImageTexture2, bottomTextureCoordinate2).rgb; vec3 leftColor2 = texture2D(inputImageTexture2, leftTextureCoordinate2).rgb; vec3 rightColor2 = texture2D(inputImageTexture2, rightTextureCoordinate2).rgb; vec3 topColor2 = texture2D(inputImageTexture2, topTextureCoordinate2).rgb; vec3 meanColor = (bottomColor + leftColor + rightColor + topColor) / 4.0; vec3 diffColor = centerColor.rgb - meanColor; vec3 meanColor2 = (bottomColor2 + leftColor2 + rightColor2 + topColor2) / 4.0; vec3 diffColor2 = centerColor2.rgb - meanColor2; vec3 gradColor = (meanColor + diffColor2); gl_FragColor = vec4(mix(centerColor.rgb, gradColor, centerColor2.a * mixturePercent), centerColor.a); } ); #else NSString *const kGPUImagePoissonBlendFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; varying vec2 leftTextureCoordinate; varying vec2 rightTextureCoordinate; varying vec2 topTextureCoordinate; varying vec2 bottomTextureCoordinate; varying vec2 textureCoordinate2; varying vec2 leftTextureCoordinate2; varying vec2 rightTextureCoordinate2; varying vec2 topTextureCoordinate2; varying vec2 bottomTextureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; uniform float mixturePercent; void main() { vec4 centerColor = texture2D(inputImageTexture, textureCoordinate); vec3 bottomColor = texture2D(inputImageTexture, bottomTextureCoordinate).rgb; vec3 leftColor = texture2D(inputImageTexture, leftTextureCoordinate).rgb; vec3 rightColor = texture2D(inputImageTexture, rightTextureCoordinate).rgb; vec3 topColor = texture2D(inputImageTexture, topTextureCoordinate).rgb; vec4 centerColor2 = texture2D(inputImageTexture2, textureCoordinate2); vec3 bottomColor2 = texture2D(inputImageTexture2, bottomTextureCoordinate2).rgb; vec3 leftColor2 = texture2D(inputImageTexture2, leftTextureCoordinate2).rgb; vec3 rightColor2 = texture2D(inputImageTexture2, rightTextureCoordinate2).rgb; vec3 topColor2 = texture2D(inputImageTexture2, topTextureCoordinate2).rgb; vec3 meanColor = (bottomColor + leftColor + rightColor + topColor) / 4.0; vec3 diffColor = centerColor.rgb - meanColor; vec3 meanColor2 = (bottomColor2 + leftColor2 + rightColor2 + topColor2) / 4.0; vec3 diffColor2 = centerColor2.rgb - meanColor2; vec3 gradColor = (meanColor + diffColor2); gl_FragColor = vec4(mix(centerColor.rgb, gradColor, centerColor2.a * mixturePercent), centerColor.a); } ); #endif @implementation GPUImagePoissonBlendFilter @synthesize mix = _mix; @synthesize numIterations = _numIterations; - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImagePoissonBlendFragmentShaderString])) { return nil; } mixUniform = [filterProgram uniformIndex:@"mixturePercent"]; self.mix = 0.5; self.numIterations = 10; return self; } - (void)setMix:(CGFloat)newValue; { _mix = newValue; [self setFloat:_mix forUniform:mixUniform program:filterProgram]; } //- (void)setOutputFBO; //{ // if (self.numIterations % 2 == 1) { // [self setSecondFilterFBO]; // } else { // [self setFilterFBO]; // } //} - (void)renderToTextureWithVertices:(const GLfloat *)vertices textureCoordinates:(const GLfloat *)textureCoordinates; { // Run the first stage of the two-pass filter [GPUImageContext setActiveShaderProgram:filterProgram]; [super renderToTextureWithVertices:vertices textureCoordinates:textureCoordinates]; for (int pass = 1; pass < self.numIterations; pass++) { if (pass % 2 == 0) { [GPUImageContext setActiveShaderProgram:filterProgram]; // TODO: This will over-unlock the incoming framebuffer [super renderToTextureWithVertices:vertices textureCoordinates:[[self class] textureCoordinatesForRotation:kGPUImageNoRotation]]; } else { // Run the second stage of the two-pass filter secondOutputFramebuffer = [[GPUImageContext sharedFramebufferCache] fetchFramebufferForSize:[self sizeOfFBO] textureOptions:self.outputTextureOptions onlyTexture:NO]; [secondOutputFramebuffer activateFramebuffer]; [GPUImageContext setActiveShaderProgram:filterProgram]; glClearColor(backgroundColorRed, backgroundColorGreen, backgroundColorBlue, backgroundColorAlpha); glClear(GL_COLOR_BUFFER_BIT); glActiveTexture(GL_TEXTURE2); glBindTexture(GL_TEXTURE_2D, [outputFramebuffer texture]); glUniform1i(filterInputTextureUniform, 2); glActiveTexture(GL_TEXTURE3); glBindTexture(GL_TEXTURE_2D, [secondInputFramebuffer texture]); glUniform1i(filterInputTextureUniform2, 3); glVertexAttribPointer(filterPositionAttribute, 2, GL_FLOAT, 0, 0, vertices); glVertexAttribPointer(filterTextureCoordinateAttribute, 2, GL_FLOAT, 0, 0, [[self class] textureCoordinatesForRotation:kGPUImageNoRotation]); glVertexAttribPointer(filterSecondTextureCoordinateAttribute, 2, GL_FLOAT, 0, 0, [[self class] textureCoordinatesForRotation:inputRotation2]); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); } } } @end ================================================ FILE: framework/Source/GPUImagePolarPixellateFilter.h ================================================ #import "GPUImageFilter.h" @interface GPUImagePolarPixellateFilter : GPUImageFilter { GLint centerUniform, pixelSizeUniform; } // The center about which to apply the distortion, with a default of (0.5, 0.5) @property(readwrite, nonatomic) CGPoint center; // The amount of distortion to apply, from (-2.0, -2.0) to (2.0, 2.0), with a default of (0.05, 0.05) @property(readwrite, nonatomic) CGSize pixelSize; @end ================================================ FILE: framework/Source/GPUImagePolarPixellateFilter.m ================================================ #import "GPUImagePolarPixellateFilter.h" // @fattjake based on vid by toneburst #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImagePolarPixellateFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform highp vec2 center; uniform highp vec2 pixelSize; void main() { highp vec2 normCoord = 2.0 * textureCoordinate - 1.0; highp vec2 normCenter = 2.0 * center - 1.0; normCoord -= normCenter; highp float r = length(normCoord); // to polar coords highp float phi = atan(normCoord.y, normCoord.x); // to polar coords r = r - mod(r, pixelSize.x) + 0.03; phi = phi - mod(phi, pixelSize.y); normCoord.x = r * cos(phi); normCoord.y = r * sin(phi); normCoord += normCenter; mediump vec2 textureCoordinateToUse = normCoord / 2.0 + 0.5; gl_FragColor = texture2D(inputImageTexture, textureCoordinateToUse ); } ); #else NSString *const kGPUImagePolarPixellateFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform vec2 center; uniform vec2 pixelSize; void main() { vec2 normCoord = 2.0 * textureCoordinate - 1.0; vec2 normCenter = 2.0 * center - 1.0; normCoord -= normCenter; float r = length(normCoord); // to polar coords float phi = atan(normCoord.y, normCoord.x); // to polar coords r = r - mod(r, pixelSize.x) + 0.03; phi = phi - mod(phi, pixelSize.y); normCoord.x = r * cos(phi); normCoord.y = r * sin(phi); normCoord += normCenter; vec2 textureCoordinateToUse = normCoord / 2.0 + 0.5; gl_FragColor = texture2D(inputImageTexture, textureCoordinateToUse ); } ); #endif @implementation GPUImagePolarPixellateFilter @synthesize center = _center; @synthesize pixelSize = _pixelSize; #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImagePolarPixellateFragmentShaderString])) { return nil; } pixelSizeUniform = [filterProgram uniformIndex:@"pixelSize"]; centerUniform = [filterProgram uniformIndex:@"center"]; self.pixelSize = CGSizeMake(0.05, 0.05); self.center = CGPointMake(0.5, 0.5); return self; } #pragma mark - #pragma mark Accessors - (void)setInputRotation:(GPUImageRotationMode)newInputRotation atIndex:(NSInteger)textureIndex; { [super setInputRotation:newInputRotation atIndex:textureIndex]; [self setCenter:self.center]; } - (void)setPixelSize:(CGSize)pixelSize { _pixelSize = pixelSize; [self setSize:_pixelSize forUniform:pixelSizeUniform program:filterProgram]; } - (void)setCenter:(CGPoint)newValue; { _center = newValue; CGPoint rotatedPoint = [self rotatedPoint:_center forRotation:inputRotation]; [self setPoint:rotatedPoint forUniform:centerUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImagePolkaDotFilter.h ================================================ #import "GPUImagePixellateFilter.h" @interface GPUImagePolkaDotFilter : GPUImagePixellateFilter { GLint dotScalingUniform; } @property(readwrite, nonatomic) CGFloat dotScaling; @end ================================================ FILE: framework/Source/GPUImagePolkaDotFilter.m ================================================ #import "GPUImagePolkaDotFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImagePolkaDotFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform highp float fractionalWidthOfPixel; uniform highp float aspectRatio; uniform highp float dotScaling; void main() { highp vec2 sampleDivisor = vec2(fractionalWidthOfPixel, fractionalWidthOfPixel / aspectRatio); highp vec2 samplePos = textureCoordinate - mod(textureCoordinate, sampleDivisor) + 0.5 * sampleDivisor; highp vec2 textureCoordinateToUse = vec2(textureCoordinate.x, (textureCoordinate.y * aspectRatio + 0.5 - 0.5 * aspectRatio)); highp vec2 adjustedSamplePos = vec2(samplePos.x, (samplePos.y * aspectRatio + 0.5 - 0.5 * aspectRatio)); highp float distanceFromSamplePoint = distance(adjustedSamplePos, textureCoordinateToUse); lowp float checkForPresenceWithinDot = step(distanceFromSamplePoint, (fractionalWidthOfPixel * 0.5) * dotScaling); lowp vec4 inputColor = texture2D(inputImageTexture, samplePos); gl_FragColor = vec4(inputColor.rgb * checkForPresenceWithinDot, inputColor.a); } ); #else NSString *const kGPUImagePolkaDotFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform float fractionalWidthOfPixel; uniform float aspectRatio; uniform float dotScaling; void main() { vec2 sampleDivisor = vec2(fractionalWidthOfPixel, fractionalWidthOfPixel / aspectRatio); vec2 samplePos = textureCoordinate - mod(textureCoordinate, sampleDivisor) + 0.5 * sampleDivisor; vec2 textureCoordinateToUse = vec2(textureCoordinate.x, (textureCoordinate.y * aspectRatio + 0.5 - 0.5 * aspectRatio)); vec2 adjustedSamplePos = vec2(samplePos.x, (samplePos.y * aspectRatio + 0.5 - 0.5 * aspectRatio)); float distanceFromSamplePoint = distance(adjustedSamplePos, textureCoordinateToUse); float checkForPresenceWithinDot = step(distanceFromSamplePoint, (fractionalWidthOfPixel * 0.5) * dotScaling); vec4 inputColor = texture2D(inputImageTexture, samplePos); gl_FragColor = vec4(inputColor.rgb * checkForPresenceWithinDot, inputColor.a); } ); #endif @implementation GPUImagePolkaDotFilter @synthesize dotScaling = _dotScaling; - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImagePolkaDotFragmentShaderString])) { return nil; } dotScalingUniform = [filterProgram uniformIndex:@"dotScaling"]; self.dotScaling = 0.90; return self; } #pragma mark - #pragma mark Accessors - (void)setDotScaling:(CGFloat)newValue; { _dotScaling = newValue; [self setFloat:_dotScaling forUniform:dotScalingUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImagePosterizeFilter.h ================================================ #import "GPUImageFilter.h" /** This reduces the color dynamic range into the number of steps specified, leading to a cartoon-like simple shading of the image. */ @interface GPUImagePosterizeFilter : GPUImageFilter { GLint colorLevelsUniform; } /** The number of color levels to reduce the image space to. This ranges from 1 to 256, with a default of 10. */ @property(readwrite, nonatomic) NSUInteger colorLevels; @end ================================================ FILE: framework/Source/GPUImagePosterizeFilter.m ================================================ #import "GPUImagePosterizeFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImagePosterizeFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform highp float colorLevels; void main() { highp vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); gl_FragColor = floor((textureColor * colorLevels) + vec4(0.5)) / colorLevels; } ); #else NSString *const kGPUImagePosterizeFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform float colorLevels; void main() { vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); gl_FragColor = floor((textureColor * colorLevels) + vec4(0.5)) / colorLevels; } ); #endif @implementation GPUImagePosterizeFilter @synthesize colorLevels = _colorLevels; #pragma mark - #pragma mark Initialization - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImagePosterizeFragmentShaderString])) { return nil; } colorLevelsUniform = [filterProgram uniformIndex:@"colorLevels"]; self.colorLevels = 10; return self; } #pragma mark - #pragma mark Accessors - (void)setColorLevels:(NSUInteger)newValue; { _colorLevels = newValue; [self setFloat:_colorLevels forUniform:colorLevelsUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImagePrewittEdgeDetectionFilter.h ================================================ #import "GPUImageSobelEdgeDetectionFilter.h" @interface GPUImagePrewittEdgeDetectionFilter : GPUImageSobelEdgeDetectionFilter @end ================================================ FILE: framework/Source/GPUImagePrewittEdgeDetectionFilter.m ================================================ #import "GPUImagePrewittEdgeDetectionFilter.h" @implementation GPUImagePrewittEdgeDetectionFilter #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImagePrewittFragmentShaderString = SHADER_STRING ( precision highp float; varying vec2 textureCoordinate; varying vec2 leftTextureCoordinate; varying vec2 rightTextureCoordinate; varying vec2 topTextureCoordinate; varying vec2 topLeftTextureCoordinate; varying vec2 topRightTextureCoordinate; varying vec2 bottomTextureCoordinate; varying vec2 bottomLeftTextureCoordinate; varying vec2 bottomRightTextureCoordinate; uniform sampler2D inputImageTexture; uniform float edgeStrength; void main() { float bottomLeftIntensity = texture2D(inputImageTexture, bottomLeftTextureCoordinate).r; float topRightIntensity = texture2D(inputImageTexture, topRightTextureCoordinate).r; float topLeftIntensity = texture2D(inputImageTexture, topLeftTextureCoordinate).r; float bottomRightIntensity = texture2D(inputImageTexture, bottomRightTextureCoordinate).r; float leftIntensity = texture2D(inputImageTexture, leftTextureCoordinate).r; float rightIntensity = texture2D(inputImageTexture, rightTextureCoordinate).r; float bottomIntensity = texture2D(inputImageTexture, bottomTextureCoordinate).r; float topIntensity = texture2D(inputImageTexture, topTextureCoordinate).r; float h = -topLeftIntensity - topIntensity - topRightIntensity + bottomLeftIntensity + bottomIntensity + bottomRightIntensity; float v = -bottomLeftIntensity - leftIntensity - topLeftIntensity + bottomRightIntensity + rightIntensity + topRightIntensity; float mag = length(vec2(h, v)) * edgeStrength; gl_FragColor = vec4(vec3(mag), 1.0); } ); #else NSString *const kGPUImagePrewittFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; varying vec2 leftTextureCoordinate; varying vec2 rightTextureCoordinate; varying vec2 topTextureCoordinate; varying vec2 topLeftTextureCoordinate; varying vec2 topRightTextureCoordinate; varying vec2 bottomTextureCoordinate; varying vec2 bottomLeftTextureCoordinate; varying vec2 bottomRightTextureCoordinate; uniform sampler2D inputImageTexture; uniform float edgeStrength; void main() { float bottomLeftIntensity = texture2D(inputImageTexture, bottomLeftTextureCoordinate).r; float topRightIntensity = texture2D(inputImageTexture, topRightTextureCoordinate).r; float topLeftIntensity = texture2D(inputImageTexture, topLeftTextureCoordinate).r; float bottomRightIntensity = texture2D(inputImageTexture, bottomRightTextureCoordinate).r; float leftIntensity = texture2D(inputImageTexture, leftTextureCoordinate).r; float rightIntensity = texture2D(inputImageTexture, rightTextureCoordinate).r; float bottomIntensity = texture2D(inputImageTexture, bottomTextureCoordinate).r; float topIntensity = texture2D(inputImageTexture, topTextureCoordinate).r; float h = -topLeftIntensity - topIntensity - topRightIntensity + bottomLeftIntensity + bottomIntensity + bottomRightIntensity; float v = -bottomLeftIntensity - leftIntensity - topLeftIntensity + bottomRightIntensity + rightIntensity + topRightIntensity; float mag = length(vec2(h, v)) * edgeStrength; gl_FragColor = vec4(vec3(mag), 1.0); } ); #endif #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [self initWithFragmentShaderFromString:kGPUImagePrewittFragmentShaderString])) { return nil; } self.edgeStrength = 1.0; return self; } @end ================================================ FILE: framework/Source/GPUImageRGBClosingFilter.h ================================================ #import "GPUImageFilterGroup.h" @class GPUImageRGBErosionFilter; @class GPUImageRGBDilationFilter; // A filter that first performs a dilation on each color channel of an image, followed by an erosion of the same radius. // This helps to filter out smaller dark elements. @interface GPUImageRGBClosingFilter : GPUImageFilterGroup { GPUImageRGBErosionFilter *erosionFilter; GPUImageRGBDilationFilter *dilationFilter; } - (id)initWithRadius:(NSUInteger)radius; @end ================================================ FILE: framework/Source/GPUImageRGBClosingFilter.m ================================================ #import "GPUImageRGBClosingFilter.h" #import "GPUImageRGBErosionFilter.h" #import "GPUImageRGBDilationFilter.h" @implementation GPUImageRGBClosingFilter - (id)init; { if (!(self = [self initWithRadius:1])) { return nil; } return self; } - (id)initWithRadius:(NSUInteger)radius; { if (!(self = [super init])) { return nil; } // First pass: dilation dilationFilter = [[GPUImageRGBDilationFilter alloc] initWithRadius:radius]; [self addFilter:dilationFilter]; // Second pass: erosion erosionFilter = [[GPUImageRGBErosionFilter alloc] initWithRadius:radius]; [self addFilter:erosionFilter]; [dilationFilter addTarget:erosionFilter]; self.initialFilters = [NSArray arrayWithObjects:dilationFilter, nil]; self.terminalFilter = erosionFilter; return self; } @end ================================================ FILE: framework/Source/GPUImageRGBDilationFilter.h ================================================ #import "GPUImageTwoPassTextureSamplingFilter.h" // For each pixel, this sets it to the maximum value of each color channel in a rectangular neighborhood extending out dilationRadius pixels from the center. // This extends out brighter colors, and can be used for abstraction of color images. @interface GPUImageRGBDilationFilter : GPUImageTwoPassTextureSamplingFilter // Acceptable values for dilationRadius, which sets the distance in pixels to sample out from the center, are 1, 2, 3, and 4. - (id)initWithRadius:(NSUInteger)dilationRadius; @end ================================================ FILE: framework/Source/GPUImageRGBDilationFilter.m ================================================ #import "GPUImageRGBDilationFilter.h" #import "GPUImageDilationFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageRGBDilationRadiusOneFragmentShaderString = SHADER_STRING ( precision highp float; varying vec2 centerTextureCoordinate; varying vec2 oneStepPositiveTextureCoordinate; varying vec2 oneStepNegativeTextureCoordinate; uniform sampler2D inputImageTexture; void main() { lowp vec4 centerIntensity = texture2D(inputImageTexture, centerTextureCoordinate); lowp vec4 oneStepPositiveIntensity = texture2D(inputImageTexture, oneStepPositiveTextureCoordinate); lowp vec4 oneStepNegativeIntensity = texture2D(inputImageTexture, oneStepNegativeTextureCoordinate); lowp vec4 maxValue = max(centerIntensity, oneStepPositiveIntensity); gl_FragColor = max(maxValue, oneStepNegativeIntensity); } ); NSString *const kGPUImageRGBDilationRadiusTwoFragmentShaderString = SHADER_STRING ( precision highp float; varying vec2 centerTextureCoordinate; varying vec2 oneStepPositiveTextureCoordinate; varying vec2 oneStepNegativeTextureCoordinate; varying vec2 twoStepsPositiveTextureCoordinate; varying vec2 twoStepsNegativeTextureCoordinate; uniform sampler2D inputImageTexture; void main() { lowp vec4 centerIntensity = texture2D(inputImageTexture, centerTextureCoordinate); lowp vec4 oneStepPositiveIntensity = texture2D(inputImageTexture, oneStepPositiveTextureCoordinate); lowp vec4 oneStepNegativeIntensity = texture2D(inputImageTexture, oneStepNegativeTextureCoordinate); lowp vec4 twoStepsPositiveIntensity = texture2D(inputImageTexture, twoStepsPositiveTextureCoordinate); lowp vec4 twoStepsNegativeIntensity = texture2D(inputImageTexture, twoStepsNegativeTextureCoordinate); lowp vec4 maxValue = max(centerIntensity, oneStepPositiveIntensity); maxValue = max(maxValue, oneStepNegativeIntensity); maxValue = max(maxValue, twoStepsPositiveIntensity); maxValue = max(maxValue, twoStepsNegativeIntensity); gl_FragColor = max(maxValue, twoStepsNegativeIntensity); } ); NSString *const kGPUImageRGBDilationRadiusThreeFragmentShaderString = SHADER_STRING ( precision highp float; varying vec2 centerTextureCoordinate; varying vec2 oneStepPositiveTextureCoordinate; varying vec2 oneStepNegativeTextureCoordinate; varying vec2 twoStepsPositiveTextureCoordinate; varying vec2 twoStepsNegativeTextureCoordinate; varying vec2 threeStepsPositiveTextureCoordinate; varying vec2 threeStepsNegativeTextureCoordinate; uniform sampler2D inputImageTexture; void main() { lowp vec4 centerIntensity = texture2D(inputImageTexture, centerTextureCoordinate); lowp vec4 oneStepPositiveIntensity = texture2D(inputImageTexture, oneStepPositiveTextureCoordinate); lowp vec4 oneStepNegativeIntensity = texture2D(inputImageTexture, oneStepNegativeTextureCoordinate); lowp vec4 twoStepsPositiveIntensity = texture2D(inputImageTexture, twoStepsPositiveTextureCoordinate); lowp vec4 twoStepsNegativeIntensity = texture2D(inputImageTexture, twoStepsNegativeTextureCoordinate); lowp vec4 threeStepsPositiveIntensity = texture2D(inputImageTexture, threeStepsPositiveTextureCoordinate); lowp vec4 threeStepsNegativeIntensity = texture2D(inputImageTexture, threeStepsNegativeTextureCoordinate); lowp vec4 maxValue = max(centerIntensity, oneStepPositiveIntensity); maxValue = max(maxValue, oneStepNegativeIntensity); maxValue = max(maxValue, twoStepsPositiveIntensity); maxValue = max(maxValue, twoStepsNegativeIntensity); maxValue = max(maxValue, threeStepsPositiveIntensity); gl_FragColor = max(maxValue, threeStepsNegativeIntensity); } ); NSString *const kGPUImageRGBDilationRadiusFourFragmentShaderString = SHADER_STRING ( precision highp float; varying vec2 centerTextureCoordinate; varying vec2 oneStepPositiveTextureCoordinate; varying vec2 oneStepNegativeTextureCoordinate; varying vec2 twoStepsPositiveTextureCoordinate; varying vec2 twoStepsNegativeTextureCoordinate; varying vec2 threeStepsPositiveTextureCoordinate; varying vec2 threeStepsNegativeTextureCoordinate; varying vec2 fourStepsPositiveTextureCoordinate; varying vec2 fourStepsNegativeTextureCoordinate; uniform sampler2D inputImageTexture; void main() { lowp vec4 centerIntensity = texture2D(inputImageTexture, centerTextureCoordinate); lowp vec4 oneStepPositiveIntensity = texture2D(inputImageTexture, oneStepPositiveTextureCoordinate); lowp vec4 oneStepNegativeIntensity = texture2D(inputImageTexture, oneStepNegativeTextureCoordinate); lowp vec4 twoStepsPositiveIntensity = texture2D(inputImageTexture, twoStepsPositiveTextureCoordinate); lowp vec4 twoStepsNegativeIntensity = texture2D(inputImageTexture, twoStepsNegativeTextureCoordinate); lowp vec4 threeStepsPositiveIntensity = texture2D(inputImageTexture, threeStepsPositiveTextureCoordinate); lowp vec4 threeStepsNegativeIntensity = texture2D(inputImageTexture, threeStepsNegativeTextureCoordinate); lowp vec4 fourStepsPositiveIntensity = texture2D(inputImageTexture, fourStepsPositiveTextureCoordinate); lowp vec4 fourStepsNegativeIntensity = texture2D(inputImageTexture, fourStepsNegativeTextureCoordinate); lowp vec4 maxValue = max(centerIntensity, oneStepPositiveIntensity); maxValue = max(maxValue, oneStepNegativeIntensity); maxValue = max(maxValue, twoStepsPositiveIntensity); maxValue = max(maxValue, twoStepsNegativeIntensity); maxValue = max(maxValue, threeStepsPositiveIntensity); maxValue = max(maxValue, threeStepsNegativeIntensity); maxValue = max(maxValue, fourStepsPositiveIntensity); gl_FragColor = max(maxValue, fourStepsNegativeIntensity); } ); #else NSString *const kGPUImageRGBDilationRadiusOneFragmentShaderString = SHADER_STRING ( varying vec2 centerTextureCoordinate; varying vec2 oneStepPositiveTextureCoordinate; varying vec2 oneStepNegativeTextureCoordinate; uniform sampler2D inputImageTexture; void main() { vec4 centerIntensity = texture2D(inputImageTexture, centerTextureCoordinate); vec4 oneStepPositiveIntensity = texture2D(inputImageTexture, oneStepPositiveTextureCoordinate); vec4 oneStepNegativeIntensity = texture2D(inputImageTexture, oneStepNegativeTextureCoordinate); vec4 maxValue = max(centerIntensity, oneStepPositiveIntensity); gl_FragColor = max(maxValue, oneStepNegativeIntensity); } ); NSString *const kGPUImageRGBDilationRadiusTwoFragmentShaderString = SHADER_STRING ( varying vec2 centerTextureCoordinate; varying vec2 oneStepPositiveTextureCoordinate; varying vec2 oneStepNegativeTextureCoordinate; varying vec2 twoStepsPositiveTextureCoordinate; varying vec2 twoStepsNegativeTextureCoordinate; uniform sampler2D inputImageTexture; void main() { vec4 centerIntensity = texture2D(inputImageTexture, centerTextureCoordinate); vec4 oneStepPositiveIntensity = texture2D(inputImageTexture, oneStepPositiveTextureCoordinate); vec4 oneStepNegativeIntensity = texture2D(inputImageTexture, oneStepNegativeTextureCoordinate); vec4 twoStepsPositiveIntensity = texture2D(inputImageTexture, twoStepsPositiveTextureCoordinate); vec4 twoStepsNegativeIntensity = texture2D(inputImageTexture, twoStepsNegativeTextureCoordinate); vec4 maxValue = max(centerIntensity, oneStepPositiveIntensity); maxValue = max(maxValue, oneStepNegativeIntensity); maxValue = max(maxValue, twoStepsPositiveIntensity); maxValue = max(maxValue, twoStepsNegativeIntensity); gl_FragColor = max(maxValue, twoStepsNegativeIntensity); } ); NSString *const kGPUImageRGBDilationRadiusThreeFragmentShaderString = SHADER_STRING ( varying vec2 centerTextureCoordinate; varying vec2 oneStepPositiveTextureCoordinate; varying vec2 oneStepNegativeTextureCoordinate; varying vec2 twoStepsPositiveTextureCoordinate; varying vec2 twoStepsNegativeTextureCoordinate; varying vec2 threeStepsPositiveTextureCoordinate; varying vec2 threeStepsNegativeTextureCoordinate; uniform sampler2D inputImageTexture; void main() { vec4 centerIntensity = texture2D(inputImageTexture, centerTextureCoordinate); vec4 oneStepPositiveIntensity = texture2D(inputImageTexture, oneStepPositiveTextureCoordinate); vec4 oneStepNegativeIntensity = texture2D(inputImageTexture, oneStepNegativeTextureCoordinate); vec4 twoStepsPositiveIntensity = texture2D(inputImageTexture, twoStepsPositiveTextureCoordinate); vec4 twoStepsNegativeIntensity = texture2D(inputImageTexture, twoStepsNegativeTextureCoordinate); vec4 threeStepsPositiveIntensity = texture2D(inputImageTexture, threeStepsPositiveTextureCoordinate); vec4 threeStepsNegativeIntensity = texture2D(inputImageTexture, threeStepsNegativeTextureCoordinate); vec4 maxValue = max(centerIntensity, oneStepPositiveIntensity); maxValue = max(maxValue, oneStepNegativeIntensity); maxValue = max(maxValue, twoStepsPositiveIntensity); maxValue = max(maxValue, twoStepsNegativeIntensity); maxValue = max(maxValue, threeStepsPositiveIntensity); gl_FragColor = max(maxValue, threeStepsNegativeIntensity); } ); NSString *const kGPUImageRGBDilationRadiusFourFragmentShaderString = SHADER_STRING ( varying vec2 centerTextureCoordinate; varying vec2 oneStepPositiveTextureCoordinate; varying vec2 oneStepNegativeTextureCoordinate; varying vec2 twoStepsPositiveTextureCoordinate; varying vec2 twoStepsNegativeTextureCoordinate; varying vec2 threeStepsPositiveTextureCoordinate; varying vec2 threeStepsNegativeTextureCoordinate; varying vec2 fourStepsPositiveTextureCoordinate; varying vec2 fourStepsNegativeTextureCoordinate; uniform sampler2D inputImageTexture; void main() { vec4 centerIntensity = texture2D(inputImageTexture, centerTextureCoordinate); vec4 oneStepPositiveIntensity = texture2D(inputImageTexture, oneStepPositiveTextureCoordinate); vec4 oneStepNegativeIntensity = texture2D(inputImageTexture, oneStepNegativeTextureCoordinate); vec4 twoStepsPositiveIntensity = texture2D(inputImageTexture, twoStepsPositiveTextureCoordinate); vec4 twoStepsNegativeIntensity = texture2D(inputImageTexture, twoStepsNegativeTextureCoordinate); vec4 threeStepsPositiveIntensity = texture2D(inputImageTexture, threeStepsPositiveTextureCoordinate); vec4 threeStepsNegativeIntensity = texture2D(inputImageTexture, threeStepsNegativeTextureCoordinate); vec4 fourStepsPositiveIntensity = texture2D(inputImageTexture, fourStepsPositiveTextureCoordinate); vec4 fourStepsNegativeIntensity = texture2D(inputImageTexture, fourStepsNegativeTextureCoordinate); vec4 maxValue = max(centerIntensity, oneStepPositiveIntensity); maxValue = max(maxValue, oneStepNegativeIntensity); maxValue = max(maxValue, twoStepsPositiveIntensity); maxValue = max(maxValue, twoStepsNegativeIntensity); maxValue = max(maxValue, threeStepsPositiveIntensity); maxValue = max(maxValue, threeStepsNegativeIntensity); maxValue = max(maxValue, fourStepsPositiveIntensity); gl_FragColor = max(maxValue, fourStepsNegativeIntensity); } ); #endif @implementation GPUImageRGBDilationFilter #pragma mark - #pragma mark Initialization and teardown - (id)initWithRadius:(NSUInteger)dilationRadius; { NSString *fragmentShaderForThisRadius = nil; NSString *vertexShaderForThisRadius = nil; switch (dilationRadius) { case 0: case 1: { vertexShaderForThisRadius = kGPUImageDilationRadiusOneVertexShaderString; fragmentShaderForThisRadius = kGPUImageRGBDilationRadiusOneFragmentShaderString; }; break; case 2: { vertexShaderForThisRadius = kGPUImageDilationRadiusTwoVertexShaderString; fragmentShaderForThisRadius = kGPUImageRGBDilationRadiusTwoFragmentShaderString; }; break; case 3: { vertexShaderForThisRadius = kGPUImageDilationRadiusThreeVertexShaderString; fragmentShaderForThisRadius = kGPUImageRGBDilationRadiusThreeFragmentShaderString; }; break; case 4: { vertexShaderForThisRadius = kGPUImageDilationRadiusFourVertexShaderString; fragmentShaderForThisRadius = kGPUImageRGBDilationRadiusFourFragmentShaderString; }; break; default: { vertexShaderForThisRadius = kGPUImageDilationRadiusFourVertexShaderString; fragmentShaderForThisRadius = kGPUImageRGBDilationRadiusFourFragmentShaderString; }; break; } if (!(self = [super initWithFirstStageVertexShaderFromString:vertexShaderForThisRadius firstStageFragmentShaderFromString:fragmentShaderForThisRadius secondStageVertexShaderFromString:vertexShaderForThisRadius secondStageFragmentShaderFromString:fragmentShaderForThisRadius])) { return nil; } return self; } - (id)init; { if (!(self = [self initWithRadius:1])) { return nil; } return self; } @end ================================================ FILE: framework/Source/GPUImageRGBErosionFilter.h ================================================ #import "GPUImageTwoPassTextureSamplingFilter.h" // For each pixel, this sets it to the minimum value of each color channel in a rectangular neighborhood extending out dilationRadius pixels from the center. // This extends out dark features, and can be used for abstraction of color images. @interface GPUImageRGBErosionFilter : GPUImageTwoPassTextureSamplingFilter // Acceptable values for erosionRadius, which sets the distance in pixels to sample out from the center, are 1, 2, 3, and 4. - (id)initWithRadius:(NSUInteger)erosionRadius; @end ================================================ FILE: framework/Source/GPUImageRGBErosionFilter.m ================================================ #import "GPUImageRGBErosionFilter.h" #import "GPUImageDilationFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageRGBErosionRadiusOneFragmentShaderString = SHADER_STRING ( precision highp float; varying vec2 centerTextureCoordinate; varying vec2 oneStepPositiveTextureCoordinate; varying vec2 oneStepNegativeTextureCoordinate; uniform sampler2D inputImageTexture; void main() { lowp vec4 centerIntensity = texture2D(inputImageTexture, centerTextureCoordinate); lowp vec4 oneStepPositiveIntensity = texture2D(inputImageTexture, oneStepPositiveTextureCoordinate); lowp vec4 oneStepNegativeIntensity = texture2D(inputImageTexture, oneStepNegativeTextureCoordinate); lowp vec4 minValue = min(centerIntensity, oneStepPositiveIntensity); gl_FragColor = min(minValue, oneStepNegativeIntensity); } ); NSString *const kGPUImageRGBErosionRadiusTwoFragmentShaderString = SHADER_STRING ( precision highp float; varying vec2 centerTextureCoordinate; varying vec2 oneStepPositiveTextureCoordinate; varying vec2 oneStepNegativeTextureCoordinate; varying vec2 twoStepsPositiveTextureCoordinate; varying vec2 twoStepsNegativeTextureCoordinate; uniform sampler2D inputImageTexture; void main() { lowp vec4 centerIntensity = texture2D(inputImageTexture, centerTextureCoordinate); lowp vec4 oneStepPositiveIntensity = texture2D(inputImageTexture, oneStepPositiveTextureCoordinate); lowp vec4 oneStepNegativeIntensity = texture2D(inputImageTexture, oneStepNegativeTextureCoordinate); lowp vec4 twoStepsPositiveIntensity = texture2D(inputImageTexture, twoStepsPositiveTextureCoordinate); lowp vec4 twoStepsNegativeIntensity = texture2D(inputImageTexture, twoStepsNegativeTextureCoordinate); lowp vec4 minValue = min(centerIntensity, oneStepPositiveIntensity); minValue = min(minValue, oneStepNegativeIntensity); minValue = min(minValue, twoStepsPositiveIntensity); gl_FragColor = min(minValue, twoStepsNegativeIntensity); } ); NSString *const kGPUImageRGBErosionRadiusThreeFragmentShaderString = SHADER_STRING ( precision highp float; varying vec2 centerTextureCoordinate; varying vec2 oneStepPositiveTextureCoordinate; varying vec2 oneStepNegativeTextureCoordinate; varying vec2 twoStepsPositiveTextureCoordinate; varying vec2 twoStepsNegativeTextureCoordinate; varying vec2 threeStepsPositiveTextureCoordinate; varying vec2 threeStepsNegativeTextureCoordinate; uniform sampler2D inputImageTexture; void main() { lowp vec4 centerIntensity = texture2D(inputImageTexture, centerTextureCoordinate); lowp vec4 oneStepPositiveIntensity = texture2D(inputImageTexture, oneStepPositiveTextureCoordinate); lowp vec4 oneStepNegativeIntensity = texture2D(inputImageTexture, oneStepNegativeTextureCoordinate); lowp vec4 twoStepsPositiveIntensity = texture2D(inputImageTexture, twoStepsPositiveTextureCoordinate); lowp vec4 twoStepsNegativeIntensity = texture2D(inputImageTexture, twoStepsNegativeTextureCoordinate); lowp vec4 threeStepsPositiveIntensity = texture2D(inputImageTexture, threeStepsPositiveTextureCoordinate); lowp vec4 threeStepsNegativeIntensity = texture2D(inputImageTexture, threeStepsNegativeTextureCoordinate); lowp vec4 minValue = min(centerIntensity, oneStepPositiveIntensity); minValue = min(minValue, oneStepNegativeIntensity); minValue = min(minValue, twoStepsPositiveIntensity); minValue = min(minValue, twoStepsNegativeIntensity); minValue = min(minValue, threeStepsPositiveIntensity); gl_FragColor = min(minValue, threeStepsNegativeIntensity); } ); NSString *const kGPUImageRGBErosionRadiusFourFragmentShaderString = SHADER_STRING ( precision highp float; varying vec2 centerTextureCoordinate; varying vec2 oneStepPositiveTextureCoordinate; varying vec2 oneStepNegativeTextureCoordinate; varying vec2 twoStepsPositiveTextureCoordinate; varying vec2 twoStepsNegativeTextureCoordinate; varying vec2 threeStepsPositiveTextureCoordinate; varying vec2 threeStepsNegativeTextureCoordinate; varying vec2 fourStepsPositiveTextureCoordinate; varying vec2 fourStepsNegativeTextureCoordinate; uniform sampler2D inputImageTexture; void main() { lowp vec4 centerIntensity = texture2D(inputImageTexture, centerTextureCoordinate); lowp vec4 oneStepPositiveIntensity = texture2D(inputImageTexture, oneStepPositiveTextureCoordinate); lowp vec4 oneStepNegativeIntensity = texture2D(inputImageTexture, oneStepNegativeTextureCoordinate); lowp vec4 twoStepsPositiveIntensity = texture2D(inputImageTexture, twoStepsPositiveTextureCoordinate); lowp vec4 twoStepsNegativeIntensity = texture2D(inputImageTexture, twoStepsNegativeTextureCoordinate); lowp vec4 threeStepsPositiveIntensity = texture2D(inputImageTexture, threeStepsPositiveTextureCoordinate); lowp vec4 threeStepsNegativeIntensity = texture2D(inputImageTexture, threeStepsNegativeTextureCoordinate); lowp vec4 fourStepsPositiveIntensity = texture2D(inputImageTexture, fourStepsPositiveTextureCoordinate); lowp vec4 fourStepsNegativeIntensity = texture2D(inputImageTexture, fourStepsNegativeTextureCoordinate); lowp vec4 minValue = min(centerIntensity, oneStepPositiveIntensity); minValue = min(minValue, oneStepNegativeIntensity); minValue = min(minValue, twoStepsPositiveIntensity); minValue = min(minValue, twoStepsNegativeIntensity); minValue = min(minValue, threeStepsPositiveIntensity); minValue = min(minValue, threeStepsNegativeIntensity); minValue = min(minValue, fourStepsPositiveIntensity); gl_FragColor = min(minValue, fourStepsNegativeIntensity); } ); #else NSString *const kGPUImageRGBErosionRadiusOneFragmentShaderString = SHADER_STRING ( varying vec2 centerTextureCoordinate; varying vec2 oneStepPositiveTextureCoordinate; varying vec2 oneStepNegativeTextureCoordinate; uniform sampler2D inputImageTexture; void main() { vec4 centerIntensity = texture2D(inputImageTexture, centerTextureCoordinate); vec4 oneStepPositiveIntensity = texture2D(inputImageTexture, oneStepPositiveTextureCoordinate); vec4 oneStepNegativeIntensity = texture2D(inputImageTexture, oneStepNegativeTextureCoordinate); vec4 minValue = min(centerIntensity, oneStepPositiveIntensity); gl_FragColor = min(minValue, oneStepNegativeIntensity); } ); NSString *const kGPUImageRGBErosionRadiusTwoFragmentShaderString = SHADER_STRING ( varying vec2 centerTextureCoordinate; varying vec2 oneStepPositiveTextureCoordinate; varying vec2 oneStepNegativeTextureCoordinate; varying vec2 twoStepsPositiveTextureCoordinate; varying vec2 twoStepsNegativeTextureCoordinate; uniform sampler2D inputImageTexture; void main() { vec4 centerIntensity = texture2D(inputImageTexture, centerTextureCoordinate); vec4 oneStepPositiveIntensity = texture2D(inputImageTexture, oneStepPositiveTextureCoordinate); vec4 oneStepNegativeIntensity = texture2D(inputImageTexture, oneStepNegativeTextureCoordinate); vec4 twoStepsPositiveIntensity = texture2D(inputImageTexture, twoStepsPositiveTextureCoordinate); vec4 twoStepsNegativeIntensity = texture2D(inputImageTexture, twoStepsNegativeTextureCoordinate); vec4 minValue = min(centerIntensity, oneStepPositiveIntensity); minValue = min(minValue, oneStepNegativeIntensity); minValue = min(minValue, twoStepsPositiveIntensity); gl_FragColor = min(minValue, twoStepsNegativeIntensity); } ); NSString *const kGPUImageRGBErosionRadiusThreeFragmentShaderString = SHADER_STRING ( varying vec2 centerTextureCoordinate; varying vec2 oneStepPositiveTextureCoordinate; varying vec2 oneStepNegativeTextureCoordinate; varying vec2 twoStepsPositiveTextureCoordinate; varying vec2 twoStepsNegativeTextureCoordinate; varying vec2 threeStepsPositiveTextureCoordinate; varying vec2 threeStepsNegativeTextureCoordinate; uniform sampler2D inputImageTexture; void main() { vec4 centerIntensity = texture2D(inputImageTexture, centerTextureCoordinate); vec4 oneStepPositiveIntensity = texture2D(inputImageTexture, oneStepPositiveTextureCoordinate); vec4 oneStepNegativeIntensity = texture2D(inputImageTexture, oneStepNegativeTextureCoordinate); vec4 twoStepsPositiveIntensity = texture2D(inputImageTexture, twoStepsPositiveTextureCoordinate); vec4 twoStepsNegativeIntensity = texture2D(inputImageTexture, twoStepsNegativeTextureCoordinate); vec4 threeStepsPositiveIntensity = texture2D(inputImageTexture, threeStepsPositiveTextureCoordinate); vec4 threeStepsNegativeIntensity = texture2D(inputImageTexture, threeStepsNegativeTextureCoordinate); vec4 minValue = min(centerIntensity, oneStepPositiveIntensity); minValue = min(minValue, oneStepNegativeIntensity); minValue = min(minValue, twoStepsPositiveIntensity); minValue = min(minValue, twoStepsNegativeIntensity); minValue = min(minValue, threeStepsPositiveIntensity); gl_FragColor = min(minValue, threeStepsNegativeIntensity); } ); NSString *const kGPUImageRGBErosionRadiusFourFragmentShaderString = SHADER_STRING ( varying vec2 centerTextureCoordinate; varying vec2 oneStepPositiveTextureCoordinate; varying vec2 oneStepNegativeTextureCoordinate; varying vec2 twoStepsPositiveTextureCoordinate; varying vec2 twoStepsNegativeTextureCoordinate; varying vec2 threeStepsPositiveTextureCoordinate; varying vec2 threeStepsNegativeTextureCoordinate; varying vec2 fourStepsPositiveTextureCoordinate; varying vec2 fourStepsNegativeTextureCoordinate; uniform sampler2D inputImageTexture; void main() { vec4 centerIntensity = texture2D(inputImageTexture, centerTextureCoordinate); vec4 oneStepPositiveIntensity = texture2D(inputImageTexture, oneStepPositiveTextureCoordinate); vec4 oneStepNegativeIntensity = texture2D(inputImageTexture, oneStepNegativeTextureCoordinate); vec4 twoStepsPositiveIntensity = texture2D(inputImageTexture, twoStepsPositiveTextureCoordinate); vec4 twoStepsNegativeIntensity = texture2D(inputImageTexture, twoStepsNegativeTextureCoordinate); vec4 threeStepsPositiveIntensity = texture2D(inputImageTexture, threeStepsPositiveTextureCoordinate); vec4 threeStepsNegativeIntensity = texture2D(inputImageTexture, threeStepsNegativeTextureCoordinate); vec4 fourStepsPositiveIntensity = texture2D(inputImageTexture, fourStepsPositiveTextureCoordinate); vec4 fourStepsNegativeIntensity = texture2D(inputImageTexture, fourStepsNegativeTextureCoordinate); vec4 minValue = min(centerIntensity, oneStepPositiveIntensity); minValue = min(minValue, oneStepNegativeIntensity); minValue = min(minValue, twoStepsPositiveIntensity); minValue = min(minValue, twoStepsNegativeIntensity); minValue = min(minValue, threeStepsPositiveIntensity); minValue = min(minValue, threeStepsNegativeIntensity); minValue = min(minValue, fourStepsPositiveIntensity); gl_FragColor = min(minValue, fourStepsNegativeIntensity); } ); #endif @implementation GPUImageRGBErosionFilter #pragma mark - #pragma mark Initialization and teardown - (id)initWithRadius:(NSUInteger)erosionRadius; { NSString *fragmentShaderForThisRadius = nil; NSString *vertexShaderForThisRadius = nil; switch (erosionRadius) { case 0: case 1: { vertexShaderForThisRadius = kGPUImageDilationRadiusOneVertexShaderString; fragmentShaderForThisRadius = kGPUImageRGBErosionRadiusOneFragmentShaderString; }; break; case 2: { vertexShaderForThisRadius = kGPUImageDilationRadiusTwoVertexShaderString; fragmentShaderForThisRadius = kGPUImageRGBErosionRadiusTwoFragmentShaderString; }; break; case 3: { vertexShaderForThisRadius = kGPUImageDilationRadiusThreeVertexShaderString; fragmentShaderForThisRadius = kGPUImageRGBErosionRadiusThreeFragmentShaderString; }; break; case 4: { vertexShaderForThisRadius = kGPUImageDilationRadiusFourVertexShaderString; fragmentShaderForThisRadius = kGPUImageRGBErosionRadiusFourFragmentShaderString; }; break; default: { vertexShaderForThisRadius = kGPUImageDilationRadiusFourVertexShaderString; fragmentShaderForThisRadius = kGPUImageRGBErosionRadiusFourFragmentShaderString; }; break; } if (!(self = [super initWithFirstStageVertexShaderFromString:vertexShaderForThisRadius firstStageFragmentShaderFromString:fragmentShaderForThisRadius secondStageVertexShaderFromString:vertexShaderForThisRadius secondStageFragmentShaderFromString:fragmentShaderForThisRadius])) { return nil; } return self; } - (id)init; { if (!(self = [self initWithRadius:1])) { return nil; } return self; } @end ================================================ FILE: framework/Source/GPUImageRGBFilter.h ================================================ #import "GPUImageFilter.h" @interface GPUImageRGBFilter : GPUImageFilter { GLint redUniform; GLint greenUniform; GLint blueUniform; } // Normalized values by which each color channel is multiplied. The range is from 0.0 up, with 1.0 as the default. @property (readwrite, nonatomic) CGFloat red; @property (readwrite, nonatomic) CGFloat green; @property (readwrite, nonatomic) CGFloat blue; @end ================================================ FILE: framework/Source/GPUImageRGBFilter.m ================================================ #import "GPUImageRGBFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageRGBFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform highp float redAdjustment; uniform highp float greenAdjustment; uniform highp float blueAdjustment; void main() { highp vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); gl_FragColor = vec4(textureColor.r * redAdjustment, textureColor.g * greenAdjustment, textureColor.b * blueAdjustment, textureColor.a); } ); #else NSString *const kGPUImageRGBFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform float redAdjustment; uniform float greenAdjustment; uniform float blueAdjustment; void main() { vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); gl_FragColor = vec4(textureColor.r * redAdjustment, textureColor.g * greenAdjustment, textureColor.b * blueAdjustment, textureColor.a); } ); #endif @implementation GPUImageRGBFilter @synthesize red = _red, blue = _blue, green = _green; #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageRGBFragmentShaderString])) { return nil; } redUniform = [filterProgram uniformIndex:@"redAdjustment"]; self.red = 1.0; greenUniform = [filterProgram uniformIndex:@"greenAdjustment"]; self.green = 1.0; blueUniform = [filterProgram uniformIndex:@"blueAdjustment"]; self.blue = 1.0; return self; } #pragma mark - #pragma mark Accessors - (void)setRed:(CGFloat)newValue; { _red = newValue; [self setFloat:_red forUniform:redUniform program:filterProgram]; } - (void)setGreen:(CGFloat)newValue; { _green = newValue; [self setFloat:_green forUniform:greenUniform program:filterProgram]; } - (void)setBlue:(CGFloat)newValue; { _blue = newValue; [self setFloat:_blue forUniform:blueUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImageRGBOpeningFilter.h ================================================ #import "GPUImageFilterGroup.h" @class GPUImageRGBErosionFilter; @class GPUImageRGBDilationFilter; // A filter that first performs an erosion on each color channel of an image, followed by a dilation of the same radius. // This helps to filter out smaller bright elements. @interface GPUImageRGBOpeningFilter : GPUImageFilterGroup { GPUImageRGBErosionFilter *erosionFilter; GPUImageRGBDilationFilter *dilationFilter; } - (id)initWithRadius:(NSUInteger)radius; @end ================================================ FILE: framework/Source/GPUImageRGBOpeningFilter.m ================================================ #import "GPUImageRGBOpeningFilter.h" #import "GPUImageRGBErosionFilter.h" #import "GPUImageRGBDilationFilter.h" @implementation GPUImageRGBOpeningFilter - (id)init; { if (!(self = [self initWithRadius:1])) { return nil; } return self; } - (id)initWithRadius:(NSUInteger)radius; { if (!(self = [super init])) { return nil; } // First pass: erosion erosionFilter = [[GPUImageRGBErosionFilter alloc] initWithRadius:radius]; [self addFilter:erosionFilter]; // Second pass: dilation dilationFilter = [[GPUImageRGBDilationFilter alloc] initWithRadius:radius]; [self addFilter:dilationFilter]; [erosionFilter addTarget:dilationFilter]; self.initialFilters = [NSArray arrayWithObjects:erosionFilter, nil]; self.terminalFilter = dilationFilter; return self; } @end ================================================ FILE: framework/Source/GPUImageRawDataInput.h ================================================ #import "GPUImageOutput.h" // The bytes passed into this input are not copied or retained, but you are free to deallocate them after they are used by this filter. // The bytes are uploaded and stored within a texture, so nothing is kept locally. // The default format for input bytes is GPUPixelFormatBGRA, unless specified with pixelFormat: // The default type for input bytes is GPUPixelTypeUByte, unless specified with pixelType: typedef enum { GPUPixelFormatBGRA = GL_BGRA, GPUPixelFormatRGBA = GL_RGBA, GPUPixelFormatRGB = GL_RGB, GPUPixelFormatLuminance = GL_LUMINANCE } GPUPixelFormat; typedef enum { GPUPixelTypeUByte = GL_UNSIGNED_BYTE, GPUPixelTypeFloat = GL_FLOAT } GPUPixelType; @interface GPUImageRawDataInput : GPUImageOutput { CGSize uploadedImageSize; dispatch_semaphore_t dataUpdateSemaphore; } // Initialization and teardown - (id)initWithBytes:(GLubyte *)bytesToUpload size:(CGSize)imageSize; - (id)initWithBytes:(GLubyte *)bytesToUpload size:(CGSize)imageSize pixelFormat:(GPUPixelFormat)pixelFormat; - (id)initWithBytes:(GLubyte *)bytesToUpload size:(CGSize)imageSize pixelFormat:(GPUPixelFormat)pixelFormat type:(GPUPixelType)pixelType; /** Input data pixel format */ @property (readwrite, nonatomic) GPUPixelFormat pixelFormat; @property (readwrite, nonatomic) GPUPixelType pixelType; // Image rendering - (void)updateDataFromBytes:(GLubyte *)bytesToUpload size:(CGSize)imageSize; - (void)processData; - (void)processDataForTimestamp:(CMTime)frameTime; - (CGSize)outputImageSize; @end ================================================ FILE: framework/Source/GPUImageRawDataInput.m ================================================ #import "GPUImageRawDataInput.h" @interface GPUImageRawDataInput() - (void)uploadBytes:(GLubyte *)bytesToUpload; @end @implementation GPUImageRawDataInput @synthesize pixelFormat = _pixelFormat; @synthesize pixelType = _pixelType; #pragma mark - #pragma mark Initialization and teardown - (id)initWithBytes:(GLubyte *)bytesToUpload size:(CGSize)imageSize; { if (!(self = [self initWithBytes:bytesToUpload size:imageSize pixelFormat:GPUPixelFormatBGRA type:GPUPixelTypeUByte])) { return nil; } return self; } - (id)initWithBytes:(GLubyte *)bytesToUpload size:(CGSize)imageSize pixelFormat:(GPUPixelFormat)pixelFormat; { if (!(self = [self initWithBytes:bytesToUpload size:imageSize pixelFormat:pixelFormat type:GPUPixelTypeUByte])) { return nil; } return self; } - (id)initWithBytes:(GLubyte *)bytesToUpload size:(CGSize)imageSize pixelFormat:(GPUPixelFormat)pixelFormat type:(GPUPixelType)pixelType; { if (!(self = [super init])) { return nil; } dataUpdateSemaphore = dispatch_semaphore_create(1); uploadedImageSize = imageSize; self.pixelFormat = pixelFormat; self.pixelType = pixelType; [self uploadBytes:bytesToUpload]; return self; } // ARC forbids explicit message send of 'release'; since iOS 6 even for dispatch_release() calls: stripping it out in that case is required. - (void)dealloc; { #if !OS_OBJECT_USE_OBJC if (dataUpdateSemaphore != NULL) { dispatch_release(dataUpdateSemaphore); } #endif } #pragma mark - #pragma mark Image rendering - (void)uploadBytes:(GLubyte *)bytesToUpload; { [GPUImageContext useImageProcessingContext]; // TODO: This probably isn't right, and will need to be corrected outputFramebuffer = [[GPUImageContext sharedFramebufferCache] fetchFramebufferForSize:uploadedImageSize textureOptions:self.outputTextureOptions onlyTexture:YES]; glBindTexture(GL_TEXTURE_2D, [outputFramebuffer texture]); glTexImage2D(GL_TEXTURE_2D, 0, _pixelFormat, (int)uploadedImageSize.width, (int)uploadedImageSize.height, 0, (GLint)_pixelFormat, (GLenum)_pixelType, bytesToUpload); } - (void)updateDataFromBytes:(GLubyte *)bytesToUpload size:(CGSize)imageSize; { uploadedImageSize = imageSize; [self uploadBytes:bytesToUpload]; } - (void)processData; { if (dispatch_semaphore_wait(dataUpdateSemaphore, DISPATCH_TIME_NOW) != 0) { return; } runAsynchronouslyOnVideoProcessingQueue(^{ CGSize pixelSizeOfImage = [self outputImageSize]; for (id currentTarget in targets) { NSInteger indexOfObject = [targets indexOfObject:currentTarget]; NSInteger textureIndexOfTarget = [[targetTextureIndices objectAtIndex:indexOfObject] integerValue]; [currentTarget setInputSize:pixelSizeOfImage atIndex:textureIndexOfTarget]; [currentTarget setInputFramebuffer:outputFramebuffer atIndex:textureIndexOfTarget]; [currentTarget newFrameReadyAtTime:kCMTimeInvalid atIndex:textureIndexOfTarget]; } dispatch_semaphore_signal(dataUpdateSemaphore); }); } - (void)processDataForTimestamp:(CMTime)frameTime; { if (dispatch_semaphore_wait(dataUpdateSemaphore, DISPATCH_TIME_NOW) != 0) { return; } runAsynchronouslyOnVideoProcessingQueue(^{ CGSize pixelSizeOfImage = [self outputImageSize]; for (id currentTarget in targets) { NSInteger indexOfObject = [targets indexOfObject:currentTarget]; NSInteger textureIndexOfTarget = [[targetTextureIndices objectAtIndex:indexOfObject] integerValue]; [currentTarget setInputSize:pixelSizeOfImage atIndex:textureIndexOfTarget]; [currentTarget newFrameReadyAtTime:frameTime atIndex:textureIndexOfTarget]; } dispatch_semaphore_signal(dataUpdateSemaphore); }); } - (CGSize)outputImageSize; { return uploadedImageSize; } @end ================================================ FILE: framework/Source/GPUImageRawDataOutput.h ================================================ #import #import "GPUImageContext.h" struct GPUByteColorVector { GLubyte red; GLubyte green; GLubyte blue; GLubyte alpha; }; typedef struct GPUByteColorVector GPUByteColorVector; @protocol GPUImageRawDataProcessor; #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE @interface GPUImageRawDataOutput : NSObject { CGSize imageSize; GPUImageRotationMode inputRotation; BOOL outputBGRA; } #else @interface GPUImageRawDataOutput : NSObject { CGSize imageSize; GPUImageRotationMode inputRotation; BOOL outputBGRA; } #endif @property(readonly) GLubyte *rawBytesForImage; @property(nonatomic, copy) void(^newFrameAvailableBlock)(void); @property(nonatomic) BOOL enabled; // Initialization and teardown - (id)initWithImageSize:(CGSize)newImageSize resultsInBGRAFormat:(BOOL)resultsInBGRAFormat; // Data access - (GPUByteColorVector)colorAtLocation:(CGPoint)locationInImage; - (NSUInteger)bytesPerRowInOutput; - (void)setImageSize:(CGSize)newImageSize; - (void)lockFramebufferForReading; - (void)unlockFramebufferAfterReading; @end ================================================ FILE: framework/Source/GPUImageRawDataOutput.m ================================================ #import "GPUImageRawDataOutput.h" #import "GPUImageContext.h" #import "GLProgram.h" #import "GPUImageFilter.h" #import "GPUImageMovieWriter.h" @interface GPUImageRawDataOutput () { GPUImageFramebuffer *firstInputFramebuffer, *outputFramebuffer, *retainedFramebuffer; BOOL hasReadFromTheCurrentFrame; GLProgram *dataProgram; GLint dataPositionAttribute, dataTextureCoordinateAttribute; GLint dataInputTextureUniform; GLubyte *_rawBytesForImage; BOOL lockNextFramebuffer; } // Frame rendering - (void)renderAtInternalSize; @end @implementation GPUImageRawDataOutput @synthesize rawBytesForImage = _rawBytesForImage; @synthesize newFrameAvailableBlock = _newFrameAvailableBlock; @synthesize enabled; #pragma mark - #pragma mark Initialization and teardown - (id)initWithImageSize:(CGSize)newImageSize resultsInBGRAFormat:(BOOL)resultsInBGRAFormat; { if (!(self = [super init])) { return nil; } self.enabled = YES; lockNextFramebuffer = NO; outputBGRA = resultsInBGRAFormat; imageSize = newImageSize; hasReadFromTheCurrentFrame = NO; _rawBytesForImage = NULL; inputRotation = kGPUImageNoRotation; [GPUImageContext useImageProcessingContext]; if ( (outputBGRA && ![GPUImageContext supportsFastTextureUpload]) || (!outputBGRA && [GPUImageContext supportsFastTextureUpload]) ) { dataProgram = [[GPUImageContext sharedImageProcessingContext] programForVertexShaderString:kGPUImageVertexShaderString fragmentShaderString:kGPUImageColorSwizzlingFragmentShaderString]; } else { dataProgram = [[GPUImageContext sharedImageProcessingContext] programForVertexShaderString:kGPUImageVertexShaderString fragmentShaderString:kGPUImagePassthroughFragmentShaderString]; } if (!dataProgram.initialized) { [dataProgram addAttribute:@"position"]; [dataProgram addAttribute:@"inputTextureCoordinate"]; if (![dataProgram link]) { NSString *progLog = [dataProgram programLog]; NSLog(@"Program link log: %@", progLog); NSString *fragLog = [dataProgram fragmentShaderLog]; NSLog(@"Fragment shader compile log: %@", fragLog); NSString *vertLog = [dataProgram vertexShaderLog]; NSLog(@"Vertex shader compile log: %@", vertLog); dataProgram = nil; NSAssert(NO, @"Filter shader link failed"); } } dataPositionAttribute = [dataProgram attributeIndex:@"position"]; dataTextureCoordinateAttribute = [dataProgram attributeIndex:@"inputTextureCoordinate"]; dataInputTextureUniform = [dataProgram uniformIndex:@"inputImageTexture"]; return self; } - (void)dealloc { if (_rawBytesForImage != NULL && (![GPUImageContext supportsFastTextureUpload])) { free(_rawBytesForImage); _rawBytesForImage = NULL; } } #pragma mark - #pragma mark Data access - (void)renderAtInternalSize; { [GPUImageContext setActiveShaderProgram:dataProgram]; outputFramebuffer = [[GPUImageContext sharedFramebufferCache] fetchFramebufferForSize:imageSize onlyTexture:NO]; [outputFramebuffer activateFramebuffer]; if(lockNextFramebuffer) { retainedFramebuffer = outputFramebuffer; [retainedFramebuffer lock]; [retainedFramebuffer lockForReading]; lockNextFramebuffer = NO; } glClearColor(0.0f, 0.0f, 0.0f, 1.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); static const GLfloat squareVertices[] = { -1.0f, -1.0f, 1.0f, -1.0f, -1.0f, 1.0f, 1.0f, 1.0f, }; static const GLfloat textureCoordinates[] = { 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, }; glActiveTexture(GL_TEXTURE4); glBindTexture(GL_TEXTURE_2D, [firstInputFramebuffer texture]); glUniform1i(dataInputTextureUniform, 4); glVertexAttribPointer(dataPositionAttribute, 2, GL_FLOAT, 0, 0, squareVertices); glVertexAttribPointer(dataTextureCoordinateAttribute, 2, GL_FLOAT, 0, 0, textureCoordinates); glEnableVertexAttribArray(dataPositionAttribute); glEnableVertexAttribArray(dataTextureCoordinateAttribute); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); [firstInputFramebuffer unlock]; } - (GPUByteColorVector)colorAtLocation:(CGPoint)locationInImage; { GPUByteColorVector *imageColorBytes = (GPUByteColorVector *)self.rawBytesForImage; // NSLog(@"Row start"); // for (unsigned int currentXPosition = 0; currentXPosition < (imageSize.width * 2.0); currentXPosition++) // { // GPUByteColorVector byteAtPosition = imageColorBytes[currentXPosition]; // NSLog(@"%d - %d, %d, %d", currentXPosition, byteAtPosition.red, byteAtPosition.green, byteAtPosition.blue); // } // NSLog(@"Row end"); // GPUByteColorVector byteAtOne = imageColorBytes[1]; // GPUByteColorVector byteAtWidth = imageColorBytes[(int)imageSize.width - 3]; // GPUByteColorVector byteAtHeight = imageColorBytes[(int)(imageSize.height - 1) * (int)imageSize.width]; // NSLog(@"Byte 1: %d, %d, %d, byte 2: %d, %d, %d, byte 3: %d, %d, %d", byteAtOne.red, byteAtOne.green, byteAtOne.blue, byteAtWidth.red, byteAtWidth.green, byteAtWidth.blue, byteAtHeight.red, byteAtHeight.green, byteAtHeight.blue); CGPoint locationToPickFrom = CGPointZero; locationToPickFrom.x = MIN(MAX(locationInImage.x, 0.0), (imageSize.width - 1.0)); locationToPickFrom.y = MIN(MAX((imageSize.height - locationInImage.y), 0.0), (imageSize.height - 1.0)); if (outputBGRA) { GPUByteColorVector flippedColor = imageColorBytes[(int)(round((locationToPickFrom.y * imageSize.width) + locationToPickFrom.x))]; GLubyte temporaryRed = flippedColor.red; flippedColor.red = flippedColor.blue; flippedColor.blue = temporaryRed; return flippedColor; } else { return imageColorBytes[(int)(round((locationToPickFrom.y * imageSize.width) + locationToPickFrom.x))]; } } #pragma mark - #pragma mark GPUImageInput protocol - (void)newFrameReadyAtTime:(CMTime)frameTime atIndex:(NSInteger)textureIndex; { hasReadFromTheCurrentFrame = NO; if (_newFrameAvailableBlock != NULL) { _newFrameAvailableBlock(); } } - (NSInteger)nextAvailableTextureIndex; { return 0; } - (void)setInputFramebuffer:(GPUImageFramebuffer *)newInputFramebuffer atIndex:(NSInteger)textureIndex; { firstInputFramebuffer = newInputFramebuffer; [firstInputFramebuffer lock]; } - (void)setInputRotation:(GPUImageRotationMode)newInputRotation atIndex:(NSInteger)textureIndex; { inputRotation = newInputRotation; } - (void)setInputSize:(CGSize)newSize atIndex:(NSInteger)textureIndex; { } - (CGSize)maximumOutputSize; { return imageSize; } - (void)endProcessing; { } - (BOOL)shouldIgnoreUpdatesToThisTarget; { return NO; } - (BOOL)wantsMonochromeInput; { return NO; } - (void)setCurrentlyReceivingMonochromeInput:(BOOL)newValue; { } #pragma mark - #pragma mark Accessors - (GLubyte *)rawBytesForImage; { if ( (_rawBytesForImage == NULL) && (![GPUImageContext supportsFastTextureUpload]) ) { _rawBytesForImage = (GLubyte *) calloc(imageSize.width * imageSize.height * 4, sizeof(GLubyte)); hasReadFromTheCurrentFrame = NO; } if (hasReadFromTheCurrentFrame) { return _rawBytesForImage; } else { runSynchronouslyOnVideoProcessingQueue(^{ // Note: the fast texture caches speed up 640x480 frame reads from 9.6 ms to 3.1 ms on iPhone 4S [GPUImageContext useImageProcessingContext]; [self renderAtInternalSize]; if ([GPUImageContext supportsFastTextureUpload]) { glFinish(); _rawBytesForImage = [outputFramebuffer byteBuffer]; } else { glReadPixels(0, 0, imageSize.width, imageSize.height, GL_RGBA, GL_UNSIGNED_BYTE, _rawBytesForImage); // GL_EXT_read_format_bgra // glReadPixels(0, 0, imageSize.width, imageSize.height, GL_BGRA_EXT, GL_UNSIGNED_BYTE, _rawBytesForImage); } hasReadFromTheCurrentFrame = YES; }); return _rawBytesForImage; } } - (NSUInteger)bytesPerRowInOutput; { return [retainedFramebuffer bytesPerRow]; } - (void)setImageSize:(CGSize)newImageSize { imageSize = newImageSize; if (_rawBytesForImage != NULL && (![GPUImageContext supportsFastTextureUpload])) { free(_rawBytesForImage); _rawBytesForImage = NULL; } } - (void)lockFramebufferForReading; { lockNextFramebuffer = YES; } - (void)unlockFramebufferAfterReading; { [retainedFramebuffer unlockAfterReading]; [retainedFramebuffer unlock]; retainedFramebuffer = nil; } @end ================================================ FILE: framework/Source/GPUImageSaturationBlendFilter.h ================================================ #import "GPUImageTwoInputFilter.h" @interface GPUImageSaturationBlendFilter : GPUImageTwoInputFilter @end ================================================ FILE: framework/Source/GPUImageSaturationBlendFilter.m ================================================ #import "GPUImageSaturationBlendFilter.h" /** * Saturation blend mode based upon pseudo code from the PDF specification. */ #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageSaturationBlendFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; varying highp vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; highp float lum(lowp vec3 c) { return dot(c, vec3(0.3, 0.59, 0.11)); } lowp vec3 clipcolor(lowp vec3 c) { highp float l = lum(c); lowp float n = min(min(c.r, c.g), c.b); lowp float x = max(max(c.r, c.g), c.b); if (n < 0.0) { c.r = l + ((c.r - l) * l) / (l - n); c.g = l + ((c.g - l) * l) / (l - n); c.b = l + ((c.b - l) * l) / (l - n); } if (x > 1.0) { c.r = l + ((c.r - l) * (1.0 - l)) / (x - l); c.g = l + ((c.g - l) * (1.0 - l)) / (x - l); c.b = l + ((c.b - l) * (1.0 - l)) / (x - l); } return c; } lowp vec3 setlum(lowp vec3 c, highp float l) { highp float d = l - lum(c); c = c + vec3(d); return clipcolor(c); } highp float sat(lowp vec3 c) { lowp float n = min(min(c.r, c.g), c.b); lowp float x = max(max(c.r, c.g), c.b); return x - n; } lowp float mid(lowp float cmin, lowp float cmid, lowp float cmax, highp float s) { return ((cmid - cmin) * s) / (cmax - cmin); } lowp vec3 setsat(lowp vec3 c, highp float s) { if (c.r > c.g) { if (c.r > c.b) { if (c.g > c.b) { /* g is mid, b is min */ c.g = mid(c.b, c.g, c.r, s); c.b = 0.0; } else { /* b is mid, g is min */ c.b = mid(c.g, c.b, c.r, s); c.g = 0.0; } c.r = s; } else { /* b is max, r is mid, g is min */ c.r = mid(c.g, c.r, c.b, s); c.b = s; c.r = 0.0; } } else if (c.r > c.b) { /* g is max, r is mid, b is min */ c.r = mid(c.b, c.r, c.g, s); c.g = s; c.b = 0.0; } else if (c.g > c.b) { /* g is max, b is mid, r is min */ c.b = mid(c.r, c.b, c.g, s); c.g = s; c.r = 0.0; } else if (c.b > c.g) { /* b is max, g is mid, r is min */ c.g = mid(c.r, c.g, c.b, s); c.b = s; c.r = 0.0; } else { c = vec3(0.0); } return c; } void main() { highp vec4 baseColor = texture2D(inputImageTexture, textureCoordinate); highp vec4 overlayColor = texture2D(inputImageTexture2, textureCoordinate2); gl_FragColor = vec4(baseColor.rgb * (1.0 - overlayColor.a) + setlum(setsat(baseColor.rgb, sat(overlayColor.rgb)), lum(baseColor.rgb)) * overlayColor.a, baseColor.a); } ); #else NSString *const kGPUImageSaturationBlendFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; varying vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; float lum(vec3 c) { return dot(c, vec3(0.3, 0.59, 0.11)); } vec3 clipcolor(vec3 c) { float l = lum(c); float n = min(min(c.r, c.g), c.b); float x = max(max(c.r, c.g), c.b); if (n < 0.0) { c.r = l + ((c.r - l) * l) / (l - n); c.g = l + ((c.g - l) * l) / (l - n); c.b = l + ((c.b - l) * l) / (l - n); } if (x > 1.0) { c.r = l + ((c.r - l) * (1.0 - l)) / (x - l); c.g = l + ((c.g - l) * (1.0 - l)) / (x - l); c.b = l + ((c.b - l) * (1.0 - l)) / (x - l); } return c; } vec3 setlum(vec3 c, float l) { float d = l - lum(c); c = c + vec3(d); return clipcolor(c); } float sat(vec3 c) { float n = min(min(c.r, c.g), c.b); float x = max(max(c.r, c.g), c.b); return x - n; } float mid(float cmin, float cmid, float cmax, float s) { return ((cmid - cmin) * s) / (cmax - cmin); } vec3 setsat(vec3 c, float s) { if (c.r > c.g) { if (c.r > c.b) { if (c.g > c.b) { /* g is mid, b is min */ c.g = mid(c.b, c.g, c.r, s); c.b = 0.0; } else { /* b is mid, g is min */ c.b = mid(c.g, c.b, c.r, s); c.g = 0.0; } c.r = s; } else { /* b is max, r is mid, g is min */ c.r = mid(c.g, c.r, c.b, s); c.b = s; c.r = 0.0; } } else if (c.r > c.b) { /* g is max, r is mid, b is min */ c.r = mid(c.b, c.r, c.g, s); c.g = s; c.b = 0.0; } else if (c.g > c.b) { /* g is max, b is mid, r is min */ c.b = mid(c.r, c.b, c.g, s); c.g = s; c.r = 0.0; } else if (c.b > c.g) { /* b is max, g is mid, r is min */ c.g = mid(c.r, c.g, c.b, s); c.b = s; c.r = 0.0; } else { c = vec3(0.0); } return c; } void main() { vec4 baseColor = texture2D(inputImageTexture, textureCoordinate); vec4 overlayColor = texture2D(inputImageTexture2, textureCoordinate2); gl_FragColor = vec4(baseColor.rgb * (1.0 - overlayColor.a) + setlum(setsat(baseColor.rgb, sat(overlayColor.rgb)), lum(baseColor.rgb)) * overlayColor.a, baseColor.a); } ); #endif @implementation GPUImageSaturationBlendFilter - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageSaturationBlendFragmentShaderString])) { return nil; } return self; } @end ================================================ FILE: framework/Source/GPUImageSaturationFilter.h ================================================ #import "GPUImageFilter.h" /** Adjusts the saturation of an image */ @interface GPUImageSaturationFilter : GPUImageFilter { GLint saturationUniform; } /** Saturation ranges from 0.0 (fully desaturated) to 2.0 (max saturation), with 1.0 as the normal level */ @property(readwrite, nonatomic) CGFloat saturation; @end ================================================ FILE: framework/Source/GPUImageSaturationFilter.m ================================================ #import "GPUImageSaturationFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageSaturationFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform lowp float saturation; // Values from "Graphics Shaders: Theory and Practice" by Bailey and Cunningham const mediump vec3 luminanceWeighting = vec3(0.2125, 0.7154, 0.0721); void main() { lowp vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); lowp float luminance = dot(textureColor.rgb, luminanceWeighting); lowp vec3 greyScaleColor = vec3(luminance); gl_FragColor = vec4(mix(greyScaleColor, textureColor.rgb, saturation), textureColor.w); } ); #else NSString *const kGPUImageSaturationFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform float saturation; // Values from "Graphics Shaders: Theory and Practice" by Bailey and Cunningham const vec3 luminanceWeighting = vec3(0.2125, 0.7154, 0.0721); void main() { vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); float luminance = dot(textureColor.rgb, luminanceWeighting); vec3 greyScaleColor = vec3(luminance); gl_FragColor = vec4(mix(greyScaleColor, textureColor.rgb, saturation), textureColor.w); } ); #endif @implementation GPUImageSaturationFilter @synthesize saturation = _saturation; #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageSaturationFragmentShaderString])) { return nil; } saturationUniform = [filterProgram uniformIndex:@"saturation"]; self.saturation = 1.0; return self; } #pragma mark - #pragma mark Accessors - (void)setSaturation:(CGFloat)newValue; { _saturation = newValue; [self setFloat:_saturation forUniform:saturationUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImageScreenBlendFilter.h ================================================ #import "GPUImageTwoInputFilter.h" @interface GPUImageScreenBlendFilter : GPUImageTwoInputFilter { } @end ================================================ FILE: framework/Source/GPUImageScreenBlendFilter.m ================================================ #import "GPUImageScreenBlendFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageScreenBlendFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; varying highp vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; void main() { mediump vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); mediump vec4 textureColor2 = texture2D(inputImageTexture2, textureCoordinate2); mediump vec4 whiteColor = vec4(1.0); gl_FragColor = whiteColor - ((whiteColor - textureColor2) * (whiteColor - textureColor)); } ); #else NSString *const kGPUImageScreenBlendFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; varying vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; void main() { vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); vec4 textureColor2 = texture2D(inputImageTexture2, textureCoordinate2); vec4 whiteColor = vec4(1.0); gl_FragColor = whiteColor - ((whiteColor - textureColor2) * (whiteColor - textureColor)); } ); #endif @implementation GPUImageScreenBlendFilter - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageScreenBlendFragmentShaderString])) { return nil; } return self; } @end ================================================ FILE: framework/Source/GPUImageSepiaFilter.h ================================================ #import "GPUImageColorMatrixFilter.h" /// Simple sepia tone filter @interface GPUImageSepiaFilter : GPUImageColorMatrixFilter @end ================================================ FILE: framework/Source/GPUImageSepiaFilter.m ================================================ #import "GPUImageSepiaFilter.h" @implementation GPUImageSepiaFilter - (id)init; { if (!(self = [super init])) { return nil; } self.intensity = 1.0; self.colorMatrix = (GPUMatrix4x4){ {0.3588, 0.7044, 0.1368, 0.0}, {0.2990, 0.5870, 0.1140, 0.0}, {0.2392, 0.4696, 0.0912 ,0.0}, {0,0,0,1.0}, }; return self; } @end ================================================ FILE: framework/Source/GPUImageSharpenFilter.h ================================================ #import "GPUImageFilter.h" @interface GPUImageSharpenFilter : GPUImageFilter { GLint sharpnessUniform; GLint imageWidthFactorUniform, imageHeightFactorUniform; } // Sharpness ranges from -4.0 to 4.0, with 0.0 as the normal level @property(readwrite, nonatomic) CGFloat sharpness; @end ================================================ FILE: framework/Source/GPUImageSharpenFilter.m ================================================ #import "GPUImageSharpenFilter.h" NSString *const kGPUImageSharpenVertexShaderString = SHADER_STRING ( attribute vec4 position; attribute vec4 inputTextureCoordinate; uniform float imageWidthFactor; uniform float imageHeightFactor; uniform float sharpness; varying vec2 textureCoordinate; varying vec2 leftTextureCoordinate; varying vec2 rightTextureCoordinate; varying vec2 topTextureCoordinate; varying vec2 bottomTextureCoordinate; varying float centerMultiplier; varying float edgeMultiplier; void main() { gl_Position = position; vec2 widthStep = vec2(imageWidthFactor, 0.0); vec2 heightStep = vec2(0.0, imageHeightFactor); textureCoordinate = inputTextureCoordinate.xy; leftTextureCoordinate = inputTextureCoordinate.xy - widthStep; rightTextureCoordinate = inputTextureCoordinate.xy + widthStep; topTextureCoordinate = inputTextureCoordinate.xy + heightStep; bottomTextureCoordinate = inputTextureCoordinate.xy - heightStep; centerMultiplier = 1.0 + 4.0 * sharpness; edgeMultiplier = sharpness; } ); #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageSharpenFragmentShaderString = SHADER_STRING ( precision highp float; varying highp vec2 textureCoordinate; varying highp vec2 leftTextureCoordinate; varying highp vec2 rightTextureCoordinate; varying highp vec2 topTextureCoordinate; varying highp vec2 bottomTextureCoordinate; varying highp float centerMultiplier; varying highp float edgeMultiplier; uniform sampler2D inputImageTexture; void main() { mediump vec3 textureColor = texture2D(inputImageTexture, textureCoordinate).rgb; mediump vec3 leftTextureColor = texture2D(inputImageTexture, leftTextureCoordinate).rgb; mediump vec3 rightTextureColor = texture2D(inputImageTexture, rightTextureCoordinate).rgb; mediump vec3 topTextureColor = texture2D(inputImageTexture, topTextureCoordinate).rgb; mediump vec3 bottomTextureColor = texture2D(inputImageTexture, bottomTextureCoordinate).rgb; gl_FragColor = vec4((textureColor * centerMultiplier - (leftTextureColor * edgeMultiplier + rightTextureColor * edgeMultiplier + topTextureColor * edgeMultiplier + bottomTextureColor * edgeMultiplier)), texture2D(inputImageTexture, bottomTextureCoordinate).w); } ); #else NSString *const kGPUImageSharpenFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; varying vec2 leftTextureCoordinate; varying vec2 rightTextureCoordinate; varying vec2 topTextureCoordinate; varying vec2 bottomTextureCoordinate; varying float centerMultiplier; varying float edgeMultiplier; uniform sampler2D inputImageTexture; void main() { vec3 textureColor = texture2D(inputImageTexture, textureCoordinate).rgb; vec3 leftTextureColor = texture2D(inputImageTexture, leftTextureCoordinate).rgb; vec3 rightTextureColor = texture2D(inputImageTexture, rightTextureCoordinate).rgb; vec3 topTextureColor = texture2D(inputImageTexture, topTextureCoordinate).rgb; vec3 bottomTextureColor = texture2D(inputImageTexture, bottomTextureCoordinate).rgb; gl_FragColor = vec4((textureColor * centerMultiplier - (leftTextureColor * edgeMultiplier + rightTextureColor * edgeMultiplier + topTextureColor * edgeMultiplier + bottomTextureColor * edgeMultiplier)), texture2D(inputImageTexture, bottomTextureCoordinate).w); } ); #endif @implementation GPUImageSharpenFilter @synthesize sharpness = _sharpness; #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super initWithVertexShaderFromString:kGPUImageSharpenVertexShaderString fragmentShaderFromString:kGPUImageSharpenFragmentShaderString])) { return nil; } sharpnessUniform = [filterProgram uniformIndex:@"sharpness"]; self.sharpness = 0.0; imageWidthFactorUniform = [filterProgram uniformIndex:@"imageWidthFactor"]; imageHeightFactorUniform = [filterProgram uniformIndex:@"imageHeightFactor"]; return self; } - (void)setupFilterForSize:(CGSize)filterFrameSize; { runSynchronouslyOnVideoProcessingQueue(^{ [GPUImageContext setActiveShaderProgram:filterProgram]; if (GPUImageRotationSwapsWidthAndHeight(inputRotation)) { glUniform1f(imageWidthFactorUniform, 1.0 / filterFrameSize.height); glUniform1f(imageHeightFactorUniform, 1.0 / filterFrameSize.width); } else { glUniform1f(imageWidthFactorUniform, 1.0 / filterFrameSize.width); glUniform1f(imageHeightFactorUniform, 1.0 / filterFrameSize.height); } }); } #pragma mark - #pragma mark Accessors - (void)setSharpness:(CGFloat)newValue; { _sharpness = newValue; [self setFloat:_sharpness forUniform:sharpnessUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImageShiTomasiFeatureDetectionFilter.h ================================================ #import "GPUImageHarrisCornerDetectionFilter.h" /** Shi-Tomasi feature detector This is the Shi-Tomasi feature detector, as described in J. Shi and C. Tomasi. Good features to track. Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 593-600, June 1994. */ @interface GPUImageShiTomasiFeatureDetectionFilter : GPUImageHarrisCornerDetectionFilter // Compared to the Harris corner detector, the default sensitivity value for this detector is set to 1.5 @end ================================================ FILE: framework/Source/GPUImageShiTomasiFeatureDetectionFilter.m ================================================ #import "GPUImageShiTomasiFeatureDetectionFilter.h" @implementation GPUImageShiTomasiFeatureDetectionFilter #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageShiTomasiCornerDetectionFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform lowp float sensitivity; void main() { mediump vec3 derivativeElements = texture2D(inputImageTexture, textureCoordinate).rgb; mediump float derivativeDifference = derivativeElements.x - derivativeElements.y; mediump float zElement = (derivativeElements.z * 2.0) - 1.0; // R = Ix^2 + Iy^2 - sqrt( (Ix^2 - Iy^2)^2 + 4 * Ixy * Ixy) mediump float cornerness = derivativeElements.x + derivativeElements.y - sqrt(derivativeDifference * derivativeDifference + 4.0 * zElement * zElement); gl_FragColor = vec4(vec3(cornerness * sensitivity), 1.0); } ); #else NSString *const kGPUImageShiTomasiCornerDetectionFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform float sensitivity; void main() { vec3 derivativeElements = texture2D(inputImageTexture, textureCoordinate).rgb; float derivativeDifference = derivativeElements.x - derivativeElements.y; float zElement = (derivativeElements.z * 2.0) - 1.0; // R = Ix^2 + Iy^2 - sqrt( (Ix^2 - Iy^2)^2 + 4 * Ixy * Ixy) float cornerness = derivativeElements.x + derivativeElements.y - sqrt(derivativeDifference * derivativeDifference + 4.0 * zElement * zElement); gl_FragColor = vec4(vec3(cornerness * sensitivity), 1.0); } ); #endif #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [self initWithCornerDetectionFragmentShader:kGPUImageShiTomasiCornerDetectionFragmentShaderString])) { return nil; } self.sensitivity = 1.5; return self; } @end ================================================ FILE: framework/Source/GPUImageSingleComponentGaussianBlurFilter.h ================================================ #import "GPUImageGaussianBlurFilter.h" // This filter merely performs the standard Gaussian blur on the red color channel (assuming a luminance image) @interface GPUImageSingleComponentGaussianBlurFilter : GPUImageGaussianBlurFilter @end ================================================ FILE: framework/Source/GPUImageSingleComponentGaussianBlurFilter.m ================================================ #import "GPUImageSingleComponentGaussianBlurFilter.h" @implementation GPUImageSingleComponentGaussianBlurFilter + (NSString *)vertexShaderForOptimizedBlurOfRadius:(NSUInteger)blurRadius sigma:(CGFloat)sigma; { if (blurRadius < 1) { return kGPUImageVertexShaderString; } // First, generate the normal Gaussian weights for a given sigma GLfloat *standardGaussianWeights = calloc(blurRadius + 1, sizeof(GLfloat)); GLfloat sumOfWeights = 0.0; for (NSUInteger currentGaussianWeightIndex = 0; currentGaussianWeightIndex < blurRadius + 1; currentGaussianWeightIndex++) { standardGaussianWeights[currentGaussianWeightIndex] = (1.0 / sqrt(2.0 * M_PI * pow(sigma, 2.0))) * exp(-pow(currentGaussianWeightIndex, 2.0) / (2.0 * pow(sigma, 2.0))); if (currentGaussianWeightIndex == 0) { sumOfWeights += standardGaussianWeights[currentGaussianWeightIndex]; } else { sumOfWeights += 2.0 * standardGaussianWeights[currentGaussianWeightIndex]; } } // Next, normalize these weights to prevent the clipping of the Gaussian curve at the end of the discrete samples from reducing luminance for (NSUInteger currentGaussianWeightIndex = 0; currentGaussianWeightIndex < blurRadius + 1; currentGaussianWeightIndex++) { standardGaussianWeights[currentGaussianWeightIndex] = standardGaussianWeights[currentGaussianWeightIndex] / sumOfWeights; } // From these weights we calculate the offsets to read interpolated values from NSUInteger numberOfOptimizedOffsets = MIN(blurRadius / 2 + (blurRadius % 2), 7); GLfloat *optimizedGaussianOffsets = calloc(numberOfOptimizedOffsets, sizeof(GLfloat)); for (NSUInteger currentOptimizedOffset = 0; currentOptimizedOffset < numberOfOptimizedOffsets; currentOptimizedOffset++) { GLfloat firstWeight = standardGaussianWeights[currentOptimizedOffset*2 + 1]; GLfloat secondWeight = standardGaussianWeights[currentOptimizedOffset*2 + 2]; GLfloat optimizedWeight = firstWeight + secondWeight; optimizedGaussianOffsets[currentOptimizedOffset] = (firstWeight * (currentOptimizedOffset*2 + 1) + secondWeight * (currentOptimizedOffset*2 + 2)) / optimizedWeight; } NSMutableString *shaderString = [[NSMutableString alloc] init]; // Header [shaderString appendFormat:@"\ attribute vec4 position;\n\ attribute vec4 inputTextureCoordinate;\n\ \n\ uniform float texelWidthOffset;\n\ uniform float texelHeightOffset;\n\ \n\ varying vec2 blurCoordinates[%lu];\n\ \n\ void main()\n\ {\n\ gl_Position = position;\n\ \n\ vec2 singleStepOffset = vec2(texelWidthOffset, texelHeightOffset);\n", (unsigned long)(1 + (numberOfOptimizedOffsets * 2))]; // Inner offset loop [shaderString appendString:@"blurCoordinates[0] = inputTextureCoordinate.xy;\n"]; for (NSUInteger currentOptimizedOffset = 0; currentOptimizedOffset < numberOfOptimizedOffsets; currentOptimizedOffset++) { [shaderString appendFormat:@"\ blurCoordinates[%lu] = inputTextureCoordinate.xy + singleStepOffset * %f;\n\ blurCoordinates[%lu] = inputTextureCoordinate.xy - singleStepOffset * %f;\n", (unsigned long)((currentOptimizedOffset * 2) + 1), optimizedGaussianOffsets[currentOptimizedOffset], (unsigned long)((currentOptimizedOffset * 2) + 2), optimizedGaussianOffsets[currentOptimizedOffset]]; } // Footer [shaderString appendString:@"}\n"]; free(optimizedGaussianOffsets); free(standardGaussianWeights); return shaderString; } + (NSString *)fragmentShaderForOptimizedBlurOfRadius:(NSUInteger)blurRadius sigma:(CGFloat)sigma; { if (blurRadius < 1) { return kGPUImagePassthroughFragmentShaderString; } // First, generate the normal Gaussian weights for a given sigma GLfloat *standardGaussianWeights = calloc(blurRadius + 1, sizeof(GLfloat)); GLfloat sumOfWeights = 0.0; for (NSUInteger currentGaussianWeightIndex = 0; currentGaussianWeightIndex < blurRadius + 1; currentGaussianWeightIndex++) { standardGaussianWeights[currentGaussianWeightIndex] = (1.0 / sqrt(2.0 * M_PI * pow(sigma, 2.0))) * exp(-pow(currentGaussianWeightIndex, 2.0) / (2.0 * pow(sigma, 2.0))); if (currentGaussianWeightIndex == 0) { sumOfWeights += standardGaussianWeights[currentGaussianWeightIndex]; } else { sumOfWeights += 2.0 * standardGaussianWeights[currentGaussianWeightIndex]; } } // Next, normalize these weights to prevent the clipping of the Gaussian curve at the end of the discrete samples from reducing luminance for (NSUInteger currentGaussianWeightIndex = 0; currentGaussianWeightIndex < blurRadius + 1; currentGaussianWeightIndex++) { standardGaussianWeights[currentGaussianWeightIndex] = standardGaussianWeights[currentGaussianWeightIndex] / sumOfWeights; } // From these weights we calculate the offsets to read interpolated values from NSUInteger numberOfOptimizedOffsets = MIN(blurRadius / 2 + (blurRadius % 2), 7); NSUInteger trueNumberOfOptimizedOffsets = blurRadius / 2 + (blurRadius % 2); NSMutableString *shaderString = [[NSMutableString alloc] init]; // Header #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE [shaderString appendFormat:@"\ uniform sampler2D inputImageTexture;\n\ uniform highp float texelWidthOffset;\n\ uniform highp float texelHeightOffset;\n\ \n\ varying highp vec2 blurCoordinates[%lu];\n\ \n\ void main()\n\ {\n\ lowp float sum = 0.0;\n", (unsigned long)(1 + (numberOfOptimizedOffsets * 2)) ]; #else [shaderString appendFormat:@"\ uniform sampler2D inputImageTexture;\n\ uniform float texelWidthOffset;\n\ uniform float texelHeightOffset;\n\ \n\ varying vec2 blurCoordinates[%lu];\n\ \n\ void main()\n\ {\n\ float sum = 0.0;\n", 1 + (numberOfOptimizedOffsets * 2) ]; #endif // Inner texture loop [shaderString appendFormat:@"sum += texture2D(inputImageTexture, blurCoordinates[0]).r * %f;\n", standardGaussianWeights[0]]; for (NSUInteger currentBlurCoordinateIndex = 0; currentBlurCoordinateIndex < numberOfOptimizedOffsets; currentBlurCoordinateIndex++) { GLfloat firstWeight = standardGaussianWeights[currentBlurCoordinateIndex * 2 + 1]; GLfloat secondWeight = standardGaussianWeights[currentBlurCoordinateIndex * 2 + 2]; GLfloat optimizedWeight = firstWeight + secondWeight; [shaderString appendFormat:@"sum += texture2D(inputImageTexture, blurCoordinates[%lu]).r * %f;\n", (unsigned long)((currentBlurCoordinateIndex * 2) + 1), optimizedWeight]; [shaderString appendFormat:@"sum += texture2D(inputImageTexture, blurCoordinates[%lu]).r * %f;\n", (unsigned long)((currentBlurCoordinateIndex * 2) + 2), optimizedWeight]; } // If the number of required samples exceeds the amount we can pass in via varyings, we have to do dependent texture reads in the fragment shader if (trueNumberOfOptimizedOffsets > numberOfOptimizedOffsets) { #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE [shaderString appendString:@"highp vec2 singleStepOffset = vec2(texelWidthOffset, texelHeightOffset);\n"]; #else [shaderString appendString:@"highp vec2 singleStepOffset = vec2(texelWidthOffset, texelHeightOffset);\n"]; #endif for (NSUInteger currentOverlowTextureRead = numberOfOptimizedOffsets; currentOverlowTextureRead < trueNumberOfOptimizedOffsets; currentOverlowTextureRead++) { GLfloat firstWeight = standardGaussianWeights[currentOverlowTextureRead * 2 + 1]; GLfloat secondWeight = standardGaussianWeights[currentOverlowTextureRead * 2 + 2]; GLfloat optimizedWeight = firstWeight + secondWeight; GLfloat optimizedOffset = (firstWeight * (currentOverlowTextureRead * 2 + 1) + secondWeight * (currentOverlowTextureRead * 2 + 2)) / optimizedWeight; [shaderString appendFormat:@"sum += texture2D(inputImageTexture, blurCoordinates[0] + singleStepOffset * %f).r * %f;\n", optimizedOffset, optimizedWeight]; [shaderString appendFormat:@"sum += texture2D(inputImageTexture, blurCoordinates[0] - singleStepOffset * %f).r * %f;\n", optimizedOffset, optimizedWeight]; } } // Footer [shaderString appendString:@"\ gl_FragColor = vec4(sum, sum, sum, 1.0);\n\ }\n"]; free(standardGaussianWeights); return shaderString; } @end ================================================ FILE: framework/Source/GPUImageSketchFilter.h ================================================ #import "GPUImageSobelEdgeDetectionFilter.h" /** Converts video to look like a sketch. This is just the Sobel edge detection filter with the colors inverted. */ @interface GPUImageSketchFilter : GPUImageSobelEdgeDetectionFilter { } @end ================================================ FILE: framework/Source/GPUImageSketchFilter.m ================================================ #import "GPUImageSketchFilter.h" @implementation GPUImageSketchFilter // Invert the colorspace for a sketch #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageSketchFragmentShaderString = SHADER_STRING ( precision mediump float; varying vec2 textureCoordinate; varying vec2 leftTextureCoordinate; varying vec2 rightTextureCoordinate; varying vec2 topTextureCoordinate; varying vec2 topLeftTextureCoordinate; varying vec2 topRightTextureCoordinate; varying vec2 bottomTextureCoordinate; varying vec2 bottomLeftTextureCoordinate; varying vec2 bottomRightTextureCoordinate; uniform float edgeStrength; uniform sampler2D inputImageTexture; void main() { float bottomLeftIntensity = texture2D(inputImageTexture, bottomLeftTextureCoordinate).r; float topRightIntensity = texture2D(inputImageTexture, topRightTextureCoordinate).r; float topLeftIntensity = texture2D(inputImageTexture, topLeftTextureCoordinate).r; float bottomRightIntensity = texture2D(inputImageTexture, bottomRightTextureCoordinate).r; float leftIntensity = texture2D(inputImageTexture, leftTextureCoordinate).r; float rightIntensity = texture2D(inputImageTexture, rightTextureCoordinate).r; float bottomIntensity = texture2D(inputImageTexture, bottomTextureCoordinate).r; float topIntensity = texture2D(inputImageTexture, topTextureCoordinate).r; float h = -topLeftIntensity - 2.0 * topIntensity - topRightIntensity + bottomLeftIntensity + 2.0 * bottomIntensity + bottomRightIntensity; float v = -bottomLeftIntensity - 2.0 * leftIntensity - topLeftIntensity + bottomRightIntensity + 2.0 * rightIntensity + topRightIntensity; float mag = 1.0 - (length(vec2(h, v)) * edgeStrength); gl_FragColor = vec4(vec3(mag), 1.0); } ); #else NSString *const kGPUImageSketchFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; varying vec2 leftTextureCoordinate; varying vec2 rightTextureCoordinate; varying vec2 topTextureCoordinate; varying vec2 topLeftTextureCoordinate; varying vec2 topRightTextureCoordinate; varying vec2 bottomTextureCoordinate; varying vec2 bottomLeftTextureCoordinate; varying vec2 bottomRightTextureCoordinate; uniform float edgeStrength; uniform sampler2D inputImageTexture; void main() { float bottomLeftIntensity = texture2D(inputImageTexture, bottomLeftTextureCoordinate).r; float topRightIntensity = texture2D(inputImageTexture, topRightTextureCoordinate).r; float topLeftIntensity = texture2D(inputImageTexture, topLeftTextureCoordinate).r; float bottomRightIntensity = texture2D(inputImageTexture, bottomRightTextureCoordinate).r; float leftIntensity = texture2D(inputImageTexture, leftTextureCoordinate).r; float rightIntensity = texture2D(inputImageTexture, rightTextureCoordinate).r; float bottomIntensity = texture2D(inputImageTexture, bottomTextureCoordinate).r; float topIntensity = texture2D(inputImageTexture, topTextureCoordinate).r; float h = -topLeftIntensity - 2.0 * topIntensity - topRightIntensity + bottomLeftIntensity + 2.0 * bottomIntensity + bottomRightIntensity; float v = -bottomLeftIntensity - 2.0 * leftIntensity - topLeftIntensity + bottomRightIntensity + 2.0 * rightIntensity + topRightIntensity; float mag = 1.0 - (length(vec2(h, v)) * edgeStrength); gl_FragColor = vec4(vec3(mag), 1.0); } ); #endif #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [self initWithFragmentShaderFromString:kGPUImageSketchFragmentShaderString])) { return nil; } return self; } @end ================================================ FILE: framework/Source/GPUImageSkinToneFilter.h ================================================ // // GPUImageSkinToneFilter.h // // // Created by github.com/r3mus on 8/14/15. // // #import "GPUImageTwoInputFilter.h" typedef NS_ENUM(NSUInteger, GPUImageSkinToneUpperColor) { GPUImageSkinToneUpperColorGreen, GPUImageSkinToneUpperColorOrange }; extern NSString *const kGPUImageSkinToneFragmentShaderString; @interface GPUImageSkinToneFilter : GPUImageFilter { GLint skinToneAdjustUniform; GLint skinHueUniform; GLint skinHueThresholdUniform; GLint maxHueShiftUniform; GLint maxSaturationShiftUniform; GLint upperSkinToneColorUniform; } // The amount of effect to apply, between -1.0 (pink) and +1.0 (orange OR green). Default is 0.0. @property (nonatomic, readwrite) CGFloat skinToneAdjust; // The initial hue of skin to adjust. Default is 0.05 (a common skin red). @property (nonatomic, readwrite) CGFloat skinHue; // The bell curve "breadth" of the skin hue adjustment (i.e. how different from the original skinHue will the modifications effect). // Default is 40.0 @property (nonatomic, readwrite) CGFloat skinHueThreshold; // The maximum amount of hue shift allowed in the adjustments that affect hue (pink, green). Default = 0.25. @property (nonatomic, readwrite) CGFloat maxHueShift; // The maximum amount of saturation shift allowed in the adjustments that affect saturation (orange). Default = 0.4. @property (nonatomic, readwrite) CGFloat maxSaturationShift; // Defines whether the upper range (> 0.0) will change the skin tone to green (hue) or orange (saturation) @property (nonatomic, readwrite) GPUImageSkinToneUpperColor upperSkinToneColor; @end ================================================ FILE: framework/Source/GPUImageSkinToneFilter.m ================================================ // // GPUImageSkinToneFilter.m // // // Created by github.com/r3mus on 8/13/15. // // #import "GPUImageSkinToneFilter.h" @implementation GPUImageSkinToneFilter #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageSkinToneFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; // [-1;1] <=> [pink;orange] uniform highp float skinToneAdjust; // will make reds more pink // Other parameters uniform mediump float skinHue; uniform mediump float skinHueThreshold; uniform mediump float maxHueShift; uniform mediump float maxSaturationShift; uniform int upperSkinToneColor; // RGB <-> HSV conversion, thanks to http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl highp vec3 rgb2hsv(highp vec3 c) { highp vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); highp vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g)); highp vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r)); highp float d = q.x - min(q.w, q.y); highp float e = 1.0e-10; return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x); } // HSV <-> RGB conversion, thanks to http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl highp vec3 hsv2rgb(highp vec3 c) { highp vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); highp vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www); return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y); } // Main void main () { // Sample the input pixel highp vec4 colorRGB = texture2D(inputImageTexture, textureCoordinate); // Convert color to HSV, extract hue highp vec3 colorHSV = rgb2hsv(colorRGB.rgb); highp float hue = colorHSV.x; // check how far from skin hue highp float dist = hue - skinHue; if (dist > 0.5) dist -= 1.0; if (dist < -0.5) dist += 1.0; dist = abs(dist)/0.5; // normalized to [0,1] // Apply Gaussian like filter highp float weight = exp(-dist*dist*skinHueThreshold); weight = clamp(weight, 0.0, 1.0); // Using pink/green, so only adjust hue if (upperSkinToneColor == 0) { colorHSV.x += skinToneAdjust * weight * maxHueShift; // Using pink/orange, so adjust hue < 0 and saturation > 0 } else if (upperSkinToneColor == 1) { // We want more orange, so increase saturation if (skinToneAdjust > 0.0) colorHSV.y += skinToneAdjust * weight * maxSaturationShift; // we want more pinks, so decrease hue else colorHSV.x += skinToneAdjust * weight * maxHueShift; } // final color highp vec3 finalColorRGB = hsv2rgb(colorHSV.rgb); // display gl_FragColor = vec4(finalColorRGB, 1.0); } ); #else NSString *const kGPUImageSkinToneFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; // [-1;1] <=> [pink;orange] uniform float skinToneAdjust; // will make reds more pink // Other parameters uniform float skinHue; uniform float skinHueThreshold; uniform float maxHueShift; uniform float maxSaturationShift; uniform int upperSkinToneColor; // RGB <-> HSV conversion, thanks to http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl highp vec3 rgb2hsv(highp vec3 c) { vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g)); vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r)); float d = q.x - min(q.w, q.y); float e = 1.0e-10; return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x); } // HSV <-> RGB conversion, thanks to http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl highp vec3 hsv2rgb(highp vec3 c) { vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www); return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y); } // Main void main () { // Sample the input pixel vec4 colorRGB = texture2D(inputImageTexture, textureCoordinate); // Convert color to HSV, extract hue vec3 colorHSV = rgb2hsv(colorRGB.rgb); float hue = colorHSV.x; // check how far from skin hue float dist = hue - skinHue; if (dist > 0.5) dist -= 1.0; if (dist < -0.5) dist += 1.0; dist = abs(dist)/0.5; // normalized to [0,1] // Apply Gaussian like filter float weight = exp(-dist*dist*skinHueThreshold); weight = clamp(weight, 0.0, 1.0); // Using pink/green, so only adjust hue if (upperSkinToneColor == 0) { colorHSV.x += skinToneAdjust * weight * maxHueShift; // Using pink/orange, so adjust hue < 0 and saturation > 0 } else if (upperSkinToneColor == 1) { // We want more orange, so increase saturation if (skinToneAdjust > 0.0) colorHSV.y += skinToneAdjust * weight * maxSaturationShift; // we want more pinks, so decrease hue else colorHSV.x += skinToneAdjust * weight * maxHueShift; } // final color vec3 finalColorRGB = hsv2rgb(colorHSV.rgb); // display gl_FragColor = vec4(finalColorRGB, 1.0); } ); #endif #pragma mark - #pragma mark Initialization and teardown @synthesize skinToneAdjust; @synthesize skinHue; @synthesize skinHueThreshold; @synthesize maxHueShift; @synthesize maxSaturationShift; @synthesize upperSkinToneColor; - (id)init { if(! (self = [super initWithFragmentShaderFromString:kGPUImageSkinToneFragmentShaderString]) ) { return nil; } skinToneAdjustUniform = [filterProgram uniformIndex:@"skinToneAdjust"]; skinHueUniform = [filterProgram uniformIndex:@"skinHue"]; skinHueThresholdUniform = [filterProgram uniformIndex:@"skinHueThreshold"]; maxHueShiftUniform = [filterProgram uniformIndex:@"maxHueShift"]; maxSaturationShiftUniform = [filterProgram uniformIndex:@"maxSaturationShift"]; upperSkinToneColorUniform = [filterProgram uniformIndex:@"upperSkinToneColor"]; self.skinHue = 0.05; self.skinHueThreshold = 40.0; self.maxHueShift = 0.25; self.maxSaturationShift = 0.4; self.upperSkinToneColor = GPUImageSkinToneUpperColorGreen; return self; } #pragma mark - #pragma mark Accessors - (void)setSkinToneAdjust:(CGFloat)newValue { skinToneAdjust = newValue; [self setFloat:newValue forUniform:skinToneAdjustUniform program:filterProgram]; } - (void)setSkinHue:(CGFloat)newValue { skinHue = newValue; [self setFloat:newValue forUniform:skinHueUniform program:filterProgram]; } - (void)setSkinHueThreshold:(CGFloat)newValue { skinHueThreshold = newValue; [self setFloat:newValue forUniform:skinHueThresholdUniform program:filterProgram]; } - (void)setMaxHueShift:(CGFloat)newValue { maxHueShift = newValue; [self setFloat:newValue forUniform:maxHueShiftUniform program:filterProgram]; } - (void)setMaxSaturationShift:(CGFloat)newValue { maxSaturationShift = newValue; [self setFloat:newValue forUniform:maxSaturationShiftUniform program:filterProgram]; } - (void)setUpperSkinToneColor:(GPUImageSkinToneUpperColor)newValue { upperSkinToneColor = newValue; [self setInteger:newValue forUniform:upperSkinToneColorUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImageSmoothToonFilter.h ================================================ #import "GPUImageFilterGroup.h" @class GPUImageGaussianBlurFilter; @class GPUImageToonFilter; /** This uses a similar process as the GPUImageToonFilter, only it precedes the toon effect with a Gaussian blur to smooth out noise. */ @interface GPUImageSmoothToonFilter : GPUImageFilterGroup { GPUImageGaussianBlurFilter *blurFilter; GPUImageToonFilter *toonFilter; } /// The image width and height factors tweak the appearance of the edges. By default, they match the filter size in pixels @property(readwrite, nonatomic) CGFloat texelWidth; /// The image width and height factors tweak the appearance of the edges. By default, they match the filter size in pixels @property(readwrite, nonatomic) CGFloat texelHeight; /// The radius of the underlying Gaussian blur. The default is 2.0. @property (readwrite, nonatomic) CGFloat blurRadiusInPixels; /// The threshold at which to apply the edges, default of 0.2 @property(readwrite, nonatomic) CGFloat threshold; /// The levels of quantization for the posterization of colors within the scene, with a default of 10.0 @property(readwrite, nonatomic) CGFloat quantizationLevels; @end ================================================ FILE: framework/Source/GPUImageSmoothToonFilter.m ================================================ #import "GPUImageSmoothToonFilter.h" #import "GPUImageGaussianBlurFilter.h" #import "GPUImageToonFilter.h" @implementation GPUImageSmoothToonFilter @synthesize threshold; @synthesize blurRadiusInPixels; @synthesize quantizationLevels; @synthesize texelWidth; @synthesize texelHeight; - (id)init; { if (!(self = [super init])) { return nil; } // First pass: apply a variable Gaussian blur blurFilter = [[GPUImageGaussianBlurFilter alloc] init]; [self addFilter:blurFilter]; // Second pass: run the Sobel edge detection on this blurred image, along with a posterization effect toonFilter = [[GPUImageToonFilter alloc] init]; [self addFilter:toonFilter]; // Texture location 0 needs to be the sharp image for both the blur and the second stage processing [blurFilter addTarget:toonFilter]; self.initialFilters = [NSArray arrayWithObject:blurFilter]; self.terminalFilter = toonFilter; self.blurRadiusInPixels = 2.0; self.threshold = 0.2; self.quantizationLevels = 10.0; return self; } #pragma mark - #pragma mark Accessors - (void)setBlurRadiusInPixels:(CGFloat)newValue; { blurFilter.blurRadiusInPixels = newValue; } - (CGFloat)blurRadiusInPixels; { return blurFilter.blurRadiusInPixels; } - (void)setTexelWidth:(CGFloat)newValue; { toonFilter.texelWidth = newValue; } - (CGFloat)texelWidth; { return toonFilter.texelWidth; } - (void)setTexelHeight:(CGFloat)newValue; { toonFilter.texelHeight = newValue; } - (CGFloat)texelHeight; { return toonFilter.texelHeight; } - (void)setThreshold:(CGFloat)newValue; { toonFilter.threshold = newValue; } - (CGFloat)threshold; { return toonFilter.threshold; } - (void)setQuantizationLevels:(CGFloat)newValue; { toonFilter.quantizationLevels = newValue; } - (CGFloat)quantizationLevels; { return toonFilter.quantizationLevels; } @end ================================================ FILE: framework/Source/GPUImageSobelEdgeDetectionFilter.h ================================================ #import "GPUImageTwoPassFilter.h" @interface GPUImageSobelEdgeDetectionFilter : GPUImageTwoPassFilter { GLint texelWidthUniform, texelHeightUniform, edgeStrengthUniform; BOOL hasOverriddenImageSizeFactor; } // The texel width and height factors tweak the appearance of the edges. By default, they match the inverse of the filter size in pixels @property(readwrite, nonatomic) CGFloat texelWidth; @property(readwrite, nonatomic) CGFloat texelHeight; // The filter strength property affects the dynamic range of the filter. High values can make edges more visible, but can lead to saturation. Default of 1.0. @property(readwrite, nonatomic) CGFloat edgeStrength; @end ================================================ FILE: framework/Source/GPUImageSobelEdgeDetectionFilter.m ================================================ #import "GPUImageSobelEdgeDetectionFilter.h" #import "GPUImageGrayscaleFilter.h" #import "GPUImage3x3ConvolutionFilter.h" // Code from "Graphics Shaders: Theory and Practice" by M. Bailey and S. Cunningham #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageSobelEdgeDetectionFragmentShaderString = SHADER_STRING ( precision mediump float; varying vec2 textureCoordinate; varying vec2 leftTextureCoordinate; varying vec2 rightTextureCoordinate; varying vec2 topTextureCoordinate; varying vec2 topLeftTextureCoordinate; varying vec2 topRightTextureCoordinate; varying vec2 bottomTextureCoordinate; varying vec2 bottomLeftTextureCoordinate; varying vec2 bottomRightTextureCoordinate; uniform sampler2D inputImageTexture; uniform float edgeStrength; void main() { float bottomLeftIntensity = texture2D(inputImageTexture, bottomLeftTextureCoordinate).r; float topRightIntensity = texture2D(inputImageTexture, topRightTextureCoordinate).r; float topLeftIntensity = texture2D(inputImageTexture, topLeftTextureCoordinate).r; float bottomRightIntensity = texture2D(inputImageTexture, bottomRightTextureCoordinate).r; float leftIntensity = texture2D(inputImageTexture, leftTextureCoordinate).r; float rightIntensity = texture2D(inputImageTexture, rightTextureCoordinate).r; float bottomIntensity = texture2D(inputImageTexture, bottomTextureCoordinate).r; float topIntensity = texture2D(inputImageTexture, topTextureCoordinate).r; float h = -topLeftIntensity - 2.0 * topIntensity - topRightIntensity + bottomLeftIntensity + 2.0 * bottomIntensity + bottomRightIntensity; float v = -bottomLeftIntensity - 2.0 * leftIntensity - topLeftIntensity + bottomRightIntensity + 2.0 * rightIntensity + topRightIntensity; float mag = length(vec2(h, v)) * edgeStrength; gl_FragColor = vec4(vec3(mag), 1.0); } ); #else NSString *const kGPUImageSobelEdgeDetectionFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; varying vec2 leftTextureCoordinate; varying vec2 rightTextureCoordinate; varying vec2 topTextureCoordinate; varying vec2 topLeftTextureCoordinate; varying vec2 topRightTextureCoordinate; varying vec2 bottomTextureCoordinate; varying vec2 bottomLeftTextureCoordinate; varying vec2 bottomRightTextureCoordinate; uniform sampler2D inputImageTexture; uniform float edgeStrength; void main() { float bottomLeftIntensity = texture2D(inputImageTexture, bottomLeftTextureCoordinate).r; float topRightIntensity = texture2D(inputImageTexture, topRightTextureCoordinate).r; float topLeftIntensity = texture2D(inputImageTexture, topLeftTextureCoordinate).r; float bottomRightIntensity = texture2D(inputImageTexture, bottomRightTextureCoordinate).r; float leftIntensity = texture2D(inputImageTexture, leftTextureCoordinate).r; float rightIntensity = texture2D(inputImageTexture, rightTextureCoordinate).r; float bottomIntensity = texture2D(inputImageTexture, bottomTextureCoordinate).r; float topIntensity = texture2D(inputImageTexture, topTextureCoordinate).r; float h = -topLeftIntensity - 2.0 * topIntensity - topRightIntensity + bottomLeftIntensity + 2.0 * bottomIntensity + bottomRightIntensity; float v = -bottomLeftIntensity - 2.0 * leftIntensity - topLeftIntensity + bottomRightIntensity + 2.0 * rightIntensity + topRightIntensity; float mag = length(vec2(h, v)) * edgeStrength; gl_FragColor = vec4(vec3(mag), 1.0); } ); #endif @implementation GPUImageSobelEdgeDetectionFilter @synthesize texelWidth = _texelWidth; @synthesize texelHeight = _texelHeight; @synthesize edgeStrength = _edgeStrength; #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [self initWithFragmentShaderFromString:kGPUImageSobelEdgeDetectionFragmentShaderString])) { return nil; } return self; } - (id)initWithFragmentShaderFromString:(NSString *)fragmentShaderString; { // Do a luminance pass first to reduce the calculations performed at each fragment in the edge detection phase if (!(self = [super initWithFirstStageVertexShaderFromString:kGPUImageVertexShaderString firstStageFragmentShaderFromString:kGPUImageLuminanceFragmentShaderString secondStageVertexShaderFromString:kGPUImageNearbyTexelSamplingVertexShaderString secondStageFragmentShaderFromString:fragmentShaderString])) { return nil; } hasOverriddenImageSizeFactor = NO; texelWidthUniform = [secondFilterProgram uniformIndex:@"texelWidth"]; texelHeightUniform = [secondFilterProgram uniformIndex:@"texelHeight"]; edgeStrengthUniform = [secondFilterProgram uniformIndex:@"edgeStrength"]; self.edgeStrength = 1.0; return self; } - (void)setupFilterForSize:(CGSize)filterFrameSize; { if (!hasOverriddenImageSizeFactor) { _texelWidth = 1.0 / filterFrameSize.width; _texelHeight = 1.0 / filterFrameSize.height; runSynchronouslyOnVideoProcessingQueue(^{ GLProgram *previousProgram = [GPUImageContext sharedImageProcessingContext].currentShaderProgram; [GPUImageContext setActiveShaderProgram:secondFilterProgram]; glUniform1f(texelWidthUniform, _texelWidth); glUniform1f(texelHeightUniform, _texelHeight); [GPUImageContext setActiveShaderProgram:previousProgram]; }); } } - (void)setUniformsForProgramAtIndex:(NSUInteger)programIndex; { [super setUniformsForProgramAtIndex:programIndex]; if (programIndex == 1) { glUniform1f(texelWidthUniform, _texelWidth); glUniform1f(texelHeightUniform, _texelHeight); } } - (BOOL)wantsMonochromeInput; { // return YES; return NO; } - (BOOL)providesMonochromeOutput; { // return YES; return NO; } #pragma mark - #pragma mark Accessors - (void)setTexelWidth:(CGFloat)newValue; { hasOverriddenImageSizeFactor = YES; _texelWidth = newValue; [self setFloat:_texelWidth forUniform:texelWidthUniform program:secondFilterProgram]; } - (void)setTexelHeight:(CGFloat)newValue; { hasOverriddenImageSizeFactor = YES; _texelHeight = newValue; [self setFloat:_texelHeight forUniform:texelHeightUniform program:secondFilterProgram]; } - (void)setEdgeStrength:(CGFloat)newValue; { _edgeStrength = newValue; [self setFloat:_edgeStrength forUniform:edgeStrengthUniform program:secondFilterProgram]; } @end ================================================ FILE: framework/Source/GPUImageSoftEleganceFilter.h ================================================ #import "GPUImageFilterGroup.h" @class GPUImagePicture; /** A photo filter based on Soft Elegance Photoshop action http://h-d-stock.deviantart.com/art/H-D-A-soft-elegance-70107603 */ // Note: If you want to use this effect you have to add // lookup_soft_elegance_1.png and lookup_soft_elegance_2.png // from Resources folder to your application bundle. @interface GPUImageSoftEleganceFilter : GPUImageFilterGroup { GPUImagePicture *lookupImageSource1; GPUImagePicture *lookupImageSource2; } @end ================================================ FILE: framework/Source/GPUImageSoftEleganceFilter.m ================================================ #import "GPUImageSoftEleganceFilter.h" #import "GPUImagePicture.h" #import "GPUImageLookupFilter.h" #import "GPUImageGaussianBlurFilter.h" #import "GPUImageAlphaBlendFilter.h" @implementation GPUImageSoftEleganceFilter - (id)init; { if (!(self = [super init])) { return nil; } #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE UIImage *image1 = [UIImage imageNamed:@"lookup_soft_elegance_1.png"]; UIImage *image2 = [UIImage imageNamed:@"lookup_soft_elegance_2.png"]; #else NSImage *image1 = [NSImage imageNamed:@"lookup_soft_elegance_1.png"]; NSImage *image2 = [NSImage imageNamed:@"lookup_soft_elegance_2.png"]; #endif NSAssert(image1 && image2, @"To use GPUImageSoftEleganceFilter you need to add lookup_soft_elegance_1.png and lookup_soft_elegance_2.png from GPUImage/framework/Resources to your application bundle."); lookupImageSource1 = [[GPUImagePicture alloc] initWithImage:image1]; GPUImageLookupFilter *lookupFilter1 = [[GPUImageLookupFilter alloc] init]; [self addFilter:lookupFilter1]; [lookupImageSource1 addTarget:lookupFilter1 atTextureLocation:1]; [lookupImageSource1 processImage]; GPUImageGaussianBlurFilter *gaussianBlur = [[GPUImageGaussianBlurFilter alloc] init]; gaussianBlur.blurRadiusInPixels = 10.0; [lookupFilter1 addTarget:gaussianBlur]; [self addFilter:gaussianBlur]; GPUImageAlphaBlendFilter *alphaBlend = [[GPUImageAlphaBlendFilter alloc] init]; alphaBlend.mix = 0.14; [lookupFilter1 addTarget:alphaBlend]; [gaussianBlur addTarget:alphaBlend]; [self addFilter:alphaBlend]; lookupImageSource2 = [[GPUImagePicture alloc] initWithImage:image2]; GPUImageLookupFilter *lookupFilter2 = [[GPUImageLookupFilter alloc] init]; [alphaBlend addTarget:lookupFilter2]; [lookupImageSource2 addTarget:lookupFilter2]; [lookupImageSource2 processImage]; [self addFilter:lookupFilter2]; self.initialFilters = [NSArray arrayWithObjects:lookupFilter1, nil]; self.terminalFilter = lookupFilter2; return self; } #pragma mark - #pragma mark Accessors @end ================================================ FILE: framework/Source/GPUImageSoftLightBlendFilter.h ================================================ #import "GPUImageTwoInputFilter.h" @interface GPUImageSoftLightBlendFilter : GPUImageTwoInputFilter { } @end ================================================ FILE: framework/Source/GPUImageSoftLightBlendFilter.m ================================================ #import "GPUImageSoftLightBlendFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageSoftLightBlendFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; varying highp vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; void main() { mediump vec4 base = texture2D(inputImageTexture, textureCoordinate); mediump vec4 overlay = texture2D(inputImageTexture2, textureCoordinate2); lowp float alphaDivisor = base.a + step(base.a, 0.0); // Protect against a divide-by-zero blacking out things in the output gl_FragColor = base * (overlay.a * (base / alphaDivisor) + (2.0 * overlay * (1.0 - (base / alphaDivisor)))) + overlay * (1.0 - base.a) + base * (1.0 - overlay.a); } ); #else NSString *const kGPUImageSoftLightBlendFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; varying vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; void main() { vec4 base = texture2D(inputImageTexture, textureCoordinate); vec4 overlay = texture2D(inputImageTexture2, textureCoordinate2); float alphaDivisor = base.a + step(base.a, 0.0); // Protect against a divide-by-zero blacking out things in the output gl_FragColor = base * (overlay.a * (base / alphaDivisor) + (2.0 * overlay * (1.0 - (base / alphaDivisor)))) + overlay * (1.0 - base.a) + base * (1.0 - overlay.a); } ); #endif @implementation GPUImageSoftLightBlendFilter - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageSoftLightBlendFragmentShaderString])) { return nil; } return self; } @end ================================================ FILE: framework/Source/GPUImageSolarizeFilter.h ================================================ #import "GPUImageFilter.h" /** Pixels with a luminance above the threshold will invert their color */ @interface GPUImageSolarizeFilter : GPUImageFilter { GLint thresholdUniform; } /** Anything above this luminance will be inverted, and anything below normal. Ranges from 0.0 to 1.0, with 0.5 as the default */ @property(readwrite, nonatomic) CGFloat threshold; @end ================================================ FILE: framework/Source/GPUImageSolarizeFilter.m ================================================ #import "GPUImageSolarizeFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageSolarizeFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform highp float threshold; const highp vec3 W = vec3(0.2125, 0.7154, 0.0721); void main() { highp vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); highp float luminance = dot(textureColor.rgb, W); highp float thresholdResult = step(luminance, threshold); highp vec3 finalColor = abs(thresholdResult - textureColor.rgb); gl_FragColor = vec4(finalColor, textureColor.w); } ); #else NSString *const kGPUImageSolarizeFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform float threshold; const vec3 W = vec3(0.2125, 0.7154, 0.0721); void main() { vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); float luminance = dot(textureColor.rgb, W); float thresholdResult = step(luminance, threshold); vec3 finalColor = abs(thresholdResult - textureColor.rgb); gl_FragColor = vec4(vec3(finalColor), textureColor.w); } ); #endif @implementation GPUImageSolarizeFilter; @synthesize threshold = _threshold; #pragma mark - #pragma mark Initialization - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageSolarizeFragmentShaderString])) { return nil; } thresholdUniform = [filterProgram uniformIndex:@"threshold"]; self.threshold = 0.5; return self; } #pragma mark - #pragma mark Accessors - (void)setThreshold:(CGFloat)newValue; { _threshold = newValue; [self setFloat:_threshold forUniform:thresholdUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImageSolidColorGenerator.h ================================================ #import "GPUImageFilter.h" // This outputs an image with a constant color. You need to use -forceProcessingAtSize: in order to set the output image // dimensions, or this won't work correctly @interface GPUImageSolidColorGenerator : GPUImageFilter { GLint colorUniform; GLint useExistingAlphaUniform; } // This color dictates what the output image will be filled with @property(readwrite, nonatomic) GPUVector4 color; @property(readwrite, nonatomic, assign) BOOL useExistingAlpha; // whether to use the alpha of the existing image or not, default is NO - (void)setColorRed:(CGFloat)redComponent green:(CGFloat)greenComponent blue:(CGFloat)blueComponent alpha:(CGFloat)alphaComponent; @end ================================================ FILE: framework/Source/GPUImageSolidColorGenerator.m ================================================ #import "GPUImageSolidColorGenerator.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUSolidColorFragmentShaderString = SHADER_STRING ( precision lowp float; varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform vec4 color; uniform float useExistingAlpha; void main() { lowp vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); gl_FragColor = vec4(color.rgb, max(textureColor.a, 1.0 - useExistingAlpha)); } ); #else NSString *const kGPUSolidColorFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform vec4 color; uniform float useExistingAlpha; void main() { vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); gl_FragColor = vec4(color.rgb, max(textureColor.a, 1.0 - useExistingAlpha)); } ); #endif @implementation GPUImageSolidColorGenerator @synthesize color = _color; - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUSolidColorFragmentShaderString])) { return nil; } colorUniform = [filterProgram uniformIndex:@"color"]; useExistingAlphaUniform = [filterProgram uniformIndex:@"useExistingAlpha"]; _color = (GPUVector4){0.0f, 0.0f, 0.5f, 1.0f}; self.useExistingAlpha = NO; return self; } - (void)renderToTextureWithVertices:(const GLfloat *)vertices textureCoordinates:(const GLfloat *)textureCoordinates; { if (self.preventRendering) { return; } runSynchronouslyOnVideoProcessingQueue(^{ [GPUImageContext setActiveShaderProgram:filterProgram]; outputFramebuffer = [[GPUImageContext sharedFramebufferCache] fetchFramebufferForSize:[self sizeOfFBO] textureOptions:self.outputTextureOptions onlyTexture:NO]; [outputFramebuffer activateFramebuffer]; glClearColor(_color.one, _color.two, _color.three, _color.four); glClear(GL_COLOR_BUFFER_BIT); }); } #pragma mark - #pragma mark Accessors - (void)forceProcessingAtSize:(CGSize)frameSize; { [super forceProcessingAtSize:frameSize]; if (!CGSizeEqualToSize(inputTextureSize, CGSizeZero)) { [self newFrameReadyAtTime:kCMTimeIndefinite atIndex:0]; } } - (void)addTarget:(id)newTarget atTextureLocation:(NSInteger)textureLocation; { [super addTarget:newTarget atTextureLocation:textureLocation]; if (!CGSizeEqualToSize(inputTextureSize, CGSizeZero)) { [newTarget setInputSize:inputTextureSize atIndex:textureLocation]; [newTarget newFrameReadyAtTime:kCMTimeIndefinite atIndex:textureLocation]; } } - (void)setColor:(GPUVector4)newValue; { [self setColorRed:newValue.one green:newValue.two blue:newValue.three alpha:newValue.four]; } - (void)setColorRed:(CGFloat)redComponent green:(CGFloat)greenComponent blue:(CGFloat)blueComponent alpha:(CGFloat)alphaComponent; { _color.one = (GLfloat)redComponent; _color.two = (GLfloat)greenComponent; _color.three = (GLfloat)blueComponent; _color.four = (GLfloat)alphaComponent; // [self setVec4:_color forUniform:colorUniform program:filterProgram]; runAsynchronouslyOnVideoProcessingQueue(^{ [self newFrameReadyAtTime:kCMTimeIndefinite atIndex:0]; }); } - (void)setUseExistingAlpha:(BOOL)useExistingAlpha; { _useExistingAlpha = useExistingAlpha; [self setInteger:(useExistingAlpha ? 1 : 0) forUniform:useExistingAlphaUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImageSourceOverBlendFilter.h ================================================ #import "GPUImageTwoInputFilter.h" @interface GPUImageSourceOverBlendFilter : GPUImageTwoInputFilter @end ================================================ FILE: framework/Source/GPUImageSourceOverBlendFilter.m ================================================ #import "GPUImageSourceOverBlendFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageSourceOverBlendFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; varying highp vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; void main() { lowp vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); lowp vec4 textureColor2 = texture2D(inputImageTexture2, textureCoordinate); gl_FragColor = mix(textureColor, textureColor2, textureColor2.a); } ); #else NSString *const kGPUImageSourceOverBlendFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; varying vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; void main() { vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); vec4 textureColor2 = texture2D(inputImageTexture2, textureCoordinate); gl_FragColor = mix(textureColor, textureColor2, textureColor2.a); } ); #endif @implementation GPUImageSourceOverBlendFilter - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageSourceOverBlendFragmentShaderString])) { return nil; } return self; } @end ================================================ FILE: framework/Source/GPUImageSphereRefractionFilter.h ================================================ #import "GPUImageFilter.h" @interface GPUImageSphereRefractionFilter : GPUImageFilter { GLint radiusUniform, centerUniform, aspectRatioUniform, refractiveIndexUniform; } /// The center about which to apply the distortion, with a default of (0.5, 0.5) @property(readwrite, nonatomic) CGPoint center; /// The radius of the distortion, ranging from 0.0 to 1.0, with a default of 0.25 @property(readwrite, nonatomic) CGFloat radius; /// The index of refraction for the sphere, with a default of 0.71 @property(readwrite, nonatomic) CGFloat refractiveIndex; @end ================================================ FILE: framework/Source/GPUImageSphereRefractionFilter.m ================================================ #import "GPUImageSphereRefractionFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageSphereRefractionFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform highp vec2 center; uniform highp float radius; uniform highp float aspectRatio; uniform highp float refractiveIndex; void main() { highp vec2 textureCoordinateToUse = vec2(textureCoordinate.x, (textureCoordinate.y * aspectRatio + 0.5 - 0.5 * aspectRatio)); highp float distanceFromCenter = distance(center, textureCoordinateToUse); lowp float checkForPresenceWithinSphere = step(distanceFromCenter, radius); distanceFromCenter = distanceFromCenter / radius; highp float normalizedDepth = radius * sqrt(1.0 - distanceFromCenter * distanceFromCenter); highp vec3 sphereNormal = normalize(vec3(textureCoordinateToUse - center, normalizedDepth)); highp vec3 refractedVector = refract(vec3(0.0, 0.0, -1.0), sphereNormal, refractiveIndex); gl_FragColor = texture2D(inputImageTexture, (refractedVector.xy + 1.0) * 0.5) * checkForPresenceWithinSphere; } ); #else NSString *const kGPUImageSphereRefractionFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform vec2 center; uniform float radius; uniform float aspectRatio; uniform float refractiveIndex; void main() { vec2 textureCoordinateToUse = vec2(textureCoordinate.x, (textureCoordinate.y * aspectRatio + 0.5 - 0.5 * aspectRatio)); float distanceFromCenter = distance(center, textureCoordinateToUse); float checkForPresenceWithinSphere = step(distanceFromCenter, radius); distanceFromCenter = distanceFromCenter / radius; float normalizedDepth = radius * sqrt(1.0 - distanceFromCenter * distanceFromCenter); vec3 sphereNormal = normalize(vec3(textureCoordinateToUse - center, normalizedDepth)); vec3 refractedVector = refract(vec3(0.0, 0.0, -1.0), sphereNormal, refractiveIndex); gl_FragColor = texture2D(inputImageTexture, (refractedVector.xy + 1.0) * 0.5) * checkForPresenceWithinSphere; } ); #endif @interface GPUImageSphereRefractionFilter () - (void)adjustAspectRatio; @property (readwrite, nonatomic) CGFloat aspectRatio; @end @implementation GPUImageSphereRefractionFilter @synthesize center = _center; @synthesize radius = _radius; @synthesize aspectRatio = _aspectRatio; @synthesize refractiveIndex = _refractiveIndex; #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [self initWithFragmentShaderFromString:kGPUImageSphereRefractionFragmentShaderString])) { return nil; } return self; } - (id)initWithFragmentShaderFromString:(NSString *)fragmentShaderString; { if (!(self = [super initWithFragmentShaderFromString:fragmentShaderString])) { return nil; } radiusUniform = [filterProgram uniformIndex:@"radius"]; aspectRatioUniform = [filterProgram uniformIndex:@"aspectRatio"]; centerUniform = [filterProgram uniformIndex:@"center"]; refractiveIndexUniform = [filterProgram uniformIndex:@"refractiveIndex"]; self.radius = 0.25; self.center = CGPointMake(0.5, 0.5); self.refractiveIndex = 0.71; [self setBackgroundColorRed:0.0 green:0.0 blue:0.0 alpha:0.0]; return self; } - (void)setInputSize:(CGSize)newSize atIndex:(NSInteger)textureIndex; { CGSize oldInputSize = inputTextureSize; [super setInputSize:newSize atIndex:textureIndex]; if (!CGSizeEqualToSize(oldInputSize, inputTextureSize) && (!CGSizeEqualToSize(newSize, CGSizeZero)) ) { [self adjustAspectRatio]; } } #pragma mark - #pragma mark Accessors - (void)adjustAspectRatio; { if (GPUImageRotationSwapsWidthAndHeight(inputRotation)) { [self setAspectRatio:(inputTextureSize.width / inputTextureSize.height)]; } else { [self setAspectRatio:(inputTextureSize.height / inputTextureSize.width)]; } } - (void)setInputRotation:(GPUImageRotationMode)newInputRotation atIndex:(NSInteger)textureIndex; { [super setInputRotation:newInputRotation atIndex:textureIndex]; [self setCenter:self.center]; [self adjustAspectRatio]; } - (void)forceProcessingAtSize:(CGSize)frameSize; { [super forceProcessingAtSize:frameSize]; [self adjustAspectRatio]; } - (void)setRadius:(CGFloat)newValue; { _radius = newValue; [self setFloat:_radius forUniform:radiusUniform program:filterProgram]; } - (void)setCenter:(CGPoint)newValue; { _center = newValue; CGPoint rotatedPoint = [self rotatedPoint:_center forRotation:inputRotation]; [self setPoint:rotatedPoint forUniform:centerUniform program:filterProgram]; } - (void)setAspectRatio:(CGFloat)newValue; { _aspectRatio = newValue; [self setFloat:_aspectRatio forUniform:aspectRatioUniform program:filterProgram]; } - (void)setRefractiveIndex:(CGFloat)newValue; { _refractiveIndex = newValue; [self setFloat:_refractiveIndex forUniform:refractiveIndexUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImageStillCamera.h ================================================ #import "GPUImageVideoCamera.h" void stillImageDataReleaseCallback(void *releaseRefCon, const void *baseAddress); void GPUImageCreateResizedSampleBuffer(CVPixelBufferRef cameraFrame, CGSize finalSize, CMSampleBufferRef *sampleBuffer); @interface GPUImageStillCamera : GPUImageVideoCamera /** The JPEG compression quality to use when capturing a photo as a JPEG. */ @property CGFloat jpegCompressionQuality; // Only reliably set inside the context of the completion handler of one of the capture methods @property (readonly) NSDictionary *currentCaptureMetadata; // Photography controls - (void)capturePhotoAsSampleBufferWithCompletionHandler:(void (^)(CMSampleBufferRef imageSampleBuffer, NSError *error))block; - (void)capturePhotoAsImageProcessedUpToFilter:(GPUImageOutput *)finalFilterInChain withCompletionHandler:(void (^)(UIImage *processedImage, NSError *error))block; - (void)capturePhotoAsImageProcessedUpToFilter:(GPUImageOutput *)finalFilterInChain withOrientation:(UIImageOrientation)orientation withCompletionHandler:(void (^)(UIImage *processedImage, NSError *error))block; - (void)capturePhotoAsJPEGProcessedUpToFilter:(GPUImageOutput *)finalFilterInChain withCompletionHandler:(void (^)(NSData *processedJPEG, NSError *error))block; - (void)capturePhotoAsJPEGProcessedUpToFilter:(GPUImageOutput *)finalFilterInChain withOrientation:(UIImageOrientation)orientation withCompletionHandler:(void (^)(NSData *processedJPEG, NSError *error))block; - (void)capturePhotoAsPNGProcessedUpToFilter:(GPUImageOutput *)finalFilterInChain withCompletionHandler:(void (^)(NSData *processedPNG, NSError *error))block; - (void)capturePhotoAsPNGProcessedUpToFilter:(GPUImageOutput *)finalFilterInChain withOrientation:(UIImageOrientation)orientation withCompletionHandler:(void (^)(NSData *processedPNG, NSError *error))block; @end ================================================ FILE: framework/Source/GPUImageStillCamera.m ================================================ // 2448x3264 pixel image = 31,961,088 bytes for uncompressed RGBA #import "GPUImageStillCamera.h" void stillImageDataReleaseCallback(void *releaseRefCon, const void *baseAddress) { free((void *)baseAddress); } void GPUImageCreateResizedSampleBuffer(CVPixelBufferRef cameraFrame, CGSize finalSize, CMSampleBufferRef *sampleBuffer) { // CVPixelBufferCreateWithPlanarBytes for YUV input CGSize originalSize = CGSizeMake(CVPixelBufferGetWidth(cameraFrame), CVPixelBufferGetHeight(cameraFrame)); CVPixelBufferLockBaseAddress(cameraFrame, 0); GLubyte *sourceImageBytes = CVPixelBufferGetBaseAddress(cameraFrame); CGDataProviderRef dataProvider = CGDataProviderCreateWithData(NULL, sourceImageBytes, CVPixelBufferGetBytesPerRow(cameraFrame) * originalSize.height, NULL); CGColorSpaceRef genericRGBColorspace = CGColorSpaceCreateDeviceRGB(); CGImageRef cgImageFromBytes = CGImageCreate((int)originalSize.width, (int)originalSize.height, 8, 32, CVPixelBufferGetBytesPerRow(cameraFrame), genericRGBColorspace, kCGBitmapByteOrder32Little | kCGImageAlphaPremultipliedFirst, dataProvider, NULL, NO, kCGRenderingIntentDefault); GLubyte *imageData = (GLubyte *) calloc(1, (int)finalSize.width * (int)finalSize.height * 4); CGContextRef imageContext = CGBitmapContextCreate(imageData, (int)finalSize.width, (int)finalSize.height, 8, (int)finalSize.width * 4, genericRGBColorspace, kCGBitmapByteOrder32Little | kCGImageAlphaPremultipliedFirst); CGContextDrawImage(imageContext, CGRectMake(0.0, 0.0, finalSize.width, finalSize.height), cgImageFromBytes); CGImageRelease(cgImageFromBytes); CGContextRelease(imageContext); CGColorSpaceRelease(genericRGBColorspace); CGDataProviderRelease(dataProvider); CVPixelBufferRef pixel_buffer = NULL; CVPixelBufferCreateWithBytes(kCFAllocatorDefault, finalSize.width, finalSize.height, kCVPixelFormatType_32BGRA, imageData, finalSize.width * 4, stillImageDataReleaseCallback, NULL, NULL, &pixel_buffer); CMVideoFormatDescriptionRef videoInfo = NULL; CMVideoFormatDescriptionCreateForImageBuffer(NULL, pixel_buffer, &videoInfo); CMTime frameTime = CMTimeMake(1, 30); CMSampleTimingInfo timing = {frameTime, frameTime, kCMTimeInvalid}; CMSampleBufferCreateForImageBuffer(kCFAllocatorDefault, pixel_buffer, YES, NULL, NULL, videoInfo, &timing, sampleBuffer); CVPixelBufferUnlockBaseAddress(cameraFrame, 0); CFRelease(videoInfo); CVPixelBufferRelease(pixel_buffer); } @interface GPUImageStillCamera () { AVCaptureStillImageOutput *photoOutput; } // Methods calling this are responsible for calling dispatch_semaphore_signal(frameRenderingSemaphore) somewhere inside the block - (void)capturePhotoProcessedUpToFilter:(GPUImageOutput *)finalFilterInChain withImageOnGPUHandler:(void (^)(NSError *error))block; @end @implementation GPUImageStillCamera { BOOL requiresFrontCameraTextureCacheCorruptionWorkaround; } @synthesize currentCaptureMetadata = _currentCaptureMetadata; @synthesize jpegCompressionQuality = _jpegCompressionQuality; #pragma mark - #pragma mark Initialization and teardown - (id)initWithSessionPreset:(NSString *)sessionPreset cameraPosition:(AVCaptureDevicePosition)cameraPosition; { if (!(self = [super initWithSessionPreset:sessionPreset cameraPosition:cameraPosition])) { return nil; } /* Detect iOS version < 6 which require a texture cache corruption workaround */ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" requiresFrontCameraTextureCacheCorruptionWorkaround = [[[UIDevice currentDevice] systemVersion] compare:@"6.0" options:NSNumericSearch] == NSOrderedAscending; #pragma clang diagnostic pop [self.captureSession beginConfiguration]; photoOutput = [[AVCaptureStillImageOutput alloc] init]; // Having a still photo input set to BGRA and video to YUV doesn't work well, so since I don't have YUV resizing for iPhone 4 yet, kick back to BGRA for that device // if (captureAsYUV && [GPUImageContext supportsFastTextureUpload]) if (captureAsYUV && [GPUImageContext deviceSupportsRedTextures]) { BOOL supportsFullYUVRange = NO; NSArray *supportedPixelFormats = photoOutput.availableImageDataCVPixelFormatTypes; for (NSNumber *currentPixelFormat in supportedPixelFormats) { if ([currentPixelFormat intValue] == kCVPixelFormatType_420YpCbCr8BiPlanarFullRange) { supportsFullYUVRange = YES; } } if (supportsFullYUVRange) { [photoOutput setOutputSettings:[NSDictionary dictionaryWithObject:[NSNumber numberWithInt:kCVPixelFormatType_420YpCbCr8BiPlanarFullRange] forKey:(id)kCVPixelBufferPixelFormatTypeKey]]; } else { [photoOutput setOutputSettings:[NSDictionary dictionaryWithObject:[NSNumber numberWithInt:kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange] forKey:(id)kCVPixelBufferPixelFormatTypeKey]]; } } else { captureAsYUV = NO; [photoOutput setOutputSettings:[NSDictionary dictionaryWithObject:[NSNumber numberWithInt:kCVPixelFormatType_32BGRA] forKey:(id)kCVPixelBufferPixelFormatTypeKey]]; [videoOutput setVideoSettings:[NSDictionary dictionaryWithObject:[NSNumber numberWithInt:kCVPixelFormatType_32BGRA] forKey:(id)kCVPixelBufferPixelFormatTypeKey]]; } [self.captureSession addOutput:photoOutput]; [self.captureSession commitConfiguration]; self.jpegCompressionQuality = 0.8; return self; } - (id)init; { if (!(self = [self initWithSessionPreset:AVCaptureSessionPresetPhoto cameraPosition:AVCaptureDevicePositionBack])) { return nil; } return self; } - (void)removeInputsAndOutputs; { [self.captureSession removeOutput:photoOutput]; [super removeInputsAndOutputs]; } #pragma mark - #pragma mark Photography controls - (void)capturePhotoAsSampleBufferWithCompletionHandler:(void (^)(CMSampleBufferRef imageSampleBuffer, NSError *error))block { NSLog(@"If you want to use the method capturePhotoAsSampleBufferWithCompletionHandler:, you must comment out the line in GPUImageStillCamera.m in the method initWithSessionPreset:cameraPosition: which sets the CVPixelBufferPixelFormatTypeKey, as well as uncomment the rest of the method capturePhotoAsSampleBufferWithCompletionHandler:. However, if you do this you cannot use any of the photo capture methods to take a photo if you also supply a filter."); /*dispatch_semaphore_wait(frameRenderingSemaphore, DISPATCH_TIME_FOREVER); [photoOutput captureStillImageAsynchronouslyFromConnection:[[photoOutput connections] objectAtIndex:0] completionHandler:^(CMSampleBufferRef imageSampleBuffer, NSError *error) { block(imageSampleBuffer, error); }]; dispatch_semaphore_signal(frameRenderingSemaphore); */ return; } - (void)capturePhotoAsImageProcessedUpToFilter:(GPUImageOutput *)finalFilterInChain withCompletionHandler:(void (^)(UIImage *processedImage, NSError *error))block; { [self capturePhotoProcessedUpToFilter:finalFilterInChain withImageOnGPUHandler:^(NSError *error) { UIImage *filteredPhoto = nil; if(!error){ filteredPhoto = [finalFilterInChain imageFromCurrentFramebuffer]; } dispatch_semaphore_signal(frameRenderingSemaphore); block(filteredPhoto, error); }]; } - (void)capturePhotoAsImageProcessedUpToFilter:(GPUImageOutput *)finalFilterInChain withOrientation:(UIImageOrientation)orientation withCompletionHandler:(void (^)(UIImage *processedImage, NSError *error))block { [self capturePhotoProcessedUpToFilter:finalFilterInChain withImageOnGPUHandler:^(NSError *error) { UIImage *filteredPhoto = nil; if(!error) { filteredPhoto = [finalFilterInChain imageFromCurrentFramebufferWithOrientation:orientation]; } dispatch_semaphore_signal(frameRenderingSemaphore); block(filteredPhoto, error); }]; } - (void)capturePhotoAsJPEGProcessedUpToFilter:(GPUImageOutput *)finalFilterInChain withCompletionHandler:(void (^)(NSData *processedJPEG, NSError *error))block; { // reportAvailableMemoryForGPUImage(@"Before Capture"); [self capturePhotoProcessedUpToFilter:finalFilterInChain withImageOnGPUHandler:^(NSError *error) { NSData *dataForJPEGFile = nil; if(!error){ @autoreleasepool { UIImage *filteredPhoto = [finalFilterInChain imageFromCurrentFramebuffer]; dispatch_semaphore_signal(frameRenderingSemaphore); // reportAvailableMemoryForGPUImage(@"After UIImage generation"); dataForJPEGFile = UIImageJPEGRepresentation(filteredPhoto,self.jpegCompressionQuality); // reportAvailableMemoryForGPUImage(@"After JPEG generation"); } // reportAvailableMemoryForGPUImage(@"After autorelease pool"); }else{ dispatch_semaphore_signal(frameRenderingSemaphore); } block(dataForJPEGFile, error); }]; } - (void)capturePhotoAsJPEGProcessedUpToFilter:(GPUImageOutput *)finalFilterInChain withOrientation:(UIImageOrientation)orientation withCompletionHandler:(void (^)(NSData *processedImage, NSError *error))block { [self capturePhotoProcessedUpToFilter:finalFilterInChain withImageOnGPUHandler:^(NSError *error) { NSData *dataForJPEGFile = nil; if(!error) { @autoreleasepool { UIImage *filteredPhoto = [finalFilterInChain imageFromCurrentFramebufferWithOrientation:orientation]; dispatch_semaphore_signal(frameRenderingSemaphore); dataForJPEGFile = UIImageJPEGRepresentation(filteredPhoto, self.jpegCompressionQuality); } } else { dispatch_semaphore_signal(frameRenderingSemaphore); } block(dataForJPEGFile, error); }]; } - (void)capturePhotoAsPNGProcessedUpToFilter:(GPUImageOutput *)finalFilterInChain withCompletionHandler:(void (^)(NSData *processedPNG, NSError *error))block; { [self capturePhotoProcessedUpToFilter:finalFilterInChain withImageOnGPUHandler:^(NSError *error) { NSData *dataForPNGFile = nil; if(!error){ @autoreleasepool { UIImage *filteredPhoto = [finalFilterInChain imageFromCurrentFramebuffer]; dispatch_semaphore_signal(frameRenderingSemaphore); dataForPNGFile = UIImagePNGRepresentation(filteredPhoto); } }else{ dispatch_semaphore_signal(frameRenderingSemaphore); } block(dataForPNGFile, error); }]; return; } - (void)capturePhotoAsPNGProcessedUpToFilter:(GPUImageOutput *)finalFilterInChain withOrientation:(UIImageOrientation)orientation withCompletionHandler:(void (^)(NSData *processedPNG, NSError *error))block; { [self capturePhotoProcessedUpToFilter:finalFilterInChain withImageOnGPUHandler:^(NSError *error) { NSData *dataForPNGFile = nil; if(!error){ @autoreleasepool { UIImage *filteredPhoto = [finalFilterInChain imageFromCurrentFramebufferWithOrientation:orientation]; dispatch_semaphore_signal(frameRenderingSemaphore); dataForPNGFile = UIImagePNGRepresentation(filteredPhoto); } }else{ dispatch_semaphore_signal(frameRenderingSemaphore); } block(dataForPNGFile, error); }]; return; } #pragma mark - Private Methods - (void)capturePhotoProcessedUpToFilter:(GPUImageOutput *)finalFilterInChain withImageOnGPUHandler:(void (^)(NSError *error))block { dispatch_semaphore_wait(frameRenderingSemaphore, DISPATCH_TIME_FOREVER); if(photoOutput.isCapturingStillImage){ block([NSError errorWithDomain:AVFoundationErrorDomain code:AVErrorMaximumStillImageCaptureRequestsExceeded userInfo:nil]); return; } [photoOutput captureStillImageAsynchronouslyFromConnection:[[photoOutput connections] objectAtIndex:0] completionHandler:^(CMSampleBufferRef imageSampleBuffer, NSError *error) { if(imageSampleBuffer == NULL){ block(error); return; } // For now, resize photos to fix within the max texture size of the GPU CVImageBufferRef cameraFrame = CMSampleBufferGetImageBuffer(imageSampleBuffer); CGSize sizeOfPhoto = CGSizeMake(CVPixelBufferGetWidth(cameraFrame), CVPixelBufferGetHeight(cameraFrame)); CGSize scaledImageSizeToFitOnGPU = [GPUImageContext sizeThatFitsWithinATextureForSize:sizeOfPhoto]; if (!CGSizeEqualToSize(sizeOfPhoto, scaledImageSizeToFitOnGPU)) { CMSampleBufferRef sampleBuffer = NULL; if (CVPixelBufferGetPlaneCount(cameraFrame) > 0) { NSAssert(NO, @"Error: no downsampling for YUV input in the framework yet"); } else { GPUImageCreateResizedSampleBuffer(cameraFrame, scaledImageSizeToFitOnGPU, &sampleBuffer); } dispatch_semaphore_signal(frameRenderingSemaphore); [finalFilterInChain useNextFrameForImageCapture]; [self captureOutput:photoOutput didOutputSampleBuffer:sampleBuffer fromConnection:[[photoOutput connections] objectAtIndex:0]]; dispatch_semaphore_wait(frameRenderingSemaphore, DISPATCH_TIME_FOREVER); if (sampleBuffer != NULL) CFRelease(sampleBuffer); } else { // This is a workaround for the corrupt images that are sometimes returned when taking a photo with the front camera and using the iOS 5.0 texture caches AVCaptureDevicePosition currentCameraPosition = [[videoInput device] position]; if ( (currentCameraPosition != AVCaptureDevicePositionFront) || (![GPUImageContext supportsFastTextureUpload]) || !requiresFrontCameraTextureCacheCorruptionWorkaround) { dispatch_semaphore_signal(frameRenderingSemaphore); [finalFilterInChain useNextFrameForImageCapture]; [self captureOutput:photoOutput didOutputSampleBuffer:imageSampleBuffer fromConnection:[[photoOutput connections] objectAtIndex:0]]; dispatch_semaphore_wait(frameRenderingSemaphore, DISPATCH_TIME_FOREVER); } } CFDictionaryRef metadata = CMCopyDictionaryOfAttachments(NULL, imageSampleBuffer, kCMAttachmentMode_ShouldPropagate); _currentCaptureMetadata = (__bridge_transfer NSDictionary *)metadata; block(nil); _currentCaptureMetadata = nil; }]; } @end ================================================ FILE: framework/Source/GPUImageStretchDistortionFilter.h ================================================ #import "GPUImageFilter.h" /** Creates a stretch distortion of the image */ @interface GPUImageStretchDistortionFilter : GPUImageFilter { GLint centerUniform; } /** The center about which to apply the distortion, with a default of (0.5, 0.5) */ @property(readwrite, nonatomic) CGPoint center; @end ================================================ FILE: framework/Source/GPUImageStretchDistortionFilter.m ================================================ #import "GPUImageStretchDistortionFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageStretchDistortionFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform highp vec2 center; void main() { highp vec2 normCoord = 2.0 * textureCoordinate - 1.0; highp vec2 normCenter = 2.0 * center - 1.0; normCoord -= normCenter; mediump vec2 s = sign(normCoord); normCoord = abs(normCoord); normCoord = 0.5 * normCoord + 0.5 * smoothstep(0.25, 0.5, normCoord) * normCoord; normCoord = s * normCoord; normCoord += normCenter; mediump vec2 textureCoordinateToUse = normCoord / 2.0 + 0.5; gl_FragColor = texture2D(inputImageTexture, textureCoordinateToUse ); } ); #else NSString *const kGPUImageStretchDistortionFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform vec2 center; void main() { vec2 normCoord = 2.0 * textureCoordinate - 1.0; vec2 normCenter = 2.0 * center - 1.0; normCoord -= normCenter; vec2 s = sign(normCoord); normCoord = abs(normCoord); normCoord = 0.5 * normCoord + 0.5 * smoothstep(0.25, 0.5, normCoord) * normCoord; normCoord = s * normCoord; normCoord += normCenter; vec2 textureCoordinateToUse = normCoord / 2.0 + 0.5; gl_FragColor = texture2D(inputImageTexture, textureCoordinateToUse); } ); #endif @implementation GPUImageStretchDistortionFilter @synthesize center = _center; #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageStretchDistortionFragmentShaderString])) { return nil; } centerUniform = [filterProgram uniformIndex:@"center"]; self.center = CGPointMake(0.5, 0.5); return self; } #pragma mark - #pragma mark Accessors - (void)setInputRotation:(GPUImageRotationMode)newInputRotation atIndex:(NSInteger)textureIndex; { [super setInputRotation:newInputRotation atIndex:textureIndex]; [self setCenter:self.center]; } - (void)setCenter:(CGPoint)newValue; { _center = newValue; CGPoint rotatedPoint = [self rotatedPoint:_center forRotation:inputRotation]; [self setPoint:rotatedPoint forUniform:centerUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImageSubtractBlendFilter.h ================================================ #import "GPUImageTwoInputFilter.h" @interface GPUImageSubtractBlendFilter : GPUImageTwoInputFilter @end ================================================ FILE: framework/Source/GPUImageSubtractBlendFilter.m ================================================ #import "GPUImageSubtractBlendFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageSubtractBlendFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; varying highp vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; void main() { lowp vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); lowp vec4 textureColor2 = texture2D(inputImageTexture2, textureCoordinate2); gl_FragColor = vec4(textureColor.rgb - textureColor2.rgb, textureColor.a); } ); #else NSString *const kGPUImageSubtractBlendFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; varying vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; void main() { vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); vec4 textureColor2 = texture2D(inputImageTexture2, textureCoordinate2); gl_FragColor = vec4(textureColor.rgb - textureColor2.rgb, textureColor.a); } ); #endif @implementation GPUImageSubtractBlendFilter - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageSubtractBlendFragmentShaderString])) { return nil; } return self; } @end ================================================ FILE: framework/Source/GPUImageSwirlFilter.h ================================================ #import "GPUImageFilter.h" /** Creates a swirl distortion on the image */ @interface GPUImageSwirlFilter : GPUImageFilter { GLint radiusUniform, centerUniform, angleUniform; } /// The center about which to apply the distortion, with a default of (0.5, 0.5) @property(readwrite, nonatomic) CGPoint center; /// The radius of the distortion, ranging from 0.0 to 1.0, with a default of 0.5 @property(readwrite, nonatomic) CGFloat radius; /// The amount of distortion to apply, with a minimum of 0.0 and a default of 1.0 @property(readwrite, nonatomic) CGFloat angle; @end ================================================ FILE: framework/Source/GPUImageSwirlFilter.m ================================================ #import "GPUImageSwirlFilter.h" // Adapted from the shader example here: http://www.geeks3d.com/20110428/shader-library-swirl-post-processing-filter-in-glsl/ #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageSwirlFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform highp vec2 center; uniform highp float radius; uniform highp float angle; void main() { highp vec2 textureCoordinateToUse = textureCoordinate; highp float dist = distance(center, textureCoordinate); if (dist < radius) { textureCoordinateToUse -= center; highp float percent = (radius - dist) / radius; highp float theta = percent * percent * angle * 8.0; highp float s = sin(theta); highp float c = cos(theta); textureCoordinateToUse = vec2(dot(textureCoordinateToUse, vec2(c, -s)), dot(textureCoordinateToUse, vec2(s, c))); textureCoordinateToUse += center; } gl_FragColor = texture2D(inputImageTexture, textureCoordinateToUse ); } ); #else NSString *const kGPUImageSwirlFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform vec2 center; uniform float radius; uniform float angle; void main() { vec2 textureCoordinateToUse = textureCoordinate; float dist = distance(center, textureCoordinate); if (dist < radius) { textureCoordinateToUse -= center; float percent = (radius - dist) / radius; float theta = percent * percent * angle * 8.0; float s = sin(theta); float c = cos(theta); textureCoordinateToUse = vec2(dot(textureCoordinateToUse, vec2(c, -s)), dot(textureCoordinateToUse, vec2(s, c))); textureCoordinateToUse += center; } gl_FragColor = texture2D(inputImageTexture, textureCoordinateToUse ); } ); #endif @implementation GPUImageSwirlFilter @synthesize center = _center; @synthesize radius = _radius; @synthesize angle = _angle; #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageSwirlFragmentShaderString])) { return nil; } radiusUniform = [filterProgram uniformIndex:@"radius"]; angleUniform = [filterProgram uniformIndex:@"angle"]; centerUniform = [filterProgram uniformIndex:@"center"]; self.radius = 0.5; self.angle = 1.0; self.center = CGPointMake(0.5, 0.5); return self; } #pragma mark - #pragma mark Accessors - (void)setInputRotation:(GPUImageRotationMode)newInputRotation atIndex:(NSInteger)textureIndex; { [super setInputRotation:newInputRotation atIndex:textureIndex]; [self setCenter:self.center]; } - (void)setRadius:(CGFloat)newValue; { _radius = newValue; [self setFloat:_radius forUniform:radiusUniform program:filterProgram]; } - (void)setAngle:(CGFloat)newValue; { _angle = newValue; [self setFloat:_angle forUniform:angleUniform program:filterProgram]; } - (void)setCenter:(CGPoint)newValue; { _center = newValue; CGPoint rotatedPoint = [self rotatedPoint:_center forRotation:inputRotation]; [self setPoint:rotatedPoint forUniform:centerUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImageTextureInput.h ================================================ #import "GPUImageOutput.h" @interface GPUImageTextureInput : GPUImageOutput { CGSize textureSize; } // Initialization and teardown - (id)initWithTexture:(GLuint)newInputTexture size:(CGSize)newTextureSize; // Image rendering - (void)processTextureWithFrameTime:(CMTime)frameTime; @end ================================================ FILE: framework/Source/GPUImageTextureInput.m ================================================ #import "GPUImageTextureInput.h" @implementation GPUImageTextureInput #pragma mark - #pragma mark Initialization and teardown - (id)initWithTexture:(GLuint)newInputTexture size:(CGSize)newTextureSize; { if (!(self = [super init])) { return nil; } runSynchronouslyOnVideoProcessingQueue(^{ [GPUImageContext useImageProcessingContext]; }); textureSize = newTextureSize; runSynchronouslyOnVideoProcessingQueue(^{ outputFramebuffer = [[GPUImageFramebuffer alloc] initWithSize:newTextureSize overriddenTexture:newInputTexture]; }); return self; } #pragma mark - #pragma mark Image rendering - (void)processTextureWithFrameTime:(CMTime)frameTime; { runAsynchronouslyOnVideoProcessingQueue(^{ for (id currentTarget in targets) { NSInteger indexOfObject = [targets indexOfObject:currentTarget]; NSInteger targetTextureIndex = [[targetTextureIndices objectAtIndex:indexOfObject] integerValue]; [currentTarget setInputSize:textureSize atIndex:targetTextureIndex]; [currentTarget setInputFramebuffer:outputFramebuffer atIndex:targetTextureIndex]; [currentTarget newFrameReadyAtTime:frameTime atIndex:targetTextureIndex]; } }); } @end ================================================ FILE: framework/Source/GPUImageTextureOutput.h ================================================ #import #import "GPUImageContext.h" @protocol GPUImageTextureOutputDelegate; @interface GPUImageTextureOutput : NSObject { GPUImageFramebuffer *firstInputFramebuffer; } @property(readwrite, unsafe_unretained, nonatomic) id delegate; @property(readonly) GLuint texture; @property(nonatomic) BOOL enabled; - (void)doneWithTexture; @end @protocol GPUImageTextureOutputDelegate - (void)newFrameReadyFromTextureOutput:(GPUImageTextureOutput *)callbackTextureOutput; @end ================================================ FILE: framework/Source/GPUImageTextureOutput.m ================================================ #import "GPUImageTextureOutput.h" @implementation GPUImageTextureOutput @synthesize delegate = _delegate; @synthesize texture = _texture; @synthesize enabled; #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super init])) { return nil; } self.enabled = YES; return self; } - (void)doneWithTexture; { [firstInputFramebuffer unlock]; } #pragma mark - #pragma mark GPUImageInput protocol - (void)newFrameReadyAtTime:(CMTime)frameTime atIndex:(NSInteger)textureIndex; { [_delegate newFrameReadyFromTextureOutput:self]; } - (NSInteger)nextAvailableTextureIndex; { return 0; } // TODO: Deal with the fact that the texture changes regularly as a result of the caching - (void)setInputFramebuffer:(GPUImageFramebuffer *)newInputFramebuffer atIndex:(NSInteger)textureIndex; { firstInputFramebuffer = newInputFramebuffer; [firstInputFramebuffer lock]; _texture = [firstInputFramebuffer texture]; } - (void)setInputRotation:(GPUImageRotationMode)newInputRotation atIndex:(NSInteger)textureIndex; { } - (void)setInputSize:(CGSize)newSize atIndex:(NSInteger)textureIndex; { } - (CGSize)maximumOutputSize; { return CGSizeZero; } - (void)endProcessing { } - (BOOL)shouldIgnoreUpdatesToThisTarget; { return NO; } - (BOOL)wantsMonochromeInput; { return NO; } - (void)setCurrentlyReceivingMonochromeInput:(BOOL)newValue; { } @end ================================================ FILE: framework/Source/GPUImageThreeInputFilter.h ================================================ #import "GPUImageTwoInputFilter.h" extern NSString *const kGPUImageThreeInputTextureVertexShaderString; @interface GPUImageThreeInputFilter : GPUImageTwoInputFilter { GPUImageFramebuffer *thirdInputFramebuffer; GLint filterThirdTextureCoordinateAttribute; GLint filterInputTextureUniform3; GPUImageRotationMode inputRotation3; GLuint filterSourceTexture3; CMTime thirdFrameTime; BOOL hasSetSecondTexture, hasReceivedThirdFrame, thirdFrameWasVideo; BOOL thirdFrameCheckDisabled; } - (void)disableThirdFrameCheck; @end ================================================ FILE: framework/Source/GPUImageThreeInputFilter.m ================================================ #import "GPUImageThreeInputFilter.h" NSString *const kGPUImageThreeInputTextureVertexShaderString = SHADER_STRING ( attribute vec4 position; attribute vec4 inputTextureCoordinate; attribute vec4 inputTextureCoordinate2; attribute vec4 inputTextureCoordinate3; varying vec2 textureCoordinate; varying vec2 textureCoordinate2; varying vec2 textureCoordinate3; void main() { gl_Position = position; textureCoordinate = inputTextureCoordinate.xy; textureCoordinate2 = inputTextureCoordinate2.xy; textureCoordinate3 = inputTextureCoordinate3.xy; } ); @implementation GPUImageThreeInputFilter #pragma mark - #pragma mark Initialization and teardown - (id)initWithFragmentShaderFromString:(NSString *)fragmentShaderString; { if (!(self = [self initWithVertexShaderFromString:kGPUImageThreeInputTextureVertexShaderString fragmentShaderFromString:fragmentShaderString])) { return nil; } return self; } - (id)initWithVertexShaderFromString:(NSString *)vertexShaderString fragmentShaderFromString:(NSString *)fragmentShaderString; { if (!(self = [super initWithVertexShaderFromString:vertexShaderString fragmentShaderFromString:fragmentShaderString])) { return nil; } inputRotation3 = kGPUImageNoRotation; hasSetSecondTexture = NO; hasReceivedThirdFrame = NO; thirdFrameWasVideo = NO; thirdFrameCheckDisabled = NO; thirdFrameTime = kCMTimeInvalid; runSynchronouslyOnVideoProcessingQueue(^{ [GPUImageContext useImageProcessingContext]; filterThirdTextureCoordinateAttribute = [filterProgram attributeIndex:@"inputTextureCoordinate3"]; filterInputTextureUniform3 = [filterProgram uniformIndex:@"inputImageTexture3"]; // This does assume a name of "inputImageTexture3" for the third input texture in the fragment shader glEnableVertexAttribArray(filterThirdTextureCoordinateAttribute); }); return self; } - (void)initializeAttributes; { [super initializeAttributes]; [filterProgram addAttribute:@"inputTextureCoordinate3"]; } - (void)disableThirdFrameCheck; { thirdFrameCheckDisabled = YES; } #pragma mark - #pragma mark Rendering - (void)renderToTextureWithVertices:(const GLfloat *)vertices textureCoordinates:(const GLfloat *)textureCoordinates; { if (self.preventRendering) { [firstInputFramebuffer unlock]; [secondInputFramebuffer unlock]; [thirdInputFramebuffer unlock]; return; } [GPUImageContext setActiveShaderProgram:filterProgram]; outputFramebuffer = [[GPUImageContext sharedFramebufferCache] fetchFramebufferForSize:[self sizeOfFBO] textureOptions:self.outputTextureOptions onlyTexture:NO]; [outputFramebuffer activateFramebuffer]; if (usingNextFrameForImageCapture) { [outputFramebuffer lock]; } [self setUniformsForProgramAtIndex:0]; glClearColor(backgroundColorRed, backgroundColorGreen, backgroundColorBlue, backgroundColorAlpha); glClear(GL_COLOR_BUFFER_BIT); glActiveTexture(GL_TEXTURE2); glBindTexture(GL_TEXTURE_2D, [firstInputFramebuffer texture]); glUniform1i(filterInputTextureUniform, 2); glActiveTexture(GL_TEXTURE3); glBindTexture(GL_TEXTURE_2D, [secondInputFramebuffer texture]); glUniform1i(filterInputTextureUniform2, 3); glActiveTexture(GL_TEXTURE4); glBindTexture(GL_TEXTURE_2D, [thirdInputFramebuffer texture]); glUniform1i(filterInputTextureUniform3, 4); glVertexAttribPointer(filterPositionAttribute, 2, GL_FLOAT, 0, 0, vertices); glVertexAttribPointer(filterTextureCoordinateAttribute, 2, GL_FLOAT, 0, 0, textureCoordinates); glVertexAttribPointer(filterSecondTextureCoordinateAttribute, 2, GL_FLOAT, 0, 0, [[self class] textureCoordinatesForRotation:inputRotation2]); glVertexAttribPointer(filterThirdTextureCoordinateAttribute, 2, GL_FLOAT, 0, 0, [[self class] textureCoordinatesForRotation:inputRotation3]); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); [firstInputFramebuffer unlock]; [secondInputFramebuffer unlock]; [thirdInputFramebuffer unlock]; if (usingNextFrameForImageCapture) { dispatch_semaphore_signal(imageCaptureSemaphore); } } #pragma mark - #pragma mark GPUImageInput - (NSInteger)nextAvailableTextureIndex; { if (hasSetSecondTexture) { return 2; } else if (hasSetFirstTexture) { return 1; } else { return 0; } } - (void)setInputFramebuffer:(GPUImageFramebuffer *)newInputFramebuffer atIndex:(NSInteger)textureIndex; { if (textureIndex == 0) { firstInputFramebuffer = newInputFramebuffer; hasSetFirstTexture = YES; [firstInputFramebuffer lock]; } else if (textureIndex == 1) { secondInputFramebuffer = newInputFramebuffer; hasSetSecondTexture = YES; [secondInputFramebuffer lock]; } else { thirdInputFramebuffer = newInputFramebuffer; [thirdInputFramebuffer lock]; } } - (void)setInputSize:(CGSize)newSize atIndex:(NSInteger)textureIndex; { if (textureIndex == 0) { [super setInputSize:newSize atIndex:textureIndex]; if (CGSizeEqualToSize(newSize, CGSizeZero)) { hasSetFirstTexture = NO; } } else if (textureIndex == 1) { if (CGSizeEqualToSize(newSize, CGSizeZero)) { hasSetSecondTexture = NO; } } } - (void)setInputRotation:(GPUImageRotationMode)newInputRotation atIndex:(NSInteger)textureIndex; { if (textureIndex == 0) { inputRotation = newInputRotation; } else if (textureIndex == 1) { inputRotation2 = newInputRotation; } else { inputRotation3 = newInputRotation; } } - (CGSize)rotatedSize:(CGSize)sizeToRotate forIndex:(NSInteger)textureIndex; { CGSize rotatedSize = sizeToRotate; GPUImageRotationMode rotationToCheck; if (textureIndex == 0) { rotationToCheck = inputRotation; } else if (textureIndex == 1) { rotationToCheck = inputRotation2; } else { rotationToCheck = inputRotation3; } if (GPUImageRotationSwapsWidthAndHeight(rotationToCheck)) { rotatedSize.width = sizeToRotate.height; rotatedSize.height = sizeToRotate.width; } return rotatedSize; } - (void)newFrameReadyAtTime:(CMTime)frameTime atIndex:(NSInteger)textureIndex; { // You can set up infinite update loops, so this helps to short circuit them if (hasReceivedFirstFrame && hasReceivedSecondFrame && hasReceivedThirdFrame) { return; } BOOL updatedMovieFrameOppositeStillImage = NO; if (textureIndex == 0) { hasReceivedFirstFrame = YES; firstFrameTime = frameTime; if (secondFrameCheckDisabled) { hasReceivedSecondFrame = YES; } if (thirdFrameCheckDisabled) { hasReceivedThirdFrame = YES; } if (!CMTIME_IS_INDEFINITE(frameTime)) { if CMTIME_IS_INDEFINITE(secondFrameTime) { updatedMovieFrameOppositeStillImage = YES; } } } else if (textureIndex == 1) { hasReceivedSecondFrame = YES; secondFrameTime = frameTime; if (firstFrameCheckDisabled) { hasReceivedFirstFrame = YES; } if (thirdFrameCheckDisabled) { hasReceivedThirdFrame = YES; } if (!CMTIME_IS_INDEFINITE(frameTime)) { if CMTIME_IS_INDEFINITE(firstFrameTime) { updatedMovieFrameOppositeStillImage = YES; } } } else { hasReceivedThirdFrame = YES; thirdFrameTime = frameTime; if (firstFrameCheckDisabled) { hasReceivedFirstFrame = YES; } if (secondFrameCheckDisabled) { hasReceivedSecondFrame = YES; } if (!CMTIME_IS_INDEFINITE(frameTime)) { if CMTIME_IS_INDEFINITE(firstFrameTime) { updatedMovieFrameOppositeStillImage = YES; } } } // || (hasReceivedFirstFrame && secondFrameCheckDisabled) || (hasReceivedSecondFrame && firstFrameCheckDisabled) if ((hasReceivedFirstFrame && hasReceivedSecondFrame && hasReceivedThirdFrame) || updatedMovieFrameOppositeStillImage) { static const GLfloat imageVertices[] = { -1.0f, -1.0f, 1.0f, -1.0f, -1.0f, 1.0f, 1.0f, 1.0f, }; [self renderToTextureWithVertices:imageVertices textureCoordinates:[[self class] textureCoordinatesForRotation:inputRotation]]; [self informTargetsAboutNewFrameAtTime:frameTime]; hasReceivedFirstFrame = NO; hasReceivedSecondFrame = NO; hasReceivedThirdFrame = NO; } } @end ================================================ FILE: framework/Source/GPUImageThresholdEdgeDetectionFilter.h ================================================ #import "GPUImageSobelEdgeDetectionFilter.h" @interface GPUImageThresholdEdgeDetectionFilter : GPUImageSobelEdgeDetectionFilter { GLint thresholdUniform; } /** Any edge above this threshold will be black, and anything below white. Ranges from 0.0 to 1.0, with 0.8 as the default */ @property(readwrite, nonatomic) CGFloat threshold; @end ================================================ FILE: framework/Source/GPUImageThresholdEdgeDetectionFilter.m ================================================ #import "GPUImageThresholdEdgeDetectionFilter.h" @implementation GPUImageThresholdEdgeDetectionFilter // Invert the colorspace for a sketch #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageThresholdEdgeDetectionFragmentShaderString = SHADER_STRING ( precision highp float; varying vec2 textureCoordinate; varying vec2 leftTextureCoordinate; varying vec2 rightTextureCoordinate; varying vec2 topTextureCoordinate; varying vec2 topLeftTextureCoordinate; varying vec2 topRightTextureCoordinate; varying vec2 bottomTextureCoordinate; varying vec2 bottomLeftTextureCoordinate; varying vec2 bottomRightTextureCoordinate; uniform sampler2D inputImageTexture; uniform lowp float threshold; uniform float edgeStrength; void main() { // float bottomLeftIntensity = texture2D(inputImageTexture, bottomLeftTextureCoordinate).r; // float topRightIntensity = texture2D(inputImageTexture, topRightTextureCoordinate).r; // float topLeftIntensity = texture2D(inputImageTexture, topLeftTextureCoordinate).r; // float bottomRightIntensity = texture2D(inputImageTexture, bottomRightTextureCoordinate).r; float leftIntensity = texture2D(inputImageTexture, leftTextureCoordinate).r; float rightIntensity = texture2D(inputImageTexture, rightTextureCoordinate).r; float bottomIntensity = texture2D(inputImageTexture, bottomTextureCoordinate).r; float topIntensity = texture2D(inputImageTexture, topTextureCoordinate).r; float centerIntensity = texture2D(inputImageTexture, textureCoordinate).r; // float h = -topLeftIntensity - 2.0 * topIntensity - topRightIntensity + bottomLeftIntensity + 2.0 * bottomIntensity + bottomRightIntensity; // float v = -bottomLeftIntensity - 2.0 * leftIntensity - topLeftIntensity + bottomRightIntensity + 2.0 * rightIntensity + topRightIntensity; // float h = -topLeftIntensity - 2.0 * topIntensity - topRightIntensity + leftIntensity + 2.0 * centerIntensity + rightIntensity; // float v = -bottomLeftIntensity - 2.0 * leftIntensity - topLeftIntensity + bottomIntensity + 2.0 * centerIntensity + topIntensity; float h = (centerIntensity - topIntensity) + (bottomIntensity - centerIntensity); float v = (centerIntensity - leftIntensity) + (rightIntensity - centerIntensity); // float h = (centerIntensity - topIntensity); // float j = (topIntensity - centerIntensity); // h = max(h,j); // j = abs(h); // float v = (centerIntensity - leftIntensity); float mag = length(vec2(h, v)) * edgeStrength; mag = step(threshold, mag); // float mag = abs(h); // gl_FragColor = vec4(h, h, h, 1.0); // gl_FragColor = vec4(texture2D(inputImageTexture, textureCoordinate)); // gl_FragColor = vec4(h, centerIntensity, j, 1.0); gl_FragColor = vec4(mag, mag, mag, 1.0); } ); #else NSString *const kGPUImageThresholdEdgeDetectionFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; varying vec2 leftTextureCoordinate; varying vec2 rightTextureCoordinate; varying vec2 topTextureCoordinate; varying vec2 topLeftTextureCoordinate; varying vec2 topRightTextureCoordinate; varying vec2 bottomTextureCoordinate; varying vec2 bottomLeftTextureCoordinate; varying vec2 bottomRightTextureCoordinate; uniform sampler2D inputImageTexture; uniform float threshold; uniform float edgeStrength; void main() { float bottomLeftIntensity = texture2D(inputImageTexture, bottomLeftTextureCoordinate).r; float topRightIntensity = texture2D(inputImageTexture, topRightTextureCoordinate).r; float topLeftIntensity = texture2D(inputImageTexture, topLeftTextureCoordinate).r; float bottomRightIntensity = texture2D(inputImageTexture, bottomRightTextureCoordinate).r; float leftIntensity = texture2D(inputImageTexture, leftTextureCoordinate).r; float rightIntensity = texture2D(inputImageTexture, rightTextureCoordinate).r; float bottomIntensity = texture2D(inputImageTexture, bottomTextureCoordinate).r; float topIntensity = texture2D(inputImageTexture, topTextureCoordinate).r; float h = -topLeftIntensity - 2.0 * topIntensity - topRightIntensity + bottomLeftIntensity + 2.0 * bottomIntensity + bottomRightIntensity; h = max(0.0, h); float v = -bottomLeftIntensity - 2.0 * leftIntensity - topLeftIntensity + bottomRightIntensity + 2.0 * rightIntensity + topRightIntensity; v = max(0.0, v); float mag = length(vec2(h, v)) * edgeStrength; mag = step(threshold, mag); gl_FragColor = vec4(vec3(mag), 1.0); } ); #endif #pragma mark - #pragma mark Initialization and teardown @synthesize threshold = _threshold; - (id)initWithFragmentShaderFromString:(NSString *)fragmentShaderString; { if (!(self = [super initWithFragmentShaderFromString:fragmentShaderString])) { return nil; } thresholdUniform = [secondFilterProgram uniformIndex:@"threshold"]; self.threshold = 0.25; self.edgeStrength = 1.0; return self; } - (id)init; { if (!(self = [self initWithFragmentShaderFromString:kGPUImageThresholdEdgeDetectionFragmentShaderString])) { return nil; } return self; } #pragma mark - #pragma mark Accessors - (void)setThreshold:(CGFloat)newValue; { _threshold = newValue; [self setFloat:_threshold forUniform:thresholdUniform program:secondFilterProgram]; } @end ================================================ FILE: framework/Source/GPUImageThresholdSketchFilter.h ================================================ #import "GPUImageThresholdEdgeDetectionFilter.h" @interface GPUImageThresholdSketchFilter : GPUImageThresholdEdgeDetectionFilter @end ================================================ FILE: framework/Source/GPUImageThresholdSketchFilter.m ================================================ #import "GPUImageThresholdSketchFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageThresholdSketchFragmentShaderString = SHADER_STRING ( precision highp float; varying vec2 textureCoordinate; varying vec2 leftTextureCoordinate; varying vec2 rightTextureCoordinate; varying vec2 topTextureCoordinate; varying vec2 topLeftTextureCoordinate; varying vec2 topRightTextureCoordinate; varying vec2 bottomTextureCoordinate; varying vec2 bottomLeftTextureCoordinate; varying vec2 bottomRightTextureCoordinate; uniform sampler2D inputImageTexture; uniform lowp float threshold; uniform float edgeStrength; const highp vec3 W = vec3(0.2125, 0.7154, 0.0721); void main() { float bottomLeftIntensity = texture2D(inputImageTexture, bottomLeftTextureCoordinate).r; float topRightIntensity = texture2D(inputImageTexture, topRightTextureCoordinate).r; float topLeftIntensity = texture2D(inputImageTexture, topLeftTextureCoordinate).r; float bottomRightIntensity = texture2D(inputImageTexture, bottomRightTextureCoordinate).r; float leftIntensity = texture2D(inputImageTexture, leftTextureCoordinate).r; float rightIntensity = texture2D(inputImageTexture, rightTextureCoordinate).r; float bottomIntensity = texture2D(inputImageTexture, bottomTextureCoordinate).r; float topIntensity = texture2D(inputImageTexture, topTextureCoordinate).r; float h = -topLeftIntensity - 2.0 * topIntensity - topRightIntensity + bottomLeftIntensity + 2.0 * bottomIntensity + bottomRightIntensity; float v = -bottomLeftIntensity - 2.0 * leftIntensity - topLeftIntensity + bottomRightIntensity + 2.0 * rightIntensity + topRightIntensity; float mag = (length(vec2(h, v)) * edgeStrength); mag = step(threshold, mag); mag = 1.0 - mag; gl_FragColor = vec4(vec3(mag), 1.0); } ); #else NSString *const kGPUImageThresholdSketchFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; varying vec2 leftTextureCoordinate; varying vec2 rightTextureCoordinate; varying vec2 topTextureCoordinate; varying vec2 topLeftTextureCoordinate; varying vec2 topRightTextureCoordinate; varying vec2 bottomTextureCoordinate; varying vec2 bottomLeftTextureCoordinate; varying vec2 bottomRightTextureCoordinate; uniform sampler2D inputImageTexture; uniform float threshold; uniform float edgeStrength; const vec3 W = vec3(0.2125, 0.7154, 0.0721); void main() { float bottomLeftIntensity = texture2D(inputImageTexture, bottomLeftTextureCoordinate).r; float topRightIntensity = texture2D(inputImageTexture, topRightTextureCoordinate).r; float topLeftIntensity = texture2D(inputImageTexture, topLeftTextureCoordinate).r; float bottomRightIntensity = texture2D(inputImageTexture, bottomRightTextureCoordinate).r; float leftIntensity = texture2D(inputImageTexture, leftTextureCoordinate).r; float rightIntensity = texture2D(inputImageTexture, rightTextureCoordinate).r; float bottomIntensity = texture2D(inputImageTexture, bottomTextureCoordinate).r; float topIntensity = texture2D(inputImageTexture, topTextureCoordinate).r; float h = -topLeftIntensity - 2.0 * topIntensity - topRightIntensity + bottomLeftIntensity + 2.0 * bottomIntensity + bottomRightIntensity; float v = -bottomLeftIntensity - 2.0 * leftIntensity - topLeftIntensity + bottomRightIntensity + 2.0 * rightIntensity + topRightIntensity; float mag = 1.0 - length(vec2(h, v) * edgeStrength); mag = step(threshold, mag); gl_FragColor = vec4(vec3(mag), 1.0); } ); #endif @implementation GPUImageThresholdSketchFilter #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [self initWithFragmentShaderFromString:kGPUImageThresholdSketchFragmentShaderString])) { return nil; } return self; } @end ================================================ FILE: framework/Source/GPUImageThresholdedNonMaximumSuppressionFilter.h ================================================ #import "GPUImage3x3TextureSamplingFilter.h" @interface GPUImageThresholdedNonMaximumSuppressionFilter : GPUImage3x3TextureSamplingFilter { GLint thresholdUniform; } /** Any local maximum above this threshold will be white, and anything below black. Ranges from 0.0 to 1.0, with 0.8 as the default */ @property(readwrite, nonatomic) CGFloat threshold; - (id)initWithPackedColorspace:(BOOL)inputUsesPackedColorspace; @end ================================================ FILE: framework/Source/GPUImageThresholdedNonMaximumSuppressionFilter.m ================================================ #import "GPUImageThresholdedNonMaximumSuppressionFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageThresholdedNonMaximumSuppressionFragmentShaderString = SHADER_STRING ( uniform sampler2D inputImageTexture; varying highp vec2 textureCoordinate; varying highp vec2 leftTextureCoordinate; varying highp vec2 rightTextureCoordinate; varying highp vec2 topTextureCoordinate; varying highp vec2 topLeftTextureCoordinate; varying highp vec2 topRightTextureCoordinate; varying highp vec2 bottomTextureCoordinate; varying highp vec2 bottomLeftTextureCoordinate; varying highp vec2 bottomRightTextureCoordinate; uniform lowp float threshold; void main() { lowp float bottomColor = texture2D(inputImageTexture, bottomTextureCoordinate).r; lowp float bottomLeftColor = texture2D(inputImageTexture, bottomLeftTextureCoordinate).r; lowp float bottomRightColor = texture2D(inputImageTexture, bottomRightTextureCoordinate).r; lowp vec4 centerColor = texture2D(inputImageTexture, textureCoordinate); lowp float leftColor = texture2D(inputImageTexture, leftTextureCoordinate).r; lowp float rightColor = texture2D(inputImageTexture, rightTextureCoordinate).r; lowp float topColor = texture2D(inputImageTexture, topTextureCoordinate).r; lowp float topRightColor = texture2D(inputImageTexture, topRightTextureCoordinate).r; lowp float topLeftColor = texture2D(inputImageTexture, topLeftTextureCoordinate).r; // Use a tiebreaker for pixels to the left and immediately above this one lowp float multiplier = 1.0 - step(centerColor.r, topColor); multiplier = multiplier * (1.0 - step(centerColor.r, topLeftColor)); multiplier = multiplier * (1.0 - step(centerColor.r, leftColor)); multiplier = multiplier * (1.0 - step(centerColor.r, bottomLeftColor)); lowp float maxValue = max(centerColor.r, bottomColor); maxValue = max(maxValue, bottomRightColor); maxValue = max(maxValue, rightColor); maxValue = max(maxValue, topRightColor); lowp float finalValue = centerColor.r * step(maxValue, centerColor.r) * multiplier; finalValue = step(threshold, finalValue); gl_FragColor = vec4(finalValue, finalValue, finalValue, 1.0); // // gl_FragColor = vec4((centerColor.rgb * step(maxValue, step(threshold, centerColor.r)) * multiplier), 1.0); } ); NSString *const kGPUImageThresholdedNonMaximumSuppressionPackedColorspaceFragmentShaderString = SHADER_STRING ( uniform sampler2D inputImageTexture; varying highp vec2 textureCoordinate; varying highp vec2 leftTextureCoordinate; varying highp vec2 rightTextureCoordinate; varying highp vec2 topTextureCoordinate; varying highp vec2 topLeftTextureCoordinate; varying highp vec2 topRightTextureCoordinate; varying highp vec2 bottomTextureCoordinate; varying highp vec2 bottomLeftTextureCoordinate; varying highp vec2 bottomRightTextureCoordinate; uniform lowp float threshold; uniform highp float texelWidth; uniform highp float texelHeight; highp float encodedIntensity(highp vec3 sourceColor) { return (sourceColor.b * 256.0 * 256.0 + sourceColor.g * 256.0 + sourceColor.r); } void main() { highp float bottomColor = encodedIntensity(texture2D(inputImageTexture, bottomTextureCoordinate).rgb); highp float bottomLeftColor = encodedIntensity(texture2D(inputImageTexture, bottomLeftTextureCoordinate).rgb); highp float bottomRightColor = encodedIntensity(texture2D(inputImageTexture, bottomRightTextureCoordinate).rgb); highp float centerColor = encodedIntensity(texture2D(inputImageTexture, textureCoordinate).rgb); highp float leftColor = encodedIntensity(texture2D(inputImageTexture, leftTextureCoordinate).rgb); highp float rightColor = encodedIntensity(texture2D(inputImageTexture, rightTextureCoordinate).rgb); highp float topColor = encodedIntensity(texture2D(inputImageTexture, topTextureCoordinate).rgb); highp float topRightColor = encodedIntensity(texture2D(inputImageTexture, topRightTextureCoordinate).rgb); highp float topLeftColor = encodedIntensity(texture2D(inputImageTexture, topLeftTextureCoordinate).rgb); highp float secondStageColor1 = encodedIntensity(texture2D(inputImageTexture, textureCoordinate + vec2(-2.0 * texelWidth, -2.0 * texelHeight)).rgb); highp float secondStageColor2 = encodedIntensity(texture2D(inputImageTexture, textureCoordinate + vec2(-2.0 * texelWidth, -1.0 * texelHeight)).rgb); highp float secondStageColor3 = encodedIntensity(texture2D(inputImageTexture, textureCoordinate + vec2(-2.0 * texelWidth, 0.0)).rgb); highp float secondStageColor4 = encodedIntensity(texture2D(inputImageTexture, textureCoordinate + vec2(-2.0 * texelWidth, 1.0 * texelHeight)).rgb); highp float secondStageColor5 = encodedIntensity(texture2D(inputImageTexture, textureCoordinate + vec2(-2.0 * texelWidth, 2.0 * texelHeight)).rgb); highp float secondStageColor6 = encodedIntensity(texture2D(inputImageTexture, textureCoordinate + vec2(-1.0 * texelWidth, 2.0 * texelHeight)).rgb); highp float secondStageColor7 = encodedIntensity(texture2D(inputImageTexture, textureCoordinate + vec2(0.0, 2.0 * texelHeight)).rgb); highp float secondStageColor8 = encodedIntensity(texture2D(inputImageTexture, textureCoordinate + vec2(1.0 * texelWidth, 2.0 * texelHeight)).rgb); highp float thirdStageColor1 = encodedIntensity(texture2D(inputImageTexture, textureCoordinate + vec2(-1.0 * texelWidth, -2.0 * texelHeight)).rgb); highp float thirdStageColor2 = encodedIntensity(texture2D(inputImageTexture, textureCoordinate + vec2(0.0, -2.0 * texelHeight)).rgb); highp float thirdStageColor3 = encodedIntensity(texture2D(inputImageTexture, textureCoordinate + vec2(1.0 * texelWidth, -2.0 * texelHeight)).rgb); highp float thirdStageColor4 = encodedIntensity(texture2D(inputImageTexture, textureCoordinate + vec2(2.0 * texelWidth, -2.0 * texelHeight)).rgb); highp float thirdStageColor5 = encodedIntensity(texture2D(inputImageTexture, textureCoordinate + vec2(2.0 * texelWidth, -1.0 * texelHeight)).rgb); highp float thirdStageColor6 = encodedIntensity(texture2D(inputImageTexture, textureCoordinate + vec2(2.0 * texelWidth, 0.0)).rgb); highp float thirdStageColor7 = encodedIntensity(texture2D(inputImageTexture, textureCoordinate + vec2(2.0 * texelWidth, 1.0 * texelHeight)).rgb); highp float thirdStageColor8 = encodedIntensity(texture2D(inputImageTexture, textureCoordinate + vec2(2.0 * texelWidth, 2.0 * texelHeight)).rgb); // Use a tiebreaker for pixels to the left and immediately above this one highp float multiplier = 1.0 - step(centerColor, topColor); multiplier = multiplier * (1.0 - step(centerColor, topLeftColor)); multiplier = multiplier * (1.0 - step(centerColor, leftColor)); multiplier = multiplier * (1.0 - step(centerColor, bottomLeftColor)); multiplier = multiplier * (1.0 - step(centerColor, secondStageColor1)); multiplier = multiplier * (1.0 - step(centerColor, secondStageColor2)); multiplier = multiplier * (1.0 - step(centerColor, secondStageColor3)); multiplier = multiplier * (1.0 - step(centerColor, secondStageColor4)); multiplier = multiplier * (1.0 - step(centerColor, secondStageColor5)); multiplier = multiplier * (1.0 - step(centerColor, secondStageColor6)); multiplier = multiplier * (1.0 - step(centerColor, secondStageColor7)); multiplier = multiplier * (1.0 - step(centerColor, secondStageColor8)); highp float maxValue = max(centerColor, bottomColor); maxValue = max(maxValue, bottomRightColor); maxValue = max(maxValue, rightColor); maxValue = max(maxValue, topRightColor); maxValue = max(maxValue, thirdStageColor1); maxValue = max(maxValue, thirdStageColor2); maxValue = max(maxValue, thirdStageColor3); maxValue = max(maxValue, thirdStageColor4); maxValue = max(maxValue, thirdStageColor5); maxValue = max(maxValue, thirdStageColor6); maxValue = max(maxValue, thirdStageColor7); maxValue = max(maxValue, thirdStageColor8); highp float midValue = centerColor * step(maxValue, centerColor) * multiplier; highp float finalValue = step(threshold, midValue); gl_FragColor = vec4(finalValue * centerColor, topLeftColor, topRightColor, topColor); } ); #else NSString *const kGPUImageThresholdedNonMaximumSuppressionFragmentShaderString = SHADER_STRING ( uniform sampler2D inputImageTexture; varying vec2 textureCoordinate; varying vec2 leftTextureCoordinate; varying vec2 rightTextureCoordinate; varying vec2 topTextureCoordinate; varying vec2 topLeftTextureCoordinate; varying vec2 topRightTextureCoordinate; varying vec2 bottomTextureCoordinate; varying vec2 bottomLeftTextureCoordinate; varying vec2 bottomRightTextureCoordinate; uniform float threshold; void main() { float bottomColor = texture2D(inputImageTexture, bottomTextureCoordinate).r; float bottomLeftColor = texture2D(inputImageTexture, bottomLeftTextureCoordinate).r; float bottomRightColor = texture2D(inputImageTexture, bottomRightTextureCoordinate).r; vec4 centerColor = texture2D(inputImageTexture, textureCoordinate); float leftColor = texture2D(inputImageTexture, leftTextureCoordinate).r; float rightColor = texture2D(inputImageTexture, rightTextureCoordinate).r; float topColor = texture2D(inputImageTexture, topTextureCoordinate).r; float topRightColor = texture2D(inputImageTexture, topRightTextureCoordinate).r; float topLeftColor = texture2D(inputImageTexture, topLeftTextureCoordinate).r; // Use a tiebreaker for pixels to the left and immediately above this one float multiplier = 1.0 - step(centerColor.r, topColor); multiplier = multiplier * (1.0 - step(centerColor.r, topLeftColor)); multiplier = multiplier * (1.0 - step(centerColor.r, leftColor)); multiplier = multiplier * (1.0 - step(centerColor.r, bottomLeftColor)); float maxValue = max(centerColor.r, bottomColor); maxValue = max(maxValue, bottomRightColor); maxValue = max(maxValue, rightColor); maxValue = max(maxValue, topRightColor); float finalValue = centerColor.r * step(maxValue, centerColor.r) * multiplier; finalValue = step(threshold, finalValue); gl_FragColor = vec4(finalValue, finalValue, finalValue, 1.0); // // gl_FragColor = vec4((centerColor.rgb * step(maxValue, step(threshold, centerColor.r)) * multiplier), 1.0); } ); NSString *const kGPUImageThresholdedNonMaximumSuppressionPackedColorspaceFragmentShaderString = SHADER_STRING ( uniform sampler2D inputImageTexture; varying vec2 textureCoordinate; varying vec2 leftTextureCoordinate; varying vec2 rightTextureCoordinate; varying vec2 topTextureCoordinate; varying vec2 topLeftTextureCoordinate; varying vec2 topRightTextureCoordinate; varying vec2 bottomTextureCoordinate; varying vec2 bottomLeftTextureCoordinate; varying vec2 bottomRightTextureCoordinate; uniform float threshold; void main() { float bottomColor = texture2D(inputImageTexture, bottomTextureCoordinate).r; float bottomLeftColor = texture2D(inputImageTexture, bottomLeftTextureCoordinate).r; float bottomRightColor = texture2D(inputImageTexture, bottomRightTextureCoordinate).r; vec4 centerColor = texture2D(inputImageTexture, textureCoordinate); float leftColor = texture2D(inputImageTexture, leftTextureCoordinate).r; float rightColor = texture2D(inputImageTexture, rightTextureCoordinate).r; float topColor = texture2D(inputImageTexture, topTextureCoordinate).r; float topRightColor = texture2D(inputImageTexture, topRightTextureCoordinate).r; float topLeftColor = texture2D(inputImageTexture, topLeftTextureCoordinate).r; // Use a tiebreaker for pixels to the left and immediately above this one float multiplier = 1.0 - step(centerColor.r, topColor); multiplier = multiplier * (1.0 - step(centerColor.r, topLeftColor)); multiplier = multiplier * (1.0 - step(centerColor.r, leftColor)); multiplier = multiplier * (1.0 - step(centerColor.r, bottomLeftColor)); float maxValue = max(centerColor.r, bottomColor); maxValue = max(maxValue, bottomRightColor); maxValue = max(maxValue, rightColor); maxValue = max(maxValue, topRightColor); float finalValue = centerColor.r * step(maxValue, centerColor.r) * multiplier; finalValue = step(threshold, finalValue); gl_FragColor = vec4(finalValue, finalValue, finalValue, 1.0); // // gl_FragColor = vec4((centerColor.rgb * step(maxValue, step(threshold, centerColor.r)) * multiplier), 1.0); } ); #endif @implementation GPUImageThresholdedNonMaximumSuppressionFilter @synthesize threshold = _threshold; #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [self initWithPackedColorspace:NO])) { return nil; } return self; } - (id)initWithPackedColorspace:(BOOL)inputUsesPackedColorspace; { NSString *shaderString; if (inputUsesPackedColorspace) { shaderString = kGPUImageThresholdedNonMaximumSuppressionPackedColorspaceFragmentShaderString; } else { shaderString = kGPUImageThresholdedNonMaximumSuppressionFragmentShaderString; } if (!(self = [super initWithFragmentShaderFromString:shaderString])) { return nil; } thresholdUniform = [filterProgram uniformIndex:@"threshold"]; self.threshold = 0.9; return self; } #pragma mark - #pragma mark Accessors - (void)setThreshold:(CGFloat)newValue; { _threshold = newValue; [self setFloat:_threshold forUniform:thresholdUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImageTiltShiftFilter.h ================================================ #import "GPUImageFilterGroup.h" @class GPUImageGaussianBlurFilter; /// A simulated tilt shift lens effect @interface GPUImageTiltShiftFilter : GPUImageFilterGroup { GPUImageGaussianBlurFilter *blurFilter; GPUImageFilter *tiltShiftFilter; } /// The radius of the underlying blur, in pixels. This is 7.0 by default. @property(readwrite, nonatomic) CGFloat blurRadiusInPixels; /// The normalized location of the top of the in-focus area in the image, this value should be lower than bottomFocusLevel, default 0.4 @property(readwrite, nonatomic) CGFloat topFocusLevel; /// The normalized location of the bottom of the in-focus area in the image, this value should be higher than topFocusLevel, default 0.6 @property(readwrite, nonatomic) CGFloat bottomFocusLevel; /// The rate at which the image gets blurry away from the in-focus region, default 0.2 @property(readwrite, nonatomic) CGFloat focusFallOffRate; @end ================================================ FILE: framework/Source/GPUImageTiltShiftFilter.m ================================================ #import "GPUImageTiltShiftFilter.h" #import "GPUImageFilter.h" #import "GPUImageTwoInputFilter.h" #import "GPUImageGaussianBlurFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageTiltShiftFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; varying highp vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; uniform highp float topFocusLevel; uniform highp float bottomFocusLevel; uniform highp float focusFallOffRate; void main() { lowp vec4 sharpImageColor = texture2D(inputImageTexture, textureCoordinate); lowp vec4 blurredImageColor = texture2D(inputImageTexture2, textureCoordinate2); lowp float blurIntensity = 1.0 - smoothstep(topFocusLevel - focusFallOffRate, topFocusLevel, textureCoordinate2.y); blurIntensity += smoothstep(bottomFocusLevel, bottomFocusLevel + focusFallOffRate, textureCoordinate2.y); gl_FragColor = mix(sharpImageColor, blurredImageColor, blurIntensity); } ); #else NSString *const kGPUImageTiltShiftFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; varying vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; uniform float topFocusLevel; uniform float bottomFocusLevel; uniform float focusFallOffRate; void main() { vec4 sharpImageColor = texture2D(inputImageTexture, textureCoordinate); vec4 blurredImageColor = texture2D(inputImageTexture2, textureCoordinate2); float blurIntensity = 1.0 - smoothstep(topFocusLevel - focusFallOffRate, topFocusLevel, textureCoordinate2.y); blurIntensity += smoothstep(bottomFocusLevel, bottomFocusLevel + focusFallOffRate, textureCoordinate2.y); gl_FragColor = mix(sharpImageColor, blurredImageColor, blurIntensity); } ); #endif @implementation GPUImageTiltShiftFilter @synthesize blurRadiusInPixels; @synthesize topFocusLevel = _topFocusLevel; @synthesize bottomFocusLevel = _bottomFocusLevel; @synthesize focusFallOffRate = _focusFallOffRate; - (id)init; { if (!(self = [super init])) { return nil; } // First pass: apply a variable Gaussian blur blurFilter = [[GPUImageGaussianBlurFilter alloc] init]; [self addFilter:blurFilter]; // Second pass: combine the blurred image with the original sharp one tiltShiftFilter = [[GPUImageTwoInputFilter alloc] initWithFragmentShaderFromString:kGPUImageTiltShiftFragmentShaderString]; [self addFilter:tiltShiftFilter]; // Texture location 0 needs to be the sharp image for both the blur and the second stage processing [blurFilter addTarget:tiltShiftFilter atTextureLocation:1]; // To prevent double updating of this filter, disable updates from the sharp image side // self.inputFilterToIgnoreForUpdates = tiltShiftFilter; self.initialFilters = [NSArray arrayWithObjects:blurFilter, tiltShiftFilter, nil]; self.terminalFilter = tiltShiftFilter; self.topFocusLevel = 0.4; self.bottomFocusLevel = 0.6; self.focusFallOffRate = 0.2; self.blurRadiusInPixels = 7.0; return self; } #pragma mark - #pragma mark Accessors - (void)setBlurRadiusInPixels:(CGFloat)newValue; { blurFilter.blurRadiusInPixels = newValue; } - (CGFloat)blurRadiusInPixels; { return blurFilter.blurRadiusInPixels; } - (void)setTopFocusLevel:(CGFloat)newValue; { _topFocusLevel = newValue; [tiltShiftFilter setFloat:newValue forUniformName:@"topFocusLevel"]; } - (void)setBottomFocusLevel:(CGFloat)newValue; { _bottomFocusLevel = newValue; [tiltShiftFilter setFloat:newValue forUniformName:@"bottomFocusLevel"]; } - (void)setFocusFallOffRate:(CGFloat)newValue; { _focusFallOffRate = newValue; [tiltShiftFilter setFloat:newValue forUniformName:@"focusFallOffRate"]; } @end ================================================ FILE: framework/Source/GPUImageToneCurveFilter.h ================================================ #import "GPUImageFilter.h" @interface GPUImageToneCurveFilter : GPUImageFilter @property(readwrite, nonatomic, copy) NSArray *redControlPoints; @property(readwrite, nonatomic, copy) NSArray *greenControlPoints; @property(readwrite, nonatomic, copy) NSArray *blueControlPoints; @property(readwrite, nonatomic, copy) NSArray *rgbCompositeControlPoints; // Initialization and teardown - (id)initWithACVData:(NSData*)data; - (id)initWithACV:(NSString*)curveFilename; - (id)initWithACVURL:(NSURL*)curveFileURL; // This lets you set all three red, green, and blue tone curves at once. // NOTE: Deprecated this function because this effect can be accomplished // using the rgbComposite channel rather then setting all 3 R, G, and B channels. - (void)setRGBControlPoints:(NSArray *)points DEPRECATED_ATTRIBUTE; - (void)setPointsWithACV:(NSString*)curveFilename; - (void)setPointsWithACVURL:(NSURL*)curveFileURL; // Curve calculation - (NSMutableArray *)getPreparedSplineCurve:(NSArray *)points; - (NSMutableArray *)splineCurve:(NSArray *)points; - (NSMutableArray *)secondDerivative:(NSArray *)cgPoints; - (void)updateToneCurveTexture; @end ================================================ FILE: framework/Source/GPUImageToneCurveFilter.m ================================================ #import "GPUImageToneCurveFilter.h" #pragma mark - #pragma mark GPUImageACVFile Helper // GPUImageACVFile // // ACV File format Parser // Please refer to http://www.adobe.com/devnet-apps/photoshop/fileformatashtml/PhotoshopFileFormats.htm#50577411_pgfId-1056330 // @interface GPUImageACVFile : NSObject{ short version; short totalCurves; NSArray *rgbCompositeCurvePoints; NSArray *redCurvePoints; NSArray *greenCurvePoints; NSArray *blueCurvePoints; } @property(strong,nonatomic) NSArray *rgbCompositeCurvePoints; @property(strong,nonatomic) NSArray *redCurvePoints; @property(strong,nonatomic) NSArray *greenCurvePoints; @property(strong,nonatomic) NSArray *blueCurvePoints; - (id) initWithACVFileData:(NSData*)data; unsigned short int16WithBytes(Byte* bytes); @end @implementation GPUImageACVFile @synthesize rgbCompositeCurvePoints, redCurvePoints, greenCurvePoints, blueCurvePoints; - (id) initWithACVFileData:(NSData *)data { self = [super init]; if (self != nil) { if (data.length == 0) { NSLog(@"failed to init ACVFile with data:%@", data); return self; } Byte* rawBytes = (Byte*) [data bytes]; version = int16WithBytes(rawBytes); rawBytes+=2; totalCurves = int16WithBytes(rawBytes); rawBytes+=2; NSMutableArray *curves = [NSMutableArray new]; float pointRate = (1.0 / 255); // The following is the data for each curve specified by count above for (NSInteger x = 0; x 0) { // Sort the array. NSArray *sortedPoints = [points sortedArrayUsingComparator:^NSComparisonResult(id a, id b) { #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE float x1 = [(NSValue *)a CGPointValue].x; float x2 = [(NSValue *)b CGPointValue].x; #else float x1 = [(NSValue *)a pointValue].x; float x2 = [(NSValue *)b pointValue].x; #endif return x1 > x2; }]; // Convert from (0, 1) to (0, 255). NSMutableArray *convertedPoints = [NSMutableArray arrayWithCapacity:[sortedPoints count]]; for (int i=0; i<[points count]; i++){ #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE CGPoint point = [[sortedPoints objectAtIndex:i] CGPointValue]; #else NSPoint point = [[sortedPoints objectAtIndex:i] pointValue]; #endif point.x = point.x * 255; point.y = point.y * 255; #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE [convertedPoints addObject:[NSValue valueWithCGPoint:point]]; #else [convertedPoints addObject:[NSValue valueWithPoint:point]]; #endif } NSMutableArray *splinePoints = [self splineCurve:convertedPoints]; // If we have a first point like (0.3, 0) we'll be missing some points at the beginning // that should be 0. #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE CGPoint firstSplinePoint = [[splinePoints objectAtIndex:0] CGPointValue]; #else NSPoint firstSplinePoint = [[splinePoints objectAtIndex:0] pointValue]; #endif if (firstSplinePoint.x > 0) { for (int i=firstSplinePoint.x; i >= 0; i--) { #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE CGPoint newCGPoint = CGPointMake(i, 0); [splinePoints insertObject:[NSValue valueWithCGPoint:newCGPoint] atIndex:0]; #else NSPoint newNSPoint = NSMakePoint(i, 0); [splinePoints insertObject:[NSValue valueWithPoint:newNSPoint] atIndex:0]; #endif } } // Insert points similarly at the end, if necessary. #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE CGPoint lastSplinePoint = [[splinePoints lastObject] CGPointValue]; if (lastSplinePoint.x < 255) { for (int i = lastSplinePoint.x + 1; i <= 255; i++) { CGPoint newCGPoint = CGPointMake(i, 255); [splinePoints addObject:[NSValue valueWithCGPoint:newCGPoint]]; } } #else NSPoint lastSplinePoint = [[splinePoints lastObject] pointValue]; if (lastSplinePoint.x < 255) { for (int i = lastSplinePoint.x + 1; i <= 255; i++) { NSPoint newNSPoint = NSMakePoint(i, 255); [splinePoints addObject:[NSValue valueWithPoint:newNSPoint]]; } } #endif // Prepare the spline points. NSMutableArray *preparedSplinePoints = [NSMutableArray arrayWithCapacity:[splinePoints count]]; for (int i=0; i<[splinePoints count]; i++) { #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE CGPoint newPoint = [[splinePoints objectAtIndex:i] CGPointValue]; #else NSPoint newPoint = [[splinePoints objectAtIndex:i] pointValue]; #endif CGPoint origPoint = CGPointMake(newPoint.x, newPoint.x); float distance = sqrt(pow((origPoint.x - newPoint.x), 2.0) + pow((origPoint.y - newPoint.y), 2.0)); if (origPoint.y > newPoint.y) { distance = -distance; } [preparedSplinePoints addObject:[NSNumber numberWithFloat:distance]]; } return preparedSplinePoints; } return nil; } - (NSMutableArray *)splineCurve:(NSArray *)points { NSMutableArray *sdA = [self secondDerivative:points]; // [points count] is equal to [sdA count] NSInteger n = [sdA count]; if (n < 1) { return nil; } double sd[n]; // From NSMutableArray to sd[n]; for (int i=0; i 255.0) { y = 255.0; } else if (y < 0.0) { y = 0.0; } #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE [output addObject:[NSValue valueWithCGPoint:CGPointMake(x, y)]]; #else [output addObject:[NSValue valueWithPoint:NSMakePoint(x, y)]]; #endif } } // The above always misses the last point because the last point is the last next, so we approach but don't equal it. [output addObject:[points lastObject]]; return output; } - (NSMutableArray *)secondDerivative:(NSArray *)points { const NSInteger n = [points count]; if ((n <= 0) || (n == 1)) { return nil; } double matrix[n][3]; double result[n]; matrix[0][1]=1; // What about matrix[0][1] and matrix[0][0]? Assuming 0 for now (Brad L.) matrix[0][0]=0; matrix[0][2]=0; for(int i=1;idown) for(int i=1;iup) for(NSInteger i=n-2;i>=0;i--) { double k = matrix[i][2]/matrix[i+1][1]; matrix[i][1] -= k*matrix[i+1][0]; matrix[i][2] = 0; result[i] -= k*result[i+1]; } double y2[n]; for(int i=0;i= 256) && ([_greenCurve count] >= 256) && ([_blueCurve count] >= 256) && ([_rgbCompositeCurve count] >= 256)) { for (unsigned int currentCurveIndex = 0; currentCurveIndex < 256; currentCurveIndex++) { // BGRA for upload to texture GLubyte b = fmin(fmax(currentCurveIndex + [[_blueCurve objectAtIndex:currentCurveIndex] floatValue], 0), 255); toneCurveByteArray[currentCurveIndex * 4] = fmin(fmax(b + [[_rgbCompositeCurve objectAtIndex:b] floatValue], 0), 255); GLubyte g = fmin(fmax(currentCurveIndex + [[_greenCurve objectAtIndex:currentCurveIndex] floatValue], 0), 255); toneCurveByteArray[currentCurveIndex * 4 + 1] = fmin(fmax(g + [[_rgbCompositeCurve objectAtIndex:g] floatValue], 0), 255); GLubyte r = fmin(fmax(currentCurveIndex + [[_redCurve objectAtIndex:currentCurveIndex] floatValue], 0), 255); toneCurveByteArray[currentCurveIndex * 4 + 2] = fmin(fmax(r + [[_rgbCompositeCurve objectAtIndex:r] floatValue], 0), 255); toneCurveByteArray[currentCurveIndex * 4 + 3] = 255; } glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 256 /*width*/, 1 /*height*/, 0, GL_BGRA, GL_UNSIGNED_BYTE, toneCurveByteArray); } }); } #pragma mark - #pragma mark Rendering - (void)renderToTextureWithVertices:(const GLfloat *)vertices textureCoordinates:(const GLfloat *)textureCoordinates; { if (self.preventRendering) { [firstInputFramebuffer unlock]; return; } [GPUImageContext setActiveShaderProgram:filterProgram]; outputFramebuffer = [[GPUImageContext sharedFramebufferCache] fetchFramebufferForSize:[self sizeOfFBO] textureOptions:self.outputTextureOptions onlyTexture:NO]; [outputFramebuffer activateFramebuffer]; if (usingNextFrameForImageCapture) { [outputFramebuffer lock]; } glClearColor(backgroundColorRed, backgroundColorGreen, backgroundColorBlue, backgroundColorAlpha); glClear(GL_COLOR_BUFFER_BIT); glActiveTexture(GL_TEXTURE2); glBindTexture(GL_TEXTURE_2D, [firstInputFramebuffer texture]); glUniform1i(filterInputTextureUniform, 2); glActiveTexture(GL_TEXTURE3); glBindTexture(GL_TEXTURE_2D, toneCurveTexture); glUniform1i(toneCurveTextureUniform, 3); glVertexAttribPointer(filterPositionAttribute, 2, GL_FLOAT, 0, 0, vertices); glVertexAttribPointer(filterTextureCoordinateAttribute, 2, GL_FLOAT, 0, 0, textureCoordinates); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); [firstInputFramebuffer unlock]; if (usingNextFrameForImageCapture) { dispatch_semaphore_signal(imageCaptureSemaphore); } } #pragma mark - #pragma mark Accessors - (void)setRGBControlPoints:(NSArray *)points { _redControlPoints = [points copy]; _redCurve = [self getPreparedSplineCurve:_redControlPoints]; _greenControlPoints = [points copy]; _greenCurve = [self getPreparedSplineCurve:_greenControlPoints]; _blueControlPoints = [points copy]; _blueCurve = [self getPreparedSplineCurve:_blueControlPoints]; [self updateToneCurveTexture]; } - (void)setRgbCompositeControlPoints:(NSArray *)newValue { _rgbCompositeControlPoints = [newValue copy]; _rgbCompositeCurve = [self getPreparedSplineCurve:_rgbCompositeControlPoints]; [self updateToneCurveTexture]; } - (void)setRedControlPoints:(NSArray *)newValue; { _redControlPoints = [newValue copy]; _redCurve = [self getPreparedSplineCurve:_redControlPoints]; [self updateToneCurveTexture]; } - (void)setGreenControlPoints:(NSArray *)newValue { _greenControlPoints = [newValue copy]; _greenCurve = [self getPreparedSplineCurve:_greenControlPoints]; [self updateToneCurveTexture]; } - (void)setBlueControlPoints:(NSArray *)newValue { _blueControlPoints = [newValue copy]; _blueCurve = [self getPreparedSplineCurve:_blueControlPoints]; [self updateToneCurveTexture]; } @end ================================================ FILE: framework/Source/GPUImageToonFilter.h ================================================ #import "GPUImage3x3TextureSamplingFilter.h" /** 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. */ @interface GPUImageToonFilter : GPUImage3x3TextureSamplingFilter { GLint thresholdUniform, quantizationLevelsUniform; } /** The threshold at which to apply the edges, default of 0.2 */ @property(readwrite, nonatomic) CGFloat threshold; /** The levels of quantization for the posterization of colors within the scene, with a default of 10.0 */ @property(readwrite, nonatomic) CGFloat quantizationLevels; @end ================================================ FILE: framework/Source/GPUImageToonFilter.m ================================================ #import "GPUImageToonFilter.h" #import "GPUImageSobelEdgeDetectionFilter.h" #import "GPUImage3x3ConvolutionFilter.h" // Code from "Graphics Shaders: Theory and Practice" by M. Bailey and S. Cunningham #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageToonFragmentShaderString = SHADER_STRING ( precision highp float; varying vec2 textureCoordinate; varying vec2 leftTextureCoordinate; varying vec2 rightTextureCoordinate; varying vec2 topTextureCoordinate; varying vec2 topLeftTextureCoordinate; varying vec2 topRightTextureCoordinate; varying vec2 bottomTextureCoordinate; varying vec2 bottomLeftTextureCoordinate; varying vec2 bottomRightTextureCoordinate; uniform sampler2D inputImageTexture; uniform highp float intensity; uniform highp float threshold; uniform highp float quantizationLevels; const highp vec3 W = vec3(0.2125, 0.7154, 0.0721); void main() { vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); float bottomLeftIntensity = texture2D(inputImageTexture, bottomLeftTextureCoordinate).r; float topRightIntensity = texture2D(inputImageTexture, topRightTextureCoordinate).r; float topLeftIntensity = texture2D(inputImageTexture, topLeftTextureCoordinate).r; float bottomRightIntensity = texture2D(inputImageTexture, bottomRightTextureCoordinate).r; float leftIntensity = texture2D(inputImageTexture, leftTextureCoordinate).r; float rightIntensity = texture2D(inputImageTexture, rightTextureCoordinate).r; float bottomIntensity = texture2D(inputImageTexture, bottomTextureCoordinate).r; float topIntensity = texture2D(inputImageTexture, topTextureCoordinate).r; float h = -topLeftIntensity - 2.0 * topIntensity - topRightIntensity + bottomLeftIntensity + 2.0 * bottomIntensity + bottomRightIntensity; float v = -bottomLeftIntensity - 2.0 * leftIntensity - topLeftIntensity + bottomRightIntensity + 2.0 * rightIntensity + topRightIntensity; float mag = length(vec2(h, v)); vec3 posterizedImageColor = floor((textureColor.rgb * quantizationLevels) + 0.5) / quantizationLevels; float thresholdTest = 1.0 - step(threshold, mag); gl_FragColor = vec4(posterizedImageColor * thresholdTest, textureColor.a); } ); #else NSString *const kGPUImageToonFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; varying vec2 leftTextureCoordinate; varying vec2 rightTextureCoordinate; varying vec2 topTextureCoordinate; varying vec2 topLeftTextureCoordinate; varying vec2 topRightTextureCoordinate; varying vec2 bottomTextureCoordinate; varying vec2 bottomLeftTextureCoordinate; varying vec2 bottomRightTextureCoordinate; uniform sampler2D inputImageTexture; uniform float intensity; uniform float threshold; uniform float quantizationLevels; const vec3 W = vec3(0.2125, 0.7154, 0.0721); void main() { vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); float bottomLeftIntensity = texture2D(inputImageTexture, bottomLeftTextureCoordinate).r; float topRightIntensity = texture2D(inputImageTexture, topRightTextureCoordinate).r; float topLeftIntensity = texture2D(inputImageTexture, topLeftTextureCoordinate).r; float bottomRightIntensity = texture2D(inputImageTexture, bottomRightTextureCoordinate).r; float leftIntensity = texture2D(inputImageTexture, leftTextureCoordinate).r; float rightIntensity = texture2D(inputImageTexture, rightTextureCoordinate).r; float bottomIntensity = texture2D(inputImageTexture, bottomTextureCoordinate).r; float topIntensity = texture2D(inputImageTexture, topTextureCoordinate).r; float h = -topLeftIntensity - 2.0 * topIntensity - topRightIntensity + bottomLeftIntensity + 2.0 * bottomIntensity + bottomRightIntensity; float v = -bottomLeftIntensity - 2.0 * leftIntensity - topLeftIntensity + bottomRightIntensity + 2.0 * rightIntensity + topRightIntensity; float mag = length(vec2(h, v)); vec3 posterizedImageColor = floor((textureColor.rgb * quantizationLevels) + 0.5) / quantizationLevels; float thresholdTest = 1.0 - step(threshold, mag); gl_FragColor = vec4(posterizedImageColor * thresholdTest, textureColor.a); } ); #endif @implementation GPUImageToonFilter @synthesize threshold = _threshold; @synthesize quantizationLevels = _quantizationLevels; #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageToonFragmentShaderString])) { return nil; } hasOverriddenImageSizeFactor = NO; thresholdUniform = [filterProgram uniformIndex:@"threshold"]; quantizationLevelsUniform = [filterProgram uniformIndex:@"quantizationLevels"]; self.threshold = 0.2; self.quantizationLevels = 10.0; return self; } #pragma mark - #pragma mark Accessors - (void)setThreshold:(CGFloat)newValue; { _threshold = newValue; [self setFloat:_threshold forUniform:thresholdUniform program:filterProgram]; } - (void)setQuantizationLevels:(CGFloat)newValue; { _quantizationLevels = newValue; [self setFloat:_quantizationLevels forUniform:quantizationLevelsUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImageTransformFilter.h ================================================ #import "GPUImageFilter.h" @interface GPUImageTransformFilter : GPUImageFilter { GLint transformMatrixUniform, orthographicMatrixUniform; GPUMatrix4x4 orthographicMatrix; } // You can either set the transform to apply to be a 2-D affine transform or a 3-D transform. The default is the identity transform (the output image is identical to the input). @property(readwrite, nonatomic) CGAffineTransform affineTransform; @property(readwrite, nonatomic) CATransform3D transform3D; // This applies the transform to the raw frame data if set to YES, the default of NO takes the aspect ratio of the image input into account when rotating @property(readwrite, nonatomic) BOOL ignoreAspectRatio; // sets the anchor point to top left corner @property(readwrite, nonatomic) BOOL anchorTopLeft; @end ================================================ FILE: framework/Source/GPUImageTransformFilter.m ================================================ #import "GPUImageTransformFilter.h" NSString *const kGPUImageTransformVertexShaderString = SHADER_STRING ( attribute vec4 position; attribute vec4 inputTextureCoordinate; uniform mat4 transformMatrix; uniform mat4 orthographicMatrix; varying vec2 textureCoordinate; void main() { gl_Position = transformMatrix * vec4(position.xyz, 1.0) * orthographicMatrix; textureCoordinate = inputTextureCoordinate.xy; } ); @implementation GPUImageTransformFilter @synthesize affineTransform; @synthesize transform3D = _transform3D; @synthesize ignoreAspectRatio = _ignoreAspectRatio; @synthesize anchorTopLeft = _anchorTopLeft; #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super initWithVertexShaderFromString:kGPUImageTransformVertexShaderString fragmentShaderFromString:kGPUImagePassthroughFragmentShaderString])) { return nil; } transformMatrixUniform = [filterProgram uniformIndex:@"transformMatrix"]; orthographicMatrixUniform = [filterProgram uniformIndex:@"orthographicMatrix"]; self.transform3D = CATransform3DIdentity; return self; } #pragma mark - #pragma mark Conversion from matrix formats - (void)loadOrthoMatrix:(GLfloat *)matrix left:(GLfloat)left right:(GLfloat)right bottom:(GLfloat)bottom top:(GLfloat)top near:(GLfloat)near far:(GLfloat)far; { GLfloat r_l = right - left; GLfloat t_b = top - bottom; GLfloat f_n = far - near; GLfloat tx = - (right + left) / (right - left); GLfloat ty = - (top + bottom) / (top - bottom); GLfloat tz = - (far + near) / (far - near); float scale = 2.0f; if (_anchorTopLeft) { scale = 4.0f; tx=-1.0f; ty=-1.0f; } matrix[0] = scale / r_l; matrix[1] = 0.0f; matrix[2] = 0.0f; matrix[3] = tx; matrix[4] = 0.0f; matrix[5] = scale / t_b; matrix[6] = 0.0f; matrix[7] = ty; matrix[8] = 0.0f; matrix[9] = 0.0f; matrix[10] = scale / f_n; matrix[11] = tz; matrix[12] = 0.0f; matrix[13] = 0.0f; matrix[14] = 0.0f; matrix[15] = 1.0f; } //- (void)convert3DTransform:(CATransform3D *)transform3D toMatrix:(GLfloat *)matrix; //{ // // struct CATransform3D // // { // // CGFloat m11, m12, m13, m14; // // CGFloat m21, m22, m23, m24; // // CGFloat m31, m32, m33, m34; // // CGFloat m41, m42, m43, m44; // // }; // // matrix[0] = (GLfloat)transform3D->m11; // matrix[1] = (GLfloat)transform3D->m12; // matrix[2] = (GLfloat)transform3D->m13; // matrix[3] = (GLfloat)transform3D->m14; // matrix[4] = (GLfloat)transform3D->m21; // matrix[5] = (GLfloat)transform3D->m22; // matrix[6] = (GLfloat)transform3D->m23; // matrix[7] = (GLfloat)transform3D->m24; // matrix[8] = (GLfloat)transform3D->m31; // matrix[9] = (GLfloat)transform3D->m32; // matrix[10] = (GLfloat)transform3D->m33; // matrix[11] = (GLfloat)transform3D->m34; // matrix[12] = (GLfloat)transform3D->m41; // matrix[13] = (GLfloat)transform3D->m42; // matrix[14] = (GLfloat)transform3D->m43; // matrix[15] = (GLfloat)transform3D->m44; //} - (void)convert3DTransform:(CATransform3D *)transform3D toMatrix:(GPUMatrix4x4 *)matrix; { // struct CATransform3D // { // CGFloat m11, m12, m13, m14; // CGFloat m21, m22, m23, m24; // CGFloat m31, m32, m33, m34; // CGFloat m41, m42, m43, m44; // }; GLfloat *mappedMatrix = (GLfloat *)matrix; mappedMatrix[0] = (GLfloat)transform3D->m11; mappedMatrix[1] = (GLfloat)transform3D->m12; mappedMatrix[2] = (GLfloat)transform3D->m13; mappedMatrix[3] = (GLfloat)transform3D->m14; mappedMatrix[4] = (GLfloat)transform3D->m21; mappedMatrix[5] = (GLfloat)transform3D->m22; mappedMatrix[6] = (GLfloat)transform3D->m23; mappedMatrix[7] = (GLfloat)transform3D->m24; mappedMatrix[8] = (GLfloat)transform3D->m31; mappedMatrix[9] = (GLfloat)transform3D->m32; mappedMatrix[10] = (GLfloat)transform3D->m33; mappedMatrix[11] = (GLfloat)transform3D->m34; mappedMatrix[12] = (GLfloat)transform3D->m41; mappedMatrix[13] = (GLfloat)transform3D->m42; mappedMatrix[14] = (GLfloat)transform3D->m43; mappedMatrix[15] = (GLfloat)transform3D->m44; } #pragma mark - #pragma mark GPUImageInput - (void)newFrameReadyAtTime:(CMTime)frameTime atIndex:(NSInteger)textureIndex; { CGSize currentFBOSize = [self sizeOfFBO]; CGFloat normalizedHeight = currentFBOSize.height / currentFBOSize.width; GLfloat adjustedVertices[] = { -1.0f, -normalizedHeight, 1.0f, -normalizedHeight, -1.0f, normalizedHeight, 1.0f, normalizedHeight, }; static const GLfloat squareVertices[] = { -1.0f, -1.0f, 1.0f, -1.0f, -1.0f, 1.0f, 1.0f, 1.0f, }; GLfloat adjustedVerticesAnchorTL[] = { 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, normalizedHeight, 1.0f, normalizedHeight, }; static const GLfloat squareVerticesAnchorTL[] = { 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, }; if (_ignoreAspectRatio) { if (_anchorTopLeft) { [self renderToTextureWithVertices:squareVerticesAnchorTL textureCoordinates:[[self class] textureCoordinatesForRotation:inputRotation]]; } else { [self renderToTextureWithVertices:squareVertices textureCoordinates:[[self class] textureCoordinatesForRotation:inputRotation]]; } } else { if (_anchorTopLeft) { [self renderToTextureWithVertices:adjustedVerticesAnchorTL textureCoordinates:[[self class] textureCoordinatesForRotation:inputRotation]]; } else { [self renderToTextureWithVertices:adjustedVertices textureCoordinates:[[self class] textureCoordinatesForRotation:inputRotation]]; } } [self informTargetsAboutNewFrameAtTime:frameTime]; } - (void)setupFilterForSize:(CGSize)filterFrameSize; { if (!_ignoreAspectRatio) { [self loadOrthoMatrix:(GLfloat *)&orthographicMatrix left:-1.0 right:1.0 bottom:(-1.0 * filterFrameSize.height / filterFrameSize.width) top:(1.0 * filterFrameSize.height / filterFrameSize.width) near:-1.0 far:1.0]; // [self loadOrthoMatrix:orthographicMatrix left:-1.0 right:1.0 bottom:(-1.0 * (GLfloat)backingHeight / (GLfloat)backingWidth) top:(1.0 * (GLfloat)backingHeight / (GLfloat)backingWidth) near:-2.0 far:2.0]; [self setMatrix4f:orthographicMatrix forUniform:orthographicMatrixUniform program:filterProgram]; } } #pragma mark - #pragma mark Accessors - (void)setAffineTransform:(CGAffineTransform)newValue; { self.transform3D = CATransform3DMakeAffineTransform(newValue); } - (CGAffineTransform)affineTransform; { return CATransform3DGetAffineTransform(self.transform3D); } - (void)setTransform3D:(CATransform3D)newValue; { _transform3D = newValue; GPUMatrix4x4 temporaryMatrix; [self convert3DTransform:&_transform3D toMatrix:&temporaryMatrix]; [self setMatrix4f:temporaryMatrix forUniform:transformMatrixUniform program:filterProgram]; } - (void)setIgnoreAspectRatio:(BOOL)newValue; { _ignoreAspectRatio = newValue; if (_ignoreAspectRatio) { [self loadOrthoMatrix:(GLfloat *)&orthographicMatrix left:-1.0 right:1.0 bottom:-1.0 top:1.0 near:-1.0 far:1.0]; [self setMatrix4f:orthographicMatrix forUniform:orthographicMatrixUniform program:filterProgram]; } else { [self setupFilterForSize:[self sizeOfFBO]]; } } - (void)setAnchorTopLeft:(BOOL)newValue { _anchorTopLeft = newValue; [self setIgnoreAspectRatio:_ignoreAspectRatio]; } @end ================================================ FILE: framework/Source/GPUImageTwoInputCrossTextureSamplingFilter.h ================================================ #import "GPUImageTwoInputFilter.h" @interface GPUImageTwoInputCrossTextureSamplingFilter : GPUImageTwoInputFilter { GLint texelWidthUniform, texelHeightUniform; CGFloat texelWidth, texelHeight; BOOL hasOverriddenImageSizeFactor; } // The texel width and height determines how far out to sample from this texel. By default, this is the normalized width of a pixel, but this can be overridden for different effects. @property(readwrite, nonatomic) CGFloat texelWidth; @property(readwrite, nonatomic) CGFloat texelHeight; @end ================================================ FILE: framework/Source/GPUImageTwoInputCrossTextureSamplingFilter.m ================================================ #import "GPUImageTwoInputCrossTextureSamplingFilter.h" NSString *const kGPUImageTwoInputNearbyTexelSamplingVertexShaderString = SHADER_STRING ( attribute vec4 position; attribute vec4 inputTextureCoordinate; attribute vec4 inputTextureCoordinate2; uniform float texelWidth; uniform float texelHeight; varying vec2 textureCoordinate; varying vec2 leftTextureCoordinate; varying vec2 rightTextureCoordinate; varying vec2 topTextureCoordinate; varying vec2 bottomTextureCoordinate; varying vec2 textureCoordinate2; varying vec2 leftTextureCoordinate2; varying vec2 rightTextureCoordinate2; varying vec2 topTextureCoordinate2; varying vec2 bottomTextureCoordinate2; void main() { gl_Position = position; vec2 widthStep = vec2(texelWidth, 0.0); vec2 heightStep = vec2(0.0, texelHeight); textureCoordinate = inputTextureCoordinate.xy; leftTextureCoordinate = inputTextureCoordinate.xy - widthStep; rightTextureCoordinate = inputTextureCoordinate.xy + widthStep; topTextureCoordinate = inputTextureCoordinate.xy - heightStep; bottomTextureCoordinate = inputTextureCoordinate.xy + heightStep; textureCoordinate2 = inputTextureCoordinate2.xy; leftTextureCoordinate2 = inputTextureCoordinate2.xy - widthStep; rightTextureCoordinate2 = inputTextureCoordinate2.xy + widthStep; topTextureCoordinate2 = inputTextureCoordinate2.xy - heightStep; bottomTextureCoordinate2 = inputTextureCoordinate2.xy + heightStep; } ); @implementation GPUImageTwoInputCrossTextureSamplingFilter @synthesize texelWidth = _texelWidth; @synthesize texelHeight = _texelHeight; #pragma mark - #pragma mark Initialization and teardown - (id)initWithFragmentShaderFromString:(NSString *)fragmentShaderString; { if (!(self = [super initWithVertexShaderFromString:kGPUImageTwoInputNearbyTexelSamplingVertexShaderString fragmentShaderFromString:fragmentShaderString])) { return nil; } texelWidthUniform = [filterProgram uniformIndex:@"texelWidth"]; texelHeightUniform = [filterProgram uniformIndex:@"texelHeight"]; return self; } - (void)setupFilterForSize:(CGSize)filterFrameSize; { if (!hasOverriddenImageSizeFactor) { _texelWidth = 1.0 / filterFrameSize.width; _texelHeight = 1.0 / filterFrameSize.height; runSynchronouslyOnVideoProcessingQueue(^{ [GPUImageContext setActiveShaderProgram:filterProgram]; if (GPUImageRotationSwapsWidthAndHeight(inputRotation)) { glUniform1f(texelWidthUniform, _texelHeight); glUniform1f(texelHeightUniform, _texelWidth); } else { glUniform1f(texelWidthUniform, _texelWidth); glUniform1f(texelHeightUniform, _texelHeight); } }); } } #pragma mark - #pragma mark Accessors - (void)setTexelWidth:(CGFloat)newValue; { hasOverriddenImageSizeFactor = YES; _texelWidth = newValue; [self setFloat:_texelWidth forUniform:texelWidthUniform program:filterProgram]; } - (void)setTexelHeight:(CGFloat)newValue; { hasOverriddenImageSizeFactor = YES; _texelHeight = newValue; [self setFloat:_texelHeight forUniform:texelHeightUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImageTwoInputFilter.h ================================================ #import "GPUImageFilter.h" extern NSString *const kGPUImageTwoInputTextureVertexShaderString; @interface GPUImageTwoInputFilter : GPUImageFilter { GPUImageFramebuffer *secondInputFramebuffer; GLint filterSecondTextureCoordinateAttribute; GLint filterInputTextureUniform2; GPUImageRotationMode inputRotation2; CMTime firstFrameTime, secondFrameTime; BOOL hasSetFirstTexture, hasReceivedFirstFrame, hasReceivedSecondFrame, firstFrameWasVideo, secondFrameWasVideo; BOOL firstFrameCheckDisabled, secondFrameCheckDisabled; } - (void)disableFirstFrameCheck; - (void)disableSecondFrameCheck; @end ================================================ FILE: framework/Source/GPUImageTwoInputFilter.m ================================================ #import "GPUImageTwoInputFilter.h" NSString *const kGPUImageTwoInputTextureVertexShaderString = SHADER_STRING ( attribute vec4 position; attribute vec4 inputTextureCoordinate; attribute vec4 inputTextureCoordinate2; varying vec2 textureCoordinate; varying vec2 textureCoordinate2; void main() { gl_Position = position; textureCoordinate = inputTextureCoordinate.xy; textureCoordinate2 = inputTextureCoordinate2.xy; } ); @implementation GPUImageTwoInputFilter #pragma mark - #pragma mark Initialization and teardown - (id)initWithFragmentShaderFromString:(NSString *)fragmentShaderString; { if (!(self = [self initWithVertexShaderFromString:kGPUImageTwoInputTextureVertexShaderString fragmentShaderFromString:fragmentShaderString])) { return nil; } return self; } - (id)initWithVertexShaderFromString:(NSString *)vertexShaderString fragmentShaderFromString:(NSString *)fragmentShaderString; { if (!(self = [super initWithVertexShaderFromString:vertexShaderString fragmentShaderFromString:fragmentShaderString])) { return nil; } inputRotation2 = kGPUImageNoRotation; hasSetFirstTexture = NO; hasReceivedFirstFrame = NO; hasReceivedSecondFrame = NO; firstFrameWasVideo = NO; secondFrameWasVideo = NO; firstFrameCheckDisabled = NO; secondFrameCheckDisabled = NO; firstFrameTime = kCMTimeInvalid; secondFrameTime = kCMTimeInvalid; runSynchronouslyOnVideoProcessingQueue(^{ [GPUImageContext useImageProcessingContext]; filterSecondTextureCoordinateAttribute = [filterProgram attributeIndex:@"inputTextureCoordinate2"]; filterInputTextureUniform2 = [filterProgram uniformIndex:@"inputImageTexture2"]; // This does assume a name of "inputImageTexture2" for second input texture in the fragment shader glEnableVertexAttribArray(filterSecondTextureCoordinateAttribute); }); return self; } - (void)initializeAttributes; { [super initializeAttributes]; [filterProgram addAttribute:@"inputTextureCoordinate2"]; } - (void)disableFirstFrameCheck; { firstFrameCheckDisabled = YES; } - (void)disableSecondFrameCheck; { secondFrameCheckDisabled = YES; } #pragma mark - #pragma mark Rendering - (void)renderToTextureWithVertices:(const GLfloat *)vertices textureCoordinates:(const GLfloat *)textureCoordinates; { if (self.preventRendering) { [firstInputFramebuffer unlock]; [secondInputFramebuffer unlock]; return; } [GPUImageContext setActiveShaderProgram:filterProgram]; outputFramebuffer = [[GPUImageContext sharedFramebufferCache] fetchFramebufferForSize:[self sizeOfFBO] textureOptions:self.outputTextureOptions onlyTexture:NO]; [outputFramebuffer activateFramebuffer]; if (usingNextFrameForImageCapture) { [outputFramebuffer lock]; } [self setUniformsForProgramAtIndex:0]; glClearColor(backgroundColorRed, backgroundColorGreen, backgroundColorBlue, backgroundColorAlpha); glClear(GL_COLOR_BUFFER_BIT); glActiveTexture(GL_TEXTURE2); glBindTexture(GL_TEXTURE_2D, [firstInputFramebuffer texture]); glUniform1i(filterInputTextureUniform, 2); glActiveTexture(GL_TEXTURE3); glBindTexture(GL_TEXTURE_2D, [secondInputFramebuffer texture]); glUniform1i(filterInputTextureUniform2, 3); glVertexAttribPointer(filterPositionAttribute, 2, GL_FLOAT, 0, 0, vertices); glVertexAttribPointer(filterTextureCoordinateAttribute, 2, GL_FLOAT, 0, 0, textureCoordinates); glVertexAttribPointer(filterSecondTextureCoordinateAttribute, 2, GL_FLOAT, 0, 0, [[self class] textureCoordinatesForRotation:inputRotation2]); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); [firstInputFramebuffer unlock]; [secondInputFramebuffer unlock]; if (usingNextFrameForImageCapture) { dispatch_semaphore_signal(imageCaptureSemaphore); } } #pragma mark - #pragma mark GPUImageInput - (NSInteger)nextAvailableTextureIndex; { if (hasSetFirstTexture) { return 1; } else { return 0; } } - (void)setInputFramebuffer:(GPUImageFramebuffer *)newInputFramebuffer atIndex:(NSInteger)textureIndex; { if (textureIndex == 0) { firstInputFramebuffer = newInputFramebuffer; hasSetFirstTexture = YES; [firstInputFramebuffer lock]; } else { secondInputFramebuffer = newInputFramebuffer; [secondInputFramebuffer lock]; } } - (void)setInputSize:(CGSize)newSize atIndex:(NSInteger)textureIndex; { if (textureIndex == 0) { [super setInputSize:newSize atIndex:textureIndex]; if (CGSizeEqualToSize(newSize, CGSizeZero)) { hasSetFirstTexture = NO; } } } - (void)setInputRotation:(GPUImageRotationMode)newInputRotation atIndex:(NSInteger)textureIndex; { if (textureIndex == 0) { inputRotation = newInputRotation; } else { inputRotation2 = newInputRotation; } } - (CGSize)rotatedSize:(CGSize)sizeToRotate forIndex:(NSInteger)textureIndex; { CGSize rotatedSize = sizeToRotate; GPUImageRotationMode rotationToCheck; if (textureIndex == 0) { rotationToCheck = inputRotation; } else { rotationToCheck = inputRotation2; } if (GPUImageRotationSwapsWidthAndHeight(rotationToCheck)) { rotatedSize.width = sizeToRotate.height; rotatedSize.height = sizeToRotate.width; } return rotatedSize; } - (void)newFrameReadyAtTime:(CMTime)frameTime atIndex:(NSInteger)textureIndex; { // You can set up infinite update loops, so this helps to short circuit them if (hasReceivedFirstFrame && hasReceivedSecondFrame) { return; } BOOL updatedMovieFrameOppositeStillImage = NO; if (textureIndex == 0) { hasReceivedFirstFrame = YES; firstFrameTime = frameTime; if (secondFrameCheckDisabled) { hasReceivedSecondFrame = YES; } if (!CMTIME_IS_INDEFINITE(frameTime)) { if CMTIME_IS_INDEFINITE(secondFrameTime) { updatedMovieFrameOppositeStillImage = YES; } } } else { hasReceivedSecondFrame = YES; secondFrameTime = frameTime; if (firstFrameCheckDisabled) { hasReceivedFirstFrame = YES; } if (!CMTIME_IS_INDEFINITE(frameTime)) { if CMTIME_IS_INDEFINITE(firstFrameTime) { updatedMovieFrameOppositeStillImage = YES; } } } // || (hasReceivedFirstFrame && secondFrameCheckDisabled) || (hasReceivedSecondFrame && firstFrameCheckDisabled) if ((hasReceivedFirstFrame && hasReceivedSecondFrame) || updatedMovieFrameOppositeStillImage) { CMTime passOnFrameTime = (!CMTIME_IS_INDEFINITE(firstFrameTime)) ? firstFrameTime : secondFrameTime; [super newFrameReadyAtTime:passOnFrameTime atIndex:0]; // Bugfix when trying to record: always use time from first input (unless indefinite, in which case use the second input) hasReceivedFirstFrame = NO; hasReceivedSecondFrame = NO; } } @end ================================================ FILE: framework/Source/GPUImageTwoPassFilter.h ================================================ #import "GPUImageFilter.h" @interface GPUImageTwoPassFilter : GPUImageFilter { GPUImageFramebuffer *secondOutputFramebuffer; GLProgram *secondFilterProgram; GLint secondFilterPositionAttribute, secondFilterTextureCoordinateAttribute; GLint secondFilterInputTextureUniform, secondFilterInputTextureUniform2; NSMutableDictionary *secondProgramUniformStateRestorationBlocks; } // Initialization and teardown - (id)initWithFirstStageVertexShaderFromString:(NSString *)firstStageVertexShaderString firstStageFragmentShaderFromString:(NSString *)firstStageFragmentShaderString secondStageVertexShaderFromString:(NSString *)secondStageVertexShaderString secondStageFragmentShaderFromString:(NSString *)secondStageFragmentShaderString; - (id)initWithFirstStageFragmentShaderFromString:(NSString *)firstStageFragmentShaderString secondStageFragmentShaderFromString:(NSString *)secondStageFragmentShaderString; - (void)initializeSecondaryAttributes; @end ================================================ FILE: framework/Source/GPUImageTwoPassFilter.m ================================================ #import "GPUImageTwoPassFilter.h" @implementation GPUImageTwoPassFilter #pragma mark - #pragma mark Initialization and teardown - (id)initWithFirstStageVertexShaderFromString:(NSString *)firstStageVertexShaderString firstStageFragmentShaderFromString:(NSString *)firstStageFragmentShaderString secondStageVertexShaderFromString:(NSString *)secondStageVertexShaderString secondStageFragmentShaderFromString:(NSString *)secondStageFragmentShaderString; { if (!(self = [super initWithVertexShaderFromString:firstStageVertexShaderString fragmentShaderFromString:firstStageFragmentShaderString])) { return nil; } secondProgramUniformStateRestorationBlocks = [NSMutableDictionary dictionaryWithCapacity:10]; runSynchronouslyOnVideoProcessingQueue(^{ [GPUImageContext useImageProcessingContext]; secondFilterProgram = [[GPUImageContext sharedImageProcessingContext] programForVertexShaderString:secondStageVertexShaderString fragmentShaderString:secondStageFragmentShaderString]; if (!secondFilterProgram.initialized) { [self initializeSecondaryAttributes]; if (![secondFilterProgram link]) { NSString *progLog = [secondFilterProgram programLog]; NSLog(@"Program link log: %@", progLog); NSString *fragLog = [secondFilterProgram fragmentShaderLog]; NSLog(@"Fragment shader compile log: %@", fragLog); NSString *vertLog = [secondFilterProgram vertexShaderLog]; NSLog(@"Vertex shader compile log: %@", vertLog); secondFilterProgram = nil; NSAssert(NO, @"Filter shader link failed"); } } secondFilterPositionAttribute = [secondFilterProgram attributeIndex:@"position"]; secondFilterTextureCoordinateAttribute = [secondFilterProgram attributeIndex:@"inputTextureCoordinate"]; secondFilterInputTextureUniform = [secondFilterProgram uniformIndex:@"inputImageTexture"]; // This does assume a name of "inputImageTexture" for the fragment shader secondFilterInputTextureUniform2 = [secondFilterProgram uniformIndex:@"inputImageTexture2"]; // This does assume a name of "inputImageTexture2" for second input texture in the fragment shader [GPUImageContext setActiveShaderProgram:secondFilterProgram]; glEnableVertexAttribArray(secondFilterPositionAttribute); glEnableVertexAttribArray(secondFilterTextureCoordinateAttribute); }); return self; } - (id)initWithFirstStageFragmentShaderFromString:(NSString *)firstStageFragmentShaderString secondStageFragmentShaderFromString:(NSString *)secondStageFragmentShaderString; { if (!(self = [self initWithFirstStageVertexShaderFromString:kGPUImageVertexShaderString firstStageFragmentShaderFromString:firstStageFragmentShaderString secondStageVertexShaderFromString:kGPUImageVertexShaderString secondStageFragmentShaderFromString:secondStageFragmentShaderString])) { return nil; } return self; } - (void)initializeSecondaryAttributes; { [secondFilterProgram addAttribute:@"position"]; [secondFilterProgram addAttribute:@"inputTextureCoordinate"]; } #pragma mark - #pragma mark Managing targets - (GPUImageFramebuffer *)framebufferForOutput; { return secondOutputFramebuffer; } - (void)removeOutputFramebuffer; { secondOutputFramebuffer = nil; } #pragma mark - #pragma mark Rendering - (void)renderToTextureWithVertices:(const GLfloat *)vertices textureCoordinates:(const GLfloat *)textureCoordinates; { if (self.preventRendering) { [firstInputFramebuffer unlock]; return; } [GPUImageContext setActiveShaderProgram:filterProgram]; outputFramebuffer = [[GPUImageContext sharedFramebufferCache] fetchFramebufferForSize:[self sizeOfFBO] textureOptions:self.outputTextureOptions onlyTexture:NO]; [outputFramebuffer activateFramebuffer]; [self setUniformsForProgramAtIndex:0]; glClearColor(backgroundColorRed, backgroundColorGreen, backgroundColorBlue, backgroundColorAlpha); glClear(GL_COLOR_BUFFER_BIT); glActiveTexture(GL_TEXTURE2); glBindTexture(GL_TEXTURE_2D, [firstInputFramebuffer texture]); glUniform1i(filterInputTextureUniform, 2); glVertexAttribPointer(filterPositionAttribute, 2, GL_FLOAT, 0, 0, vertices); glVertexAttribPointer(filterTextureCoordinateAttribute, 2, GL_FLOAT, 0, 0, textureCoordinates); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); [firstInputFramebuffer unlock]; firstInputFramebuffer = nil; // This assumes that any two-pass filter that says it desires monochrome input is using the first pass for a luminance conversion, which can be dropped // if (!currentlyReceivingMonochromeInput) // { // Run the first stage of the two-pass filter // [super renderToTextureWithVertices:vertices textureCoordinates:textureCoordinates]; // } // Run the second stage of the two-pass filter secondOutputFramebuffer = [[GPUImageContext sharedFramebufferCache] fetchFramebufferForSize:[self sizeOfFBO] textureOptions:self.outputTextureOptions onlyTexture:NO]; [secondOutputFramebuffer activateFramebuffer]; [GPUImageContext setActiveShaderProgram:secondFilterProgram]; if (usingNextFrameForImageCapture) { [secondOutputFramebuffer lock]; } [self setUniformsForProgramAtIndex:1]; glActiveTexture(GL_TEXTURE3); glBindTexture(GL_TEXTURE_2D, [outputFramebuffer texture]); glVertexAttribPointer(secondFilterTextureCoordinateAttribute, 2, GL_FLOAT, 0, 0, [[self class] textureCoordinatesForRotation:kGPUImageNoRotation]); // TODO: Re-enable this monochrome optimization // if (!currentlyReceivingMonochromeInput) // { // glActiveTexture(GL_TEXTURE3); // glBindTexture(GL_TEXTURE_2D, outputTexture); // glVertexAttribPointer(secondFilterTextureCoordinateAttribute, 2, GL_FLOAT, 0, 0, [[self class] textureCoordinatesForRotation:kGPUImageNoRotation]); // } // else // { // glActiveTexture(GL_TEXTURE3); // glBindTexture(GL_TEXTURE_2D, sourceTexture); // glVertexAttribPointer(secondFilterTextureCoordinateAttribute, 2, GL_FLOAT, 0, 0, textureCoordinates); // } glUniform1i(secondFilterInputTextureUniform, 3); glVertexAttribPointer(secondFilterPositionAttribute, 2, GL_FLOAT, 0, 0, vertices); glClearColor(0.0f, 0.0f, 0.0f, 1.0f); glClear(GL_COLOR_BUFFER_BIT); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); [outputFramebuffer unlock]; outputFramebuffer = nil; if (usingNextFrameForImageCapture) { dispatch_semaphore_signal(imageCaptureSemaphore); } } - (void)setAndExecuteUniformStateCallbackAtIndex:(GLint)uniform forProgram:(GLProgram *)shaderProgram toBlock:(dispatch_block_t)uniformStateBlock; { // TODO: Deal with the fact that two-pass filters may have the same shader program identifier if (shaderProgram == filterProgram) { [uniformStateRestorationBlocks setObject:[uniformStateBlock copy] forKey:[NSNumber numberWithInt:uniform]]; } else { [secondProgramUniformStateRestorationBlocks setObject:[uniformStateBlock copy] forKey:[NSNumber numberWithInt:uniform]]; } uniformStateBlock(); } - (void)setUniformsForProgramAtIndex:(NSUInteger)programIndex; { if (programIndex == 0) { [uniformStateRestorationBlocks enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop){ dispatch_block_t currentBlock = obj; currentBlock(); }]; } else { [secondProgramUniformStateRestorationBlocks enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop){ dispatch_block_t currentBlock = obj; currentBlock(); }]; } } @end ================================================ FILE: framework/Source/GPUImageTwoPassTextureSamplingFilter.h ================================================ #import "GPUImageTwoPassFilter.h" @interface GPUImageTwoPassTextureSamplingFilter : GPUImageTwoPassFilter { GLint verticalPassTexelWidthOffsetUniform, verticalPassTexelHeightOffsetUniform, horizontalPassTexelWidthOffsetUniform, horizontalPassTexelHeightOffsetUniform; GLfloat verticalPassTexelWidthOffset, verticalPassTexelHeightOffset, horizontalPassTexelWidthOffset, horizontalPassTexelHeightOffset; CGFloat _verticalTexelSpacing, _horizontalTexelSpacing; } // This sets the spacing between texels (in pixels) when sampling for the first. By default, this is 1.0 @property(readwrite, nonatomic) CGFloat verticalTexelSpacing, horizontalTexelSpacing; @end ================================================ FILE: framework/Source/GPUImageTwoPassTextureSamplingFilter.m ================================================ #import "GPUImageTwoPassTextureSamplingFilter.h" @implementation GPUImageTwoPassTextureSamplingFilter @synthesize verticalTexelSpacing = _verticalTexelSpacing; @synthesize horizontalTexelSpacing = _horizontalTexelSpacing; #pragma mark - #pragma mark Initialization and teardown - (id)initWithFirstStageVertexShaderFromString:(NSString *)firstStageVertexShaderString firstStageFragmentShaderFromString:(NSString *)firstStageFragmentShaderString secondStageVertexShaderFromString:(NSString *)secondStageVertexShaderString secondStageFragmentShaderFromString:(NSString *)secondStageFragmentShaderString { if (!(self = [super initWithFirstStageVertexShaderFromString:firstStageVertexShaderString firstStageFragmentShaderFromString:firstStageFragmentShaderString secondStageVertexShaderFromString:secondStageVertexShaderString secondStageFragmentShaderFromString:secondStageFragmentShaderString])) { return nil; } runSynchronouslyOnVideoProcessingQueue(^{ [GPUImageContext useImageProcessingContext]; verticalPassTexelWidthOffsetUniform = [filterProgram uniformIndex:@"texelWidthOffset"]; verticalPassTexelHeightOffsetUniform = [filterProgram uniformIndex:@"texelHeightOffset"]; horizontalPassTexelWidthOffsetUniform = [secondFilterProgram uniformIndex:@"texelWidthOffset"]; horizontalPassTexelHeightOffsetUniform = [secondFilterProgram uniformIndex:@"texelHeightOffset"]; }); self.verticalTexelSpacing = 1.0; self.horizontalTexelSpacing = 1.0; return self; } - (void)setUniformsForProgramAtIndex:(NSUInteger)programIndex; { [super setUniformsForProgramAtIndex:programIndex]; if (programIndex == 0) { glUniform1f(verticalPassTexelWidthOffsetUniform, verticalPassTexelWidthOffset); glUniform1f(verticalPassTexelHeightOffsetUniform, verticalPassTexelHeightOffset); } else { glUniform1f(horizontalPassTexelWidthOffsetUniform, horizontalPassTexelWidthOffset); glUniform1f(horizontalPassTexelHeightOffsetUniform, horizontalPassTexelHeightOffset); } } - (void)setupFilterForSize:(CGSize)filterFrameSize; { runSynchronouslyOnVideoProcessingQueue(^{ // The first pass through the framebuffer may rotate the inbound image, so need to account for that by changing up the kernel ordering for that pass if (GPUImageRotationSwapsWidthAndHeight(inputRotation)) { verticalPassTexelWidthOffset = _verticalTexelSpacing / filterFrameSize.height; verticalPassTexelHeightOffset = 0.0; } else { verticalPassTexelWidthOffset = 0.0; verticalPassTexelHeightOffset = _verticalTexelSpacing / filterFrameSize.height; } horizontalPassTexelWidthOffset = _horizontalTexelSpacing / filterFrameSize.width; horizontalPassTexelHeightOffset = 0.0; }); } #pragma mark - #pragma mark Accessors - (void)setVerticalTexelSpacing:(CGFloat)newValue; { _verticalTexelSpacing = newValue; [self setupFilterForSize:[self sizeOfFBO]]; } - (void)setHorizontalTexelSpacing:(CGFloat)newValue; { _horizontalTexelSpacing = newValue; [self setupFilterForSize:[self sizeOfFBO]]; } @end ================================================ FILE: framework/Source/GPUImageUIElement.h ================================================ #import "GPUImageOutput.h" @interface GPUImageUIElement : GPUImageOutput // Initialization and teardown - (id)initWithView:(UIView *)inputView; - (id)initWithLayer:(CALayer *)inputLayer; // Layer management - (CGSize)layerSizeInPixels; - (void)update; - (void)updateUsingCurrentTime; - (void)updateWithTimestamp:(CMTime)frameTime; @end ================================================ FILE: framework/Source/GPUImageUIElement.m ================================================ #import "GPUImageUIElement.h" @interface GPUImageUIElement () { UIView *view; CALayer *layer; CGSize previousLayerSizeInPixels; CMTime time; NSTimeInterval actualTimeOfLastUpdate; } @end @implementation GPUImageUIElement #pragma mark - #pragma mark Initialization and teardown - (id)initWithView:(UIView *)inputView; { if (!(self = [super init])) { return nil; } view = inputView; layer = inputView.layer; previousLayerSizeInPixels = CGSizeZero; [self update]; return self; } - (id)initWithLayer:(CALayer *)inputLayer; { if (!(self = [super init])) { return nil; } view = nil; layer = inputLayer; previousLayerSizeInPixels = CGSizeZero; [self update]; return self; } #pragma mark - #pragma mark Layer management - (CGSize)layerSizeInPixels; { CGSize pointSize = layer.bounds.size; return CGSizeMake(layer.contentsScale * pointSize.width, layer.contentsScale * pointSize.height); } - (void)update; { [self updateWithTimestamp:kCMTimeIndefinite]; } - (void)updateUsingCurrentTime; { if(CMTIME_IS_INVALID(time)) { time = CMTimeMakeWithSeconds(0, 600); actualTimeOfLastUpdate = [NSDate timeIntervalSinceReferenceDate]; } else { NSTimeInterval now = [NSDate timeIntervalSinceReferenceDate]; NSTimeInterval diff = now - actualTimeOfLastUpdate; time = CMTimeAdd(time, CMTimeMakeWithSeconds(diff, 600)); actualTimeOfLastUpdate = now; } [self updateWithTimestamp:time]; } - (void)updateWithTimestamp:(CMTime)frameTime; { [GPUImageContext useImageProcessingContext]; CGSize layerPixelSize = [self layerSizeInPixels]; GLubyte *imageData = (GLubyte *) calloc(1, (int)layerPixelSize.width * (int)layerPixelSize.height * 4); CGColorSpaceRef genericRGBColorspace = CGColorSpaceCreateDeviceRGB(); CGContextRef imageContext = CGBitmapContextCreate(imageData, (int)layerPixelSize.width, (int)layerPixelSize.height, 8, (int)layerPixelSize.width * 4, genericRGBColorspace, kCGBitmapByteOrder32Little | kCGImageAlphaPremultipliedFirst); // CGContextRotateCTM(imageContext, M_PI_2); CGContextTranslateCTM(imageContext, 0.0f, layerPixelSize.height); CGContextScaleCTM(imageContext, layer.contentsScale, -layer.contentsScale); // CGContextSetBlendMode(imageContext, kCGBlendModeCopy); // From Technical Q&A QA1708: http://developer.apple.com/library/ios/#qa/qa1708/_index.html [layer renderInContext:imageContext]; CGContextRelease(imageContext); CGColorSpaceRelease(genericRGBColorspace); // TODO: This may not work outputFramebuffer = [[GPUImageContext sharedFramebufferCache] fetchFramebufferForSize:layerPixelSize textureOptions:self.outputTextureOptions onlyTexture:YES]; glBindTexture(GL_TEXTURE_2D, [outputFramebuffer texture]); // no need to use self.outputTextureOptions here, we always need these texture options glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, (int)layerPixelSize.width, (int)layerPixelSize.height, 0, GL_BGRA, GL_UNSIGNED_BYTE, imageData); free(imageData); for (id currentTarget in targets) { if (currentTarget != self.targetToIgnoreForUpdates) { NSInteger indexOfObject = [targets indexOfObject:currentTarget]; NSInteger textureIndexOfTarget = [[targetTextureIndices objectAtIndex:indexOfObject] integerValue]; [currentTarget setInputSize:layerPixelSize atIndex:textureIndexOfTarget]; [currentTarget newFrameReadyAtTime:frameTime atIndex:textureIndexOfTarget]; } } } @end ================================================ FILE: framework/Source/GPUImageUnsharpMaskFilter.h ================================================ #import "GPUImageFilterGroup.h" @class GPUImageGaussianBlurFilter; @interface GPUImageUnsharpMaskFilter : GPUImageFilterGroup { GPUImageGaussianBlurFilter *blurFilter; GPUImageFilter *unsharpMaskFilter; } // The blur radius of the underlying Gaussian blur. The default is 4.0. @property (readwrite, nonatomic) CGFloat blurRadiusInPixels; // The strength of the sharpening, from 0.0 on up, with a default of 1.0 @property(readwrite, nonatomic) CGFloat intensity; @end ================================================ FILE: framework/Source/GPUImageUnsharpMaskFilter.m ================================================ #import "GPUImageUnsharpMaskFilter.h" #import "GPUImageFilter.h" #import "GPUImageTwoInputFilter.h" #import "GPUImageGaussianBlurFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageUnsharpMaskFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; varying highp vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; uniform highp float intensity; void main() { lowp vec4 sharpImageColor = texture2D(inputImageTexture, textureCoordinate); lowp vec3 blurredImageColor = texture2D(inputImageTexture2, textureCoordinate2).rgb; gl_FragColor = vec4(sharpImageColor.rgb * intensity + blurredImageColor * (1.0 - intensity), sharpImageColor.a); // gl_FragColor = mix(blurredImageColor, sharpImageColor, intensity); // gl_FragColor = vec4(sharpImageColor.rgb - (blurredImageColor.rgb * intensity), 1.0); } ); #else NSString *const kGPUImageUnsharpMaskFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; varying vec2 textureCoordinate2; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; uniform float intensity; void main() { vec4 sharpImageColor = texture2D(inputImageTexture, textureCoordinate); vec3 blurredImageColor = texture2D(inputImageTexture2, textureCoordinate2).rgb; gl_FragColor = vec4(sharpImageColor.rgb * intensity + blurredImageColor * (1.0 - intensity), sharpImageColor.a); // gl_FragColor = mix(blurredImageColor, sharpImageColor, intensity); // gl_FragColor = vec4(sharpImageColor.rgb - (blurredImageColor.rgb * intensity), 1.0); } ); #endif @implementation GPUImageUnsharpMaskFilter @synthesize blurRadiusInPixels; @synthesize intensity = _intensity; - (id)init; { if (!(self = [super init])) { return nil; } // First pass: apply a variable Gaussian blur blurFilter = [[GPUImageGaussianBlurFilter alloc] init]; [self addFilter:blurFilter]; // Second pass: combine the blurred image with the original sharp one unsharpMaskFilter = [[GPUImageTwoInputFilter alloc] initWithFragmentShaderFromString:kGPUImageUnsharpMaskFragmentShaderString]; [self addFilter:unsharpMaskFilter]; // Texture location 0 needs to be the sharp image for both the blur and the second stage processing [blurFilter addTarget:unsharpMaskFilter atTextureLocation:1]; self.initialFilters = [NSArray arrayWithObjects:blurFilter, unsharpMaskFilter, nil]; self.terminalFilter = unsharpMaskFilter; self.intensity = 1.0; self.blurRadiusInPixels = 4.0; return self; } #pragma mark - #pragma mark Accessors - (void)setBlurRadiusInPixels:(CGFloat)newValue; { blurFilter.blurRadiusInPixels = newValue; } - (CGFloat)blurRadiusInPixels; { return blurFilter.blurRadiusInPixels; } - (void)setIntensity:(CGFloat)newValue; { _intensity = newValue; [unsharpMaskFilter setFloat:newValue forUniformName:@"intensity"]; } @end ================================================ FILE: framework/Source/GPUImageVibranceFilter.h ================================================ // // GPUImageVibranceFilter.h // // // Created by github.com/r3mus on 8/14/15. // // #import "GPUImageFilter.h" @interface GPUImageVibranceFilter : GPUImageFilter { GLint vibranceUniform; } // Modifies the saturation of desaturated colors, leaving saturated colors unmodified. // Value -1 to 1 (-1 is minimum vibrance, 0 is no change, and 1 is maximum vibrance) @property (readwrite, nonatomic) GLfloat vibrance; @end ================================================ FILE: framework/Source/GPUImageVibranceFilter.m ================================================ // // GPUImageVibranceFilter.m // // // Created by github.com/r3mus on 8/13/15. // // #import "GPUImageVibranceFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageVibranceFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform lowp float vibrance; void main() { lowp vec4 color = texture2D(inputImageTexture, textureCoordinate); lowp float average = (color.r + color.g + color.b) / 3.0; lowp float mx = max(color.r, max(color.g, color.b)); lowp float amt = (mx - average) * (-vibrance * 3.0); color.rgb = mix(color.rgb, vec3(mx), amt); gl_FragColor = color; } ); #else NSString *const kGPUImageVibranceFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform float vibrance; void main() { vec4 color = texture2D(inputImageTexture, textureCoordinate); float average = (color.r + color.g + color.b) / 3.0; float mx = max(color.r, max(color.g, color.b)); float amt = (mx - average) * (-vibrance * 3.0); color.rgb = mix(color.rgb, vec3(mx), amt); gl_FragColor = color; } ); #endif @implementation GPUImageVibranceFilter @synthesize vibrance = _vibrance; #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageVibranceFragmentShaderString])) { return nil; } vibranceUniform = [filterProgram uniformIndex:@"vibrance"]; self.vibrance = 0.0; return self; } #pragma mark - #pragma mark Accessors - (void)setVibrance:(GLfloat)vibrance; { _vibrance = vibrance; [self setFloat:_vibrance forUniform:vibranceUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImageVideoCamera.h ================================================ #import #import #import #import "GPUImageContext.h" #import "GPUImageOutput.h" #import "GPUImageColorConversion.h" //Optionally override the YUV to RGB matrices void setColorConversion601( GLfloat conversionMatrix[9] ); void setColorConversion601FullRange( GLfloat conversionMatrix[9] ); void setColorConversion709( GLfloat conversionMatrix[9] ); //Delegate Protocal for Face Detection. @protocol GPUImageVideoCameraDelegate @optional - (void)willOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer; @end /** A GPUImageOutput that provides frames from either camera */ @interface GPUImageVideoCamera : GPUImageOutput { NSUInteger numberOfFramesCaptured; CGFloat totalFrameTimeDuringCapture; AVCaptureSession *_captureSession; AVCaptureDevice *_inputCamera; AVCaptureDevice *_microphone; AVCaptureDeviceInput *videoInput; AVCaptureVideoDataOutput *videoOutput; BOOL capturePaused; GPUImageRotationMode outputRotation, internalRotation; dispatch_semaphore_t frameRenderingSemaphore; BOOL captureAsYUV; GLuint luminanceTexture, chrominanceTexture; __unsafe_unretained id _delegate; } /// Whether or not the underlying AVCaptureSession is running @property(readonly, nonatomic) BOOL isRunning; /// The AVCaptureSession used to capture from the camera @property(readonly, retain, nonatomic) AVCaptureSession *captureSession; /// This enables the capture session preset to be changed on the fly @property (readwrite, nonatomic, copy) NSString *captureSessionPreset; /// This sets the frame rate of the camera (iOS 5 and above only) /** Setting this to 0 or below will set the frame rate back to the default setting for a particular preset. */ @property (readwrite) int32_t frameRate; /// Easy way to tell which cameras are present on device @property (readonly, getter = isFrontFacingCameraPresent) BOOL frontFacingCameraPresent; @property (readonly, getter = isBackFacingCameraPresent) BOOL backFacingCameraPresent; /// This enables the benchmarking mode, which logs out instantaneous and average frame times to the console @property(readwrite, nonatomic) BOOL runBenchmark; /// Use this property to manage camera settings. Focus point, exposure point, etc. @property(readonly) AVCaptureDevice *inputCamera; /// This determines the rotation applied to the output image, based on the source material @property(readwrite, nonatomic) UIInterfaceOrientation outputImageOrientation; /// These properties determine whether or not the two camera orientations should be mirrored. By default, both are NO. @property(readwrite, nonatomic) BOOL horizontallyMirrorFrontFacingCamera, horizontallyMirrorRearFacingCamera; @property(nonatomic, assign) id delegate; /// @name Initialization and teardown /** Begin a capture session See AVCaptureSession for acceptable values @param sessionPreset Session preset to use @param cameraPosition Camera to capture from */ - (id)initWithSessionPreset:(NSString *)sessionPreset cameraPosition:(AVCaptureDevicePosition)cameraPosition; /** Add audio capture to the session. Adding inputs and outputs freezes the capture session momentarily, so you can use this method to add the audio inputs and outputs early, if you're going to set the audioEncodingTarget later. Returns YES is the audio inputs and outputs were added, or NO if they had already been added. */ - (BOOL)addAudioInputsAndOutputs; /** Remove the audio capture inputs and outputs from this session. Returns YES if the audio inputs and outputs were removed, or NO is they hadn't already been added. */ - (BOOL)removeAudioInputsAndOutputs; /** Tear down the capture session */ - (void)removeInputsAndOutputs; /// @name Manage the camera video stream /** Start camera capturing */ - (void)startCameraCapture; /** Stop camera capturing */ - (void)stopCameraCapture; /** Pause camera capturing */ - (void)pauseCameraCapture; /** Resume camera capturing */ - (void)resumeCameraCapture; /** Process a video sample @param sampleBuffer Buffer to process */ - (void)processVideoSampleBuffer:(CMSampleBufferRef)sampleBuffer; /** Process an audio sample @param sampleBuffer Buffer to process */ - (void)processAudioSampleBuffer:(CMSampleBufferRef)sampleBuffer; /** Get the position (front, rear) of the source camera */ - (AVCaptureDevicePosition)cameraPosition; /** Get the AVCaptureConnection of the source camera */ - (AVCaptureConnection *)videoCaptureConnection; /** This flips between the front and rear cameras */ - (void)rotateCamera; /// @name Benchmarking /** When benchmarking is enabled, this will keep a running average of the time from uploading, processing, and final recording or display */ - (CGFloat)averageFrameDurationDuringCapture; - (void)resetBenchmarkAverage; + (BOOL)isBackFacingCameraPresent; + (BOOL)isFrontFacingCameraPresent; @end ================================================ FILE: framework/Source/GPUImageVideoCamera.m ================================================ #import "GPUImageVideoCamera.h" #import "GPUImageMovieWriter.h" #import "GPUImageFilter.h" void setColorConversion601( GLfloat conversionMatrix[9] ) { kColorConversion601 = conversionMatrix; } void setColorConversion601FullRange( GLfloat conversionMatrix[9] ) { kColorConversion601FullRange = conversionMatrix; } void setColorConversion709( GLfloat conversionMatrix[9] ) { kColorConversion709 = conversionMatrix; } #pragma mark - #pragma mark Private methods and instance variables @interface GPUImageVideoCamera () { AVCaptureDeviceInput *audioInput; AVCaptureAudioDataOutput *audioOutput; NSDate *startingCaptureTime; dispatch_queue_t cameraProcessingQueue, audioProcessingQueue; GLProgram *yuvConversionProgram; GLint yuvConversionPositionAttribute, yuvConversionTextureCoordinateAttribute; GLint yuvConversionLuminanceTextureUniform, yuvConversionChrominanceTextureUniform; GLint yuvConversionMatrixUniform; const GLfloat *_preferredConversion; BOOL isFullYUVRange; int imageBufferWidth, imageBufferHeight; BOOL addedAudioInputsDueToEncodingTarget; } - (void)updateOrientationSendToTargets; - (void)convertYUVToRGBOutput; @end @implementation GPUImageVideoCamera @synthesize captureSessionPreset = _captureSessionPreset; @synthesize captureSession = _captureSession; @synthesize inputCamera = _inputCamera; @synthesize runBenchmark = _runBenchmark; @synthesize outputImageOrientation = _outputImageOrientation; @synthesize delegate = _delegate; @synthesize horizontallyMirrorFrontFacingCamera = _horizontallyMirrorFrontFacingCamera, horizontallyMirrorRearFacingCamera = _horizontallyMirrorRearFacingCamera; @synthesize frameRate = _frameRate; #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [self initWithSessionPreset:AVCaptureSessionPreset640x480 cameraPosition:AVCaptureDevicePositionBack])) { return nil; } return self; } - (id)initWithSessionPreset:(NSString *)sessionPreset cameraPosition:(AVCaptureDevicePosition)cameraPosition; { if (!(self = [super init])) { return nil; } cameraProcessingQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH,0); audioProcessingQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW,0); frameRenderingSemaphore = dispatch_semaphore_create(1); _frameRate = 0; // This will not set frame rate unless this value gets set to 1 or above _runBenchmark = NO; capturePaused = NO; outputRotation = kGPUImageNoRotation; internalRotation = kGPUImageNoRotation; captureAsYUV = YES; _preferredConversion = kColorConversion709; // Grab the back-facing or front-facing camera _inputCamera = nil; NSArray *devices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo]; for (AVCaptureDevice *device in devices) { if ([device position] == cameraPosition) { _inputCamera = device; } } if (!_inputCamera) { return nil; } // Create the capture session _captureSession = [[AVCaptureSession alloc] init]; [_captureSession beginConfiguration]; // Add the video input NSError *error = nil; videoInput = [[AVCaptureDeviceInput alloc] initWithDevice:_inputCamera error:&error]; if ([_captureSession canAddInput:videoInput]) { [_captureSession addInput:videoInput]; } // Add the video frame output videoOutput = [[AVCaptureVideoDataOutput alloc] init]; [videoOutput setAlwaysDiscardsLateVideoFrames:NO]; // if (captureAsYUV && [GPUImageContext deviceSupportsRedTextures]) if (captureAsYUV && [GPUImageContext supportsFastTextureUpload]) { BOOL supportsFullYUVRange = NO; NSArray *supportedPixelFormats = videoOutput.availableVideoCVPixelFormatTypes; for (NSNumber *currentPixelFormat in supportedPixelFormats) { if ([currentPixelFormat intValue] == kCVPixelFormatType_420YpCbCr8BiPlanarFullRange) { supportsFullYUVRange = YES; } } if (supportsFullYUVRange) { [videoOutput setVideoSettings:[NSDictionary dictionaryWithObject:[NSNumber numberWithInt:kCVPixelFormatType_420YpCbCr8BiPlanarFullRange] forKey:(id)kCVPixelBufferPixelFormatTypeKey]]; isFullYUVRange = YES; } else { [videoOutput setVideoSettings:[NSDictionary dictionaryWithObject:[NSNumber numberWithInt:kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange] forKey:(id)kCVPixelBufferPixelFormatTypeKey]]; isFullYUVRange = NO; } } else { [videoOutput setVideoSettings:[NSDictionary dictionaryWithObject:[NSNumber numberWithInt:kCVPixelFormatType_32BGRA] forKey:(id)kCVPixelBufferPixelFormatTypeKey]]; } runSynchronouslyOnVideoProcessingQueue(^{ if (captureAsYUV) { [GPUImageContext useImageProcessingContext]; // if ([GPUImageContext deviceSupportsRedTextures]) // { // yuvConversionProgram = [[GPUImageContext sharedImageProcessingContext] programForVertexShaderString:kGPUImageVertexShaderString fragmentShaderString:kGPUImageYUVVideoRangeConversionForRGFragmentShaderString]; // } // else // { if (isFullYUVRange) { yuvConversionProgram = [[GPUImageContext sharedImageProcessingContext] programForVertexShaderString:kGPUImageVertexShaderString fragmentShaderString:kGPUImageYUVFullRangeConversionForLAFragmentShaderString]; } else { yuvConversionProgram = [[GPUImageContext sharedImageProcessingContext] programForVertexShaderString:kGPUImageVertexShaderString fragmentShaderString:kGPUImageYUVVideoRangeConversionForLAFragmentShaderString]; } // } if (!yuvConversionProgram.initialized) { [yuvConversionProgram addAttribute:@"position"]; [yuvConversionProgram addAttribute:@"inputTextureCoordinate"]; if (![yuvConversionProgram link]) { NSString *progLog = [yuvConversionProgram programLog]; NSLog(@"Program link log: %@", progLog); NSString *fragLog = [yuvConversionProgram fragmentShaderLog]; NSLog(@"Fragment shader compile log: %@", fragLog); NSString *vertLog = [yuvConversionProgram vertexShaderLog]; NSLog(@"Vertex shader compile log: %@", vertLog); yuvConversionProgram = nil; NSAssert(NO, @"Filter shader link failed"); } } yuvConversionPositionAttribute = [yuvConversionProgram attributeIndex:@"position"]; yuvConversionTextureCoordinateAttribute = [yuvConversionProgram attributeIndex:@"inputTextureCoordinate"]; yuvConversionLuminanceTextureUniform = [yuvConversionProgram uniformIndex:@"luminanceTexture"]; yuvConversionChrominanceTextureUniform = [yuvConversionProgram uniformIndex:@"chrominanceTexture"]; yuvConversionMatrixUniform = [yuvConversionProgram uniformIndex:@"colorConversionMatrix"]; [GPUImageContext setActiveShaderProgram:yuvConversionProgram]; glEnableVertexAttribArray(yuvConversionPositionAttribute); glEnableVertexAttribArray(yuvConversionTextureCoordinateAttribute); } }); [videoOutput setSampleBufferDelegate:self queue:cameraProcessingQueue]; if ([_captureSession canAddOutput:videoOutput]) { [_captureSession addOutput:videoOutput]; } else { NSLog(@"Couldn't add video output"); return nil; } _captureSessionPreset = sessionPreset; [_captureSession setSessionPreset:_captureSessionPreset]; // This will let you get 60 FPS video from the 720p preset on an iPhone 4S, but only that device and that preset // AVCaptureConnection *conn = [videoOutput connectionWithMediaType:AVMediaTypeVideo]; // // if (conn.supportsVideoMinFrameDuration) // conn.videoMinFrameDuration = CMTimeMake(1,60); // if (conn.supportsVideoMaxFrameDuration) // conn.videoMaxFrameDuration = CMTimeMake(1,60); [_captureSession commitConfiguration]; return self; } - (GPUImageFramebuffer *)framebufferForOutput; { return outputFramebuffer; } - (void)dealloc { [self stopCameraCapture]; [videoOutput setSampleBufferDelegate:nil queue:dispatch_get_main_queue()]; [audioOutput setSampleBufferDelegate:nil queue:dispatch_get_main_queue()]; [self removeInputsAndOutputs]; // ARC forbids explicit message send of 'release'; since iOS 6 even for dispatch_release() calls: stripping it out in that case is required. #if !OS_OBJECT_USE_OBJC if (frameRenderingSemaphore != NULL) { dispatch_release(frameRenderingSemaphore); } #endif } - (BOOL)addAudioInputsAndOutputs { if (audioOutput) return NO; [_captureSession beginConfiguration]; _microphone = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeAudio]; audioInput = [AVCaptureDeviceInput deviceInputWithDevice:_microphone error:nil]; if ([_captureSession canAddInput:audioInput]) { [_captureSession addInput:audioInput]; } audioOutput = [[AVCaptureAudioDataOutput alloc] init]; if ([_captureSession canAddOutput:audioOutput]) { [_captureSession addOutput:audioOutput]; } else { NSLog(@"Couldn't add audio output"); } [audioOutput setSampleBufferDelegate:self queue:audioProcessingQueue]; [_captureSession commitConfiguration]; return YES; } - (BOOL)removeAudioInputsAndOutputs { if (!audioOutput) return NO; [_captureSession beginConfiguration]; [_captureSession removeInput:audioInput]; [_captureSession removeOutput:audioOutput]; audioInput = nil; audioOutput = nil; _microphone = nil; [_captureSession commitConfiguration]; return YES; } - (void)removeInputsAndOutputs; { [_captureSession beginConfiguration]; if (videoInput) { [_captureSession removeInput:videoInput]; [_captureSession removeOutput:videoOutput]; videoInput = nil; videoOutput = nil; } if (_microphone != nil) { [_captureSession removeInput:audioInput]; [_captureSession removeOutput:audioOutput]; audioInput = nil; audioOutput = nil; _microphone = nil; } [_captureSession commitConfiguration]; } #pragma mark - #pragma mark Managing targets - (void)addTarget:(id)newTarget atTextureLocation:(NSInteger)textureLocation; { [super addTarget:newTarget atTextureLocation:textureLocation]; [newTarget setInputRotation:outputRotation atIndex:textureLocation]; } #pragma mark - #pragma mark Manage the camera video stream - (BOOL)isRunning; { return [_captureSession isRunning]; } - (void)startCameraCapture; { if (![_captureSession isRunning]) { startingCaptureTime = [NSDate date]; [_captureSession startRunning]; }; } - (void)stopCameraCapture; { if ([_captureSession isRunning]) { [_captureSession stopRunning]; } } - (void)pauseCameraCapture; { capturePaused = YES; } - (void)resumeCameraCapture; { capturePaused = NO; } - (void)rotateCamera { if (self.frontFacingCameraPresent == NO) return; NSError *error; AVCaptureDeviceInput *newVideoInput; AVCaptureDevicePosition currentCameraPosition = [[videoInput device] position]; if (currentCameraPosition == AVCaptureDevicePositionBack) { currentCameraPosition = AVCaptureDevicePositionFront; } else { currentCameraPosition = AVCaptureDevicePositionBack; } AVCaptureDevice *backFacingCamera = nil; NSArray *devices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo]; for (AVCaptureDevice *device in devices) { if ([device position] == currentCameraPosition) { backFacingCamera = device; } } newVideoInput = [[AVCaptureDeviceInput alloc] initWithDevice:backFacingCamera error:&error]; if (newVideoInput != nil) { [_captureSession beginConfiguration]; [_captureSession removeInput:videoInput]; if ([_captureSession canAddInput:newVideoInput]) { [_captureSession addInput:newVideoInput]; videoInput = newVideoInput; } else { [_captureSession addInput:videoInput]; } //captureSession.sessionPreset = oriPreset; [_captureSession commitConfiguration]; } _inputCamera = backFacingCamera; [self setOutputImageOrientation:_outputImageOrientation]; } - (AVCaptureDevicePosition)cameraPosition { return [[videoInput device] position]; } + (BOOL)isBackFacingCameraPresent; { NSArray *devices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo]; for (AVCaptureDevice *device in devices) { if ([device position] == AVCaptureDevicePositionBack) return YES; } return NO; } - (BOOL)isBackFacingCameraPresent { return [GPUImageVideoCamera isBackFacingCameraPresent]; } + (BOOL)isFrontFacingCameraPresent; { NSArray *devices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo]; for (AVCaptureDevice *device in devices) { if ([device position] == AVCaptureDevicePositionFront) return YES; } return NO; } - (BOOL)isFrontFacingCameraPresent { return [GPUImageVideoCamera isFrontFacingCameraPresent]; } - (void)setCaptureSessionPreset:(NSString *)captureSessionPreset; { [_captureSession beginConfiguration]; _captureSessionPreset = captureSessionPreset; [_captureSession setSessionPreset:_captureSessionPreset]; [_captureSession commitConfiguration]; } - (void)setFrameRate:(int32_t)frameRate; { _frameRate = frameRate; if (_frameRate > 0) { if ([_inputCamera respondsToSelector:@selector(setActiveVideoMinFrameDuration:)] && [_inputCamera respondsToSelector:@selector(setActiveVideoMaxFrameDuration:)]) { NSError *error; [_inputCamera lockForConfiguration:&error]; if (error == nil) { #if defined(__IPHONE_7_0) [_inputCamera setActiveVideoMinFrameDuration:CMTimeMake(1, _frameRate)]; [_inputCamera setActiveVideoMaxFrameDuration:CMTimeMake(1, _frameRate)]; #endif } [_inputCamera unlockForConfiguration]; } else { for (AVCaptureConnection *connection in videoOutput.connections) { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" if ([connection respondsToSelector:@selector(setVideoMinFrameDuration:)]) connection.videoMinFrameDuration = CMTimeMake(1, _frameRate); if ([connection respondsToSelector:@selector(setVideoMaxFrameDuration:)]) connection.videoMaxFrameDuration = CMTimeMake(1, _frameRate); #pragma clang diagnostic pop } } } else { if ([_inputCamera respondsToSelector:@selector(setActiveVideoMinFrameDuration:)] && [_inputCamera respondsToSelector:@selector(setActiveVideoMaxFrameDuration:)]) { NSError *error; [_inputCamera lockForConfiguration:&error]; if (error == nil) { #if defined(__IPHONE_7_0) [_inputCamera setActiveVideoMinFrameDuration:kCMTimeInvalid]; [_inputCamera setActiveVideoMaxFrameDuration:kCMTimeInvalid]; #endif } [_inputCamera unlockForConfiguration]; } else { for (AVCaptureConnection *connection in videoOutput.connections) { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" if ([connection respondsToSelector:@selector(setVideoMinFrameDuration:)]) connection.videoMinFrameDuration = kCMTimeInvalid; // This sets videoMinFrameDuration back to default if ([connection respondsToSelector:@selector(setVideoMaxFrameDuration:)]) connection.videoMaxFrameDuration = kCMTimeInvalid; // This sets videoMaxFrameDuration back to default #pragma clang diagnostic pop } } } } - (int32_t)frameRate; { return _frameRate; } - (AVCaptureConnection *)videoCaptureConnection { for (AVCaptureConnection *connection in [videoOutput connections] ) { for ( AVCaptureInputPort *port in [connection inputPorts] ) { if ( [[port mediaType] isEqual:AVMediaTypeVideo] ) { return connection; } } } return nil; } #define INITIALFRAMESTOIGNOREFORBENCHMARK 5 - (void)updateTargetsForVideoCameraUsingCacheTextureAtWidth:(int)bufferWidth height:(int)bufferHeight time:(CMTime)currentTime; { // First, update all the framebuffers in the targets for (id currentTarget in targets) { if ([currentTarget enabled]) { NSInteger indexOfObject = [targets indexOfObject:currentTarget]; NSInteger textureIndexOfTarget = [[targetTextureIndices objectAtIndex:indexOfObject] integerValue]; if (currentTarget != self.targetToIgnoreForUpdates) { [currentTarget setInputRotation:outputRotation atIndex:textureIndexOfTarget]; [currentTarget setInputSize:CGSizeMake(bufferWidth, bufferHeight) atIndex:textureIndexOfTarget]; if ([currentTarget wantsMonochromeInput] && captureAsYUV) { [currentTarget setCurrentlyReceivingMonochromeInput:YES]; // TODO: Replace optimization for monochrome output [currentTarget setInputFramebuffer:outputFramebuffer atIndex:textureIndexOfTarget]; } else { [currentTarget setCurrentlyReceivingMonochromeInput:NO]; [currentTarget setInputFramebuffer:outputFramebuffer atIndex:textureIndexOfTarget]; } } else { [currentTarget setInputRotation:outputRotation atIndex:textureIndexOfTarget]; [currentTarget setInputFramebuffer:outputFramebuffer atIndex:textureIndexOfTarget]; } } } // Then release our hold on the local framebuffer to send it back to the cache as soon as it's no longer needed [outputFramebuffer unlock]; outputFramebuffer = nil; // Finally, trigger rendering as needed for (id currentTarget in targets) { if ([currentTarget enabled]) { NSInteger indexOfObject = [targets indexOfObject:currentTarget]; NSInteger textureIndexOfTarget = [[targetTextureIndices objectAtIndex:indexOfObject] integerValue]; if (currentTarget != self.targetToIgnoreForUpdates) { [currentTarget newFrameReadyAtTime:currentTime atIndex:textureIndexOfTarget]; } } } } - (void)processVideoSampleBuffer:(CMSampleBufferRef)sampleBuffer; { if (capturePaused) { return; } CFAbsoluteTime startTime = CFAbsoluteTimeGetCurrent(); CVImageBufferRef cameraFrame = CMSampleBufferGetImageBuffer(sampleBuffer); int bufferWidth = (int) CVPixelBufferGetWidth(cameraFrame); int bufferHeight = (int) CVPixelBufferGetHeight(cameraFrame); CFTypeRef colorAttachments = CVBufferGetAttachment(cameraFrame, kCVImageBufferYCbCrMatrixKey, NULL); if (colorAttachments != NULL) { if(CFStringCompare(colorAttachments, kCVImageBufferYCbCrMatrix_ITU_R_601_4, 0) == kCFCompareEqualTo) { if (isFullYUVRange) { _preferredConversion = kColorConversion601FullRange; } else { _preferredConversion = kColorConversion601; } } else { _preferredConversion = kColorConversion709; } } else { if (isFullYUVRange) { _preferredConversion = kColorConversion601FullRange; } else { _preferredConversion = kColorConversion601; } } CMTime currentTime = CMSampleBufferGetPresentationTimeStamp(sampleBuffer); [GPUImageContext useImageProcessingContext]; if ([GPUImageContext supportsFastTextureUpload] && captureAsYUV) { CVOpenGLESTextureRef luminanceTextureRef = NULL; CVOpenGLESTextureRef chrominanceTextureRef = NULL; // if (captureAsYUV && [GPUImageContext deviceSupportsRedTextures]) if (CVPixelBufferGetPlaneCount(cameraFrame) > 0) // Check for YUV planar inputs to do RGB conversion { CVPixelBufferLockBaseAddress(cameraFrame, 0); if ( (imageBufferWidth != bufferWidth) && (imageBufferHeight != bufferHeight) ) { imageBufferWidth = bufferWidth; imageBufferHeight = bufferHeight; } CVReturn err; // Y-plane glActiveTexture(GL_TEXTURE4); if ([GPUImageContext deviceSupportsRedTextures]) { // err = CVOpenGLESTextureCacheCreateTextureFromImage(kCFAllocatorDefault, coreVideoTextureCache, cameraFrame, NULL, GL_TEXTURE_2D, GL_RED_EXT, bufferWidth, bufferHeight, GL_RED_EXT, GL_UNSIGNED_BYTE, 0, &luminanceTextureRef); err = CVOpenGLESTextureCacheCreateTextureFromImage(kCFAllocatorDefault, [[GPUImageContext sharedImageProcessingContext] coreVideoTextureCache], cameraFrame, NULL, GL_TEXTURE_2D, GL_LUMINANCE, bufferWidth, bufferHeight, GL_LUMINANCE, GL_UNSIGNED_BYTE, 0, &luminanceTextureRef); } else { err = CVOpenGLESTextureCacheCreateTextureFromImage(kCFAllocatorDefault, [[GPUImageContext sharedImageProcessingContext] coreVideoTextureCache], cameraFrame, NULL, GL_TEXTURE_2D, GL_LUMINANCE, bufferWidth, bufferHeight, GL_LUMINANCE, GL_UNSIGNED_BYTE, 0, &luminanceTextureRef); } if (err) { NSLog(@"Error at CVOpenGLESTextureCacheCreateTextureFromImage %d", err); } luminanceTexture = CVOpenGLESTextureGetName(luminanceTextureRef); glBindTexture(GL_TEXTURE_2D, luminanceTexture); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); // UV-plane glActiveTexture(GL_TEXTURE5); if ([GPUImageContext deviceSupportsRedTextures]) { // err = CVOpenGLESTextureCacheCreateTextureFromImage(kCFAllocatorDefault, coreVideoTextureCache, cameraFrame, NULL, GL_TEXTURE_2D, GL_RG_EXT, bufferWidth/2, bufferHeight/2, GL_RG_EXT, GL_UNSIGNED_BYTE, 1, &chrominanceTextureRef); err = CVOpenGLESTextureCacheCreateTextureFromImage(kCFAllocatorDefault, [[GPUImageContext sharedImageProcessingContext] coreVideoTextureCache], cameraFrame, NULL, GL_TEXTURE_2D, GL_LUMINANCE_ALPHA, bufferWidth/2, bufferHeight/2, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, 1, &chrominanceTextureRef); } else { err = CVOpenGLESTextureCacheCreateTextureFromImage(kCFAllocatorDefault, [[GPUImageContext sharedImageProcessingContext] coreVideoTextureCache], cameraFrame, NULL, GL_TEXTURE_2D, GL_LUMINANCE_ALPHA, bufferWidth/2, bufferHeight/2, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, 1, &chrominanceTextureRef); } if (err) { NSLog(@"Error at CVOpenGLESTextureCacheCreateTextureFromImage %d", err); } chrominanceTexture = CVOpenGLESTextureGetName(chrominanceTextureRef); glBindTexture(GL_TEXTURE_2D, chrominanceTexture); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); // if (!allTargetsWantMonochromeData) // { [self convertYUVToRGBOutput]; // } int rotatedImageBufferWidth = bufferWidth, rotatedImageBufferHeight = bufferHeight; if (GPUImageRotationSwapsWidthAndHeight(internalRotation)) { rotatedImageBufferWidth = bufferHeight; rotatedImageBufferHeight = bufferWidth; } [self updateTargetsForVideoCameraUsingCacheTextureAtWidth:rotatedImageBufferWidth height:rotatedImageBufferHeight time:currentTime]; CVPixelBufferUnlockBaseAddress(cameraFrame, 0); CFRelease(luminanceTextureRef); CFRelease(chrominanceTextureRef); } else { // TODO: Mesh this with the output framebuffer structure // CVPixelBufferLockBaseAddress(cameraFrame, 0); // // CVReturn err = CVOpenGLESTextureCacheCreateTextureFromImage(kCFAllocatorDefault, [[GPUImageContext sharedImageProcessingContext] coreVideoTextureCache], cameraFrame, NULL, GL_TEXTURE_2D, GL_RGBA, bufferWidth, bufferHeight, GL_BGRA, GL_UNSIGNED_BYTE, 0, &texture); // // if (!texture || err) { // NSLog(@"Camera CVOpenGLESTextureCacheCreateTextureFromImage failed (error: %d)", err); // NSAssert(NO, @"Camera failure"); // return; // } // // outputTexture = CVOpenGLESTextureGetName(texture); // // glBindTexture(CVOpenGLESTextureGetTarget(texture), outputTexture); // glBindTexture(GL_TEXTURE_2D, outputTexture); // glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); // glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); // glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); // glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); // // [self updateTargetsForVideoCameraUsingCacheTextureAtWidth:bufferWidth height:bufferHeight time:currentTime]; // // CVPixelBufferUnlockBaseAddress(cameraFrame, 0); // CFRelease(texture); // // outputTexture = 0; } if (_runBenchmark) { numberOfFramesCaptured++; if (numberOfFramesCaptured > INITIALFRAMESTOIGNOREFORBENCHMARK) { CFAbsoluteTime currentFrameTime = (CFAbsoluteTimeGetCurrent() - startTime); totalFrameTimeDuringCapture += currentFrameTime; NSLog(@"Average frame time : %f ms", [self averageFrameDurationDuringCapture]); NSLog(@"Current frame time : %f ms", 1000.0 * currentFrameTime); } } } else { CVPixelBufferLockBaseAddress(cameraFrame, 0); int bytesPerRow = (int) CVPixelBufferGetBytesPerRow(cameraFrame); outputFramebuffer = [[GPUImageContext sharedFramebufferCache] fetchFramebufferForSize:CGSizeMake(bytesPerRow / 4, bufferHeight) onlyTexture:YES]; [outputFramebuffer activateFramebuffer]; glBindTexture(GL_TEXTURE_2D, [outputFramebuffer texture]); // glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, bufferWidth, bufferHeight, 0, GL_BGRA, GL_UNSIGNED_BYTE, CVPixelBufferGetBaseAddress(cameraFrame)); // Using BGRA extension to pull in video frame data directly // The use of bytesPerRow / 4 accounts for a display glitch present in preview video frames when using the photo preset on the camera glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, bytesPerRow / 4, bufferHeight, 0, GL_BGRA, GL_UNSIGNED_BYTE, CVPixelBufferGetBaseAddress(cameraFrame)); [self updateTargetsForVideoCameraUsingCacheTextureAtWidth:bytesPerRow / 4 height:bufferHeight time:currentTime]; CVPixelBufferUnlockBaseAddress(cameraFrame, 0); if (_runBenchmark) { numberOfFramesCaptured++; if (numberOfFramesCaptured > INITIALFRAMESTOIGNOREFORBENCHMARK) { CFAbsoluteTime currentFrameTime = (CFAbsoluteTimeGetCurrent() - startTime); totalFrameTimeDuringCapture += currentFrameTime; } } } } - (void)processAudioSampleBuffer:(CMSampleBufferRef)sampleBuffer; { [self.audioEncodingTarget processAudioBuffer:sampleBuffer]; } - (void)convertYUVToRGBOutput; { [GPUImageContext setActiveShaderProgram:yuvConversionProgram]; int rotatedImageBufferWidth = imageBufferWidth, rotatedImageBufferHeight = imageBufferHeight; if (GPUImageRotationSwapsWidthAndHeight(internalRotation)) { rotatedImageBufferWidth = imageBufferHeight; rotatedImageBufferHeight = imageBufferWidth; } outputFramebuffer = [[GPUImageContext sharedFramebufferCache] fetchFramebufferForSize:CGSizeMake(rotatedImageBufferWidth, rotatedImageBufferHeight) textureOptions:self.outputTextureOptions onlyTexture:NO]; [outputFramebuffer activateFramebuffer]; glClearColor(0.0f, 0.0f, 0.0f, 1.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); static const GLfloat squareVertices[] = { -1.0f, -1.0f, 1.0f, -1.0f, -1.0f, 1.0f, 1.0f, 1.0f, }; glActiveTexture(GL_TEXTURE4); glBindTexture(GL_TEXTURE_2D, luminanceTexture); glUniform1i(yuvConversionLuminanceTextureUniform, 4); glActiveTexture(GL_TEXTURE5); glBindTexture(GL_TEXTURE_2D, chrominanceTexture); glUniform1i(yuvConversionChrominanceTextureUniform, 5); glUniformMatrix3fv(yuvConversionMatrixUniform, 1, GL_FALSE, _preferredConversion); glVertexAttribPointer(yuvConversionPositionAttribute, 2, GL_FLOAT, 0, 0, squareVertices); glVertexAttribPointer(yuvConversionTextureCoordinateAttribute, 2, GL_FLOAT, 0, 0, [GPUImageFilter textureCoordinatesForRotation:internalRotation]); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); } #pragma mark - #pragma mark Benchmarking - (CGFloat)averageFrameDurationDuringCapture; { return (totalFrameTimeDuringCapture / (CGFloat)(numberOfFramesCaptured - INITIALFRAMESTOIGNOREFORBENCHMARK)) * 1000.0; } - (void)resetBenchmarkAverage; { numberOfFramesCaptured = 0; totalFrameTimeDuringCapture = 0.0; } #pragma mark - #pragma mark AVCaptureVideoDataOutputSampleBufferDelegate - (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection { if (!self.captureSession.isRunning) { return; } else if (captureOutput == audioOutput) { [self processAudioSampleBuffer:sampleBuffer]; } else { if (dispatch_semaphore_wait(frameRenderingSemaphore, DISPATCH_TIME_NOW) != 0) { return; } CFRetain(sampleBuffer); runAsynchronouslyOnVideoProcessingQueue(^{ //Feature Detection Hook. if (self.delegate) { [self.delegate willOutputSampleBuffer:sampleBuffer]; } [self processVideoSampleBuffer:sampleBuffer]; CFRelease(sampleBuffer); dispatch_semaphore_signal(frameRenderingSemaphore); }); } } #pragma mark - #pragma mark Accessors - (void)setAudioEncodingTarget:(GPUImageMovieWriter *)newValue; { if (newValue) { /* Add audio inputs and outputs, if necessary */ addedAudioInputsDueToEncodingTarget |= [self addAudioInputsAndOutputs]; } else if (addedAudioInputsDueToEncodingTarget) { /* Remove audio inputs and outputs, if they were added by previously setting the audio encoding target */ [self removeAudioInputsAndOutputs]; addedAudioInputsDueToEncodingTarget = NO; } [super setAudioEncodingTarget:newValue]; } - (void)updateOrientationSendToTargets; { runSynchronouslyOnVideoProcessingQueue(^{ // From the iOS 5.0 release notes: // In previous iOS versions, the front-facing camera would always deliver buffers in AVCaptureVideoOrientationLandscapeLeft and the back-facing camera would always deliver buffers in AVCaptureVideoOrientationLandscapeRight. if (captureAsYUV && [GPUImageContext supportsFastTextureUpload]) { outputRotation = kGPUImageNoRotation; if ([self cameraPosition] == AVCaptureDevicePositionBack) { if (_horizontallyMirrorRearFacingCamera) { switch(_outputImageOrientation) { case UIInterfaceOrientationPortrait:internalRotation = kGPUImageRotateRightFlipVertical; break; case UIInterfaceOrientationPortraitUpsideDown:internalRotation = kGPUImageRotate180; break; case UIInterfaceOrientationLandscapeLeft:internalRotation = kGPUImageFlipHorizonal; break; case UIInterfaceOrientationLandscapeRight:internalRotation = kGPUImageFlipVertical; break; default:internalRotation = kGPUImageNoRotation; } } else { switch(_outputImageOrientation) { case UIInterfaceOrientationPortrait:internalRotation = kGPUImageRotateRight; break; case UIInterfaceOrientationPortraitUpsideDown:internalRotation = kGPUImageRotateLeft; break; case UIInterfaceOrientationLandscapeLeft:internalRotation = kGPUImageRotate180; break; case UIInterfaceOrientationLandscapeRight:internalRotation = kGPUImageNoRotation; break; default:internalRotation = kGPUImageNoRotation; } } } else { if (_horizontallyMirrorFrontFacingCamera) { switch(_outputImageOrientation) { case UIInterfaceOrientationPortrait:internalRotation = kGPUImageRotateRightFlipVertical; break; case UIInterfaceOrientationPortraitUpsideDown:internalRotation = kGPUImageRotateRightFlipHorizontal; break; case UIInterfaceOrientationLandscapeLeft:internalRotation = kGPUImageFlipHorizonal; break; case UIInterfaceOrientationLandscapeRight:internalRotation = kGPUImageFlipVertical; break; default:internalRotation = kGPUImageNoRotation; } } else { switch(_outputImageOrientation) { case UIInterfaceOrientationPortrait:internalRotation = kGPUImageRotateRight; break; case UIInterfaceOrientationPortraitUpsideDown:internalRotation = kGPUImageRotateLeft; break; case UIInterfaceOrientationLandscapeLeft:internalRotation = kGPUImageNoRotation; break; case UIInterfaceOrientationLandscapeRight:internalRotation = kGPUImageRotate180; break; default:internalRotation = kGPUImageNoRotation; } } } } else { if ([self cameraPosition] == AVCaptureDevicePositionBack) { if (_horizontallyMirrorRearFacingCamera) { switch(_outputImageOrientation) { case UIInterfaceOrientationPortrait:outputRotation = kGPUImageRotateRightFlipVertical; break; case UIInterfaceOrientationPortraitUpsideDown:outputRotation = kGPUImageRotate180; break; case UIInterfaceOrientationLandscapeLeft:outputRotation = kGPUImageFlipHorizonal; break; case UIInterfaceOrientationLandscapeRight:outputRotation = kGPUImageFlipVertical; break; default:outputRotation = kGPUImageNoRotation; } } else { switch(_outputImageOrientation) { case UIInterfaceOrientationPortrait:outputRotation = kGPUImageRotateRight; break; case UIInterfaceOrientationPortraitUpsideDown:outputRotation = kGPUImageRotateLeft; break; case UIInterfaceOrientationLandscapeLeft:outputRotation = kGPUImageRotate180; break; case UIInterfaceOrientationLandscapeRight:outputRotation = kGPUImageNoRotation; break; default:outputRotation = kGPUImageNoRotation; } } } else { if (_horizontallyMirrorFrontFacingCamera) { switch(_outputImageOrientation) { case UIInterfaceOrientationPortrait:outputRotation = kGPUImageRotateRightFlipVertical; break; case UIInterfaceOrientationPortraitUpsideDown:outputRotation = kGPUImageRotateRightFlipHorizontal; break; case UIInterfaceOrientationLandscapeLeft:outputRotation = kGPUImageFlipHorizonal; break; case UIInterfaceOrientationLandscapeRight:outputRotation = kGPUImageFlipVertical; break; default:outputRotation = kGPUImageNoRotation; } } else { switch(_outputImageOrientation) { case UIInterfaceOrientationPortrait:outputRotation = kGPUImageRotateRight; break; case UIInterfaceOrientationPortraitUpsideDown:outputRotation = kGPUImageRotateLeft; break; case UIInterfaceOrientationLandscapeLeft:outputRotation = kGPUImageNoRotation; break; case UIInterfaceOrientationLandscapeRight:outputRotation = kGPUImageRotate180; break; default:outputRotation = kGPUImageNoRotation; } } } } for (id currentTarget in targets) { NSInteger indexOfObject = [targets indexOfObject:currentTarget]; [currentTarget setInputRotation:outputRotation atIndex:[[targetTextureIndices objectAtIndex:indexOfObject] integerValue]]; } }); } - (void)setOutputImageOrientation:(UIInterfaceOrientation)newValue; { _outputImageOrientation = newValue; [self updateOrientationSendToTargets]; } - (void)setHorizontallyMirrorFrontFacingCamera:(BOOL)newValue { _horizontallyMirrorFrontFacingCamera = newValue; [self updateOrientationSendToTargets]; } - (void)setHorizontallyMirrorRearFacingCamera:(BOOL)newValue { _horizontallyMirrorRearFacingCamera = newValue; [self updateOrientationSendToTargets]; } @end ================================================ FILE: framework/Source/GPUImageVignetteFilter.h ================================================ #import "GPUImageFilter.h" /** Performs a vignetting effect, fading out the image at the edges */ @interface GPUImageVignetteFilter : GPUImageFilter { GLint vignetteCenterUniform, vignetteColorUniform, vignetteStartUniform, vignetteEndUniform; } // the center for the vignette in tex coords (defaults to 0.5, 0.5) @property (nonatomic, readwrite) CGPoint vignetteCenter; // The color to use for the Vignette (defaults to black) @property (nonatomic, readwrite) GPUVector3 vignetteColor; // The normalized distance from the center where the vignette effect starts. Default of 0.5. @property (nonatomic, readwrite) CGFloat vignetteStart; // The normalized distance from the center where the vignette effect ends. Default of 0.75. @property (nonatomic, readwrite) CGFloat vignetteEnd; @end ================================================ FILE: framework/Source/GPUImageVignetteFilter.m ================================================ #import "GPUImageVignetteFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageVignetteFragmentShaderString = SHADER_STRING ( uniform sampler2D inputImageTexture; varying highp vec2 textureCoordinate; uniform lowp vec2 vignetteCenter; uniform lowp vec3 vignetteColor; uniform highp float vignetteStart; uniform highp float vignetteEnd; void main() { lowp vec4 sourceImageColor = texture2D(inputImageTexture, textureCoordinate); lowp float d = distance(textureCoordinate, vec2(vignetteCenter.x, vignetteCenter.y)); lowp float percent = smoothstep(vignetteStart, vignetteEnd, d); gl_FragColor = vec4(mix(sourceImageColor.rgb, vignetteColor, percent), sourceImageColor.a); } ); #else NSString *const kGPUImageVignetteFragmentShaderString = SHADER_STRING ( uniform sampler2D inputImageTexture; varying vec2 textureCoordinate; uniform vec2 vignetteCenter; uniform vec3 vignetteColor; uniform float vignetteStart; uniform float vignetteEnd; void main() { vec4 sourceImageColor = texture2D(inputImageTexture, textureCoordinate); float d = distance(textureCoordinate, vec2(vignetteCenter.x, vignetteCenter.y)); float percent = smoothstep(vignetteStart, vignetteEnd, d); gl_FragColor = vec4(mix(sourceImageColor.rgb, vignetteColor, percent), sourceImageColor.a); } ); #endif @implementation GPUImageVignetteFilter @synthesize vignetteCenter = _vignetteCenter; @synthesize vignetteColor = _vignetteColor; @synthesize vignetteStart =_vignetteStart; @synthesize vignetteEnd = _vignetteEnd; #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageVignetteFragmentShaderString])) { return nil; } vignetteCenterUniform = [filterProgram uniformIndex:@"vignetteCenter"]; vignetteColorUniform = [filterProgram uniformIndex:@"vignetteColor"]; vignetteStartUniform = [filterProgram uniformIndex:@"vignetteStart"]; vignetteEndUniform = [filterProgram uniformIndex:@"vignetteEnd"]; self.vignetteCenter = (CGPoint){ 0.5f, 0.5f }; self.vignetteColor = (GPUVector3){ 0.0f, 0.0f, 0.0f }; self.vignetteStart = 0.3; self.vignetteEnd = 0.75; return self; } #pragma mark - #pragma mark Accessors - (void)setVignetteCenter:(CGPoint)newValue { _vignetteCenter = newValue; [self setPoint:newValue forUniform:vignetteCenterUniform program:filterProgram]; } - (void)setVignetteColor:(GPUVector3)newValue { _vignetteColor = newValue; [self setVec3:newValue forUniform:vignetteColorUniform program:filterProgram]; } - (void)setVignetteStart:(CGFloat)newValue; { _vignetteStart = newValue; [self setFloat:_vignetteStart forUniform:vignetteStartUniform program:filterProgram]; } - (void)setVignetteEnd:(CGFloat)newValue; { _vignetteEnd = newValue; [self setFloat:_vignetteEnd forUniform:vignetteEndUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImageVoronoiConsumerFilter.h ================================================ #import "GPUImageTwoInputFilter.h" @interface GPUImageVoronoiConsumerFilter : GPUImageTwoInputFilter { GLint sizeUniform; } @property (nonatomic, readwrite) CGSize sizeInPixels; @end ================================================ FILE: framework/Source/GPUImageVoronoiConsumerFilter.m ================================================ #import "GPUImageVoronoiConsumerFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageVoronoiConsumerFragmentShaderString = SHADER_STRING ( precision highp float; uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; uniform vec2 size; varying vec2 textureCoordinate; vec2 getCoordFromColor(vec4 color) { float z = color.z * 256.0; float yoff = floor(z / 8.0); float xoff = mod(z, 8.0); float x = color.x*256.0 + xoff*256.0; float y = color.y*256.0 + yoff*256.0; return vec2(x,y) / size; } void main(void) { vec4 colorLoc = texture2D(inputImageTexture2, textureCoordinate); vec4 color = texture2D(inputImageTexture, getCoordFromColor(colorLoc)); gl_FragColor = color; } ); #else NSString *const kGPUImageVoronoiConsumerFragmentShaderString = SHADER_STRING ( uniform sampler2D inputImageTexture; uniform sampler2D inputImageTexture2; uniform vec2 size; varying vec2 textureCoordinate; vec2 getCoordFromColor(vec4 color) { float z = color.z * 256.0; float yoff = floor(z / 8.0); float xoff = mod(z, 8.0); float x = color.x*256.0 + xoff*256.0; float y = color.y*256.0 + yoff*256.0; return vec2(x,y) / size; } void main(void) { vec4 colorLoc = texture2D(inputImageTexture2, textureCoordinate); vec4 color = texture2D(inputImageTexture, getCoordFromColor(colorLoc)); gl_FragColor = color; } ); #endif @implementation GPUImageVoronoiConsumerFilter @synthesize sizeInPixels = _sizeInPixels; - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageVoronoiConsumerFragmentShaderString])) { return nil; } sizeUniform = [filterProgram uniformIndex:@"size"]; return self; } -(void)setSizeInPixels:(CGSize)sizeInPixels { _sizeInPixels = sizeInPixels; //validate that it's a power of 2 and square float width = log2(sizeInPixels.width); float height = log2(sizeInPixels.height); if (width != height) { NSLog(@"Voronoi point texture must be square"); return; } if (width != floor(width) || height != floor(height)) { NSLog(@"Voronoi point texture must be a power of 2. Texture size %f, %f", sizeInPixels.width, sizeInPixels.height); return; } glUniform2f(sizeUniform, _sizeInPixels.width, _sizeInPixels.height); } @end ================================================ FILE: framework/Source/GPUImageWeakPixelInclusionFilter.h ================================================ #import "GPUImage3x3TextureSamplingFilter.h" @interface GPUImageWeakPixelInclusionFilter : GPUImage3x3TextureSamplingFilter @end ================================================ FILE: framework/Source/GPUImageWeakPixelInclusionFilter.m ================================================ #import "GPUImageWeakPixelInclusionFilter.h" @implementation GPUImageWeakPixelInclusionFilter #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageWeakPixelInclusionFragmentShaderString = SHADER_STRING ( precision lowp float; varying vec2 textureCoordinate; varying vec2 leftTextureCoordinate; varying vec2 rightTextureCoordinate; varying vec2 topTextureCoordinate; varying vec2 topLeftTextureCoordinate; varying vec2 topRightTextureCoordinate; varying vec2 bottomTextureCoordinate; varying vec2 bottomLeftTextureCoordinate; varying vec2 bottomRightTextureCoordinate; uniform sampler2D inputImageTexture; void main() { float bottomLeftIntensity = texture2D(inputImageTexture, bottomLeftTextureCoordinate).r; float topRightIntensity = texture2D(inputImageTexture, topRightTextureCoordinate).r; float topLeftIntensity = texture2D(inputImageTexture, topLeftTextureCoordinate).r; float bottomRightIntensity = texture2D(inputImageTexture, bottomRightTextureCoordinate).r; float leftIntensity = texture2D(inputImageTexture, leftTextureCoordinate).r; float rightIntensity = texture2D(inputImageTexture, rightTextureCoordinate).r; float bottomIntensity = texture2D(inputImageTexture, bottomTextureCoordinate).r; float topIntensity = texture2D(inputImageTexture, topTextureCoordinate).r; float centerIntensity = texture2D(inputImageTexture, textureCoordinate).r; float pixelIntensitySum = bottomLeftIntensity + topRightIntensity + topLeftIntensity + bottomRightIntensity + leftIntensity + rightIntensity + bottomIntensity + topIntensity + centerIntensity; float sumTest = step(1.5, pixelIntensitySum); float pixelTest = step(0.01, centerIntensity); gl_FragColor = vec4(vec3(sumTest * pixelTest), 1.0); } ); #else NSString *const kGPUImageWeakPixelInclusionFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; varying vec2 leftTextureCoordinate; varying vec2 rightTextureCoordinate; varying vec2 topTextureCoordinate; varying vec2 topLeftTextureCoordinate; varying vec2 topRightTextureCoordinate; varying vec2 bottomTextureCoordinate; varying vec2 bottomLeftTextureCoordinate; varying vec2 bottomRightTextureCoordinate; uniform sampler2D inputImageTexture; void main() { float bottomLeftIntensity = texture2D(inputImageTexture, bottomLeftTextureCoordinate).r; float topRightIntensity = texture2D(inputImageTexture, topRightTextureCoordinate).r; float topLeftIntensity = texture2D(inputImageTexture, topLeftTextureCoordinate).r; float bottomRightIntensity = texture2D(inputImageTexture, bottomRightTextureCoordinate).r; float leftIntensity = texture2D(inputImageTexture, leftTextureCoordinate).r; float rightIntensity = texture2D(inputImageTexture, rightTextureCoordinate).r; float bottomIntensity = texture2D(inputImageTexture, bottomTextureCoordinate).r; float topIntensity = texture2D(inputImageTexture, topTextureCoordinate).r; float centerIntensity = texture2D(inputImageTexture, textureCoordinate).r; float pixelIntensitySum = bottomLeftIntensity + topRightIntensity + topLeftIntensity + bottomRightIntensity + leftIntensity + rightIntensity + bottomIntensity + topIntensity + centerIntensity; float sumTest = step(1.5, pixelIntensitySum); float pixelTest = step(0.01, centerIntensity); gl_FragColor = vec4(vec3(sumTest * pixelTest), 1.0); } ); #endif #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [self initWithFragmentShaderFromString:kGPUImageWeakPixelInclusionFragmentShaderString])) { return nil; } return self; } @end ================================================ FILE: framework/Source/GPUImageWhiteBalanceFilter.h ================================================ #import "GPUImageFilter.h" /** * Created by Alaric Cole * Allows adjustment of color temperature in terms of what an image was effectively shot in. This means higher Kelvin values will warm the image, while lower values will cool it. */ @interface GPUImageWhiteBalanceFilter : GPUImageFilter { GLint temperatureUniform, tintUniform; } //choose color temperature, in degrees Kelvin @property(readwrite, nonatomic) CGFloat temperature; //adjust tint to compensate @property(readwrite, nonatomic) CGFloat tint; @end ================================================ FILE: framework/Source/GPUImageWhiteBalanceFilter.m ================================================ #import "GPUImageWhiteBalanceFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageWhiteBalanceFragmentShaderString = SHADER_STRING ( uniform sampler2D inputImageTexture; varying highp vec2 textureCoordinate; uniform lowp float temperature; uniform lowp float tint; const lowp vec3 warmFilter = vec3(0.93, 0.54, 0.0); const mediump mat3 RGBtoYIQ = mat3(0.299, 0.587, 0.114, 0.596, -0.274, -0.322, 0.212, -0.523, 0.311); const mediump mat3 YIQtoRGB = mat3(1.0, 0.956, 0.621, 1.0, -0.272, -0.647, 1.0, -1.105, 1.702); void main() { lowp vec4 source = texture2D(inputImageTexture, textureCoordinate); mediump vec3 yiq = RGBtoYIQ * source.rgb; //adjusting tint yiq.b = clamp(yiq.b + tint*0.5226*0.1, -0.5226, 0.5226); lowp vec3 rgb = YIQtoRGB * yiq; lowp vec3 processed = vec3( (rgb.r < 0.5 ? (2.0 * rgb.r * warmFilter.r) : (1.0 - 2.0 * (1.0 - rgb.r) * (1.0 - warmFilter.r))), //adjusting temperature (rgb.g < 0.5 ? (2.0 * rgb.g * warmFilter.g) : (1.0 - 2.0 * (1.0 - rgb.g) * (1.0 - warmFilter.g))), (rgb.b < 0.5 ? (2.0 * rgb.b * warmFilter.b) : (1.0 - 2.0 * (1.0 - rgb.b) * (1.0 - warmFilter.b)))); gl_FragColor = vec4(mix(rgb, processed, temperature), source.a); } ); #else NSString *const kGPUImageWhiteBalanceFragmentShaderString = SHADER_STRING ( uniform sampler2D inputImageTexture; varying vec2 textureCoordinate; uniform float temperature; uniform float tint; const vec3 warmFilter = vec3(0.93, 0.54, 0.0); const mat3 RGBtoYIQ = mat3(0.299, 0.587, 0.114, 0.596, -0.274, -0.322, 0.212, -0.523, 0.311); const mat3 YIQtoRGB = mat3(1.0, 0.956, 0.621, 1.0, -0.272, -0.647, 1.0, -1.105, 1.702); void main() { vec4 source = texture2D(inputImageTexture, textureCoordinate); vec3 yiq = RGBtoYIQ * source.rgb; //adjusting tint yiq.b = clamp(yiq.b + tint*0.5226*0.1, -0.5226, 0.5226); vec3 rgb = YIQtoRGB * yiq; vec3 processed = vec3( (rgb.r < 0.5 ? (2.0 * rgb.r * warmFilter.r) : (1.0 - 2.0 * (1.0 - rgb.r) * (1.0 - warmFilter.r))), //adjusting temperature (rgb.g < 0.5 ? (2.0 * rgb.g * warmFilter.g) : (1.0 - 2.0 * (1.0 - rgb.g) * (1.0 - warmFilter.g))), (rgb.b < 0.5 ? (2.0 * rgb.b * warmFilter.b) : (1.0 - 2.0 * (1.0 - rgb.b) * (1.0 - warmFilter.b)))); gl_FragColor = vec4(mix(rgb, processed, temperature), source.a); } ); #endif @implementation GPUImageWhiteBalanceFilter @synthesize temperature = _temperature; @synthesize tint = _tint; #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageWhiteBalanceFragmentShaderString])) { return nil; } temperatureUniform = [filterProgram uniformIndex:@"temperature"]; tintUniform = [filterProgram uniformIndex:@"tint"]; self.temperature = 5000.0; self.tint = 0.0; return self; } #pragma mark - #pragma mark Accessors - (void)setTemperature:(CGFloat)newValue; { _temperature = newValue; [self setFloat:_temperature < 5000 ? 0.0004 * (_temperature-5000.0) : 0.00006 * (_temperature-5000.0) forUniform:temperatureUniform program:filterProgram]; } - (void)setTint:(CGFloat)newValue; { _tint = newValue; [self setFloat:_tint / 100.0 forUniform:tintUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImageXYDerivativeFilter.h ================================================ #import "GPUImageSobelEdgeDetectionFilter.h" @interface GPUImageXYDerivativeFilter : GPUImageSobelEdgeDetectionFilter @end ================================================ FILE: framework/Source/GPUImageXYDerivativeFilter.m ================================================ #import "GPUImageXYDerivativeFilter.h" // I'm using the Prewitt operator to obtain the derivative, then squaring the X and Y components and placing the product of the two in Z. // In tests, Prewitt seemed to be tied with Sobel for the best, and it's just a little cheaper to compute. // This is primarily intended to be used with corner detection filters. @implementation GPUImageXYDerivativeFilter #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageGradientFragmentShaderString = SHADER_STRING ( precision highp float; varying vec2 textureCoordinate; varying vec2 leftTextureCoordinate; varying vec2 rightTextureCoordinate; varying vec2 topTextureCoordinate; varying vec2 topLeftTextureCoordinate; varying vec2 topRightTextureCoordinate; varying vec2 bottomTextureCoordinate; varying vec2 bottomLeftTextureCoordinate; varying vec2 bottomRightTextureCoordinate; uniform sampler2D inputImageTexture; uniform float edgeStrength; void main() { float topIntensity = texture2D(inputImageTexture, topTextureCoordinate).r; float topRightIntensity = texture2D(inputImageTexture, topRightTextureCoordinate).r; float topLeftIntensity = texture2D(inputImageTexture, topLeftTextureCoordinate).r; float bottomIntensity = texture2D(inputImageTexture, bottomTextureCoordinate).r; float bottomLeftIntensity = texture2D(inputImageTexture, bottomLeftTextureCoordinate).r; float bottomRightIntensity = texture2D(inputImageTexture, bottomRightTextureCoordinate).r; float leftIntensity = texture2D(inputImageTexture, leftTextureCoordinate).r; float rightIntensity = texture2D(inputImageTexture, rightTextureCoordinate).r; float verticalDerivative = -topLeftIntensity - topIntensity - topRightIntensity + bottomLeftIntensity + bottomIntensity + bottomRightIntensity; float horizontalDerivative = -bottomLeftIntensity - leftIntensity - topLeftIntensity + bottomRightIntensity + rightIntensity + topRightIntensity; verticalDerivative = verticalDerivative * edgeStrength; horizontalDerivative = horizontalDerivative * edgeStrength; // Scaling the X * Y operation so that negative numbers are not clipped in the 0..1 range. This will be expanded in the corner detection filter gl_FragColor = vec4(horizontalDerivative * horizontalDerivative, verticalDerivative * verticalDerivative, ((verticalDerivative * horizontalDerivative) + 1.0) / 2.0, 1.0); } ); #else NSString *const kGPUImageGradientFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; varying vec2 leftTextureCoordinate; varying vec2 rightTextureCoordinate; varying vec2 topTextureCoordinate; varying vec2 topLeftTextureCoordinate; varying vec2 topRightTextureCoordinate; varying vec2 bottomTextureCoordinate; varying vec2 bottomLeftTextureCoordinate; varying vec2 bottomRightTextureCoordinate; uniform sampler2D inputImageTexture; uniform float edgeStrength; void main() { float topIntensity = texture2D(inputImageTexture, topTextureCoordinate).r; float topRightIntensity = texture2D(inputImageTexture, topRightTextureCoordinate).r; float topLeftIntensity = texture2D(inputImageTexture, topLeftTextureCoordinate).r; float bottomIntensity = texture2D(inputImageTexture, bottomTextureCoordinate).r; float bottomLeftIntensity = texture2D(inputImageTexture, bottomLeftTextureCoordinate).r; float bottomRightIntensity = texture2D(inputImageTexture, bottomRightTextureCoordinate).r; float leftIntensity = texture2D(inputImageTexture, leftTextureCoordinate).r; float rightIntensity = texture2D(inputImageTexture, rightTextureCoordinate).r; float verticalDerivative = -topLeftIntensity - topIntensity - topRightIntensity + bottomLeftIntensity + bottomIntensity + bottomRightIntensity; float horizontalDerivative = -bottomLeftIntensity - leftIntensity - topLeftIntensity + bottomRightIntensity + rightIntensity + topRightIntensity; verticalDerivative = verticalDerivative * edgeStrength; horizontalDerivative = horizontalDerivative * edgeStrength; // Scaling the X * Y operation so that negative numbers are not clipped in the 0..1 range. This will be expanded in the corner detection filter gl_FragColor = vec4(horizontalDerivative * horizontalDerivative, verticalDerivative * verticalDerivative, ((verticalDerivative * horizontalDerivative) + 1.0) / 2.0, 1.0); } ); #endif #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [self initWithFragmentShaderFromString:kGPUImageGradientFragmentShaderString])) { return nil; } self.edgeStrength = 1.0; return self; } @end ================================================ FILE: framework/Source/GPUImageZoomBlurFilter.h ================================================ #import "GPUImageFilter.h" @interface GPUImageZoomBlurFilter : GPUImageFilter /** A multiplier for the blur size, ranging from 0.0 on up, with a default of 1.0 */ @property (readwrite, nonatomic) CGFloat blurSize; /** The normalized center of the blur. (0.5, 0.5) by default */ @property (readwrite, nonatomic) CGPoint blurCenter; @end ================================================ FILE: framework/Source/GPUImageZoomBlurFilter.m ================================================ #import "GPUImageZoomBlurFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageZoomBlurFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform highp vec2 blurCenter; uniform highp float blurSize; void main() { // TODO: Do a more intelligent scaling based on resolution here highp vec2 samplingOffset = 1.0/100.0 * (blurCenter - textureCoordinate) * blurSize; lowp vec4 fragmentColor = texture2D(inputImageTexture, textureCoordinate) * 0.18; fragmentColor += texture2D(inputImageTexture, textureCoordinate + samplingOffset) * 0.15; fragmentColor += texture2D(inputImageTexture, textureCoordinate + (2.0 * samplingOffset)) * 0.12; fragmentColor += texture2D(inputImageTexture, textureCoordinate + (3.0 * samplingOffset)) * 0.09; fragmentColor += texture2D(inputImageTexture, textureCoordinate + (4.0 * samplingOffset)) * 0.05; fragmentColor += texture2D(inputImageTexture, textureCoordinate - samplingOffset) * 0.15; fragmentColor += texture2D(inputImageTexture, textureCoordinate - (2.0 * samplingOffset)) * 0.12; fragmentColor += texture2D(inputImageTexture, textureCoordinate - (3.0 * samplingOffset)) * 0.09; fragmentColor += texture2D(inputImageTexture, textureCoordinate - (4.0 * samplingOffset)) * 0.05; gl_FragColor = fragmentColor; } ); #else NSString *const kGPUImageZoomBlurFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; uniform vec2 blurCenter; uniform float blurSize; void main() { // TODO: Do a more intelligent scaling based on resolution here vec2 samplingOffset = 1.0/100.0 * (blurCenter - textureCoordinate) * blurSize; vec4 fragmentColor = texture2D(inputImageTexture, textureCoordinate) * 0.18; fragmentColor += texture2D(inputImageTexture, textureCoordinate + samplingOffset) * 0.15; fragmentColor += texture2D(inputImageTexture, textureCoordinate + (2.0 * samplingOffset)) * 0.12; fragmentColor += texture2D(inputImageTexture, textureCoordinate + (3.0 * samplingOffset)) * 0.09; fragmentColor += texture2D(inputImageTexture, textureCoordinate + (4.0 * samplingOffset)) * 0.05; fragmentColor += texture2D(inputImageTexture, textureCoordinate - samplingOffset) * 0.15; fragmentColor += texture2D(inputImageTexture, textureCoordinate - (2.0 * samplingOffset)) * 0.12; fragmentColor += texture2D(inputImageTexture, textureCoordinate - (3.0 * samplingOffset)) * 0.09; fragmentColor += texture2D(inputImageTexture, textureCoordinate - (4.0 * samplingOffset)) * 0.05; gl_FragColor = fragmentColor; } ); #endif @interface GPUImageZoomBlurFilter() { GLint blurSizeUniform, blurCenterUniform; } @end @implementation GPUImageZoomBlurFilter @synthesize blurSize = _blurSize; @synthesize blurCenter = _blurCenter; #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super initWithFragmentShaderFromString:kGPUImageZoomBlurFragmentShaderString])) { return nil; } blurSizeUniform = [filterProgram uniformIndex:@"blurSize"]; blurCenterUniform = [filterProgram uniformIndex:@"blurCenter"]; self.blurSize = 1.0; self.blurCenter = CGPointMake(0.5, 0.5); return self; } #pragma mark - #pragma mark Accessors - (void)setInputRotation:(GPUImageRotationMode)newInputRotation atIndex:(NSInteger)textureIndex; { [super setInputRotation:newInputRotation atIndex:textureIndex]; [self setBlurCenter:self.blurCenter]; } - (void)setBlurSize:(CGFloat)newValue; { _blurSize = newValue; [self setFloat:_blurSize forUniform:blurSizeUniform program:filterProgram]; } - (void)setBlurCenter:(CGPoint)newValue; { _blurCenter = newValue; CGPoint rotatedPoint = [self rotatedPoint:_blurCenter forRotation:inputRotation]; [self setPoint:rotatedPoint forUniform:blurCenterUniform program:filterProgram]; } @end ================================================ FILE: framework/Source/GPUImageiOSBlurFilter.h ================================================ #import "GPUImageFilterGroup.h" @class GPUImageSaturationFilter; @class GPUImageGaussianBlurFilter; @class GPUImageLuminanceRangeFilter; @interface GPUImageiOSBlurFilter : GPUImageFilterGroup { GPUImageSaturationFilter *saturationFilter; GPUImageGaussianBlurFilter *blurFilter; GPUImageLuminanceRangeFilter *luminanceRangeFilter; } /** A radius in pixels to use for the blur, with a default of 12.0. This adjusts the sigma variable in the Gaussian distribution function. */ @property (readwrite, nonatomic) CGFloat blurRadiusInPixels; /** Saturation ranges from 0.0 (fully desaturated) to 2.0 (max saturation), with 0.8 as the normal level */ @property (readwrite, nonatomic) CGFloat saturation; /** The degree to which to downsample, then upsample the incoming image to minimize computations within the Gaussian blur, default of 4.0 */ @property (readwrite, nonatomic) CGFloat downsampling; /** The degree to reduce the luminance range, from 0.0 to 1.0. Default is 0.6. */ @property (readwrite, nonatomic) CGFloat rangeReductionFactor; @end ================================================ FILE: framework/Source/GPUImageiOSBlurFilter.m ================================================ #import "GPUImageiOSBlurFilter.h" #import "GPUImageSaturationFilter.h" #import "GPUImageGaussianBlurFilter.h" #import "GPUImageLuminanceRangeFilter.h" @implementation GPUImageiOSBlurFilter @synthesize blurRadiusInPixels; @synthesize saturation; @synthesize downsampling = _downsampling; #pragma mark - #pragma mark Initialization and teardown - (id)init; { if (!(self = [super init])) { return nil; } // First pass: downsample and desaturate saturationFilter = [[GPUImageSaturationFilter alloc] init]; [self addFilter:saturationFilter]; // Second pass: apply a strong Gaussian blur blurFilter = [[GPUImageGaussianBlurFilter alloc] init]; [self addFilter:blurFilter]; // Third pass: upsample and adjust luminance range luminanceRangeFilter = [[GPUImageLuminanceRangeFilter alloc] init]; [self addFilter:luminanceRangeFilter]; [saturationFilter addTarget:blurFilter]; [blurFilter addTarget:luminanceRangeFilter]; self.initialFilters = [NSArray arrayWithObject:saturationFilter]; self.terminalFilter = luminanceRangeFilter; self.blurRadiusInPixels = 12.0; self.saturation = 0.8; self.downsampling = 4.0; self.rangeReductionFactor = 0.6; return self; } - (void)setInputSize:(CGSize)newSize atIndex:(NSInteger)textureIndex; { if (_downsampling > 1.0) { CGSize rotatedSize = [saturationFilter rotatedSize:newSize forIndex:textureIndex]; [saturationFilter forceProcessingAtSize:CGSizeMake(rotatedSize.width / _downsampling, rotatedSize.height / _downsampling)]; [luminanceRangeFilter forceProcessingAtSize:rotatedSize]; } [super setInputSize:newSize atIndex:textureIndex]; } #pragma mark - #pragma mark Accessors // From Apple's UIImage+ImageEffects category: // A description of how to compute the box kernel width from the Gaussian // radius (aka standard deviation) appears in the SVG spec: // http://www.w3.org/TR/SVG/filters.html#feGaussianBlurElement // // For larger values of 's' (s >= 2.0), an approximation can be used: Three // successive box-blurs build a piece-wise quadratic convolution kernel, which // approximates the Gaussian kernel to within roughly 3%. // // let d = floor(s * 3*sqrt(2*pi)/4 + 0.5) // // ... if d is odd, use three box-blurs of size 'd', centered on the output pixel. - (void)setBlurRadiusInPixels:(CGFloat)newValue; { blurFilter.blurRadiusInPixels = newValue; } - (CGFloat)blurRadiusInPixels; { return blurFilter.blurRadiusInPixels; } - (void)setSaturation:(CGFloat)newValue; { saturationFilter.saturation = newValue; } - (CGFloat)saturation; { return saturationFilter.saturation; } - (void)setDownsampling:(CGFloat)newValue; { _downsampling = newValue; } - (void)setRangeReductionFactor:(CGFloat)rangeReductionFactor { luminanceRangeFilter.rangeReductionFactor = rangeReductionFactor; } - (CGFloat)rangeReductionFactor { return luminanceRangeFilter.rangeReductionFactor; } @end ================================================ FILE: framework/Source/Mac/GPUImage.h ================================================ #import // Base classes #import #import // Sources #import #import #import #import #import #import #import #import // Filters #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import // Outputs #import #import #import ================================================ FILE: framework/Source/Mac/GPUImageAVCamera.h ================================================ #import #import #import #import "GPUImageContext.h" #import "GPUImageOutput.h" //Delegate Protocal for Face Detection. @protocol GPUImageVideoCameraDelegate @optional - (void)willOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer; @end /** A GPUImageOutput that provides frames from either camera */ @interface GPUImageAVCamera : GPUImageOutput { NSUInteger numberOfFramesCaptured; CGFloat totalFrameTimeDuringCapture; AVCaptureSession *_captureSession; AVCaptureDevice *_inputCamera; AVCaptureDevice *_microphone; AVCaptureDeviceInput *videoInput; AVCaptureVideoDataOutput *videoOutput; BOOL capturePaused; GPUImageRotationMode outputRotation; dispatch_semaphore_t frameRenderingSemaphore; BOOL captureAsYUV; GLuint luminanceTexture, chrominanceTexture; __unsafe_unretained id _delegate; } /// The AVCaptureSession used to capture from the camera @property(readonly, retain, nonatomic) AVCaptureSession *captureSession; /// This enables the capture session preset to be changed on the fly @property (readwrite, nonatomic, copy) NSString *captureSessionPreset; /// This sets the frame rate of the camera (iOS 5 and above only) /** Setting this to 0 or below will set the frame rate back to the default setting for a particular preset. */ @property (readwrite) NSInteger frameRate; /// Easy way to tell if front-facing camera is present on device @property (readonly, getter = isFrontFacingCameraPresent) BOOL frontFacingCameraPresent; /// This enables the benchmarking mode, which logs out instantaneous and average frame times to the console @property(readwrite, nonatomic) BOOL runBenchmark; /// Use this property to manage camera settings. Focus point, exposure point, etc. @property(readonly) AVCaptureDevice *inputCamera; /// These properties determine whether or not the two camera orientations should be mirrored. By default, both are NO. @property(readwrite, nonatomic) BOOL horizontallyMirrorFrontFacingCamera, horizontallyMirrorRearFacingCamera; @property(nonatomic, assign) id delegate; /// @name Initialization and teardown + (NSArray *)connectedCameraDevices; /** Begin a capture session See AVCaptureSession for acceptable values @param sessionPreset Session preset to use @param cameraPosition Camera to capture from */ - (id)initWithDeviceUniqueID:(NSString *)deviceUniqueID; - (id)initWithSessionPreset:(NSString *)sessionPreset deviceUniqueID:(NSString *)deviceUniqueID; - (id)initWithSessionPreset:(NSString *)sessionPreset cameraDevice:(AVCaptureDevice *)cameraDevice; /** Tear down the capture session */ - (void)removeInputsAndOutputs; /// @name Manage the camera video stream /** Start camera capturing */ - (void)startCameraCapture; /** Stop camera capturing */ - (void)stopCameraCapture; /** Pause camera capturing */ - (void)pauseCameraCapture; /** Resume camera capturing */ - (void)resumeCameraCapture; /** Process a video sample @param sampleBuffer Buffer to process */ - (void)processVideoSampleBuffer:(CMSampleBufferRef)sampleBuffer; /** Process an audio sample @param sampleBuffer Buffer to process */ - (void)processAudioSampleBuffer:(CMSampleBufferRef)sampleBuffer; /** Get the position (front, rear) of the source camera */ - (AVCaptureDevicePosition)cameraPosition; /** Get the AVCaptureConnection of the source camera */ - (AVCaptureConnection *)videoCaptureConnection; /** This flips between the front and rear cameras */ - (void)rotateCamera; /// @name Benchmarking /** When benchmarking is enabled, this will keep a running average of the time from uploading, processing, and final recording or display */ - (CGFloat)averageFrameDurationDuringCapture; - (void)printSupportedPixelFormats; @end ================================================ FILE: framework/Source/Mac/GPUImageAVCamera.m ================================================ #import "GPUImageAVCamera.h" #import "GPUImageMovieWriter.h" #import "GPUImageFilter.h" #import "GPUImageColorConversion.h" #pragma mark - #pragma mark Private methods and instance variables @interface GPUImageAVCamera () { AVCaptureDeviceInput *audioInput; AVCaptureAudioDataOutput *audioOutput; NSDate *startingCaptureTime; NSInteger _frameRate; dispatch_queue_t cameraProcessingQueue, audioProcessingQueue; GLProgram *yuvConversionProgram; GLint yuvConversionPositionAttribute, yuvConversionTextureCoordinateAttribute; GLint yuvConversionLuminanceTextureUniform, yuvConversionChrominanceTextureUniform; int imageBufferWidth, imageBufferHeight; } - (void)updateOrientationSendToTargets; - (void)convertYUVToRGBOutput; @end @implementation GPUImageAVCamera @synthesize captureSessionPreset = _captureSessionPreset; @synthesize captureSession = _captureSession; @synthesize inputCamera = _inputCamera; @synthesize runBenchmark = _runBenchmark; @synthesize delegate = _delegate; @synthesize horizontallyMirrorFrontFacingCamera = _horizontallyMirrorFrontFacingCamera, horizontallyMirrorRearFacingCamera = _horizontallyMirrorRearFacingCamera; #pragma mark - #pragma mark Initialization and teardown + (NSArray *)connectedCameraDevices; { NSArray *devices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo]; return devices; } - (id)init; { if (!(self = [self initWithSessionPreset:AVCaptureSessionPreset640x480 cameraDevice:nil])) { return nil; } return self; } - (id)initWithDeviceUniqueID:(NSString *)deviceUniqueID; { if (!(self = [self initWithSessionPreset:AVCaptureSessionPreset640x480 deviceUniqueID:deviceUniqueID])) { return nil; } return self; } - (id)initWithSessionPreset:(NSString *)sessionPreset deviceUniqueID:(NSString *)deviceUniqueID; { if (!(self = [self initWithSessionPreset:sessionPreset cameraDevice:[AVCaptureDevice deviceWithUniqueID:deviceUniqueID]])) { return nil; } return self; } - (id)initWithSessionPreset:(NSString *)sessionPreset cameraDevice:(AVCaptureDevice *)cameraDevice; { if (!(self = [super init])) { return nil; } cameraProcessingQueue = dispatch_queue_create("com.sunsetlakesoftware.GPUImage.cameraProcessingQueue", NULL); audioProcessingQueue = dispatch_queue_create("com.sunsetlakesoftware.GPUImage.audioProcessingQueue", NULL); frameRenderingSemaphore = dispatch_semaphore_create(1); _frameRate = 0; // This will not set frame rate unless this value gets set to 1 or above _runBenchmark = NO; capturePaused = NO; outputRotation = kGPUImageNoRotation; // captureAsYUV = YES; captureAsYUV = NO; runSynchronouslyOnVideoProcessingQueue(^{ if (captureAsYUV) { [GPUImageContext useImageProcessingContext]; // if ([GPUImageContext deviceSupportsRedTextures]) // { // yuvConversionProgram = [[GPUImageContext sharedImageProcessingContext] programForVertexShaderString:kGPUImageVertexShaderString fragmentShaderString:kGPUImageYUVVideoRangeConversionForRGFragmentShaderString]; // } // else // { yuvConversionProgram = [[GPUImageContext sharedImageProcessingContext] programForVertexShaderString:kGPUImageVertexShaderString fragmentShaderString:kGPUImageYUVVideoRangeConversionForLAFragmentShaderString]; // } if (!yuvConversionProgram.initialized) { [yuvConversionProgram addAttribute:@"position"]; [yuvConversionProgram addAttribute:@"inputTextureCoordinate"]; if (![yuvConversionProgram link]) { NSString *progLog = [yuvConversionProgram programLog]; NSLog(@"Program link log: %@", progLog); NSString *fragLog = [yuvConversionProgram fragmentShaderLog]; NSLog(@"Fragment shader compile log: %@", fragLog); NSString *vertLog = [yuvConversionProgram vertexShaderLog]; NSLog(@"Vertex shader compile log: %@", vertLog); yuvConversionProgram = nil; NSAssert(NO, @"Filter shader link failed"); } } yuvConversionPositionAttribute = [yuvConversionProgram attributeIndex:@"position"]; yuvConversionTextureCoordinateAttribute = [yuvConversionProgram attributeIndex:@"inputTextureCoordinate"]; yuvConversionLuminanceTextureUniform = [yuvConversionProgram uniformIndex:@"luminanceTexture"]; yuvConversionChrominanceTextureUniform = [yuvConversionProgram uniformIndex:@"chrominanceTexture"]; [GPUImageContext setActiveShaderProgram:yuvConversionProgram]; glEnableVertexAttribArray(yuvConversionPositionAttribute); glEnableVertexAttribArray(yuvConversionTextureCoordinateAttribute); } }); // Grab the back-facing or front-facing camera _inputCamera = nil; if (cameraDevice == nil) { _inputCamera = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo]; } else { _inputCamera = cameraDevice; } if (!_inputCamera) { return nil; } // Create the capture session _captureSession = [[AVCaptureSession alloc] init]; [_captureSession beginConfiguration]; // Add the video input NSError *error = nil; videoInput = [[AVCaptureDeviceInput alloc] initWithDevice:_inputCamera error:&error]; if ([_captureSession canAddInput:videoInput]) { [_captureSession addInput:videoInput]; } // Add the video frame output videoOutput = [[AVCaptureVideoDataOutput alloc] init]; [videoOutput setAlwaysDiscardsLateVideoFrames:NO]; // NSLog(@"Camera: %@", _inputCamera); // [self printSupportedPixelFormats]; // if (captureAsYUV && [GPUImageContext deviceSupportsRedTextures]) if (captureAsYUV && [GPUImageContext supportsFastTextureUpload]) { BOOL supportsFullYUVRange = NO; NSArray *supportedPixelFormats = videoOutput.availableVideoCVPixelFormatTypes; for (NSNumber *currentPixelFormat in supportedPixelFormats) { if ([currentPixelFormat intValue] == kCVPixelFormatType_420YpCbCr8BiPlanarFullRange) { supportsFullYUVRange = YES; } } if (supportsFullYUVRange) { [videoOutput setVideoSettings:[NSDictionary dictionaryWithObject:[NSNumber numberWithInt:kCVPixelFormatType_420YpCbCr8BiPlanarFullRange] forKey:(id)kCVPixelBufferPixelFormatTypeKey]]; } else { [videoOutput setVideoSettings:[NSDictionary dictionaryWithObject:[NSNumber numberWithInt:kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange] forKey:(id)kCVPixelBufferPixelFormatTypeKey]]; } } else { // Despite returning a longer list of supported pixel formats, only RGB, RGBA, BGRA, and the YUV 4:2:2 variants seem to return cleanly [videoOutput setVideoSettings:[NSDictionary dictionaryWithObject:[NSNumber numberWithInt:kCVPixelFormatType_32BGRA] forKey:(id)kCVPixelBufferPixelFormatTypeKey]]; // [videoOutput setVideoSettings:[NSDictionary dictionaryWithObject:[NSNumber numberWithInt:kCVPixelFormatType_422YpCbCr8_yuvs] forKey:(id)kCVPixelBufferPixelFormatTypeKey]]; } [videoOutput setSampleBufferDelegate:self queue:cameraProcessingQueue]; // [videoOutput setSampleBufferDelegate:self queue:[GPUImageContext sharedContextQueue]]; if ([_captureSession canAddOutput:videoOutput]) { [_captureSession addOutput:videoOutput]; } else { NSLog(@"Couldn't add video output"); return nil; } _captureSessionPreset = sessionPreset; [_captureSession setSessionPreset:_captureSessionPreset]; // This will let you get 60 FPS video from the 720p preset on an iPhone 4S, but only that device and that preset // AVCaptureConnection *conn = [videoOutput connectionWithMediaType:AVMediaTypeVideo]; // // if (conn.supportsVideoMinFrameDuration) // conn.videoMinFrameDuration = CMTimeMake(1,60); // if (conn.supportsVideoMaxFrameDuration) // conn.videoMaxFrameDuration = CMTimeMake(1,60); [_captureSession commitConfiguration]; return self; } - (void)dealloc { [self stopCameraCapture]; [videoOutput setSampleBufferDelegate:nil queue:dispatch_get_main_queue()]; [audioOutput setSampleBufferDelegate:nil queue:dispatch_get_main_queue()]; [self removeInputsAndOutputs]; // ARC forbids explicit message send of 'release'; since iOS 6 even for dispatch_release() calls: stripping it out in that case is required. //#if ( (__IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_6_0) || (!defined(__IPHONE_6_0)) ) #if __MAC_OS_X_VERSION_MAX_ALLOWED <= __MAC_10_7 if (cameraProcessingQueue != NULL) { dispatch_release(cameraProcessingQueue); } if (audioProcessingQueue != NULL) { dispatch_release(audioProcessingQueue); } if (frameRenderingSemaphore != NULL) { dispatch_release(frameRenderingSemaphore); } #endif } - (void)removeInputsAndOutputs; { [_captureSession removeInput:videoInput]; [_captureSession removeOutput:videoOutput]; if (_microphone != nil) { [_captureSession removeInput:audioInput]; [_captureSession removeOutput:audioOutput]; } } #pragma mark - #pragma mark Managing targets - (void)addTarget:(id)newTarget atTextureLocation:(NSInteger)textureLocation; { [super addTarget:newTarget atTextureLocation:textureLocation]; [newTarget setInputRotation:outputRotation atIndex:textureLocation]; } #pragma mark - #pragma mark Manage the camera video stream - (void)startCameraCapture; { if (![_captureSession isRunning]) { startingCaptureTime = [NSDate date]; [_captureSession startRunning]; }; } - (void)stopCameraCapture; { if ([_captureSession isRunning]) { [_captureSession stopRunning]; } } - (void)pauseCameraCapture; { capturePaused = YES; } - (void)resumeCameraCapture; { capturePaused = NO; } - (void)rotateCamera { if (self.frontFacingCameraPresent == NO) return; NSError *error; AVCaptureDeviceInput *newVideoInput; AVCaptureDevicePosition currentCameraPosition = [[videoInput device] position]; if (currentCameraPosition == AVCaptureDevicePositionBack) { currentCameraPosition = AVCaptureDevicePositionFront; } else { currentCameraPosition = AVCaptureDevicePositionBack; } AVCaptureDevice *backFacingCamera = nil; NSArray *devices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo]; for (AVCaptureDevice *device in devices) { if ([device position] == currentCameraPosition) { backFacingCamera = device; } } newVideoInput = [[AVCaptureDeviceInput alloc] initWithDevice:backFacingCamera error:&error]; if (newVideoInput != nil) { [_captureSession beginConfiguration]; [_captureSession removeInput:videoInput]; if ([_captureSession canAddInput:newVideoInput]) { [_captureSession addInput:newVideoInput]; videoInput = newVideoInput; } else { [_captureSession addInput:videoInput]; } //captureSession.sessionPreset = oriPreset; [_captureSession commitConfiguration]; } _inputCamera = backFacingCamera; } - (AVCaptureDevicePosition)cameraPosition { return [[videoInput device] position]; } - (BOOL)isFrontFacingCameraPresent; { NSArray *devices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo]; for (AVCaptureDevice *device in devices) { if ([device position] == AVCaptureDevicePositionFront) return YES; } return NO; } - (void)setCaptureSessionPreset:(NSString *)captureSessionPreset; { [_captureSession beginConfiguration]; _captureSessionPreset = captureSessionPreset; [_captureSession setSessionPreset:_captureSessionPreset]; [_captureSession commitConfiguration]; } - (void)setFrameRate:(NSInteger)frameRate; { _frameRate = frameRate; if (_frameRate > 0) { for (AVCaptureConnection *connection in videoOutput.connections) { if ([connection respondsToSelector:@selector(setVideoMinFrameDuration:)]) connection.videoMinFrameDuration = CMTimeMake(1, (int32_t)_frameRate); } } else { for (AVCaptureConnection *connection in videoOutput.connections) { if ([connection respondsToSelector:@selector(setVideoMinFrameDuration:)]) connection.videoMinFrameDuration = kCMTimeInvalid; // This sets videoMinFrameDuration back to default } } } - (NSInteger)frameRate; { return _frameRate; } - (AVCaptureConnection *)videoCaptureConnection { for (AVCaptureConnection *connection in [videoOutput connections] ) { for ( AVCaptureInputPort *port in [connection inputPorts] ) { if ( [[port mediaType] isEqual:AVMediaTypeVideo] ) { return connection; } } } return nil; } #define INITIALFRAMESTOIGNOREFORBENCHMARK 5 - (void)updateTargetsForVideoCameraUsingCacheTextureAtWidth:(int)bufferWidth height:(int)bufferHeight time:(CMTime)currentTime; { // First, update all the framebuffers in the targets for (id currentTarget in targets) { if ([currentTarget enabled]) { NSInteger indexOfObject = [targets indexOfObject:currentTarget]; NSInteger textureIndexOfTarget = [[targetTextureIndices objectAtIndex:indexOfObject] integerValue]; if (currentTarget != self.targetToIgnoreForUpdates) { [currentTarget setInputRotation:outputRotation atIndex:textureIndexOfTarget]; [currentTarget setInputSize:CGSizeMake(bufferWidth, bufferHeight) atIndex:textureIndexOfTarget]; if ([currentTarget wantsMonochromeInput] && captureAsYUV) { [currentTarget setCurrentlyReceivingMonochromeInput:YES]; // TODO: Replace optimization for monochrome output [currentTarget setInputFramebuffer:outputFramebuffer atIndex:textureIndexOfTarget]; } else { [currentTarget setCurrentlyReceivingMonochromeInput:NO]; [currentTarget setInputFramebuffer:outputFramebuffer atIndex:textureIndexOfTarget]; } } else { [currentTarget setInputRotation:outputRotation atIndex:textureIndexOfTarget]; [currentTarget setInputFramebuffer:outputFramebuffer atIndex:textureIndexOfTarget]; } } } // Then release our hold on the local framebuffer to send it back to the cache as soon as it's no longer needed [outputFramebuffer unlock]; // Finally, trigger rendering as needed for (id currentTarget in targets) { if ([currentTarget enabled]) { NSInteger indexOfObject = [targets indexOfObject:currentTarget]; NSInteger textureIndexOfTarget = [[targetTextureIndices objectAtIndex:indexOfObject] integerValue]; if (currentTarget != self.targetToIgnoreForUpdates) { [currentTarget newFrameReadyAtTime:currentTime atIndex:textureIndexOfTarget]; } } } } - (void)processVideoSampleBuffer:(CMSampleBufferRef)sampleBuffer; { if (capturePaused) { return; } CFAbsoluteTime startTime = CFAbsoluteTimeGetCurrent(); CVImageBufferRef cameraFrame = CMSampleBufferGetImageBuffer(sampleBuffer); GLsizei bufferWidth = (GLsizei)CVPixelBufferGetWidth(cameraFrame); GLsizei bufferHeight = (GLsizei)CVPixelBufferGetHeight(cameraFrame); CMTime currentTime = CMSampleBufferGetPresentationTimeStamp(sampleBuffer); [GPUImageContext useImageProcessingContext]; CVPixelBufferLockBaseAddress(cameraFrame, 0); outputFramebuffer = [[GPUImageContext sharedFramebufferCache] fetchFramebufferForSize:CGSizeMake(bufferWidth, bufferHeight) onlyTexture:YES]; glBindTexture(GL_TEXTURE_2D, [outputFramebuffer texture]); // glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, bufferWidth, bufferHeight, 0, GL_BGRA, GL_UNSIGNED_BYTE, CVPixelBufferGetBaseAddress(cameraFrame)); // Using BGRA extension to pull in video frame data directly // glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, bytesPerRow / 3, bufferHeight, 0, GL_RGB, GL_UNSIGNED_BYTE, CVPixelBufferGetBaseAddress(cameraFrame)); // glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, bufferWidth, bufferHeight, 0, GL_YCBCR_422_APPLE, GL_UNSIGNED_SHORT_8_8_REV_APPLE, CVPixelBufferGetBaseAddress(cameraFrame)); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, bufferWidth, bufferHeight, 0, GL_BGRA, GL_UNSIGNED_BYTE, CVPixelBufferGetBaseAddress(cameraFrame)); [self updateTargetsForVideoCameraUsingCacheTextureAtWidth:bufferWidth height:bufferHeight time:currentTime]; // for (id currentTarget in targets) // { // if ([currentTarget enabled]) // { // if (currentTarget != self.targetToIgnoreForUpdates) // { // NSInteger indexOfObject = [targets indexOfObject:currentTarget]; // NSInteger textureIndexOfTarget = [[targetTextureIndices objectAtIndex:indexOfObject] integerValue]; // // [currentTarget setInputSize:CGSizeMake(bufferWidth, bufferHeight) atIndex:textureIndexOfTarget]; // [currentTarget newFrameReadyAtTime:currentTime atIndex:textureIndexOfTarget]; // } // } // } CVPixelBufferUnlockBaseAddress(cameraFrame, 0); if (_runBenchmark) { numberOfFramesCaptured++; if (numberOfFramesCaptured > INITIALFRAMESTOIGNOREFORBENCHMARK) { CFAbsoluteTime currentFrameTime = (CFAbsoluteTimeGetCurrent() - startTime); totalFrameTimeDuringCapture += currentFrameTime; NSLog(@"Average frame time : %f ms", [self averageFrameDurationDuringCapture]); NSLog(@"Current frame time : %f ms", 1000.0 * currentFrameTime); } } } - (void)processAudioSampleBuffer:(CMSampleBufferRef)sampleBuffer; { [self.audioEncodingTarget processAudioBuffer:sampleBuffer]; } - (void)convertYUVToRGBOutput; { [GPUImageContext setActiveShaderProgram:yuvConversionProgram]; outputFramebuffer = [[GPUImageContext sharedFramebufferCache] fetchFramebufferForSize:CGSizeMake(imageBufferWidth, imageBufferHeight) textureOptions:self.outputTextureOptions onlyTexture:NO]; [outputFramebuffer activateFramebuffer]; glClearColor(0.0f, 0.0f, 0.0f, 1.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); static const GLfloat squareVertices[] = { -1.0f, -1.0f, 1.0f, -1.0f, -1.0f, 1.0f, 1.0f, 1.0f, }; static const GLfloat textureCoordinates[] = { 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, }; glActiveTexture(GL_TEXTURE4); glBindTexture(GL_TEXTURE_2D, luminanceTexture); glUniform1i(yuvConversionLuminanceTextureUniform, 4); glActiveTexture(GL_TEXTURE5); glBindTexture(GL_TEXTURE_2D, chrominanceTexture); glUniform1i(yuvConversionChrominanceTextureUniform, 5); glVertexAttribPointer(yuvConversionPositionAttribute, 2, GL_FLOAT, 0, 0, squareVertices); glVertexAttribPointer(yuvConversionTextureCoordinateAttribute, 2, GL_FLOAT, 0, 0, textureCoordinates); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); } #pragma mark - #pragma mark Benchmarking - (CGFloat)averageFrameDurationDuringCapture; { return (totalFrameTimeDuringCapture / (CGFloat)(numberOfFramesCaptured - INITIALFRAMESTOIGNOREFORBENCHMARK)) * 1000.0; } #pragma mark - #pragma mark AVCaptureVideoDataOutputSampleBufferDelegate - (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection { if (captureOutput == audioOutput) { // if (dispatch_semaphore_wait(frameRenderingSemaphore, DISPATCH_TIME_NOW) != 0) // { // return; // } CFRetain(sampleBuffer); runAsynchronouslyOnVideoProcessingQueue(^{ [self processAudioSampleBuffer:sampleBuffer]; CFRelease(sampleBuffer); // dispatch_semaphore_signal(frameRenderingSemaphore); }); } else { if (dispatch_semaphore_wait(frameRenderingSemaphore, DISPATCH_TIME_NOW) != 0) { return; } CFRetain(sampleBuffer); runAsynchronouslyOnVideoProcessingQueue(^{ //Feature Detection Hook. if (self.delegate && [self.delegate respondsToSelector:@selector(willOutputSampleBuffer:)]) { [self.delegate willOutputSampleBuffer:sampleBuffer]; } [self processVideoSampleBuffer:sampleBuffer]; CFRelease(sampleBuffer); dispatch_semaphore_signal(frameRenderingSemaphore); }); } } #pragma mark - #pragma mark Accessors - (void)setAudioEncodingTarget:(GPUImageMovieWriter *)newValue; { runSynchronouslyOnVideoProcessingQueue(^{ [_captureSession beginConfiguration]; if (newValue == nil) { if (audioOutput) { [_captureSession removeInput:audioInput]; [_captureSession removeOutput:audioOutput]; audioInput = nil; audioOutput = nil; _microphone = nil; } } else { _microphone = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeAudio]; audioInput = [AVCaptureDeviceInput deviceInputWithDevice:_microphone error:nil]; if ([_captureSession canAddInput:audioInput]) { [_captureSession addInput:audioInput]; } audioOutput = [[AVCaptureAudioDataOutput alloc] init]; if ([_captureSession canAddOutput:audioOutput]) { [_captureSession addOutput:audioOutput]; } else { NSLog(@"Couldn't add audio output"); } [audioOutput setSampleBufferDelegate:self queue:audioProcessingQueue]; } [_captureSession commitConfiguration]; [super setAudioEncodingTarget:newValue]; }); } - (void)updateOrientationSendToTargets; { runSynchronouslyOnVideoProcessingQueue(^{ // From the iOS 5.0 release notes: // In previous iOS versions, the front-facing camera would always deliver buffers in AVCaptureVideoOrientationLandscapeLeft and the back-facing camera would always deliver buffers in AVCaptureVideoOrientationLandscapeRight. outputRotation = kGPUImageNoRotation; for (id currentTarget in targets) { NSInteger indexOfObject = [targets indexOfObject:currentTarget]; [currentTarget setInputRotation:outputRotation atIndex:[[targetTextureIndices objectAtIndex:indexOfObject] integerValue]]; } }); } - (void)setHorizontallyMirrorFrontFacingCamera:(BOOL)newValue { _horizontallyMirrorFrontFacingCamera = newValue; [self updateOrientationSendToTargets]; } - (void)setHorizontallyMirrorRearFacingCamera:(BOOL)newValue { _horizontallyMirrorRearFacingCamera = newValue; [self updateOrientationSendToTargets]; } - (void)printSupportedPixelFormats; { NSArray *supportedPixelFormats = videoOutput.availableVideoCVPixelFormatTypes; for (NSNumber *currentPixelFormat in supportedPixelFormats) { NSString *pixelFormatName = nil; switch([currentPixelFormat intValue]) { case kCVPixelFormatType_1Monochrome: pixelFormatName = @"kCVPixelFormatType_1Monochrome"; break; case kCVPixelFormatType_2Indexed: pixelFormatName = @"kCVPixelFormatType_2Indexed"; break; case kCVPixelFormatType_4Indexed: pixelFormatName = @"kCVPixelFormatType_4Indexed"; break; case kCVPixelFormatType_8Indexed: pixelFormatName = @"kCVPixelFormatType_8Indexed"; break; case kCVPixelFormatType_1IndexedGray_WhiteIsZero: pixelFormatName = @"kCVPixelFormatType_1IndexedGray_WhiteIsZero"; break; case kCVPixelFormatType_2IndexedGray_WhiteIsZero: pixelFormatName = @"kCVPixelFormatType_2IndexedGray_WhiteIsZero"; break; case kCVPixelFormatType_4IndexedGray_WhiteIsZero: pixelFormatName = @"kCVPixelFormatType_4IndexedGray_WhiteIsZero"; break; case kCVPixelFormatType_8IndexedGray_WhiteIsZero: pixelFormatName = @"kCVPixelFormatType_8IndexedGray_WhiteIsZero"; break; case kCVPixelFormatType_16BE555: pixelFormatName = @"kCVPixelFormatType_16BE555"; break; case kCVPixelFormatType_16LE555: pixelFormatName = @"kCVPixelFormatType_16LE555"; break; case kCVPixelFormatType_16LE5551: pixelFormatName = @"kCVPixelFormatType_16LE5551"; break; case kCVPixelFormatType_16BE565: pixelFormatName = @"kCVPixelFormatType_16BE565"; break; case kCVPixelFormatType_16LE565: pixelFormatName = @"kCVPixelFormatType_16LE565"; break; case kCVPixelFormatType_24RGB: pixelFormatName = @"kCVPixelFormatType_24RGB"; break; case kCVPixelFormatType_24BGR: pixelFormatName = @"kCVPixelFormatType_24BGR"; break; case kCVPixelFormatType_32ARGB: pixelFormatName = @"kCVPixelFormatType_32ARGB"; break; case kCVPixelFormatType_32BGRA: pixelFormatName = @"kCVPixelFormatType_32BGRA"; break; case kCVPixelFormatType_32ABGR: pixelFormatName = @"kCVPixelFormatType_32ABGR"; break; case kCVPixelFormatType_32RGBA: pixelFormatName = @"kCVPixelFormatType_32RGBA"; break; case kCVPixelFormatType_64ARGB: pixelFormatName = @"kCVPixelFormatType_64ARGB"; break; case kCVPixelFormatType_48RGB: pixelFormatName = @"kCVPixelFormatType_48RGB"; break; case kCVPixelFormatType_32AlphaGray: pixelFormatName = @"kCVPixelFormatType_32AlphaGray"; break; case kCVPixelFormatType_16Gray: pixelFormatName = @"kCVPixelFormatType_16Gray"; break; case kCVPixelFormatType_30RGB: pixelFormatName = @"kCVPixelFormatType_30RGB"; break; case kCVPixelFormatType_422YpCbCr8: pixelFormatName = @"kCVPixelFormatType_422YpCbCr8"; break; case kCVPixelFormatType_4444YpCbCrA8: pixelFormatName = @"kCVPixelFormatType_4444YpCbCrA8"; break; case kCVPixelFormatType_4444YpCbCrA8R: pixelFormatName = @"kCVPixelFormatType_4444YpCbCrA8R"; break; case kCVPixelFormatType_4444AYpCbCr8: pixelFormatName = @"kCVPixelFormatType_4444AYpCbCr8"; break; case kCVPixelFormatType_4444AYpCbCr16: pixelFormatName = @"kCVPixelFormatType_4444AYpCbCr16"; break; case kCVPixelFormatType_444YpCbCr8: pixelFormatName = @"kCVPixelFormatType_444YpCbCr8"; break; case kCVPixelFormatType_422YpCbCr16: pixelFormatName = @"kCVPixelFormatType_422YpCbCr16"; break; case kCVPixelFormatType_422YpCbCr10: pixelFormatName = @"kCVPixelFormatType_422YpCbCr10"; break; case kCVPixelFormatType_444YpCbCr10: pixelFormatName = @"kCVPixelFormatType_444YpCbCr10"; break; case kCVPixelFormatType_420YpCbCr8Planar: pixelFormatName = @"kCVPixelFormatType_420YpCbCr8Planar"; break; case kCVPixelFormatType_420YpCbCr8PlanarFullRange: pixelFormatName = @"kCVPixelFormatType_420YpCbCr8PlanarFullRange"; break; case kCVPixelFormatType_422YpCbCr_4A_8BiPlanar: pixelFormatName = @"kCVPixelFormatType_422YpCbCr_4A_8BiPlanar"; break; case kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange: pixelFormatName = @"kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange"; break; case kCVPixelFormatType_420YpCbCr8BiPlanarFullRange: pixelFormatName = @"kCVPixelFormatType_420YpCbCr8BiPlanarFullRange"; break; case kCVPixelFormatType_422YpCbCr8_yuvs: pixelFormatName = @"kCVPixelFormatType_422YpCbCr8_yuvs"; break; case kCVPixelFormatType_422YpCbCr8FullRange: pixelFormatName = @"kCVPixelFormatType_422YpCbCr8FullRange"; break; case kCVPixelFormatType_OneComponent8: pixelFormatName = @"kCVPixelFormatType_OneComponent8"; break; case kCVPixelFormatType_TwoComponent8: pixelFormatName = @"kCVPixelFormatType_TwoComponent8"; break; } NSLog(@"Supported pixel format: %@", pixelFormatName); } } @end ================================================ FILE: framework/Source/Mac/GPUImageContext.h ================================================ #import #import #import #import "GLProgram.h" #import "GPUImageFramebuffer.h" #import "GPUImageFramebufferCache.h" #define GPUImageRotationSwapsWidthAndHeight(rotation) (((rotation) == kGPUImageRotateLeft) || ((rotation) == kGPUImageRotateRight) || ((rotation) == kGPUImageRotateRightFlipVertical) ) typedef enum { kGPUImageNoRotation, kGPUImageRotateLeft, kGPUImageRotateRight, kGPUImageFlipVertical, kGPUImageFlipHorizonal, kGPUImageRotateRightFlipVertical, kGPUImageRotateRightFlipHorizontal, kGPUImageRotate180 } GPUImageRotationMode; @interface GPUImageContext : NSObject @property(readonly, nonatomic) dispatch_queue_t contextQueue; @property(readwrite, retain, nonatomic) GLProgram *currentShaderProgram; @property(readonly, retain, nonatomic) NSOpenGLContext *context; @property(readonly) CVOpenGLTextureCacheRef coreVideoTextureCache; @property(readonly) GPUImageFramebufferCache *framebufferCache; + (void *)contextKey; + (GPUImageContext *)sharedImageProcessingContext; + (dispatch_queue_t)sharedContextQueue; + (GPUImageFramebufferCache *)sharedFramebufferCache; + (void)useImageProcessingContext; + (void)setActiveShaderProgram:(GLProgram *)shaderProgram; + (GLint)maximumTextureSizeForThisDevice; + (GLint)maximumTextureUnitsForThisDevice; + (BOOL)deviceSupportsOpenGLESExtension:(NSString *)extension; + (BOOL)deviceSupportsRedTextures; + (BOOL)deviceSupportsFramebufferReads; + (CGSize)sizeThatFitsWithinATextureForSize:(CGSize)inputSize; - (void)presentBufferForDisplay; - (GLProgram *)programForVertexShaderString:(NSString *)vertexShaderString fragmentShaderString:(NSString *)fragmentShaderString; - (void)useSharegroup:(CGLShareGroupObj *)sharegroup; // Manage fast texture upload + (BOOL)supportsFastTextureUpload; @end @protocol GPUImageInput - (void)newFrameReadyAtTime:(CMTime)frameTime atIndex:(NSInteger)textureIndex; - (void)setInputFramebuffer:(GPUImageFramebuffer *)newInputFramebuffer atIndex:(NSInteger)textureIndex; - (NSInteger)nextAvailableTextureIndex; - (void)setInputSize:(CGSize)newSize atIndex:(NSInteger)textureIndex; - (void)setInputRotation:(GPUImageRotationMode)newInputRotation atIndex:(NSInteger)textureIndex; - (CGSize)maximumOutputSize; - (void)endProcessing; - (BOOL)shouldIgnoreUpdatesToThisTarget; - (BOOL)enabled; - (BOOL)wantsMonochromeInput; - (void)setCurrentlyReceivingMonochromeInput:(BOOL)newValue; @end ================================================ FILE: framework/Source/Mac/GPUImageContext.m ================================================ #import "GPUImageContext.h" #import @interface GPUImageContext() { NSMutableDictionary *shaderProgramCache; CGLShareGroupObj *_sharegroup; NSOpenGLPixelFormat *_pixelFormat; } @end @implementation GPUImageContext @synthesize context = _context; @synthesize currentShaderProgram = _currentShaderProgram; @synthesize contextQueue = _contextQueue; @synthesize coreVideoTextureCache = _coreVideoTextureCache; @synthesize framebufferCache = _framebufferCache; static void *openGLESContextQueueKey; - (id)init; { if (!(self = [super init])) { return nil; } openGLESContextQueueKey = &openGLESContextQueueKey; _contextQueue = dispatch_queue_create("com.sunsetlakesoftware.GPUImage.openGLESContextQueue", NULL); dispatch_queue_set_specific(_contextQueue, openGLESContextQueueKey, (__bridge void *)self, NULL); shaderProgramCache = [[NSMutableDictionary alloc] init]; return self; } + (void *)contextKey { return openGLESContextQueueKey; } // Based on Colin Wheeler's example here: http://cocoasamurai.blogspot.com/2011/04/singletons-your-doing-them-wrong.html + (GPUImageContext *)sharedImageProcessingContext; { static dispatch_once_t pred; static GPUImageContext *sharedImageProcessingContext = nil; dispatch_once(&pred, ^{ sharedImageProcessingContext = [[[self class] alloc] init]; }); return sharedImageProcessingContext; } + (dispatch_queue_t)sharedContextQueue; { return [[self sharedImageProcessingContext] contextQueue]; } + (GPUImageFramebufferCache *)sharedFramebufferCache; { return [[self sharedImageProcessingContext] framebufferCache]; } + (void)useImageProcessingContext; { NSOpenGLContext *imageProcessingContext = [[GPUImageContext sharedImageProcessingContext] context]; if ([NSOpenGLContext currentContext] != imageProcessingContext) { [imageProcessingContext makeCurrentContext]; } } + (void)setActiveShaderProgram:(GLProgram *)shaderProgram; { GPUImageContext *sharedContext = [GPUImageContext sharedImageProcessingContext]; NSOpenGLContext *imageProcessingContext = [sharedContext context]; if ([NSOpenGLContext currentContext] != imageProcessingContext) { [imageProcessingContext makeCurrentContext]; } if (sharedContext.currentShaderProgram != shaderProgram) { sharedContext.currentShaderProgram = shaderProgram; [shaderProgram use]; } } + (GLint)maximumTextureSizeForThisDevice; { static dispatch_once_t pred; static GLint maxTextureSize = 0; dispatch_once(&pred, ^{ [self useImageProcessingContext]; glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTextureSize); }); return maxTextureSize; } + (GLint)maximumTextureUnitsForThisDevice; { GLint maxTextureUnits; glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &maxTextureUnits); return maxTextureUnits; } + (BOOL)deviceSupportsOpenGLESExtension:(NSString *)extension; { static dispatch_once_t pred; static NSArray *extensionNames = nil; // Cache extensions for later quick reference, since this won't change for a given device dispatch_once(&pred, ^{ [GPUImageContext useImageProcessingContext]; NSString *extensionsString = [NSString stringWithCString:(const char *)glGetString(GL_EXTENSIONS) encoding:NSASCIIStringEncoding]; extensionNames = [extensionsString componentsSeparatedByString:@" "]; }); return [extensionNames containsObject:extension]; } + (BOOL)deviceSupportsFramebufferReads; { return NO; } // http://www.khronos.org/registry/gles/extensions/EXT/EXT_texture_rg.txt + (BOOL)deviceSupportsRedTextures; { static dispatch_once_t pred; static BOOL supportsRedTextures = NO; dispatch_once(&pred, ^{ supportsRedTextures = [GPUImageContext deviceSupportsOpenGLESExtension:@"GL_EXT_texture_rg"]; }); return supportsRedTextures; } + (CGSize)sizeThatFitsWithinATextureForSize:(CGSize)inputSize; { GLint maxTextureSize = [self maximumTextureSizeForThisDevice]; if ( (inputSize.width < maxTextureSize) && (inputSize.height < maxTextureSize) ) { return inputSize; } CGSize adjustedSize; if (inputSize.width > inputSize.height) { adjustedSize.width = (CGFloat)maxTextureSize; adjustedSize.height = ((CGFloat)maxTextureSize / inputSize.width) * inputSize.height; } else { adjustedSize.height = (CGFloat)maxTextureSize; adjustedSize.width = ((CGFloat)maxTextureSize / inputSize.height) * inputSize.width; } return adjustedSize; } - (void)presentBufferForDisplay; { [self.context flushBuffer]; } - (GLProgram *)programForVertexShaderString:(NSString *)vertexShaderString fragmentShaderString:(NSString *)fragmentShaderString; { NSString *lookupKeyForShaderProgram = [NSString stringWithFormat:@"V: %@ - F: %@", vertexShaderString, fragmentShaderString]; GLProgram *programFromCache = [shaderProgramCache objectForKey:lookupKeyForShaderProgram]; if (programFromCache == nil) { programFromCache = [[GLProgram alloc] initWithVertexShaderString:vertexShaderString fragmentShaderString:fragmentShaderString]; [shaderProgramCache setObject:programFromCache forKey:lookupKeyForShaderProgram]; } return programFromCache; } - (void)useSharegroup:(CGLShareGroupObj *)sharegroup; { NSAssert(_context == nil, @"Unable to use a share group when the context has already been created. Call this method before you use the context for the first time."); _sharegroup = sharegroup; } - (NSOpenGLContext *)createContext; { NSOpenGLPixelFormatAttribute pixelFormatAttributes[] = { NSOpenGLPFADoubleBuffer, NSOpenGLPFAAccelerated, 0, 0 }; _pixelFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:pixelFormatAttributes]; if (_pixelFormat == nil) { NSLog(@"Error: No appropriate pixel format found"); } // TODO: Take into account the sharegroup NSOpenGLContext *context = [[NSOpenGLContext alloc] initWithFormat:_pixelFormat shareContext:nil]; NSAssert(context != nil, @"Unable to create an OpenGL context. The GPUImage framework requires OpenGL support to work."); return context; } - (CVOpenGLTextureCacheRef)coreVideoTextureCache; { if (_coreVideoTextureCache == NULL) { CVReturn err = CVOpenGLTextureCacheCreate(kCFAllocatorDefault, NULL, (__bridge void *)[self context], [_pixelFormat CGLPixelFormatObj], NULL, &_coreVideoTextureCache); if (err) { NSAssert(NO, @"Error at CVOpenGLESTextureCacheCreate %d", err); } } return _coreVideoTextureCache; } #pragma mark - #pragma mark Manage fast texture upload + (BOOL)supportsFastTextureUpload; { // This may need to be redone to account for the Mac's accelerated data transfer methods return NO; } #pragma mark - #pragma mark Accessors - (NSOpenGLContext *)context; { if (_context == nil) { _context = [self createContext]; [_context makeCurrentContext]; // Set up a few global settings for the image processing pipeline glDisable(GL_DEPTH_TEST); glEnable(GL_TEXTURE_2D); } return _context; } - (GPUImageFramebufferCache *)framebufferCache; { if (_framebufferCache == nil) { _framebufferCache = [[GPUImageFramebufferCache alloc] init]; } return _framebufferCache; } @end ================================================ FILE: framework/Source/Mac/GPUImageMac-Info.plist ================================================ CFBundleDevelopmentRegion English CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIconFile CFBundleIdentifier com.sunsetlakesoftware.${PRODUCT_NAME:rfc1034identifier} CFBundleInfoDictionaryVersion 6.0 CFBundleName ${PRODUCT_NAME} CFBundlePackageType FMWK CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion 1 NSHumanReadableCopyright Copyright © 2013 Sunset Lake Software LLC. All rights reserved. NSPrincipalClass ================================================ FILE: framework/Source/Mac/GPUImageMac-Prefix.pch ================================================ // // Prefix header for all source files of the 'GPUImageMac' target in the 'GPUImageMac' project // #ifdef __OBJC__ #import #endif ================================================ FILE: framework/Source/Mac/GPUImageMovieWriter.h ================================================ #import #import #import "GPUImageContext.h" extern NSString *const kGPUImageColorSwizzlingFragmentShaderString; @protocol GPUImageMovieWriterDelegate @optional - (void)movieRecordingCompleted; - (void)movieRecordingFailedWithError:(NSError*)error; @end @interface GPUImageMovieWriter : NSObject { CMVideoDimensions videoDimensions; CMVideoCodecType videoType; NSURL *movieURL; NSString *fileType; AVAssetWriter *assetWriter; AVAssetWriterInput *assetWriterAudioInput; AVAssetWriterInput *assetWriterVideoInput; AVAssetWriterInputPixelBufferAdaptor *assetWriterPixelBufferInput; dispatch_queue_t movieWritingQueue; CGSize videoSize; GPUImageRotationMode inputRotation; } @property(readwrite, nonatomic) BOOL hasAudioTrack; @property(readwrite, nonatomic) BOOL shouldPassthroughAudio; @property(nonatomic, copy) void(^completionBlock)(void); @property(nonatomic, copy) void(^failureBlock)(NSError*); @property(nonatomic, assign) id delegate; @property(readwrite, nonatomic) BOOL encodingLiveVideo; @property(nonatomic, copy) void(^videoInputReadyCallback)(void); @property(nonatomic, copy) void(^audioInputReadyCallback)(void); @property(nonatomic) BOOL enabled; // Initialization and teardown - (id)initWithMovieURL:(NSURL *)newMovieURL size:(CGSize)newSize; - (id)initWithMovieURL:(NSURL *)newMovieURL size:(CGSize)newSize fileType:(NSString *)newFileType outputSettings:(NSMutableDictionary *)outputSettings; - (void)setHasAudioTrack:(BOOL)hasAudioTrack audioSettings:(NSDictionary *)audioOutputSettings; // Movie recording - (void)startRecording; - (void)startRecordingInOrientation:(CGAffineTransform)orientationTransform; - (void)finishRecording; - (void)finishRecordingWithCompletionHandler:(void (^)(void))handler; - (void)cancelRecording; - (void)processAudioBuffer:(CMSampleBufferRef)audioBuffer; - (void)enableSynchronizationCallbacks; @end ================================================ FILE: framework/Source/Mac/GPUImageMovieWriter.m ================================================ #import "GPUImageMovieWriter.h" #import "GPUImageContext.h" #import "GLProgram.h" #import "GPUImageFilter.h" #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageColorSwizzlingFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; void main() { gl_FragColor = texture2D(inputImageTexture, textureCoordinate).bgra; } ); #else NSString *const kGPUImageColorSwizzlingFragmentShaderString = SHADER_STRING ( varying vec2 textureCoordinate; uniform sampler2D inputImageTexture; void main() { gl_FragColor = texture2D(inputImageTexture, textureCoordinate).bgra; } ); #endif @interface GPUImageMovieWriter () { GPUImageFramebuffer *firstInputFramebuffer; GLuint movieFramebuffer, movieRenderbuffer; GLProgram *colorSwizzlingProgram; GLint colorSwizzlingPositionAttribute, colorSwizzlingTextureCoordinateAttribute; GLint colorSwizzlingInputTextureUniform; GLubyte *frameData; CMTime startTime, previousFrameTime; BOOL isRecording; } // Movie recording - (void)initializeMovieWithOutputSettings:(NSMutableDictionary *)outputSettings; // Frame rendering - (void)createDataFBO; - (void)destroyDataFBO; - (void)setFilterFBO; - (void)renderAtInternalSize; @end @implementation GPUImageMovieWriter @synthesize hasAudioTrack = _hasAudioTrack; @synthesize encodingLiveVideo = _encodingLiveVideo; @synthesize shouldPassthroughAudio = _shouldPassthroughAudio; @synthesize completionBlock; @synthesize failureBlock; @synthesize videoInputReadyCallback; @synthesize audioInputReadyCallback; @synthesize enabled; @synthesize delegate = _delegate; #pragma mark - #pragma mark Initialization and teardown - (id)initWithMovieURL:(NSURL *)newMovieURL size:(CGSize)newSize; { return [self initWithMovieURL:newMovieURL size:newSize fileType:AVFileTypeQuickTimeMovie outputSettings:nil]; } - (id)initWithMovieURL:(NSURL *)newMovieURL size:(CGSize)newSize fileType:(NSString *)newFileType outputSettings:(NSMutableDictionary *)outputSettings; { if (!(self = [super init])) { return nil; } self.enabled = YES; videoSize = newSize; movieURL = newMovieURL; fileType = newFileType; startTime = kCMTimeInvalid; _encodingLiveVideo = YES; previousFrameTime = kCMTimeNegativeInfinity; inputRotation = kGPUImageNoRotation; runSynchronouslyOnVideoProcessingQueue(^{ [GPUImageContext useImageProcessingContext]; if ([GPUImageContext supportsFastTextureUpload]) { colorSwizzlingProgram = [[GPUImageContext sharedImageProcessingContext] programForVertexShaderString:kGPUImageVertexShaderString fragmentShaderString:kGPUImagePassthroughFragmentShaderString]; } else { colorSwizzlingProgram = [[GPUImageContext sharedImageProcessingContext] programForVertexShaderString:kGPUImageVertexShaderString fragmentShaderString:kGPUImageColorSwizzlingFragmentShaderString]; } if (!colorSwizzlingProgram.initialized) { [colorSwizzlingProgram addAttribute:@"position"]; [colorSwizzlingProgram addAttribute:@"inputTextureCoordinate"]; if (![colorSwizzlingProgram link]) { NSString *progLog = [colorSwizzlingProgram programLog]; NSLog(@"Program link log: %@", progLog); NSString *fragLog = [colorSwizzlingProgram fragmentShaderLog]; NSLog(@"Fragment shader compile log: %@", fragLog); NSString *vertLog = [colorSwizzlingProgram vertexShaderLog]; NSLog(@"Vertex shader compile log: %@", vertLog); colorSwizzlingProgram = nil; NSAssert(NO, @"Filter shader link failed"); } } colorSwizzlingPositionAttribute = [colorSwizzlingProgram attributeIndex:@"position"]; colorSwizzlingTextureCoordinateAttribute = [colorSwizzlingProgram attributeIndex:@"inputTextureCoordinate"]; colorSwizzlingInputTextureUniform = [colorSwizzlingProgram uniformIndex:@"inputImageTexture"]; // REFACTOR: Wrap this in a block for the image processing queue [GPUImageContext setActiveShaderProgram:colorSwizzlingProgram]; glEnableVertexAttribArray(colorSwizzlingPositionAttribute); glEnableVertexAttribArray(colorSwizzlingTextureCoordinateAttribute); }); [self initializeMovieWithOutputSettings:outputSettings]; return self; } - (void)dealloc; { [self destroyDataFBO]; if (frameData != NULL) { free(frameData); } } #pragma mark - #pragma mark Movie recording - (void)initializeMovieWithOutputSettings:(NSMutableDictionary *)outputSettings; { isRecording = NO; self.enabled = YES; frameData = (GLubyte *) malloc((int)videoSize.width * (int)videoSize.height * 4); // frameData = (GLubyte *) calloc(videoSize.width * videoSize.height * 4, sizeof(GLubyte)); NSError *error = nil; assetWriter = [[AVAssetWriter alloc] initWithURL:movieURL fileType:fileType error:&error]; if (error != nil) { NSLog(@"Error: %@", error); if (failureBlock) { failureBlock(error); } else { if(self.delegate && [self.delegate respondsToSelector:@selector(movieRecordingFailedWithError:)]) { [self.delegate movieRecordingFailedWithError:error]; } } } // Set this to make sure that a functional movie is produced, even if the recording is cut off mid-stream. Only the last second should be lost in that case. assetWriter.movieFragmentInterval = CMTimeMakeWithSeconds(1.0, 1000); // use default output settings if none specified if (outputSettings == nil) { outputSettings = [[NSMutableDictionary alloc] init]; [outputSettings setObject:AVVideoCodecH264 forKey:AVVideoCodecKey]; [outputSettings setObject:[NSNumber numberWithInt:videoSize.width] forKey:AVVideoWidthKey]; [outputSettings setObject:[NSNumber numberWithInt:videoSize.height] forKey:AVVideoHeightKey]; } // custom output settings specified else { #ifndef NS_BLOCK_ASSERTIONS NSString *videoCodec = [outputSettings objectForKey:AVVideoCodecKey]; NSNumber *width = [outputSettings objectForKey:AVVideoWidthKey]; NSNumber *height = [outputSettings objectForKey:AVVideoHeightKey]; NSAssert(videoCodec && width && height, @"OutputSettings is missing required parameters."); #endif } /* NSDictionary *videoCleanApertureSettings = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:videoSize.width], AVVideoCleanApertureWidthKey, [NSNumber numberWithInt:videoSize.height], AVVideoCleanApertureHeightKey, [NSNumber numberWithInt:0], AVVideoCleanApertureHorizontalOffsetKey, [NSNumber numberWithInt:0], AVVideoCleanApertureVerticalOffsetKey, nil]; NSDictionary *videoAspectRatioSettings = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:3], AVVideoPixelAspectRatioHorizontalSpacingKey, [NSNumber numberWithInt:3], AVVideoPixelAspectRatioVerticalSpacingKey, nil]; NSMutableDictionary * compressionProperties = [[NSMutableDictionary alloc] init]; [compressionProperties setObject:videoCleanApertureSettings forKey:AVVideoCleanApertureKey]; [compressionProperties setObject:videoAspectRatioSettings forKey:AVVideoPixelAspectRatioKey]; [compressionProperties setObject:[NSNumber numberWithInt: 2000000] forKey:AVVideoAverageBitRateKey]; [compressionProperties setObject:[NSNumber numberWithInt: 16] forKey:AVVideoMaxKeyFrameIntervalKey]; [compressionProperties setObject:AVVideoProfileLevelH264Main31 forKey:AVVideoProfileLevelKey]; [outputSettings setObject:compressionProperties forKey:AVVideoCompressionPropertiesKey]; */ assetWriterVideoInput = [AVAssetWriterInput assetWriterInputWithMediaType:AVMediaTypeVideo outputSettings:outputSettings]; assetWriterVideoInput.expectsMediaDataInRealTime = _encodingLiveVideo; // You need to use BGRA for the video in order to get realtime encoding. I use a color-swizzling shader to line up glReadPixels' normal RGBA output with the movie input's BGRA. NSDictionary *sourcePixelBufferAttributesDictionary = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:kCVPixelFormatType_32BGRA], kCVPixelBufferPixelFormatTypeKey, [NSNumber numberWithInt:videoSize.width], kCVPixelBufferWidthKey, [NSNumber numberWithInt:videoSize.height], kCVPixelBufferHeightKey, nil]; // NSDictionary *sourcePixelBufferAttributesDictionary = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:kCVPixelFormatType_32ARGB], kCVPixelBufferPixelFormatTypeKey, // nil]; assetWriterPixelBufferInput = [AVAssetWriterInputPixelBufferAdaptor assetWriterInputPixelBufferAdaptorWithAssetWriterInput:assetWriterVideoInput sourcePixelBufferAttributes:sourcePixelBufferAttributesDictionary]; [assetWriter addInput:assetWriterVideoInput]; } - (void)startRecording; { isRecording = YES; startTime = kCMTimeInvalid; // [assetWriter startWriting]; // [assetWriter startSessionAtSourceTime:kCMTimeZero]; } - (void)startRecordingInOrientation:(CGAffineTransform)orientationTransform; { assetWriterVideoInput.transform = orientationTransform; [self startRecording]; } - (void)cancelRecording; { if (assetWriter.status == AVAssetWriterStatusCompleted) { return; } isRecording = NO; runOnMainQueueWithoutDeadlocking(^{ [assetWriterVideoInput markAsFinished]; [assetWriterAudioInput markAsFinished]; [assetWriter cancelWriting]; }); } - (void)finishRecording; { [self finishRecordingWithCompletionHandler:nil]; } - (void)finishRecordingWithCompletionHandler:(void (^)(void))handler; { if (assetWriter.status == AVAssetWriterStatusCompleted) { return; } isRecording = NO; runOnMainQueueWithoutDeadlocking(^{ [assetWriterVideoInput markAsFinished]; [assetWriterAudioInput markAsFinished]; #if (!defined(__IPHONE_6_0) || (__IPHONE_OS_VERSION_MAX_ALLOWED < __IPHONE_6_0)) // Not iOS 6 SDK [assetWriter finishWriting]; if (handler) handler(); #else // iOS 6 SDK if ([assetWriter respondsToSelector:@selector(finishWritingWithCompletionHandler:)]) { // Running iOS 6 [assetWriter finishWritingWithCompletionHandler:(handler ?: ^{ })]; } else { // Not running iOS 6 [assetWriter finishWriting]; if (handler) handler(); } #endif }); } - (void)processAudioBuffer:(CMSampleBufferRef)audioBuffer; { if (!isRecording) { return; } if (_hasAudioTrack) { CMTime currentSampleTime = CMSampleBufferGetOutputPresentationTimeStamp(audioBuffer); if (CMTIME_IS_INVALID(startTime)) { if (audioInputReadyCallback == NULL) { [assetWriter startWriting]; } [assetWriter startSessionAtSourceTime:currentSampleTime]; startTime = currentSampleTime; } if (!assetWriterAudioInput.readyForMoreMediaData) { NSLog(@"Had to drop an audio frame"); return; } // NSLog(@"Recorded audio sample time: %lld, %d, %lld", currentSampleTime.value, currentSampleTime.timescale, currentSampleTime.epoch); [assetWriterAudioInput appendSampleBuffer:audioBuffer]; } } - (void)enableSynchronizationCallbacks; { if (videoInputReadyCallback != NULL) { [assetWriter startWriting]; [assetWriterVideoInput requestMediaDataWhenReadyOnQueue:[GPUImageContext sharedContextQueue] usingBlock:videoInputReadyCallback]; } if (audioInputReadyCallback != NULL) { [assetWriterAudioInput requestMediaDataWhenReadyOnQueue:[GPUImageContext sharedContextQueue] usingBlock:audioInputReadyCallback]; } } #pragma mark - #pragma mark Frame rendering - (void)createDataFBO; { glActiveTexture(GL_TEXTURE1); glGenFramebuffers(1, &movieFramebuffer); glBindFramebuffer(GL_FRAMEBUFFER, movieFramebuffer); glGenRenderbuffers(1, &movieRenderbuffer); glBindRenderbuffer(GL_RENDERBUFFER, movieRenderbuffer); glRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA8, (int)videoSize.width, (int)videoSize.height); glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, movieRenderbuffer); #ifndef NS_BLOCK_ASSERTIONS GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); NSAssert(status == GL_FRAMEBUFFER_COMPLETE, @"Incomplete filter FBO: %d", status); #endif } - (void)destroyDataFBO; { [GPUImageContext useImageProcessingContext]; if (movieFramebuffer) { glDeleteFramebuffers(1, &movieFramebuffer); movieFramebuffer = 0; } if (movieRenderbuffer) { glDeleteRenderbuffers(1, &movieRenderbuffer); movieRenderbuffer = 0; } } - (void)setFilterFBO; { if (!movieFramebuffer) { [self createDataFBO]; } glBindFramebuffer(GL_FRAMEBUFFER, movieFramebuffer); glViewport(0, 0, (int)videoSize.width, (int)videoSize.height); } - (void)renderAtInternalSize; { [GPUImageContext useImageProcessingContext]; [self setFilterFBO]; [GPUImageContext setActiveShaderProgram:colorSwizzlingProgram]; glClearColor(1.0f, 0.0f, 0.0f, 1.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // This needs to be flipped to write out to video correctly static const GLfloat squareVertices[] = { -1.0f, -1.0f, 1.0f, -1.0f, -1.0f, 1.0f, 1.0f, 1.0f, }; static const GLfloat textureCoordinates[] = { 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, }; glActiveTexture(GL_TEXTURE4); glBindTexture(GL_TEXTURE_2D, [firstInputFramebuffer texture]); glUniform1i(colorSwizzlingInputTextureUniform, 4); glVertexAttribPointer(colorSwizzlingPositionAttribute, 2, GL_FLOAT, 0, 0, squareVertices); glVertexAttribPointer(colorSwizzlingTextureCoordinateAttribute, 2, GL_FLOAT, 0, 0, textureCoordinates); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); glFinish(); [firstInputFramebuffer unlock]; } #pragma mark - #pragma mark GPUImageInput protocol - (void)newFrameReadyAtTime:(CMTime)frameTime atIndex:(NSInteger)textureIndex; { if (!isRecording) { [firstInputFramebuffer unlock]; return; } // Drop frames forced by images and other things with no time constants // Also, if two consecutive times with the same value are added to the movie, it aborts recording, so I bail on that case if ( (CMTIME_IS_INVALID(frameTime)) || (CMTIME_COMPARE_INLINE(frameTime, ==, previousFrameTime)) || (CMTIME_IS_INDEFINITE(frameTime)) ) { [firstInputFramebuffer unlock]; return; } if (CMTIME_IS_INVALID(startTime)) { if (videoInputReadyCallback == NULL) { [assetWriter startWriting]; } [assetWriter startSessionAtSourceTime:frameTime]; startTime = frameTime; } if (!assetWriterVideoInput.readyForMoreMediaData) { [firstInputFramebuffer unlock]; NSLog(@"Had to drop a video frame"); return; } // Render the frame with swizzled colors, so that they can be uploaded quickly as BGRA frames [GPUImageContext useImageProcessingContext]; [self renderAtInternalSize]; CVPixelBufferRef pixel_buffer = NULL; CVReturn status = CVPixelBufferPoolCreatePixelBuffer (NULL, [assetWriterPixelBufferInput pixelBufferPool], &pixel_buffer); if ((pixel_buffer == NULL) || (status != kCVReturnSuccess)) { return; } else { CVPixelBufferLockBaseAddress(pixel_buffer, 0); GLubyte *pixelBufferData = (GLubyte *)CVPixelBufferGetBaseAddress(pixel_buffer); glReadPixels(0, 0, videoSize.width, videoSize.height, GL_RGBA, GL_UNSIGNED_BYTE, pixelBufferData); } // if(![assetWriterPixelBufferInput appendPixelBuffer:pixel_buffer withPresentationTime:CMTimeSubtract(frameTime, startTime)]) if(![assetWriterPixelBufferInput appendPixelBuffer:pixel_buffer withPresentationTime:frameTime]) { NSLog(@"Problem appending pixel buffer at time: %lld", frameTime.value); } else { // NSLog(@"Recorded video sample time: %lld, %d, %lld", frameTime.value, frameTime.timescale, frameTime.epoch); } CVPixelBufferUnlockBaseAddress(pixel_buffer, 0); previousFrameTime = frameTime; if (![GPUImageContext supportsFastTextureUpload]) { CVPixelBufferRelease(pixel_buffer); } } - (NSInteger)nextAvailableTextureIndex; { return 0; } - (void)setInputFramebuffer:(GPUImageFramebuffer *)newInputFramebuffer atIndex:(NSInteger)textureIndex; { firstInputFramebuffer = newInputFramebuffer; [firstInputFramebuffer lock]; } - (void)setInputRotation:(GPUImageRotationMode)newInputRotation atIndex:(NSInteger)textureIndex; { inputRotation = newInputRotation; } - (void)setInputSize:(CGSize)newSize atIndex:(NSInteger)textureIndex; { } - (CGSize)maximumOutputSize; { return videoSize; } - (void)endProcessing { if (completionBlock) { completionBlock(); } else { if (_delegate && [_delegate respondsToSelector:@selector(movieRecordingCompleted)]) { [_delegate movieRecordingCompleted]; } } } - (BOOL)shouldIgnoreUpdatesToThisTarget; { return NO; } - (void)conserveMemoryForNextFrame; { } - (BOOL)wantsMonochromeInput; { return NO; } - (void)setCurrentlyReceivingMonochromeInput:(BOOL)newValue; { } #pragma mark - #pragma mark Accessors - (void)setHasAudioTrack:(BOOL)newValue { [self setHasAudioTrack:newValue audioSettings:nil]; } - (void)setHasAudioTrack:(BOOL)newValue audioSettings:(NSDictionary *)audioOutputSettings; { _hasAudioTrack = newValue; if (_hasAudioTrack) { if (_shouldPassthroughAudio) { // Do not set any settings so audio will be the same as passthrough audioOutputSettings = nil; } else if (audioOutputSettings == nil) { // double preferredHardwareSampleRate = [[AVAudioSession sharedInstance] currentHardwareSampleRate]; double preferredHardwareSampleRate = 48000; // ? - TODO: Fix this, because it's probably broken AudioChannelLayout acl; bzero( &acl, sizeof(acl)); acl.mChannelLayoutTag = kAudioChannelLayoutTag_Mono; audioOutputSettings = [NSDictionary dictionaryWithObjectsAndKeys: [ NSNumber numberWithInt: kAudioFormatMPEG4AAC], AVFormatIDKey, [ NSNumber numberWithInt: 1 ], AVNumberOfChannelsKey, [ NSNumber numberWithFloat: preferredHardwareSampleRate ], AVSampleRateKey, [ NSData dataWithBytes: &acl length: sizeof( acl ) ], AVChannelLayoutKey, //[ NSNumber numberWithInt:AVAudioQualityLow], AVEncoderAudioQualityKey, [ NSNumber numberWithInt: 64000 ], AVEncoderBitRateKey, nil]; /* AudioChannelLayout acl; bzero( &acl, sizeof(acl)); acl.mChannelLayoutTag = kAudioChannelLayoutTag_Mono; audioOutputSettings = [NSDictionary dictionaryWithObjectsAndKeys: [ NSNumber numberWithInt: kAudioFormatMPEG4AAC ], AVFormatIDKey, [ NSNumber numberWithInt: 1 ], AVNumberOfChannelsKey, [ NSNumber numberWithFloat: 44100.0 ], AVSampleRateKey, [ NSNumber numberWithInt: 64000 ], AVEncoderBitRateKey, [ NSData dataWithBytes: &acl length: sizeof( acl ) ], AVChannelLayoutKey, nil];*/ } assetWriterAudioInput = [AVAssetWriterInput assetWriterInputWithMediaType:AVMediaTypeAudio outputSettings:audioOutputSettings]; [assetWriter addInput:assetWriterAudioInput]; assetWriterAudioInput.expectsMediaDataInRealTime = _encodingLiveVideo; } else { // Remove audio track if it exists } } @end ================================================ FILE: framework/Source/Mac/GPUImagePicture.h ================================================ #import #import "GPUImageOutput.h" @interface GPUImagePicture : GPUImageOutput { CGSize pixelSizeOfImage; BOOL hasProcessedImage; dispatch_semaphore_t imageUpdateSemaphore; } // Initialization and teardown - (id)initWithURL:(NSURL *)url; - (id)initWithImage:(NSImage *)newImageSource; - (id)initWithCGImage:(CGImageRef)newImageSource; - (id)initWithImage:(NSImage *)newImageSource smoothlyScaleOutput:(BOOL)smoothlyScaleOutput; - (id)initWithCGImage:(CGImageRef)newImageSource smoothlyScaleOutput:(BOOL)smoothlyScaleOutput; // Image rendering - (void)processImage; - (BOOL)processImageWithCompletionHandler:(void (^)(void))completion; - (void)processImageUpToFilter:(GPUImageOutput *)finalFilterInChain withCompletionHandler:(void (^)(NSImage *processedImage))block; - (CGSize)outputImageSize; @end ================================================ FILE: framework/Source/Mac/GPUImagePicture.m ================================================ #import "GPUImagePicture.h" @implementation GPUImagePicture #pragma mark - #pragma mark Initialization and teardown - (id)initWithURL:(NSURL *)url; { NSData *imageData = [[NSData alloc] initWithContentsOfURL:url]; if (!(self = [self initWithData:imageData])) { return nil; } return self; } - (id)initWithData:(NSData *)imageData; { NSImage *inputImage = [[NSImage alloc] initWithData:imageData]; if (!(self = [self initWithImage:inputImage])) { return nil; } return self; } - (id)initWithImage:(NSImage *)newImageSource; { if (!(self = [self initWithImage:newImageSource smoothlyScaleOutput:NO])) { return nil; } return self; } - (id)initWithCGImage:(CGImageRef)newImageSource; { if (!(self = [self initWithCGImage:newImageSource smoothlyScaleOutput:NO])) { return nil; } return self; } - (id)initWithImage:(NSImage *)newImageSource smoothlyScaleOutput:(BOOL)smoothlyScaleOutput; { return [self initWithCGImage:[newImageSource CGImageForProposedRect:NULL context:NULL hints:nil] smoothlyScaleOutput:smoothlyScaleOutput]; } - (id)initWithCGImage:(CGImageRef)newImageSource smoothlyScaleOutput:(BOOL)smoothlyScaleOutput; { if (!(self = [super init])) { return nil; } hasProcessedImage = NO; self.shouldSmoothlyScaleOutput = smoothlyScaleOutput; imageUpdateSemaphore = dispatch_semaphore_create(1); // TODO: Dispatch this whole thing asynchronously to move image loading off main thread CGFloat widthOfImage = CGImageGetWidth(newImageSource); CGFloat heightOfImage = CGImageGetHeight(newImageSource); // If passed an empty image reference, CGContextDrawImage will fail in future versions of the SDK. NSAssert( widthOfImage > 0 && heightOfImage > 0, @"Passed image must not be empty - it should be at least 1px tall and wide"); pixelSizeOfImage = CGSizeMake(widthOfImage, heightOfImage); CGSize pixelSizeToUseForTexture = pixelSizeOfImage; BOOL shouldRedrawUsingCoreGraphics = NO; // For now, deal with images larger than the maximum texture size by resizing to be within that limit CGSize scaledImageSizeToFitOnGPU = [GPUImageContext sizeThatFitsWithinATextureForSize:pixelSizeOfImage]; if (!CGSizeEqualToSize(scaledImageSizeToFitOnGPU, pixelSizeOfImage)) { pixelSizeOfImage = scaledImageSizeToFitOnGPU; pixelSizeToUseForTexture = pixelSizeOfImage; shouldRedrawUsingCoreGraphics = YES; } if (self.shouldSmoothlyScaleOutput) { // In order to use mipmaps, you need to provide power-of-two textures, so convert to the next largest power of two and stretch to fill CGFloat powerClosestToWidth = ceil(log2(pixelSizeOfImage.width)); CGFloat powerClosestToHeight = ceil(log2(pixelSizeOfImage.height)); pixelSizeToUseForTexture = CGSizeMake(pow(2.0, powerClosestToWidth), pow(2.0, powerClosestToHeight)); shouldRedrawUsingCoreGraphics = YES; } GLubyte *imageData = NULL; CFDataRef dataFromImageDataProvider; GLenum format = GL_BGRA; if (!shouldRedrawUsingCoreGraphics) { /* Check that the memory layout is compatible with GL, as we cannot use glPixelStore to * tell GL about the memory layout with GLES. */ if (CGImageGetBytesPerRow(newImageSource) != CGImageGetWidth(newImageSource) * 4 || CGImageGetBitsPerPixel(newImageSource) != 32 || CGImageGetBitsPerComponent(newImageSource) != 8) { shouldRedrawUsingCoreGraphics = YES; } else { /* Check that the bitmap pixel format is compatible with GL */ CGBitmapInfo bitmapInfo = CGImageGetBitmapInfo(newImageSource); if ((bitmapInfo & kCGBitmapFloatComponents) != 0) { /* We don't support float components for use directly in GL */ shouldRedrawUsingCoreGraphics = YES; } else { CGBitmapInfo byteOrderInfo = bitmapInfo & kCGBitmapByteOrderMask; if (byteOrderInfo == kCGBitmapByteOrder32Little) { /* Little endian, for alpha-first we can use this bitmap directly in GL */ CGImageAlphaInfo alphaInfo = bitmapInfo & kCGBitmapAlphaInfoMask; if (alphaInfo != kCGImageAlphaPremultipliedFirst && alphaInfo != kCGImageAlphaFirst && alphaInfo != kCGImageAlphaNoneSkipFirst) { shouldRedrawUsingCoreGraphics = YES; } } else if (byteOrderInfo == kCGBitmapByteOrderDefault || byteOrderInfo == kCGBitmapByteOrder32Big) { /* Big endian, for alpha-last we can use this bitmap directly in GL */ CGImageAlphaInfo alphaInfo = bitmapInfo & kCGBitmapAlphaInfoMask; if (alphaInfo != kCGImageAlphaPremultipliedLast && alphaInfo != kCGImageAlphaLast && alphaInfo != kCGImageAlphaNoneSkipLast) { shouldRedrawUsingCoreGraphics = YES; } else { /* Can access directly using GL_RGBA pixel format */ format = GL_RGBA; } } } } } // CFAbsoluteTime elapsedTime, startTime = CFAbsoluteTimeGetCurrent(); if (shouldRedrawUsingCoreGraphics) { // For resized or incompatible image: redraw imageData = (GLubyte *) calloc(1, (int)pixelSizeToUseForTexture.width * (int)pixelSizeToUseForTexture.height * 4); CGColorSpaceRef genericRGBColorspace = CGColorSpaceCreateDeviceRGB(); CGContextRef imageContext = CGBitmapContextCreate(imageData, (size_t)pixelSizeToUseForTexture.width, (size_t)pixelSizeToUseForTexture.height, 8, (size_t)pixelSizeToUseForTexture.width * 4, genericRGBColorspace, kCGBitmapByteOrder32Little | kCGImageAlphaPremultipliedFirst); // CGContextSetBlendMode(imageContext, kCGBlendModeCopy); // From Technical Q&A QA1708: http://developer.apple.com/library/ios/#qa/qa1708/_index.html CGContextDrawImage(imageContext, CGRectMake(0.0, 0.0, pixelSizeToUseForTexture.width, pixelSizeToUseForTexture.height), newImageSource); CGContextRelease(imageContext); CGColorSpaceRelease(genericRGBColorspace); } else { // Access the raw image bytes directly dataFromImageDataProvider = CGDataProviderCopyData(CGImageGetDataProvider(newImageSource)); imageData = (GLubyte *)CFDataGetBytePtr(dataFromImageDataProvider); } // elapsedTime = (CFAbsoluteTimeGetCurrent() - startTime) * 1000.0; // NSLog(@"Core Graphics drawing time: %f", elapsedTime); // CGFloat currentRedTotal = 0.0f, currentGreenTotal = 0.0f, currentBlueTotal = 0.0f, currentAlphaTotal = 0.0f; // NSUInteger totalNumberOfPixels = round(pixelSizeToUseForTexture.width * pixelSizeToUseForTexture.height); // // for (NSUInteger currentPixel = 0; currentPixel < totalNumberOfPixels; currentPixel++) // { // currentBlueTotal += (CGFloat)imageData[(currentPixel * 4)] / 255.0f; // currentGreenTotal += (CGFloat)imageData[(currentPixel * 4) + 1] / 255.0f; // currentRedTotal += (CGFloat)imageData[(currentPixel * 4 + 2)] / 255.0f; // currentAlphaTotal += (CGFloat)imageData[(currentPixel * 4) + 3] / 255.0f; // } // // NSLog(@"Debug, average input image red: %f, green: %f, blue: %f, alpha: %f", currentRedTotal / (CGFloat)totalNumberOfPixels, currentGreenTotal / (CGFloat)totalNumberOfPixels, currentBlueTotal / (CGFloat)totalNumberOfPixels, currentAlphaTotal / (CGFloat)totalNumberOfPixels); runSynchronouslyOnVideoProcessingQueue(^{ [GPUImageContext useImageProcessingContext]; outputFramebuffer = [[GPUImageContext sharedFramebufferCache] fetchFramebufferForSize:pixelSizeToUseForTexture onlyTexture:YES]; [outputFramebuffer disableReferenceCounting]; glBindTexture(GL_TEXTURE_2D, [outputFramebuffer texture]); if (self.shouldSmoothlyScaleOutput) { glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); } // no need to use self.outputTextureOptions here since pictures need this texture formats and type glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, (int)pixelSizeToUseForTexture.width, (int)pixelSizeToUseForTexture.height, 0, format, GL_UNSIGNED_BYTE, imageData); if (self.shouldSmoothlyScaleOutput) { glGenerateMipmap(GL_TEXTURE_2D); } glBindTexture(GL_TEXTURE_2D, 0); }); if (shouldRedrawUsingCoreGraphics) { free(imageData); } else { CFRelease(dataFromImageDataProvider); } return self; } // ARC forbids explicit message send of 'release' on Mountain Lion, but needs this on Lion and older #if ( (MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_8) || (!defined(__MAC_10_8)) ) - (void)dealloc; { [outputFramebuffer enableReferenceCounting]; [outputFramebuffer unlock]; if (imageUpdateSemaphore != NULL) { dispatch_release(imageUpdateSemaphore); } } #endif #pragma mark - #pragma mark Image rendering - (void)removeAllTargets; { [super removeAllTargets]; hasProcessedImage = NO; } - (void)processImage; { [self processImageWithCompletionHandler:nil]; } - (BOOL)processImageWithCompletionHandler:(void (^)(void))completion; { hasProcessedImage = YES; // dispatch_semaphore_wait(imageUpdateSemaphore, DISPATCH_TIME_FOREVER); if (dispatch_semaphore_wait(imageUpdateSemaphore, DISPATCH_TIME_NOW) != 0) { return NO; } runAsynchronouslyOnVideoProcessingQueue(^{ for (id currentTarget in targets) { NSInteger indexOfObject = [targets indexOfObject:currentTarget]; NSInteger textureIndexOfTarget = [[targetTextureIndices objectAtIndex:indexOfObject] integerValue]; [currentTarget setCurrentlyReceivingMonochromeInput:NO]; [currentTarget setInputSize:pixelSizeOfImage atIndex:textureIndexOfTarget]; [currentTarget setInputFramebuffer:outputFramebuffer atIndex:textureIndexOfTarget]; [currentTarget newFrameReadyAtTime:kCMTimeIndefinite atIndex:textureIndexOfTarget]; } dispatch_semaphore_signal(imageUpdateSemaphore); if (completion != nil) { completion(); } }); return YES; } - (void)processImageUpToFilter:(GPUImageOutput *)finalFilterInChain withCompletionHandler:(void (^)(NSImage *processedImage))block; { [finalFilterInChain useNextFrameForImageCapture]; [self processImageWithCompletionHandler:^{ NSImage *imageFromFilter = [finalFilterInChain imageFromCurrentFramebuffer]; block(imageFromFilter); }]; } - (CGSize)outputImageSize; { return pixelSizeOfImage; } - (void)addTarget:(id)newTarget atTextureLocation:(NSInteger)textureLocation; { [super addTarget:newTarget atTextureLocation:textureLocation]; if (hasProcessedImage) { [newTarget setInputSize:pixelSizeOfImage atIndex:textureLocation]; [newTarget newFrameReadyAtTime:kCMTimeIndefinite atIndex:textureLocation]; } } @end ================================================ FILE: framework/Source/Mac/GPUImageView.h ================================================ #import #import "GPUImageContext.h" typedef enum { kGPUImageFillModeStretch, // Stretch to fill the full view, which may distort the image outside of its normal aspect ratio kGPUImageFillModePreserveAspectRatio, // Maintains the aspect ratio of the source image, adding bars of the specified background color kGPUImageFillModePreserveAspectRatioAndFill // Maintains the aspect ratio of the source image, zooming in on its center to fill the view } GPUImageFillModeType; /** UIView subclass to use as an endpoint for displaying GPUImage outputs */ @interface GPUImageView : NSOpenGLView { GPUImageRotationMode inputRotation; } /** The fill mode dictates how images are fit in the view, with the default being kGPUImageFillModePreserveAspectRatio */ @property(readwrite, nonatomic) GPUImageFillModeType fillMode; /** This calculates the current display size, in pixels, taking into account Retina scaling factors */ @property(readonly, nonatomic) CGSize sizeInPixels; @property(nonatomic) BOOL enabled; /** Handling fill mode @param redComponent Red component for background color @param greenComponent Green component for background color @param blueComponent Blue component for background color @param alphaComponent Alpha component for background color */ - (void)setBackgroundColorRed:(GLfloat)redComponent green:(GLfloat)greenComponent blue:(GLfloat)blueComponent alpha:(GLfloat)alphaComponent; - (void)setCurrentlyReceivingMonochromeInput:(BOOL)newValue; @end ================================================ FILE: framework/Source/Mac/GPUImageView.m ================================================ #import "GPUImageView.h" #import #import "GPUImageContext.h" #import "GPUImageFilter.h" #import #pragma mark - #pragma mark Private methods and instance variables @interface GPUImageView () { GPUImageFramebuffer *inputFramebufferForDisplay; GLProgram *displayProgram; GLint displayPositionAttribute, displayTextureCoordinateAttribute; GLint displayInputTextureUniform; CGSize inputImageSize; GLfloat imageVertices[8]; GLfloat backgroundColorRed, backgroundColorGreen, backgroundColorBlue, backgroundColorAlpha; } // Initialization and teardown - (void)commonInit; // Managing the display FBOs - (void)createDisplayFramebuffer; - (void)destroyDisplayFramebuffer; // Handling fill mode - (void)recalculateViewGeometry; @end @implementation GPUImageView @synthesize sizeInPixels = _sizeInPixels; @synthesize fillMode = _fillMode; @synthesize enabled; #pragma mark - #pragma mark Initialization and teardown - (id)initWithFrame:(CGRect)frame { if (!(self = [super initWithFrame:frame])) { return nil; } [self commonInit]; return self; } -(id)initWithCoder:(NSCoder *)coder { if (!(self = [super initWithCoder:coder])) { return nil; } [self commonInit]; return self; } - (void)commonInit; { [self setOpenGLContext:[[GPUImageContext sharedImageProcessingContext] context]]; if ([self respondsToSelector:@selector(setWantsBestResolutionOpenGLSurface:)]) { [self setWantsBestResolutionOpenGLSurface:YES]; } inputRotation = kGPUImageNoRotation; self.hidden = NO; self.enabled = YES; runSynchronouslyOnVideoProcessingQueue(^{ [GPUImageContext useImageProcessingContext]; displayProgram = [[GPUImageContext sharedImageProcessingContext] programForVertexShaderString:kGPUImageVertexShaderString fragmentShaderString:kGPUImagePassthroughFragmentShaderString]; if (!displayProgram.initialized) { [displayProgram addAttribute:@"position"]; [displayProgram addAttribute:@"inputTextureCoordinate"]; if (![displayProgram link]) { NSString *progLog = [displayProgram programLog]; NSLog(@"Program link log: %@", progLog); NSString *fragLog = [displayProgram fragmentShaderLog]; NSLog(@"Fragment shader compile log: %@", fragLog); NSString *vertLog = [displayProgram vertexShaderLog]; NSLog(@"Vertex shader compile log: %@", vertLog); displayProgram = nil; NSAssert(NO, @"Filter shader link failed"); } } displayPositionAttribute = [displayProgram attributeIndex:@"position"]; displayTextureCoordinateAttribute = [displayProgram attributeIndex:@"inputTextureCoordinate"]; displayInputTextureUniform = [displayProgram uniformIndex:@"inputImageTexture"]; [GPUImageContext setActiveShaderProgram:displayProgram]; glEnableVertexAttribArray(displayPositionAttribute); glEnableVertexAttribArray(displayTextureCoordinateAttribute); [self setBackgroundColorRed:0.0 green:0.0 blue:0.0 alpha:1.0]; _fillMode = kGPUImageFillModePreserveAspectRatio; [self createDisplayFramebuffer]; }); } - (void)dealloc { } #pragma mark - #pragma mark Managing the display FBOs - (void)createDisplayFramebuffer; { // Perhaps I'll use an FBO at some time later, but for now will render directly to the screen if ([self respondsToSelector:@selector(convertSizeToBacking:)]) { _sizeInPixels = [self convertSizeToBacking:self.bounds.size]; } else { _sizeInPixels = self.bounds.size; } } - (void)destroyDisplayFramebuffer; { [self.openGLContext makeCurrentContext]; } - (void)setDisplayFramebuffer; { glBindFramebuffer(GL_FRAMEBUFFER, 0); glBindRenderbuffer(GL_RENDERBUFFER, 0); glViewport(0, 0, (GLint)_sizeInPixels.width, (GLint)_sizeInPixels.height); } - (void)presentFramebuffer; { [self.openGLContext flushBuffer]; } - (void)reshape; { CGSize viewSize = self.bounds.size; if ([self respondsToSelector:@selector(convertSizeToBacking:)]) { viewSize = [self convertSizeToBacking:self.bounds.size]; } if ( (_sizeInPixels.width == viewSize.width) && (_sizeInPixels.height == viewSize.height) ) { return; } _sizeInPixels = viewSize; [self recalculateViewGeometry]; dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ [self newFrameReadyAtTime:kCMTimeInvalid atIndex:0]; }); } #pragma mark - #pragma mark Handling fill mode - (void)recalculateViewGeometry; { CGFloat heightScaling, widthScaling; CGSize currentViewSize = self.sizeInPixels; if ((inputImageSize.width < 1.0) || (inputImageSize.height < 1.0)) { return; } CGRect insetRect = AVMakeRectWithAspectRatioInsideRect(inputImageSize, CGRectMake(0.0,0.0,currentViewSize.width,currentViewSize.height)); if ((insetRect.size.width < 1.0) || (insetRect.size.width < 1.0)) { insetRect = CGRectMake(0.0,0.0,currentViewSize.width,currentViewSize.height); } switch(_fillMode) { case kGPUImageFillModeStretch: { widthScaling = 1.0; heightScaling = 1.0; }; break; case kGPUImageFillModePreserveAspectRatio: { widthScaling = insetRect.size.width / currentViewSize.width; heightScaling = insetRect.size.height / currentViewSize.height; }; break; case kGPUImageFillModePreserveAspectRatioAndFill: { widthScaling = currentViewSize.height / insetRect.size.height; heightScaling = currentViewSize.width / insetRect.size.width; }; break; } imageVertices[0] = -widthScaling; imageVertices[1] = -heightScaling; imageVertices[2] = widthScaling; imageVertices[3] = -heightScaling; imageVertices[4] = -widthScaling; imageVertices[5] = heightScaling; imageVertices[6] = widthScaling; imageVertices[7] = heightScaling; } - (void)setBackgroundColorRed:(GLfloat)redComponent green:(GLfloat)greenComponent blue:(GLfloat)blueComponent alpha:(GLfloat)alphaComponent; { backgroundColorRed = redComponent; backgroundColorGreen = greenComponent; backgroundColorBlue = blueComponent; backgroundColorAlpha = alphaComponent; } + (const GLfloat *)textureCoordinatesForRotation:(GPUImageRotationMode)rotationMode; { // static const GLfloat noRotationTextureCoordinates[] = { // 0.0f, 0.0f, // 1.0f, 0.0f, // 0.0f, 1.0f, // 1.0f, 1.0f, // }; static const GLfloat noRotationTextureCoordinates[] = { 0.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, }; static const GLfloat rotateRightTextureCoordinates[] = { 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, }; static const GLfloat rotateLeftTextureCoordinates[] = { 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f, 1.0f, }; static const GLfloat verticalFlipTextureCoordinates[] = { 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, }; static const GLfloat horizontalFlipTextureCoordinates[] = { 1.0f, 1.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, }; static const GLfloat rotateRightVerticalFlipTextureCoordinates[] = { 1.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f, }; static const GLfloat rotateRightHorizontalFlipTextureCoordinates[] = { 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, }; static const GLfloat rotate180TextureCoordinates[] = { 1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f, }; switch(rotationMode) { case kGPUImageNoRotation: return noRotationTextureCoordinates; case kGPUImageRotateLeft: return rotateLeftTextureCoordinates; case kGPUImageRotateRight: return rotateRightTextureCoordinates; case kGPUImageFlipVertical: return verticalFlipTextureCoordinates; case kGPUImageFlipHorizonal: return horizontalFlipTextureCoordinates; case kGPUImageRotateRightFlipVertical: return rotateRightVerticalFlipTextureCoordinates; case kGPUImageRotateRightFlipHorizontal: return rotateRightHorizontalFlipTextureCoordinates; case kGPUImageRotate180: return rotate180TextureCoordinates; } } #pragma mark - #pragma mark GPUInput protocol - (void)newFrameReadyAtTime:(CMTime)frameTime atIndex:(NSInteger)textureIndex; { runSynchronouslyOnVideoProcessingQueue(^{ [GPUImageContext setActiveShaderProgram:displayProgram]; [self setDisplayFramebuffer]; glClearColor(backgroundColorRed, backgroundColorGreen, backgroundColorBlue, backgroundColorAlpha); glClear(GL_COLOR_BUFFER_BIT); // Re-render onscreen, flipped to a normal orientation glBindFramebuffer(GL_FRAMEBUFFER, 0); glBindRenderbuffer(GL_RENDERBUFFER, 0); glActiveTexture(GL_TEXTURE4); glBindTexture(GL_TEXTURE_2D, [inputFramebufferForDisplay texture]); glUniform1i(displayInputTextureUniform, 4); glVertexAttribPointer(displayPositionAttribute, 2, GL_FLOAT, 0, 0, imageVertices); glVertexAttribPointer(displayTextureCoordinateAttribute, 2, GL_FLOAT, 0, 0, [GPUImageView textureCoordinatesForRotation:inputRotation]); BOOL canLockFocus = YES; if ([self respondsToSelector:@selector(lockFocusIfCanDraw)]) { canLockFocus = [self lockFocusIfCanDraw]; } else { [self lockFocus]; } if (canLockFocus) { glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); [self presentFramebuffer]; glBindTexture(GL_TEXTURE_2D, 0); [self unlockFocus]; } [inputFramebufferForDisplay unlock]; inputFramebufferForDisplay = nil; }); } - (NSInteger)nextAvailableTextureIndex; { return 0; } - (void)setInputFramebuffer:(GPUImageFramebuffer *)newInputFramebuffer atIndex:(NSInteger)textureIndex; { inputFramebufferForDisplay = newInputFramebuffer; [inputFramebufferForDisplay lock]; } - (void)setInputRotation:(GPUImageRotationMode)newInputRotation atIndex:(NSInteger)textureIndex; { inputRotation = newInputRotation; } - (void)setInputSize:(CGSize)newSize atIndex:(NSInteger)textureIndex; { if ((newSize.width < 1.0) || (newSize.height < 1.0)) { return; } runSynchronouslyOnVideoProcessingQueue(^{ CGSize rotatedSize = newSize; if (GPUImageRotationSwapsWidthAndHeight(inputRotation)) { rotatedSize.width = newSize.height; rotatedSize.height = newSize.width; } if (!CGSizeEqualToSize(inputImageSize, rotatedSize)) { inputImageSize = rotatedSize; [self recalculateViewGeometry]; } }); } - (CGSize)maximumOutputSize; { if ([self respondsToSelector:@selector(convertSizeToBacking:)]) { return [self convertSizeToBacking:self.bounds.size]; } else { return self.bounds.size; } } - (void)endProcessing { } - (BOOL)shouldIgnoreUpdatesToThisTarget; { return NO; } - (void)conserveMemoryForNextFrame; { } - (BOOL)wantsMonochromeInput; { return NO; } - (void)setCurrentlyReceivingMonochromeInput:(BOOL)newValue; { } #pragma mark - #pragma mark Accessors - (CGSize)sizeInPixels; { if (CGSizeEqualToSize(_sizeInPixels, CGSizeZero)) { return [self maximumOutputSize]; } else { return _sizeInPixels; } } - (void)setFillMode:(GPUImageFillModeType)newValue; { _fillMode = newValue; [self recalculateViewGeometry]; } @end ================================================ FILE: framework/Source/Mac/en.lproj/InfoPlist.strings ================================================ /* Localized versions of Info.plist keys */ ================================================ FILE: framework/Source/iOS/Framework/GPUImageFramework.h ================================================ #import //! Project version number for GPUImageFramework. FOUNDATION_EXPORT double GPUImageFrameworkVersionNumber; //! Project version string for GPUImageFramework. FOUNDATION_EXPORT const unsigned char GPUImageFrameworkVersionString[]; #import // Base classes #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import // Filters #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import ================================================ FILE: framework/Source/iOS/Framework/Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName ${PRODUCT_NAME} CFBundlePackageType FMWK CFBundleShortVersionString 0.1.4 CFBundleSignature ???? CFBundleVersion ${CURRENT_PROJECT_VERSION} NSPrincipalClass ================================================ FILE: framework/Source/iOS/Framework/module.modulemap ================================================ framework module GPUImage { umbrella header "GPUImageFramework.h" export * module * { export * } } ================================================ FILE: framework/Source/iOS/GPUImage-Prefix.pch ================================================ // // Prefix header for all source files of the 'GPUImage' target in the 'GPUImage' project // #ifdef __OBJC__ #import #endif ================================================ FILE: framework/Source/iOS/GPUImageContext.h ================================================ #import "GLProgram.h" #import "GPUImageFramebuffer.h" #import "GPUImageFramebufferCache.h" #define GPUImageRotationSwapsWidthAndHeight(rotation) ((rotation) == kGPUImageRotateLeft || (rotation) == kGPUImageRotateRight || (rotation) == kGPUImageRotateRightFlipVertical || (rotation) == kGPUImageRotateRightFlipHorizontal) typedef NS_ENUM(NSUInteger, GPUImageRotationMode) { kGPUImageNoRotation, kGPUImageRotateLeft, kGPUImageRotateRight, kGPUImageFlipVertical, kGPUImageFlipHorizonal, kGPUImageRotateRightFlipVertical, kGPUImageRotateRightFlipHorizontal, kGPUImageRotate180 }; @interface GPUImageContext : NSObject @property(readonly, nonatomic) dispatch_queue_t contextQueue; @property(readwrite, retain, nonatomic) GLProgram *currentShaderProgram; @property(readonly, retain, nonatomic) EAGLContext *context; @property(readonly) CVOpenGLESTextureCacheRef coreVideoTextureCache; @property(readonly) GPUImageFramebufferCache *framebufferCache; + (void *)contextKey; + (GPUImageContext *)sharedImageProcessingContext; + (dispatch_queue_t)sharedContextQueue; + (GPUImageFramebufferCache *)sharedFramebufferCache; + (void)useImageProcessingContext; - (void)useAsCurrentContext; + (void)setActiveShaderProgram:(GLProgram *)shaderProgram; - (void)setContextShaderProgram:(GLProgram *)shaderProgram; + (GLint)maximumTextureSizeForThisDevice; + (GLint)maximumTextureUnitsForThisDevice; + (GLint)maximumVaryingVectorsForThisDevice; + (BOOL)deviceSupportsOpenGLESExtension:(NSString *)extension; + (BOOL)deviceSupportsRedTextures; + (BOOL)deviceSupportsFramebufferReads; + (CGSize)sizeThatFitsWithinATextureForSize:(CGSize)inputSize; - (void)presentBufferForDisplay; - (GLProgram *)programForVertexShaderString:(NSString *)vertexShaderString fragmentShaderString:(NSString *)fragmentShaderString; - (void)useSharegroup:(EAGLSharegroup *)sharegroup; // Manage fast texture upload + (BOOL)supportsFastTextureUpload; @end @protocol GPUImageInput - (void)newFrameReadyAtTime:(CMTime)frameTime atIndex:(NSInteger)textureIndex; - (void)setInputFramebuffer:(GPUImageFramebuffer *)newInputFramebuffer atIndex:(NSInteger)textureIndex; - (NSInteger)nextAvailableTextureIndex; - (void)setInputSize:(CGSize)newSize atIndex:(NSInteger)textureIndex; - (void)setInputRotation:(GPUImageRotationMode)newInputRotation atIndex:(NSInteger)textureIndex; - (CGSize)maximumOutputSize; - (void)endProcessing; - (BOOL)shouldIgnoreUpdatesToThisTarget; - (BOOL)enabled; - (BOOL)wantsMonochromeInput; - (void)setCurrentlyReceivingMonochromeInput:(BOOL)newValue; @end ================================================ FILE: framework/Source/iOS/GPUImageContext.m ================================================ #import "GPUImageContext.h" #import #import #define MAXSHADERPROGRAMSALLOWEDINCACHE 40 extern dispatch_queue_attr_t GPUImageDefaultQueueAttribute(void); @interface GPUImageContext() { NSMutableDictionary *shaderProgramCache; NSMutableArray *shaderProgramUsageHistory; EAGLSharegroup *_sharegroup; } @end @implementation GPUImageContext @synthesize context = _context; @synthesize currentShaderProgram = _currentShaderProgram; @synthesize contextQueue = _contextQueue; @synthesize coreVideoTextureCache = _coreVideoTextureCache; @synthesize framebufferCache = _framebufferCache; static void *openGLESContextQueueKey; - (id)init; { if (!(self = [super init])) { return nil; } openGLESContextQueueKey = &openGLESContextQueueKey; _contextQueue = dispatch_queue_create("com.sunsetlakesoftware.GPUImage.openGLESContextQueue", GPUImageDefaultQueueAttribute()); #if OS_OBJECT_USE_OBJC dispatch_queue_set_specific(_contextQueue, openGLESContextQueueKey, (__bridge void *)self, NULL); #endif shaderProgramCache = [[NSMutableDictionary alloc] init]; shaderProgramUsageHistory = [[NSMutableArray alloc] init]; return self; } + (void *)contextKey { return openGLESContextQueueKey; } // Based on Colin Wheeler's example here: http://cocoasamurai.blogspot.com/2011/04/singletons-your-doing-them-wrong.html + (GPUImageContext *)sharedImageProcessingContext; { static dispatch_once_t pred; static GPUImageContext *sharedImageProcessingContext = nil; dispatch_once(&pred, ^{ sharedImageProcessingContext = [[[self class] alloc] init]; }); return sharedImageProcessingContext; } + (dispatch_queue_t)sharedContextQueue; { return [[self sharedImageProcessingContext] contextQueue]; } + (GPUImageFramebufferCache *)sharedFramebufferCache; { return [[self sharedImageProcessingContext] framebufferCache]; } + (void)useImageProcessingContext; { [[GPUImageContext sharedImageProcessingContext] useAsCurrentContext]; } - (void)useAsCurrentContext; { EAGLContext *imageProcessingContext = [self context]; if ([EAGLContext currentContext] != imageProcessingContext) { [EAGLContext setCurrentContext:imageProcessingContext]; } } + (void)setActiveShaderProgram:(GLProgram *)shaderProgram; { GPUImageContext *sharedContext = [GPUImageContext sharedImageProcessingContext]; [sharedContext setContextShaderProgram:shaderProgram]; } - (void)setContextShaderProgram:(GLProgram *)shaderProgram; { EAGLContext *imageProcessingContext = [self context]; if ([EAGLContext currentContext] != imageProcessingContext) { [EAGLContext setCurrentContext:imageProcessingContext]; } if (self.currentShaderProgram != shaderProgram) { self.currentShaderProgram = shaderProgram; [shaderProgram use]; } } + (GLint)maximumTextureSizeForThisDevice; { static dispatch_once_t pred; static GLint maxTextureSize = 0; dispatch_once(&pred, ^{ [self useImageProcessingContext]; glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTextureSize); }); return maxTextureSize; } + (GLint)maximumTextureUnitsForThisDevice; { static dispatch_once_t pred; static GLint maxTextureUnits = 0; dispatch_once(&pred, ^{ [self useImageProcessingContext]; glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &maxTextureUnits); }); return maxTextureUnits; } + (GLint)maximumVaryingVectorsForThisDevice; { static dispatch_once_t pred; static GLint maxVaryingVectors = 0; dispatch_once(&pred, ^{ [self useImageProcessingContext]; glGetIntegerv(GL_MAX_VARYING_VECTORS, &maxVaryingVectors); }); return maxVaryingVectors; } + (BOOL)deviceSupportsOpenGLESExtension:(NSString *)extension; { static dispatch_once_t pred; static NSArray *extensionNames = nil; // Cache extensions for later quick reference, since this won't change for a given device dispatch_once(&pred, ^{ [GPUImageContext useImageProcessingContext]; NSString *extensionsString = [NSString stringWithCString:(const char *)glGetString(GL_EXTENSIONS) encoding:NSASCIIStringEncoding]; extensionNames = [extensionsString componentsSeparatedByString:@" "]; }); return [extensionNames containsObject:extension]; } // http://www.khronos.org/registry/gles/extensions/EXT/EXT_texture_rg.txt + (BOOL)deviceSupportsRedTextures; { static dispatch_once_t pred; static BOOL supportsRedTextures = NO; dispatch_once(&pred, ^{ supportsRedTextures = [GPUImageContext deviceSupportsOpenGLESExtension:@"GL_EXT_texture_rg"]; }); return supportsRedTextures; } + (BOOL)deviceSupportsFramebufferReads; { static dispatch_once_t pred; static BOOL supportsFramebufferReads = NO; dispatch_once(&pred, ^{ supportsFramebufferReads = [GPUImageContext deviceSupportsOpenGLESExtension:@"GL_EXT_shader_framebuffer_fetch"]; }); return supportsFramebufferReads; } + (CGSize)sizeThatFitsWithinATextureForSize:(CGSize)inputSize; { GLint maxTextureSize = [self maximumTextureSizeForThisDevice]; if ( (inputSize.width < maxTextureSize) && (inputSize.height < maxTextureSize) ) { return inputSize; } CGSize adjustedSize; if (inputSize.width > inputSize.height) { adjustedSize.width = (CGFloat)maxTextureSize; adjustedSize.height = ((CGFloat)maxTextureSize / inputSize.width) * inputSize.height; } else { adjustedSize.height = (CGFloat)maxTextureSize; adjustedSize.width = ((CGFloat)maxTextureSize / inputSize.height) * inputSize.width; } return adjustedSize; } - (void)presentBufferForDisplay; { [self.context presentRenderbuffer:GL_RENDERBUFFER]; } - (GLProgram *)programForVertexShaderString:(NSString *)vertexShaderString fragmentShaderString:(NSString *)fragmentShaderString; { NSString *lookupKeyForShaderProgram = [NSString stringWithFormat:@"V: %@ - F: %@", vertexShaderString, fragmentShaderString]; GLProgram *programFromCache = [shaderProgramCache objectForKey:lookupKeyForShaderProgram]; if (programFromCache == nil) { programFromCache = [[GLProgram alloc] initWithVertexShaderString:vertexShaderString fragmentShaderString:fragmentShaderString]; [shaderProgramCache setObject:programFromCache forKey:lookupKeyForShaderProgram]; // [shaderProgramUsageHistory addObject:lookupKeyForShaderProgram]; // if ([shaderProgramUsageHistory count] >= MAXSHADERPROGRAMSALLOWEDINCACHE) // { // for (NSUInteger currentShaderProgramRemovedFromCache = 0; currentShaderProgramRemovedFromCache < 10; currentShaderProgramRemovedFromCache++) // { // NSString *shaderProgramToRemoveFromCache = [shaderProgramUsageHistory objectAtIndex:0]; // [shaderProgramUsageHistory removeObjectAtIndex:0]; // [shaderProgramCache removeObjectForKey:shaderProgramToRemoveFromCache]; // } // } } return programFromCache; } - (void)useSharegroup:(EAGLSharegroup *)sharegroup; { NSAssert(_context == nil, @"Unable to use a share group when the context has already been created. Call this method before you use the context for the first time."); _sharegroup = sharegroup; } - (EAGLContext *)createContext; { EAGLContext *context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2 sharegroup:_sharegroup]; NSAssert(context != nil, @"Unable to create an OpenGL ES 2.0 context. The GPUImage framework requires OpenGL ES 2.0 support to work."); return context; } #pragma mark - #pragma mark Manage fast texture upload + (BOOL)supportsFastTextureUpload; { #if TARGET_IPHONE_SIMULATOR return NO; #else #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wtautological-pointer-compare" return (CVOpenGLESTextureCacheCreate != NULL); #pragma clang diagnostic pop #endif } #pragma mark - #pragma mark Accessors - (EAGLContext *)context; { if (_context == nil) { _context = [self createContext]; [EAGLContext setCurrentContext:_context]; // Set up a few global settings for the image processing pipeline glDisable(GL_DEPTH_TEST); } return _context; } - (CVOpenGLESTextureCacheRef)coreVideoTextureCache; { if (_coreVideoTextureCache == NULL) { #if defined(__IPHONE_6_0) CVReturn err = CVOpenGLESTextureCacheCreate(kCFAllocatorDefault, NULL, [self context], NULL, &_coreVideoTextureCache); #else CVReturn err = CVOpenGLESTextureCacheCreate(kCFAllocatorDefault, NULL, (__bridge void *)[self context], NULL, &_coreVideoTextureCache); #endif if (err) { NSAssert(NO, @"Error at CVOpenGLESTextureCacheCreate %d", err); } } return _coreVideoTextureCache; } - (GPUImageFramebufferCache *)framebufferCache; { if (_framebufferCache == nil) { _framebufferCache = [[GPUImageFramebufferCache alloc] init]; } return _framebufferCache; } @end ================================================ FILE: framework/Source/iOS/GPUImageMovieWriter.h ================================================ #import #import #import "GPUImageContext.h" extern NSString *const kGPUImageColorSwizzlingFragmentShaderString; @protocol GPUImageMovieWriterDelegate @optional - (void)movieRecordingCompleted; - (void)movieRecordingFailedWithError:(NSError*)error; @end @interface GPUImageMovieWriter : NSObject { BOOL alreadyFinishedRecording; NSURL *movieURL; NSString *fileType; AVAssetWriter *assetWriter; AVAssetWriterInput *assetWriterAudioInput; AVAssetWriterInput *assetWriterVideoInput; AVAssetWriterInputPixelBufferAdaptor *assetWriterPixelBufferInput; GPUImageContext *_movieWriterContext; CVPixelBufferRef renderTarget; CVOpenGLESTextureRef renderTexture; CGSize videoSize; GPUImageRotationMode inputRotation; } @property(readwrite, nonatomic) BOOL hasAudioTrack; @property(readwrite, nonatomic) BOOL shouldPassthroughAudio; @property(readwrite, nonatomic) BOOL shouldInvalidateAudioSampleWhenDone; @property(nonatomic, copy) void(^completionBlock)(void); @property(nonatomic, copy) void(^failureBlock)(NSError*); @property(nonatomic, assign) id delegate; @property(readwrite, nonatomic) BOOL encodingLiveVideo; @property(nonatomic, copy) BOOL(^videoInputReadyCallback)(void); @property(nonatomic, copy) BOOL(^audioInputReadyCallback)(void); @property(nonatomic, copy) void(^audioProcessingCallback)(SInt16 **samplesRef, CMItemCount numSamplesInBuffer); @property(nonatomic) BOOL enabled; @property(nonatomic, readonly) AVAssetWriter *assetWriter; @property(nonatomic, readonly) CMTime duration; @property(nonatomic, assign) CGAffineTransform transform; @property(nonatomic, copy) NSArray *metaData; @property(nonatomic, assign, getter = isPaused) BOOL paused; @property(nonatomic, retain) GPUImageContext *movieWriterContext; // Initialization and teardown - (id)initWithMovieURL:(NSURL *)newMovieURL size:(CGSize)newSize; - (id)initWithMovieURL:(NSURL *)newMovieURL size:(CGSize)newSize fileType:(NSString *)newFileType outputSettings:(NSDictionary *)outputSettings; - (void)setHasAudioTrack:(BOOL)hasAudioTrack audioSettings:(NSDictionary *)audioOutputSettings; // Movie recording - (void)startRecording; - (void)startRecordingInOrientation:(CGAffineTransform)orientationTransform; - (void)finishRecording; - (void)finishRecordingWithCompletionHandler:(void (^)(void))handler; - (void)cancelRecording; - (void)processAudioBuffer:(CMSampleBufferRef)audioBuffer; - (void)enableSynchronizationCallbacks; @end ================================================ FILE: framework/Source/iOS/GPUImageMovieWriter.m ================================================ #import "GPUImageMovieWriter.h" #import "GPUImageContext.h" #import "GLProgram.h" #import "GPUImageFilter.h" NSString *const kGPUImageColorSwizzlingFragmentShaderString = SHADER_STRING ( varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; void main() { gl_FragColor = texture2D(inputImageTexture, textureCoordinate).bgra; } ); @interface GPUImageMovieWriter () { GLuint movieFramebuffer, movieRenderbuffer; GLProgram *colorSwizzlingProgram; GLint colorSwizzlingPositionAttribute, colorSwizzlingTextureCoordinateAttribute; GLint colorSwizzlingInputTextureUniform; GPUImageFramebuffer *firstInputFramebuffer; BOOL discont; CMTime startTime, previousFrameTime, previousAudioTime; CMTime offsetTime; dispatch_queue_t audioQueue, videoQueue; BOOL audioEncodingIsFinished, videoEncodingIsFinished; BOOL isRecording; } // Movie recording - (void)initializeMovieWithOutputSettings:(NSMutableDictionary *)outputSettings; // Frame rendering - (void)createDataFBO; - (void)destroyDataFBO; - (void)setFilterFBO; - (void)renderAtInternalSizeUsingFramebuffer:(GPUImageFramebuffer *)inputFramebufferToUse; @end @implementation GPUImageMovieWriter @synthesize hasAudioTrack = _hasAudioTrack; @synthesize encodingLiveVideo = _encodingLiveVideo; @synthesize shouldPassthroughAudio = _shouldPassthroughAudio; @synthesize completionBlock; @synthesize failureBlock; @synthesize videoInputReadyCallback; @synthesize audioInputReadyCallback; @synthesize enabled; @synthesize shouldInvalidateAudioSampleWhenDone = _shouldInvalidateAudioSampleWhenDone; @synthesize paused = _paused; @synthesize movieWriterContext = _movieWriterContext; @synthesize delegate = _delegate; #pragma mark - #pragma mark Initialization and teardown - (id)initWithMovieURL:(NSURL *)newMovieURL size:(CGSize)newSize; { return [self initWithMovieURL:newMovieURL size:newSize fileType:AVFileTypeQuickTimeMovie outputSettings:nil]; } - (id)initWithMovieURL:(NSURL *)newMovieURL size:(CGSize)newSize fileType:(NSString *)newFileType outputSettings:(NSMutableDictionary *)outputSettings; { if (!(self = [super init])) { return nil; } _shouldInvalidateAudioSampleWhenDone = NO; self.enabled = YES; alreadyFinishedRecording = NO; videoEncodingIsFinished = NO; audioEncodingIsFinished = NO; discont = NO; videoSize = newSize; movieURL = newMovieURL; fileType = newFileType; startTime = kCMTimeInvalid; _encodingLiveVideo = [[outputSettings objectForKey:@"EncodingLiveVideo"] isKindOfClass:[NSNumber class]] ? [[outputSettings objectForKey:@"EncodingLiveVideo"] boolValue] : YES; previousFrameTime = kCMTimeNegativeInfinity; previousAudioTime = kCMTimeNegativeInfinity; inputRotation = kGPUImageNoRotation; _movieWriterContext = [[GPUImageContext alloc] init]; [_movieWriterContext useSharegroup:[[[GPUImageContext sharedImageProcessingContext] context] sharegroup]]; runSynchronouslyOnContextQueue(_movieWriterContext, ^{ [_movieWriterContext useAsCurrentContext]; if ([GPUImageContext supportsFastTextureUpload]) { colorSwizzlingProgram = [_movieWriterContext programForVertexShaderString:kGPUImageVertexShaderString fragmentShaderString:kGPUImagePassthroughFragmentShaderString]; } else { colorSwizzlingProgram = [_movieWriterContext programForVertexShaderString:kGPUImageVertexShaderString fragmentShaderString:kGPUImageColorSwizzlingFragmentShaderString]; } if (!colorSwizzlingProgram.initialized) { [colorSwizzlingProgram addAttribute:@"position"]; [colorSwizzlingProgram addAttribute:@"inputTextureCoordinate"]; if (![colorSwizzlingProgram link]) { NSString *progLog = [colorSwizzlingProgram programLog]; NSLog(@"Program link log: %@", progLog); NSString *fragLog = [colorSwizzlingProgram fragmentShaderLog]; NSLog(@"Fragment shader compile log: %@", fragLog); NSString *vertLog = [colorSwizzlingProgram vertexShaderLog]; NSLog(@"Vertex shader compile log: %@", vertLog); colorSwizzlingProgram = nil; NSAssert(NO, @"Filter shader link failed"); } } colorSwizzlingPositionAttribute = [colorSwizzlingProgram attributeIndex:@"position"]; colorSwizzlingTextureCoordinateAttribute = [colorSwizzlingProgram attributeIndex:@"inputTextureCoordinate"]; colorSwizzlingInputTextureUniform = [colorSwizzlingProgram uniformIndex:@"inputImageTexture"]; [_movieWriterContext setContextShaderProgram:colorSwizzlingProgram]; glEnableVertexAttribArray(colorSwizzlingPositionAttribute); glEnableVertexAttribArray(colorSwizzlingTextureCoordinateAttribute); }); [self initializeMovieWithOutputSettings:outputSettings]; return self; } - (void)dealloc; { [self destroyDataFBO]; #if !OS_OBJECT_USE_OBJC if( audioQueue != NULL ) { dispatch_release(audioQueue); } if( videoQueue != NULL ) { dispatch_release(videoQueue); } #endif } #pragma mark - #pragma mark Movie recording - (void)initializeMovieWithOutputSettings:(NSDictionary *)outputSettings; { isRecording = NO; self.enabled = YES; NSError *error = nil; assetWriter = [[AVAssetWriter alloc] initWithURL:movieURL fileType:fileType error:&error]; if (error != nil) { NSLog(@"Error: %@", error); if (failureBlock) { failureBlock(error); } else { if(self.delegate && [self.delegate respondsToSelector:@selector(movieRecordingFailedWithError:)]) { [self.delegate movieRecordingFailedWithError:error]; } } } // Set this to make sure that a functional movie is produced, even if the recording is cut off mid-stream. Only the last second should be lost in that case. assetWriter.movieFragmentInterval = CMTimeMakeWithSeconds(1.0, 1000); // use default output settings if none specified if (outputSettings == nil) { NSMutableDictionary *settings = [[NSMutableDictionary alloc] init]; [settings setObject:AVVideoCodecH264 forKey:AVVideoCodecKey]; [settings setObject:[NSNumber numberWithInt:videoSize.width] forKey:AVVideoWidthKey]; [settings setObject:[NSNumber numberWithInt:videoSize.height] forKey:AVVideoHeightKey]; outputSettings = settings; } // custom output settings specified else { __unused NSString *videoCodec = [outputSettings objectForKey:AVVideoCodecKey]; __unused NSNumber *width = [outputSettings objectForKey:AVVideoWidthKey]; __unused NSNumber *height = [outputSettings objectForKey:AVVideoHeightKey]; NSAssert(videoCodec && width && height, @"OutputSettings is missing required parameters."); if( [outputSettings objectForKey:@"EncodingLiveVideo"] ) { NSMutableDictionary *tmp = [outputSettings mutableCopy]; [tmp removeObjectForKey:@"EncodingLiveVideo"]; outputSettings = tmp; } } /* NSDictionary *videoCleanApertureSettings = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:videoSize.width], AVVideoCleanApertureWidthKey, [NSNumber numberWithInt:videoSize.height], AVVideoCleanApertureHeightKey, [NSNumber numberWithInt:0], AVVideoCleanApertureHorizontalOffsetKey, [NSNumber numberWithInt:0], AVVideoCleanApertureVerticalOffsetKey, nil]; NSDictionary *videoAspectRatioSettings = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:3], AVVideoPixelAspectRatioHorizontalSpacingKey, [NSNumber numberWithInt:3], AVVideoPixelAspectRatioVerticalSpacingKey, nil]; NSMutableDictionary * compressionProperties = [[NSMutableDictionary alloc] init]; [compressionProperties setObject:videoCleanApertureSettings forKey:AVVideoCleanApertureKey]; [compressionProperties setObject:videoAspectRatioSettings forKey:AVVideoPixelAspectRatioKey]; [compressionProperties setObject:[NSNumber numberWithInt: 2000000] forKey:AVVideoAverageBitRateKey]; [compressionProperties setObject:[NSNumber numberWithInt: 16] forKey:AVVideoMaxKeyFrameIntervalKey]; [compressionProperties setObject:AVVideoProfileLevelH264Main31 forKey:AVVideoProfileLevelKey]; [outputSettings setObject:compressionProperties forKey:AVVideoCompressionPropertiesKey]; */ assetWriterVideoInput = [AVAssetWriterInput assetWriterInputWithMediaType:AVMediaTypeVideo outputSettings:outputSettings]; assetWriterVideoInput.expectsMediaDataInRealTime = _encodingLiveVideo; // You need to use BGRA for the video in order to get realtime encoding. I use a color-swizzling shader to line up glReadPixels' normal RGBA output with the movie input's BGRA. NSDictionary *sourcePixelBufferAttributesDictionary = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:kCVPixelFormatType_32BGRA], kCVPixelBufferPixelFormatTypeKey, [NSNumber numberWithInt:videoSize.width], kCVPixelBufferWidthKey, [NSNumber numberWithInt:videoSize.height], kCVPixelBufferHeightKey, nil]; // NSDictionary *sourcePixelBufferAttributesDictionary = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:kCVPixelFormatType_32ARGB], kCVPixelBufferPixelFormatTypeKey, // nil]; assetWriterPixelBufferInput = [AVAssetWriterInputPixelBufferAdaptor assetWriterInputPixelBufferAdaptorWithAssetWriterInput:assetWriterVideoInput sourcePixelBufferAttributes:sourcePixelBufferAttributesDictionary]; [assetWriter addInput:assetWriterVideoInput]; } - (void)setEncodingLiveVideo:(BOOL) value { _encodingLiveVideo = value; if (isRecording) { NSAssert(NO, @"Can not change Encoding Live Video while recording"); } else { assetWriterVideoInput.expectsMediaDataInRealTime = _encodingLiveVideo; assetWriterAudioInput.expectsMediaDataInRealTime = _encodingLiveVideo; } } - (void)startRecording; { alreadyFinishedRecording = NO; startTime = kCMTimeInvalid; runSynchronouslyOnContextQueue(_movieWriterContext, ^{ if (audioInputReadyCallback == NULL) { [assetWriter startWriting]; } }); isRecording = YES; // [assetWriter startSessionAtSourceTime:kCMTimeZero]; } - (void)startRecordingInOrientation:(CGAffineTransform)orientationTransform; { assetWriterVideoInput.transform = orientationTransform; [self startRecording]; } - (void)cancelRecording; { if (assetWriter.status == AVAssetWriterStatusCompleted) { return; } isRecording = NO; runSynchronouslyOnContextQueue(_movieWriterContext, ^{ alreadyFinishedRecording = YES; if( assetWriter.status == AVAssetWriterStatusWriting && ! videoEncodingIsFinished ) { videoEncodingIsFinished = YES; [assetWriterVideoInput markAsFinished]; } if( assetWriter.status == AVAssetWriterStatusWriting && ! audioEncodingIsFinished ) { audioEncodingIsFinished = YES; [assetWriterAudioInput markAsFinished]; } [assetWriter cancelWriting]; }); } - (void)finishRecording; { [self finishRecordingWithCompletionHandler:NULL]; } - (void)finishRecordingWithCompletionHandler:(void (^)(void))handler; { runSynchronouslyOnContextQueue(_movieWriterContext, ^{ isRecording = NO; if (assetWriter.status == AVAssetWriterStatusCompleted || assetWriter.status == AVAssetWriterStatusCancelled || assetWriter.status == AVAssetWriterStatusUnknown) { if (handler) runAsynchronouslyOnContextQueue(_movieWriterContext, handler); return; } if( assetWriter.status == AVAssetWriterStatusWriting && ! videoEncodingIsFinished ) { videoEncodingIsFinished = YES; [assetWriterVideoInput markAsFinished]; } if( assetWriter.status == AVAssetWriterStatusWriting && ! audioEncodingIsFinished ) { audioEncodingIsFinished = YES; [assetWriterAudioInput markAsFinished]; } #if (!defined(__IPHONE_6_0) || (__IPHONE_OS_VERSION_MAX_ALLOWED < __IPHONE_6_0)) // Not iOS 6 SDK [assetWriter finishWriting]; if (handler) runAsynchronouslyOnContextQueue(_movieWriterContext,handler); #else // iOS 6 SDK if ([assetWriter respondsToSelector:@selector(finishWritingWithCompletionHandler:)]) { // Running iOS 6 [assetWriter finishWritingWithCompletionHandler:(handler ?: ^{ })]; } else { // Not running iOS 6 #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" [assetWriter finishWriting]; #pragma clang diagnostic pop if (handler) runAsynchronouslyOnContextQueue(_movieWriterContext, handler); } #endif }); } - (void)processAudioBuffer:(CMSampleBufferRef)audioBuffer; { if (!isRecording || _paused) { return; } // if (_hasAudioTrack && CMTIME_IS_VALID(startTime)) if (_hasAudioTrack) { CFRetain(audioBuffer); CMTime currentSampleTime = CMSampleBufferGetOutputPresentationTimeStamp(audioBuffer); if (CMTIME_IS_INVALID(startTime)) { runSynchronouslyOnContextQueue(_movieWriterContext, ^{ if ((audioInputReadyCallback == NULL) && (assetWriter.status != AVAssetWriterStatusWriting)) { [assetWriter startWriting]; } [assetWriter startSessionAtSourceTime:currentSampleTime]; startTime = currentSampleTime; }); } if (!assetWriterAudioInput.readyForMoreMediaData && _encodingLiveVideo) { NSLog(@"1: Had to drop an audio frame: %@", CFBridgingRelease(CMTimeCopyDescription(kCFAllocatorDefault, currentSampleTime))); if (_shouldInvalidateAudioSampleWhenDone) { CMSampleBufferInvalidate(audioBuffer); } CFRelease(audioBuffer); return; } if (discont) { discont = NO; CMTime current; if (offsetTime.value > 0) { current = CMTimeSubtract(currentSampleTime, offsetTime); } else { current = currentSampleTime; } CMTime offset = CMTimeSubtract(current, previousAudioTime); if (offsetTime.value == 0) { offsetTime = offset; } else { offsetTime = CMTimeAdd(offsetTime, offset); } } if (offsetTime.value > 0) { CFRelease(audioBuffer); audioBuffer = [self adjustTime:audioBuffer by:offsetTime]; CFRetain(audioBuffer); } // record most recent time so we know the length of the pause currentSampleTime = CMSampleBufferGetPresentationTimeStamp(audioBuffer); previousAudioTime = currentSampleTime; //if the consumer wants to do something with the audio samples before writing, let him. if (self.audioProcessingCallback) { //need to introspect into the opaque CMBlockBuffer structure to find its raw sample buffers. CMBlockBufferRef buffer = CMSampleBufferGetDataBuffer(audioBuffer); CMItemCount numSamplesInBuffer = CMSampleBufferGetNumSamples(audioBuffer); AudioBufferList audioBufferList; CMSampleBufferGetAudioBufferListWithRetainedBlockBuffer(audioBuffer, NULL, &audioBufferList, sizeof(audioBufferList), NULL, NULL, kCMSampleBufferFlag_AudioBufferList_Assure16ByteAlignment, &buffer ); //passing a live pointer to the audio buffers, try to process them in-place or we might have syncing issues. for (int bufferCount=0; bufferCount < audioBufferList.mNumberBuffers; bufferCount++) { SInt16 *samples = (SInt16 *)audioBufferList.mBuffers[bufferCount].mData; self.audioProcessingCallback(&samples, numSamplesInBuffer); } } // NSLog(@"Recorded audio sample time: %lld, %d, %lld", currentSampleTime.value, currentSampleTime.timescale, currentSampleTime.epoch); void(^write)() = ^() { while( ! assetWriterAudioInput.readyForMoreMediaData && ! _encodingLiveVideo && ! audioEncodingIsFinished ) { NSDate *maxDate = [NSDate dateWithTimeIntervalSinceNow:0.5]; //NSLog(@"audio waiting..."); [[NSRunLoop currentRunLoop] runUntilDate:maxDate]; } if (!assetWriterAudioInput.readyForMoreMediaData) { NSLog(@"2: Had to drop an audio frame %@", CFBridgingRelease(CMTimeCopyDescription(kCFAllocatorDefault, currentSampleTime))); } else if(assetWriter.status == AVAssetWriterStatusWriting) { if (![assetWriterAudioInput appendSampleBuffer:audioBuffer]) NSLog(@"Problem appending audio buffer at time: %@", CFBridgingRelease(CMTimeCopyDescription(kCFAllocatorDefault, currentSampleTime))); } else { //NSLog(@"Wrote an audio frame %@", CFBridgingRelease(CMTimeCopyDescription(kCFAllocatorDefault, currentSampleTime))); } if (_shouldInvalidateAudioSampleWhenDone) { CMSampleBufferInvalidate(audioBuffer); } CFRelease(audioBuffer); }; // runAsynchronouslyOnContextQueue(_movieWriterContext, write); if( _encodingLiveVideo ) { runAsynchronouslyOnContextQueue(_movieWriterContext, write); } else { write(); } } } - (void)enableSynchronizationCallbacks; { if (videoInputReadyCallback != NULL) { if( assetWriter.status != AVAssetWriterStatusWriting ) { [assetWriter startWriting]; } videoQueue = dispatch_queue_create("com.sunsetlakesoftware.GPUImage.videoReadingQueue", GPUImageDefaultQueueAttribute()); [assetWriterVideoInput requestMediaDataWhenReadyOnQueue:videoQueue usingBlock:^{ if( _paused ) { //NSLog(@"video requestMediaDataWhenReadyOnQueue paused"); // if we don't sleep, we'll get called back almost immediately, chewing up CPU usleep(10000); return; } //NSLog(@"video requestMediaDataWhenReadyOnQueue begin"); while( assetWriterVideoInput.readyForMoreMediaData && ! _paused ) { if( videoInputReadyCallback && ! videoInputReadyCallback() && ! videoEncodingIsFinished ) { runAsynchronouslyOnContextQueue(_movieWriterContext, ^{ if( assetWriter.status == AVAssetWriterStatusWriting && ! videoEncodingIsFinished ) { videoEncodingIsFinished = YES; [assetWriterVideoInput markAsFinished]; } }); } } //NSLog(@"video requestMediaDataWhenReadyOnQueue end"); }]; } if (audioInputReadyCallback != NULL) { audioQueue = dispatch_queue_create("com.sunsetlakesoftware.GPUImage.audioReadingQueue", GPUImageDefaultQueueAttribute()); [assetWriterAudioInput requestMediaDataWhenReadyOnQueue:audioQueue usingBlock:^{ if( _paused ) { //NSLog(@"audio requestMediaDataWhenReadyOnQueue paused"); // if we don't sleep, we'll get called back almost immediately, chewing up CPU usleep(10000); return; } //NSLog(@"audio requestMediaDataWhenReadyOnQueue begin"); while( assetWriterAudioInput.readyForMoreMediaData && ! _paused ) { if( audioInputReadyCallback && ! audioInputReadyCallback() && ! audioEncodingIsFinished ) { runAsynchronouslyOnContextQueue(_movieWriterContext, ^{ if( assetWriter.status == AVAssetWriterStatusWriting && ! audioEncodingIsFinished ) { audioEncodingIsFinished = YES; [assetWriterAudioInput markAsFinished]; } }); } } //NSLog(@"audio requestMediaDataWhenReadyOnQueue end"); }]; } } #pragma mark - #pragma mark Frame rendering - (void)createDataFBO; { glActiveTexture(GL_TEXTURE1); glGenFramebuffers(1, &movieFramebuffer); glBindFramebuffer(GL_FRAMEBUFFER, movieFramebuffer); if ([GPUImageContext supportsFastTextureUpload]) { // Code originally sourced from http://allmybrain.com/2011/12/08/rendering-to-a-texture-with-ios-5-texture-cache-api/ CVPixelBufferPoolCreatePixelBuffer (NULL, [assetWriterPixelBufferInput pixelBufferPool], &renderTarget); /* AVAssetWriter will use BT.601 conversion matrix for RGB to YCbCr conversion * regardless of the kCVImageBufferYCbCrMatrixKey value. * Tagging the resulting video file as BT.601, is the best option right now. * Creating a proper BT.709 video is not possible at the moment. */ CVBufferSetAttachment(renderTarget, kCVImageBufferColorPrimariesKey, kCVImageBufferColorPrimaries_ITU_R_709_2, kCVAttachmentMode_ShouldPropagate); CVBufferSetAttachment(renderTarget, kCVImageBufferYCbCrMatrixKey, kCVImageBufferYCbCrMatrix_ITU_R_601_4, kCVAttachmentMode_ShouldPropagate); CVBufferSetAttachment(renderTarget, kCVImageBufferTransferFunctionKey, kCVImageBufferTransferFunction_ITU_R_709_2, kCVAttachmentMode_ShouldPropagate); CVOpenGLESTextureCacheCreateTextureFromImage (kCFAllocatorDefault, [_movieWriterContext coreVideoTextureCache], renderTarget, NULL, // texture attributes GL_TEXTURE_2D, GL_RGBA, // opengl format (int)videoSize.width, (int)videoSize.height, GL_BGRA, // native iOS format GL_UNSIGNED_BYTE, 0, &renderTexture); glBindTexture(CVOpenGLESTextureGetTarget(renderTexture), CVOpenGLESTextureGetName(renderTexture)); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, CVOpenGLESTextureGetName(renderTexture), 0); } else { glGenRenderbuffers(1, &movieRenderbuffer); glBindRenderbuffer(GL_RENDERBUFFER, movieRenderbuffer); glRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA8_OES, (int)videoSize.width, (int)videoSize.height); glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, movieRenderbuffer); } __unused GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); NSAssert(status == GL_FRAMEBUFFER_COMPLETE, @"Incomplete filter FBO: %d", status); } - (void)destroyDataFBO; { runSynchronouslyOnContextQueue(_movieWriterContext, ^{ [_movieWriterContext useAsCurrentContext]; if (movieFramebuffer) { glDeleteFramebuffers(1, &movieFramebuffer); movieFramebuffer = 0; } if (movieRenderbuffer) { glDeleteRenderbuffers(1, &movieRenderbuffer); movieRenderbuffer = 0; } if ([GPUImageContext supportsFastTextureUpload]) { if (renderTexture) { CFRelease(renderTexture); } if (renderTarget) { CVPixelBufferRelease(renderTarget); } } }); } - (void)setFilterFBO; { if (!movieFramebuffer) { [self createDataFBO]; } glBindFramebuffer(GL_FRAMEBUFFER, movieFramebuffer); glViewport(0, 0, (int)videoSize.width, (int)videoSize.height); } - (void)renderAtInternalSizeUsingFramebuffer:(GPUImageFramebuffer *)inputFramebufferToUse; { [_movieWriterContext useAsCurrentContext]; [self setFilterFBO]; [_movieWriterContext setContextShaderProgram:colorSwizzlingProgram]; glClearColor(1.0f, 0.0f, 0.0f, 1.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // This needs to be flipped to write out to video correctly static const GLfloat squareVertices[] = { -1.0f, -1.0f, 1.0f, -1.0f, -1.0f, 1.0f, 1.0f, 1.0f, }; const GLfloat *textureCoordinates = [GPUImageFilter textureCoordinatesForRotation:inputRotation]; glActiveTexture(GL_TEXTURE4); glBindTexture(GL_TEXTURE_2D, [inputFramebufferToUse texture]); glUniform1i(colorSwizzlingInputTextureUniform, 4); // NSLog(@"Movie writer framebuffer: %@", inputFramebufferToUse); glVertexAttribPointer(colorSwizzlingPositionAttribute, 2, GL_FLOAT, 0, 0, squareVertices); glVertexAttribPointer(colorSwizzlingTextureCoordinateAttribute, 2, GL_FLOAT, 0, 0, textureCoordinates); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); glFinish(); } #pragma mark - #pragma mark GPUImageInput protocol - (void)newFrameReadyAtTime:(CMTime)frameTime atIndex:(NSInteger)textureIndex; { if (!isRecording || _paused) { [firstInputFramebuffer unlock]; return; } if (discont) { discont = NO; CMTime current; if (offsetTime.value > 0) { current = CMTimeSubtract(frameTime, offsetTime); } else { current = frameTime; } CMTime offset = CMTimeSubtract(current, previousFrameTime); if (offsetTime.value == 0) { offsetTime = offset; } else { offsetTime = CMTimeAdd(offsetTime, offset); } } if (offsetTime.value > 0) { frameTime = CMTimeSubtract(frameTime, offsetTime); } // Drop frames forced by images and other things with no time constants // Also, if two consecutive times with the same value are added to the movie, it aborts recording, so I bail on that case if ( (CMTIME_IS_INVALID(frameTime)) || (CMTIME_COMPARE_INLINE(frameTime, ==, previousFrameTime)) || (CMTIME_IS_INDEFINITE(frameTime)) ) { [firstInputFramebuffer unlock]; return; } if (CMTIME_IS_INVALID(startTime)) { runSynchronouslyOnContextQueue(_movieWriterContext, ^{ if ((videoInputReadyCallback == NULL) && (assetWriter.status != AVAssetWriterStatusWriting)) { [assetWriter startWriting]; } [assetWriter startSessionAtSourceTime:frameTime]; startTime = frameTime; }); } GPUImageFramebuffer *inputFramebufferForBlock = firstInputFramebuffer; glFinish(); runAsynchronouslyOnContextQueue(_movieWriterContext, ^{ if (!assetWriterVideoInput.readyForMoreMediaData && _encodingLiveVideo) { [inputFramebufferForBlock unlock]; NSLog(@"1: Had to drop a video frame: %@", CFBridgingRelease(CMTimeCopyDescription(kCFAllocatorDefault, frameTime))); return; } // Render the frame with swizzled colors, so that they can be uploaded quickly as BGRA frames [_movieWriterContext useAsCurrentContext]; [self renderAtInternalSizeUsingFramebuffer:inputFramebufferForBlock]; CVPixelBufferRef pixel_buffer = NULL; if ([GPUImageContext supportsFastTextureUpload]) { pixel_buffer = renderTarget; CVPixelBufferLockBaseAddress(pixel_buffer, 0); } else { CVReturn status = CVPixelBufferPoolCreatePixelBuffer (NULL, [assetWriterPixelBufferInput pixelBufferPool], &pixel_buffer); if ((pixel_buffer == NULL) || (status != kCVReturnSuccess)) { CVPixelBufferRelease(pixel_buffer); return; } else { CVPixelBufferLockBaseAddress(pixel_buffer, 0); GLubyte *pixelBufferData = (GLubyte *)CVPixelBufferGetBaseAddress(pixel_buffer); glReadPixels(0, 0, videoSize.width, videoSize.height, GL_RGBA, GL_UNSIGNED_BYTE, pixelBufferData); } } void(^write)() = ^() { while( ! assetWriterVideoInput.readyForMoreMediaData && ! _encodingLiveVideo && ! videoEncodingIsFinished ) { NSDate *maxDate = [NSDate dateWithTimeIntervalSinceNow:0.1]; // NSLog(@"video waiting..."); [[NSRunLoop currentRunLoop] runUntilDate:maxDate]; } if (!assetWriterVideoInput.readyForMoreMediaData) { NSLog(@"2: Had to drop a video frame: %@", CFBridgingRelease(CMTimeCopyDescription(kCFAllocatorDefault, frameTime))); } else if(self.assetWriter.status == AVAssetWriterStatusWriting) { if (![assetWriterPixelBufferInput appendPixelBuffer:pixel_buffer withPresentationTime:frameTime]) NSLog(@"Problem appending pixel buffer at time: %@", CFBridgingRelease(CMTimeCopyDescription(kCFAllocatorDefault, frameTime))); } else { NSLog(@"Couldn't write a frame"); //NSLog(@"Wrote a video frame: %@", CFBridgingRelease(CMTimeCopyDescription(kCFAllocatorDefault, frameTime))); } CVPixelBufferUnlockBaseAddress(pixel_buffer, 0); previousFrameTime = frameTime; if (![GPUImageContext supportsFastTextureUpload]) { CVPixelBufferRelease(pixel_buffer); } }; write(); [inputFramebufferForBlock unlock]; }); } - (NSInteger)nextAvailableTextureIndex; { return 0; } - (void)setInputFramebuffer:(GPUImageFramebuffer *)newInputFramebuffer atIndex:(NSInteger)textureIndex; { [newInputFramebuffer lock]; // runSynchronouslyOnContextQueue(_movieWriterContext, ^{ firstInputFramebuffer = newInputFramebuffer; // }); } - (void)setInputRotation:(GPUImageRotationMode)newInputRotation atIndex:(NSInteger)textureIndex; { inputRotation = newInputRotation; } - (void)setInputSize:(CGSize)newSize atIndex:(NSInteger)textureIndex; { } - (CGSize)maximumOutputSize; { return videoSize; } - (void)endProcessing { if (completionBlock) { if (!alreadyFinishedRecording) { alreadyFinishedRecording = YES; completionBlock(); } } else { if (_delegate && [_delegate respondsToSelector:@selector(movieRecordingCompleted)]) { [_delegate movieRecordingCompleted]; } } } - (BOOL)shouldIgnoreUpdatesToThisTarget; { return NO; } - (BOOL)wantsMonochromeInput; { return NO; } - (void)setCurrentlyReceivingMonochromeInput:(BOOL)newValue; { } #pragma mark - #pragma mark Accessors - (void)setHasAudioTrack:(BOOL)newValue { [self setHasAudioTrack:newValue audioSettings:nil]; } - (void)setHasAudioTrack:(BOOL)newValue audioSettings:(NSDictionary *)audioOutputSettings; { _hasAudioTrack = newValue; if (_hasAudioTrack) { if (_shouldPassthroughAudio) { // Do not set any settings so audio will be the same as passthrough audioOutputSettings = nil; } else if (audioOutputSettings == nil) { AVAudioSession *sharedAudioSession = [AVAudioSession sharedInstance]; double preferredHardwareSampleRate; if ([sharedAudioSession respondsToSelector:@selector(sampleRate)]) { preferredHardwareSampleRate = [sharedAudioSession sampleRate]; } else { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" preferredHardwareSampleRate = [[AVAudioSession sharedInstance] currentHardwareSampleRate]; #pragma clang diagnostic pop } AudioChannelLayout acl; bzero( &acl, sizeof(acl)); acl.mChannelLayoutTag = kAudioChannelLayoutTag_Mono; audioOutputSettings = [NSDictionary dictionaryWithObjectsAndKeys: [ NSNumber numberWithInt: kAudioFormatMPEG4AAC], AVFormatIDKey, [ NSNumber numberWithInt: 1 ], AVNumberOfChannelsKey, [ NSNumber numberWithFloat: preferredHardwareSampleRate ], AVSampleRateKey, [ NSData dataWithBytes: &acl length: sizeof( acl ) ], AVChannelLayoutKey, //[ NSNumber numberWithInt:AVAudioQualityLow], AVEncoderAudioQualityKey, [ NSNumber numberWithInt: 64000 ], AVEncoderBitRateKey, nil]; /* AudioChannelLayout acl; bzero( &acl, sizeof(acl)); acl.mChannelLayoutTag = kAudioChannelLayoutTag_Mono; audioOutputSettings = [NSDictionary dictionaryWithObjectsAndKeys: [ NSNumber numberWithInt: kAudioFormatMPEG4AAC ], AVFormatIDKey, [ NSNumber numberWithInt: 1 ], AVNumberOfChannelsKey, [ NSNumber numberWithFloat: 44100.0 ], AVSampleRateKey, [ NSNumber numberWithInt: 64000 ], AVEncoderBitRateKey, [ NSData dataWithBytes: &acl length: sizeof( acl ) ], AVChannelLayoutKey, nil];*/ } assetWriterAudioInput = [AVAssetWriterInput assetWriterInputWithMediaType:AVMediaTypeAudio outputSettings:audioOutputSettings]; [assetWriter addInput:assetWriterAudioInput]; assetWriterAudioInput.expectsMediaDataInRealTime = _encodingLiveVideo; } else { // Remove audio track if it exists } } - (NSArray*)metaData { return assetWriter.metadata; } - (void)setMetaData:(NSArray*)metaData { assetWriter.metadata = metaData; } - (CMTime)duration { if( ! CMTIME_IS_VALID(startTime) ) return kCMTimeZero; if( ! CMTIME_IS_NEGATIVE_INFINITY(previousFrameTime) ) return CMTimeSubtract(previousFrameTime, startTime); if( ! CMTIME_IS_NEGATIVE_INFINITY(previousAudioTime) ) return CMTimeSubtract(previousAudioTime, startTime); return kCMTimeZero; } - (CGAffineTransform)transform { return assetWriterVideoInput.transform; } - (void)setTransform:(CGAffineTransform)transform { assetWriterVideoInput.transform = transform; } - (AVAssetWriter*)assetWriter { return assetWriter; } - (void)setPaused:(BOOL)newValue { if (_paused != newValue) { _paused = newValue; if (_paused) { discont = YES; } } } - (CMSampleBufferRef)adjustTime:(CMSampleBufferRef) sample by:(CMTime) offset { CMItemCount count; CMSampleBufferGetSampleTimingInfoArray(sample, 0, nil, &count); CMSampleTimingInfo* pInfo = malloc(sizeof(CMSampleTimingInfo) * count); CMSampleBufferGetSampleTimingInfoArray(sample, count, pInfo, &count); for (CMItemCount i = 0; i < count; i++) { pInfo[i].decodeTimeStamp = CMTimeSubtract(pInfo[i].decodeTimeStamp, offset); pInfo[i].presentationTimeStamp = CMTimeSubtract(pInfo[i].presentationTimeStamp, offset); } CMSampleBufferRef sout; CMSampleBufferCreateCopyWithNewTiming(nil, sample, count, pInfo, &sout); free(pInfo); return sout; } @end ================================================ FILE: framework/Source/iOS/GPUImagePicture+TextureSubimage.h ================================================ // // GPUImagePicture+TextureSubimage.h // GPUImage // // Created by Jack Wu on 2014-05-28. // Copyright (c) 2014 Brad Larson. All rights reserved. // #import "GPUImagePicture.h" @interface GPUImagePicture (TextureSubimage) - (void)replaceTextureWithSubimage:(UIImage*)subimage; - (void)replaceTextureWithSubCGImage:(CGImageRef)subimageSource; - (void)replaceTextureWithSubimage:(UIImage*)subimage inRect:(CGRect)subRect; - (void)replaceTextureWithSubCGImage:(CGImageRef)subimageSource inRect:(CGRect)subRect; @end ================================================ FILE: framework/Source/iOS/GPUImagePicture+TextureSubimage.m ================================================ // // GPUImagePicture+TextureSubimage.m // GPUImage // // Created by Jack Wu on 2014-05-28. // Copyright (c) 2014 Brad Larson. All rights reserved. // #import "GPUImagePicture+TextureSubimage.h" @implementation GPUImagePicture (TextureSubimage) - (void)replaceTextureWithSubimage:(UIImage*)subimage { return [self replaceTextureWithSubCGImage:[subimage CGImage]]; } - (void)replaceTextureWithSubCGImage:(CGImageRef)subimageSource { CGRect rect = (CGRect) {.origin = CGPointZero, .size = (CGSize){.width = CGImageGetWidth(subimageSource), .height = CGImageGetHeight(subimageSource)}}; return [self replaceTextureWithSubCGImage:subimageSource inRect:rect]; } - (void)replaceTextureWithSubimage:(UIImage*)subimage inRect:(CGRect)subRect { return [self replaceTextureWithSubCGImage:[subimage CGImage] inRect:subRect]; } - (void)replaceTextureWithSubCGImage:(CGImageRef)subimageSource inRect:(CGRect)subRect { NSAssert(outputFramebuffer, @"Picture must be initialized first before replacing subtexture"); NSAssert(self.framebufferForOutput.textureOptions.internalFormat == GL_RGBA, @"For replacing subtexture the internal texture format must be GL_RGBA."); CGRect subimageRect = (CGRect){.origin = CGPointZero, .size = (CGSize){.width = CGImageGetWidth(subimageSource), .height = CGImageGetHeight(subimageSource)}}; NSAssert(!CGRectIsEmpty(subimageRect), @"Passed sub image must not be empty - it should be at least 1px tall and wide"); NSAssert(!CGRectIsEmpty(subRect), @"Passed sub rect must not be empty"); NSAssert(CGSizeEqualToSize(subimageRect.size, subRect.size), @"Subimage size must match the size of sub rect"); // We don't have to worry about scaling the subimage or finding a power of two size. // The initialization has taken care of that for us. dispatch_semaphore_signal(imageUpdateSemaphore); BOOL shouldRedrawUsingCoreGraphics = NO; // Since internal format is always RGBA, we need the input data in RGBA as well. CGBitmapInfo bitmapInfo = CGImageGetBitmapInfo(subimageSource); CGBitmapInfo byteOrderInfo = bitmapInfo & kCGBitmapByteOrderMask; if (byteOrderInfo != kCGBitmapByteOrderDefault && byteOrderInfo != kCGBitmapByteOrder32Big) { shouldRedrawUsingCoreGraphics = YES; } else { CGImageAlphaInfo alphaInfo = bitmapInfo & kCGBitmapAlphaInfoMask; if (alphaInfo != kCGImageAlphaPremultipliedLast && alphaInfo != kCGImageAlphaLast && alphaInfo != kCGImageAlphaNoneSkipLast) { shouldRedrawUsingCoreGraphics = YES; } } GLubyte *imageData = NULL; CFDataRef dataFromImageDataProvider; if (shouldRedrawUsingCoreGraphics) { // For resized or incompatible image: redraw imageData = (GLubyte *) calloc(1, (int)subimageRect.size.width * (int)subimageRect.size.height * 4); CGColorSpaceRef genericRGBColorspace = CGColorSpaceCreateDeviceRGB(); CGContextRef imageContext = CGBitmapContextCreate(imageData, (size_t)subimageRect.size.width, (size_t)subimageRect.size.height, 8, (size_t)subimageRect.size.width * 4, genericRGBColorspace, kCGBitmapByteOrderDefault | kCGImageAlphaPremultipliedLast); CGContextDrawImage(imageContext, CGRectMake(0.0, 0.0, subimageRect.size.width, subimageRect.size.height), subimageSource); CGContextRelease(imageContext); CGColorSpaceRelease(genericRGBColorspace); } else { // Access the raw image bytes directly dataFromImageDataProvider = CGDataProviderCopyData(CGImageGetDataProvider(subimageSource)); imageData = (GLubyte *)CFDataGetBytePtr(dataFromImageDataProvider); } runSynchronouslyOnVideoProcessingQueue(^{ [GPUImageContext useImageProcessingContext]; [outputFramebuffer disableReferenceCounting]; glBindTexture(GL_TEXTURE_2D, [outputFramebuffer texture]); // no need to use self.outputTextureOptions here since pictures need this texture formats and type glTexSubImage2D(GL_TEXTURE_2D, 0, subRect.origin.x, subRect.origin.y, (GLint)subRect.size.width, subRect.size.height, GL_RGBA, GL_UNSIGNED_BYTE, imageData); if (self.shouldSmoothlyScaleOutput) { glGenerateMipmap(GL_TEXTURE_2D); } glBindTexture(GL_TEXTURE_2D, 0); }); if (shouldRedrawUsingCoreGraphics) { free(imageData); } else { CFRelease(dataFromImageDataProvider); } } @end ================================================ FILE: framework/Source/iOS/GPUImagePicture.h ================================================ #import #import "GPUImageOutput.h" @interface GPUImagePicture : GPUImageOutput { CGSize pixelSizeOfImage; BOOL hasProcessedImage; dispatch_semaphore_t imageUpdateSemaphore; } // Initialization and teardown - (id)initWithURL:(NSURL *)url; - (id)initWithImage:(UIImage *)newImageSource; - (id)initWithCGImage:(CGImageRef)newImageSource; - (id)initWithImage:(UIImage *)newImageSource smoothlyScaleOutput:(BOOL)smoothlyScaleOutput; - (id)initWithCGImage:(CGImageRef)newImageSource smoothlyScaleOutput:(BOOL)smoothlyScaleOutput; - (id)initWithImage:(UIImage *)newImageSource removePremultiplication:(BOOL)removePremultiplication; - (id)initWithCGImage:(CGImageRef)newImageSource removePremultiplication:(BOOL)removePremultiplication; - (id)initWithImage:(UIImage *)newImageSource smoothlyScaleOutput:(BOOL)smoothlyScaleOutput removePremultiplication:(BOOL)removePremultiplication; - (id)initWithCGImage:(CGImageRef)newImageSource smoothlyScaleOutput:(BOOL)smoothlyScaleOutput removePremultiplication:(BOOL)removePremultiplication; // Image rendering - (void)processImage; - (CGSize)outputImageSize; /** * Process image with all targets and filters asynchronously * The completion handler is called after processing finished in the * GPU's dispatch queue - and only if this method did not return NO. * * @returns NO if resource is blocked and processing is discarded, YES otherwise */ - (BOOL)processImageWithCompletionHandler:(void (^)(void))completion; - (void)processImageUpToFilter:(GPUImageOutput *)finalFilterInChain withCompletionHandler:(void (^)(UIImage *processedImage))block; @end ================================================ FILE: framework/Source/iOS/GPUImagePicture.m ================================================ #import "GPUImagePicture.h" @implementation GPUImagePicture #pragma mark - #pragma mark Initialization and teardown - (id)initWithURL:(NSURL *)url; { NSData *imageData = [[NSData alloc] initWithContentsOfURL:url]; if (!(self = [self initWithData:imageData])) { return nil; } return self; } - (id)initWithData:(NSData *)imageData; { UIImage *inputImage = [[UIImage alloc] initWithData:imageData]; if (!(self = [self initWithImage:inputImage])) { return nil; } return self; } - (id)initWithImage:(UIImage *)newImageSource; { if (!(self = [self initWithImage:newImageSource smoothlyScaleOutput:NO])) { return nil; } return self; } - (id)initWithCGImage:(CGImageRef)newImageSource; { if (!(self = [self initWithCGImage:newImageSource smoothlyScaleOutput:NO])) { return nil; } return self; } - (id)initWithImage:(UIImage *)newImageSource smoothlyScaleOutput:(BOOL)smoothlyScaleOutput; { return [self initWithCGImage:[newImageSource CGImage] smoothlyScaleOutput:smoothlyScaleOutput]; } - (id)initWithCGImage:(CGImageRef)newImageSource smoothlyScaleOutput:(BOOL)smoothlyScaleOutput; { return [self initWithCGImage:newImageSource smoothlyScaleOutput:smoothlyScaleOutput removePremultiplication:NO]; } - (id)initWithImage:(UIImage *)newImageSource removePremultiplication:(BOOL)removePremultiplication; { return [self initWithCGImage:[newImageSource CGImage] smoothlyScaleOutput:NO removePremultiplication:removePremultiplication]; } - (id)initWithCGImage:(CGImageRef)newImageSource removePremultiplication:(BOOL)removePremultiplication; { return [self initWithCGImage:newImageSource smoothlyScaleOutput:NO removePremultiplication:removePremultiplication]; } - (id)initWithImage:(UIImage *)newImageSource smoothlyScaleOutput:(BOOL)smoothlyScaleOutput removePremultiplication:(BOOL)removePremultiplication; { return [self initWithCGImage:[newImageSource CGImage] smoothlyScaleOutput:smoothlyScaleOutput removePremultiplication:removePremultiplication]; } - (id)initWithCGImage:(CGImageRef)newImageSource smoothlyScaleOutput:(BOOL)smoothlyScaleOutput removePremultiplication:(BOOL)removePremultiplication; { if (!(self = [super init])) { return nil; } hasProcessedImage = NO; self.shouldSmoothlyScaleOutput = smoothlyScaleOutput; imageUpdateSemaphore = dispatch_semaphore_create(0); dispatch_semaphore_signal(imageUpdateSemaphore); // TODO: Dispatch this whole thing asynchronously to move image loading off main thread CGFloat widthOfImage = CGImageGetWidth(newImageSource); CGFloat heightOfImage = CGImageGetHeight(newImageSource); // If passed an empty image reference, CGContextDrawImage will fail in future versions of the SDK. NSAssert( widthOfImage > 0 && heightOfImage > 0, @"Passed image must not be empty - it should be at least 1px tall and wide"); pixelSizeOfImage = CGSizeMake(widthOfImage, heightOfImage); CGSize pixelSizeToUseForTexture = pixelSizeOfImage; BOOL shouldRedrawUsingCoreGraphics = NO; // For now, deal with images larger than the maximum texture size by resizing to be within that limit CGSize scaledImageSizeToFitOnGPU = [GPUImageContext sizeThatFitsWithinATextureForSize:pixelSizeOfImage]; if (!CGSizeEqualToSize(scaledImageSizeToFitOnGPU, pixelSizeOfImage)) { pixelSizeOfImage = scaledImageSizeToFitOnGPU; pixelSizeToUseForTexture = pixelSizeOfImage; shouldRedrawUsingCoreGraphics = YES; } if (self.shouldSmoothlyScaleOutput) { // In order to use mipmaps, you need to provide power-of-two textures, so convert to the next largest power of two and stretch to fill CGFloat powerClosestToWidth = ceil(log2(pixelSizeOfImage.width)); CGFloat powerClosestToHeight = ceil(log2(pixelSizeOfImage.height)); pixelSizeToUseForTexture = CGSizeMake(pow(2.0, powerClosestToWidth), pow(2.0, powerClosestToHeight)); shouldRedrawUsingCoreGraphics = YES; } GLubyte *imageData = NULL; CFDataRef dataFromImageDataProvider = NULL; GLenum format = GL_BGRA; BOOL isLitteEndian = YES; BOOL alphaFirst = NO; BOOL premultiplied = NO; if (!shouldRedrawUsingCoreGraphics) { /* Check that the memory layout is compatible with GL, as we cannot use glPixelStore to * tell GL about the memory layout with GLES. */ if (CGImageGetBytesPerRow(newImageSource) != CGImageGetWidth(newImageSource) * 4 || CGImageGetBitsPerPixel(newImageSource) != 32 || CGImageGetBitsPerComponent(newImageSource) != 8) { shouldRedrawUsingCoreGraphics = YES; } else { /* Check that the bitmap pixel format is compatible with GL */ CGBitmapInfo bitmapInfo = CGImageGetBitmapInfo(newImageSource); if ((bitmapInfo & kCGBitmapFloatComponents) != 0) { /* We don't support float components for use directly in GL */ shouldRedrawUsingCoreGraphics = YES; } else { CGBitmapInfo byteOrderInfo = bitmapInfo & kCGBitmapByteOrderMask; if (byteOrderInfo == kCGBitmapByteOrder32Little) { /* Little endian, for alpha-first we can use this bitmap directly in GL */ CGImageAlphaInfo alphaInfo = bitmapInfo & kCGBitmapAlphaInfoMask; if (alphaInfo != kCGImageAlphaPremultipliedFirst && alphaInfo != kCGImageAlphaFirst && alphaInfo != kCGImageAlphaNoneSkipFirst) { shouldRedrawUsingCoreGraphics = YES; } } else if (byteOrderInfo == kCGBitmapByteOrderDefault || byteOrderInfo == kCGBitmapByteOrder32Big) { isLitteEndian = NO; /* Big endian, for alpha-last we can use this bitmap directly in GL */ CGImageAlphaInfo alphaInfo = bitmapInfo & kCGBitmapAlphaInfoMask; if (alphaInfo != kCGImageAlphaPremultipliedLast && alphaInfo != kCGImageAlphaLast && alphaInfo != kCGImageAlphaNoneSkipLast) { shouldRedrawUsingCoreGraphics = YES; } else { /* Can access directly using GL_RGBA pixel format */ premultiplied = alphaInfo == kCGImageAlphaPremultipliedLast || alphaInfo == kCGImageAlphaPremultipliedLast; alphaFirst = alphaInfo == kCGImageAlphaFirst || alphaInfo == kCGImageAlphaPremultipliedFirst; format = GL_RGBA; } } } } } // CFAbsoluteTime elapsedTime, startTime = CFAbsoluteTimeGetCurrent(); if (shouldRedrawUsingCoreGraphics) { // For resized or incompatible image: redraw imageData = (GLubyte *) calloc(1, (int)pixelSizeToUseForTexture.width * (int)pixelSizeToUseForTexture.height * 4); CGColorSpaceRef genericRGBColorspace = CGColorSpaceCreateDeviceRGB(); CGContextRef imageContext = CGBitmapContextCreate(imageData, (size_t)pixelSizeToUseForTexture.width, (size_t)pixelSizeToUseForTexture.height, 8, (size_t)pixelSizeToUseForTexture.width * 4, genericRGBColorspace, kCGBitmapByteOrder32Little | kCGImageAlphaPremultipliedFirst); // CGContextSetBlendMode(imageContext, kCGBlendModeCopy); // From Technical Q&A QA1708: http://developer.apple.com/library/ios/#qa/qa1708/_index.html CGContextDrawImage(imageContext, CGRectMake(0.0, 0.0, pixelSizeToUseForTexture.width, pixelSizeToUseForTexture.height), newImageSource); CGContextRelease(imageContext); CGColorSpaceRelease(genericRGBColorspace); isLitteEndian = YES; alphaFirst = YES; premultiplied = YES; } else { // Access the raw image bytes directly dataFromImageDataProvider = CGDataProviderCopyData(CGImageGetDataProvider(newImageSource)); imageData = (GLubyte *)CFDataGetBytePtr(dataFromImageDataProvider); } if (removePremultiplication && premultiplied) { NSUInteger totalNumberOfPixels = round(pixelSizeToUseForTexture.width * pixelSizeToUseForTexture.height); uint32_t *pixelP = (uint32_t *)imageData; uint32_t pixel; CGFloat srcR, srcG, srcB, srcA; for (NSUInteger idx=0; idx> 24) / 255.0f; } else { srcA = (CGFloat)(pixel & 0x000000ff) / 255.0f; pixel >>= 8; } srcR = (CGFloat)((pixel & 0x00ff0000) >> 16) / 255.0f; srcG = (CGFloat)((pixel & 0x0000ff00) >> 8) / 255.0f; srcB = (CGFloat)(pixel & 0x000000ff) / 255.0f; srcR /= srcA; srcG /= srcA; srcB /= srcA; pixel = (uint32_t)(srcR * 255.0) << 16; pixel |= (uint32_t)(srcG * 255.0) << 8; pixel |= (uint32_t)(srcB * 255.0); if (alphaFirst) { pixel |= (uint32_t)(srcA * 255.0) << 24; } else { pixel <<= 8; pixel |= (uint32_t)(srcA * 255.0); } *pixelP = isLitteEndian ? CFSwapInt32HostToLittle(pixel) : CFSwapInt32HostToBig(pixel); } } // elapsedTime = (CFAbsoluteTimeGetCurrent() - startTime) * 1000.0; // NSLog(@"Core Graphics drawing time: %f", elapsedTime); // CGFloat currentRedTotal = 0.0f, currentGreenTotal = 0.0f, currentBlueTotal = 0.0f, currentAlphaTotal = 0.0f; // NSUInteger totalNumberOfPixels = round(pixelSizeToUseForTexture.width * pixelSizeToUseForTexture.height); // // for (NSUInteger currentPixel = 0; currentPixel < totalNumberOfPixels; currentPixel++) // { // currentBlueTotal += (CGFloat)imageData[(currentPixel * 4)] / 255.0f; // currentGreenTotal += (CGFloat)imageData[(currentPixel * 4) + 1] / 255.0f; // currentRedTotal += (CGFloat)imageData[(currentPixel * 4 + 2)] / 255.0f; // currentAlphaTotal += (CGFloat)imageData[(currentPixel * 4) + 3] / 255.0f; // } // // NSLog(@"Debug, average input image red: %f, green: %f, blue: %f, alpha: %f", currentRedTotal / (CGFloat)totalNumberOfPixels, currentGreenTotal / (CGFloat)totalNumberOfPixels, currentBlueTotal / (CGFloat)totalNumberOfPixels, currentAlphaTotal / (CGFloat)totalNumberOfPixels); runSynchronouslyOnVideoProcessingQueue(^{ [GPUImageContext useImageProcessingContext]; outputFramebuffer = [[GPUImageContext sharedFramebufferCache] fetchFramebufferForSize:pixelSizeToUseForTexture onlyTexture:YES]; [outputFramebuffer disableReferenceCounting]; glBindTexture(GL_TEXTURE_2D, [outputFramebuffer texture]); if (self.shouldSmoothlyScaleOutput) { glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); } // no need to use self.outputTextureOptions here since pictures need this texture formats and type glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, (int)pixelSizeToUseForTexture.width, (int)pixelSizeToUseForTexture.height, 0, format, GL_UNSIGNED_BYTE, imageData); if (self.shouldSmoothlyScaleOutput) { glGenerateMipmap(GL_TEXTURE_2D); } glBindTexture(GL_TEXTURE_2D, 0); }); if (shouldRedrawUsingCoreGraphics) { free(imageData); } else { if (dataFromImageDataProvider) { CFRelease(dataFromImageDataProvider); } } return self; } // ARC forbids explicit message send of 'release'; since iOS 6 even for dispatch_release() calls: stripping it out in that case is required. - (void)dealloc; { [outputFramebuffer enableReferenceCounting]; [outputFramebuffer unlock]; #if !OS_OBJECT_USE_OBJC if (imageUpdateSemaphore != NULL) { dispatch_release(imageUpdateSemaphore); } #endif } #pragma mark - #pragma mark Image rendering - (void)removeAllTargets; { [super removeAllTargets]; hasProcessedImage = NO; } - (void)processImage; { [self processImageWithCompletionHandler:nil]; } - (BOOL)processImageWithCompletionHandler:(void (^)(void))completion; { hasProcessedImage = YES; // dispatch_semaphore_wait(imageUpdateSemaphore, DISPATCH_TIME_FOREVER); if (dispatch_semaphore_wait(imageUpdateSemaphore, DISPATCH_TIME_NOW) != 0) { return NO; } runAsynchronouslyOnVideoProcessingQueue(^{ for (id currentTarget in targets) { NSInteger indexOfObject = [targets indexOfObject:currentTarget]; NSInteger textureIndexOfTarget = [[targetTextureIndices objectAtIndex:indexOfObject] integerValue]; [currentTarget setCurrentlyReceivingMonochromeInput:NO]; [currentTarget setInputSize:pixelSizeOfImage atIndex:textureIndexOfTarget]; [currentTarget setInputFramebuffer:outputFramebuffer atIndex:textureIndexOfTarget]; [currentTarget newFrameReadyAtTime:kCMTimeIndefinite atIndex:textureIndexOfTarget]; } dispatch_semaphore_signal(imageUpdateSemaphore); if (completion != nil) { completion(); } }); return YES; } - (void)processImageUpToFilter:(GPUImageOutput *)finalFilterInChain withCompletionHandler:(void (^)(UIImage *processedImage))block; { [finalFilterInChain useNextFrameForImageCapture]; [self processImageWithCompletionHandler:^{ UIImage *imageFromFilter = [finalFilterInChain imageFromCurrentFramebuffer]; block(imageFromFilter); }]; } - (CGSize)outputImageSize; { return pixelSizeOfImage; } - (void)addTarget:(id)newTarget atTextureLocation:(NSInteger)textureLocation; { [super addTarget:newTarget atTextureLocation:textureLocation]; if (hasProcessedImage) { [newTarget setInputSize:pixelSizeOfImage atIndex:textureLocation]; [newTarget newFrameReadyAtTime:kCMTimeIndefinite atIndex:textureLocation]; } } @end ================================================ FILE: framework/Source/iOS/GPUImageView.h ================================================ #import #import "GPUImageContext.h" typedef NS_ENUM(NSUInteger, GPUImageFillModeType) { kGPUImageFillModeStretch, // Stretch to fill the full view, which may distort the image outside of its normal aspect ratio kGPUImageFillModePreserveAspectRatio, // Maintains the aspect ratio of the source image, adding bars of the specified background color kGPUImageFillModePreserveAspectRatioAndFill // Maintains the aspect ratio of the source image, zooming in on its center to fill the view }; /** UIView subclass to use as an endpoint for displaying GPUImage outputs */ @interface GPUImageView : UIView { GPUImageRotationMode inputRotation; } /** The fill mode dictates how images are fit in the view, with the default being kGPUImageFillModePreserveAspectRatio */ @property(readwrite, nonatomic) GPUImageFillModeType fillMode; /** This calculates the current display size, in pixels, taking into account Retina scaling factors */ @property(readonly, nonatomic) CGSize sizeInPixels; @property(nonatomic) BOOL enabled; /** Handling fill mode @param redComponent Red component for background color @param greenComponent Green component for background color @param blueComponent Blue component for background color @param alphaComponent Alpha component for background color */ - (void)setBackgroundColorRed:(GLfloat)redComponent green:(GLfloat)greenComponent blue:(GLfloat)blueComponent alpha:(GLfloat)alphaComponent; - (void)setCurrentlyReceivingMonochromeInput:(BOOL)newValue; @end ================================================ FILE: framework/Source/iOS/GPUImageView.m ================================================ #import "GPUImageView.h" #import #import #import "GPUImageContext.h" #import "GPUImageFilter.h" #import #pragma mark - #pragma mark Private methods and instance variables @interface GPUImageView () { GPUImageFramebuffer *inputFramebufferForDisplay; GLuint displayRenderbuffer, displayFramebuffer; GLProgram *displayProgram; GLint displayPositionAttribute, displayTextureCoordinateAttribute; GLint displayInputTextureUniform; CGSize inputImageSize; GLfloat imageVertices[8]; GLfloat backgroundColorRed, backgroundColorGreen, backgroundColorBlue, backgroundColorAlpha; CGSize boundsSizeAtFrameBufferEpoch; } @property (assign, nonatomic) NSUInteger aspectRatio; // Initialization and teardown - (void)commonInit; // Managing the display FBOs - (void)createDisplayFramebuffer; - (void)destroyDisplayFramebuffer; // Handling fill mode - (void)recalculateViewGeometry; @end @implementation GPUImageView @synthesize aspectRatio; @synthesize sizeInPixels = _sizeInPixels; @synthesize fillMode = _fillMode; @synthesize enabled; #pragma mark - #pragma mark Initialization and teardown + (Class)layerClass { return [CAEAGLLayer class]; } - (id)initWithFrame:(CGRect)frame { if (!(self = [super initWithFrame:frame])) { return nil; } [self commonInit]; return self; } -(id)initWithCoder:(NSCoder *)coder { if (!(self = [super initWithCoder:coder])) { return nil; } [self commonInit]; return self; } - (void)commonInit; { // Set scaling to account for Retina display if ([self respondsToSelector:@selector(setContentScaleFactor:)]) { self.contentScaleFactor = [[UIScreen mainScreen] scale]; } inputRotation = kGPUImageNoRotation; self.opaque = YES; self.hidden = NO; CAEAGLLayer *eaglLayer = (CAEAGLLayer *)self.layer; eaglLayer.opaque = YES; eaglLayer.drawableProperties = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:NO], kEAGLDrawablePropertyRetainedBacking, kEAGLColorFormatRGBA8, kEAGLDrawablePropertyColorFormat, nil]; self.enabled = YES; runSynchronouslyOnVideoProcessingQueue(^{ [GPUImageContext useImageProcessingContext]; displayProgram = [[GPUImageContext sharedImageProcessingContext] programForVertexShaderString:kGPUImageVertexShaderString fragmentShaderString:kGPUImagePassthroughFragmentShaderString]; if (!displayProgram.initialized) { [displayProgram addAttribute:@"position"]; [displayProgram addAttribute:@"inputTextureCoordinate"]; if (![displayProgram link]) { NSString *progLog = [displayProgram programLog]; NSLog(@"Program link log: %@", progLog); NSString *fragLog = [displayProgram fragmentShaderLog]; NSLog(@"Fragment shader compile log: %@", fragLog); NSString *vertLog = [displayProgram vertexShaderLog]; NSLog(@"Vertex shader compile log: %@", vertLog); displayProgram = nil; NSAssert(NO, @"Filter shader link failed"); } } displayPositionAttribute = [displayProgram attributeIndex:@"position"]; displayTextureCoordinateAttribute = [displayProgram attributeIndex:@"inputTextureCoordinate"]; displayInputTextureUniform = [displayProgram uniformIndex:@"inputImageTexture"]; // This does assume a name of "inputTexture" for the fragment shader [GPUImageContext setActiveShaderProgram:displayProgram]; glEnableVertexAttribArray(displayPositionAttribute); glEnableVertexAttribArray(displayTextureCoordinateAttribute); [self setBackgroundColorRed:0.0 green:0.0 blue:0.0 alpha:1.0]; _fillMode = kGPUImageFillModePreserveAspectRatio; [self createDisplayFramebuffer]; }); } - (void)layoutSubviews { [super layoutSubviews]; // The frame buffer needs to be trashed and re-created when the view size changes. if (!CGSizeEqualToSize(self.bounds.size, boundsSizeAtFrameBufferEpoch) && !CGSizeEqualToSize(self.bounds.size, CGSizeZero)) { runSynchronouslyOnVideoProcessingQueue(^{ [self destroyDisplayFramebuffer]; [self createDisplayFramebuffer]; }); } else if (!CGSizeEqualToSize(self.bounds.size, CGSizeZero)) { [self recalculateViewGeometry]; } } - (void)dealloc { runSynchronouslyOnVideoProcessingQueue(^{ [self destroyDisplayFramebuffer]; }); } #pragma mark - #pragma mark Managing the display FBOs - (void)createDisplayFramebuffer; { [GPUImageContext useImageProcessingContext]; glGenFramebuffers(1, &displayFramebuffer); glBindFramebuffer(GL_FRAMEBUFFER, displayFramebuffer); glGenRenderbuffers(1, &displayRenderbuffer); glBindRenderbuffer(GL_RENDERBUFFER, displayRenderbuffer); [[[GPUImageContext sharedImageProcessingContext] context] renderbufferStorage:GL_RENDERBUFFER fromDrawable:(CAEAGLLayer*)self.layer]; GLint backingWidth, backingHeight; glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, &backingWidth); glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_HEIGHT, &backingHeight); if ( (backingWidth == 0) || (backingHeight == 0) ) { [self destroyDisplayFramebuffer]; return; } _sizeInPixels.width = (CGFloat)backingWidth; _sizeInPixels.height = (CGFloat)backingHeight; // NSLog(@"Backing width: %d, height: %d", backingWidth, backingHeight); glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, displayRenderbuffer); __unused GLuint framebufferCreationStatus = glCheckFramebufferStatus(GL_FRAMEBUFFER); NSAssert(framebufferCreationStatus == GL_FRAMEBUFFER_COMPLETE, @"Failure with display framebuffer generation for display of size: %f, %f", self.bounds.size.width, self.bounds.size.height); boundsSizeAtFrameBufferEpoch = self.bounds.size; [self recalculateViewGeometry]; } - (void)destroyDisplayFramebuffer; { [GPUImageContext useImageProcessingContext]; if (displayFramebuffer) { glDeleteFramebuffers(1, &displayFramebuffer); displayFramebuffer = 0; } if (displayRenderbuffer) { glDeleteRenderbuffers(1, &displayRenderbuffer); displayRenderbuffer = 0; } } - (void)setDisplayFramebuffer; { if (!displayFramebuffer) { [self createDisplayFramebuffer]; } glBindFramebuffer(GL_FRAMEBUFFER, displayFramebuffer); glViewport(0, 0, (GLint)_sizeInPixels.width, (GLint)_sizeInPixels.height); } - (void)presentFramebuffer; { glBindRenderbuffer(GL_RENDERBUFFER, displayRenderbuffer); [[GPUImageContext sharedImageProcessingContext] presentBufferForDisplay]; } #pragma mark - #pragma mark Handling fill mode - (void)recalculateViewGeometry; { runSynchronouslyOnVideoProcessingQueue(^{ CGFloat heightScaling, widthScaling; CGSize currentViewSize = self.bounds.size; // CGFloat imageAspectRatio = inputImageSize.width / inputImageSize.height; // CGFloat viewAspectRatio = currentViewSize.width / currentViewSize.height; CGRect insetRect = AVMakeRectWithAspectRatioInsideRect(inputImageSize, self.bounds); switch(_fillMode) { case kGPUImageFillModeStretch: { widthScaling = 1.0; heightScaling = 1.0; }; break; case kGPUImageFillModePreserveAspectRatio: { widthScaling = insetRect.size.width / currentViewSize.width; heightScaling = insetRect.size.height / currentViewSize.height; }; break; case kGPUImageFillModePreserveAspectRatioAndFill: { // CGFloat widthHolder = insetRect.size.width / currentViewSize.width; widthScaling = currentViewSize.height / insetRect.size.height; heightScaling = currentViewSize.width / insetRect.size.width; }; break; } imageVertices[0] = -widthScaling; imageVertices[1] = -heightScaling; imageVertices[2] = widthScaling; imageVertices[3] = -heightScaling; imageVertices[4] = -widthScaling; imageVertices[5] = heightScaling; imageVertices[6] = widthScaling; imageVertices[7] = heightScaling; }); // static const GLfloat imageVertices[] = { // -1.0f, -1.0f, // 1.0f, -1.0f, // -1.0f, 1.0f, // 1.0f, 1.0f, // }; } - (void)setBackgroundColorRed:(GLfloat)redComponent green:(GLfloat)greenComponent blue:(GLfloat)blueComponent alpha:(GLfloat)alphaComponent; { backgroundColorRed = redComponent; backgroundColorGreen = greenComponent; backgroundColorBlue = blueComponent; backgroundColorAlpha = alphaComponent; } + (const GLfloat *)textureCoordinatesForRotation:(GPUImageRotationMode)rotationMode; { // static const GLfloat noRotationTextureCoordinates[] = { // 0.0f, 0.0f, // 1.0f, 0.0f, // 0.0f, 1.0f, // 1.0f, 1.0f, // }; static const GLfloat noRotationTextureCoordinates[] = { 0.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, }; static const GLfloat rotateRightTextureCoordinates[] = { 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, }; static const GLfloat rotateLeftTextureCoordinates[] = { 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f, 1.0f, }; static const GLfloat verticalFlipTextureCoordinates[] = { 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, }; static const GLfloat horizontalFlipTextureCoordinates[] = { 1.0f, 1.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, }; static const GLfloat rotateRightVerticalFlipTextureCoordinates[] = { 1.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f, }; static const GLfloat rotateRightHorizontalFlipTextureCoordinates[] = { 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, 0.0f, }; static const GLfloat rotate180TextureCoordinates[] = { 1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f, }; switch(rotationMode) { case kGPUImageNoRotation: return noRotationTextureCoordinates; case kGPUImageRotateLeft: return rotateLeftTextureCoordinates; case kGPUImageRotateRight: return rotateRightTextureCoordinates; case kGPUImageFlipVertical: return verticalFlipTextureCoordinates; case kGPUImageFlipHorizonal: return horizontalFlipTextureCoordinates; case kGPUImageRotateRightFlipVertical: return rotateRightVerticalFlipTextureCoordinates; case kGPUImageRotateRightFlipHorizontal: return rotateRightHorizontalFlipTextureCoordinates; case kGPUImageRotate180: return rotate180TextureCoordinates; } } #pragma mark - #pragma mark GPUInput protocol - (void)newFrameReadyAtTime:(CMTime)frameTime atIndex:(NSInteger)textureIndex; { runSynchronouslyOnVideoProcessingQueue(^{ [GPUImageContext setActiveShaderProgram:displayProgram]; [self setDisplayFramebuffer]; glClearColor(backgroundColorRed, backgroundColorGreen, backgroundColorBlue, backgroundColorAlpha); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glActiveTexture(GL_TEXTURE4); glBindTexture(GL_TEXTURE_2D, [inputFramebufferForDisplay texture]); glUniform1i(displayInputTextureUniform, 4); glVertexAttribPointer(displayPositionAttribute, 2, GL_FLOAT, 0, 0, imageVertices); glVertexAttribPointer(displayTextureCoordinateAttribute, 2, GL_FLOAT, 0, 0, [GPUImageView textureCoordinatesForRotation:inputRotation]); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); [self presentFramebuffer]; [inputFramebufferForDisplay unlock]; inputFramebufferForDisplay = nil; }); } - (NSInteger)nextAvailableTextureIndex; { return 0; } - (void)setInputFramebuffer:(GPUImageFramebuffer *)newInputFramebuffer atIndex:(NSInteger)textureIndex; { inputFramebufferForDisplay = newInputFramebuffer; [inputFramebufferForDisplay lock]; } - (void)setInputRotation:(GPUImageRotationMode)newInputRotation atIndex:(NSInteger)textureIndex; { inputRotation = newInputRotation; } - (void)setInputSize:(CGSize)newSize atIndex:(NSInteger)textureIndex; { runSynchronouslyOnVideoProcessingQueue(^{ CGSize rotatedSize = newSize; if (GPUImageRotationSwapsWidthAndHeight(inputRotation)) { rotatedSize.width = newSize.height; rotatedSize.height = newSize.width; } if (!CGSizeEqualToSize(inputImageSize, rotatedSize)) { inputImageSize = rotatedSize; [self recalculateViewGeometry]; } }); } - (CGSize)maximumOutputSize; { if ([self respondsToSelector:@selector(setContentScaleFactor:)]) { CGSize pointSize = self.bounds.size; return CGSizeMake(self.contentScaleFactor * pointSize.width, self.contentScaleFactor * pointSize.height); } else { return self.bounds.size; } } - (void)endProcessing { } - (BOOL)shouldIgnoreUpdatesToThisTarget; { return NO; } - (BOOL)wantsMonochromeInput; { return NO; } - (void)setCurrentlyReceivingMonochromeInput:(BOOL)newValue; { } #pragma mark - #pragma mark Accessors - (CGSize)sizeInPixels; { if (CGSizeEqualToSize(_sizeInPixels, CGSizeZero)) { return [self maximumOutputSize]; } else { return _sizeInPixels; } } - (void)setFillMode:(GPUImageFillModeType)newValue; { _fillMode = newValue; [self recalculateViewGeometry]; } @end