├── .gitattributes ├── .gitignore ├── LICENSE ├── MagicCamera.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ ├── WorkspaceSettings.xcsettings │ │ └── swiftpm │ │ └── Package.resolved └── xcshareddata │ └── xcschemes │ └── MagicCamera.xcscheme ├── MagicCamera.xcworkspace ├── contents.xcworkspacedata └── xcuserdata │ └── william.xcuserdatad │ └── UserInterfaceState.xcuserstate ├── MagicCamera ├── AppDelegate.swift ├── Assets.xcassets │ ├── AccentColor.colorset │ │ └── Contents.json │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── icon-1024.png │ │ ├── icon-20-ipad.png │ │ ├── icon-20@2x-ipad.png │ │ ├── icon-20@2x.png │ │ ├── icon-20@3x.png │ │ ├── icon-29-ipad.png │ │ ├── icon-29.png │ │ ├── icon-29@2x-ipad.png │ │ ├── icon-29@2x.png │ │ ├── icon-29@3x.png │ │ ├── icon-40.png │ │ ├── icon-40@2x.png │ │ ├── icon-40@3x.png │ │ ├── icon-60@2x.png │ │ ├── icon-60@3x.png │ │ ├── icon-76.png │ │ ├── icon-76@2x.png │ │ └── icon-83.5@2x.png │ └── Contents.json ├── Base.lproj │ └── LaunchScreen.storyboard ├── Cameras │ ├── ArtCameraView.swift │ ├── ArtImageView.swift │ ├── BeautyCameraView.swift │ ├── BeautyImageView.swift │ ├── CartoonCameraView.swift │ ├── CartoonImageView.swift │ ├── ImageSaveView.swift │ ├── Introspect │ │ ├── AppKitIntrospectionView.swift │ │ ├── Introspect.h │ │ ├── Introspect.swift │ │ ├── UIKitIntrospectionView.swift │ │ ├── UIKitIntrospectionViewController.swift │ │ └── ViewExtensions.swift │ ├── ScrollViewProxy.swift │ ├── StyleCameraView.swift │ ├── StyleImageView.swift │ ├── SwiftUICustomView.swift │ ├── VideoPlayer.swift │ └── VideoView.swift ├── ContentView.swift ├── FilterAssets.bundle │ ├── 1977map.png │ ├── Glacial1.png │ ├── Glacial2.png │ ├── Lansdowne1.png │ ├── Lansdowne2.png │ ├── XPro2Border.png │ ├── aden_map.png │ ├── amaroBorder.png │ ├── amaroMap.png │ ├── blackOverlayMap.png │ ├── blackboard.png │ ├── bleach_reduction_curves1.png │ ├── bleach_reduction_lgg.png │ ├── borderTexture.png │ ├── brannanBlowout.png │ ├── brannanBorder.png │ ├── brannanContrast.png │ ├── brannanLuma.png │ ├── brannanProcess.png │ ├── brannanScreen.png │ ├── brightcontrast_map.png │ ├── bw_vintage_curves1.png │ ├── bw_vintage_curves2.png │ ├── chic_curves1.png │ ├── chic_curves2.png │ ├── classy_look_levels2.png │ ├── classy_look_tonemap1.png │ ├── clut_blue.png │ ├── clut_bw.png │ ├── clut_cinema_blue.png │ ├── clut_cinema_green.png │ ├── clut_cinema_red.png │ ├── clut_clear.png │ ├── clut_instant.png │ ├── clut_pastel_pink.png │ ├── clut_pastel_sky.png │ ├── clut_vintage.png │ ├── clut_yellow.png │ ├── crazycolor_map.png │ ├── crazycolor_overlay.png │ ├── crema_map.png │ ├── crossprotwo_curves.png │ ├── earlyBirdCurves.png │ ├── earlybirdBlowout.png │ ├── earlybirdBorder.png │ ├── earlybirdMap.png │ ├── earlybirdOverlayMap.png │ ├── edgeBurn.pvr │ ├── epic_1.png │ ├── epic_2.png │ ├── filterBorderPlainWhite.png │ ├── glowField.png │ ├── hefeBorder.png │ ├── hefeGradientMap.png │ ├── hefeMap.png │ ├── hefeMetal.pvr │ ├── hefeSoftLight.png │ ├── hudsonBackground.pvr │ ├── hudsonBorder.png │ ├── hudsonMap.png │ ├── inkwellMap.png │ ├── juno_map.png │ ├── kelvinBorder.png │ ├── kelvinMap.png │ ├── lark_map.png │ ├── lomoBorder.png │ ├── lomoMap.png │ ├── ludwig_map.png │ ├── luster_map.png │ ├── mayfairBorder.png │ ├── mayfairColorGradient.png │ ├── mayfairColorOverlay.png │ ├── mayfairGlowField.png │ ├── mayfairOverlayMap100.png │ ├── metalTexture2.pvr │ ├── midtones_curve.png │ ├── nashvilleBorder.png │ ├── nashvilleMap.png │ ├── overlayMap.png │ ├── overlayMap81.png │ ├── perpetua_map.png │ ├── perpetua_overlay.png │ ├── plusDarker.png │ ├── reyes_map.png │ ├── riseBorder.png │ ├── riseMap.png │ ├── screen30.png │ ├── seventies_curves.png │ ├── sierraBorder.png │ ├── sierraMap.png │ ├── sierraSmoke.png │ ├── sierraVignette.png │ ├── slumber_map.png │ ├── softLight.png │ ├── softLight100.png │ ├── subtlecolor_map.png │ ├── super_film_stock_curves.png │ ├── sutroBorder.png │ ├── sutroCurves.png │ ├── sutroEdgeBurn.pvr │ ├── sutroMap.png │ ├── sutroMetal.pvr │ ├── toasterColorShift.png │ ├── toasterCurves.png │ ├── toasterOverlayMapWarm.png │ ├── toasterSoftLight.png │ ├── valenciaGradientMap.png │ ├── valenciaMap.png │ ├── vignetteMap.png │ ├── vintage_signature_curves1.png │ ├── vintage_signature_lgg_curves.png │ ├── vogue_map.png │ ├── waldenBorder.png │ ├── waldenMap.png │ ├── willowBorder.png │ ├── willowMap.png │ ├── willowSoftLight100.png │ ├── willowVignette.png │ └── xproMap.png ├── Home │ ├── HeaderView.swift │ ├── HomeViewArt.swift │ ├── HomeViewCarttoon.swift │ ├── HomeViewStyle.swift │ └── SwiftPopupView.swift ├── HomeView.swift ├── Info.plist ├── InfoPlist.strings ├── LanchScreenView.swift ├── MagicCamera-Bridging-Header.h ├── Main.storyboard ├── Newwork │ ├── Alamofire+Sync.swift │ └── Network.swift ├── PostData.swift ├── Preview Content │ └── Preview Assets.xcassets │ │ └── Contents.json ├── SceneDelegate.swift ├── SlidingTabView.swift ├── SwiftPaid │ ├── BlurView.swift │ ├── DefaultsKeys.swift │ ├── LoadingView.swift │ ├── ProImageView.swift │ ├── ProSelectView.swift │ ├── SelectedView.swift │ ├── ShowNowView.swift │ └── WebView.swift ├── SwiftUICam │ ├── CameraPhotoFilterVC.swift │ ├── FaceImage.swift │ ├── Filters │ │ ├── IFShaderLib.h │ │ ├── MT1977Filter.metal │ │ ├── MT1977Filter.swift │ │ ├── MTAdenFilter.metal │ │ ├── MTAdenFilter.swift │ │ ├── MTAmaroFilter.metal │ │ ├── MTAmaroFilter.swift │ │ ├── MTAshbyVideoFilter.metal │ │ ├── MTAshbyVideoFilter.swift │ │ ├── MTBrannanFilter.metal │ │ ├── MTBrannanFilter.swift │ │ ├── MTBrooklynVideoFilter.metal │ │ ├── MTBrooklynVideoFilter.swift │ │ ├── MTCharmesVideoFilter.metal │ │ ├── MTCharmesVideoFilter.swift │ │ ├── MTClarendonVideoFilter.metal │ │ ├── MTClarendonVideoFilter.swift │ │ ├── MTCremaFilter.metal │ │ ├── MTCremaFilter.swift │ │ ├── MTDogpatchVideoFilter.metal │ │ ├── MTDogpatchVideoFilter.swift │ │ ├── MTEarlybirdFilter.metal │ │ ├── MTEarlybirdFilter.swift │ │ ├── MTGinghamVideoFilter.metal │ │ ├── MTGinghamVideoFilter.swift │ │ ├── MTGinzaVideoFilter.metal │ │ ├── MTGinzaVideoFilter.swift │ │ ├── MTHefeFilter.metal │ │ ├── MTHefeFilter.swift │ │ ├── MTHelenaVideoFilter.metal │ │ ├── MTHelenaVideoFilter.swift │ │ ├── MTHudsonFilter.metal │ │ ├── MTHudsonFilter.swift │ │ ├── MTIShaderLib.h │ │ ├── MTInkwellFilter.metal │ │ ├── MTInkwellFilter.swift │ │ ├── MTJunoFilter.metal │ │ ├── MTJunoFilter.swift │ │ ├── MTKelvinFilter.metal │ │ ├── MTKelvinFilter.swift │ │ ├── MTLarkFilter.metal │ │ ├── MTLarkFilter.swift │ │ ├── MTLoFiFilter.metal │ │ ├── MTLoFiFilter.swift │ │ ├── MTLudwigFilter.metal │ │ ├── MTLudwigFilter.swift │ │ ├── MTMavenVideoFilter.metal │ │ ├── MTMavenVideoFilter.swift │ │ ├── MTMayfairFilter.metal │ │ ├── MTMayfairFilter.swift │ │ ├── MTMoonVideoFilter.metal │ │ ├── MTMoonVideoFilter.swift │ │ ├── MTNashvilleFilter.metal │ │ ├── MTNashvilleFilter.swift │ │ ├── MTNormalFilter.metal │ │ ├── MTNormalFilter.swift │ │ ├── MTPerpetuaFilter.metal │ │ ├── MTPerpetuaFilter.swift │ │ ├── MTReyesFilter.metal │ │ ├── MTReyesFilter.swift │ │ ├── MTRiseFilter.metal │ │ ├── MTRiseFilter.swift │ │ ├── MTSierraFilter.metal │ │ ├── MTSierraFilter.swift │ │ ├── MTSkylineVideoFilter.metal │ │ ├── MTSkylineVideoFilter.swift │ │ ├── MTSlumberFilter.metal │ │ ├── MTSlumberFilter.swift │ │ ├── MTStinsonVideoFilter.metal │ │ ├── MTStinsonVideoFilter.swift │ │ ├── MTSutroFilter.metal │ │ ├── MTSutroFilter.swift │ │ ├── MTToasterFilter.metal │ │ ├── MTToasterFilter.swift │ │ ├── MTValenciaFilter.metal │ │ ├── MTValenciaFilter.swift │ │ ├── MTVesperVideoFilter.metal │ │ ├── MTVesperVideoFilter.swift │ │ ├── MTWaldenFilter.metal │ │ ├── MTWaldenFilter.swift │ │ ├── MTWillowFilter.metal │ │ ├── MTWillowFilter.swift │ │ ├── MTXpro2Filter.metal │ │ └── MTXpro2Filter.swift │ ├── LiveCameraFilterView.swift │ ├── MTFilter │ │ ├── MTAntiLuxFilter.metal │ │ ├── MTAntiLuxFilter.swift │ │ ├── MTBasicAdjustFilter.metal │ │ ├── MTBasicAdjustFilter.swift │ │ ├── MTFilter.swift │ │ ├── MTFilterGroup.swift │ │ ├── MTFilterManager.swift │ │ ├── MTIShaderLib.h │ │ ├── MTImageOverlayFilter.metal │ │ ├── MTImageOverlayFilter.swift │ │ ├── MTLocalLaplacianFilter.metal │ │ ├── MTLocalLaplacianFilter.swift │ │ ├── MTLuxBlendFilter.metal │ │ ├── MTLuxBlendFilter.swift │ │ ├── MTStarlightFilter.metal │ │ ├── MTStarlightFilter.swift │ │ └── MTTintColor.swift │ ├── PhotoPickerView.swift │ ├── StyleImage.swift │ └── UserEvents.swift ├── ThridLib │ ├── GPUImage.xcodeproj │ │ ├── GPUImage_Info.plist │ │ ├── project.pbxproj │ │ └── xcuserdata │ │ │ └── william.xcuserdatad │ │ │ └── xcschemes │ │ │ └── xcschememanagement.plist │ └── Source │ │ ├── BasicOperation.swift │ │ ├── Camera.swift │ │ ├── Color.swift │ │ ├── ImageGenerator.swift │ │ ├── ImageOrientation.swift │ │ ├── Matrix.swift │ │ ├── MetalRendering.swift │ │ ├── MetalRenderingDevice.swift │ │ ├── MovieInput.swift │ │ ├── MovieOutput.swift │ │ ├── OperationGroup.swift │ │ ├── Operations │ │ ├── AdaptiveThreshold.metal │ │ ├── AdaptiveThreshold.swift │ │ ├── AddBlend.metal │ │ ├── AddBlend.swift │ │ ├── AlphaBlend.metal │ │ ├── AlphaBlend.swift │ │ ├── AmatorkaFilter.swift │ │ ├── BlendShaderTypes.h │ │ ├── BlendShaderTypes.metal │ │ ├── BoxBlur.swift │ │ ├── BrightnessAdjustment.metal │ │ ├── BrightnessAdjustment.swift │ │ ├── BulgeDistortion.metal │ │ ├── BulgeDistortion.swift │ │ ├── CGAColorspace.metal │ │ ├── CGAColorspace.swift │ │ ├── ChromaKey.metal │ │ ├── ChromaKey.swift │ │ ├── ChromaKeyBlend.metal │ │ ├── ChromaKeyBlend.swift │ │ ├── ColorBlend.metal │ │ ├── ColorBlend.swift │ │ ├── ColorBurnBlend.metal │ │ ├── ColorBurnBlend.swift │ │ ├── ColorDodgeBlend.metal │ │ ├── ColorDodgeBlend.swift │ │ ├── ColorInversion.metal │ │ ├── ColorInversion.swift │ │ ├── ColorLocalBinaryPattern.metal │ │ ├── ColorLocalBinaryPattern.swift │ │ ├── ColorMatrixFilter.metal │ │ ├── ColorMatrixFilter.swift │ │ ├── ColorSwizzle.metal │ │ ├── ColourFASTFeatureDetection.metal │ │ ├── ColourFASTFeatureDetection.swift │ │ ├── ContrastAdjustment.metal │ │ ├── ContrastAdjustment.swift │ │ ├── Convolution3x3.metal │ │ ├── Convolution3x3.swift │ │ ├── Crosshatch.metal │ │ ├── Crosshatch.swift │ │ ├── DarkenBlend.metal │ │ ├── DarkenBlend.swift │ │ ├── DifferenceBlend.metal │ │ ├── DifferenceBlend.swift │ │ ├── DissolveBlend.metal │ │ ├── DissolveBlend.swift │ │ ├── DivideBlend.metal │ │ ├── DivideBlend.swift │ │ ├── EmbossFilter.swift │ │ ├── ExclusionBlend.metal │ │ ├── ExclusionBlend.swift │ │ ├── ExposureAdjustment.metal │ │ ├── ExposureAdjustment.swift │ │ ├── FalseColor.metal │ │ ├── FalseColor.swift │ │ ├── GammaAdjustment.metal │ │ ├── GammaAdjustment.swift │ │ ├── GaussianBlur.swift │ │ ├── GlassSphere.metal │ │ ├── GlassSphere.swift │ │ ├── HalfTone.metal │ │ ├── HalfTone.swift │ │ ├── HardLightBlend.metal │ │ ├── HardLightBlend.swift │ │ ├── Haze.metal │ │ ├── Haze.swift │ │ ├── HighPassFilter.swift │ │ ├── HighlightAndShadowTint.metal │ │ ├── HighlightAndShadowTint.swift │ │ ├── HighlightsAndShadows.metal │ │ ├── HighlightsAndShadows.swift │ │ ├── HueAdjustment.metal │ │ ├── HueAdjustment.swift │ │ ├── HueBlend.metal │ │ ├── HueBlend.swift │ │ ├── ImageBuffer.swift │ │ ├── KuwaharaFilter.metal │ │ ├── KuwaharaFilter.swift │ │ ├── KuwaharaRadius3Filter.metal │ │ ├── KuwaharaRadius3Filter.swift │ │ ├── Laplacian.metal │ │ ├── Laplacian.swift │ │ ├── LevelsAdjustment.metal │ │ ├── LevelsAdjustment.swift │ │ ├── LightenBlend.metal │ │ ├── LightenBlend.swift │ │ ├── LinearBurnBlend.metal │ │ ├── LinearBurnBlend.swift │ │ ├── LocalBinaryPattern.metal │ │ ├── LocalBinaryPattern.swift │ │ ├── LookupFilter.metal │ │ ├── LookupFilter.swift │ │ ├── LookupImages │ │ │ ├── lookup.png │ │ │ ├── lookup_amatorka.png │ │ │ ├── lookup_miss_etikate.png │ │ │ ├── lookup_soft_elegance_1.png │ │ │ └── lookup_soft_elegance_2.png │ │ ├── LowPassFilter.swift │ │ ├── Luminance.metal │ │ ├── Luminance.swift │ │ ├── LuminanceRangeReduction.metal │ │ ├── LuminanceRangeReduction.swift │ │ ├── LuminanceThreshold.metal │ │ ├── LuminanceThreshold.swift │ │ ├── LuminosityBlend.metal │ │ ├── LuminosityBlend.swift │ │ ├── MedianFilter.metal │ │ ├── MedianFilter.swift │ │ ├── MissEtikateFilter.swift │ │ ├── MonochromeFilter.metal │ │ ├── MonochromeFilter.swift │ │ ├── MotionBlur.metal │ │ ├── MotionBlur.swift │ │ ├── MultiplyBlend.metal │ │ ├── MultiplyBlend.swift │ │ ├── NearbyTexelSampling.metal │ │ ├── NormalBlend.metal │ │ ├── NormalBlend.swift │ │ ├── OpacityAdjustment.metal │ │ ├── OpacityAdjustment.swift │ │ ├── OperationShaderTypes.h │ │ ├── OverlayBlend.metal │ │ ├── OverlayBlend.swift │ │ ├── Passthrough.metal │ │ ├── PinchDistortion.metal │ │ ├── PinchDistortion.swift │ │ ├── Pixellate.metal │ │ ├── Pixellate.swift │ │ ├── PolarPixellate.metal │ │ ├── PolarPixellate.swift │ │ ├── PolkaDot.metal │ │ ├── PolkaDot.swift │ │ ├── Posterize.metal │ │ ├── Posterize.swift │ │ ├── PrewittEdgeDetection.metal │ │ ├── PrewittEdgeDetection.swift │ │ ├── RGBAdjustment.metal │ │ ├── RGBAdjustment.swift │ │ ├── SaturationAdjustment.metal │ │ ├── SaturationAdjustment.swift │ │ ├── SaturationBlend.metal │ │ ├── SaturationBlend.swift │ │ ├── ScreenBlend.metal │ │ ├── ScreenBlend.swift │ │ ├── SepiaToneFilter.swift │ │ ├── Sharpen.metal │ │ ├── Sharpen.swift │ │ ├── Sketch.metal │ │ ├── Sketch.swift │ │ ├── SmoothToonFilter.swift │ │ ├── SobelEdgeDetection.metal │ │ ├── SobelEdgeDetection.swift │ │ ├── SoftElegance.swift │ │ ├── SoftLightBlend.metal │ │ ├── SoftLightBlend.swift │ │ ├── Solarize.metal │ │ ├── Solarize.swift │ │ ├── SolidColorGenerator.swift │ │ ├── SourceOverBlend.metal │ │ ├── SourceOverBlend.swift │ │ ├── SphereRefraction.metal │ │ ├── SphereRefraction.swift │ │ ├── StretchDistortion.metal │ │ ├── StretchDistortion.swift │ │ ├── SubtractBlend.metal │ │ ├── SubtractBlend.swift │ │ ├── SwirlDistortion.metal │ │ ├── SwirlDistortion.swift │ │ ├── TexelSamplingTypes.h │ │ ├── ThresholdSketch.metal │ │ ├── ThresholdSketch.swift │ │ ├── ThresholdSobelEdgeDetection.metal │ │ ├── ThresholdSobelEdgeDetection.swift │ │ ├── TiltShift.metal │ │ ├── TiltShift.swift │ │ ├── ToonFilter.metal │ │ ├── ToonFilter.swift │ │ ├── Vibrance.metal │ │ ├── Vibrance.swift │ │ ├── Vignette.metal │ │ ├── Vignette.swift │ │ ├── WhiteBalance.metal │ │ ├── WhiteBalance.swift │ │ ├── ZoomBlur.metal │ │ ├── ZoomBlur.swift │ │ └── iOSBlur.swift │ │ ├── PictureInput.swift │ │ ├── PictureOutput.swift │ │ ├── Pipeline.swift │ │ ├── Position.swift │ │ ├── RenderView.swift │ │ ├── ShaderUniformSettings.swift │ │ ├── Size.swift │ │ ├── Texture.swift │ │ ├── TextureSamplingOperation.swift │ │ ├── Timestamp.swift │ │ ├── YUVToRGBConversion.metal │ │ └── YUVToRGBConversion.swift ├── Vision │ ├── CoreMLHelpers │ │ ├── Array+Extensions.swift │ │ ├── CGImage+CVPixelBuffer.swift │ │ ├── CGImage+RawBytes.swift │ │ ├── CGImagePropertyOrientation.swift │ │ ├── CVPixelBuffer+Helpers.swift │ │ ├── CoreML+Combine.swift │ │ ├── MLModel+Images.swift │ │ ├── MLMultiArray+Helpers.swift │ │ ├── MLMultiArray+Image.swift │ │ ├── Math.swift │ │ ├── NonMaxSuppression.swift │ │ ├── Predictions.swift │ │ ├── UIImage+CVPixelBuffer.swift │ │ ├── UIImage+Extensions.swift │ │ └── UIImage+RawBytes.swift │ ├── GlassFace.swift │ ├── MlsOperation │ │ ├── MovingLeastSquare.h │ │ ├── MovingLeastSquareHelper.h │ │ └── MovingLeastSquareHelper.mm │ ├── OldFace.swift │ ├── OldFaceOperation.swift │ ├── ThinFace.swift │ ├── ThinFaceOperation.swift │ ├── VisionAttGanProvider.swift │ ├── VisionBackground.swift │ ├── VisionRequests.swift │ ├── VisionStyleProvider.swift │ ├── models │ │ ├── conv.py │ │ └── opt.py │ └── waifu2x │ │ ├── BackgroundPipeline.swift │ │ ├── BackgroundTask.swift │ │ ├── Bicubic.swift │ │ ├── MLModel+Prediction.swift │ │ ├── MetalBicubic.swift │ │ ├── ModelFactory.swift │ │ ├── Queue.swift │ │ ├── UIImage+Alpha.swift │ │ ├── UIImage+Bicubic.swift │ │ ├── UIImage+Crop.swift │ │ ├── UIImage+Expand.swift │ │ ├── Waifu2x.swift │ │ ├── bicubic.metal │ │ └── waifu2x.h ├── en.lproj │ ├── InfoPlist.strings │ └── Localizable.strings ├── icons │ ├── 15457-camera-snapshot.json │ ├── 33886-check-okey-done.json │ ├── 34607-cta-button-background.json │ ├── 4309-take-photo.json │ ├── 8657-camera-scanning-effect.json │ ├── Age90.png │ ├── IMG_0008.JPG │ ├── IMG_0009.JPG │ ├── IMG_0010.JPG │ ├── IMG_0011.JPG │ ├── IMG_0012.JPG │ ├── IMG_0013.JPG │ ├── IMG_0074.JPG │ ├── IMG_0075.JPG │ ├── aged.jpg │ ├── attgan_blond_hair.jpg │ ├── attgan_brown_hair.jpg │ ├── attgan_male.jpg │ ├── attgan_mustache.jpg │ ├── attgan_old.jpg │ ├── attgan_young.jpg │ ├── beauty.jpg │ ├── bubble.jpg │ ├── cam_art.png │ ├── cam_cartoon.png │ ├── cam_style.jpg │ ├── colorful.jpg │ ├── face.jpg │ ├── face.mp4 │ ├── face.png │ ├── face1.jpg │ ├── face2.jpg │ ├── face3.jpg │ ├── fleeting.jpg │ ├── flower.jpg │ ├── frame.jpg │ ├── gb.jpg │ ├── glass.png │ ├── hdr.jpg │ ├── icon_new.png │ ├── info.png │ ├── kuwahara.jpg │ ├── load.jpg │ ├── logo_zw.png │ ├── lomo.jpg │ ├── new.png │ ├── photo2cartoon_bubble.jpg │ ├── photo2cartoon_colorful.jpg │ ├── photo2cartoon_flower.jpg │ ├── photo2cartoon_romance.jpg │ ├── photo_album.png │ ├── pixellate.jpg │ ├── romance.jpg │ ├── rotate.png │ ├── save.png │ ├── style_la_muse.jpg │ ├── style_pointillism8.jpg │ ├── style_rain_princess.jpg │ ├── style_shipwreck_minotaur.jpg │ ├── style_starry_night8.jpg │ ├── style_the_scream.jpg │ ├── style_udnie.jpg │ ├── style_wave.jpg │ ├── take_photo.png │ ├── toon.jpg │ └── vip.png └── zh-Hans.lproj │ ├── InfoPlist.strings │ ├── LaunchScreen.strings │ └── Localizable.strings ├── Podfile ├── Readme.md ├── Readme_EN.md ├── docs └── chs │ └── 01.md └── screenshot ├── image1.jpg ├── image2.jpg └── image3.jpg /.gitattributes: -------------------------------------------------------------------------------- 1 | *.mlmodel filter=lfs diff=lfs merge=lfs -text 2 | *.car filter=lfs diff=lfs merge=lfs -text 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | Pods/ 2 | Podfile.lock 3 | build/XCBuildData/ 4 | MagicCamera.xcodeproj/xcuserdata/ 5 | MagicCamera.xcodeproj/project.xcworkspace/xcuserdata/ 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2021 william0wang 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | 9 | -------------------------------------------------------------------------------- /MagicCamera.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /MagicCamera.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /MagicCamera.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /MagicCamera.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /MagicCamera.xcworkspace/xcuserdata/william.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera.xcworkspace/xcuserdata/william.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /MagicCamera/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /MagicCamera/Assets.xcassets/AppIcon.appiconset/icon-1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/Assets.xcassets/AppIcon.appiconset/icon-1024.png -------------------------------------------------------------------------------- /MagicCamera/Assets.xcassets/AppIcon.appiconset/icon-20-ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/Assets.xcassets/AppIcon.appiconset/icon-20-ipad.png -------------------------------------------------------------------------------- /MagicCamera/Assets.xcassets/AppIcon.appiconset/icon-20@2x-ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/Assets.xcassets/AppIcon.appiconset/icon-20@2x-ipad.png -------------------------------------------------------------------------------- /MagicCamera/Assets.xcassets/AppIcon.appiconset/icon-20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/Assets.xcassets/AppIcon.appiconset/icon-20@2x.png -------------------------------------------------------------------------------- /MagicCamera/Assets.xcassets/AppIcon.appiconset/icon-20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/Assets.xcassets/AppIcon.appiconset/icon-20@3x.png -------------------------------------------------------------------------------- /MagicCamera/Assets.xcassets/AppIcon.appiconset/icon-29-ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/Assets.xcassets/AppIcon.appiconset/icon-29-ipad.png -------------------------------------------------------------------------------- /MagicCamera/Assets.xcassets/AppIcon.appiconset/icon-29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/Assets.xcassets/AppIcon.appiconset/icon-29.png -------------------------------------------------------------------------------- /MagicCamera/Assets.xcassets/AppIcon.appiconset/icon-29@2x-ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/Assets.xcassets/AppIcon.appiconset/icon-29@2x-ipad.png -------------------------------------------------------------------------------- /MagicCamera/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png -------------------------------------------------------------------------------- /MagicCamera/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png -------------------------------------------------------------------------------- /MagicCamera/Assets.xcassets/AppIcon.appiconset/icon-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/Assets.xcassets/AppIcon.appiconset/icon-40.png -------------------------------------------------------------------------------- /MagicCamera/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png -------------------------------------------------------------------------------- /MagicCamera/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png -------------------------------------------------------------------------------- /MagicCamera/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png -------------------------------------------------------------------------------- /MagicCamera/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png -------------------------------------------------------------------------------- /MagicCamera/Assets.xcassets/AppIcon.appiconset/icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/Assets.xcassets/AppIcon.appiconset/icon-76.png -------------------------------------------------------------------------------- /MagicCamera/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png -------------------------------------------------------------------------------- /MagicCamera/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png -------------------------------------------------------------------------------- /MagicCamera/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /MagicCamera/Cameras/ImageSaveView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ImageSaveView.swift 3 | // MagicCamera 4 | // 5 | // Created by William on 2021/5/24. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct ImageSaveView: View { 11 | @Binding var savePopupOk: Bool 12 | @Binding var saveError : Error? 13 | 14 | var body: some View { 15 | VStack { 16 | if savePopupOk { 17 | Text("保存图片成功!").foregroundColor(.white).padding(.bottom, 10) 18 | Text("已经保存图片到相册").foregroundColor(.white) 19 | } else { 20 | Text("保存图片失败!").foregroundColor(.white).padding(.bottom, 10) 21 | Text(saveError?.localizedDescription ?? "").foregroundColor(.white) 22 | } 23 | } 24 | .frame(width: 240, height: 90) 25 | .background(Color(.gray)) 26 | .cornerRadius(15.0) 27 | } 28 | } 29 | 30 | struct ImageSaveView_Previews: PreviewProvider { 31 | static var previews: some View { 32 | ImageSaveView(savePopupOk: .constant(true), saveError: .constant(nil)) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /MagicCamera/Cameras/Introspect/Introspect.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | //! Project version number for Introspect. 4 | FOUNDATION_EXPORT double IntrospectVersionNumber; 5 | 6 | //! Project version string for Introspect. 7 | FOUNDATION_EXPORT const unsigned char IntrospectVersionString[]; 8 | -------------------------------------------------------------------------------- /MagicCamera/Cameras/VideoView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // VideoView.swift 3 | // MagicCamera 4 | // 5 | // Created by William on 2021/3/24. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct VideoView: View { 11 | var body: some View { 12 | let fileUrl = Bundle.main.url(forResource: "face", withExtension: "mp4") 13 | VideoPlayerContainerView(url: fileUrl!) 14 | } 15 | } 16 | 17 | struct VideoView_Previews: PreviewProvider { 18 | static var previews: some View { 19 | VideoView().frame(width:100, height:100) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/1977map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/1977map.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/Glacial1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/Glacial1.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/Glacial2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/Glacial2.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/Lansdowne1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/Lansdowne1.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/Lansdowne2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/Lansdowne2.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/XPro2Border.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/XPro2Border.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/aden_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/aden_map.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/amaroBorder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/amaroBorder.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/amaroMap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/amaroMap.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/blackOverlayMap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/blackOverlayMap.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/blackboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/blackboard.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/bleach_reduction_curves1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/bleach_reduction_curves1.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/bleach_reduction_lgg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/bleach_reduction_lgg.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/borderTexture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/borderTexture.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/brannanBlowout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/brannanBlowout.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/brannanBorder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/brannanBorder.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/brannanContrast.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/brannanContrast.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/brannanLuma.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/brannanLuma.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/brannanProcess.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/brannanProcess.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/brannanScreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/brannanScreen.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/brightcontrast_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/brightcontrast_map.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/bw_vintage_curves1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/bw_vintage_curves1.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/bw_vintage_curves2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/bw_vintage_curves2.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/chic_curves1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/chic_curves1.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/chic_curves2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/chic_curves2.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/classy_look_levels2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/classy_look_levels2.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/classy_look_tonemap1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/classy_look_tonemap1.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/clut_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/clut_blue.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/clut_bw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/clut_bw.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/clut_cinema_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/clut_cinema_blue.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/clut_cinema_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/clut_cinema_green.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/clut_cinema_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/clut_cinema_red.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/clut_clear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/clut_clear.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/clut_instant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/clut_instant.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/clut_pastel_pink.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/clut_pastel_pink.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/clut_pastel_sky.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/clut_pastel_sky.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/clut_vintage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/clut_vintage.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/clut_yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/clut_yellow.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/crazycolor_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/crazycolor_map.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/crazycolor_overlay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/crazycolor_overlay.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/crema_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/crema_map.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/crossprotwo_curves.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/crossprotwo_curves.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/earlyBirdCurves.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/earlyBirdCurves.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/earlybirdBlowout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/earlybirdBlowout.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/earlybirdBorder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/earlybirdBorder.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/earlybirdMap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/earlybirdMap.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/earlybirdOverlayMap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/earlybirdOverlayMap.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/edgeBurn.pvr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/edgeBurn.pvr -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/epic_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/epic_1.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/epic_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/epic_2.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/filterBorderPlainWhite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/filterBorderPlainWhite.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/glowField.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/glowField.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/hefeBorder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/hefeBorder.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/hefeGradientMap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/hefeGradientMap.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/hefeMap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/hefeMap.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/hefeMetal.pvr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/hefeMetal.pvr -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/hefeSoftLight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/hefeSoftLight.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/hudsonBackground.pvr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/hudsonBackground.pvr -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/hudsonBorder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/hudsonBorder.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/hudsonMap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/hudsonMap.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/inkwellMap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/inkwellMap.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/juno_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/juno_map.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/kelvinBorder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/kelvinBorder.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/kelvinMap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/kelvinMap.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/lark_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/lark_map.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/lomoBorder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/lomoBorder.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/lomoMap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/lomoMap.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/ludwig_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/ludwig_map.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/luster_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/luster_map.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/mayfairBorder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/mayfairBorder.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/mayfairColorGradient.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/mayfairColorGradient.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/mayfairColorOverlay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/mayfairColorOverlay.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/mayfairGlowField.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/mayfairGlowField.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/mayfairOverlayMap100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/mayfairOverlayMap100.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/metalTexture2.pvr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/metalTexture2.pvr -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/midtones_curve.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/midtones_curve.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/nashvilleBorder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/nashvilleBorder.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/nashvilleMap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/nashvilleMap.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/overlayMap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/overlayMap.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/overlayMap81.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/overlayMap81.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/perpetua_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/perpetua_map.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/perpetua_overlay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/perpetua_overlay.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/plusDarker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/plusDarker.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/reyes_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/reyes_map.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/riseBorder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/riseBorder.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/riseMap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/riseMap.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/screen30.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/screen30.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/seventies_curves.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/seventies_curves.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/sierraBorder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/sierraBorder.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/sierraMap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/sierraMap.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/sierraSmoke.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/sierraSmoke.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/sierraVignette.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/sierraVignette.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/slumber_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/slumber_map.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/softLight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/softLight.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/softLight100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/softLight100.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/subtlecolor_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/subtlecolor_map.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/super_film_stock_curves.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/super_film_stock_curves.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/sutroBorder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/sutroBorder.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/sutroCurves.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/sutroCurves.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/sutroEdgeBurn.pvr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/sutroEdgeBurn.pvr -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/sutroMap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/sutroMap.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/sutroMetal.pvr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/sutroMetal.pvr -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/toasterColorShift.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/toasterColorShift.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/toasterCurves.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/toasterCurves.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/toasterOverlayMapWarm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/toasterOverlayMapWarm.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/toasterSoftLight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/toasterSoftLight.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/valenciaGradientMap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/valenciaGradientMap.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/valenciaMap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/valenciaMap.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/vignetteMap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/vignetteMap.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/vintage_signature_curves1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/vintage_signature_curves1.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/vintage_signature_lgg_curves.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/vintage_signature_lgg_curves.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/vogue_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/vogue_map.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/waldenBorder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/waldenBorder.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/waldenMap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/waldenMap.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/willowBorder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/willowBorder.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/willowMap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/willowMap.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/willowSoftLight100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/willowSoftLight100.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/willowVignette.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/willowVignette.png -------------------------------------------------------------------------------- /MagicCamera/FilterAssets.bundle/xproMap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/FilterAssets.bundle/xproMap.png -------------------------------------------------------------------------------- /MagicCamera/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* 2 | InfoPlist.strings 3 | MagicCamera 4 | 5 | Created by William on 2021/5/26. 6 | 7 | */ 8 | 9 | CFBundleDisplayName = "魔法相机"; 10 | -------------------------------------------------------------------------------- /MagicCamera/MagicCamera-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // Use this file to import your target's public headers that you would like to expose to Swift. 3 | // 4 | 5 | #import "Vision/MlsOperation/MovingLeastSquare.h" 6 | #import "Vision/MlsOperation/MovingLeastSquareHelper.h" 7 | -------------------------------------------------------------------------------- /MagicCamera/PostData.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PostData.swift 3 | // MagicCamera 4 | // 5 | // Created by William on 2020/12/12. 6 | // 7 | 8 | import Foundation 9 | 10 | func PostData(_ data: Data?, callback:@escaping (Data?)->Void) { 11 | let session = URLSession.shared 12 | let url = URL(string: "https://dev-face.51kfire.com:4443/")! 13 | 14 | var request = URLRequest(url: url) 15 | request.httpMethod = "POST" 16 | request.httpBody = data 17 | 18 | let task = session.dataTask(with: request ) { (data, response, error) in 19 | 20 | if let httpStatus = response as? HTTPURLResponse{ 21 | if httpStatus.statusCode != 200 { 22 | debugPrint("statusCode should be 200, but is \(httpStatus.statusCode)") 23 | return 24 | } 25 | } 26 | debugPrint("response = \(response)") 27 | callback(data) 28 | } 29 | 30 | task.resume() 31 | } 32 | -------------------------------------------------------------------------------- /MagicCamera/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /MagicCamera/SwiftPaid/BlurView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BlurView.swift 3 | // MagicCamera 4 | // 5 | // Created by William on 2020/12/23. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct VisualEffectView: UIViewRepresentable { 11 | var effect: UIVisualEffect? 12 | func makeUIView(context: UIViewRepresentableContext) -> UIVisualEffectView { UIVisualEffectView() } 13 | func updateUIView(_ uiView: UIVisualEffectView, context: UIViewRepresentableContext) { uiView.effect = effect } 14 | } 15 | 16 | struct BlurView: View { 17 | var body: some View { 18 | VisualEffectView(effect: UIBlurEffect(style: .light)) 19 | .edgesIgnoringSafeArea(.all) 20 | } 21 | } 22 | 23 | struct BlurView_Previews: PreviewProvider { 24 | static var previews: some View { 25 | ZStack{ 26 | loadImage(name: "icon.png") 27 | BlurView() 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/Filters/MT1977Filter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MT1977Filter.swift 3 | // MetalFilters 4 | // 5 | // Created by alexiscn on 2018/6/8. 6 | // 7 | 8 | import Foundation 9 | import MetalPetal 10 | 11 | class MT1977Filter: MTFilter { 12 | 13 | override class var name: String { 14 | return "1977" 15 | } 16 | 17 | override var borderName: String { 18 | return "filterBorderPlainWhite.png" 19 | } 20 | 21 | override var fragmentName: String { 22 | return "MT1977Fragment" 23 | } 24 | 25 | override var samplers: [String : String] { 26 | return [ 27 | "map": "1977map.png", 28 | "screen": "screen30.png", 29 | ] 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/Filters/MTAdenFilter.metal: -------------------------------------------------------------------------------- 1 | // 2 | // MTAdenFilter.metal 3 | // MetalFilters 4 | // 5 | // Created by alexiscn on 2018/6/8. 6 | // 7 | 8 | #include 9 | #include "MTIShaderLib.h" 10 | #include "IFShaderLib.h" 11 | using namespace metalpetal; 12 | 13 | fragment float4 MTAdenFragment(VertexOut vertexIn [[ stage_in ]], 14 | texture2d inputTexture [[ texture(0) ]], 15 | texture2d lookup [[ texture(1) ]], 16 | constant float & strength [[ buffer(0)]], 17 | sampler textureSampler [[ sampler(0) ]]) 18 | { 19 | constexpr sampler s(coord::normalized, address::clamp_to_edge, filter::linear); 20 | float4 texel = inputTexture.sample(s, vertexIn.textureCoordinate); 21 | float4 inputTexel = texel; 22 | texel.rgb = metalColorLookUp(lookup, s, texel.rgb, 33).rgb; 23 | texel.rgb = mix(inputTexel.rgb, texel.rgb, strength); 24 | return texel; 25 | } 26 | -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/Filters/MTAdenFilter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MTAdenFilter.swift 3 | // MetalFilters 4 | // 5 | // Created by alexiscn on 2018/6/8. 6 | // 7 | 8 | import Foundation 9 | import MetalPetal 10 | 11 | class MTAdenFilter: MTFilter { 12 | 13 | override class var name: String { 14 | return "Aden" 15 | } 16 | 17 | override var borderName: String { 18 | return "filterBorderPlainWhite.png" 19 | } 20 | 21 | override var fragmentName: String { 22 | return "MTAdenFragment" 23 | } 24 | 25 | override var samplers: [String : String] { 26 | return [ 27 | "lookup": "aden_map.png", 28 | ] 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/Filters/MTAmaroFilter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MTAmaroFilter.swift 3 | // MetalFilters 4 | // 5 | // Created by alexiscn on 2018/6/8. 6 | // 7 | 8 | import Foundation 9 | import MetalPetal 10 | 11 | class MTAmaroFilter: MTFilter { 12 | 13 | override class var name: String { 14 | return "Amaro" 15 | } 16 | 17 | override var borderName: String { 18 | return "amaroBorder.png" 19 | } 20 | 21 | override var fragmentName: String { 22 | return "MTAmaroFragment" 23 | } 24 | 25 | override var samplers: [String : String] { 26 | return [ 27 | "blackboard": "blackboard.png", 28 | "map": "amaroMap.png", 29 | "overlay": "overlayMap.png", 30 | ] 31 | } 32 | 33 | } -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/Filters/MTAshbyVideoFilter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MTAshbyVideoFilter.swift 3 | // MetalFilters 4 | // 5 | // Created by alexiscn on 2018/6/8. 6 | // 7 | 8 | import Foundation 9 | import MetalPetal 10 | 11 | class MTAshbyVideoFilter: MTFilter { 12 | 13 | override class var name: String { 14 | return "Ashby" 15 | } 16 | 17 | override var borderName: String { 18 | return "filterBorderPlainWhite.png" 19 | } 20 | 21 | override var fragmentName: String { 22 | return "MTAshbyVideoFragment" 23 | } 24 | 25 | override var samplers: [String : String] { 26 | return [ 27 | "levels": "classy_look_levels2.png", 28 | "tonemap": "classy_look_tonemap1.png", 29 | ] 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/Filters/MTBrannanFilter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MTBrannanFilter.swift 3 | // MetalFilters 4 | // 5 | // Created by alexiscn on 2018/6/8. 6 | // 7 | 8 | import Foundation 9 | import MetalPetal 10 | 11 | class MTBrannanFilter: MTFilter { 12 | 13 | override class var name: String { 14 | return "Brannan" 15 | } 16 | 17 | override var borderName: String { 18 | return "brannanBorder.png" 19 | } 20 | 21 | override var fragmentName: String { 22 | return "MTBrannanFragment" 23 | } 24 | 25 | override var samplers: [String : String] { 26 | return [ 27 | "blowout": "brannanBlowout.png", 28 | "brannanMap": "brannanProcess.png", 29 | "contrast": "brannanContrast.png", 30 | "lumaMap": "brannanLuma.png", 31 | "screenMap": "brannanScreen.png", 32 | ] 33 | } 34 | 35 | } -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/Filters/MTBrooklynVideoFilter.metal: -------------------------------------------------------------------------------- 1 | // 2 | // MTBrooklynVideoFilter.metal 3 | // MetalFilters 4 | // 5 | // Created by alexiscn on 2018/6/8. 6 | // 7 | 8 | #include 9 | #include "MTIShaderLib.h" 10 | #include "IFShaderLib.h" 11 | using namespace metalpetal; 12 | 13 | fragment float4 MTBrooklynVideoFragment(VertexOut vertexIn [[ stage_in ]], 14 | texture2d inputTexture [[ texture(0) ]], 15 | texture2d map [[ texture(1) ]], 16 | constant float & strength [[ buffer(0)]], 17 | sampler textureSampler [[ sampler(0) ]]) 18 | { 19 | constexpr sampler s(coord::normalized, address::clamp_to_edge, filter::linear); 20 | float4 texel = inputTexture.sample(s, vertexIn.textureCoordinate); 21 | float4 inputTexel = texel; 22 | texel.r = map.sample(s, float2(texel.r, 0.5)).r; 23 | texel.g = map.sample(s, float2(texel.g, 0.5)).g; 24 | texel.b = map.sample(s, float2(texel.b, 0.5)).b; 25 | texel.rgb = mix(inputTexel.rgb, texel.rgb, strength); 26 | return texel; 27 | } 28 | -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/Filters/MTBrooklynVideoFilter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MTBrooklynVideoFilter.swift 3 | // MetalFilters 4 | // 5 | // Created by alexiscn on 2018/6/8. 6 | // 7 | 8 | import Foundation 9 | import MetalPetal 10 | 11 | class MTBrooklynVideoFilter: MTFilter { 12 | 13 | override class var name: String { 14 | return "Brooklyn" 15 | } 16 | 17 | override var borderName: String { 18 | return "filterBorderPlainWhite.png" 19 | } 20 | 21 | override var fragmentName: String { 22 | return "MTBrooklynVideoFragment" 23 | } 24 | 25 | override var samplers: [String : String] { 26 | return [ 27 | "map": "crossprotwo_curves.png", 28 | ] 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/Filters/MTCharmesVideoFilter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MTCharmesVideoFilter.swift 3 | // MetalFilters 4 | // 5 | // Created by alexiscn on 2018/6/8. 6 | // 7 | 8 | import Foundation 9 | import MetalPetal 10 | 11 | class MTCharmesVideoFilter: MTFilter { 12 | 13 | override class var name: String { 14 | return "Charmes" 15 | } 16 | 17 | override var borderName: String { 18 | return "filterBorderPlainWhite.png" 19 | } 20 | 21 | override var fragmentName: String { 22 | return "MTCharmesVideoFragment" 23 | } 24 | 25 | override var samplers: [String : String] { 26 | return [ 27 | "map": "vogue_map.png", 28 | ] 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/Filters/MTClarendonVideoFilter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MTClarendonVideoFilter.swift 3 | // MetalFilters 4 | // 5 | // Created by alexiscn on 2018/6/8. 6 | // 7 | 8 | import Foundation 9 | import MetalPetal 10 | 11 | class MTClarendonVideoFilter: MTFilter { 12 | 13 | override class var name: String { 14 | return "Clarendon" 15 | } 16 | 17 | override var borderName: String { 18 | return "filterBorderPlainWhite.png" 19 | } 20 | 21 | override var fragmentName: String { 22 | return "MTClarendonVideoFragment" 23 | } 24 | 25 | override var samplers: [String : String] { 26 | return [ 27 | "map": "Glacial1.png", 28 | "map2": "Glacial2.png", 29 | ] 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/Filters/MTCremaFilter.metal: -------------------------------------------------------------------------------- 1 | // 2 | // MTCremaFilter.metal 3 | // MetalFilters 4 | // 5 | // Created by alexiscn on 2018/6/8. 6 | // 7 | 8 | #include 9 | #include "MTIShaderLib.h" 10 | #include "IFShaderLib.h" 11 | using namespace metalpetal; 12 | 13 | fragment float4 MTCremaFragment(VertexOut vertexIn [[ stage_in ]], 14 | texture2d inputTexture [[ texture(0) ]], 15 | texture2d lookup [[ texture(1) ]], 16 | constant float & strength [[ buffer(0)]], 17 | sampler textureSampler [[ sampler(0) ]]) 18 | { 19 | constexpr sampler s(coord::normalized, address::clamp_to_edge, filter::linear); 20 | float4 texel = inputTexture.sample(s, vertexIn.textureCoordinate); 21 | float4 inputTexel = texel; 22 | texel.rgb = metalColorLookUp(lookup, s, texel.rgb, 33).rgb; 23 | texel.rgb = mix(inputTexel.rgb, texel.rgb, strength); 24 | return texel; 25 | } 26 | -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/Filters/MTCremaFilter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MTCremaFilter.swift 3 | // MetalFilters 4 | // 5 | // Created by alexiscn on 2018/6/8. 6 | // 7 | 8 | import Foundation 9 | import MetalPetal 10 | 11 | class MTCremaFilter: MTFilter { 12 | 13 | override class var name: String { 14 | return "Crema" 15 | } 16 | 17 | override var borderName: String { 18 | return "filterBorderPlainWhite.png" 19 | } 20 | 21 | override var fragmentName: String { 22 | return "MTCremaFragment" 23 | } 24 | 25 | override var samplers: [String : String] { 26 | return [ 27 | "lookup": "crema_map.png", 28 | ] 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/Filters/MTDogpatchVideoFilter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MTDogpatchVideoFilter.swift 3 | // MetalFilters 4 | // 5 | // Created by alexiscn on 2018/6/8. 6 | // 7 | 8 | import Foundation 9 | import MetalPetal 10 | 11 | class MTDogpatchVideoFilter: MTFilter { 12 | 13 | override class var name: String { 14 | return "Dogpatch" 15 | } 16 | 17 | override var borderName: String { 18 | return "filterBorderPlainWhite.png" 19 | } 20 | 21 | override var fragmentName: String { 22 | return "MTDogpatchVideoFragment" 23 | } 24 | 25 | override var samplers: [String : String] { 26 | return [ 27 | "map1": "bleach_reduction_curves1.png", 28 | "mapLgg": "bleach_reduction_lgg.png", 29 | ] 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/Filters/MTEarlybirdFilter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MTEarlybirdFilter.swift 3 | // MetalFilters 4 | // 5 | // Created by alexiscn on 2018/6/8. 6 | // 7 | 8 | import Foundation 9 | import MetalPetal 10 | 11 | class MTEarlybirdFilter: MTFilter { 12 | 13 | override class var name: String { 14 | return "Earlybird" 15 | } 16 | 17 | override var borderName: String { 18 | return "earlybirdBorder.png" 19 | } 20 | 21 | override var fragmentName: String { 22 | return "MTEarlybirdFragment" 23 | } 24 | 25 | override var samplers: [String : String] { 26 | return [ 27 | "blowout": "earlybirdBlowout.png", 28 | "curves": "earlyBirdCurves.png", 29 | "earlybirdMap": "earlybirdMap.png", 30 | "overlayMap": "earlybirdOverlayMap.png", 31 | "vignetteMap": "plusDarker.png", 32 | ] 33 | } 34 | 35 | } -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/Filters/MTGinghamVideoFilter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MTGinghamVideoFilter.swift 3 | // MetalFilters 4 | // 5 | // Created by alexiscn on 2018/6/8. 6 | // 7 | 8 | import Foundation 9 | import MetalPetal 10 | 11 | class MTGinghamVideoFilter: MTFilter { 12 | 13 | override class var name: String { 14 | return "Gingham" 15 | } 16 | 17 | override var borderName: String { 18 | return "filterBorderPlainWhite.png" 19 | } 20 | 21 | override var fragmentName: String { 22 | return "MTGinghamVideoFragment" 23 | } 24 | 25 | override var samplers: [String : String] { 26 | return [ 27 | "map": "vintage_signature_curves1.png", 28 | "mapLgg": "vintage_signature_lgg_curves.png", 29 | ] 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/Filters/MTGinzaVideoFilter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MTGinzaVideoFilter.swift 3 | // MetalFilters 4 | // 5 | // Created by alexiscn on 2018/6/8. 6 | // 7 | 8 | import Foundation 9 | import MetalPetal 10 | 11 | class MTGinzaVideoFilter: MTFilter { 12 | 13 | override class var name: String { 14 | return "Ginza" 15 | } 16 | 17 | override var borderName: String { 18 | return "filterBorderPlainWhite.png" 19 | } 20 | 21 | override var fragmentName: String { 22 | return "MTGinzaVideoFragment" 23 | } 24 | 25 | override var samplers: [String : String] { 26 | return [ 27 | "map1": "chic_curves1.png", 28 | "map2": "chic_curves2.png", 29 | ] 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/Filters/MTHefeFilter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MTHefeFilter.swift 3 | // MetalFilters 4 | // 5 | // Created by alexiscn on 2018/6/8. 6 | // 7 | 8 | import Foundation 9 | import MetalPetal 10 | 11 | class MTHefeFilter: MTFilter { 12 | 13 | override class var name: String { 14 | return "Hefe" 15 | } 16 | 17 | override var borderName: String { 18 | return "hefeBorder.png" 19 | } 20 | 21 | override var fragmentName: String { 22 | return "MTHefeFragment" 23 | } 24 | 25 | override var samplers: [String : String] { 26 | return [ 27 | "edgeBurn": "edgeBurn.pvr", 28 | "gradMap": "hefeGradientMap.png", 29 | "hefeMetal": "hefeMetal.pvr", 30 | "map": "hefeMap.png", 31 | "softLight": "hefeSoftLight.png", 32 | ] 33 | } 34 | 35 | } -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/Filters/MTHelenaVideoFilter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MTHelenaVideoFilter.swift 3 | // MetalFilters 4 | // 5 | // Created by alexiscn on 2018/6/8. 6 | // 7 | 8 | import Foundation 9 | import MetalPetal 10 | 11 | class MTHelenaVideoFilter: MTFilter { 12 | 13 | override class var name: String { 14 | return "Helena" 15 | } 16 | 17 | override var borderName: String { 18 | return "filterBorderPlainWhite.png" 19 | } 20 | 21 | override var fragmentName: String { 22 | return "MTHelenaVideoFragment" 23 | } 24 | 25 | override var samplers: [String : String] { 26 | return [ 27 | "map1": "epic_1.png", 28 | "map2": "epic_2.png", 29 | ] 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/Filters/MTHudsonFilter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MTHudsonFilter.swift 3 | // MetalFilters 4 | // 5 | // Created by alexiscn on 2018/6/8. 6 | // 7 | 8 | import Foundation 9 | import MetalPetal 10 | 11 | class MTHudsonFilter: MTFilter { 12 | 13 | override class var name: String { 14 | return "Hudson" 15 | } 16 | 17 | override var borderName: String { 18 | return "hudsonBorder.png" 19 | } 20 | 21 | override var fragmentName: String { 22 | return "MTHudsonFragment" 23 | } 24 | 25 | override var samplers: [String : String] { 26 | return [ 27 | "blowout": "hudsonBackground.pvr", 28 | "map": "hudsonMap.png", 29 | "overlay": "overlayMap.png", 30 | ] 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/Filters/MTInkwellFilter.metal: -------------------------------------------------------------------------------- 1 | // 2 | // MTInkwellFilter.metal 3 | // MetalFilters 4 | // 5 | // Created by alexiscn on 2018/6/8. 6 | // 7 | 8 | #include 9 | #include "MTIShaderLib.h" 10 | #include "IFShaderLib.h" 11 | using namespace metalpetal; 12 | 13 | fragment float4 MTInkwellFragment(VertexOut vertexIn [[ stage_in ]], 14 | texture2d inputTexture [[ texture(0) ]], 15 | texture2d map [[ texture(1) ]], 16 | constant float & strength [[ buffer(0)]], 17 | sampler textureSampler [[ sampler(0) ]]) 18 | { 19 | constexpr sampler s(coord::normalized, address::clamp_to_edge, filter::linear); 20 | float4 texel = inputTexture.sample(s, vertexIn.textureCoordinate); 21 | float4 inputTexel = texel; 22 | texel.rgb = float3(dot(float3(0.3, 0.6, 0.1), texel.rgb)); 23 | texel.rgb = float3(map.sample(s, float2(texel.r, .16666)).r); 24 | texel.rgb = mix(inputTexel.rgb, texel.rgb, strength); 25 | return texel; 26 | } 27 | -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/Filters/MTInkwellFilter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MTInkwellFilter.swift 3 | // MetalFilters 4 | // 5 | // Created by alexiscn on 2018/6/8. 6 | // 7 | 8 | import Foundation 9 | import MetalPetal 10 | 11 | class MTInkwellFilter: MTFilter { 12 | 13 | override class var name: String { 14 | return "Inkwell" 15 | } 16 | 17 | override var borderName: String { 18 | return "filterBorderPlainWhite.png" 19 | } 20 | 21 | override var fragmentName: String { 22 | return "MTInkwellFragment" 23 | } 24 | 25 | override var samplers: [String : String] { 26 | return [ 27 | "map": "inkwellMap.png", 28 | ] 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/Filters/MTJunoFilter.metal: -------------------------------------------------------------------------------- 1 | // 2 | // MTJunoFilter.metal 3 | // MetalFilters 4 | // 5 | // Created by alexiscn on 2018/6/8. 6 | // 7 | 8 | #include 9 | #include "MTIShaderLib.h" 10 | #include "IFShaderLib.h" 11 | using namespace metalpetal; 12 | 13 | fragment float4 MTJunoFragment(VertexOut vertexIn [[ stage_in ]], 14 | texture2d inputTexture [[ texture(0) ]], 15 | texture2d lookup [[ texture(1) ]], 16 | constant float & strength [[ buffer(0)]], 17 | sampler textureSampler [[ sampler(0) ]]) 18 | { 19 | constexpr sampler s(coord::normalized, address::clamp_to_edge, filter::linear); 20 | float4 texel = inputTexture.sample(s, vertexIn.textureCoordinate); 21 | float4 inputTexel = texel; 22 | texel.rgb = metalColorLookUp(lookup, s, texel.rgb, 33).rgb; 23 | texel.rgb = mix(inputTexel.rgb, texel.rgb, strength); 24 | return texel; 25 | } 26 | -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/Filters/MTJunoFilter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MTJunoFilter.swift 3 | // MetalFilters 4 | // 5 | // Created by alexiscn on 2018/6/8. 6 | // 7 | 8 | import Foundation 9 | import MetalPetal 10 | 11 | class MTJunoFilter: MTFilter { 12 | 13 | override class var name: String { 14 | return "Juno" 15 | } 16 | 17 | override var borderName: String { 18 | return "filterBorderPlainWhite.png" 19 | } 20 | 21 | override var fragmentName: String { 22 | return "MTJunoFragment" 23 | } 24 | 25 | override var samplers: [String : String] { 26 | return [ 27 | "lookup": "juno_map.png", 28 | ] 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/Filters/MTKelvinFilter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MTKelvinFilter.swift 3 | // MetalFilters 4 | // 5 | // Created by alexiscn on 2018/6/8. 6 | // 7 | 8 | import Foundation 9 | import MetalPetal 10 | 11 | class MTKelvinFilter: MTFilter { 12 | 13 | override class var name: String { 14 | return "Kelvin" 15 | } 16 | 17 | override var borderName: String { 18 | return "kelvinBorder.png" 19 | } 20 | 21 | override var fragmentName: String { 22 | return "MTKelvinFragment" 23 | } 24 | 25 | override var samplers: [String : String] { 26 | return [ 27 | "map": "kelvinMap.png", 28 | ] 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/Filters/MTLarkFilter.metal: -------------------------------------------------------------------------------- 1 | // 2 | // MTLarkFilter.metal 3 | // MetalFilters 4 | // 5 | // Created by alexiscn on 2018/6/8. 6 | // 7 | 8 | #include 9 | #include "MTIShaderLib.h" 10 | #include "IFShaderLib.h" 11 | using namespace metalpetal; 12 | 13 | fragment float4 MTLarkFragment(VertexOut vertexIn [[ stage_in ]], 14 | texture2d inputTexture [[ texture(0) ]], 15 | texture2d lookup [[ texture(1) ]], 16 | constant float & strength [[ buffer(0)]], 17 | sampler textureSampler [[ sampler(0) ]]) 18 | { 19 | constexpr sampler s(coord::normalized, address::clamp_to_edge, filter::linear); 20 | float4 texel = inputTexture.sample(s, vertexIn.textureCoordinate); 21 | float4 inputTexel = texel; 22 | texel.rgb = metalColorLookUp(lookup, s, texel.rgb, 33).rgb; 23 | texel.rgb = mix(inputTexel.rgb, texel.rgb, strength); 24 | return texel; 25 | } 26 | -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/Filters/MTLarkFilter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MTLarkFilter.swift 3 | // MetalFilters 4 | // 5 | // Created by alexiscn on 2018/6/8. 6 | // 7 | 8 | import Foundation 9 | import MetalPetal 10 | 11 | class MTLarkFilter: MTFilter { 12 | 13 | override class var name: String { 14 | return "Lark" 15 | } 16 | 17 | override var borderName: String { 18 | return "filterBorderPlainWhite.png" 19 | } 20 | 21 | override var fragmentName: String { 22 | return "MTLarkFragment" 23 | } 24 | 25 | override var samplers: [String : String] { 26 | return [ 27 | "lookup": "lark_map.png", 28 | ] 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/Filters/MTLoFiFilter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MTLoFiFilter.swift 3 | // MetalFilters 4 | // 5 | // Created by alexiscn on 2018/6/8. 6 | // 7 | 8 | import Foundation 9 | import MetalPetal 10 | 11 | class MTLoFiFilter: MTFilter { 12 | 13 | override class var name: String { 14 | return "Lo-Fi" 15 | } 16 | 17 | override var borderName: String { 18 | return "lomoBorder.png" 19 | } 20 | 21 | override var fragmentName: String { 22 | return "MTLoFiFragment" 23 | } 24 | 25 | override var samplers: [String : String] { 26 | return [ 27 | "lomoMap": "lomoMap.png", 28 | "vignetteMap": "blackOverlayMap.png", 29 | ] 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/Filters/MTLudwigFilter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MTLudwigFilter.swift 3 | // MetalFilters 4 | // 5 | // Created by alexiscn on 2018/6/8. 6 | // 7 | 8 | import Foundation 9 | import MetalPetal 10 | 11 | class MTLudwigFilter: MTFilter { 12 | 13 | override class var name: String { 14 | return "Ludwig" 15 | } 16 | 17 | override var borderName: String { 18 | return "filterBorderPlainWhite.png" 19 | } 20 | 21 | override var fragmentName: String { 22 | return "MTLudwigFragment" 23 | } 24 | 25 | override var samplers: [String : String] { 26 | return [ 27 | "lookup": "ludwig_map.png", 28 | ] 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/Filters/MTMavenVideoFilter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MTMavenVideoFilter.swift 3 | // MetalFilters 4 | // 5 | // Created by alexiscn on 2018/6/8. 6 | // 7 | 8 | import Foundation 9 | import MetalPetal 10 | 11 | class MTMavenVideoFilter: MTFilter { 12 | 13 | override class var name: String { 14 | return "Maven" 15 | } 16 | 17 | override var borderName: String { 18 | return "filterBorderPlainWhite.png" 19 | } 20 | 21 | override var fragmentName: String { 22 | return "MTMavenVideoFragment" 23 | } 24 | 25 | override var samplers: [String : String] { 26 | return [ 27 | "map1": "Lansdowne1.png", 28 | "map2": "Lansdowne2.png", 29 | ] 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/Filters/MTMayfairFilter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MTMayfairFilter.swift 3 | // MetalFilters 4 | // 5 | // Created by alexiscn on 2018/6/8. 6 | // 7 | 8 | import Foundation 9 | import MetalPetal 10 | 11 | class MTMayfairFilter: MTFilter { 12 | 13 | override class var name: String { 14 | return "Mayfair" 15 | } 16 | 17 | override var borderName: String { 18 | return "mayfairBorder.png" 19 | } 20 | 21 | override var fragmentName: String { 22 | return "MTMayfairFragment" 23 | } 24 | 25 | override var samplers: [String : String] { 26 | return [ 27 | "colorOverlay": "mayfairColorOverlay.png", 28 | "glowField": "mayfairGlowField.png", 29 | "map": "mayfairColorGradient.png", 30 | "overlay": "mayfairOverlayMap100.png", 31 | ] 32 | } 33 | 34 | } -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/Filters/MTMoonVideoFilter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MTMoonVideoFilter.swift 3 | // MetalFilters 4 | // 5 | // Created by alexiscn on 2018/6/8. 6 | // 7 | 8 | import Foundation 9 | import MetalPetal 10 | 11 | class MTMoonVideoFilter: MTFilter { 12 | 13 | override class var name: String { 14 | return "Moon" 15 | } 16 | 17 | override var borderName: String { 18 | return "filterBorderPlainWhite.png" 19 | } 20 | 21 | override var fragmentName: String { 22 | return "MTMoonVideoFragment" 23 | } 24 | 25 | override var samplers: [String : String] { 26 | return [ 27 | "map1": "bw_vintage_curves1.png", 28 | "map2": "bw_vintage_curves2.png", 29 | ] 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/Filters/MTNashvilleFilter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MTNashvilleFilter.swift 3 | // MetalFilters 4 | // 5 | // Created by alexiscn on 2018/6/8. 6 | // 7 | 8 | import Foundation 9 | import MetalPetal 10 | 11 | class MTNashvilleFilter: MTFilter { 12 | 13 | override class var name: String { 14 | return "Nashville" 15 | } 16 | 17 | override var borderName: String { 18 | return "nashvilleBorder.png" 19 | } 20 | 21 | override var fragmentName: String { 22 | return "MTNashvilleFragment" 23 | } 24 | 25 | override var samplers: [String : String] { 26 | return [ 27 | "map": "nashvilleMap.png", 28 | ] 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/Filters/MTNormalFilter.metal: -------------------------------------------------------------------------------- 1 | // 2 | // MTNormalFilter.metal 3 | // MetalFilters 4 | // 5 | // Created by alexiscn on 2018/6/8. 6 | // 7 | 8 | #include 9 | #include "MTIShaderLib.h" 10 | #include "IFShaderLib.h" 11 | using namespace metalpetal; 12 | 13 | fragment float4 MTNormalFragment(VertexOut vertexIn [[ stage_in ]], 14 | texture2d inputTexture [[ texture(0) ]], 15 | constant float & strength [[ buffer(0)]], 16 | sampler textureSampler [[ sampler(0) ]]) 17 | { 18 | constexpr sampler s(coord::normalized, address::clamp_to_edge, filter::linear); 19 | float4 texel = inputTexture.sample(s, vertexIn.textureCoordinate); 20 | float4 inputTexel = texel; 21 | 22 | texel.rgb = mix(inputTexel.rgb, texel.rgb, strength); 23 | return texel; 24 | } 25 | -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/Filters/MTNormalFilter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MTNormalFilter.swift 3 | // MetalFilters 4 | // 5 | // Created by alexiscn on 2018/6/8. 6 | // 7 | 8 | import Foundation 9 | import MetalPetal 10 | 11 | class MTNormalFilter: MTFilter { 12 | 13 | override class var name: String { 14 | return "Normal" 15 | } 16 | 17 | override var borderName: String { 18 | return "" 19 | } 20 | 21 | override var fragmentName: String { 22 | return "MTNormalFragment" 23 | } 24 | 25 | override var samplers: [String : String] { 26 | return [ 27 | : 28 | ] 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/Filters/MTPerpetuaFilter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MTPerpetuaFilter.swift 3 | // MetalFilters 4 | // 5 | // Created by alexiscn on 2018/6/8. 6 | // 7 | 8 | import Foundation 9 | import MetalPetal 10 | 11 | class MTPerpetuaFilter: MTFilter { 12 | 13 | override class var name: String { 14 | return "Perpetua" 15 | } 16 | 17 | override var borderName: String { 18 | return "filterBorderPlainWhite.png" 19 | } 20 | 21 | override var fragmentName: String { 22 | return "MTPerpetuaFragment" 23 | } 24 | 25 | override var samplers: [String : String] { 26 | return [ 27 | "gradient": "perpetua_overlay.png", 28 | "lookup": "perpetua_map.png", 29 | ] 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/Filters/MTReyesFilter.metal: -------------------------------------------------------------------------------- 1 | // 2 | // MTReyesFilter.metal 3 | // MetalFilters 4 | // 5 | // Created by alexiscn on 2018/6/8. 6 | // 7 | 8 | #include 9 | #include "MTIShaderLib.h" 10 | #include "IFShaderLib.h" 11 | using namespace metalpetal; 12 | 13 | fragment float4 MTReyesFragment(VertexOut vertexIn [[ stage_in ]], 14 | texture2d inputTexture [[ texture(0) ]], 15 | texture2d lookup [[ texture(1) ]], 16 | constant float & strength [[ buffer(0)]], 17 | sampler textureSampler [[ sampler(0) ]]) 18 | { 19 | constexpr sampler s(coord::normalized, address::clamp_to_edge, filter::linear); 20 | float4 texel = inputTexture.sample(s, vertexIn.textureCoordinate); 21 | float4 inputTexel = texel; 22 | texel.rgb = metalColorLookUp(lookup, s, texel.rgb, 33).rgb; 23 | texel.rgb = mix(inputTexel.rgb, texel.rgb, strength); 24 | return texel; 25 | } 26 | -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/Filters/MTReyesFilter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MTReyesFilter.swift 3 | // MetalFilters 4 | // 5 | // Created by alexiscn on 2018/6/8. 6 | // 7 | 8 | import Foundation 9 | import MetalPetal 10 | 11 | class MTReyesFilter: MTFilter { 12 | 13 | override class var name: String { 14 | return "Reyes" 15 | } 16 | 17 | override var borderName: String { 18 | return "filterBorderPlainWhite.png" 19 | } 20 | 21 | override var fragmentName: String { 22 | return "MTReyesFragment" 23 | } 24 | 25 | override var samplers: [String : String] { 26 | return [ 27 | "lookup": "reyes_map.png", 28 | ] 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/Filters/MTRiseFilter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MTRiseFilter.swift 3 | // MetalFilters 4 | // 5 | // Created by alexiscn on 2018/6/8. 6 | // 7 | 8 | import Foundation 9 | import MetalPetal 10 | 11 | class MTRiseFilter: MTFilter { 12 | 13 | override class var name: String { 14 | return "Rise" 15 | } 16 | 17 | override var borderName: String { 18 | return "riseBorder.png" 19 | } 20 | 21 | override var fragmentName: String { 22 | return "MTRiseFragment" 23 | } 24 | 25 | override var samplers: [String : String] { 26 | return [ 27 | "blowout": "blackboard.png", 28 | "map": "riseMap.png", 29 | "overlay": "overlayMap.png", 30 | ] 31 | } 32 | 33 | } -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/Filters/MTSierraFilter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MTSierraFilter.swift 3 | // MetalFilters 4 | // 5 | // Created by alexiscn on 2018/6/8. 6 | // 7 | 8 | import Foundation 9 | import MetalPetal 10 | 11 | class MTSierraFilter: MTFilter { 12 | 13 | override class var name: String { 14 | return "Sierra" 15 | } 16 | 17 | override var borderName: String { 18 | return "sierraBorder.png" 19 | } 20 | 21 | override var fragmentName: String { 22 | return "MTSierraFragment" 23 | } 24 | 25 | override var samplers: [String : String] { 26 | return [ 27 | "map": "sierraMap.png", 28 | "overlay": "overlayMap.png", 29 | "smoke": "sierraSmoke.png", 30 | "softLight": "softLight100.png", 31 | "vignette": "sierraVignette.png", 32 | ] 33 | } 34 | 35 | } -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/Filters/MTSkylineVideoFilter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MTSkylineVideoFilter.swift 3 | // MetalFilters 4 | // 5 | // Created by alexiscn on 2018/6/8. 6 | // 7 | 8 | import Foundation 9 | import MetalPetal 10 | 11 | class MTSkylineVideoFilter: MTFilter { 12 | 13 | override class var name: String { 14 | return "Skyline" 15 | } 16 | 17 | override var borderName: String { 18 | return "filterBorderPlainWhite.png" 19 | } 20 | 21 | override var fragmentName: String { 22 | return "MTSkylineVideoFragment" 23 | } 24 | 25 | override var samplers: [String : String] { 26 | return [ 27 | "map": "super_film_stock_curves.png", 28 | ] 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/Filters/MTSlumberFilter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MTSlumberFilter.swift 3 | // MetalFilters 4 | // 5 | // Created by alexiscn on 2018/6/8. 6 | // 7 | 8 | import Foundation 9 | import MetalPetal 10 | 11 | class MTSlumberFilter: MTFilter { 12 | 13 | override class var name: String { 14 | return "Slumber" 15 | } 16 | 17 | override var borderName: String { 18 | return "filterBorderPlainWhite.png" 19 | } 20 | 21 | override var fragmentName: String { 22 | return "MTSlumberFragment" 23 | } 24 | 25 | override var samplers: [String : String] { 26 | return [ 27 | "lookup": "slumber_map.png", 28 | ] 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/Filters/MTStinsonVideoFilter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MTStinsonVideoFilter.swift 3 | // MetalFilters 4 | // 5 | // Created by alexiscn on 2018/6/8. 6 | // 7 | 8 | import Foundation 9 | import MetalPetal 10 | 11 | class MTStinsonVideoFilter: MTFilter { 12 | 13 | override class var name: String { 14 | return "Stinson" 15 | } 16 | 17 | override var borderName: String { 18 | return "filterBorderPlainWhite.png" 19 | } 20 | 21 | override var fragmentName: String { 22 | return "MTStinsonVideoFragment" 23 | } 24 | 25 | override var samplers: [String : String] { 26 | return [ 27 | "map": "seventies_curves.png", 28 | ] 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/Filters/MTSutroFilter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MTSutroFilter.swift 3 | // MetalFilters 4 | // 5 | // Created by alexiscn on 2018/6/8. 6 | // 7 | 8 | import Foundation 9 | import MetalPetal 10 | 11 | class MTSutroFilter: MTFilter { 12 | 13 | override class var name: String { 14 | return "Sutro" 15 | } 16 | 17 | override var borderName: String { 18 | return "sutroBorder.png" 19 | } 20 | 21 | override var fragmentName: String { 22 | return "MTSutroFragment" 23 | } 24 | 25 | override var samplers: [String : String] { 26 | return [ 27 | "curves": "sutroCurves.png", 28 | "edgeBurn": "sutroEdgeBurn.pvr", 29 | "softLight": "softLight.png", 30 | "sutroMetal": "sutroMetal.pvr", 31 | "vignetteMap": "blackOverlayMap.png", 32 | ] 33 | } 34 | 35 | } -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/Filters/MTToasterFilter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MTToasterFilter.swift 3 | // MetalFilters 4 | // 5 | // Created by alexiscn on 2018/6/8. 6 | // 7 | 8 | import Foundation 9 | import MetalPetal 10 | 11 | class MTToasterFilter: MTFilter { 12 | 13 | override class var name: String { 14 | return "Toaster" 15 | } 16 | 17 | override var borderName: String { 18 | return "filterBorderPlainWhite.png" 19 | } 20 | 21 | override var fragmentName: String { 22 | return "MTToasterFragment" 23 | } 24 | 25 | override var samplers: [String : String] { 26 | return [ 27 | "colorShift": "toasterColorShift.png", 28 | "curves": "toasterCurves.png", 29 | "metal": "metalTexture2.pvr", 30 | "softLight": "toasterSoftLight.png", 31 | "vignetteMap": "toasterOverlayMapWarm.png", 32 | ] 33 | } 34 | 35 | } -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/Filters/MTValenciaFilter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MTValenciaFilter.swift 3 | // MetalFilters 4 | // 5 | // Created by alexiscn on 2018/6/8. 6 | // 7 | 8 | import Foundation 9 | import MetalPetal 10 | 11 | class MTValenciaFilter: MTFilter { 12 | 13 | override class var name: String { 14 | return "Valencia" 15 | } 16 | 17 | override var borderName: String { 18 | return "filterBorderPlainWhite.png" 19 | } 20 | 21 | override var fragmentName: String { 22 | return "MTValenciaFragment" 23 | } 24 | 25 | override var samplers: [String : String] { 26 | return [ 27 | "gradientMap": "valenciaGradientMap.png", 28 | "map": "valenciaMap.png", 29 | ] 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/Filters/MTVesperVideoFilter.metal: -------------------------------------------------------------------------------- 1 | // 2 | // MTVesperVideoFilter.metal 3 | // MetalFilters 4 | // 5 | // Created by alexiscn on 2018/6/8. 6 | // 7 | 8 | #include 9 | #include "MTIShaderLib.h" 10 | #include "IFShaderLib.h" 11 | using namespace metalpetal; 12 | 13 | fragment float4 MTVesperVideoFragment(VertexOut vertexIn [[ stage_in ]], 14 | texture2d inputTexture [[ texture(0) ]], 15 | texture2d map [[ texture(1) ]], 16 | constant float & strength [[ buffer(0)]], 17 | sampler textureSampler [[ sampler(0) ]]) 18 | { 19 | constexpr sampler s(coord::normalized, address::clamp_to_edge, filter::linear); 20 | float4 texel = inputTexture.sample(s, vertexIn.textureCoordinate); 21 | float4 inputTexel = texel; 22 | texel.r = map.sample(s, float2(texel.r, 0.5)).r; 23 | texel.g = map.sample(s, float2(texel.g, 0.5)).g; 24 | texel.b = map.sample(s, float2(texel.b, 0.5)).b; 25 | texel.rgb = mix(inputTexel.rgb, texel.rgb, strength); 26 | return texel; 27 | } 28 | -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/Filters/MTVesperVideoFilter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MTVesperVideoFilter.swift 3 | // MetalFilters 4 | // 5 | // Created by alexiscn on 2018/6/8. 6 | // 7 | 8 | import Foundation 9 | import MetalPetal 10 | 11 | class MTVesperVideoFilter: MTFilter { 12 | 13 | override class var name: String { 14 | return "Vesper" 15 | } 16 | 17 | override var borderName: String { 18 | return "filterBorderPlainWhite.png" 19 | } 20 | 21 | override var fragmentName: String { 22 | return "MTVesperVideoFragment" 23 | } 24 | 25 | override var samplers: [String : String] { 26 | return [ 27 | "map": "luster_map.png", 28 | ] 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/Filters/MTWaldenFilter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MTWaldenFilter.swift 3 | // MetalFilters 4 | // 5 | // Created by alexiscn on 2018/6/8. 6 | // 7 | 8 | import Foundation 9 | import MetalPetal 10 | 11 | class MTWaldenFilter: MTFilter { 12 | 13 | override class var name: String { 14 | return "Walden" 15 | } 16 | 17 | override var borderName: String { 18 | return "waldenBorder.png" 19 | } 20 | 21 | override var fragmentName: String { 22 | return "MTWaldenFragment" 23 | } 24 | 25 | override var samplers: [String : String] { 26 | return [ 27 | "vignetteMap": "vignetteMap.png", 28 | "waldenMap": "waldenMap.png", 29 | ] 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/Filters/MTWillowFilter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MTWillowFilter.swift 3 | // MetalFilters 4 | // 5 | // Created by alexiscn on 2018/6/8. 6 | // 7 | 8 | import Foundation 9 | import MetalPetal 10 | 11 | class MTWillowFilter: MTFilter { 12 | 13 | override class var name: String { 14 | return "Willow" 15 | } 16 | 17 | override var borderName: String { 18 | return "willowBorder.png" 19 | } 20 | 21 | override var fragmentName: String { 22 | return "MTWillowFragment" 23 | } 24 | 25 | override var samplers: [String : String] { 26 | return [ 27 | "borderTexture": "borderTexture.png", 28 | "glowMap": "glowField.png", 29 | "map": "willowMap.png", 30 | "overlayMap": "overlayMap81.png", 31 | "softLightMap": "willowSoftLight100.png", 32 | "vignette": "willowVignette.png", 33 | ] 34 | } 35 | 36 | } -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/Filters/MTXpro2Filter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MTXpro2Filter.swift 3 | // MetalFilters 4 | // 5 | // Created by alexiscn on 2018/6/8. 6 | // 7 | 8 | import Foundation 9 | import MetalPetal 10 | 11 | class MTXpro2Filter: MTFilter { 12 | 13 | override class var name: String { 14 | return "X-Pro II" 15 | } 16 | 17 | override var borderName: String { 18 | return "XPro2Border.png" 19 | } 20 | 21 | override var fragmentName: String { 22 | return "MTXpro2Fragment" 23 | } 24 | 25 | override var samplers: [String : String] { 26 | return [ 27 | "vignetteMap": "plusDarker.png", 28 | "xproMap": "xproMap.png", 29 | ] 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/MTFilter/MTAntiLuxFilter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MTAntiLuxFilter.swift 3 | // MetalFilters 4 | // 5 | // Created by xu.shuifeng on 2018/6/13. 6 | // Copyright © 2018 shuifeng.me. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/MTFilter/MTFilterGroup.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MTFilterGroup.swift 3 | // MetalFilters 4 | // 5 | // Created by xushuifeng on 2018/6/17. 6 | // Copyright © 2018 shuifeng.me. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class MTFilterGroup { 12 | 13 | private var filters: [MTFilter] = [] 14 | 15 | func add(filter: MTFilter) { 16 | 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/MTFilter/MTImageOverlayFilter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MTImageOverlayFilter.swift 3 | // MetalFilters 4 | // 5 | // Created by xu.shuifeng on 2018/6/15. 6 | // Copyright © 2018 shuifeng.me. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import MetalPetal 11 | 12 | class MTImageOverlayFilter: MTFilter { 13 | 14 | override var fragmentName: String { 15 | return "MTImageOverlayFilterFragment" 16 | } 17 | 18 | override func modifySamplersIfNeeded(_ samplers: [MTIImage]) -> [MTIImage] { 19 | return samplers 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/MTFilter/MTLocalLaplacianFilter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MTLocalLaplacianFilter.swift 3 | // MetalFilters 4 | // 5 | // Created by xu.shuifeng on 2018/6/13. 6 | // Copyright © 2018 shuifeng.me. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class MTLocalLaplacianFilter: MTFilter { 12 | 13 | var filterStrength: Float = 0 14 | 15 | override var fragmentName: String { 16 | return "MTLocalLaplacianFilterFragment" 17 | } 18 | 19 | override var samplers: [String : String] { 20 | return [:] 21 | } 22 | 23 | override var parameters: [String: Any] { 24 | return [ "filterStrength" : filterStrength] 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/MTFilter/MTLuxBlendFilter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MTLuxBlendFilter.swift 3 | // MetalFilters 4 | // 5 | // Created by xu.shuifeng on 2018/6/13. 6 | // Copyright © 2018 shuifeng.me. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class MTLuxBlendFilter: MTFilter { 12 | 13 | var luxBlendAmount: Float = 0 14 | 15 | override var parameters: [String : Any] { 16 | return ["luxBlendAmount": luxBlendAmount] 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/MTFilter/MTStarlightFilter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MTStarlightFilter.swift 3 | // MetalFilters 4 | // 5 | // Created by xu.shuifeng on 2018/6/13. 6 | // Copyright © 2018 shuifeng.me. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class MTStarlightFilter: MTFilter { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /MagicCamera/SwiftUICam/UserEvents.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UserEvents.swift 3 | // SwiftUICam 4 | // 5 | // Created by Pierre Véron on 31.03.20. 6 | // Copyright © 2020 Pierre Véron. All rights reserved. 7 | // 8 | import SwiftUI 9 | 10 | public class UserEvents: ObservableObject { 11 | @Published public var didAskToCapturePhoto = false 12 | @Published public var didAskToRotateCamera = false 13 | 14 | public init() { 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/GPUImage.xcodeproj/GPUImage_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | NSHumanReadableCopyright 22 | Copyright © 2018 Red Queen Coder, LLC. All rights reserved. 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/GPUImage.xcodeproj/xcuserdata/william.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | GPUImage_iOS.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 4 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Color.swift: -------------------------------------------------------------------------------- 1 | public struct Color { 2 | public let redComponent:Float 3 | public let greenComponent:Float 4 | public let blueComponent:Float 5 | public let alphaComponent:Float 6 | 7 | public init(red:Float, green:Float, blue:Float, alpha:Float = 1.0) { 8 | self.redComponent = red 9 | self.greenComponent = green 10 | self.blueComponent = blue 11 | self.alphaComponent = alpha 12 | } 13 | 14 | public static let black = Color(red:0.0, green:0.0, blue:0.0, alpha:1.0) 15 | public static let white = Color(red:1.0, green:1.0, blue:1.0, alpha:1.0) 16 | public static let red = Color(red:1.0, green:0.0, blue:0.0, alpha:1.0) 17 | public static let green = Color(red:0.0, green:1.0, blue:0.0, alpha:1.0) 18 | public static let blue = Color(red:0.0, green:0.0, blue:1.0, alpha:1.0) 19 | public static let transparent = Color(red:0.0, green:0.0, blue:0.0, alpha:0.0) 20 | } 21 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/ImageGenerator.swift: -------------------------------------------------------------------------------- 1 | public class ImageGenerator: ImageSource { 2 | public var size:Size 3 | 4 | public let targets = TargetContainer() 5 | var internalTexture:Texture! 6 | 7 | public init(size:Size) { 8 | self.size = size 9 | internalTexture = Texture(device:sharedMetalRenderingDevice.device, orientation:.portrait, width:Int(size.width), height:Int(size.height), timingStyle:.stillImage) 10 | } 11 | 12 | public func transmitPreviousImage(to target:ImageConsumer, atIndex:UInt) { 13 | target.newTextureAvailable(internalTexture, fromSourceIndex:atIndex) 14 | } 15 | 16 | func notifyTargets() { 17 | updateTargetsWithTexture(internalTexture) 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/OperationGroup.swift: -------------------------------------------------------------------------------- 1 | open class OperationGroup: ImageProcessingOperation { 2 | let inputImageRelay = ImageRelay() 3 | let outputImageRelay = ImageRelay() 4 | 5 | public var sources:SourceContainer { get { return inputImageRelay.sources } } 6 | public var targets:TargetContainer { get { return outputImageRelay.targets } } 7 | public let maximumInputs:UInt = 1 8 | 9 | public init() { 10 | } 11 | 12 | public func newTextureAvailable(_ texture:Texture, fromSourceIndex:UInt) { 13 | inputImageRelay.newTextureAvailable(texture, fromSourceIndex:fromSourceIndex) 14 | } 15 | 16 | public func configureGroup(_ configurationOperation:(_ input:ImageRelay, _ output:ImageRelay) -> ()) { 17 | configurationOperation(inputImageRelay, outputImageRelay) 18 | } 19 | 20 | public func transmitPreviousImage(to target:ImageConsumer, atIndex:UInt) { 21 | outputImageRelay.transmitPreviousImage(to:target, atIndex:atIndex) 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/AdaptiveThreshold.metal: -------------------------------------------------------------------------------- 1 | #include 2 | #include "OperationShaderTypes.h" 3 | using namespace metal; 4 | 5 | fragment half4 adaptiveThresholdFragment(TwoInputVertexIO fragmentInput [[stage_in]], 6 | texture2d inputTexture1 [[texture(0)]], 7 | texture2d inputTexture2 [[texture(1)]]) 8 | { 9 | constexpr sampler quadSampler; 10 | half blurredInput = inputTexture1.sample(quadSampler, fragmentInput.textureCoordinate).r; 11 | half localLuminance = inputTexture2.sample(quadSampler, fragmentInput.textureCoordinate).r; 12 | half thresholdResult = step(blurredInput - 0.05h, localLuminance); 13 | 14 | return half4(half3(thresholdResult), 1.0); 15 | } 16 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/AdaptiveThreshold.swift: -------------------------------------------------------------------------------- 1 | public class AdaptiveThreshold: OperationGroup { 2 | public var blurRadiusInPixels: Float { didSet { boxBlur.blurRadiusInPixels = blurRadiusInPixels } } 3 | 4 | let luminance = Luminance() 5 | let boxBlur = BoxBlur() 6 | let adaptiveThreshold = BasicOperation(fragmentFunctionName:"adaptiveThresholdFragment", numberOfInputs:2) 7 | 8 | public override init() { 9 | blurRadiusInPixels = 4.0 10 | super.init() 11 | 12 | self.configureGroup{input, output in 13 | input --> self.luminance --> self.boxBlur --> self.adaptiveThreshold --> output 14 | self.luminance --> self.adaptiveThreshold 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/AddBlend.swift: -------------------------------------------------------------------------------- 1 | public class AddBlend: BasicOperation { 2 | 3 | public init() { 4 | super.init(fragmentFunctionName:"addBlendFragment", numberOfInputs:2) 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/AlphaBlend.metal: -------------------------------------------------------------------------------- 1 | #include 2 | #include "OperationShaderTypes.h" 3 | using namespace metal; 4 | 5 | typedef struct 6 | { 7 | float mixturePercent; 8 | } AlphaBlendUniform; 9 | 10 | fragment half4 alphaBlendFragment(TwoInputVertexIO fragmentInput [[stage_in]], 11 | texture2d inputTexture [[texture(0)]], 12 | texture2d inputTexture2 [[texture(1)]], 13 | constant AlphaBlendUniform& uniform [[ buffer(1) ]]) 14 | { 15 | constexpr sampler quadSampler; 16 | half4 textureColor = inputTexture.sample(quadSampler, fragmentInput.textureCoordinate); 17 | constexpr sampler quadSampler2; 18 | half4 textureColor2 = inputTexture2.sample(quadSampler, fragmentInput.textureCoordinate2); 19 | 20 | return half4(mix(textureColor.rgb, textureColor2.rgb, textureColor2.a * half(uniform.mixturePercent)), textureColor.a); 21 | } 22 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/AlphaBlend.swift: -------------------------------------------------------------------------------- 1 | public class AlphaBlend: BasicOperation { 2 | public var mix:Float = 0.5 { didSet { uniformSettings["mixturePercent"] = mix } } 3 | 4 | public init() { 5 | super.init(fragmentFunctionName:"alphaBlendFragment", numberOfInputs:2) 6 | 7 | ({mix = 0.5})() 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/AmatorkaFilter.swift: -------------------------------------------------------------------------------- 1 | /** A photo filter based on Photoshop action by Amatorka 2 | http://amatorka.deviantart.com/art/Amatorka-Action-2-121069631 3 | */ 4 | 5 | public class AmatorkaFilter: LookupFilter { 6 | public override init() { 7 | super.init() 8 | 9 | ({lookupImage = PictureInput(imageName:"lookup_amatorka.png")})() 10 | ({intensity = 1.0})() 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/BlendShaderTypes.h: -------------------------------------------------------------------------------- 1 | #ifndef BLENDSHADERTYPES_H 2 | #define BLENDSHADERTYPES_H 3 | 4 | half lum(half3 c); 5 | 6 | half3 clipcolor(half3 c); 7 | 8 | half3 setlum(half3 c, half l); 9 | 10 | half sat(half3 c); 11 | 12 | half mid(half cmin, half cmid, half cmax, half s); 13 | 14 | half3 setsat(half3 c, half s); 15 | 16 | float mod(float x, float y); 17 | 18 | float2 mod(float2 x, float2 y); 19 | 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/BrightnessAdjustment.metal: -------------------------------------------------------------------------------- 1 | #include 2 | #include "OperationShaderTypes.h" 3 | 4 | using namespace metal; 5 | 6 | typedef struct 7 | { 8 | float brightness; 9 | } BrightnessUniform; 10 | 11 | fragment half4 brightnessFragment(SingleInputVertexIO fragmentInput [[stage_in]], 12 | texture2d inputTexture [[texture(0)]], 13 | constant BrightnessUniform& uniform [[ buffer(1) ]]) 14 | { 15 | constexpr sampler quadSampler; 16 | half4 color = inputTexture.sample(quadSampler, fragmentInput.textureCoordinate); 17 | 18 | return half4(color.rgb + uniform.brightness, color.a); 19 | } 20 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/BrightnessAdjustment.swift: -------------------------------------------------------------------------------- 1 | public class BrightnessAdjustment: BasicOperation { 2 | public var brightness:Float = 0.0 { didSet { uniformSettings["brightness"] = brightness } } 3 | 4 | public init() { 5 | super.init(fragmentFunctionName:"brightnessFragment", numberOfInputs:1) 6 | 7 | ({brightness = 0.0})() 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/BulgeDistortion.swift: -------------------------------------------------------------------------------- 1 | public class BulgeDistortion: BasicOperation { 2 | public var radius:Float = 0.25 { didSet { uniformSettings["radius"] = radius } } 3 | public var scale:Float = 0.5 { didSet { uniformSettings["scale"] = scale } } 4 | public var center:Position = Position.center { didSet { uniformSettings["center"] = center } } 5 | 6 | public init() { 7 | super.init(fragmentFunctionName:"bulgeDistortionFragment", numberOfInputs:1) 8 | 9 | ({radius = 0.25})() 10 | ({scale = 0.5})() 11 | ({center = Position.center})() 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/CGAColorspace.swift: -------------------------------------------------------------------------------- 1 | public class CGAColorspaceFilter: BasicOperation { 2 | public init() { 3 | super.init(fragmentFunctionName:"CGAColorspaceFragment", numberOfInputs:1) 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/ChromaKey.swift: -------------------------------------------------------------------------------- 1 | public class ChromaKeying: BasicOperation { 2 | public var thresholdSensitivity:Float = 0.4 { didSet { uniformSettings["thresholdSensitivity"] = thresholdSensitivity } } 3 | public var smoothing:Float = 0.1 { didSet { uniformSettings["smoothing"] = smoothing } } 4 | public var colorToReplace:Color = Color.green { didSet { uniformSettings["colorToReplace"] = colorToReplace } } 5 | 6 | public init() { 7 | super.init(fragmentFunctionName:"ChromaKeyFragment", numberOfInputs:1) 8 | 9 | ({thresholdSensitivity = 0.4})() 10 | ({smoothing = 0.1})() 11 | ({colorToReplace = Color.green})() 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/ChromaKeyBlend.swift: -------------------------------------------------------------------------------- 1 | public class ChromaKeyBlend: BasicOperation { 2 | public var thresholdSensitivity:Float = 0.4 { didSet { uniformSettings["thresholdSensitivity"] = thresholdSensitivity } } 3 | public var smoothing:Float = 0.1 { didSet { uniformSettings["smoothing"] = smoothing } } 4 | public var colorToReplace:Color = Color.green { didSet { uniformSettings["colorToReplace"] = colorToReplace } } 5 | 6 | public init() { 7 | super.init(fragmentFunctionName:"chromaKeyBlendFragment", numberOfInputs:2) 8 | 9 | ({thresholdSensitivity = 0.4})() 10 | ({smoothing = 0.1})() 11 | ({colorToReplace = Color.green})() 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/ColorBlend.metal: -------------------------------------------------------------------------------- 1 | #include 2 | #include "OperationShaderTypes.h" 3 | #include "BlendShaderTypes.h" 4 | using namespace metal; 5 | 6 | fragment half4 colorBlendFragment(TwoInputVertexIO fragmentInput [[stage_in]], 7 | texture2d inputTexture [[texture(0)]], 8 | texture2d inputTexture2 [[texture(1)]]) 9 | { 10 | constexpr sampler quadSampler; 11 | half4 base = inputTexture.sample(quadSampler, fragmentInput.textureCoordinate); 12 | constexpr sampler quadSampler2; 13 | half4 overlay = inputTexture2.sample(quadSampler, fragmentInput.textureCoordinate2); 14 | 15 | return half4(base.rgb * (1.0h - overlay.a) + setlum(overlay.rgb, lum(base.rgb)) * overlay.a, base.a); 16 | } 17 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/ColorBlend.swift: -------------------------------------------------------------------------------- 1 | public class ColorBlend: BasicOperation { 2 | public init() { 3 | super.init(fragmentFunctionName:"colorBlendFragment", numberOfInputs:2) 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/ColorBurnBlend.metal: -------------------------------------------------------------------------------- 1 | #include 2 | #include "OperationShaderTypes.h" 3 | using namespace metal; 4 | 5 | fragment half4 colorBurnBlendFragment(TwoInputVertexIO fragmentInput [[stage_in]], 6 | texture2d inputTexture [[texture(0)]], 7 | texture2d inputTexture2 [[texture(1)]]) 8 | { 9 | constexpr sampler quadSampler; 10 | half4 textureColor = inputTexture.sample(quadSampler, fragmentInput.textureCoordinate); 11 | constexpr sampler quadSampler2; 12 | half4 textureColor2 = inputTexture2.sample(quadSampler, fragmentInput.textureCoordinate2); 13 | half4 whiteColor = half4(1.0); 14 | 15 | return whiteColor - (whiteColor - textureColor) / textureColor2; 16 | } 17 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/ColorBurnBlend.swift: -------------------------------------------------------------------------------- 1 | public class ColorBurnBlend: BasicOperation { 2 | public init() { 3 | super.init(fragmentFunctionName:"colorBurnBlendFragment", numberOfInputs:2) 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/ColorDodgeBlend.swift: -------------------------------------------------------------------------------- 1 | public class ColorDodgeBlend: BasicOperation { 2 | public init() { 3 | super.init(fragmentFunctionName:"colorDodgeBlendFragment", numberOfInputs:2) 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/ColorInversion.metal: -------------------------------------------------------------------------------- 1 | /* 2 | For a complete explanation behind the math of this shader, read this blog post: 3 | http://redqueengraphics.com/2018/07/15/metal-shaders-color-inversion/ 4 | */ 5 | 6 | #include 7 | #include "OperationShaderTypes.h" 8 | using namespace metal; 9 | 10 | fragment half4 colorInversionFragment(SingleInputVertexIO fragmentInput [[stage_in]], 11 | texture2d inputTexture [[texture(0)]]) 12 | { 13 | constexpr sampler quadSampler; 14 | half4 color = inputTexture.sample(quadSampler, fragmentInput.textureCoordinate); 15 | 16 | return half4((1.0 - color.rgb), color.a); 17 | } 18 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/ColorInversion.swift: -------------------------------------------------------------------------------- 1 | public class ColorInversion: BasicOperation { 2 | public init() { 3 | super.init(fragmentFunctionName:"colorInversionFragment", numberOfInputs:1) 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/ColorLocalBinaryPattern.swift: -------------------------------------------------------------------------------- 1 | /** 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 2 | http://www.ee.oulu.fi/~jhannuks/publications/SPIE2011a.pdf 3 | 4 | Right pixel is the most significant bit, traveling clockwise to get to the upper right, which is the least significant 5 | If the external pixel is greater than or equal to the center, set to 1, otherwise 0 6 | 7 | 2 1 0 8 | 3 7 9 | 4 5 6 10 | 11 | 01101101 12 | 76543210 13 | */ 14 | public class ColorLocalBinaryPattern: TextureSamplingOperation { 15 | public init() { 16 | super.init(fragmentFunctionName:"colorLocalBinaryPatternFragment") 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/ColorMatrixFilter.metal: -------------------------------------------------------------------------------- 1 | #include 2 | #include "OperationShaderTypes.h" 3 | using namespace metal; 4 | 5 | typedef struct 6 | { 7 | float intensity; 8 | float4x4 colorMatrix; 9 | } ColorMatrixUniform; 10 | 11 | fragment half4 colorMatrixFragment(SingleInputVertexIO fragmentInput [[stage_in]], 12 | texture2d inputTexture [[texture(0)]], 13 | constant ColorMatrixUniform& uniform [[ buffer(1) ]]) 14 | { 15 | constexpr sampler quadSampler; 16 | half4 color = inputTexture.sample(quadSampler, fragmentInput.textureCoordinate); 17 | half4 outputColor = color * half4x4(uniform.colorMatrix); 18 | 19 | return half4(uniform.intensity * outputColor) + ((1.0 - uniform.intensity) * color); 20 | } 21 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/ColorMatrixFilter.swift: -------------------------------------------------------------------------------- 1 | public class ColorMatrixFilter: BasicOperation { 2 | public var intensity:Float = 1.0 { didSet { uniformSettings["intensity"] = intensity } } 3 | public var colorMatrix:Matrix4x4 = Matrix4x4.identity { didSet { uniformSettings["colorMatrix"] = colorMatrix } } 4 | 5 | public init() { 6 | 7 | super.init(fragmentFunctionName:"colorMatrixFragment", numberOfInputs:1) 8 | 9 | ({intensity = 1.0})() 10 | ({colorMatrix = Matrix4x4.identity})() 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/ColorSwizzle.metal: -------------------------------------------------------------------------------- 1 | #include 2 | #include "OperationShaderTypes.h" 3 | 4 | using namespace metal; 5 | 6 | fragment half4 colorSwizzleFragment(SingleInputVertexIO fragmentInput [[stage_in]], 7 | texture2d inputTexture [[texture(0)]]) 8 | { 9 | constexpr sampler quadSampler; 10 | half4 color = inputTexture.sample(quadSampler, fragmentInput.textureCoordinate).bgra; 11 | 12 | return color; 13 | } 14 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/ContrastAdjustment.metal: -------------------------------------------------------------------------------- 1 | #include 2 | #include "OperationShaderTypes.h" 3 | using namespace metal; 4 | 5 | typedef struct 6 | { 7 | float contrast; 8 | } ContrastUniform; 9 | 10 | fragment half4 contrastFragment(SingleInputVertexIO fragmentInput [[stage_in]], 11 | texture2d inputTexture [[texture(0)]], 12 | constant ContrastUniform& uniform [[ buffer(1) ]]) 13 | { 14 | constexpr sampler quadSampler; 15 | half4 color = inputTexture.sample(quadSampler, fragmentInput.textureCoordinate); 16 | 17 | return half4(((color.rgb - half3(0.5)) * uniform.contrast + half3(0.5)), color.a); 18 | } 19 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/ContrastAdjustment.swift: -------------------------------------------------------------------------------- 1 | public class ContrastAdjustment: BasicOperation { 2 | public var contrast:Float = 1.0 { didSet { uniformSettings["contrast"] = contrast } } 3 | 4 | public init() { 5 | super.init(fragmentFunctionName:"contrastFragment", numberOfInputs:1) 6 | 7 | ({contrast = 1.0})() 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/Crosshatch.swift: -------------------------------------------------------------------------------- 1 | public class Crosshatch: BasicOperation { 2 | public var crossHatchSpacing:Float = 0.03 { didSet { uniformSettings["crossHatchSpacing"] = crossHatchSpacing } } 3 | public var lineWidth:Float = 0.003 { didSet { uniformSettings["lineWidth"] = lineWidth } } 4 | 5 | public init() { 6 | super.init(fragmentFunctionName:"crosshatchFragment", numberOfInputs:1) 7 | 8 | ({crossHatchSpacing = 0.03})() 9 | ({lineWidth = 0.003})() 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/DarkenBlend.metal: -------------------------------------------------------------------------------- 1 | #include 2 | #include "OperationShaderTypes.h" 3 | using namespace metal; 4 | 5 | fragment half4 darkenBlendFragment(TwoInputVertexIO fragmentInput [[stage_in]], 6 | texture2d inputTexture [[texture(0)]], 7 | texture2d inputTexture2 [[texture(1)]]) 8 | { 9 | constexpr sampler quadSampler; 10 | half4 base = inputTexture.sample(quadSampler, fragmentInput.textureCoordinate); 11 | constexpr sampler quadSampler2; 12 | half4 overlay = inputTexture2.sample(quadSampler, fragmentInput.textureCoordinate2); 13 | 14 | return half4(min(overlay.rgb * base.a, base.rgb * overlay.a) + overlay.rgb * (1.0h - base.a) + base.rgb * (1.0h - overlay.a), 1.0h); 15 | } 16 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/DarkenBlend.swift: -------------------------------------------------------------------------------- 1 | public class DarkenBlend: BasicOperation { 2 | public init() { 3 | super.init(fragmentFunctionName:"darkenBlendFragment", numberOfInputs:2) 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/DifferenceBlend.metal: -------------------------------------------------------------------------------- 1 | #include 2 | #include "OperationShaderTypes.h" 3 | using namespace metal; 4 | 5 | fragment half4 differenceBlendFragment(TwoInputVertexIO fragmentInput [[stage_in]], 6 | texture2d inputTexture [[texture(0)]], 7 | texture2d inputTexture2 [[texture(1)]]) 8 | { 9 | constexpr sampler quadSampler; 10 | half4 textureColor = inputTexture.sample(quadSampler, fragmentInput.textureCoordinate); 11 | constexpr sampler quadSampler2; 12 | half4 textureColor2 = inputTexture2.sample(quadSampler, fragmentInput.textureCoordinate2); 13 | 14 | return half4(abs(textureColor2.rgb - textureColor.rgb), textureColor.a); 15 | } 16 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/DifferenceBlend.swift: -------------------------------------------------------------------------------- 1 | public class DifferenceBlend: BasicOperation { 2 | public init() { 3 | super.init(fragmentFunctionName:"differenceBlendFragment", numberOfInputs:2) 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/DissolveBlend.metal: -------------------------------------------------------------------------------- 1 | #include 2 | #include "OperationShaderTypes.h" 3 | using namespace metal; 4 | 5 | typedef struct 6 | { 7 | float mixturePercent; 8 | } DissolveBlendUniform; 9 | 10 | fragment half4 dissolveBlendFragment(TwoInputVertexIO fragmentInput [[stage_in]], 11 | texture2d inputTexture [[texture(0)]], 12 | texture2d inputTexture2 [[texture(1)]], 13 | constant DissolveBlendUniform& uniform [[ buffer(1) ]]) 14 | { 15 | constexpr sampler quadSampler; 16 | half4 textureColor = inputTexture.sample(quadSampler, fragmentInput.textureCoordinate); 17 | constexpr sampler quadSampler2; 18 | half4 textureColor2 = inputTexture2.sample(quadSampler, fragmentInput.textureCoordinate2); 19 | 20 | return mix(textureColor, textureColor2, half(uniform.mixturePercent)); 21 | } 22 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/DissolveBlend.swift: -------------------------------------------------------------------------------- 1 | public class DissolveBlend: BasicOperation { 2 | public var mix:Float = 0.5 { didSet { uniformSettings["mixturePercent"] = mix } } 3 | 4 | public init() { 5 | super.init(fragmentFunctionName:"dissolveBlendFragment", numberOfInputs:2) 6 | 7 | ({mix = 0.5})() 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/DivideBlend.swift: -------------------------------------------------------------------------------- 1 | public class DivideBlend: BasicOperation { 2 | public init() { 3 | super.init(fragmentFunctionName: "divideBlendFragment", numberOfInputs:2) 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/EmbossFilter.swift: -------------------------------------------------------------------------------- 1 | public class EmbossFilter : Convolution3x3 { 2 | public var intensity:Float = 1.0 { 3 | didSet { 4 | self.convolutionKernel = Matrix3x3(rowMajorValues:[ 5 | intensity * (-2.0), -intensity, 0.0, 6 | -intensity, 1.0, intensity, 7 | 0.0, intensity, intensity * 2.0]) 8 | } 9 | } 10 | 11 | public override init() { 12 | super.init() 13 | 14 | ({intensity = 1.0})() 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/ExclusionBlend.metal: -------------------------------------------------------------------------------- 1 | #include 2 | #include "OperationShaderTypes.h" 3 | using namespace metal; 4 | 5 | fragment half4 exclusionBlendFragment(TwoInputVertexIO fragmentInput [[stage_in]], 6 | texture2d inputTexture [[texture(0)]], 7 | texture2d inputTexture2 [[texture(1)]]) 8 | { 9 | constexpr sampler quadSampler; 10 | half4 base = inputTexture.sample(quadSampler, fragmentInput.textureCoordinate); 11 | constexpr sampler quadSampler2; 12 | half4 overlay = inputTexture2.sample(quadSampler, fragmentInput.textureCoordinate2); 13 | 14 | return half4((overlay.rgb * base.a + base.rgb * overlay.a - 2.0h * overlay.rgb * base.rgb) + overlay.rgb * (1.0h - base.a) + base.rgb * (1.0h - overlay.a), base.a); 15 | } 16 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/ExclusionBlend.swift: -------------------------------------------------------------------------------- 1 | public class ExclusionBlend: BasicOperation { 2 | public init() { 3 | super.init(fragmentFunctionName:"exclusionBlendFragment", numberOfInputs:2) 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/ExposureAdjustment.metal: -------------------------------------------------------------------------------- 1 | #include 2 | #include "OperationShaderTypes.h" 3 | using namespace metal; 4 | 5 | typedef struct 6 | { 7 | float exposure; 8 | } ExposureUniform; 9 | 10 | fragment half4 exposureFragment(SingleInputVertexIO fragmentInput [[stage_in]], 11 | texture2d inputTexture [[texture(0)]], 12 | constant ExposureUniform& uniform [[ buffer(1) ]]) 13 | { 14 | constexpr sampler quadSampler; 15 | half4 color = inputTexture.sample(quadSampler, fragmentInput.textureCoordinate); 16 | 17 | return half4((color.rgb * pow(2.0, uniform.exposure)), color.a); 18 | } 19 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/ExposureAdjustment.swift: -------------------------------------------------------------------------------- 1 | public class ExposureAdjustment: BasicOperation { 2 | public var exposure:Float = 0.0 { didSet { uniformSettings["exposure"] = exposure } } 3 | 4 | public init() { 5 | super.init(fragmentFunctionName:"exposureFragment", numberOfInputs:1) 6 | 7 | ({exposure = 0.0})() 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/FalseColor.metal: -------------------------------------------------------------------------------- 1 | #include 2 | #include "OperationShaderTypes.h" 3 | using namespace metal; 4 | 5 | typedef struct 6 | { 7 | float4 firstColor; 8 | float4 secondColor; 9 | } FalseColorUniform; 10 | 11 | fragment half4 falseColorFragment(SingleInputVertexIO fragmentInput [[stage_in]], 12 | texture2d inputTexture [[texture(0)]], 13 | constant FalseColorUniform& uniform [[ buffer(1) ]]) 14 | { 15 | constexpr sampler quadSampler; 16 | half4 color = inputTexture.sample(quadSampler, fragmentInput.textureCoordinate); 17 | float luminance = dot(color.rgb, luminanceWeighting); 18 | 19 | return half4(mix(half3(uniform.firstColor.rgb), half3(uniform.secondColor.rgb), half3(luminance)), color.a); 20 | } 21 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/FalseColor.swift: -------------------------------------------------------------------------------- 1 | public class FalseColor: BasicOperation { 2 | public var firstColor:Color = Color(red:0.0, green:0.0, blue:0.5, alpha:1.0) { didSet { uniformSettings["firstColor"] = firstColor } } 3 | public var secondColor:Color = Color.red { didSet { uniformSettings["secondColor"] = secondColor } } 4 | 5 | public init() { 6 | super.init(fragmentFunctionName:"falseColorFragment", numberOfInputs:1) 7 | 8 | uniformSettings.colorUniformsUseAlpha = true 9 | ({firstColor = Color(red:0.0, green:0.0, blue:0.5, alpha:1.0)})() 10 | ({secondColor = Color.red})() 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/GammaAdjustment.metal: -------------------------------------------------------------------------------- 1 | #include 2 | #include "OperationShaderTypes.h" 3 | using namespace metal; 4 | 5 | typedef struct 6 | { 7 | float gamma; 8 | } GammaUniform; 9 | 10 | fragment half4 gammaFragment(SingleInputVertexIO fragmentInput [[stage_in]], 11 | texture2d inputTexture [[texture(0)]], 12 | constant GammaUniform& uniform [[ buffer(1) ]]) 13 | { 14 | constexpr sampler quadSampler; 15 | half4 color = inputTexture.sample(quadSampler, fragmentInput.textureCoordinate); 16 | 17 | return half4(pow(color.rgb, half3(uniform.gamma)), color.a); 18 | } 19 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/GammaAdjustment.swift: -------------------------------------------------------------------------------- 1 | public class GammaAdjustment: BasicOperation { 2 | public var gamma:Float = 1.0 { didSet { uniformSettings["gamma"] = gamma } } 3 | 4 | public init() { 5 | super.init(fragmentFunctionName:"gammaFragment", numberOfInputs:1) 6 | 7 | ({gamma = 1.0})() 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/GlassSphere.swift: -------------------------------------------------------------------------------- 1 | public class GlassSphereRefraction: BasicOperation { 2 | public var radius:Float = 0.25 { didSet { uniformSettings["radius"] = radius } } 3 | public var refractiveIndex:Float = 0.71 { didSet { uniformSettings["refractiveIndex"] = refractiveIndex } } 4 | public var center:Position = Position.center { didSet { uniformSettings["center"] = center } } 5 | 6 | public init() { 7 | super.init(fragmentFunctionName:"glassSphereFragment", numberOfInputs:1) 8 | 9 | ({radius = 0.25})() 10 | ({refractiveIndex = 0.71})() 11 | ({center = Position.center})() 12 | 13 | // self.backgroundColor = Color(red:0.0, green:0.0, blue:0.0, alpha:0.0) 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/HalfTone.swift: -------------------------------------------------------------------------------- 1 | public class Halftone: BasicOperation { 2 | public var fractionalWidthOfAPixel:Float = 0.01 { 3 | didSet { 4 | uniformSettings["fractionalWidthOfPixel"] = max(fractionalWidthOfAPixel, 0.01) 5 | } 6 | } 7 | 8 | public init() { 9 | super.init(fragmentFunctionName:"halftoneFragment", numberOfInputs:1) 10 | 11 | ({fractionalWidthOfAPixel = 0.01})() 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/HardLightBlend.swift: -------------------------------------------------------------------------------- 1 | public class HardLightBlend: BasicOperation { 2 | public init() { 3 | super.init(fragmentFunctionName:"hardLightBlendFragment", numberOfInputs:2) 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/Haze.metal: -------------------------------------------------------------------------------- 1 | #include 2 | #include "OperationShaderTypes.h" 3 | using namespace metal; 4 | 5 | typedef struct 6 | { 7 | float hazeDistance; 8 | float slope; 9 | } HazeUniform; 10 | 11 | fragment half4 hazeFragment(SingleInputVertexIO fragmentInput [[stage_in]], 12 | texture2d inputTexture [[texture(0)]], 13 | constant HazeUniform& uniform [[ buffer(1) ]]) 14 | { 15 | constexpr sampler quadSampler; 16 | half4 white = half4(1.0); 17 | 18 | half d = fragmentInput.textureCoordinate.y * uniform.slope + uniform.hazeDistance; 19 | 20 | half4 color = inputTexture.sample(quadSampler, fragmentInput.textureCoordinate); 21 | color = (color - d * white) / (1.0 - d); 22 | 23 | return color; 24 | } 25 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/Haze.swift: -------------------------------------------------------------------------------- 1 | public class Haze: BasicOperation { 2 | public var distance:Float = 0.2 { didSet { uniformSettings["hazeDistance"] = distance } } 3 | public var slope:Float = 0.0 { didSet { uniformSettings["slope"] = slope } } 4 | 5 | public init() { 6 | super.init(fragmentFunctionName:"hazeFragment", numberOfInputs:1) 7 | 8 | ({distance = 0.2})() 9 | ({slope = 0.0})() 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/HighPassFilter.swift: -------------------------------------------------------------------------------- 1 | public class HighPassFilter: OperationGroup { 2 | public var strength: Float = 0.5 { didSet { lowPass.strength = strength } } 3 | 4 | let lowPass = LowPassFilter() 5 | let differenceBlend = DifferenceBlend() 6 | 7 | public override init() { 8 | super.init() 9 | 10 | ({strength = 0.5})() 11 | 12 | self.configureGroup{input, output in 13 | input --> self.differenceBlend 14 | input --> self.lowPass --> self.differenceBlend --> output 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/HighlightAndShadowTint.swift: -------------------------------------------------------------------------------- 1 | public class HighlightAndShadowTint: BasicOperation { 2 | public var shadowTintIntensity:Float = 0.0 { didSet { uniformSettings["shadowTintIntensity"] = shadowTintIntensity } } 3 | public var highlightTintIntensity:Float = 0.0 { didSet { uniformSettings["highlightTintIntensity"] = highlightTintIntensity } } 4 | public var shadowTintColor:Color = Color.red { didSet { uniformSettings["shadowTintColor"] = shadowTintColor } } 5 | public var highlightTintColor:Color = Color.blue { didSet { uniformSettings["highlightTintColor"] = highlightTintColor } } 6 | 7 | public init() { 8 | super.init(fragmentFunctionName:"highlightShadowTintFragment", numberOfInputs:1) 9 | 10 | ({shadowTintIntensity = 0.0})() 11 | ({highlightTintIntensity = 0.0})() 12 | ({shadowTintColor = Color.red})() 13 | ({highlightTintColor = Color.blue})() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/HighlightsAndShadows.swift: -------------------------------------------------------------------------------- 1 | public class HighlightsAndShadows: BasicOperation { 2 | public var shadows:Float = 0.0 { didSet { uniformSettings["shadows"] = shadows } } 3 | public var highlights:Float = 1.0 { didSet { uniformSettings["highlights"] = highlights } } 4 | 5 | public init() { 6 | super.init(fragmentFunctionName:"highlightShadowFragment", numberOfInputs:1) 7 | 8 | ({shadows = 0.0})() 9 | ({highlights = 1.0})() 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/HueAdjustment.swift: -------------------------------------------------------------------------------- 1 | public class HueAdjustment: BasicOperation { 2 | public var hue:Float = 90.0 { didSet { uniformSettings["hue"] = hue } } 3 | 4 | public init() { 5 | super.init(fragmentFunctionName:"hueFragment", numberOfInputs:1) 6 | 7 | ({hue = 90.0})() 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/HueBlend.metal: -------------------------------------------------------------------------------- 1 | // Hue blend mode based upon pseudo code from the PDF specification. 2 | 3 | #include 4 | #include "OperationShaderTypes.h" 5 | #include "BlendShaderTypes.h" 6 | using namespace metal; 7 | 8 | fragment half4 hueBlendFragment(TwoInputVertexIO fragmentInput [[stage_in]], 9 | texture2d inputTexture [[texture(0)]], 10 | texture2d inputTexture2 [[texture(1)]]) 11 | { 12 | constexpr sampler quadSampler; 13 | half4 base = inputTexture.sample(quadSampler, fragmentInput.textureCoordinate); 14 | constexpr sampler quadSampler2; 15 | half4 overlay = inputTexture2.sample(quadSampler, fragmentInput.textureCoordinate2); 16 | 17 | return half4(base.rgb * (1.0h - overlay.a) + setlum(setsat(overlay.rgb, sat(base.rgb)), lum(base.rgb)) * overlay.a, base.a); 18 | } 19 | 20 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/HueBlend.swift: -------------------------------------------------------------------------------- 1 | public class HueBlend: BasicOperation { 2 | public init() { 3 | super.init(fragmentFunctionName:"hueBlendFragment", numberOfInputs:2) 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/KuwaharaFilter.swift: -------------------------------------------------------------------------------- 1 | public class KuwaharaFilter: BasicOperation { 2 | public var radius:Float = 3.0 { didSet { uniformSettings["radius"] = radius } } 3 | 4 | public init() { 5 | super.init(fragmentFunctionName:"kuwaharaFragment", numberOfInputs:1) 6 | 7 | ({radius = 3.0})() 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/KuwaharaRadius3Filter.swift: -------------------------------------------------------------------------------- 1 | public class KuwaharaRadius3Filter: BasicOperation { 2 | public init() { 3 | super.init(fragmentFunctionName:"kuwaharaRadius3Fragment", numberOfInputs:1) 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/Laplacian.swift: -------------------------------------------------------------------------------- 1 | public class Laplacian: TextureSamplingOperation { 2 | public init() { 3 | super.init(fragmentFunctionName:"laplacianFilter") 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/LightenBlend.metal: -------------------------------------------------------------------------------- 1 | #include 2 | #include "OperationShaderTypes.h" 3 | using namespace metal; 4 | 5 | fragment half4 lightenBlendFragment(TwoInputVertexIO fragmentInput [[stage_in]], 6 | texture2d inputTexture [[texture(0)]], 7 | texture2d inputTexture2 [[texture(1)]]) 8 | { 9 | constexpr sampler quadSampler; 10 | half4 textureColor = inputTexture.sample(quadSampler, fragmentInput.textureCoordinate); 11 | constexpr sampler quadSampler2; 12 | half4 textureColor2 = inputTexture2.sample(quadSampler, fragmentInput.textureCoordinate2); 13 | 14 | return max(textureColor, textureColor2); 15 | } 16 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/LightenBlend.swift: -------------------------------------------------------------------------------- 1 | public class LightenBlend: BasicOperation { 2 | public init() { 3 | super.init(fragmentFunctionName:"lightenBlendFragment", numberOfInputs:2) 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/LinearBurnBlend.metal: -------------------------------------------------------------------------------- 1 | #include 2 | #include "OperationShaderTypes.h" 3 | using namespace metal; 4 | 5 | fragment half4 linearBurnBlendFragment(TwoInputVertexIO fragmentInput [[stage_in]], 6 | texture2d inputTexture [[texture(0)]], 7 | texture2d inputTexture2 [[texture(1)]]) 8 | { 9 | constexpr sampler quadSampler; 10 | half4 textureColor = inputTexture.sample(quadSampler, fragmentInput.textureCoordinate); 11 | constexpr sampler quadSampler2; 12 | half4 textureColor2 = inputTexture2.sample(quadSampler, fragmentInput.textureCoordinate2); 13 | 14 | return half4(clamp(textureColor.rgb + textureColor2.rgb - half3(1.0h), half3(0.0h), half3(1.0h)), textureColor.a); 15 | } 16 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/LinearBurnBlend.swift: -------------------------------------------------------------------------------- 1 | public class LinearBurnBlend: BasicOperation { 2 | public init() { 3 | super.init(fragmentFunctionName:"linearBurnBlendFragment", numberOfInputs:2) 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/LocalBinaryPattern.swift: -------------------------------------------------------------------------------- 1 | /* 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 2 | http://www.ee.oulu.fi/~jhannuks/publications/SPIE2011a.pdf 3 | 4 | Right pixel is the most significant bit, traveling clockwise to get to the upper right, which is the least significant 5 | If the external pixel is greater than or equal to the center, set to 1, otherwise 0 6 | 7 | 2 1 0 8 | 3 7 9 | 4 5 6 10 | 11 | 01101101 12 | 76543210 13 | */ 14 | public class LocalBinaryPattern: TextureSamplingOperation { 15 | public init() { 16 | super.init(fragmentFunctionName:"localBinaryPatternFragment") 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/LookupFilter.swift: -------------------------------------------------------------------------------- 1 | public class LookupFilter: BasicOperation { 2 | public var intensity:Float = 1.0 { didSet { uniformSettings["intensity"] = intensity } } 3 | public var lookupImage:PictureInput? { // TODO: Check for retain cycles in all cases here 4 | didSet { 5 | lookupImage?.addTarget(self, atTargetIndex:1) 6 | lookupImage?.processImage() 7 | } 8 | } 9 | 10 | public init() { 11 | super.init(fragmentFunctionName:"lookupFragment", numberOfInputs:2) 12 | 13 | ({intensity = 1.0})() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/LookupImages/lookup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/ThridLib/Source/Operations/LookupImages/lookup.png -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/LookupImages/lookup_amatorka.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/ThridLib/Source/Operations/LookupImages/lookup_amatorka.png -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/LookupImages/lookup_miss_etikate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/ThridLib/Source/Operations/LookupImages/lookup_miss_etikate.png -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/LookupImages/lookup_soft_elegance_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/ThridLib/Source/Operations/LookupImages/lookup_soft_elegance_1.png -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/LookupImages/lookup_soft_elegance_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/ThridLib/Source/Operations/LookupImages/lookup_soft_elegance_2.png -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/LowPassFilter.swift: -------------------------------------------------------------------------------- 1 | public class LowPassFilter: OperationGroup { 2 | public var strength: Float = 0.5 { didSet { dissolveBlend.mix = strength } } 3 | 4 | let dissolveBlend = DissolveBlend() 5 | let buffer = ImageBuffer() 6 | 7 | public override init() { 8 | super.init() 9 | 10 | buffer.bufferSize = 1 11 | ({strength = 0.5})() 12 | 13 | self.configureGroup{input, output in 14 | // This is needed to break the cycle on the very first pass through the blend loop 15 | self.dissolveBlend.activatePassthroughOnNextFrame = true 16 | // self.buffer.activatePassthroughOnNextFrame = true 17 | // TODO: this may be a retain cycle 18 | input --> self.dissolveBlend --> self.buffer --> self.dissolveBlend --> output 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/Luminance.metal: -------------------------------------------------------------------------------- 1 | /* 2 | For a complete explanation behind the math of this shader, read this blog post: 3 | http://redqueengraphics.com/2018/07/26/metal-shaders-luminance/ 4 | */ 5 | 6 | #include 7 | #include "OperationShaderTypes.h" 8 | using namespace metal; 9 | 10 | fragment half4 luminanceFragment(SingleInputVertexIO fragmentInput [[stage_in]], 11 | texture2d inputTexture [[texture(0)]]) 12 | { 13 | constexpr sampler quadSampler; 14 | half4 color = inputTexture.sample(quadSampler, fragmentInput.textureCoordinate); 15 | half luminance = dot(color.rgb, luminanceWeighting); 16 | 17 | return half4(half3(luminance), color.a); 18 | } 19 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/Luminance.swift: -------------------------------------------------------------------------------- 1 | public class Luminance: BasicOperation { 2 | public init() { 3 | super.init(fragmentFunctionName:"luminanceFragment", numberOfInputs:1) 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/LuminanceRangeReduction.metal: -------------------------------------------------------------------------------- 1 | #include 2 | #include "OperationShaderTypes.h" 3 | 4 | using namespace metal; 5 | 6 | typedef struct 7 | { 8 | float rangeReduction; 9 | } RangeReductionUniform; 10 | 11 | fragment half4 luminanceRangeFragment(SingleInputVertexIO fragmentInput [[stage_in]], 12 | texture2d inputTexture [[texture(0)]], 13 | constant RangeReductionUniform& uniform [[ buffer(1) ]]) 14 | { 15 | constexpr sampler quadSampler; 16 | half4 color = inputTexture.sample(quadSampler, fragmentInput.textureCoordinate); 17 | 18 | half luminance = dot(color.rgb, luminanceWeighting); 19 | half luminanceRatio = ((0.5 - luminance) * uniform.rangeReduction); 20 | 21 | return half4(half3((color.rgb) + (luminanceRatio)), color.w); 22 | } 23 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/LuminanceRangeReduction.swift: -------------------------------------------------------------------------------- 1 | public class LuminanceRangeReduction: BasicOperation { 2 | public var rangeReductionFactor:Float = 0.6 { didSet { uniformSettings["rangeReduction"] = rangeReductionFactor } } 3 | 4 | public init() { 5 | super.init(fragmentFunctionName: "luminanceRangeFragment", numberOfInputs: 1) 6 | 7 | ({rangeReductionFactor = 0.6})() 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/LuminanceThreshold.metal: -------------------------------------------------------------------------------- 1 | #include 2 | #include "OperationShaderTypes.h" 3 | 4 | using namespace metal; 5 | 6 | typedef struct 7 | { 8 | float threshold; 9 | } ThresholdUniform; 10 | 11 | fragment half4 thresholdFragment(SingleInputVertexIO fragmentInput [[stage_in]], 12 | texture2d inputTexture [[texture(0)]], 13 | constant ThresholdUniform& uniform [[ buffer(1) ]]) 14 | { 15 | constexpr sampler quadSampler; 16 | half4 color = inputTexture.sample(quadSampler, fragmentInput.textureCoordinate); 17 | 18 | half luminance = dot(color.rgb, luminanceWeighting); 19 | half thresholdResult = step(half(uniform.threshold), luminance); 20 | 21 | return half4(half3(thresholdResult), color.w); 22 | } 23 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/LuminanceThreshold.swift: -------------------------------------------------------------------------------- 1 | public class LuminanceThreshold: BasicOperation { 2 | public var threshold:Float = 0.5 { didSet { uniformSettings["threshold"] = threshold } } 3 | 4 | public init() { 5 | super.init(fragmentFunctionName: "thresholdFragment", numberOfInputs:1) 6 | 7 | ({threshold = 0.5})() 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/LuminosityBlend.metal: -------------------------------------------------------------------------------- 1 | #include 2 | #include "OperationShaderTypes.h" 3 | #include "BlendShaderTypes.h" 4 | using namespace metal; 5 | 6 | fragment half4 luminosityBlendFragment(TwoInputVertexIO fragmentInput [[stage_in]], 7 | texture2d inputTexture [[texture(0)]], 8 | texture2d inputTexture2 [[texture(1)]]) 9 | { 10 | constexpr sampler quadSampler; 11 | half4 base = inputTexture.sample(quadSampler, fragmentInput.textureCoordinate); 12 | constexpr sampler quadSampler2; 13 | half4 overlay = inputTexture2.sample(quadSampler, fragmentInput.textureCoordinate2); 14 | 15 | return half4(base.rgb * (1.0h - overlay.a) + setlum(base.rgb, lum(overlay.rgb)) * overlay.a, base.a); 16 | } 17 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/LuminosityBlend.swift: -------------------------------------------------------------------------------- 1 | public class LuminosityBlend: BasicOperation { 2 | public init() { 3 | super.init(fragmentFunctionName:"luminosityBlendFragment", numberOfInputs:2) 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/MedianFilter.swift: -------------------------------------------------------------------------------- 1 | public class MedianFilter: TextureSamplingOperation { 2 | public init() { 3 | super.init(fragmentFunctionName:"medianFilter") 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/MissEtikateFilter.swift: -------------------------------------------------------------------------------- 1 | /** A photo filter based on Photoshop action by Miss Etikate: 2 | http://miss-etikate.deviantart.com/art/Photoshop-Action-15-120151961 3 | */ 4 | 5 | public class MissEtikateFilter: LookupFilter { 6 | public override init() { 7 | super.init() 8 | 9 | ({lookupImage = PictureInput(imageName:"lookup_miss_etikate.png")})() 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/MonochromeFilter.swift: -------------------------------------------------------------------------------- 1 | public class MonochromeFilter: BasicOperation { 2 | public var intensity:Float = 1.0 { didSet { uniformSettings["intensity"] = intensity } } 3 | public var color:Color = Color(red:0.6, green:0.45, blue:0.3, alpha:1.0) { didSet { uniformSettings["filterColor"] = color } } 4 | 5 | public init() { 6 | super.init(fragmentFunctionName:"monochromeFragment", numberOfInputs:1) 7 | 8 | self.uniformSettings.colorUniformsUseAlpha = false 9 | ({intensity = 1.0})() 10 | ({color = Color(red:0.6, green:0.45, blue:0.3, alpha:1.0)})() 11 | } 12 | } 13 | 14 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/MultiplyBlend.metal: -------------------------------------------------------------------------------- 1 | #include 2 | #include "OperationShaderTypes.h" 3 | using namespace metal; 4 | 5 | fragment half4 multiplyBlendFragment(TwoInputVertexIO fragmentInput [[stage_in]], 6 | texture2d inputTexture [[texture(0)]], 7 | texture2d inputTexture2 [[texture(1)]]) 8 | { 9 | constexpr sampler quadSampler; 10 | half4 base = inputTexture.sample(quadSampler, fragmentInput.textureCoordinate); 11 | constexpr sampler quadSampler2; 12 | half4 overlay = inputTexture2.sample(quadSampler, fragmentInput.textureCoordinate2); 13 | 14 | return overlay * base + overlay * (1.0h - base.a) + base * (1.0h - overlay.a); 15 | } 16 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/MultiplyBlend.swift: -------------------------------------------------------------------------------- 1 | public class MultiplyBlend: BasicOperation { 2 | public init() { 3 | super.init(fragmentFunctionName:"multiplyBlendFragment", numberOfInputs:2) 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/NormalBlend.swift: -------------------------------------------------------------------------------- 1 | public class NormalBlend: BasicOperation { 2 | public init() { 3 | super.init(fragmentFunctionName:"normalBlendFragment", numberOfInputs:2) 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/OpacityAdjustment.metal: -------------------------------------------------------------------------------- 1 | #include 2 | #include "OperationShaderTypes.h" 3 | using namespace metal; 4 | 5 | typedef struct 6 | { 7 | float opacity; 8 | } OpacityUniform; 9 | 10 | fragment half4 opacityFragment(SingleInputVertexIO fragmentInput [[stage_in]], 11 | texture2d inputTexture [[texture(0)]], 12 | constant OpacityUniform& uniform [[ buffer(1) ]]) 13 | { 14 | constexpr sampler quadSampler; 15 | half4 color = inputTexture.sample(quadSampler, fragmentInput.textureCoordinate); 16 | 17 | return half4(color.rgb, color.a * half(uniform.opacity)); 18 | } 19 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/OpacityAdjustment.swift: -------------------------------------------------------------------------------- 1 | public class OpacityAdjustment: BasicOperation { 2 | public var opacity:Float = 0.0 { didSet { uniformSettings["opacity"] = opacity } } 3 | 4 | public init() { 5 | super.init(fragmentFunctionName:"opacityFragment", numberOfInputs:1) 6 | 7 | ({opacity = 0.0})() 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/OperationShaderTypes.h: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace metal; 3 | 4 | #ifndef OPERATIONSHADERTYPES_H 5 | #define OPERATIONSHADERTYPES_H 6 | 7 | // Luminance Constants 8 | constant half3 luminanceWeighting = half3(0.2125, 0.7154, 0.0721); // Values from "Graphics Shaders: Theory and Practice" by Bailey and Cunningham 9 | 10 | struct SingleInputVertexIO 11 | { 12 | float4 position [[position]]; 13 | float2 textureCoordinate [[user(texturecoord)]]; 14 | }; 15 | 16 | struct TwoInputVertexIO 17 | { 18 | float4 position [[position]]; 19 | float2 textureCoordinate [[user(texturecoord)]]; 20 | float2 textureCoordinate2 [[user(texturecoord2)]]; 21 | }; 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/OverlayBlend.swift: -------------------------------------------------------------------------------- 1 | public class OverlayBlend: BasicOperation { 2 | public init() { 3 | super.init(fragmentFunctionName:"overlayBlendFragment", numberOfInputs:2) 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/PinchDistortion.swift: -------------------------------------------------------------------------------- 1 | public class PinchDistortion: BasicOperation { 2 | public var radius:Float = 0.5 { didSet { uniformSettings["radius"] = radius } } 3 | public var scale:Float = 0.5 { didSet { uniformSettings["scale"] = scale } } 4 | public var center:Position = Position.center { didSet { uniformSettings["center"] = center } } 5 | 6 | public init() { 7 | super.init(fragmentFunctionName:"pinchDistortionFragment", numberOfInputs:1) 8 | 9 | ({radius = 0.5})() 10 | ({scale = 0.5})() 11 | ({center = Position.center})() 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/Pixellate.metal: -------------------------------------------------------------------------------- 1 | #include 2 | #include "OperationShaderTypes.h" 3 | #include "BlendShaderTypes.h" 4 | using namespace metal; 5 | 6 | typedef struct { 7 | float fractionalWidthOfPixel; 8 | float aspectRatio; 9 | } PixellateUniform; 10 | 11 | fragment half4 pixellateFragment(SingleInputVertexIO fragmentInput [[stage_in]], 12 | texture2d inputTexture [[texture(0)]], 13 | constant PixellateUniform& uniform [[buffer(1)]]) 14 | { 15 | float2 sampleDivisor = float2(uniform.fractionalWidthOfPixel, uniform.fractionalWidthOfPixel / uniform.aspectRatio); 16 | 17 | float2 samplePos = fragmentInput.textureCoordinate - mod(fragmentInput.textureCoordinate, sampleDivisor) + float2(0.5) * sampleDivisor; 18 | 19 | constexpr sampler quadSampler; 20 | return half4(inputTexture.sample(quadSampler, samplePos)); 21 | } 22 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/Pixellate.swift: -------------------------------------------------------------------------------- 1 | public class Pixellate: BasicOperation { 2 | public var fractionalWidthOfAPixel:Float = 0.01 { 3 | didSet { 4 | uniformSettings["fractionalWidthOfPixel"] = max(fractionalWidthOfAPixel, 0.01) 5 | } 6 | } 7 | 8 | public init() { 9 | super.init(fragmentFunctionName:"pixellateFragment", numberOfInputs:1) 10 | 11 | ({fractionalWidthOfAPixel = 0.01})() 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/PolarPixellate.swift: -------------------------------------------------------------------------------- 1 | // Issues with Size not working with the compiler 2 | public class PolarPixellate: BasicOperation { 3 | public var pixelSize:Size = Size(width:0.05, height:0.05) { didSet { uniformSettings["pixelSize"] = pixelSize } } 4 | public var center:Position = Position.center { didSet { uniformSettings["center"] = center } } 5 | 6 | public init() { 7 | super.init(fragmentFunctionName:"polarPixellateFragment", numberOfInputs:1) 8 | 9 | ({pixelSize = Size(width:0.05, height:0.05)})() 10 | ({center = Position.center})() 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/PolkaDot.swift: -------------------------------------------------------------------------------- 1 | public class PolkaDot: BasicOperation { 2 | public var dotScaling:Float = 0.90 { didSet { uniformSettings["dotScaling"] = dotScaling } } 3 | public var fractionalWidthOfAPixel:Float = 0.01{ 4 | didSet { 5 | uniformSettings["fractionalWidthOfPixel"] = max(fractionalWidthOfAPixel, 0.01) 6 | } 7 | } 8 | 9 | public init() { 10 | super.init(fragmentFunctionName:"polkaDotFragment", numberOfInputs:1) 11 | 12 | ({fractionalWidthOfAPixel = 0.01})() 13 | ({dotScaling = 0.90})() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/Posterize.metal: -------------------------------------------------------------------------------- 1 | #include 2 | #include "OperationShaderTypes.h" 3 | using namespace metal; 4 | 5 | typedef struct { 6 | float colorLevels; 7 | } PosterizeUniform; 8 | 9 | fragment half4 posterizeFragment(SingleInputVertexIO fragmentInput [[stage_in]], 10 | texture2d inputTexture [[texture(0)]], 11 | constant PosterizeUniform& uniform [[buffer(1)]]) 12 | { 13 | constexpr sampler quadSampler; 14 | half4 color = inputTexture.sample(quadSampler, fragmentInput.textureCoordinate); 15 | 16 | half colorLevels = half(uniform.colorLevels); 17 | return floor((color * colorLevels) + half4(0.5)) / colorLevels; 18 | } 19 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/Posterize.swift: -------------------------------------------------------------------------------- 1 | public class Posterize: BasicOperation { 2 | public var colorLevels:Float = 10.0 { didSet { uniformSettings["colorLevels"] = colorLevels } } 3 | 4 | public init() { 5 | super.init(fragmentFunctionName: "posterizeFragment", numberOfInputs: 1) 6 | 7 | ({colorLevels = 10.0})() 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/PrewittEdgeDetection.swift: -------------------------------------------------------------------------------- 1 | public class PrewittEdgeDetection: TextureSamplingOperation { 2 | public var edgeStrength:Float = 1.0 { didSet { uniformSettings["edgeStrength"] = edgeStrength } } 3 | 4 | public init() { 5 | super.init(fragmentFunctionName:"prewittEdgeDetectionFragment", numberOfInputs:1) 6 | 7 | ({edgeStrength = 1.0})() 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/RGBAdjustment.metal: -------------------------------------------------------------------------------- 1 | #include 2 | #include "OperationShaderTypes.h" 3 | using namespace metal; 4 | 5 | typedef struct 6 | { 7 | float redAdjustment; 8 | float greenAdjustment; 9 | float blueAdjustment; 10 | } RGBAdjustmentUniform; 11 | 12 | fragment half4 rgbAdjustmentFragment(SingleInputVertexIO fragmentInput [[stage_in]], 13 | texture2d inputTexture [[texture(0)]], 14 | constant RGBAdjustmentUniform& uniform [[ buffer(1) ]]) 15 | { 16 | constexpr sampler quadSampler; 17 | half4 color = inputTexture.sample(quadSampler, fragmentInput.textureCoordinate); 18 | 19 | return half4(color.r * uniform.redAdjustment, 20 | color.g * uniform.greenAdjustment, 21 | color.b * uniform.blueAdjustment, 22 | color.a); 23 | } 24 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/RGBAdjustment.swift: -------------------------------------------------------------------------------- 1 | public class RGBAdjustment: BasicOperation { 2 | public var red:Float = 1.0 { didSet { uniformSettings["redAdjustment"] = red } } 3 | public var blue:Float = 1.0 { didSet { uniformSettings["blueAdjustment"] = blue } } 4 | public var green:Float = 1.0 { didSet { uniformSettings["greenAdjustment"] = green } } 5 | 6 | public init() { 7 | super.init(fragmentFunctionName:"rgbAdjustmentFragment", numberOfInputs:1) 8 | 9 | ({red = 1.0})() 10 | ({blue = 1.0})() 11 | ({green = 1.0})() 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/SaturationAdjustment.metal: -------------------------------------------------------------------------------- 1 | #include 2 | #include "OperationShaderTypes.h" 3 | using namespace metal; 4 | 5 | typedef struct 6 | { 7 | float saturation; 8 | } SaturationUniform; 9 | 10 | fragment half4 saturationFragment(SingleInputVertexIO fragmentInput [[stage_in]], 11 | texture2d inputTexture [[texture(0)]], 12 | constant SaturationUniform& uniform [[ buffer(1) ]]) 13 | { 14 | constexpr sampler quadSampler; 15 | half4 color = inputTexture.sample(quadSampler, fragmentInput.textureCoordinate); 16 | 17 | half luminance = dot(color.rgb, luminanceWeighting); 18 | 19 | return half4(mix(half3(luminance), color.rgb, half(uniform.saturation)), color.a); 20 | } 21 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/SaturationAdjustment.swift: -------------------------------------------------------------------------------- 1 | public class SaturationAdjustment: BasicOperation { 2 | public var saturation:Float = 1.0 { didSet { uniformSettings["saturation"] = saturation } } 3 | 4 | public init() { 5 | super.init(fragmentFunctionName:"saturationFragment", numberOfInputs:1) 6 | 7 | ({saturation = 1.0})() 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/SaturationBlend.metal: -------------------------------------------------------------------------------- 1 | #include 2 | #include "OperationShaderTypes.h" 3 | #include "BlendShaderTypes.h" 4 | using namespace metal; 5 | 6 | fragment half4 saturationBlendFragment(TwoInputVertexIO fragmentInput [[stage_in]], 7 | texture2d inputTexture [[texture(0)]], 8 | texture2d inputTexture2 [[texture(1)]]) 9 | { 10 | constexpr sampler quadSampler; 11 | half4 base = inputTexture.sample(quadSampler, fragmentInput.textureCoordinate); 12 | constexpr sampler quadSampler2; 13 | half4 overlay = inputTexture2.sample(quadSampler, fragmentInput.textureCoordinate2); 14 | 15 | return half4(base.rgb * (1.0h - overlay.a) + setlum(setsat(base.rgb, sat(overlay.rgb)), lum(base.rgb)) * overlay.a, base.a); 16 | } 17 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/SaturationBlend.swift: -------------------------------------------------------------------------------- 1 | public class SaturationBlend: BasicOperation { 2 | public init() { 3 | super.init(fragmentFunctionName:"saturationBlendFragment", numberOfInputs:2) 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/ScreenBlend.metal: -------------------------------------------------------------------------------- 1 | #include 2 | #include "OperationShaderTypes.h" 3 | using namespace metal; 4 | 5 | fragment half4 screenBlendFragment(TwoInputVertexIO fragmentInput [[stage_in]], 6 | texture2d inputTexture [[texture(0)]], 7 | texture2d inputTexture2 [[texture(1)]]) 8 | { 9 | constexpr sampler quadSampler; 10 | half4 textureColor = inputTexture.sample(quadSampler, fragmentInput.textureCoordinate); 11 | constexpr sampler quadSampler2; 12 | half4 textureColor2 = inputTexture2.sample(quadSampler, fragmentInput.textureCoordinate2); 13 | half4 whiteColor = half4(1.0); 14 | 15 | return whiteColor - ((whiteColor - textureColor2) * (whiteColor - textureColor)); 16 | } 17 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/ScreenBlend.swift: -------------------------------------------------------------------------------- 1 | public class ScreenBlend: BasicOperation { 2 | public init() { 3 | super.init(fragmentFunctionName:"screenBlendFragment", numberOfInputs:2) 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/SepiaToneFilter.swift: -------------------------------------------------------------------------------- 1 | public class SepiaToneFilter: ColorMatrixFilter { 2 | override public init() { 3 | super.init() 4 | 5 | ({colorMatrix = Matrix4x4(rowMajorValues:[0.3588, 0.7044, 0.1368, 0.0, 6 | 0.2990, 0.5870, 0.1140, 0.0, 7 | 0.2392, 0.4696, 0.0912 ,0.0, 8 | 0.0, 0.0, 0.0, 1.0])})() 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/Sharpen.swift: -------------------------------------------------------------------------------- 1 | public class Sharpen: BasicOperation { 2 | public var sharpness:Float = 0.0 { didSet { uniformSettings["sharpness"] = sharpness } } 3 | public var overriddenTexelSize:Size? 4 | 5 | public init() { 6 | super.init(vertexFunctionName: "sharpenVertex", fragmentFunctionName: "sharpenFragment", numberOfInputs: 1) 7 | 8 | ({sharpness = 0.0})() 9 | } 10 | 11 | // Pretty sure this is OpenGL only 12 | // override func configureFramebufferSpecificUniforms(_ inputFramebuffer:Framebuffer) { 13 | // let outputRotation = overriddenOutputRotation ?? inputFramebuffer.orientation.rotationNeededForOrientation(.portrait) 14 | // let texelSize = overriddenTexelSize ?? inputFramebuffer.texelSize(for:outputRotation) 15 | // uniformSettings["texelWidth"] = texelSize.width 16 | // uniformSettings["texelHeight"] = texelSize.height 17 | // } 18 | } 19 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/Sketch.swift: -------------------------------------------------------------------------------- 1 | public class SketchFilter: TextureSamplingOperation { 2 | public var edgeStrength:Float = 1.0 { didSet { uniformSettings["edgeStrength"] = edgeStrength } } 3 | 4 | public init() { 5 | super.init(fragmentFunctionName:"sketchFragment", numberOfInputs:1) 6 | 7 | ({edgeStrength = 1.0})() 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/SmoothToonFilter.swift: -------------------------------------------------------------------------------- 1 | public class SmoothToonFilter: OperationGroup { 2 | public var blurRadiusInPixels: Float = 2.0 { didSet { gaussianBlur.blurRadiusInPixels = blurRadiusInPixels } } 3 | public var threshold: Float = 0.2 { didSet { toonFilter.threshold = threshold } } 4 | public var quantizationLevels: Float = 10.0 { didSet { toonFilter.quantizationLevels = quantizationLevels } } 5 | 6 | let gaussianBlur = GaussianBlur() 7 | let toonFilter = ToonFilter() 8 | 9 | public override init() { 10 | super.init() 11 | 12 | ({blurRadiusInPixels = 2.0})() 13 | ({threshold = 0.2})() 14 | ({quantizationLevels = 10.0})() 15 | 16 | self.configureGroup{input, output in 17 | input --> self.gaussianBlur --> self.toonFilter --> output 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/SobelEdgeDetection.swift: -------------------------------------------------------------------------------- 1 | public class SobelEdgeDetection: TextureSamplingOperation { 2 | public var edgeStrength:Float = 1.0 { didSet { uniformSettings["edgeStrength"] = edgeStrength } } 3 | 4 | public init() { 5 | super.init(fragmentFunctionName:"sobelEdgeDetectionFragment", numberOfInputs:1) 6 | 7 | ({edgeStrength = 1.0})() 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/SoftElegance.swift: -------------------------------------------------------------------------------- 1 | public class SoftElegance: OperationGroup { 2 | let lookup1 = LookupFilter() 3 | let lookup2 = LookupFilter() 4 | let gaussianBlur = GaussianBlur() 5 | let alphaBlend = AlphaBlend() 6 | 7 | public override init() { 8 | super.init() 9 | 10 | self.configureGroup{input, output in 11 | self.lookup1.lookupImage = PictureInput(imageName:"lookup_soft_elegance_1.png") 12 | self.lookup2.lookupImage = PictureInput(imageName:"lookup_soft_elegance_2.png") 13 | self.gaussianBlur.blurRadiusInPixels = 10.0 14 | self.alphaBlend.mix = 0.14 15 | 16 | input --> self.lookup1 --> self.alphaBlend --> self.lookup2 --> output 17 | self.lookup1 --> self.gaussianBlur --> self.alphaBlend 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/SoftLightBlend.metal: -------------------------------------------------------------------------------- 1 | #include 2 | #include "OperationShaderTypes.h" 3 | using namespace metal; 4 | 5 | fragment half4 softLightBlendFragment(TwoInputVertexIO fragmentInput [[stage_in]], 6 | texture2d inputTexture [[texture(0)]], 7 | texture2d inputTexture2 [[texture(1)]]) 8 | { 9 | constexpr sampler quadSampler; 10 | half4 base = inputTexture.sample(quadSampler, fragmentInput.textureCoordinate); 11 | constexpr sampler quadSampler2; 12 | half4 overlay = inputTexture2.sample(quadSampler, fragmentInput.textureCoordinate2); 13 | 14 | half alphaDivisor = base.a + step(base.a, 0.0h); // Protect against a divide-by-zero blacking out things in the output 15 | 16 | return base * (overlay.a * (base / alphaDivisor) + (2.0h * overlay * (1.0h - (base / alphaDivisor)))) + overlay * (1.0h - base.a) + base * (1.0h - overlay.a); 17 | } 18 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/SoftLightBlend.swift: -------------------------------------------------------------------------------- 1 | public class SoftLightBlend: BasicOperation { 2 | public init() { 3 | super.init(fragmentFunctionName:"softLightBlendFragment", numberOfInputs:2) 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/Solarize.metal: -------------------------------------------------------------------------------- 1 | #include 2 | #include "OperationShaderTypes.h" 3 | using namespace metal; 4 | 5 | typedef struct { 6 | float threshold; 7 | } SolarizeUniform; 8 | 9 | fragment half4 solarizeFragment(SingleInputVertexIO fragmentInput [[stage_in]], 10 | texture2d inputTexture [[texture(0)]], 11 | constant SolarizeUniform& uniform [[buffer(1)]]) 12 | { 13 | constexpr sampler quadSampler; 14 | half4 color = inputTexture.sample(quadSampler, fragmentInput.textureCoordinate); 15 | half luminance = dot(color.rgb, luminanceWeighting); 16 | half thresholdResult = step(luminance, half(uniform.threshold)); 17 | half3 finalColor = abs(thresholdResult - color.rgb); 18 | return half4(finalColor, color.a); 19 | } 20 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/Solarize.swift: -------------------------------------------------------------------------------- 1 | public class Solarize: BasicOperation { 2 | public var threshold:Float = 0.5 { didSet { uniformSettings["threshold"] = threshold } } 3 | 4 | public init() { 5 | super.init(fragmentFunctionName: "solarizeFragment", numberOfInputs:1) 6 | 7 | ({threshold = 0.5})() 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/SolidColorGenerator.swift: -------------------------------------------------------------------------------- 1 | public class SolidColorGenerator: ImageGenerator { 2 | 3 | public func renderColor(_ color:Color) { 4 | guard let commandBuffer = sharedMetalRenderingDevice.commandQueue.makeCommandBuffer() else {return} 5 | 6 | commandBuffer.clear(with: color, outputTexture: internalTexture) 7 | 8 | notifyTargets() 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/SourceOverBlend.metal: -------------------------------------------------------------------------------- 1 | #include 2 | #include "OperationShaderTypes.h" 3 | using namespace metal; 4 | 5 | fragment half4 sourceOverBlendFragment(TwoInputVertexIO fragmentInput [[stage_in]], 6 | texture2d inputTexture [[texture(0)]], 7 | texture2d inputTexture2 [[texture(1)]]) 8 | { 9 | constexpr sampler quadSampler; 10 | half4 textureColor = inputTexture.sample(quadSampler, fragmentInput.textureCoordinate); 11 | constexpr sampler quadSampler2; 12 | half4 textureColor2 = inputTexture2.sample(quadSampler, fragmentInput.textureCoordinate2); 13 | 14 | return mix(textureColor, textureColor2, textureColor2.a); 15 | } 16 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/SourceOverBlend.swift: -------------------------------------------------------------------------------- 1 | public class SourceOverBlend: BasicOperation { 2 | public init() { 3 | super.init(fragmentFunctionName:"sourceOverBlendFragment", numberOfInputs:2) 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/SphereRefraction.swift: -------------------------------------------------------------------------------- 1 | public class SphereRefraction: BasicOperation { 2 | public var radius:Float = 0.25 { didSet { uniformSettings["radius"] = radius } } 3 | public var refractiveIndex:Float = 0.71 { didSet { uniformSettings["refractiveIndex"] = refractiveIndex } } 4 | public var center:Position = Position.center { didSet { uniformSettings["center"] = center } } 5 | 6 | public init() { 7 | super.init(fragmentFunctionName:"sphereRefractionFragment", numberOfInputs:1) 8 | 9 | ({radius = 0.25})() 10 | ({refractiveIndex = 0.71})() 11 | ({center = Position.center})() 12 | 13 | // self.backgroundColor = Color(red:0.0, green:0.0, blue:0.0, alpha:0.0) 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/StretchDistortion.swift: -------------------------------------------------------------------------------- 1 | public class StretchDistortion: BasicOperation { 2 | public var center:Position = Position.center { didSet { uniformSettings["center"] = center } } 3 | 4 | public init() { 5 | super.init(fragmentFunctionName:"stretchDistortionFragment", numberOfInputs:1) 6 | 7 | ({center = Position.center})() 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/SubtractBlend.metal: -------------------------------------------------------------------------------- 1 | #include 2 | #include "OperationShaderTypes.h" 3 | using namespace metal; 4 | 5 | fragment half4 subtractBlendFragment(TwoInputVertexIO fragmentInput [[stage_in]], 6 | texture2d inputTexture [[texture(0)]], 7 | texture2d inputTexture2 [[texture(1)]]) 8 | { 9 | constexpr sampler quadSampler; 10 | half4 textureColor = inputTexture.sample(quadSampler, fragmentInput.textureCoordinate); 11 | constexpr sampler quadSampler2; 12 | half4 textureColor2 = inputTexture2.sample(quadSampler, fragmentInput.textureCoordinate2); 13 | 14 | return half4(textureColor.rgb - textureColor2.rgb, textureColor.a); 15 | } 16 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/SubtractBlend.swift: -------------------------------------------------------------------------------- 1 | public class SubtractBlend: BasicOperation { 2 | public init() { 3 | super.init(fragmentFunctionName:"subtractBlendFragment", numberOfInputs:2) 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/SwirlDistortion.swift: -------------------------------------------------------------------------------- 1 | public class SwirlDistortion: BasicOperation { 2 | public var radius:Float = 0.5 { didSet { uniformSettings["radius"] = radius } } 3 | public var angle:Float = 1.0 { didSet { uniformSettings["angle"] = angle } } 4 | public var center:Position = Position.center { didSet { uniformSettings["center"] = center } } 5 | 6 | public init() { 7 | super.init(fragmentFunctionName:"swirlFragment", numberOfInputs:1) 8 | 9 | ({radius = 0.5})() 10 | ({angle = 1.0})() 11 | ({center = Position.center})() 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/TexelSamplingTypes.h: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace metal; 3 | 4 | #ifndef TexelSamplingTypes_h 5 | #define TexelSamplingTypes_h 6 | 7 | struct NearbyTexelVertexIO 8 | { 9 | float4 position [[position]]; 10 | 11 | float2 textureCoordinate [[user(textureCoordinate)]]; 12 | float2 leftTextureCoordinate [[user(leftTextureCoordinate)]]; 13 | float2 rightTextureCoordinate [[user(rightTextureCoordinate)]]; 14 | 15 | float2 topTextureCoordinate [[user(topTextureCoordinate)]]; 16 | float2 topLeftTextureCoordinate [[user(topLeftTextureCoordinate)]]; 17 | float2 topRightTextureCoordinate [[user(topRightTextureCoordinate)]]; 18 | 19 | float2 bottomTextureCoordinate [[user(bottomTextureCoordinate)]]; 20 | float2 bottomLeftTextureCoordinate [[user(bottomLeftTextureCoordinate)]]; 21 | float2 bottomRightTextureCoordinate [[user(bottomRightTextureCoordinate)]]; 22 | }; 23 | 24 | #endif /* TexelSamplingTypes_h */ 25 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/ThresholdSketch.swift: -------------------------------------------------------------------------------- 1 | public class ThresholdSketchFilter: TextureSamplingOperation { 2 | public var edgeStrength:Float = 1.0 { didSet { uniformSettings["edgeStrength"] = edgeStrength } } 3 | public var threshold:Float = 0.25 { didSet { uniformSettings["threshold"] = threshold } } 4 | 5 | public init() { 6 | super.init(fragmentFunctionName:"thresholdSketchFragment", numberOfInputs:1) 7 | 8 | ({edgeStrength = 1.0})() 9 | ({threshold = 0.25})() 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/ThresholdSobelEdgeDetection.swift: -------------------------------------------------------------------------------- 1 | public class ThresholdSobelEdgeDetection: TextureSamplingOperation { 2 | public var edgeStrength:Float = 1.0 { didSet { uniformSettings["edgeStrength"] = edgeStrength } } 3 | public var threshold:Float = 0.25 { didSet { uniformSettings["threshold"] = threshold } } 4 | 5 | public init() { 6 | super.init(fragmentFunctionName:"thresholdSobelEdgeDetectionFragment", numberOfInputs:1) 7 | 8 | ({edgeStrength = 1.0})() 9 | ({threshold = 0.25})() 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/ToonFilter.swift: -------------------------------------------------------------------------------- 1 | public class ToonFilter: TextureSamplingOperation { 2 | public var threshold:Float = 0.2 { didSet { uniformSettings["threshold"] = threshold } } 3 | public var quantizationLevels:Float = 10.0 { didSet { uniformSettings["quantizationLevels"] = quantizationLevels } } 4 | 5 | public init() { 6 | super.init(fragmentFunctionName:"toonFragment", numberOfInputs:1) 7 | 8 | ({threshold = 0.2})() 9 | ({quantizationLevels = 10.0})() 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/Vibrance.metal: -------------------------------------------------------------------------------- 1 | #include 2 | #include "OperationShaderTypes.h" 3 | using namespace metal; 4 | 5 | typedef struct 6 | { 7 | float vibrance; 8 | } VibranceUniform; 9 | 10 | fragment half4 vibranceFragment(SingleInputVertexIO fragmentInput [[stage_in]], 11 | texture2d inputTexture [[texture(0)]], 12 | constant VibranceUniform& uniform [[ buffer(1) ]]) 13 | { 14 | constexpr sampler quadSampler; 15 | half4 color = inputTexture.sample(quadSampler, fragmentInput.textureCoordinate); 16 | 17 | half average = (color.r + color.g + color.b) / 3.0; 18 | half mx = max(color.r, max(color.g, color.b)); 19 | half amt = (mx - average) * (-uniform.vibrance * 3.0); 20 | color.rgb = mix(color.rgb, half3(mx), amt); 21 | 22 | return half4(color); 23 | } 24 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/Vibrance.swift: -------------------------------------------------------------------------------- 1 | public class Vibrance: BasicOperation { 2 | public var vibrance:Float = 0.0 { didSet { uniformSettings["vibrance"] = vibrance } } 3 | 4 | public init() { 5 | super.init(fragmentFunctionName:"vibranceFragment", numberOfInputs:1) 6 | 7 | ({vibrance = 0.0})() 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/Vignette.metal: -------------------------------------------------------------------------------- 1 | #include 2 | #include "OperationShaderTypes.h" 3 | using namespace metal; 4 | 5 | typedef struct { 6 | float2 vignetteCenter; 7 | float3 vignetteColor; 8 | float vignetteStart; 9 | float vignetteEnd; 10 | } VignetteUniform; 11 | 12 | fragment half4 vignetteFragment(SingleInputVertexIO fragmentInput [[stage_in]], 13 | texture2d inputTexture [[texture(0)]], 14 | constant VignetteUniform& uniform [[buffer(1)]]) 15 | { 16 | constexpr sampler quadSampler; 17 | half4 color = inputTexture.sample(quadSampler, fragmentInput.textureCoordinate); 18 | 19 | float d = distance(fragmentInput.textureCoordinate, float2(uniform.vignetteCenter.x, uniform.vignetteCenter.y)); 20 | float percent = smoothstep(uniform.vignetteStart, uniform.vignetteEnd, d); 21 | return half4(mix(color.rgb, half3(uniform.vignetteColor), half(percent)), color.a); 22 | } 23 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/Vignette.swift: -------------------------------------------------------------------------------- 1 | public class Vignette: BasicOperation { 2 | public var center:Position = Position.center { didSet { uniformSettings["vignetteCenter"] = center } } 3 | public var color:Color = Color.black { didSet { uniformSettings["vignetteColor"] = color } } 4 | public var start:Float = 0.3 { didSet { uniformSettings["vignetteStart"] = start } } 5 | public var end:Float = 0.75 { didSet { uniformSettings["vignetteEnd"] = end } } 6 | 7 | public init() { 8 | super.init(fragmentFunctionName:"vignetteFragment", numberOfInputs:1) 9 | 10 | ({center = Position.center})() 11 | ({color = Color.black})() 12 | ({start = 0.3})() 13 | ({end = 0.75})() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/WhiteBalance.swift: -------------------------------------------------------------------------------- 1 | /* 2 | public class WhiteBalance: BasicOperation { 3 | public var temperature:Float = 5000.0 { didSet { uniformSettings["temperature"] = temperature < 5000.0 ? 0.0004 * (temperature - 5000.0) : 0.00006 * (temperature - 5000.0) } } 4 | public var tint:Float = 0.0 { didSet { uniformSettings["tint"] = tint / 100.0 } } 5 | 6 | public init() { 7 | super.init(fragmentFunctionName:"whiteBalanceFragmentShader", numberOfInputs:1) 8 | 9 | uniformSettings.appendUniform(5000.0) 10 | uniformSettings.appendUniform(0.0) 11 | } 12 | } 13 | */ 14 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/ZoomBlur.swift: -------------------------------------------------------------------------------- 1 | public class ZoomBlur: BasicOperation { 2 | public var blurSize:Float = 1.0 { didSet { uniformSettings["size"] = blurSize } } 3 | public var blurCenter:Position = Position.center { didSet { uniformSettings["center"] = blurCenter } } 4 | 5 | public init() { 6 | super.init(fragmentFunctionName:"zoomBlurFragment", numberOfInputs:1) 7 | 8 | ({blurSize = 1.0})() 9 | ({blurCenter = Position.center})() 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Operations/iOSBlur.swift: -------------------------------------------------------------------------------- 1 | public class iOSBlur: OperationGroup { 2 | public var blurRadiusInPixels:Float = 48.0 { didSet { gaussianBlur.blurRadiusInPixels = blurRadiusInPixels } } 3 | public var saturation:Float = 0.8 { didSet { saturationFilter.saturation = saturation } } 4 | public var rangeReductionFactor:Float = 0.6 { didSet { luminanceRange.rangeReductionFactor = rangeReductionFactor } } 5 | 6 | let saturationFilter = SaturationAdjustment() 7 | let gaussianBlur = GaussianBlur() 8 | let luminanceRange = LuminanceRangeReduction() 9 | 10 | public override init() { 11 | super.init() 12 | 13 | ({blurRadiusInPixels = 48.0})() 14 | ({saturation = 0.8})() 15 | ({rangeReductionFactor = 0.6})() 16 | 17 | self.configureGroup{input, output in 18 | input --> self.saturationFilter --> self.gaussianBlur --> self.luminanceRange --> output 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Position.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | #if os(iOS) 4 | import UIKit 5 | #endif 6 | 7 | public struct Position { 8 | public let x:Float 9 | public let y:Float 10 | public let z:Float? 11 | 12 | public init (_ x:Float, _ y:Float, _ z:Float? = nil) { 13 | self.x = x 14 | self.y = y 15 | self.z = z 16 | } 17 | 18 | public static let center = Position(0.5, 0.5) 19 | public static let zero = Position(0.0, 0.0) 20 | } 21 | 22 | 23 | public struct Position2D { 24 | public let x:Float 25 | public let y:Float 26 | 27 | public init (_ x:Float, _ y:Float) { 28 | self.x = x 29 | self.y = y 30 | } 31 | 32 | public static let center = Position(0.5, 0.5) 33 | public static let zero = Position(0.0, 0.0) 34 | } 35 | -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/Size.swift: -------------------------------------------------------------------------------- 1 | public struct Size { 2 | public let width:Float 3 | public let height:Float 4 | 5 | public init(width:Float, height:Float) { 6 | self.width = width 7 | self.height = height 8 | } 9 | } -------------------------------------------------------------------------------- /MagicCamera/ThridLib/Source/TextureSamplingOperation.swift: -------------------------------------------------------------------------------- 1 | open class TextureSamplingOperation: BasicOperation { 2 | // public var overriddenTexelSize:Size? 3 | 4 | override public init(vertexFunctionName: String? = "nearbyTexelSampling", 5 | fragmentFunctionName: String, 6 | numberOfInputs: UInt = 1, 7 | operationName: String = #file) { 8 | super.init(vertexFunctionName:vertexFunctionName, fragmentFunctionName:fragmentFunctionName, numberOfInputs:numberOfInputs, operationName:operationName) 9 | self.useNormalizedTextureCoordinates = false 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /MagicCamera/Vision/models/opt.py: -------------------------------------------------------------------------------- 1 | 2 | import coremltools 3 | from coremltools.models.neural_network import quantization_utils 4 | 5 | name = 'cpaprika' 6 | 7 | model = coremltools.models.MLModel(name + '.mlmodel') 8 | 9 | model_fp16 = quantization_utils.quantize_weights(model, nbits=16) 10 | model_fp16.save(name + "16.mlmodel") 11 | 12 | # model_fp8 = quantization_utils.quantize_weights(model, nbits=8) 13 | # model_fp8.save(name + "8.mlmodel") 14 | -------------------------------------------------------------------------------- /MagicCamera/Vision/waifu2x/UIImage+Alpha.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+Alpha.swift 3 | // waifu2x 4 | // 5 | // Created by 谢宜 on 2017/12/29. 6 | // Copyright © 2017年 xieyi. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import UIKit 11 | 12 | extension UIImage { 13 | 14 | func alpha() -> [UInt8] { 15 | let width = Int(size.width) 16 | let height = Int(size.height) 17 | let data = UnsafeMutablePointer.allocate(capacity: width * height) 18 | let alphaOnly = CGContext(data: data, width: width, height: height, bitsPerComponent: 8, bytesPerRow: width, space: CGColorSpace.init(name: CGColorSpace.linearGray)!, bitmapInfo: CGImageAlphaInfo.alphaOnly.rawValue) 19 | alphaOnly?.draw(cgImage!, in: CGRect(x: 0, y: 0, width: width, height: height)) 20 | var result: [UInt8] = [] 21 | for i in 0 ..< width * height { 22 | result.append(data[i]) 23 | } 24 | return result 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /MagicCamera/Vision/waifu2x/waifu2x.h: -------------------------------------------------------------------------------- 1 | // 2 | // waifu2x.h 3 | // waifu2x 4 | // 5 | // Created by 谢宜 on 2017/11/18. 6 | // Copyright © 2017年 xieyi. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for waifu2x. 12 | FOUNDATION_EXPORT double waifu2xVersionNumber; 13 | 14 | //! Project version string for waifu2x. 15 | FOUNDATION_EXPORT const unsigned char waifu2xVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /MagicCamera/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* 2 | InfoPlist.strings 3 | MagicCamera 4 | 5 | Created by William on 2020/12/17. 6 | 7 | */ 8 | 9 | CFBundleDisplayName = "Magic Camera"; 10 | -------------------------------------------------------------------------------- /MagicCamera/icons/Age90.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/Age90.png -------------------------------------------------------------------------------- /MagicCamera/icons/IMG_0008.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/IMG_0008.JPG -------------------------------------------------------------------------------- /MagicCamera/icons/IMG_0009.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/IMG_0009.JPG -------------------------------------------------------------------------------- /MagicCamera/icons/IMG_0010.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/IMG_0010.JPG -------------------------------------------------------------------------------- /MagicCamera/icons/IMG_0011.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/IMG_0011.JPG -------------------------------------------------------------------------------- /MagicCamera/icons/IMG_0012.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/IMG_0012.JPG -------------------------------------------------------------------------------- /MagicCamera/icons/IMG_0013.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/IMG_0013.JPG -------------------------------------------------------------------------------- /MagicCamera/icons/IMG_0074.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/IMG_0074.JPG -------------------------------------------------------------------------------- /MagicCamera/icons/IMG_0075.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/IMG_0075.JPG -------------------------------------------------------------------------------- /MagicCamera/icons/aged.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/aged.jpg -------------------------------------------------------------------------------- /MagicCamera/icons/attgan_blond_hair.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/attgan_blond_hair.jpg -------------------------------------------------------------------------------- /MagicCamera/icons/attgan_brown_hair.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/attgan_brown_hair.jpg -------------------------------------------------------------------------------- /MagicCamera/icons/attgan_male.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/attgan_male.jpg -------------------------------------------------------------------------------- /MagicCamera/icons/attgan_mustache.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/attgan_mustache.jpg -------------------------------------------------------------------------------- /MagicCamera/icons/attgan_old.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/attgan_old.jpg -------------------------------------------------------------------------------- /MagicCamera/icons/attgan_young.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/attgan_young.jpg -------------------------------------------------------------------------------- /MagicCamera/icons/beauty.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/beauty.jpg -------------------------------------------------------------------------------- /MagicCamera/icons/bubble.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/bubble.jpg -------------------------------------------------------------------------------- /MagicCamera/icons/cam_art.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/cam_art.png -------------------------------------------------------------------------------- /MagicCamera/icons/cam_cartoon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/cam_cartoon.png -------------------------------------------------------------------------------- /MagicCamera/icons/cam_style.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/cam_style.jpg -------------------------------------------------------------------------------- /MagicCamera/icons/colorful.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/colorful.jpg -------------------------------------------------------------------------------- /MagicCamera/icons/face.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/face.jpg -------------------------------------------------------------------------------- /MagicCamera/icons/face.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/face.mp4 -------------------------------------------------------------------------------- /MagicCamera/icons/face.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/face.png -------------------------------------------------------------------------------- /MagicCamera/icons/face1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/face1.jpg -------------------------------------------------------------------------------- /MagicCamera/icons/face2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/face2.jpg -------------------------------------------------------------------------------- /MagicCamera/icons/face3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/face3.jpg -------------------------------------------------------------------------------- /MagicCamera/icons/fleeting.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/fleeting.jpg -------------------------------------------------------------------------------- /MagicCamera/icons/flower.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/flower.jpg -------------------------------------------------------------------------------- /MagicCamera/icons/frame.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/frame.jpg -------------------------------------------------------------------------------- /MagicCamera/icons/gb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/gb.jpg -------------------------------------------------------------------------------- /MagicCamera/icons/glass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/glass.png -------------------------------------------------------------------------------- /MagicCamera/icons/hdr.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/hdr.jpg -------------------------------------------------------------------------------- /MagicCamera/icons/icon_new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/icon_new.png -------------------------------------------------------------------------------- /MagicCamera/icons/info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/info.png -------------------------------------------------------------------------------- /MagicCamera/icons/kuwahara.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/kuwahara.jpg -------------------------------------------------------------------------------- /MagicCamera/icons/load.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/load.jpg -------------------------------------------------------------------------------- /MagicCamera/icons/logo_zw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/logo_zw.png -------------------------------------------------------------------------------- /MagicCamera/icons/lomo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/lomo.jpg -------------------------------------------------------------------------------- /MagicCamera/icons/new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/new.png -------------------------------------------------------------------------------- /MagicCamera/icons/photo2cartoon_bubble.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/photo2cartoon_bubble.jpg -------------------------------------------------------------------------------- /MagicCamera/icons/photo2cartoon_colorful.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/photo2cartoon_colorful.jpg -------------------------------------------------------------------------------- /MagicCamera/icons/photo2cartoon_flower.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/photo2cartoon_flower.jpg -------------------------------------------------------------------------------- /MagicCamera/icons/photo2cartoon_romance.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/photo2cartoon_romance.jpg -------------------------------------------------------------------------------- /MagicCamera/icons/photo_album.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/photo_album.png -------------------------------------------------------------------------------- /MagicCamera/icons/pixellate.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/pixellate.jpg -------------------------------------------------------------------------------- /MagicCamera/icons/romance.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/romance.jpg -------------------------------------------------------------------------------- /MagicCamera/icons/rotate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/rotate.png -------------------------------------------------------------------------------- /MagicCamera/icons/save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/save.png -------------------------------------------------------------------------------- /MagicCamera/icons/style_la_muse.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/style_la_muse.jpg -------------------------------------------------------------------------------- /MagicCamera/icons/style_pointillism8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/style_pointillism8.jpg -------------------------------------------------------------------------------- /MagicCamera/icons/style_rain_princess.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/style_rain_princess.jpg -------------------------------------------------------------------------------- /MagicCamera/icons/style_shipwreck_minotaur.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/style_shipwreck_minotaur.jpg -------------------------------------------------------------------------------- /MagicCamera/icons/style_starry_night8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/style_starry_night8.jpg -------------------------------------------------------------------------------- /MagicCamera/icons/style_the_scream.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/style_the_scream.jpg -------------------------------------------------------------------------------- /MagicCamera/icons/style_udnie.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/style_udnie.jpg -------------------------------------------------------------------------------- /MagicCamera/icons/style_wave.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/style_wave.jpg -------------------------------------------------------------------------------- /MagicCamera/icons/take_photo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/take_photo.png -------------------------------------------------------------------------------- /MagicCamera/icons/toon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/toon.jpg -------------------------------------------------------------------------------- /MagicCamera/icons/vip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/MagicCamera/icons/vip.png -------------------------------------------------------------------------------- /MagicCamera/zh-Hans.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* 2 | InfoPlist.strings 3 | MagicCamera 4 | 5 | Created by William on 2020/12/17. 6 | 7 | */ 8 | 9 | CFBundleDisplayName = "魔法相机"; 10 | -------------------------------------------------------------------------------- /MagicCamera/zh-Hans.lproj/LaunchScreen.strings: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | source 'https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git' 2 | 3 | platform :ios, '13.0' 4 | 5 | target 'MagicCamera' do 6 | pod 'BBMetalImage' 7 | pod 'OpenCV', '3.4.2' 8 | end 9 | -------------------------------------------------------------------------------- /Readme_EN.md: -------------------------------------------------------------------------------- 1 | # Magic Camera 2 | 3 | 4 | [中文版](Readme.md) | **English Version** 5 | 6 | Please download pre-trained models from 7 | [Google Drive](https://drive.google.com/file/d/1T644NT5GnzBlKgQnxL6eEMcTqZShs7dK/view?usp=sharing) 8 | 9 | *The document is still being written, please wait* 10 | -------------------------------------------------------------------------------- /screenshot/image1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/screenshot/image1.jpg -------------------------------------------------------------------------------- /screenshot/image2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/screenshot/image2.jpg -------------------------------------------------------------------------------- /screenshot/image3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/william0wang/MagicCamera/75e8ba2282d2207daf8790f8eeadbb90f4fd1d00/screenshot/image3.jpg --------------------------------------------------------------------------------