| 
					
				 | 
			
			
				@@ -8,6 +8,7 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import AVFoundation 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import Foundation 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import ObjectMapper 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 // import GPUImage 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 public class PQCompositionExporter { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -32,6 +33,9 @@ public class PQCompositionExporter { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     //最后一次显示的 sticker 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     var lastshowSticker:PQEditVisionTrackMaterialsModel? 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    //是否显示高斯 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    var showGaussianBlur:Bool = false 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      init(asset: AVAsset, videoComposition: AVVideoComposition? = nil, audioMix: AVAudioMix? = nil, filters: [ImageProcessingOperation]? = nil,stickers:[PQEditVisionTrackMaterialsModel]? = nil, animationTool: AVVideoCompositionCoreAnimationTool? = nil, exportURL: URL) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         self.asset = asset 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -163,8 +167,32 @@ public class PQCompositionExporter { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             input!.removeAllTargets() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             let currentTarget: ImageSource = input! 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            currentTarget.addTarget(showFitler!, atTargetIndex: 0) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            showFitler?.addTarget(output!, atTargetIndex: 0) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if(currentSticker?.type == StickerType.IMAGE.rawValue && showGaussianBlur){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                //高斯层 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                let json = currentSticker?.toJSONString(prettyPrint: false) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if json == nil { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    BFLog(message: "数据转换有问题 跳转") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                let blurStickerModel: PQEditVisionTrackMaterialsModel? = Mapper<PQEditVisionTrackMaterialsModel>().map(JSONString: json!) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                blurStickerModel?.canvasFillType = stickerContentMode.aspectFillStr.rawValue 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                let showGaussianFitler:PQBaseFilter = PQImageFilter(sticker: blurStickerModel!) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                let iosb:GaussianBlur = GaussianBlur.init() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                iosb.blurRadiusInPixels = 20 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                showGaussianFitler.addTarget(iosb) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                currentTarget.addTarget(showGaussianFitler, atTargetIndex: 0) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                iosb.addTarget(showFitler!) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                showFitler?.addTarget(output!, atTargetIndex: 0) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                currentTarget.addTarget(showFitler!, atTargetIndex: 0) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                showFitler?.addTarget(output!, atTargetIndex: 0) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             lastshowSticker = currentSticker 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   
			 |