我得到這個錯誤BSXPCMessage received error for message: Connection interrupted
顯示出來,只要我爲圖像創建一個我將允許用戶編輯。但是,雖然接受的答案(https://stackoverflow.com/a/26268910/2939977)確實可以消除錯誤消息,但它將CPU使用率激增至不可用的級別,並導致UI變得非常不連貫(一旦kCIContextUseSoftwareRenderer
標誌被設置爲YES
,CPU使用率從50%到大約150%),因爲我的過濾器連接到滑塊並且性能至關重要。CIContext和iOS8中的BSXPCMessage錯誤錯誤
我試過以下apple documentation here創建一個EAGL context
來創建我的CIContext,我將顏色空間設置爲null
。
EAGLContext *myEAGLContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
NSDictionary *options = @{ kCIContextWorkingColorSpace : [NSNull null] };
imageContext = [CIContext contextWithEAGLContext:myEAGLContext options:options];
這創建了沒有錯誤信息的過濾器,性能要好得多!但是,只要用戶使用編輯選項來調整圖像,我會在第一次調整時獲得BSXPCMessage received error for message: Connection interrupted
。我再也看不到錯誤消息,它似乎也沒有影響輸出。
[filter setValue:@(contrast) forKey:@"inputContrast"];
[filter setValue:@(color) forKey:@"inputSaturation"];
CIImage *outputImage = [filter outputImage];
CGImageRef cgimg = [imageContext createCGImage:outputImage fromRect:[outputImage extent]];
UIImage *newImage = [UIImage imageWithCGImage:cgimg scale:1 orientation:UIImageOrientationRight];
transitionImage.image = newImage;
CGImageRelease(cgimg);
如果你想知道使用上的滑塊過濾器時,我也開始因爲更好的性能上GPUImage
卻發現了其他一些問題,當它來到的圖像縮放,導致我刪除它,然後往下走CIFilter
路線。
任何建議或幫助,將不勝感激:)
試試這個,http://stackoverflow.com/a/32578781/3411787 – 2015-09-15 06:05:36