プロジェクトで画像フィルタを追加するためにコア画像フレームワークを使用しました。追加した最初の5つのフィルタは正常に動作していますが、他のフィルタを実装すると画像が消えます。作品は以下のとおりです。 1)CIHueAdjust 2)CIGammaAdjust 3)CIExposureAdjust 4)CIColorMonochrome 5)CISepiaTone 私のために仕事をdidntの他のフィルタCIGloom、CILineOverlayあるとothers.Hereは私code.Plzは私が私を助けていたあります間違っています.....画像にコア画像フィルタを使用する
CIImage *inputImage = [[CIImage alloc] initWithImage:[UIImage imageNamed:@"leaves2.png"]];
CIFilter *Gloom = [CIFilter filterWithName:@"CIGloom"];
[Gloom setDefaults];
[Gloom setValue: inputImage forKey:@"inputImage"];
[Gloom setValue:[NSNumber numberWithFloat: 10.00]
forKey:@"inputRadius"];[Gloom setValue:[NSNumber numberWithFloat: 0.8f]
forKey:@"inputIntensity"];
CIImage *outputImage = [Gloom valueForKey:@"outputImage"];
// define context
CIContext *context = [CIContext contextWithOptions:nil];
// set image to UIImageView
imageView.image = [UIImage imageWithCGImage:
[context createCGImage:outputImage
fromRect:outputImage.extent]];
ボタンをクリックすると画像が表示されますf。
'Gloom'は、2行目に割り当てで有効なポインタを取得していますか? – Caleb
はい。取得します。他のフィルタでも機能します。ただし、特定のフィルタでは表示されません。 –
画像が戻るときはnullです。 –