The main image filter "CIDepthBlurEffect" does not work on iOS 11 / Xcode 9.0

I can’t get a new one CIDepthBlurEffectto work. Am I doing something wrong, or is this a known issue?

Below is my code in 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);
+4
source share
1 answer

This issue was resolved with the release of Xcode 9 beta 2 and iOS 11 beta 2.

0
source

Source: https://habr.com/ru/post/1679412/


All Articles