gpt4 book ai didi

ios - 使用 GPUImage 旋转 UIImage 的正确方法

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

我想使用 GPUImage 旋转一个大的 UIImage,因为它比核心图形快得多,至少在 iOS 设备上是这样。

这是我正在做的:

 GPUImagePicture *src = [GPUImagePicture alloc] initWithImage:image];
GPUImageFilter *rotationFilter = [[GPUImageFilter alloc] init];
[rotationFilter setInputRotation:gpuRotationMode atIndex:0];
[src addTarget:rotationFilter];
[src processImage]
[rotationFilter imageFromCurrentlyProcessedOutputWithOrientation:UIImageOrientationUp];

唯一的问题是我在最后得到一条白色像素条(黑色 strip 不是图像的一部分):

gpuimage orientation rotation
(来源:kevinharringtonphoto.com)

我如何去掉那条白色 strip ?

注意:我在旋转滤镜之上使用了其他滤镜。可能与其他过滤器一起使用时出现问题。

最佳答案

问题在于您正在使用的图层之一的大小。太小了。您是否通过图像优化软件传递图像?这也会导致这类问题。

关于ios - 使用 GPUImage 旋转 UIImage 的正确方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16366413/

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