我尝试生成 CIGaussianGradient 但我在控制台中得到了休闲输出
012-08-03 16:45:10.423 OGL[2882:303] *** Assertion failure in -[NSBitmapImageRep initWithCIImage:], /SourceCache/AppKit/AppKit-1187/AppKit.subproj/NSBitmapImageRep.m:1531
2012-08-03 16:45:10.425 OGL[2882:303] An uncaught exception was raised
2012-08-03 16:45:10.427 OGL[2882:303] <CIImage: 0x400353620> {
FEPromise: 0x4007106e0 extent: infinite; filter CIGaussianGradient: 0x4001ecde0; kernel gaussianDot; center [150 150] color0 <CGColor 0x40021b6e0> [<CGColorSpace 0x400417ca0> (kCGColorSpaceICCBased; kCGColorSpaceModelRGB; Generic RGB Profile)] ( 1 1 1 0 ) color1 <CGColor 0x400236180> [<CGColorSpace 0x400417ca0> (kCGColorSpaceICCBased; kCGColorSpaceModelRGB; Generic RGB Profile)] ( 0 0 0 1 ) radius_recip 0.00333333
} parameter to -initWithCIImage: is not of finite extent
虽然我的应用代码如下所示:
CIFilter *F = [CIFilter filterWithName:@"CIGaussianGradient"];
[F setDefaults];
[F setValue:[CIColor colorWithRed:1 green:1 blue:1 alpha:0] forKey:@"inputColor0"];
[F setValue:[CIColor colorWithRed:0 green:0 blue:0 alpha:1] forKey:@"inputColor1"];
CIImage *Fimg = [F valueForKey:@"outputImage"];
NSBitmapImageRep *FBitmap = [[NSBitmapImageRep alloc] initWithCIImage:Fimg];
我的错误在哪里?