gpt4 book ai didi

iOS - 模糊效果 - GPUImage - processImageWithCompletionHandler

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:39:15 25 4
gpt4 key购买 nike

我使用 GPUImage 来实现模糊效果,并使我的侧边菜单背景模糊(这是 POC 代码):

UIImage *currentScreenShotImage = [Util screenshot];

GPUImageView *blurView = [[GPUImageView alloc] initWithFrame:CGRectMake(0, 0, 320, 568)];
blurView.clipsToBounds = YES;
blurView.layer.contentsGravity = kCAGravityTop;

GPUImageiOSBlurFilter *blurFilter = [[GPUImageiOSBlurFilter alloc] init];
blurFilter.blurRadiusInPixels = 8.0f;

GPUImagePicture *picture = [[GPUImagePicture alloc] initWithImage:currentScreenShotImage];

[picture addTarget:blurFilter];
[blurFilter addTarget:blurView];

[picture processImageWithCompletionHandler:^{
[blurFilter removeAllTargets];
}];

processImageWithCompletionHandler - 实际处理和模糊屏幕截图的方法需要 1 秒(很多!)。

我怎样才能让它更快或者有人有不同于截图的技巧?

最佳答案

关于iOS - 模糊效果 - GPUImage - processImageWithCompletionHandler,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23906358/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com