如何将CIFilter应用于CGImageRef?

时间:2015-05-10 12:46:39

标签: objective-c macos cifilter cgimageref

我尝试将CIFilter应用于CGImageRef,但似乎没有这样做。

CGImageRef image = _image;
CIFilter *filter = [CIFilter filterWithName @"CISephiaTone" keysAndValues:kCIInputImageKey, image, @"inputItensity", @0.8, nil];
CGImageRef outputImage = (__bridge CGImageRef)([filter valueForKey:kCIOutputImageKey]);

有谁知道如何将滤镜应用于图像参考并将输出图像传递给drawRect方法?

我也试过CGImageRef outputImage = [filter outputImage]。但编译器不知道outputImage

0 个答案:

没有答案