Я не могу заставить работать новый CIDepthBlurEffect
. Я что-то делаю не так, или это известная проблема?
Ниже мой код в Objective-C:
NSDictionary *dict = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:[NSNumber numberWithBool:YES], [NSNumber numberWithBool:YES], nil] forKeys:[NSArray arrayWithObjects:kCIImageAuxiliaryDisparity, @"kCIImageApplyOrientationProperty", nil]];
CIImage *disparityImage = [CIImage imageWithData:imageData options:dict];
CIFilter *ciDepthBlurEffect = [CIFilter filterWithName:@"CIDepthBlurEffect"];
[ciDepthBlurEffect setDefaults];
[ciDepthBlurEffect setValue:disparityImage forKey:@"inputDisparityImage"];
[ciDepthBlurEffect setValue:originalImage forKey:@"inputImage"];
CIImage *outputImage = [ciDepthBlurEffect valueForKey:@"outputImage"];
EAGLContext *previewEaglContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
CIContext *context = [CIContext contextWithEAGLContext:previewEaglContext options:@{kCIContextWorkingFormat :[NSNumber numberWithInt:kCIFormatRGBAh]} ];
CGImageRef cgimg = [context createCGImage:disparityImage fromRect:[disparityImage extent]];
image = [[UIImage alloc] initWithCGImage:cgimg];
CGImageRelease(cgimg);
outputImage
. то есть это вернет визуализацию карты глубины, а не размытое изображение. - person John Scalo   schedule 29.10.2018