2011-12-06 2 views
1

GPU 대신 CPU에서 CoreImage 필터를 실행하고 싶습니다. , 나는 현재하고 있어요CoreImage - CPU에서 필터 실행

NSDictionary * cpuonlycontextOptions = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool: YES],kCIContextUseSoftwareRenderer,nil]; 
CGContextRef cgcontext = [[NSGraphicsContext graphicsContextWithBitmapImageRep:rep] graphicsPort]; 
CIContext * cpu_context = [CIContext contextWithCGContext:cgcontext options: cpuonlycontextOptions]; 

이 필터를 적용하려면 : CI 문서에서, 나는 당신이이 같은 상황에 맞는 뭔가 (see here)를 작성하여 CPU에서 실행되는 필터들 취향을 표현할 수 있다는 것을 발견했습니다 이 :

문제는, 어디서 또는 어떻게 CPU의 유일한 CI 컨텍스트를 설정 볼 수 없습니다. 어떻게 이것이 제대로 이루어 집니까?

답변

0

이 강제로 CPU 렌더링 :

NSDictionary *theCIContextOptions = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], kCIContextUseSoftwareRenderer, NULL]; 

CIContext *theCIContext = [CIContext contextWithOptions:theCIContextOptions ]; 
관련 문제