gpt4 book ai didi

ios - 这种使用调度队列和 CIFilters 的方式可能会导致我的应用程序被拒绝吗?

转载 作者:行者123 更新时间:2023-11-29 02:51:52 25 4
gpt4 key购买 nike

我一整天都在寻找在动画中动态应用单个 CIFilter 的各种方法。

我希望对图像应用强大的 CIPixellation 滤镜,并逐渐以动画形式呈现原始图像,而不使用诸如 alpha 淡入淡出之类的东西,这样就不会产生所需的动画效果。

我查看了 Brad 的 GPUImage,但将 MB 的框架导入到一个非常简单的应用程序中有点让我害怕,尽管它看起来是一个完美的选择。

那么剩下要做的唯一一件事感觉有点老套和欺骗,所以我问;下面的代码可能会让我的应用程序被拒绝吗?如果是,基于什么理由?

干杯。

- (void)pixellateImage:(UIImage *)image fromValue:(int)from toValue:(int)to

{

dispatch_queue_t bgQueue = dispatch_queue_create("bgqueue", NULL);

for (int i = from; i >= to; i--) {

dispatch_async(bgQueue, ^{
CIContext *context = [CIContext contextWithOptions:nil];

CIImage *ciImage = [[CIImage alloc] initWithImage:[UIImage imageNamed:@"c3po"]];

CIFilter *blur = [CIFilter filterWithName:@"CIPixellate"];

[blur setValue:ciImage forKey:kCIInputImageKey];
[blur setValue:[NSNumber numberWithInt:i] forKey:@"inputScale"];

CGImageRef imageRef = [context createCGImage:blur.outputImage fromRect:[blur.outputImage extent]];

UIImage *returnImage = [UIImage imageWithCGImage:imageRef];

CGImageRelease(imageRef);

dispatch_async(dispatch_get_main_queue(), ^{
self.imageView.image = returnImage;
});
});
}

最佳答案

只要您不使用私有(private) API,黑客代码就不会让您被拒绝。

关于ios - 这种使用调度队列和 CIFilters 的方式可能会导致我的应用程序被拒绝吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24391265/

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